我是vue.js(2)的新手,我目前正在开发一个简单的事件应用程序.我已设法添加事件但现在我想基于单击按钮删除事件.
HTML
<div class="list-group">
<div class="list-group-item" v-for="event in events">
<h4 class="list-group-item-heading">
{{ event.name }}
</h4>
<h5>
{{ event.date }}
</h5>
<p class="list-group-item-text" v-if="event.description">{{ event.description }}</p>
<button class="btn btn-xs btn-danger" @click="deleteEvent(event)">Delete</button>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JS(Vue公司)
new Vue ({
el: '#app',
data: {
events: [
{
id: 1,
name: 'Event 1',
description: 'Just some lorem ipsum',
date: '2015-09-10'
},
{
id: 2,
name: 'Event 2',
description: 'Just another lorem ipsum',
date: '2015-10-02'
}
],
event: { name: '', description: '', date: '' …Run Code Online (Sandbox Code Playgroud) 在Java中,我有一个文件名字符串.在那里,我想用'_'替换所有非法字符,但不是a-z,0-9和-,.和_
我试过以下代码:但是这没用!
myString = myString.replaceAll("[\\W][^\\.][^-][^_]", "_");
Run Code Online (Sandbox Code Playgroud) 我希望变量中有星期几DOW.
所以我使用以下bash脚本:
DOM=$(date +%d)
DOW=($($DOM % 7) ) | sed 's/^0*//'
Run Code Online (Sandbox Code Playgroud)
但是我收到了消息bash: 09: command not found.我希望结果是变量中的2(9%7 = 2)$DOW.
怎么实现这个?该代码适用于1-8天,但是C-Hex的数量不超过8,并且会显示消息bash: 09: value too great for base (error token is "09").
我必须将ArrayList形成为"普通"阵列文件[].
File[] fSorted = (File[]) x.toArray();
Run Code Online (Sandbox Code Playgroud)
错误: Cast Exception
Exception in thread "Thread-5" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.io.File;
Run Code Online (Sandbox Code Playgroud)
如何将列表x作为File [] -List返回?
-
我的功能:
private File[] sortFiles(File[] files){;
ArrayList<String> allFiles = new ArrayList<String>() ;
for (int index = 0; index < files.length; index++)
{
File afile = new File(files[index].toString());
allFiles.add(afile.getPath().toString());
}
java.util.Collections.sort(allFiles);
ArrayList<File> x = new ArrayList<File>();
for(int i = 0; i< allFiles.size(); ++i){
x.add(new File(allFiles.get(i)));
}
File[] fSorted = (File[]) x.toArray();
return fSorted;
}
Run Code Online (Sandbox Code Playgroud) long freeSize = ((Main.maxSPace-Main.usedSpace)*1000*1000);
maxSpace = 20000
usedSpace = 8
Run Code Online (Sandbox Code Playgroud)
- > freeSize = -1482836480
为什么结果是否定的?
为什么以下代码中的文件日期没有更改?
fLocal.location = C:\中的现有文件
fLocal.date =在Long中设置的日期
boolean x = new File(fLocal.location).setLastModified(Long.parseLong(fLocal.date));
System.out.println("Changed: " + x);
System.out.println(new Date(new File(fLocal.location).lastModified()));
System.out.println(new Date(Long.parseLong(fLocal.date)));
Run Code Online (Sandbox Code Playgroud)
输出:
Changed: false
Fri Feb 15 23:02:51 CET 2013
Fri Feb 15 22:49:34 CET 2013
Run Code Online (Sandbox Code Playgroud) 如何格式化list-index使用css 的背景?
<ol style="list-style-type:decimal">
<li>Tagesordnung</li>
<li>Pause</li>
<li>Vorbesprechung</li>
<li>Mittagessen</li>
<li>Vortrag zum Thema "Komme nie zu früh zur Sache!"</li>
<li>Pause</li>
<li>Gemütlicher Ausklang</li>
</ol>
Run Code Online (Sandbox Code Playgroud) 我想开始我的程序
start %USERPROFILE%\.myProgramm\myProgramm.exe
Run Code Online (Sandbox Code Playgroud)
但现在我收到一条弹出消息,找不到文件夹C:\ Documets.这是由于缺少像这样的大肆造成的start '%USERPROFILE%\.myProgramm\myProgramm.exe'.这该怎么做??
我正在尝试在树莓派上的 kubernetes 集群上运行 gitlab-runner。
gitlab 管道生成以下输出:
Running with gitlab-runner 10.4.0 (857480b6) on hello-world-gitlab-runner-6548-tq4mr (123)
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image arm32v7/node ...
Waiting for pod gitlab/runner-123-project-456-concurrent-789 to be running, status is Pending
Waiting for pod gitlab/runner-123-project-456-concurrent-789 to be running, status is Pending
Waiting for pod gitlab/runner-123-project-456-concurrent-789 to be running, status is Pending
ERROR: Job failed (system failure): unable to upgrade connection: container not found ("helper")
Run Code Online (Sandbox Code Playgroud)
gitlab-runner pod 记录以下输出:
+ cp /scripts/config.toml /etc/gitlab-runner/
+ /entrypoint register --non-interactive --executor …Run Code Online (Sandbox Code Playgroud) java ×4
file ×2
arm ×1
arraylist ×1
arrays ×1
bash ×1
batch-file ×1
cmd ×1
css ×1
date ×1
gitlab ×1
html ×1
html-lists ×1
javascript ×1
kubernetes ×1
long-integer ×1
raspberry-pi ×1
regex ×1
replace ×1
sed ×1
vuejs2 ×1
windows ×1