2007年9月28日星期五
N70,竟然不提示短信
基本没有删除过,除了一些没意义的。
可是今天竟然短信来了不提示了,
搞了半天,格式化什么都试过了,
格式化以后是好了,
可是把备份的短信和一些其他东西弄回去以后
问题又出现了。
郁闷了好长时间,
忽然想到了把收件箱里的东西移动到自己的文件夹里面
行不行,试过以后还是不行,
恢复一下出厂设置, YEAH,
问题解决。OK了,哈哈, 好高兴。
今天还把我的移动心机给刷成了大陆行货。OKOK啦。~
终于告别丑陋的移动图标了, 速度也快了不少。
2007年9月21日星期五
2007年9月4日星期二
LDD第一个例子运行成功!
太高兴了,在经过了无数次莫名其妙的失败以后,终于搞定了内核模块~
哈哈哈哈~~~
大家不要笑我哈,高兴是很正常的~
总结经验, 主要是准备工作没有做好,
1. 要下载linux-kernel-src , 然后 make all
2.make modules_install 把你的模块文件放到 /lib/modules/linux-XX-XX中
最后把源文件中的 /linux/config.h去掉,
然后把makefile中的 uname -r 换成 /lib/modules/linux-XX-XX 就OK了。。。
呵呵。。。可以开始研究kernel device driver 了。
--
Shit happens!
2007年8月31日星期五
走了,实习结束了
自由了,
--
Shit happens!
2007年8月30日星期四
10 Rules of programming
By Malcolm McLean
Never fork development. It becomes virtually impossible to keep more than one version of a program in synch. A bug is fixed in one program, but the matching file in the other program has some subtle changes essential to make it work. So the fix may or may not be posted in, it may not even be relevant. Very quickly you will arrive at a situation in which no one knows what is happening.
The rule also applies to program objects that can be edited by the user. The user expects that the interface will show a snapshot of the real state of his data. This is very hard to achieve if every menu item is caching data. Unfortunately it is also a difficult problem to fix; you need to impose rigorous mangement on non-modal meus especially. This is particularly true if efficiency considerations make it impossible to do a general refresh with every data value entered.
The rule of two
Thy names shall be binomial.
In most cultures people have two-part names, such as Christian name / surname. When Linnaeus developed his system of biological nomenclature, scientists quickly simplified it to a binomial system, e.g. Pan troglodytes for a chimpanzee, Homo erectus for primitive humans. Three-part or higher names are not names but descriptions.
The rule is of great importance in variable naming. In many languages variables are usually a member of a named structure or object. This means that both the member and the enclosing instance must have single-part names for the whole to be readable. Eg candidate.name not candidate_trainee.firstname . Names longer than two parts can of course be used in simple expressions. The rule applies when variables must be embedded in complex expressions.
The rule of three
Thou canst cope with only three levels of indirection.
A human can just about read a mathematical expression with three levels of nested parentheses. Go to four and understanding breaks down. Similarly humans can cope with three levels of loop nesting, or arrays with three dimensions, or pointers to pointers to pointers.
These things are all related to the fact that we are adapted to living in a three-dimensional world. Hence a three dimensional array has a physical analogue. Looping, indirection and parentheses are all used to support multi-dimensional arrays, hence really part of the same rule.
The rule of four
Thou shalt pass only four parameters to a function.
If you expect your caller to remember the parameters a function takes, their order, and what they do, then you can pass a maximum of four parameters. Five is slightly too many to remember without effort, or to scan unconsiously. Four parameters is also the threshold for machine optimisation on may platforms.
The rule of five
Thou shalt have only five levels in a tree.
A binary tree with five levels has sixteen members at the leaves. This is about the most that can fit onto a single diagram. Your call tree will of course be much bigger than five levels deep in a large program. However it can be broken down into files, with no more than five levels within each file, and no more than five levels of files in each library, and no more than five levels of libraries in each program. Or in object-oriented languages, no more than five levels of methods within each class, and no more than five levels of class dependencies.
The rule of six
Thou shalt use up to six letters in a minor identifier.
This one is imposed by Fortran 77, which only allows six letters in identifiers. However it is a good rule to keep to for minor variables. Generally a one letter convention will exist for many variables in a function, such as N for an integer total and i for a counter, x, y and z for Cartesian co-ordinates, and so forth. The problem comes when we have source x, y and destination x, y. We can't use x, y for both. However sourcex, destinationx will make expressions far too long. srcx, destx is more acceptable. The limit is about six characters.
Six digits is also the maximum that a human can take in without trouble. Unfortunately this rule is impossible to enforce in a computer programming context, because frequently greater precision is required for technical reasons. However it tells us that the rule of six also applies to names made of arbitrary characters, like "memptr". Identifiers which are English words are obviously perfectly readable. That's why the rule of six mentions "minor identifiers".
The rule of seven
Thou shalt pass only seven parameters to a function.
Humans can take in about seven objects without counting them. This means that seven parameters is the limit for a readable function call. The rule of four was the rule for a scannable function call. The difference between scanning and reading is that the scanned call can be accepted as a single unit, the read call has to be worked through parameter by parameter. More than seven arguments and the reader will lose track of which is which and have to count arguments, matching them to the manual. So the code becomes non-readable, and is only acceptable if the reader already knows what the function does without looking at its argument list.
The rule of eight
Thou shalt have no rule of eight. A foolish consistency is the bugbear of little minds.
The rule of nine
Thou shalt hardcode only nine explicit conditions.
In a two dimensional array each non-edge cell has eight neighbours, plus itself to make nine. This is about the limit for coding each condition explicitly. It is also the number of directions in common use � North, South, East, West, North-east, North-west, South-east, South-west, plus one for "stay still". OK, I am running out of ideas; this could be the rule of eight or the rule of ten. An if ... else ladder of nine is not unacceptable. If we go to cubic arrays we have 27 cells in each 3x3x3 block, and we must use loops to index them. Similarly if we want more than the eight compass directions, it is time to code as degrees rather than by name.
The rule of ten
Thou shalt have only ten commandments in a list of rules.
That one was obvious.
--
Shit happens!
2007年8月5日星期日
物价飞涨,给80后们看的省钱指南[转]
本文由 xwsxws 在 2007-8-4 09:51 发表于: 倍可亲.美国 ( backchina.com )
物价飞涨,在老板涨工资还遥遥无期的情况下,节流即是开源。
找出一张纸,把你的各项支出列出来,好好分析你的消费支出,从战略,战术层面来节约。你每月的支出至少可以减少20%。
1.不要在网上到处泡MM,这个开宵很大,一个月至少在500,上不封顶,约会支出是很恐怖的,吃饭,泡吧,礼物,开房间,买套套这些费用都很高。如果还没有找到合适的女生,不得不约会MM,至少大家先视频一下,不要看她N年之前的旧照,或者艺术照,大家或者先电话聊聊。免得见面大失所望,碍于男人面子,你又不能开溜,只好忍痛请恐龙吃饭。即浪费青春,又腰包出血。最好的办法是参加些网友活动,什么爬山啊,打球啊,先见面,感觉不错再
发展。
2.年青人最大的一笔开宵就是谈恋爱。如果她动不动就去什么高档的消费场所,赶快甩了她。别癞哈蟆想吃天鹅肉,梦想找一个富婆,这个跟买彩票一样,还是踏实点,找一个朴实点的女生,门当户对。两人同居,房租可省,两人自己做饭,伙食费用可省。
3.如果可以,把各种各样的打折卡全部带上,至少每月能帮你省1-200元。去饭店吃饭,如果没有带打折卡,跟老板要发票,再问不开票有没有打折,老板一般会给你打个9折。
4.如果每个月要用一打安全套,建议你批量采购,可以到淘宝上去采购,一个才4毛钱,100个才40元,足够你用半年,每个月至少可以省20元。
5.尽量买最便宜的药来吃,贵的药与便宜药化学分子式相同,效果是一样的,不必要为生产商付广告费。
比方说感冒药,不必吃20多元的康泰克,服点1元的朴感敏,效果一样,都是起缓解感冒症状的,还是要靠自身的抵抗力。医生给你开完处方,如果你有当医生的朋友,问一问或者上网咨询,很多药并不是必要的都可以省略掉。
6.把该打的疫苗全部都打上,比方说什么乙肝疫苗,如果可能每一两年,做一次体检.经常做做锻炼,生活有规律,保持身体健康,是你应对生活压力,通货膨胀,节省意外支出的最好药方之一,以上几项做到至少能帮你节省80%的医药费。
7.晚上打的11:00以后一般都会有加班费,你可以跟司机说,不收加班费。司机一般都会同意。