我试图弄清楚如何将样式添加到JList以使其功能(如果选择项目则关闭按钮)(如果收到新消息,则为新消息图标),如下所示:
http://cdn.livechatinc.com/website/media/img/devices/windows/main-feature_v3.png
我正在考虑与"安娜,露西和乔"的名单
有什么想法可以实现吗?
编辑:切换到正确的图片:)
我试图在不使用 jQuery 的情况下更改 div 的内容。我想按 id 或 class 选择 div。
我设法让附加工作:
function appendHtml(targetC, htmldata) {
var theDiv = document.getElementById(targetC);
var newNode = document.createElement('div');
newNode.innerHTML = htmldata;
theDiv.appendChild(newNode)
}
Run Code Online (Sandbox Code Playgroud)
但无法弄清楚如何更改一个文本..
有任何想法吗?
我将以下com.apple.test.plist文件放置在该文件夹中:
/系统/库/启动守护程序
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.Spotlight</string>
<key>ProgramArguments</key>
<array>
<string>/Users/todd/Dropbox/client/CLIENT.BUILDS/MAC/v0.1/ApplicationTest.app</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
但是由于某种原因,当我使用用户todd登录时,ApplicationTest.app无法启动。
有任何想法吗?
我试图让我的JTable标题的背景有一个渐变.
使用代码可以正常工作:
String[] colName = new String[] { "#", "Location", "Name" ,"Source", "System", "Hits", "Current", "Time" };
Object[][] products = new Object[][] {
};
dtm = new DefaultTableModel(products, colName) {
@Override
public boolean isCellEditable(int row, int column) {
//all cells false
return false;
}
};
table = new JTable( dtm );
table.setRowHeight(32);
table.getTableHeader().setReorderingAllowed(false);
table.setDefaultRenderer(Object.class, new VisitorRenderer());
table.setFont(new java.awt.Font("Tahoma", Font.PLAIN, 12));
table.getColumnModel().getColumn(0).setMinWidth(5);
table.getColumnModel().getColumn(1).setMinWidth(50);
table.getColumnModel().getColumn(2).setMinWidth(5);
table.getColumnModel().getColumn(3).setMinWidth(5);
table.getColumnModel().getColumn(4).setMinWidth(5);
table.getColumnModel().getColumn(5).setMinWidth(3);
table.getColumnModel().getColumn(6).setMinWidth(230);
table.getColumnModel().getColumn(7).setMinWidth(3);
final JTableHeader header = table.getTableHeader();
header.setPreferredSize(new Dimension(100, 37));
header.setDefaultRenderer(new DefaultTableCellHeaderRenderer() …Run Code Online (Sandbox Code Playgroud) 我有一个聊天应用程序,我的服务器在发送新消息时发送推送通知.我遇到的问题是如何让用户看到正确的视图?我channelID在推送通知中发送了一个但是如何检索它并将用户带到实际的会话中?
我正在使用此代码来检测何时单击推送通知
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if ( application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground )
{
//opened from a push notification when the app was on background
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试按两列排序表格:prioritet和id
我要订购prioritet与ASC和id与RAND()
到目前为止,我得到的查询是:
SELECT id, user_id, active, prioritet
FROM `agents`
WHERE user_id = ' + user_id + ' AND active = \'1\'
ORDER BY prioritet ASC, id ASC, RAND()
Run Code Online (Sandbox Code Playgroud)
我有什么想法我做错了吗?
我有一个像下面这样的对象:
var _names = {
'name1@gmail.com' : {
'bob@gmail.com' : {
channel: '1234',
from: 'bob'
}
},
'name2@gmail.com' : {
'dan@gmail.com' : {
channel: '53345',
from: 'dan'
}
}
};
Run Code Online (Sandbox Code Playgroud)
我怎么能将以下内容添加到name1@gmail.com:
'judy@gmail.com' : {
channel: '23233',
from: 'judy'
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
出于某种原因,sockjs将一堆请求信息打印到我的控制台中.我没有告诉它在我的代码中的任何地方这样做.
例如;
GET /echo/info 1ms 200
GET echo/332/ed2323/websocket 1ms
etc
Run Code Online (Sandbox Code Playgroud)
有可能以某种方式扭转这种局面吗?
我JSON array从服务器接收到的格式如下:
{ messageArray:
[ { msgFrom: 'V351315826',
msgDate: Tue Oct 29 2013 04:00:35 GMT+0000 (UTC),
msgBody: 'Hi?',
channelID: 'V351315826' },
{ msgFrom: 'V351315826',
msgDate: Tue Oct 29 2013 04:00:38 GMT+0000 (UTC),
msgBody: 'Hello!',
channelID: 'V351315826' } ] }
Run Code Online (Sandbox Code Playgroud)
我如何遍历它?
到目前为止得到的是:
NSError* error;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [(NSString *) message dataUsingEncoding:NSUTF8StringEncoding] options: NSJSONReadingMutableContainers
error: &error];
NSArray *messageArray = [JSON objectForKey:@"messageArray"];
// Parse and loop through the JSON
for (NSDictionary * dataDict in messageArray) {
NSString * messageID …Run Code Online (Sandbox Code Playgroud) 我想搜索一个字符串,看看它是否包含以下任何单词: AB|AG|AS|Ltd|KB|University
我有这个工作在JavaScript中:
var str = 'Hello test AB';
var forbiddenwords= new RegExp("AB|AG|AS|Ltd|KB|University", "g");
var matchForbidden = str.match(forbiddenwords);
if (matchForbidden !== null) {
console.log("Contains the word");
} else {
console.log("Does not contain the word");
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能使上述工作在python中?