8.5 日志
Logging模块提供了一些功能全面和灵活的日志系统。最简单的形式就是把日志信息发送到一个文件或sys.stderr;
import logging
logging.debug(’Debugging information’)
logging.info(’Informational message’)
logging.warning(’Warning:config file...
分类:
编程语言 时间:
2014-05-22 10:45:11
阅读次数:
379
我们的常用的系统中,程序的工作通常是有事件驱动和消息驱动两种方式,在Android系统中,Java应用程序是靠消息驱动来工作的。
消息驱动的原理就是:
1. 有一个消息队列,可以往这个队列中投递消息;
2. 有一个消息循环,不断从消息队列中取出消息,然后进行处理。
在Android中通过Looper来封装消息循环,同时在其中封装了一个消息队列MessageQueue。
另外Andro...
分类:
移动开发 时间:
2014-05-22 08:20:57
阅读次数:
253
作者:刘昊昱
博客:http://blog.csdn.net/liuhaoyutz
Android版本:4.4.2
在上一篇文章中我们看了一个使用Handler处理Message消息的例子,本文我们来分析一下其背后隐藏的Android消息处理机制。
我们可能比较熟悉Windows操作系统的消息处理模型:
while(GetMessage(&msg,NULL, 0, 0))
{
...
分类:
移动开发 时间:
2014-05-20 13:58:34
阅读次数:
459
Communication SystemTime Limit: 1000MSMemory Limit:
10000KTotal Submissions: 22445Accepted: 7977DescriptionWe have received an order
from Pizoor Comm....
分类:
其他好文 时间:
2014-05-20 07:37:17
阅读次数:
454
/**
* 封装ProecssDialog对话框
*
*/
public class LoadDialog extends ProgressDialog {
private String title = "进度对话框";
private String message = "加载数据中....";
public LoadDialog(Context context, int theme)...
分类:
移动开发 时间:
2014-05-18 15:42:07
阅读次数:
314
消息传递(Message Passing)
通常可用把并行程序理解为一组相互独立的、能够发关和接收消息的组件,这也称为角色模型(ActorModel),在维基百科上可找到更正式的解释
http://en.wikipedia.org/wiki/Actor_model。虽然使用消息传递的场景往往相当复杂,但是其背后的思想却相对简单,正像下面将要看到的示例一样:
消息传递背后的基本思想是这...
分类:
其他好文 时间:
2014-05-18 08:16:28
阅读次数:
373
一般都用GDI实现:void
CXiangpijinView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your
message handler code here and/or call default CVi...
分类:
其他好文 时间:
2014-05-15 21:04:55
阅读次数:
330
send($data)`. The sent data will then* be the
result of the `yield` expression. Thus it can be received using a code like*
`$data = yield;`.*/ /* What...
分类:
其他好文 时间:
2014-05-15 17:46:37
阅读次数:
311
一、简介
Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件,而SMB是Server Message Block的缩写,即为服务器消息块
,SMB主要是作为Microsoft的网络通讯协议,后来Samba将SMB通信协议应用到了Linux系统上,就形成了现在的Samba软件....
分类:
其他好文 时间:
2014-05-15 09:44:29
阅读次数:
292
断言:学java的时候学过断言,但一直用的很少,node中也有varassert=require(‘assert‘)
console.info(‘.......startapp.......‘);
varactual=1;
varexpect=‘1‘
vara;
//判断是否为真
assert(a,‘isnotvalid‘);
assert.ok(0,‘isnoteffective‘);
//arg[0]为真实值,arg[1]期望值,a..
分类:
Web程序 时间:
2014-05-15 09:09:47
阅读次数:
373