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

2013年7月19日

摘要: 通过 ANE(Adobe Native Extension) 启动Andriod服务 阅读全文

posted @ 2013-07-19 18:38 bobolive 阅读(2185) 评论(2) 推荐(0) 编辑

2013年7月17日

摘要: 1、Open quote is expected for attribute "android:name" associated with an element type "XXX"配置文件的编码格式不对, 一般是在拷贝某些配置信息的时候编码格式有冲突(GBK to UTF-8?..),或是标点符号有中文标点, 全角字符等。笔者就遇过用了中文的“” 报这个错。 阅读全文

posted @ 2013-07-17 11:24 bobolive 阅读(228) 评论(0) 推荐(0) 编辑

2013年7月14日

摘要: Erlang 编程指南第四章 练习4-2编写一个程序,生成N个进程并相连成环,启动环后绕环发送M个消息,当收到退出消息后终止.ringStart(M,N,Message, Cp) -> io:format("ring start ~w|~w|~p~n",[M, N, Message]), if N > 0 -> Pid = spawn(test_pid, ringReader, [N, self(), yes, 0]), Pid ! {read, M, Message}; true -> Pid = Cp ... 阅读全文

posted @ 2013-07-14 16:20 bobolive 阅读(184) 评论(0) 推荐(0) 编辑

2013年7月5日

摘要: erlang 进程通讯中 执行到 receive 语句时 如果信箱没有消息可以匹配时会暂停等待消息.go() -> register(echo, spawn(test_pid,loop,[])), echo ! {self(), hello}, receive {_Pid,Msg} -> io:format("~w~n",[Msg]) end. %%Pid ! stop.loop() -> io:format(" loop start~n", []), receive {From, Msg} -> ... 阅读全文

posted @ 2013-07-05 09:09 bobolive 阅读(226) 评论(0) 推荐(0) 编辑

2013年7月2日

摘要: starling 比较早之前就有开始解了,但只到最近参与一个用starling 做为框架的手游项目才真正做为一程来使用它。 项目也是刚开始搭建,在这做些笔记。在写一个管理类时, 遇到 starling.events.EventDispatcher 和 flash.events.EventDispatcher, 这两者有什么区别呢,查了下手册Packagestarling.eventsClasspublic class EventDispatcherInheritanceEventDispatcher ObjectSubclassesDelayedCall, DisplayObject, St. 阅读全文

posted @ 2013-07-02 11:06 bobolive 阅读(239) 评论(0) 推荐(0) 编辑

2013年6月29日

摘要: 1. sum(3) => 6; sum(1,3) => 6; sum(6,6) => 6;sum(N) when is_integer(N) -> sum_acc(N,0);sum(_) -> {error, {bad_argument}}.sum_acc(0, Sum) -> Sum;sum_acc(N, Sum) -> sum_acc(N-1, Sum + N).sum(N, M) when is_integer(N), is_integer(M), M >= N -> sum_acc3(N, M, 0);sum(_, _) -> 阅读全文

posted @ 2013-06-29 21:35 bobolive 阅读(224) 评论(0) 推荐(0) 编辑

2013年6月26日

摘要: case Expression ofPattern1 [when Guard1] -> Expr_seq1;Pattern2 [when Guard2] -> Expr_seq2;…endif Guard1 -> ...; Guard2 -> ...; ...;end.Erlang 编程指南 第三章程顺序编程里有这么一个例子%%test1(X) ->%% if%% X > 1 -> greater;%% X smaller;%% true -> equal%% end.如果把 true 改成通配符行不行?%%test1(X) ->%% .. 阅读全文

posted @ 2013-06-26 12:52 bobolive 阅读(792) 评论(0) 推荐(0) 编辑

2013年6月24日

摘要: 用正则的时候不要用if(content.match("test").length > 0) ...;改成 if(content.match(/test/g).length > 0) ...;前者匹配不到时返回 nul 会出现空错误,后者匹配不到时返回 [] 不会出现空错误. 阅读全文

posted @ 2013-06-24 11:02 bobolive 阅读(125) 评论(0) 推荐(0) 编辑

2011年6月14日

摘要: super() 就是父类的构造器函数。super 不能再静态方法中。 阅读全文

posted @ 2011-06-14 13:54 bobolive 阅读(162) 评论(0) 推荐(0) 编辑

2011年3月8日

摘要: 数据库建表时,我们有时会这样命名"resource_id" 来表示这是个resource表里面的"id"字段。当表名比较长时我们可能会这样"resource_ref"表示资源影射表。这样的表通常有外键,很可能就是我们在开头命名的"resource_id"。这时候字段名可能就变成"resource_ref_resource_id"。OK,这样稍微比一长串字符串的命名好认一些。但做实体的时候,你应该不要做一模一样的命名。View Code 1 <?php 2 class Zwb_Models_ 阅读全文

posted @ 2011-03-08 18:09 bobolive 阅读(2154) 评论(0) 推荐(1) 编辑