如何检查在ArrayList中是否存在扫描仪中写入的值?
List<CurrentAccount> lista = new ArrayList<CurrentAccount>();
CurrentAccount conta1 = new CurrentAccount("Alberto Carlos", 1052);
CurrentAccount conta2 = new CurrentAccount("Pedro Fonseca", 30);
CurrentAccount conta3 = new CurrentAccount("Ricardo Vitor", 1534);
CurrentAccount conta4 = new CurrentAccount("João Lopes", 3135);
lista.add(conta1);
lista.add(conta2);
lista.add(conta3);
lista.add(conta4);
Collections.sort(lista);
System.out.printf("Bank Accounts:" + "%n");
Iterator<CurrentAccount> itr = lista.iterator();
while (itr.hasNext()) {
CurrentAccount element = itr.next();
System.out.printf(element + " " + "%n");
}
System.out.println();
Run Code Online (Sandbox Code Playgroud) 为什么日期转换到错误的时间?
result=$(ls /path/to/file/File.*)
#/path/to/file/File.1361234760790
currentIndexTime=${result##*.}
echo "$currentIndexTime"
#1361234760790
date -d@"$currentIndexTime"
#Tue 24 Oct 45105 10:53:10 PM GMT
Run Code Online (Sandbox Code Playgroud) 我有以下bash代码,它循环遍历文本文件,逐行..我试图将工作'前缀'作为前缀添加到每一行,但我得到此错误:
rob@laptop:~/Desktop$ ./appendToFile.sh stusers.txt kp
stusers.txt
kp
./appendToFile.sh: line 11: /bin/sed: Argument list too long
115000_210org@house.com,passw0rd
Run Code Online (Sandbox Code Playgroud)
这是bash脚本..
#!/bin/bash
file=$1
string=$2
echo "$file"
echo "$string"
for line in `cat $file`
do
sed -e 's/^/prefix/' $line
echo "$line"
done < $file
Run Code Online (Sandbox Code Playgroud)
我在这做错了什么?
更新:执行head on file将所有行转储到终端的一行,可能是相关的?
rob@laptop:~/Desktop$ head stusers.txt
rob@laptop:~/Desktop$ ouse.com,passw0rd
Run Code Online (Sandbox Code Playgroud) 我想重新存根someHandler.getStatus,但我得到了TypeError: Attempted to wrap getStatus which is already wrapped......
it('is a test', function() {
sandbox.stub(someHandler, 'getStatus', function(callback) {
callback(null, {
value: 1
});
});
sandbox.stub(someOtherHandler, 'doSomething', function(callback) {
callback(null);
});
sandbox.stub(someHandler, 'getStatus', function(callback) {
callback(null, {
value: 0
});
});
});
Run Code Online (Sandbox Code Playgroud) 为什么导航按钮不可见?
我正在使用jQuery和owlcarousel(http://owlgraphic.com/owlcarousel/).
http://jsfiddle.net/bobbyrne01/s10bgckL/1/

html ..
<div id="owl-demo">
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
<div class="item">
<img src="http://placehold.it/50x50" alt="Owl Image" />
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
js .. …
为什么当我手动更改阵列的阿尔法值,被传递到着色器,结果是两者的相同0.0f和1.0f?
我期望根据alpha值绘制具有某种透明度的对象.
我没有使用任何纹理.我总是看到我的红色物体在黑色背景下.
glsl从java.. 访问变量
float[] color = {1.0f, 0.0f, 0.0f, 1.0f};
gl2.glGetUniformLocation(shaderProgram, "vColor");
gl2.glUniform4fv(mColorHandle, 1, color, 0);
Run Code Online (Sandbox Code Playgroud)
glsl片段着色器..
#version 120
uniform vec4 vColor;
void main() {
gl_FragColor = vColor;
gl_FragColor.a = 0.0; // does not make object transparent
// gl_FragColor.a = 1.0; // does not make object transparent
}
Run Code Online (Sandbox Code Playgroud) 我的测试是从命令行传递的,但是我typescript使用Atom.
当我在编辑器中打开其中一个测试文件时,我在这一行看到一个错误:
expect(pageObject.name.getText()).toEqual('Some name');
Run Code Online (Sandbox Code Playgroud)
这是错误:
Typescript
Error
Argument of type '"Some name"' is not assignable to parameter of type 'Expected<Promise<string>>'.at line 16 col 50
Run Code Online (Sandbox Code Playgroud)
为什么这会显示在我的编辑器中?然而测试通过了。
运行量角器测试的命令:
protractor dist/protractor.config.js
Run Code Online (Sandbox Code Playgroud)
片段来自 package.json
"dependencies": {
"typescript": "2.3.3"
},
"devDependencies": {
"@types/jasmine": "2.5.45",
"@types/node": "^7.0.13",
"jasmine-core": "^2.6.0",
"jasmine-spec-reporter": "^4.1.0",
"protractor": "^5.1.2"
}
Run Code Online (Sandbox Code Playgroud)
tsconfig.fvt.test.json
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"noUnusedLocals": true,
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedParameters": true,
"outDir": "dist",
"skipLibCheck": true,
"target": "ES5",
"lib": [ …Run Code Online (Sandbox Code Playgroud) 项目内容:
rob@work:~/git/proj $ ls
lib node_modules props.json start.sh
app.js Dockerfile package.json README.md
Run Code Online (Sandbox Code Playgroud)
start.sh ..
rob@work:~/git/proj $ cat start.sh
#/bin/bash
# do things
/some/other/stuff
echo "Starting app .."
node app.js
Run Code Online (Sandbox Code Playgroud)
Dockerfile ..
FROM somewhere.com/dependencyProj
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
COPY props.json /etc/someService.d/props.json
EXPOSE 4101
ENTRYPOINT ["/start.sh"]
Run Code Online (Sandbox Code Playgroud)
构建泊坞窗图像:
rob@work:~/git/proj $ docker build -t dx/proj:0.0.1 .
Sending build context to Docker daemon 59.99 MB
Step 1 : FROM somewhere.com/dependencyProj
latest: Pulling from dependencyProj
420890c9e918: Already exists
8ff1af46fe3d: Already exists …Run Code Online (Sandbox Code Playgroud) 我试图决定为什么我应该TSLint在我的Typescript2/ Angular2项目中使用.
暴露的规则列表TSLint:https://palantir.github.io/tslint/rules/
可用的编译器选项TypeScript:https://www.typescriptlang.org/docs/handbook/compiler-options.html
从Typescript2现在开始有一些编译器选项--noUnusedParameters,是否真的需要TSLint?是TSLint编译器选项的超集吗?
项目结构:
.
??? bower.json
??? index.js
??? package.json
??? src
? ??? app
? ? ??? app.component.spec.ts
? ? ??? app.component.ts
? ? ??? app.module.ts
? ??? index.html
? ??? main.ts
? ??? tsconfig.json
??? tslint.js
??? webpack.common.js
??? webpack.dev.config.js
Run Code Online (Sandbox Code Playgroud) 如何设置myOtherKey属性any?
打字稿错误..
Object literal's property 'children' implicitly has an 'any[]' type
Run Code Online (Sandbox Code Playgroud)
对象初始化..
let myObject = {
myKey: 'someValue',
myOtherKey: []
};
Run Code Online (Sandbox Code Playgroud) typescript ×3
bash ×2
arraylist ×1
arrays ×1
contains ×1
css ×1
date ×1
docker ×1
dockerfile ×1
epoch ×1
glsl ×1
html ×1
jasmine ×1
java ×1
javascript ×1
jquery ×1
lint ×1
linux ×1
opengl ×1
owl-carousel ×1
protractor ×1
sed ×1
sinon ×1
stub ×1
unit-testing ×1