我创建了两个网页,一个包含iframe中的另一个网页.我想通过javascript从父页面滚动嵌入页面.
到目前为止我尝试了什么:
$('#go').scrollTop(200);
$('.footer').scrollTop(200);
var frame = document.getElementById('go');
frame.contentWindow.scrollTo(0, 200);
这些都没有奏效
父网页html:
<html>
<body>
.
.
.
<div class="footer">
<iframe id="go" src="go.html"></iframe>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这两个网页都是计算机上的本地文件,我使用的是带有"--allow-file-access-from-files"标志的Google Chrome.
如何将iframe滚动到某个位置?
我试图自动化构建应用程序,运行单元测试,最后运行UI测试的过程.
我正在某些目录中通过命令行(xcodebuild -sdk iphonesimulator6.0)构建应用程序.
如何通过命令行(在〜/ Library/Application Support/iPhone模拟器//应用程序中)将此应用程序安装到iOS模拟器?
我试过了:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication MyApp.app/MyApp
Run Code Online (Sandbox Code Playgroud)
但这会打开一个名为"iOS模拟器无法找到要模拟的应用程序"的新查找器窗口.
我有一个像这样的excel表(csv):
我希望输出(制表符分隔)是这样的:
基本上:
我正在努力创造一个可以做到这一点的公式.如果我尝试"删除重复项",它会删除该值并将值向上移动一行.我希望它删除重复项但不会将值向上移动.
对于下面的代码,当"n"大约为100,000时,它会停止运行.我需要它运行到100万.我不知道它出了什么问题,我还在学习Java,所以代码中也可能存在简单的错误.
public class Problem14{
public static void main(String[] args) {
int chainLength;
int longestChain = 0;
int startingNumber = 0;
for(int n =2; n<=1000000; n++)
{
chainLength = getChain(n);
if(chainLength > longestChain)
{
System.out.println("chainLength: "+chainLength+" start: "+n);
longestChain = chainLength;
startingNumber = n;
}
}
System.out.println("longest:"+longestChain +" "+"start:"+startingNumber);
}
public static int getChain(int y)
{
int count = 0;
while(y != 1)
{
if((y%2) == 0)
{
y = y/2;
}
else{
y = (3*y) + 1;
}
count = …
Run Code Online (Sandbox Code Playgroud) 我相信我之前已经运行了这个,但是对于我的生活,我无法在perlrun或Google中找到任何参考.希望这里的一些perl boffins能够回答它.使用-ne开关运行perl one衬管时.是否有选项可以将perl编译的代码输出到控制台?
所以如果我跑:
crontab -l | perl -ne 'print if /^00/'
Run Code Online (Sandbox Code Playgroud)
然后Perl会将其编译为:
while(<>){
print if /^00/;
}
Run Code Online (Sandbox Code Playgroud)
我确信有一种方法可以让perl吐出它将要使用的代码,包括任何开始或结束块.希望有人知道如何.
我正在通过终端在OS X上学习Java.当我编译下面的代码时,我没有得到任何错误但是当我尝试运行它时,我得到了
线程"main"中的异常java.lang.NoSuchMethodError:main
我的代码:
public class Problem5{
public void main(String[] args) {
int n = 1;
while(!checkMod(n)){
n++;
}
}
public boolean checkMod(int in)
{
int count = 0;
for(int i=1; i<20; i++)
{
if(in%i == 0)
{
count = count + 1;
}
}
if(count ==19)
{
return true;
}
else{
return false;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我从main方法中删除了"static",因为我调用了checkMod方法.
我该如何正确编码?
谢谢
java ×2
command-line ×1
excel ×1
excel-2010 ×1
javascript ×1
jquery ×1
macos ×1
perl ×1
perl-module ×1
shell ×1