我有Set<String> result
&想要将其转换为逗号分隔的字符串.我的方法如下所示,但也在寻找其他意见.
List<String> slist = new ArrayList<String> (result);
StringBuilder rString = new StringBuilder();
Separator sep = new Separator(", ");
//String sep = ", ";
for (String each : slist) {
rString.append(sep).append(each);
}
return rString;
Run Code Online (Sandbox Code Playgroud) 我正在尝试调试此问题,但不确定我需要在哪里替换 Eclipse的SWT jar文件.
当前系统配置:
Eclipse Helios 3.6 - 32 Bit
JDK 1.6
JVM - 32 Bit
Windows 7 - 64 Bit
Run Code Online (Sandbox Code Playgroud)
错误信息:
java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:687)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at de.vogella.rcp.intro.first.Application.start(Application.java:18)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
An error has occurred. See …
Run Code Online (Sandbox Code Playgroud) 我的目标:
我想以.png格式提取与主机相关的图形.我的GOOGLE研究表明,我们没有Zabbix API来完成这项任务.因此很少有博客建议使用Chart2.php和CURL.有人可以解释一下如何去做(详细步骤)?
注意:对不起从未在php上工作过,也从未在curl上工作
我试过的时候
curl https://example.com/zabbix/chart2.php?graphid=1552&width=300&height=300
Run Code Online (Sandbox Code Playgroud)
得到了这个,但链接不起作用
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="/zabbix/openid?graphid=1552&modauthopenid.referrer=https%3A%2F%2Fexample.com%2Fzabbix%2Fchart2.php%3Fgraphid%3D1552">here</a>.</p>
<hr>
<address>Apache/2.2.3 (Red Hat) Server at example.com Port 80</address>
</body></html>
Run Code Online (Sandbox Code Playgroud)
我怎样才能将这个与我的zabbix api(JAVA)电话合并?
试图在Windows 7(64位)上安装VS2010Pro,我也检查了相同的所有系统要求.
错误:
查看错误日志:
[05/15/12,10:48:22] Microsoft Visual Studio 2010 64bit Prerequisites (x64): [2] Error: Installation failed for component Microsoft Visual Studio 2010 64bit Prerequisites (x64). MSI returned error code 1603
[05/15/12,10:48:22] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2010 64bit Prerequisites (x64) is not installed.
[05/15/12,10:48:22] VS70pgui: [2] DepCheck indicates Microsoft Visual F# 2.0 Runtime was not attempted to be installed.
[05/15/12,10:48:22] VS70pgui: [2] DepCheck indicates TFS Object Model (x64) was not attempted to be installed.
[05/15/12,10:48:22] VS70pgui: [2] DepCheck …
Run Code Online (Sandbox Code Playgroud) 我确实安装了下面提到的红宝石东西
当我尝试执行chef-client时,我收到下面提到的错误
c:\RubyDevKit>chef-client
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- ruby-wmi (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef/provider/env/windows.rb:20:in `<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef/providers.rb:49:in `<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef.rb:25:in `<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/bin/chef-client:23:in `<top (required)>'
from C:/Ruby193/bin/chef-client:23:in `load'
from C:/Ruby193/bin/chef-client:23:in `<main>'
Run Code Online (Sandbox Code Playgroud)
Ruby193文件夹结构(缺失)
我想在玩笑中模拟 localStorage 方法以进行错误模拟。我在utility.js 中定义了localstorage getter 和setter 方法。我想模拟localStorage.setItem
在utility.setItem
调用时抛出错误。
//file: utility.js
export default {
getItem(key) {
return localStorage.getItem(key);
},
setItem(key, value) {
localStorage.setItem(key, value);
}
};
Run Code Online (Sandbox Code Playgroud)
开玩笑,
test('throw error', () => {
localStorage.setItem = jest.fn(() => {
console.log(" called ");
throw new Error('ERROR');
});
utility.setItem('123', 'value');
});
Run Code Online (Sandbox Code Playgroud)
然而,localStorage.setItem
mock 永远不会被调用。我也试过做
window.localStorage.setItem = jest.genMockFunction(()=>{console.log(" Mock Called")});
global.localStorage.setItem = jest.fn(()=>{console.log(" Mock Called")});
Run Code Online (Sandbox Code Playgroud) 我有一个显示项目数量的组合框.根据项目数量选择,我显示项目的价格值.默认情况下,我将价格值设置为第一个项目值.但是当我加载页面时,我希望我的组合框显示第一个项目数量,即100.
问题:它应该加载数量:100而不是加载空白
所以我有一个商店定义为
Store = new Ext.data.JsonStore({
storeId: 'Store',
root: 'storevalue',
autoLoad: false,
baseParams: { itemid: '${itemID!""}',
adjustPrice: '${adjustPrice}',
overrideShowPrice: '${overrideShowPrice}' },
url: 'ListQtyPrice.epm',
fields: [ 'qty', 'rawprice', 'displayPrice' ]
});
Run Code Online (Sandbox Code Playgroud)
组合框显示数量
<#if Select>
new DBEComboBox({
name: 'orderqty',
displayField: 'qty',
valueField: 'qty',
id: 'order-qty',
store: Store,
forceSelection: true,
mode: 'remote',
triggerAction: 'all',
allowBlank: true,
listWidth: 202,
triggerClass: 'orderqty-trigger',
width: 200
,defaultValue: 100
,listeners: {
// for price adjustments
}
});
</#if>
Store.load({
callback: function() {
alert("reached");
Ext.getCmp('order-qty').setValue(Store.getAt(0).get('qty'));
var oqc = …
Run Code Online (Sandbox Code Playgroud) 我使用angualr-material实现了表单,我找不到任何标准方法来更改材质中的默认颜色编码.
形成
<div class="col-xs-12 testFormLabel">
<md-input-container class="testLabel">
<label>Reason</label>
<input name="reasonBox" id="reasonBox" ng-model="obj. reasonBox" ng-required="true">
</md-input-container>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.md-input-has-value. testLabel > input {
color:#008cba;
}
Run Code Online (Sandbox Code Playgroud)
问题
如何更改自动对焦标签名称和下划线到不同的颜色(让我们说从深蓝色到绿色)
我正在尝试在angularjs 2中使用toastr作为服务,将在我的组件中注入,如下所述.当调用handleEvent函数时,我正在接收"无法读取未定义的属性'扩展'".非常感谢对错误的任何建议和/或解释.
app.moudle.ts已导入ToastrService,并且已在提供程序中添加ToastrService.
//events/events-list.components.ts
import { ToastrService } from '../common/toastr.service';
@Component ({
selector: 'event-list',
template: `
<div>
<h1> Upcoming Angular 2 Event </h1>
<hr>
<div class="row">
<div *ngFor="let event_data of all_data" class="col-md-5">
<event-thumbnail (click)="handleEvent(event_data.name)" [event]="event_data"></event-thumbnail>
</div>
</div>
</div>
`
})
export class EventListComponent implements OnInit {
all_data:any[]
constructor(private eventService : EventService , private toastr : ToastrService ){
//moved code from here to ngOnInit
}
ngOnInit(){
this.all_data = this.eventService.getEvents();
}
handleEvent(eventName) {
console.log("hey here "+eventName);
this.toastr.success(eventName);
}
}
Run Code Online (Sandbox Code Playgroud)
错误:
[在console.log输出后抛出此错误]
EXCEPTION:./ …
我遇到了这个问题,我能够编写解决方案,可以处理对象数组(这里没有发布)或一个深层嵌套对象,但是当给定对象具有如下所示的嵌套结构时,我无法解决.我很想知道如何解决这个问题.
const source = {
a: 1,
b: {
c: true,
d: {
e: 'foo'
}
},
f: false,
g: ['red', 'green', 'blue'],
h: [{
i: 2,
j: 3
}]
};
Run Code Online (Sandbox Code Playgroud)
解决方案应该是
const solution = {
'a': 1,
'b.c': true,
'b.d.e': 'foo',
'f': false,
'g.0': 'red',
'g.1': 'green',
'g.2': 'blue',
'h.0.i': 2,
'h.0.j': 3
};
Run Code Online (Sandbox Code Playgroud)
尝试一个深层嵌套对象
let returnObj = {}
let nestetdObject = (source, parentKey) => {
let keys = keyFunction(source);
keys.forEach((key) => {
let values = source[key];
if( typeof …
Run Code Online (Sandbox Code Playgroud) javascript arrays javascript-objects data-structures typescript
javascript ×3
java ×2
typescript ×2
angular ×1
angularjs ×1
arrays ×1
chef-infra ×1
collections ×1
combobox ×1
curl ×1
eclipse-rcp ×1
extjs ×1
extjs4 ×1
installation ×1
jestjs ×1
jvm ×1
linux ×1
list ×1
php ×1
reactjs ×1
ruby ×1
rubygems ×1
set ×1
string ×1
swt ×1
toastr ×1
windows ×1
zabbix ×1