什么是kk:mm,HH:mm和hh:mm格式之间的区别?
SimpleDateFormat broken = new SimpleDateFormat("kk:mm:ss");
broken.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
SimpleDateFormat working = new SimpleDateFormat("HH:mm:ss");
working.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
SimpleDateFormat working2 = new SimpleDateFormat("hh:mm:ss");
working.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
System.out.println(broken.format(epoch));
System.out.println(working.format(epoch));
System.out.println(working2.format(epoch));
Run Code Online (Sandbox Code Playgroud)
打印:
24:00:00
00:00:00
05:30:00
Run Code Online (Sandbox Code Playgroud) 我正在开发一个Android应用程序来访问一些battle.net(https://eu.battle.net)帐户数据(对于魔兽世界),我正在使用org.apache.http.client.HttpClient
这样做.
这是我正在使用的代码:
public static final String USER_AGENT = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)";
public static class MyHttpClient extends DefaultHttpClient {
final Context context;
public MyHttpClient(Context context) {
super();
this.context = context;
}
@Override
protected ClientConnectionManager createClientConnectionManager() {
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
// Register for port 443 our SSLSocketFactory with our keystore
// to the ConnectionManager
registry.register(new Scheme("https", newSslSocketFactory(), 443));
return new SingleClientConnManager(getParams(), registry); …
Run Code Online (Sandbox Code Playgroud) 我一直在努力用twitter bootstrap手风琴来实现这个目标:
通常,使用手风琴(bootstraps collapse plugin)不是必须的.
我想要达到的目的是:
真的很想得到一些帮助,因为我觉得我对此失去了理智:(
使用额外的jQuery插件(如jQuery UI)是"允许的".
int id = 0;
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setContentTitle(context.getString(R.string.notification_on_the_move_gps_title))
.setContentText(context.getString(R.string.notification_on_the_move_text));
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(context.getString(R.string.notification_on_the_move_gps_big_text)));
Intent mainIntent = new Intent(context, MainActivity.class);
Intent turnOffIntent = new Intent(context, MainActivity.class);
turnOffIntent.putExtra(MainApp.KEY_TURN_OFF_NOTIFICATION_ID, id);
TaskStackBuilder mainBuilder = TaskStackBuilder.create(context);
mainBuilder.addParentStack(MainActivity.class);
mainBuilder.addNextIntent(mainIntent);
PendingIntent mainPendingIntent = mainBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(mainPendingIntent);
TaskStackBuilder turnOffBuilder = TaskStackBuilder.create(context);
turnOffBuilder.addParentStack(MainActivity.class);
turnOffBuilder.addNextIntent(turnOffIntent);
PendingIntent turnOffPendingIntent = turnOffBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder
.setSmallIcon(R.drawable.ic_stat_notification)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_launcher))
.setAutoCancel(true)
.setLights(Color.BLUE, 500, 500)
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE)
.addAction(R.drawable.ic_stat_notification, "Open", mainPendingIntent)
.addAction(R.drawable.ic_stat_notification_off, "Turn off", turnOffPendingIntent);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(id, builder.build());
Run Code Online (Sandbox Code Playgroud)
单击未展开或扩展的通知正文或打开操作按钮始终使用(KEY_TURN_OFF_NOTIFICATION_ID)额外传递意图.
我试过放弃TaskStackBuilder并PendingIntent …
我从SVN存储库导入了现有项目,但它不会显示元素的版本信息:
这对我来说很奇怪,因为:
这是我的安装细节:
每当我在Eclipse(4.2.1)中打开一个连接到Git仓库的项目时,Git仓库描述[Name branch]将由项目所在的工作集显示.
例:
如果我关闭TestSlide项目(具有相同名称的repo),那么[TestSlide master]
将会消失.当我打开另一个Git连接项目时,它的 repo名称/分支将打印在工作集旁边.
当工作集中打开了几个Git连接项目时(所有这些项目巧合地指向主分支),显示如下:
即使同一工作集中有多个项目连接到SVN repos,其工作集名称旁边也不会显示其repo名称.
不知怎的,我相信这不是预期的(Eclipse),所以我在Eclipse中"错误配置"了,所以我可以修复它以摆脱这种烦恼吗?
使用git config user.email "some@email.com"
在全局配置文件中设置用户电子邮件
使用git config --global user.email "some@email.com"
或git config --local user.email "some@email.com"
(从回购中)抛出:
"错误:一次只有一个配置文件."
我的全球.gitconfig
:
[color]
ui = auto
[user]
name = My Name
email = my@email.com
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
type = cat-file -t
dump = cat-file -p
[push] …
Run Code Online (Sandbox Code Playgroud) 为什么会发生以下情况?两者都不应该有效吗?
List<String> items = data;
for( String id : items ) {
List<String> otherItems = otherData;
// 1. addAll()
//Causes ConcurrentModificationException
items.addAll(otherItems);
// 2. .add()
//Doesn't cause exceptions
for( String otherId : otherItems ) {
items.add(otherId);
}
}
Run Code Online (Sandbox Code Playgroud)
是因为add()
添加了集合Items,还是addAll()
创建了一个新的集合,从而将Items修改为List的另一个实例?
编辑
items
并otherItems
具体类型ArrayList<String>
.
app.js:
var express = require('express');
var session = require('express-session');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var mongoStore = require('connect-mongo')(session);
var mongoose = require('mongoose');
var passport = require('passport');
var config = require('./config');
var routes = require('./routes');
var mongodb = mongoose.connect(config.mongodb);
var app = express();
// view engine setup
app.set('views', config.root + '/views');
app.set('view engine', 'jade');
app.engine('html', require('ejs').renderFile);
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(cookieParser());
app.use(express.static(config.root + …
Run Code Online (Sandbox Code Playgroud)