分页: 1/4 第一页 1 2 3 4 下页 最后页 [ 显示模式: 摘要 | 列表 ]
没有时间细看那么多文章,在此摘录和备忘一些内容:
(有些都是人家三年前的研究了。。落伍啊,部分可能正常方式访问不到,再次和国外落伍了。。)

1 The Android boot process from power on

引用
1. Power on and boot ROM code execution
2. The boot loader
3. The Linux kernel
4. The init process
5. Zygote and Dalvik
6. The system server
7. Boot completed


2 Android Initialization Process

引用
init is the first process after kernel started. The corresponding source code lies in: device/system/init. It does the following tasks step by step:

1.       Initialize log system.

2.       Parse /init.rc and /init.%hardware%.rc.

3.       Execute early-init action in the two files parsed in step 2.

4.       Device specific initialize. For example, make all device node in /dev and download firmwares.

5.       Initialize property system. Actually the property system is working as a share memory. Logically it looks like a registry under Windows system.

6.       Execute init action in the two files parsed in step 2.

7.       Start property service.

8.       Execute early-boot and boot actions in the two files parsed in step 2.

9.       Execute property action in the two files parsed in step 2.

10.   Enter into an indefinite loop to wait for device/property set/child process exit events. For example, if an SD card is plugined, init will receive a device add event, so it can make node for the device. Most of the important process is forked in init, so if any of them crashed, init will receive a SIGCHLD then translate it into a child process exit event, so in the loop init can handle the process exit event and execute the commands defined in *.rc(it will run command onrestart).
Tags:
参观创新工厂是一个比较偶然的机会。
下午要跟老板去联想,而老板中午有事去创新工厂,所以跟着去看看。

创新工厂在搜狐和谷歌的区域,16楼,那个楼貌似是英式的楼层计算方式,我们的2楼,人家叫1楼,1楼叫ground。

点击在新窗口中浏览此图片

创新工厂还没有很正式的大门,一个普通的小门进去,看到上面的logo。
其实在出电梯的地方,能看到一个叫谷翔的公司不知道是否有什么关系在这里面。墙上可以看到一个白纸写的创新工厂指示方向,相当的简单。
目前在公司办公的估计不到30人,每个人的桌子都蛮大的,光线非常好,可以发现的是,差不多每个桌子都有一本老板的书《世界因你不同》。

李开复开会出来,还专门见了我们几个参观的人:“欢迎你们来参观创新工厂!”
然后,他主动的给了我们几个一人一本他写的自传《世界因你不同》,提示我们,书已经签名了。

点击在新窗口中浏览此图片

我觉得这个见面方式比别人见面递名片要牛的多。让别人看书了解自己比看名片了解自己要强多了。
书还没来得及看,但封面那句话告诉我们专注于一个领域的感觉:“一个世界有你,一个世界没有你,让两者的不同最大,就是你一生的意义。”
其实公司也没有很特殊的地方,就是里面都是牛人,都有比较传奇的故事。
Tags: ,
最近发现的这个工具KeePass,很好用,它有几个好处:

1 帮你记录你的密码,方便复制使用
2 备忘你的账号信息
3 各平台都有相应的版本
4 可以自动生成某些规则的密码,自动生成密码

比如你注册网站是,可以先建立账号,它会给你生成一个随机密码,你就用这密码就好,避免填写自己的密码到别的网站,其实注册过程很不安全。
对于网管,这个也是杀手级的工具了,分配ftp账号,用户账号等。。
Tags:
android里,很多命令都没有,但可以借助一个工具箱子,使用这些命令,那就是buxybox。

busybox简介

引用
  BusyBox 是标准 Linux 工具的一个单个可执行实现。BusyBox 包含了一些简单的工具,例如 cat 和 echo,还包含了一些更大、更复杂的工具,例如 grep、find、mount 以及 telnet。有些人将 BusyBox 称为 Linux 工具里的瑞士军刀.简单的说BusyBox就好像是个大工具箱,它集成压缩了 Linux 的许多工具和命令。
  1、BusyBox 的诞生
  BusyBox 最初是由 Bruce Perens 在 1996 年为 Debian GNU/Linux 安装盘编写的。其目标是在一张软盘上创建一个可引导的 GNU/Linux 系统,这可以用作安装盘和急救盘。
  2、busybox的用法
  可以这样用busybox
  #busybox ls
  他的功能就相当运行ls命令
  最常用的用法是建立指向busybox的链接,不同的链接名完成不同的功能.
  #ln -s busybox ls
  #ln -s busybox rm
  #ln -s busybox mkdir
  然后分别运行这三个链接:
  #./ls
  #./rm
  #./mkdir
  就可以分别完成了ls rm 和mkdir命令的功能.虽然他们都指向同一个可执行程序busybox,但是只要链接名不同,完成的功能就不同,很多linux网站都提供busybox的源代码下载。
Tags:
客户端需要UTF-16编码的文件,但转换时,同事说不对,要小尾序的,其实不太明白这个意思,查了一下资料。

PHP里的代码也就这样了:
$content = iconv('UTF-8', 'UTF-16', $content);


从某篇文章发现这样的东西:
from_to($string, 'UTF-16le', 'UTF-8');


这说明了有其它的UTF-16的编码方式,我们看看维基的说明《UTF-16》:
引用
UTF-16是Unicode的其中一个使用方式。 UTF是 Unicode/UCS Transformation Format,即把Unicode转做某种格式的意思。

UTF-16的大尾序和小尾序储存形式都在用。一般来说,以Macintosh制作或储存的文字使用大尾序格式,以Microsoft或Linux制作或储存的文字使用小尾序格式。

字符“朱”:
UTF-16LE 小尾序  31 67
UTF-16BE 大尾序  67 31


PHP稍微修改一下就对了:
$content = iconv('UTF-8', 'UTF-16le', $content);


另外有这么个代码:UTF-8 to Code Point Array Converter in PHP
把字符都转换成代表的数字了,目前不知道什么用途。。

另外,需要转换PC格式为Unix格式时,需要在转换Utf-16之前处理,否则会出现好多乱码的哦
$content = str_replace("\r\n", "\n", $content);
$content = iconv('UTF-8', 'UTF-16le', $content);

Tags: ,
这里备忘一下,同时分享此内容

原文地址:Building an efficient edonkey server on linux/FreeBSD/Win32

有一个服务器有此软件,也许以后需要修改配置,下面是简单的翻译一些:

1 下载安装

$ wget http://lugdunum.shortypower.org/files/eserver-17.14.i686-linux.gz
$ wget -O ipfilter.srv http://lugdunum.shortypower.org/files/ipfilter.srv
$ gzip -d eserver-17.14.i686-linux.gz
$ chmod 755 eserver-17.14.i686-linux
$ rm -f eserver
$ ln -s eserver-17.14.i686-linux eserver


2 最精简的配置文件(donkey.ini)

[server]
name=my server name
desc=the desc of my server
thisIP=81.12.34.56 # The IP of my server
port=4232 # the TCP port (default is 4661, but it is wise to choose another value)
Tags: ,
从大的编码转换到小的编码,是会产生字符缩减的,甚至有些字在目标字符集里不存在。

比如gb2312里,“囧”、“镕”都会产生转换失败,但很奇怪,gb2312的网页里是有这样的文字的,有点不解。
先看看官方的说明吧 iconv

引用
out_charset
The output charset.

If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can't be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character and an E_NOTICE is generated.


看示例可知

在输出字符里添加//TRANSLIT可以得到相近的意思的字符
添加//IGNORE可以忽略不能转换的
不添加,则在第一个错误的地方停止转换,也就是被截断了

如何知道被截断了或者转换失败?

有个例子可以参考一下(单位是字节还是字符,这里不确定)

<?
//code from http://www.aslibra.com
//code by hqlulu @ 2010-1-25

$title_origin = "something";
$title = iconv('utf-8', 'gb2312//IGNORE', $title_origin);
$percent = round(strlen($title_origin)/strlen($title), 3);

//UTF-8汉字 3字节 gb2312汉字 2字节
//最大比例为1.5,如果丢失文字,那就是有转换失败,并且比例变大
//简单例子:“我”的urlencode值 = %E6%88%91(utf-8) = %CE%D2(gb2312)

if($percent > 1.5 ){
  $error[] = array('str', $title_origin);
}
?>
Tags: ,
分页: 1/4 第一页 1 2 3 4 下页 最后页 [ 显示模式: 摘要 | 列表 ]

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐