我可以通过ZipInputStream,但在开始迭代之前,我想获得迭代期间需要的特定文件.我怎样才能做到这一点?
ZipInputStream zin = new ZipInputStream(myInputStream)
while ((entry = zin.getNextEntry()) != null)
{
println entry.getName()
}
Run Code Online (Sandbox Code Playgroud) 安装模块后 socket.io
npm install socket.io --save
Run Code Online (Sandbox Code Playgroud)
我有以下错误:
错误TS2307:找不到模块'socket.io-client'
进口
import * as io from 'socket.io-client';
Run Code Online (Sandbox Code Playgroud)
systemjs.config.js
var map = {
'socket.io-client': 'node_modules/socket.io-client/socket.io.js'
}
var packages = {
'socket.io-client': { main: 'socket.io', format: 'cjs', defaultExtension: 'js' }
}
Run Code Online (Sandbox Code Playgroud)
的package.json
"dependencies": {
"socket.io": "^1.4.8"
}
Run Code Online (Sandbox Code Playgroud)
typings.d.ts
/// <reference path="../socket.io-client/socket.io.js" />
declare module 'socket.io-client' {
var e: any;
export = e;
}
Run Code Online (Sandbox Code Playgroud)
socket.io-client(目录)
- socket.io.js
- typings.d.ts
Angular 2 RC5
当我的代码只有一次出现时:
def result = "Text 1,1"
def matches = (result =~ /^.+\s([0-9],[0-9])$/ ).with { m -> m.matches() ? result.replace(/${m[ 0 ][ 1 ]}/, 'X'+m[ 0 ][ 1 ]+'X') : result }
assert "Text X,X" == matches
Run Code Online (Sandbox Code Playgroud)
如果我的String包含多次出现,我该怎么办?
def result = "aaaa Text 1,1 Text 2,2 ssss"
Run Code Online (Sandbox Code Playgroud)
谢谢
当我尝试在gsp视图中使用日期格式标记来更改我的日期格式但它不起作用.
这是我的代码:
class MyDate {
Date date
}
Run Code Online (Sandbox Code Playgroud)
MyDateController:
....
def unixSeconds = params["date"].replaceAll("\"", "") as long //params["date"]="1386157660"
Date date = new Date(unixSeconds*1000L)
myDateInstance = new MyDate(date:date)
....
Run Code Online (Sandbox Code Playgroud)
gsp查看:
${myDateInstance.date.format('yyyy-MM-dd HH:mm')}
Run Code Online (Sandbox Code Playgroud)
我的格式是2013-12-04 12:47:40.0而不是2013-12-04 12:47
如何从数组数组中获取列表?
我有一个列表列表,如:[[1,2,3],[1,2,3],[1,2,3]].
我想要一个List,其中包含我列表中的所有第一个元素.
例如,在我的例子中,我想要一个list = [1,1,1].
我正在尝试使用Jenkins Pipeline脚本将一些二进制文件上传到Artifactory.我使用了Artifactory 文档中的相同示例,但它不起作用.我有以下错误:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.lang.String.upload() is applicable for argument types: (java.lang.String) values: [{
"files": [
....
Run Code Online (Sandbox Code Playgroud)
还有另一个类似的问题,但没有回应......
pipeline {
agent any
environment {
def server = Artifactory.server 'art-1'
def uploadSpec = """{
"files": [
{
"pattern": "path/",
"target": "path/"
}
]
}"""
}
stages {
stage('upload') {
steps {
script { server.upload(uploadSpec) }
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
Artifactory 5.4.6
groovy ×5
angular ×1
arrays ×1
artifactory ×1
date ×1
file-io ×1
grails ×1
inputstream ×1
java ×1
jenkins ×1
list ×1
regex ×1
sockets ×1
typescript ×1