/*
* $Id: AHref.java,v 1.5 2005/05/09 11:52:44 blowagie Exp $
* $Name: $
*
* This code is part of the 'iText Tutorial'.
* You can find the complete tutorial at the following address:
* http://itextdocs.lowagie.com/tutorial/
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* itext-questions@lists.sourceforge.net
*/
package com.lowagie.examples.objects.anchors;
import java.awt.Color;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Anchor;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.FontFactory;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.HtmlWriter;
import com.lowagie.text.pdf.PdfWriter;
/**
* Demonstrates how the Anchor object works.
*
* @author blowagie
*/
public class AHref {
/**
* Demonstrates some Anchor functionality.
*
* @param args no arguments needed here
*/
public static void main(String[] args) {
System.out.println("the Anchor object");
// step 1: creation of a document-object
Document document = new Document();
try {
// step 2:
PdfWriter.getInstance(document, new FileOutputStream("AHref.pdf"));
HtmlWriter.getInstance(document, new FileOutputStream("AHref.html"));
// step 3: we open the document
document.open();
// step 4:
Paragraph paragraph = new Paragraph("Please visit my ");
Anchor anchor1 = new Anchor("website (external reference)", FontFactory.getFont(FontFactory.HELVETICA, 12, Font.UNDERLINE, new Color(0, 0, 255)));
anchor1.setReference("http://www.lowagie.com/iText/");
anchor1.setName("top");
paragraph.add(anchor1);
paragraph.add(new Chunk("./n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n"));
document.add(paragraph);
Anchor anchor2 = new Anchor("please jump to a local destination", FontFactory.getFont(FontFactory.HELVETICA, 12, Font.NORMAL, new Color(0, 0, 255)));
anchor2.setReference("#top");
document.add(anchor2);
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
}
}
相关推荐
退火朗之万动力学采样
退火朗之万动力学采样(Simulated Annealing Langevin Dynamics Sampling)结合了退火技术和朗之万动力学,是一种用于分子模拟和统计物理中的计算方法。这种方法可以帮助系统从局部最小值中逃逸,以找到全局最小值或进行有效的配置空间探索。
Thymeleaf中href与 th:href的区别,th:href怎么带参数
1. Thymeleaf中href与 th:href的区别: 转自:https://www.cnblogs.com/q924152020/p/10602807.html 语法格式如下: <a th:href="@{/channel/page/add}">添加渠道 </a> <a href="/channel/page/add">添加渠道 </a>...
别再到处找模板了!手把手教你用Vue3+Element Plus搭建一个‘能跑起来’的管理后台原型
本文详细介绍了如何利用Vue3和Element Plus在72小时内快速搭建一个功能完整的管理后台原型。从环境准备到项目获取、依赖安装、原型定制、数据模拟以及构建优化,手把手教你打造一个可直接演示的后台系统,特别适合创业者快速验证产品逻辑。
浅谈src与href的区别
src 和 href 都是用来引入外部资源的属性,例如:图片、视频、CSS 文件、JavaScript 文件等。 那么它们两者之间究竟有什么样的区别呢?
Android 面试题 Handler篇
1.Handler的实现原理。
具身智能:原理、算法与系统 第16章 运动控制基础
实时迭代(Real-Time Iteration, RTI)策略在每个采样时刻执行有限次迭代(通常一次),利用相邻时刻解的连续性,在严格时间限制内获得可行解。比例-积分-微分(Proportional-Integral-Derivative, PID)控制是工业界最广泛应用的控制策略,其原理基于误差的当前值(比例)、累积值(积分)与变化率(微分)的线性组合。力-位置混合控制(Hybrid Force/Position Control)将任务空间分解为力控制子空间与位置控制子空间,分别控制。
php 中 href,html中href什么意思
HTML中的href指的是超文本引用,它的值是任何有效文档的相对或绝对URL,包括标识符或js代码段,一般用于a标签中来指定超链接跳转目标url。对于a标签,大家都不陌生它最重要的功能是实现超链接和锚点的,而href是a标签中的一个重要属性,接下来将在文章中为大家详细介绍href是什么意思,具有一定的参考价值,希望对大家有所帮助。【推荐课程:HTML教程】href属性href指的是超文本引用,它的...
【数据结构】考点二十八 : 二叉树的概念:二叉树的度、完全二叉树、满二叉数结点数、哈夫曼结点数、完全二叉树的深度
二叉树(Binary Tree)是一种常见的数据结构,它或者为空(null),或者由一个根节点(root node)和两个子树(left subtree 和 right subtree)组成,这两个子树又分别是一棵二叉树。二叉树的每个节点最多有两个子节点,通常称为左子节点(left child)和右子节点(right child)。
vue的:href和href
不要使用vue.min.js,要用vue.js,可以显示报错信息。 代码段 <ol class="breadcrumb"> <li><a href="shopkeeper_category_list">所有分类</a></li> <li><a :href="'shopkeeper_product_list?cid='+category.id">{{category.nam
Web渗/透/攻/击实战(1)—成功渗/透台湾某净化设备公司官网
写在前面 作为一个防御型白帽黑客 你一定要知道黑客的进攻套路 才能有相应的防御措施 声明:只做测试,发现对方的漏洞,并不进行破坏性操作 1、 网站分析 地址:http://www.xxx.com.tw/ 这是一家中国台湾地区的网站,看着满屏的繁体字,就不是很舒服 网站首页包括:关于我们、资料下载、联络方式等等。 这些对我们进行sql注入用处并不大 我们需要的是可以进行参数传入的页面,这样我们就可以在参数里做文章 找一下 有没有新闻列表相关的页面 页...
1、电路分析知识全解析:从基础到实践应用
本博客全面解析电路分析知识体系,涵盖从基础的电压、电流、电阻概念到复杂的交流电路、瞬态分析和高级应用如滤波器与变压器等内容。适合电子技术专业学生和技术爱好者学习,提供详细的知识结构、学习路径、实践示例以及丰富的学习资源,包括计算机模拟工具Multisim和PSpice的使用指导。通过理论与实践结合,帮助学习者掌握电路分析的核心技能,为电子工程和电力系统等相关领域打下坚实基础。
a href="javascript"作用
今天在完成一个验证码刷新案例的时候,碰到一些问题 需求是:点击超链接,验证码的图片随机更换 完成此操作,需要用到a标签的 < a href = “javascript:;”>相关知识 1. a href = “javascript:;” 含义 是为了让超链接去执行js函数,点击此超链接时,页面不会进行任何操作,防止跳到其他页面 点击后,页面不动,只打开连接 其中javascript...
外设测试 - ATAES132A 加解密芯片测试
原理 使用芯片官方提供的读写操作库,进行先写后读并校验,确认数据一致。 示例代码 int main(void) { uint8_t ret; aes132p_enable_interface(); ret = write_memory_test(); if (ret != AES132_FUNCTION_RETCODE_SUCCESS) { aes132p_disable_interface(); printf
关于js中window.location.href,location.href,parent.location.href,top.location.href的用法
关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法 "window.location.href"、"location.href"是本页面跳转 "parent.location.href"是上一层页面跳转 "top.locat
迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)
迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
关于js中"window.location.href"、"location.href"重定向
关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法 "window.location.href"、"location.href"是本页面跳转 "parent.location.href"是上一层页面跳转 "top.location.href"是最外层的页
RU DOS版、EFI版32bit/64bit BIOS常用工具
DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。
js中location.href,parent.location.href,top.location.href的用法
window.location.href、location.href是本页面跳转 parent.location.href是上一层页面跳转 top.location.href是最外层的页面跳转 举例说明: 如果A,B,C,D都是html,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这写 window.location.href、location.href:D页面跳转 parent.location.href:C页面跳转 top.location.href:A页面跳转
文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况
主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。
location.href
一、location.href常见的几种形式 目前在开发中经常要用到的几种形式有: 1 2 3 4 5 6 self.location.href;//当前页面打开URL页面 window.location.href;//当前页面打开URL页面 this.location.href;//当前页面打开URL页面 ...
关于js中window location href location href parent location href
关于js中window location href location href parent location href
通过href调用javascript
通过HREF就可以调用javascript,有两种方法十分简单,如下: 方法1 Click here for Javascript action! 注:如果Javascript被浏览器禁用,会有一个错误提示警告读者无法运行Javascript程序。 方法2 onClick="myFunction(); return false"> Click here for Javascr
js中top.location.href、parent.location.href用法
window.location.href、location.href是本页面跳转parent.location.href是上一层页面跳转top.location.href是最外层的页面跳转举例说明:window.location.href、location.href:例:window.location.href= 'wapsend1.asp?zimu=A&rev= ' + form1.rev
js中window.location.href,location.href,parent.location.href,top.location.href的用法
"window.location.href"、"location.href"是本页面跳转 "parent.location.href"是上一层页面跳转 "top.location.href"是最外层的页面跳转 举例说明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写 "window....
top.location.href和localtion.href有什么不同
top.location.href=”url” 在顶层页面打开url(跳出框架) self.location.href=”url” 仅在本页面打开url地址 parent.location.href=”url” 在父窗口打开Url地址 this.location.href=”url” 用法和self的用法一致 ...
a标签的href属性
a标签的href属性1)href属性的定义href属性链接目标地址,如果未使用href属性,则< a >标签不是超链接,而是占位符。2)href=”url” 作用 绝对url - 指向另一个站点(href=”http://www.baidu.com”) 相对url - 指向站点内的某个文件(href=”index.html”) 锚url - 指向页面中的锚(href=”#top”) 3)href常见
剖析src和href
前言 src和href都是用于外部资源的引入,像图片、CSS文件、HTML文件、js文件或其他web页面等。那么在SRC和HREF之间是否有一个明确的区别呢?在哪些地方或者什么时候应该用SRC还是HREF?我想它们的使用并不是可以随意替换的。我先给出几个这两个属性的使用例子: 引用css文件时:href="cssfile.css" 引用js文件时:src="myscript.j...
1949



被折叠的 条评论
为什么被折叠?



