`
2014马年
  • 浏览: 118849 次
  • 性别: Icon_minigender_1
  • 来自: 晋中
社区版块
存档分类
最新评论
文章列表
1.简单的使用:   db.ss.find({"user": int(uid)}).sort("createTime",-1)  按照创建时间排序     2.多个条件   .sort([("field1",pymongo.ASCENDING), ("field2",pymongo.DESCENDING)])  
  找了一会,好像只有这一种解决方案。   远离就是在菜单按钮上,添加一层布局,然后在这一层布局上试用动画 代码:   public void setRefreshActionButtonState(final boolean refreshing) { if (optionsMenu != null) { final MenuItem refreshItem = optionsMenu .findItem(R.id.action_refresh); if (re ...
混淆打包的时候,用到webkit混淆出错, 查了资料,都没说对,最后受youmi广告的文档启发   加入   -keep class android.webkit.**   解决了问题,这句话应该是不对webkit混淆   -dontwarn android.support.**   这句话是不警告。
1.解决方案官网提供的 http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/ 大概意思就是新建一个表,专门存最大userid。每次取一个id,就+1,这样也不会重复   2.pymongo 实现 代码如下,注意,第一次是返回{},然后是 1-2-3...   print db.usercounter.find_and_modify({"_id": "users"}, update={ "$inc": {'count': 1}} ...
  1.新建连接     from pymongo import MongoClient client = MongoClient('localhost', 27017) #client = MongoClient('mongodb://localhost:27017/') db = client.test_database #db = client['test-database']  2.插入     db.posts.insert(postjson) #datetime.datetime.utcnow() 时间用这个方法  3.查看有哪些表     pri ...
使用 android-async-http 1.4.4   使用的代码:   myClient.get(Config.url_adlist, rp, new TextHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, String responseBody) { lastUpdate = System.currentTimeMillis(); ...
使用了appcompat ,准备在actionbar上面加上一个刷新按钮   找到官方文档: http://developer.android.com/guide/topics/ui/actionbar.html   但是加不上去,菜单只能是在按菜单键的时候出现在底部。   解决办法: http://stackoverflow.com/questions/17913311/is-it-possible-to-have-a-action-bar-menu-using-the-appcompat-library   <menu xmlns:android="h ...
转载: http://blog.sina.com.cn/s/blog_74dfa9f401017s3u.html http://blog.csdn.net/liuzhidong123/article/details/6821635     sqlite> .tables sqlite> ALTER TABLE Students RENAME TO Teachers; sqlite> .schema Teachers sqlite> DROP TABLE Teachers;   SQLite 中的数据类型SQLite 数据库中的数据一般由以 ...
  class UserInfo(models.Model): userId = models.IntegerField(primary_key=True) userName = models.CharField(max_length=30) score = models.IntegerField(default=0) countScore = models.IntegerField(default=0)   有这样一个对象,然后 ui = UserInfo(userName='user'+str(random.randint(1,10 ...
用java做了一个项目,配置文件本来都读取没问题的,但是我把properties文件的编码改成了utf8,然后程序读取的都是乱码,总共有两个地方使用了:   1.使用java代码读取: Properties prop=new Properties(); prop.load(Client.class.getClassLoader().getResourceAsStream("config.properties"));  改成: Properties prop=new Properties(); prop.load(new ...
英文原文地址: http://legacy.python.org/dev/peps/pep-0008/ 原文太长,这里展示一部分规范。   介绍 本文档改编自《Guido's original Python Style Guide essay》,还有一些来自《Barry's style guide》   一致性并不一定对(A Foolish Consistency is the Hobgoblin of Little Minds) 代码更多的是为了让人去读。   一致性很重要。但是更重要的是:知道何时保持一致性,很多时候不应该用代码规范。   下面的情况忽略掉 ...
  1.问题:匹配上url中的反斜杠"/"(%2f) 在springmvc 里,我要匹配: http://yourdomain.com/start/xx/xx/xx/end   @RequestMapping("/{start}/**/{end}") public String vv(@PathVariable("start") String start, @PathVariable("end") String end){ }  然而,我需要获得url中间的数据: @RequestMappi ...
在使用一些本地的jar包的时候,   <dependency> <groupId>com.dropbox</groupId> <artifactId>dropbox-sdk</artifactId> <version>1.3.1</version> <scope>system</scope> <systemPath>${project.basedir}/libs/dropbox-j ...
在安装好apache2 后,修改原来的80端口为81端口,出现404错误。   解决过程如下: 1.修改下面的文件:   /etc/apache2/ports.conf 改为81端口: NameVirtualHost *:81 Listen 81  这样启动就会出现404错误   所以就有了接下来的步骤   2.修改下面文件: /etc/apache2/sites-enabled/000-default  也修改成81端口 <VirtualHost *:81> ServerAdmin webmaster@localhost ...
参考:https://www.quora.com/Python-programming-language-1/What-are-some-cool-Python-tricks   1.几个简单的 产生一个数组  [10 * x for x in a]  产生一个迭代(a generatorexpression) (10 * x for x in a)  dict和set >>> {x: 10 * x for x in range(5)} {0: 0, 1: 10, 2: 20, 3: 30, 4: 40} >>> {10 * x for ...
Global site tag (gtag.js) - Google Analytics