Finish A small javascript server

A simple HTTP-Server base on Duktape

I want to build a remote mantain web server for ARM-based linux. First I choose Python, but cross-compile is painful, and Python is very huge size.

So I decided to find some light script engine, such like lua. But I don’t like LUA Syntax.

Finally I found Duktape in my codes collection. And pick it up, try again. So I base on luasocket and duktape, I implement a light http server.

But duktape is leak of buildin function. So I implement python like library. And extend String.encode(encoding) and String.decode(encodeing) base on libiconv. And override default Duktape.modSearch function.

All the source push to github.com

https://github.com/buaabyl/dukserver

Posted in Writing | Tagged , , , | Comments Off on Finish A small javascript server

Google Chrome freezing and beep

I upgraded Chrome from 43 to 46 on PC. When open new page, it freezing for 3-5 seconds randomly, sound ‘beep’, then normal…

But Chrome 26 to 46 at Thinkpad x200 work fine, no freeze happend! Maybe hardware problem or driver mismatch.

I ask Google for a long time (3 days:), found this post
https://code.google.com/p/chromium/issues/detail?id=259165

They said Realtek HD Audio Driver have some bug, will let chrome crash, need to install newest driver. My PC have Relatek HD Audio, x200 is Conexant CX20561, so I download newest Realtek driver. After I install the newest R2.71 driver, freezing happen less, but still happen……

Continue reading

Posted in Memo | Tagged , , | Comments Off on Google Chrome freezing and beep

google拼音输入法和google chrome冲突……

本来用得好好的,一直是Chrome + Google Pinyin 2.7,将Chrome升级到46后,用Chrome打开网页经常电脑卡死,鼠标也不能移动,但是音乐还在播放,然后几秒钟后恢复。一直以为是Samsung SSD的问题(另外一个用Sandisk SSD没问题)。

然后各种换……最后发现安装1.23版本的Google Pinyin输入法就好很多了,至少不会这么频繁的卡死。

所以可能的原因是:

  • Samsung SDD读写可能在某些高并发的时候有较大的延时,毕竟Sandisk的没问题,LITEON的也没问题
  • Google Pinyin 2.7和Chrome46冲突,但是为啥在其他SSD上没这个问题。输入法和浏览器对硬盘的访问都不小吧

继续测试中,看看会不会再有其他的现象。

Posted in Memo | Tagged , , , | Comments Off on google拼音输入法和google chrome冲突……

About microblaze architecture version

I work on microblaze recently. And mb32 is confuse me.There are not architecture version? or instruction set version?

So I check all mb_ref_guide.pdf I have. This is microblaze version list.
Begin from 7.1i there are Processor Version Register 0 (PVR0) registers.
So I guest every mb_ref_guide after this will update PVR0 if instruction set changed.

“?” means PVR — EDK pair is not verify in mb_ref_guide.
Because I can’t get all version of ISE documents.

and arch version from v3.00.a support by gcc.

Continue reading

Posted in Memo | Tagged , , , , | Comments Off on About microblaze architecture version

python version and visual c++ version

在编译Python扩展的时候常常会遇到版本不匹配的问题,以下搜集了常见的版本的VC版本的对应关系。

* MSC v1310: Visual Studio 2003 *
Python 2.4.x
Python 2.5.x

* MSC v1500: Visual Studio 2008 *
Python 2.6.x
Python 2.7.x
Python 3.0.x
Python 3.1.x
Python 3.2.x

* MSC v1600: Visual Studio 2010 *
Python 3.3.x
Python 3.4.x

Posted in Memo | Tagged , , | Comments Off on python version and visual c++ version

fake FT232RL :(

original photo from http://zeptobars.ru/en/read/FTDI-FT232RL-real-vs-fake-supereal

Continue reading

Posted in Memo | Tagged , , | Comments Off on fake FT232RL :(

vc 命令行开启调试信息

一直用gcc+gdb调试程序,vc只是最后发布的时候用。最近发现可以用vc开启调试模式:


CFLAGS = $(CFLAGS) /Zi
LFLAGS = /DEBUG

Posted in Memo | Tagged , , | Comments Off on vc 命令行开启调试信息

extend opencv to Put Unicode Text

原始的Opencv cvPutText 只支持英文,比较不方便,之前一直使用GDI辅助绘制文字,但是太麻烦了。

所以想着能否用其他办法,然后找到freetype,想着可以用freetype渲染成位图,然后拷贝。

Continue reading

Posted in Memo | Tagged , , , , , , | Comments Off on extend opencv to Put Unicode Text

关于VMwareTools-9.6.1的问题

手欠,把VMware Player的VMWareTools更新了,然后发现任务栏的右键菜单只有About、Disable……,以前的一些小功能都没了!!!第一反应是被删除了,就像vmnetcfg.exe的遭遇一样(被删了,只在Workstation版本有)。然后看看Guest的API,貌似还有!估计只是不提供给普通用户了吧。

注意最后的反斜杠不能省掉!

C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe disk shrink C:\
C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe disk shrink D:\

不过发现命令行的工具还能用,希望不会像vmnetcfg的dll一样,最后还是删除了:)

Posted in Memo | Tagged , , , | 3 Comments

About Sequence points

具体参考: http://c-faq.com/expr/seqpoints.html

http://en.wikipedia.org/wiki/Sequence_point

http://blog.tinlans.org/2010/08/06/sequence-point/

简单说就是如下的代码

int i = 0;
char a[100];

i = i++;
i = (i++) + (++i);
a[i] = i++;

其实行为是未定义的,而且编译器是会提示的!


ipp.c: In function 'main':
ipp.c:9:7: warning: operation on 'i' may be undefined [-Wsequence-point]
i = i++;
^
ipp.c:10:7: warning: operation on 'i' may be undefined [-Wsequence-point]
i = (i++) + (++i);
^
ipp.c:10:7: warning: operation on 'i' may be undefined [-Wsequence-point]
ipp.c:11:13: warning: operation on 'i' may be undefined [-Wsequence-point]
a[i] = i++;

不要以为在学校学的就是完全正确的……

Posted in Others | Tagged , | Comments Off on About Sequence points