最近ubuntu一直无法更新,开始也没注意,过去很久了一直不能更新。今天抽空看了一下,原来是proxy的问题。
错误提示是:Connection failed [IP: 127.0.0.1 8080]
解决办法是:
将/etc/apt/apt.conf文件里面有关代理的设置删掉。
OK。
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 can get the IMEI code but users would became suspicious because you will need to set a permission to use this, and beside this IMEI have only phones, not tablets.
You may choose to retrive ANDROID_ID with the following code: Continue reading →
waitForCondition 基本都出现在继承了类 GLSurfaceView 的情况下 , 出现死锁的位置一般是引用 egl.eglCreateWindowSurface(…) 或者 mEgl.eglSwapBuffers(…) 这两个方法的时候 .
避免出现 waitForCondition 的方法总结 :
- 在绘制线程中必须先合法的获取Surface 才能开始绘制内容,在SurfaceHolder.Callback.surfaceCreated() 和SurfaceHolder.Callback.surfaceDestroyed() 之间的状态为合法的,另外在Surface 类型为 SURFACE_TYPE_PUSH_BUFFERS 时候是不合法的. Continue reading →
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应用, 技术为本
|
一个简单的 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应用, 技术为本
|