Author Archives: 王永杰

About 王永杰

路漫漫其修远兮,吾将上下而求索

News: filesystem upgrade – manual intervention required(ZZ)

最近用上了archlinux,挺不错,不过升级系统的时候,出现错误,mtab有冲突,如果删除,又会出现空间不够的错误。google到了解决方法,如下: When upgrading to filesystem-2011.12 there will be a conflict with /etc/mtab. Install the package as follows: pacman -S filesystem –force It is strongly advised to avoid the –force or -f switch as it is not safe. However, in this … Continue reading

Posted in linux应用, 技术为本 | Leave a comment

aptitude update – Error: Connection failed [IP: 127.0.0.1 8080]

最近ubuntu一直无法更新,开始也没注意,过去很久了一直不能更新。今天抽空看了一下,原来是proxy的问题。 错误提示是:Connection failed [IP: 127.0.0.1 8080] 解决办法是: 将/etc/apt/apt.conf文件里面有关代理的设置删掉。 OK。

Posted in linux应用 | Leave a comment

How to get Serial Number, Mac, or ANDROID ID of an Android Device(ZZ)

Hi, I think many of you thought which is best to retrieve from the Android Device, so that you can be sure the device will not trick you and the identifier you asked is unique and unchangeable. For example we … Continue reading

Posted in Android, Mobile, 技术为本, 文摘转贴 | Leave a comment

关于waitForCondition导致死锁的问题(zz)

waitForCondition 基本都出现在继承了类 GLSurfaceView 的情况下 , 出现死锁的位置一般是引用 egl.eglCreateWindowSurface(…) 或者 mEgl.eglSwapBuffers(…) 这两个方法的时候 . 避免出现 waitForCondition 的方法总结 : 在绘制线程中必须先合法的获取Surface 才能开始绘制内容,在SurfaceHolder.Callback.surfaceCreated() 和SurfaceHolder.Callback.surfaceDestroyed() 之间的状态为合法的,另外在Surface 类型为 SURFACE_TYPE_PUSH_BUFFERS 时候是不合法的.

Posted in Android, Mobile, 技术为本, 文摘转贴 | Leave a comment

MD5 算法 (The MD5 Message-Digest Algorithm)

MD5即Message-Digest Algorithm 5(信息-摘要算法 5),用于确保信息传输完整一致。是计算机广泛使用的雜湊算法之一(又译摘要算法、哈希算法),主流编程语言普遍已有MD5实现。 在维基百科上有详细介绍,在各种语言上也都已有相应实现。 http://www.ietf.org/rfc/rfc1321.txt 上给出了算法介绍和C语言的实现。 我们在使用过程中发现一个问题,就是计算出来的MD5值有误。 经过调查,并非算法有问题,而是因为机器是64位系统导致的,在32位系统上就没问题。 为了通用性,只要把md5.h中的41行,修改一下就可以了。 typedef unsigned int UINT4;

Posted in C&C++, linux应用, 技术为本 | Leave a comment

一个简单的 makefile 模板

一个简单的 makefile 模板, CC = gcc CFLAGS+=-c -Wall -I[include_path] LDFLAGS+= -lm SOURCES= \ main.c \ OBJECTS=$(SOURCES:.c=.o) EXECUTABLE=test all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) -o $@ .c.o: $(CC) $(CFLAGS) $< -o $@ .PHONY: clean clean: rm -f $(EXECUTABLE) $(OBJECTS)

Posted in C&C++, linux应用, 技术为本 | Leave a comment

Undefined reference to ‘pow()’ using (ZZ)

加上 flag -lm 即可。

Posted in C&C++, 技术为本 | Leave a comment