本文译自How to sort NSArray with custom
objects。我们开发的每个程序都会使用到一些数据,而这些数据一般被封装在一个自定义的类中。例如一个音乐程序可能会有一个Song类,聊天程序则又一个Friend类,点菜程序会有一个Recipe类等。有时候我们希望在程序中显示的...
分类:
其他好文 时间:
2014-06-29 15:29:25
阅读次数:
342
最近在用QDeclarativeItem的继承来做Qt界面的控件,一开始发现怎么样也没法自动调用paint函数,后来查看了资料,发现如下字句:
You can subclass QDeclarativeItem to provide your own custom visual
item that inherits these features. Note that, because it ...
分类:
其他好文 时间:
2014-06-04 23:47:17
阅读次数:
511
SELECT o. *FROM hq_goods gLEFT JOIN hq_orders o ON
o.goods_id = g.idWHERE o.user_id =73AND o.state =1AND o.id not in( select
c.order_id from hq_comme....
分类:
数据库 时间:
2014-06-04 21:36:03
阅读次数:
297
定义
当一个对象的内在状态改变时允许改变其行为,这个对象看起来像是改变了其类。
状态模式的核心是封装,状态的变更引起了行为的变更,从外部看起来就好像这个对象对应的类发生了改变一样。通用类图如下:
1.State——抽象状态角色
接口或者抽象类,负责对象状态定义,并且封装角色以实现状态切换
2.ConcreteState——具体状态角色...
分类:
其他好文 时间:
2014-06-03 00:45:39
阅读次数:
360
思路:在自定义shape中增加一层或多层,并错开,即可显示阴影效果。为增加立体感,按钮按下的时候,只设置一层。我们可以通过top, bottom, right 和 left 四个参数来控制阴影的方向和大小。关系图以下自定义两种阴影效果:res/drawable-hdpi/shadow1.xml
...
分类:
移动开发 时间:
2014-06-01 11:18:34
阅读次数:
320
参考了 ss的源代码
以及 netlink相关资料:http://blog.csdn.net/scdxmoe/article/details/27711205
实现结果为:
gcc netlink_dig_530_7.c -o netlink_dig_530_7
./netlink_dig_530_7
state family l.addr...
分类:
Web程序 时间:
2014-06-01 05:15:58
阅读次数:
424
Finite State Machine can be used the model the
behavior of system by identifying what states the system can be in, what inputs
or events trigger state...
分类:
其他好文 时间:
2014-05-31 20:20:04
阅读次数:
292
无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service
(ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。如果服务器位于远程计算机上,请检查
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\...
分类:
其他好文 时间:
2014-05-31 18:34:17
阅读次数:
222
在存储过程中进程会处理一些逻辑性的错误,如:将RMB转换为USD时,没有查询到想要的汇率
这个时候最好在存储过程中抛个异常,方便自己查找错误信息。。。其语法如下:RAISERROR({msg_id|msg_str|@local_variable}{,severity,state}[,argument...
分类:
数据库 时间:
2014-05-30 23:21:07
阅读次数:
326
When you invoke the constructor function with
new, the following happens inside the function:? An empty object is created and
referenced by this varia...
分类:
编程语言 时间:
2014-05-30 00:14:49
阅读次数:
308