信仰

猛图www.omeng.org

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年1月11日

摘要: notesCursor = mDbHelper.fetchAllNotes(); startManagingCursor(notesCursor); String[] from = new String[]{NotepadDBAdapter.KEY_TITLE}; int[] to = new int[]{R.id.list_title}; notes = new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to); se... 阅读全文
posted @ 2012-01-11 10:04 信仰123 阅读(145) 评论(0) 推荐(0) 编辑

2012年1月10日

摘要: Toast.makeText(getApplicationContext(), "OK!", Toast.LENGTH_LONG).show(); 阅读全文
posted @ 2012-01-10 17:54 信仰123 阅读(169) 评论(0) 推荐(0) 编辑

摘要: Bundle b = new Bundle(); b.putString("itemID", v); Intent i1 = new Intent(); i1.setClass(this, NoteEdit.class); i1.putExtras(b); startActivity(i1); i1.putExtra(mDbHelper.KEY_ROWID, keyRowId); i1.putExtra(mDbHelper.KEY_TITLE, keyTitle); i1.putExtra(mDb... 阅读全文
posted @ 2012-01-10 12:35 信仰123 阅读(144) 评论(0) 推荐(0) 编辑

2012年1月9日

摘要: package com.notepadClass;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class NotepadD 阅读全文
posted @ 2012-01-09 18:06 信仰123 阅读(282) 评论(0) 推荐(0) 编辑

摘要: Intent i = new Intent();i.setClass(this, children.class);startActivty(i); 阅读全文
posted @ 2012-01-09 18:05 信仰123 阅读(136) 评论(0) 推荐(0) 编辑

2011年10月14日

摘要: itertools – Iterator functions for efficient loopinghttp://www.doughellmann.com/PyMOTW/itertools/index.html Purpose:The itertools module includes a set of functions for working with iterable (sequence-like) data sets.Available In:2.3The functions provided are inspired by similar features of the “la. 阅读全文
posted @ 2011-10-14 18:02 信仰123 阅读(289) 评论(0) 推荐(0) 编辑

2011年8月11日

摘要: jpypepackage demo.jpype;public class JpypeDemo{ public String sayHello(String user) { return "hello " + user; } public int calc(int a,int b) { return a+b; }}-----------------------------------------------------from jpype import *import osstartJVM("%s/jre/bin/client/jvm.dll"%(os.e 阅读全文
posted @ 2011-08-11 11:44 信仰123 阅读(260) 评论(0) 推荐(0) 编辑

2011年8月9日

摘要: 导入数据到obj.pkl文件try: import cPickle as Pickleexcept ImportError: import pickle as Pickleoutfile = open("obj.pkl","wb")data = {"a":"aaaaa"}Pickle.dump(data, outfile)outfile.close()读取数据try: import cPickle as Pickleexcept ImportError: import pickle as Picklereadfil 阅读全文
posted @ 2011-08-09 12:41 信仰123 阅读(158) 评论(0) 推荐(0) 编辑

摘要: 安装 libeventapt-get install libevent-dev安装python-devapt-get install python-dev安装greenleteasy_install greenlet安装geventeasy_install gevent一个小测试测试gevent 的任务池from gevent import poolg = pool.Pool()def a(): for i in xrange(100): g.spawn(b)def b(): print 'b'g.spawn(a)g.join() 阅读全文
posted @ 2011-08-09 12:32 信仰123 阅读(2413) 评论(0) 推荐(0) 编辑

2011年7月27日

摘要: 在chinaunix上问了很久没找到解决方案自己动手丰衣足食脚本如下#!/bin/bashc=$(ps -ef|grep python |grep -v "grep"|wc -l)if [ $c -lt 1 ]then python /home/spider/spider.py &fi保存文件名为 xxx.sh运行命令 :crontab -e在 nano里面 添加*/分钟 * * * * sh 文件的路径ctrl+xY回车/etc/init.d/cron restart 阅读全文
posted @ 2011-07-27 16:34 信仰123 阅读(211) 评论(0) 推荐(0) 编辑

猛图