我想创建一个函数,在函数被调用的时候,顶部的第一个li将是最后一个,所以第一个例子看起来像这样
<ul>
<li id="2">
<li id="3">
<li id="4">
<li id="5">
<li id="6">
<li id="7">
<li id="1">
</ul>
Run Code Online (Sandbox Code Playgroud)
谢谢
我说的是Eclipse(3.5 = Galileo),在Kubuntu 9.10下运行,我有Subversive插件.
我已经从Gnome-Ubuntu转移到Kubuntu了,另一个副作用是现在有些字体太小而无法阅读.
资源管理器中的文件名大小合适,但文件夹以太小的字体显示,调整后General|Appearance|Colors and Fonts
文件夹中的所有字体都保持不变.
也许我只是瞎了.如果有人能指出我可以在Package Explorer中调整文件夹字体的位置,我会很感激
我正在考虑自我托管我的WCF服务,而不是使用IIS.对我来说一个很大的问题是我是否需要像IIS那样实例化多个服务主机,或者一个就足够了.
除了安全原因,除了隔离外,多个服务主机是否会提供任何好处?
一个servicehost可以同时在一个端点上提供多个连接吗?
我试图找出为什么下面的代码似乎不起作用.它没有给出错误 - 它根本不会缩放.如果我将其更改为我的第二个代码示例,它实际上似乎有效.有人有任何想法吗?
谢谢
public static void StartMouseEnterAnimation(Button button)
{
Storyboard storyboard = new Storyboard();
ScaleTransform scale = new ScaleTransform(1.0, 1.0, 1, 1);
button.RenderTransformOrigin = new Point(0.5, 0.5);
button.RenderTransform = scale;
DoubleAnimation growAnimation = new DoubleAnimation();
growAnimation.Duration = TimeSpan.FromMilliseconds(300);
growAnimation.From = 1;
growAnimation.To = 1.8;
storyboard.Children.Add(growAnimation);
Storyboard.SetTargetProperty(growAnimation, new PropertyPath(ScaleTransform.ScaleXProperty));
Storyboard.SetTarget(growAnimation, scale);
storyboard.Begin();
}
Run Code Online (Sandbox Code Playgroud)
---下面的DOES工作,但我必须创建一个TransformGroup并通过一个更复杂的PropertyChain引用它...
public static void StartMouseEnterAnimation(Button button)
{
Storyboard storyboard = new Storyboard();
ScaleTransform scale = new ScaleTransform(1.0, 1.0, 1, 1);
button.RenderTransformOrigin = new Point(0.5, 0.5);
TransformGroup myTransGroup …
Run Code Online (Sandbox Code Playgroud) 我的配置文件
project/WEB-INF/web.xml:
<resource-ref>
<description>ConnectionPool DataSource Reference</description>
<res-ref-name>jdbc/mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Run Code Online (Sandbox Code Playgroud)
项目/ WEB-INF /码头-env.xml:
<New id="mysql" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/mysql</Arg>
<Arg>
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">com.mysql.jdbc.Driver</Set>
<Set name="url">jdbc:mysql://localhost:3306/db</Set>
<Set name="username">user</Set>
<Set name="password">pwd</Set>
<Set name="maxActive">50</Set>
</New>
</Arg>
</New>
Run Code Online (Sandbox Code Playgroud)
ctx = new InitialContext();
ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mysql");
con=ds.getConnection();
Run Code Online (Sandbox Code Playgroud)
脚本启动jetty:
java -DOPTIONS=plus -jar start.jar
java -jar start.jar
Run Code Online (Sandbox Code Playgroud)
无论哪种方式开始码头,我都有以下错误:
javax.naming.NameNotFoundException; remaining name 'env/jdbc/mysql'
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:632)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:663)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:678)
at org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:110)
at javax.naming.InitialContext.lookup(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
问题是:
谢谢!
我正在使用ArrayList<String>
并在特定索引处添加数据,如何检查特定索引是否存在?
我应该简单地get()
检查价值吗?或者我应该等待例外?还有另外一种方法吗?
谢谢你的答案,但因为我只是在特定索引处添加内容,列表的长度不会显示哪些是可用的.
我有一个数据et,喜欢while
用Perl脚本做一个简单的操作.以下是数据集中的一个小提取:
"number","code","country","gamma","X1","X2","X3","X4","X5","X6"1,"DZA","Algeria"," 0.01",7.44,47.3,0.46,0,0,0.13 2,"AGO","安哥拉","0.00",6.79,"空",0.21,1,0,0.28 3,"BEN","贝宁" ," - 0.01",7.02,38.9,0.27,1,0,0.05 4,"BWA","博茨瓦纳","0.06",6.28,45.7,0.42,1,0,0.07 5,"HVO","布基纳Faso","0.00",6.15,36.3,0.08,1,0,0.05 6,"BDI","布隆迪","0.00",6.38,41.8,0.18,1,0,0
脚本应计算每个,
分隔字段的长度,并将最高值存储到数组中.
但是,保存无法正常工作.这是代码的一部分:
@maxl = map length, @terms;
while(`<INFILE>`) {
$_ =~ s/[\"\n]//g ;
@terms = split/$sep/, $_;
@lengths = map length, @terms;
for($k = 0, $k <= $#terms, $k++) {
if($lengths[$k] > $maxl[$k]) {
$maxl[$k] = $lenghts[$k];
}
}
print "@lengths\n";
}
Run Code Online (Sandbox Code Playgroud)
现在@maxl
使用代码中的早期部分,它使用数据集的第二行.当我使用print
命令只是为了看到@maxl
我得到的操作的值:
1 3 7 4 4 4 4 1 1 5
在while
循环中我使用另一个print
语句来查看其他值,我得到:
1 …
Run Code Online (Sandbox Code Playgroud) 我用下面的脚本解析一个文本文件.
如何将数组数据插入MySQL表?
我已经学习了Perl MySQL DBI连接方法.我可以成功连接到本地MySQL数据库.我可以使用MySQL命令行创建表.
#!C:\Perl\bin\perl.exe
use strict;
use warnings;
while ( <DATA> ) {
my @rocks = split(/\s+/, $_);
foreach my $rock (@rocks) {
$rock = "\t$rock "; # put a tab in front of each element of @rocks
$rock .= "\n"; # put a newline on the end of each
print $rock ;
}
}
__DATA__
A B C D
E F G H
Run Code Online (Sandbox Code Playgroud)
我想要表浏览结果.
Item1 Item2 Itme3 Item4 A B C D E F G …
您可能知道,浏览器的安全模型不允许从http://www.example.com页面加载的脚本发出跨域请求(除了www.example.com之外的任何其他域都没有AJAX调用).Javascript文件本身可能是从一个不同的域(www.javascript.com/myscript.js)提供的,这是无关紧要的.这是同源政策.
Flash也有类似的东西吗?但Flash是否将原点视为加载 .swf文件的HTML页面,或者源是为.swf文件提供服务的域?
因此http://www.example.com从http://www.swf.com/myflash.swf加载.swf文件.现在.swf只能从www.example.com或www.swf.com加载资源?我假设在example.com或swf.com上没有设置跨域文件.