2008年8月31日星期日
mod_python global value study
not like tomcat, the whole application run on one jvm, and global value is easy.
mod_python use seperated process for python Interpreter. here is a test source to show:
when the pid is not changed, global value gv is "global", but if pid changed, another context is created. and apache seems to create multi process for mod_python. In fact if there is not a multi-thread implementation in python Interpreter (and for apache2) which i have not confirmed, force a single-thread will make multi request trouble which can be imaged. and this is a existing topic on python thread, thread-safe which i should google study.
and how Django implements global like session, i seek the doc and found almost 3 ways: 1, use a database,
2, use a file, 3, use a third-part memory cache. so all the ways implies mod_python is lack of a good implemented native global solution.
and there seem to be “limitations and consequences” in python multi-thread.
mod_python use seperated process for python Interpreter. here is a test source to show:
from mod_python import apache
import os
gv=[]
cnt=0
def handler(req):
global gv
global cnt
req.content_type = "text/html"
sb=[]
sb.append("pid %d, interpreter '%s'" % (os.getpid(), req.interpreter))
gv.append("cnt:%d"%(cnt))
cnt+=1
for x in gv:
sb.append(x)
req.write("<br>".join(sb))
return apache.OKwhen the pid is not changed, global value gv is "global", but if pid changed, another context is created. and apache seems to create multi process for mod_python. In fact if there is not a multi-thread implementation in python Interpreter (and for apache2) which i have not confirmed, force a single-thread will make multi request trouble which can be imaged. and this is a existing topic on python thread, thread-safe which i should google study.
and how Django implements global like session, i seek the doc and found almost 3 ways: 1, use a database,
2, use a file, 3, use a third-part memory cache. so all the ways implies mod_python is lack of a good implemented native global solution.
and there seem to be “limitations and consequences” in python multi-thread.
2008年8月30日星期六
successfully install ubuntu 8.04 linux on laptop hasee f233t
I tried first with goodbye-microsoft.com for the debian installer, using the text mode, it failed by cannot finding the harddisk driver! the hd is something of 80G SATA.
then i burned a ubuntu cd and install, safe mode graphic and kernel param "acpi=off noapic nolapic " is must, and "pnpbios=off" is also perferred.
it failed to install grub automatic. i mount the sda6 the install grub using: "grub-install /dev/sda6 --root-directory=/mount/a6"
the partition appears to be fat16 which prevent grub to mount it, so i use fdisk to modify sda6 to "83 Linux", then use update-grub to update the menu.lst to grub or grub seems cannot find it automatic ly. the menu.lst is like this:
a ati 3d card driver is found.
the harddisk driver i wonder if it is fast.
everything is ok and i begin to enjoy.
then i burned a ubuntu cd and install, safe mode graphic and kernel param "acpi=off noapic nolapic " is must, and "pnpbios=off" is also perferred.
it failed to install grub automatic. i mount the sda6 the install grub using: "grub-install /dev/sda6 --root-directory=/mount/a6"
the partition appears to be fat16 which prevent grub to mount it, so i use fdisk to modify sda6 to "83 Linux", then use update-grub to update the menu.lst to grub or grub seems cannot find it automatic ly. the menu.lst is like this:
default 0
title Windows XP
root (hd0,0)
makeactive
chainloader +1
title Linux Ubuntu 8.04
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-19-generic ro root=/dev/sda6 acpi=off noapic nolapic
initrd /boot/initrd.img-2.6.24-19-generic
title DOS
root (hd0,0)
makeactive
chainloader /arldra ati 3d card driver is found.
the harddisk driver i wonder if it is fast.
everything is ok and i begin to enjoy.
2008年8月29日星期五
2008年8月27日星期三
无底洞
网易新闻
话题:西安一动物园内小老虎不配合拍照遭毒打(图)
查看原文
网易评论
网易江苏苏州网友(58.210.*.*) 的原贴:
本人06年,因与西安秦岭野生动物园工程项目建设的业务关系,其动物园领导领导相识,大言不惭的聊出有很多,管理野生动物的黑幕,我对他的话总结大概有三种手段,方法。欺骗国家,谋私利。
1,投入小于产出,,如熊类,定期取胆汁,勾结药贩,定期轮换圈养。(小钱范畴,基本是基层管理领导分食)
2,向国家定期上报珍禽异兽虚假信息。骗取巨额补贴,如新闻公布的华南虎事件,没有公布的还更多,如金丝猴种群,穿山甲,野生秦岭大熊猫种群,,骗取金额补贴
4,虚假的野生动物种群活动扩大,向国家申请大块圈地,在条块分割,变相外卖。如07年7月(西安“秦岭山水”二三期规划未批先售)获取巨利。
3,死体价值大于活体,,如现在说的老虎,随着老虎长大,其利益越发明显,在成年前死亡,利益最大,原因1:肉自己人分食,其他做成虎制品,(出上下打点部分)销售给:"会员"客户.有钱的富豪都有内部线人,市场需求大。
2:死亡不上报,继续领补贴金额,上下关系打点,2,万一消息透漏,在未成年死亡,解释非常合理,
3,向上国家永远哭穷,门票收入,维护投入,每年国家下发客观的补贴,真正用在建设的寥寥无几。
我的评论
无底洞。穷的像个无底洞。越是穷过,当官以后越是贪婪。
其实我的玩是不是也是个无底洞,原来还想干什么什么事情,但是有了时间,比如放假周末都会用来玩。以后有机会试着玩个一年,大概还是玩不够吧。
话题:西安一动物园内小老虎不配合拍照遭毒打(图)
查看原文
网易评论
网易江苏苏州网友(58.210.*.*) 的原贴:
本人06年,因与西安秦岭野生动物园工程项目建设的业务关系,其动物园领导领导相识,大言不惭的聊出有很多,管理野生动物的黑幕,我对他的话总结大概有三种手段,方法。欺骗国家,谋私利。
1,投入小于产出,,如熊类,定期取胆汁,勾结药贩,定期轮换圈养。(小钱范畴,基本是基层管理领导分食)
2,向国家定期上报珍禽异兽虚假信息。骗取巨额补贴,如新闻公布的华南虎事件,没有公布的还更多,如金丝猴种群,穿山甲,野生秦岭大熊猫种群,,骗取金额补贴
4,虚假的野生动物种群活动扩大,向国家申请大块圈地,在条块分割,变相外卖。如07年7月(西安“秦岭山水”二三期规划未批先售)获取巨利。
3,死体价值大于活体,,如现在说的老虎,随着老虎长大,其利益越发明显,在成年前死亡,利益最大,原因1:肉自己人分食,其他做成虎制品,(出上下打点部分)销售给:"会员"客户.有钱的富豪都有内部线人,市场需求大。
2:死亡不上报,继续领补贴金额,上下关系打点,2,万一消息透漏,在未成年死亡,解释非常合理,
3,向上国家永远哭穷,门票收入,维护投入,每年国家下发客观的补贴,真正用在建设的寥寥无几。
我的评论
无底洞。穷的像个无底洞。越是穷过,当官以后越是贪婪。
其实我的玩是不是也是个无底洞,原来还想干什么什么事情,但是有了时间,比如放假周末都会用来玩。以后有机会试着玩个一年,大概还是玩不够吧。
2008年8月24日星期日
2008年8月22日星期五
2008年8月21日星期四
新闻你到底要告诉我什么?
我常觉得最近吃下去的是垃圾(思想上),本来信息爆炸了,然后我还是发现信息枯竭,找不到想看的,然后还出现那么多垃圾信息。
改做新闻评论了,
1. 刘翔退赛的想法
运动,从好的方面想就是让人更快更高更强更健康。但是要是把肌腱搞发炎了,那还不如普通人了,运动员、普通人,难道只有一线之隔。
2. 番茄花园的被抓
番茄花园明目张胆,我一直没懂,所以估计是政府官方支持的,就像怀疑过于专业的日剧字幕组一样。
现在被抓了,我想,XP捆绑流氓软件月入10万,和这个有关,安全! 想一下要是某些政府领导人用了番茄花园,那些不可告人的故事泄露了,那还不把你抓进安全局啊。
3. 输了还能上电视的福原爱
福原爱又输给我们中国的选手了,但是还是给她长时间的专访。 福原爱的角色不是一个普通的运动员,而是一个代号,一个什么。
4. 网易别恶心
网易的新闻太过暴力色情血腥,我不是夸大其词,而是真的这样,比如今天的新闻,
让我纯洁幼小的心灵受到严重的创伤。
改做新闻评论了,
1. 刘翔退赛的想法
运动,从好的方面想就是让人更快更高更强更健康。但是要是把肌腱搞发炎了,那还不如普通人了,运动员、普通人,难道只有一线之隔。
2. 番茄花园的被抓
番茄花园明目张胆,我一直没懂,所以估计是政府官方支持的,就像怀疑过于专业的日剧字幕组一样。
现在被抓了,我想,XP捆绑流氓软件月入10万,和这个有关,安全! 想一下要是某些政府领导人用了番茄花园,那些不可告人的故事泄露了,那还不把你抓进安全局啊。
3. 输了还能上电视的福原爱
福原爱又输给我们中国的选手了,但是还是给她长时间的专访。 福原爱的角色不是一个普通的运动员,而是一个代号,一个什么。
4. 网易别恶心
网易的新闻太过暴力色情血腥,我不是夸大其词,而是真的这样,比如今天的新闻,
让我纯洁幼小的心灵受到严重的创伤。
2008年8月20日星期三
shell to kill and wait weblogic server
shell to kill and wait weblogic server
#!/bin/sh
echo killing
ps -ef|grep weblogic.Server|grep java|awk '{print $2}' | xargs kill
echo waiting
running=1
while [ $running != "0" ]
do
sleep 1
#ps -ef|grep weblogic.Server|grep java | wc -l
running="`ps -ef|grep weblogic.Server|grep java | wc -l`"
echo running = $running
done
echo done
ps -ef|grep weblogic.Server|grep java
2008年8月19日星期二
2008年8月15日星期五
通用bootsect
今天我渐渐开始伟大宏伟的os计划, os的名字叫yunxingos, 很特别吧?
下面这个程序的功能是,
众所周知,x86 cpu启动时会调用 f000:fff0 的程序,这是bios的程序,而bios会把boot disk的第一个sector 512 byte读入0x7c0:0000,然后执行, 操作系统就从这里开始。 由于只读了512byte,所以要干接下来的事情,一定要在这里读入更多的磁盘的内容。 所以这里我参考linux1.0的代码,更加简化,修改, 读入指定的4个sector的1204byte的内容,然后执行, 放入的地点是0x9000:0000, 为什么放这里呢, 因为有些内容是被系统的一些东西占用的,而这里的空的,而且我让他和linux相同.
bootsect binary。
下面这个程序的功能是,
众所周知,x86 cpu启动时会调用 f000:fff0 的程序,这是bios的程序,而bios会把boot disk的第一个sector 512 byte读入0x7c0:0000,然后执行, 操作系统就从这里开始。 由于只读了512byte,所以要干接下来的事情,一定要在这里读入更多的磁盘的内容。 所以这里我参考linux1.0的代码,更加简化,修改, 读入指定的4个sector的1204byte的内容,然后执行, 放入的地点是0x9000:0000, 为什么放这里呢, 因为有些内容是被系统的一些东西占用的,而这里的空的,而且我让他和linux相同.
bootsect binary。
; derived by neoedmund from
; bootsect.s Copyright (C) 1991, 1992 Linus Torvalds
; modified by Drew Eckhardt
; modified by Bruce Evans (bde)
;
; use fasm to compile to a 512 byte binary
;
; bootsect.s is loaded at 0x7c00 by the bios-startup routines, and read
; SETUPSECS sectors from disk to address 0x90000, and jumps there.
INITSEG equ 0x9000
SETUPSECS equ 4 ; nr of setup-sectors
BOOTSEG equ 0x07C0 ; original address of boot-sector
_main:
mov ax,BOOTSEG
mov ds,ax
mov ax,INITSEG
mov es,ax
load_setup:
; mov dx,[0] ; drive 0, head 0
mov cx,0x0002 ; sector 2, track 0
mov bx,0x0000 ; address = 0
mov ax,0x0200+SETUPSECS ; service 2, nr of sectors
; (assume all on head 0, track 0)
int 0x13 ; read it
jnc ok_load_setup ; ok - continue
push ax ; dump error code
call print_nl
mov bp, sp
call print_hex
die1: jmp die1
ok_load_setup:
; Print some inane message
mov ah,0x03 ; read cursor pos
xor bh,bh
int 0x10
mov cx,9
mov bx,0x0005 ; page 0, attribute 7 (normal)
mov bp,msg1
mov ax,BOOTSEG
mov es,ax
mov ax,0x1301 ; write string, move cursor
int 0x10
call print_nl
; Go to load
jmp far INITSEG:0
print_nl:
mov ax,0xe0d ; CR
int 0x10
mov al,0xa ; LF
int 0x10
ret
;
; print_hex is for debugging purposes, and prints the word
; pointed to by ss:bp in hexadecmial.
;
print_hex:
mov cx,4 ; 4 hex digits
mov dx, [bp] ; load word into dx
print_digit:
rol dx,4 ; rotate so that lowest 4 bits are used
mov ah,0xe
mov al, dl ; mask off so we have only next nibble
and al,0xf
add al,'0' ; convert to 0-based digit
cmp al,'9' ; check for overflow
jbe good_digit
add al,'A' - '0' - 10
good_digit:
int 0x10
loop print_digit
ret
msg1:
db 13,10
db "Loading"
;.org 498
rb 512-2-$
boot_flag:
dw 0xAA55
2008年8月14日星期四
2008年8月12日星期二
2008年8月8日星期五
2008年8月7日星期四
日本人的走路神态
在区分一个普通日本人和中国人的问题上我做过几个研究。
比如走路吧。话说眼睛是心灵的窗户。
中国人可能是精光四射,注意周围的动静,并且希望从陌生人那里得到眼神的交流。
日本人自顾自,目光范围不远,有时会很无辜很淳朴善良的样子。
这些微小的区别,但是能察觉。
原因可能有两个,走在中国的路上你必须注意四周,一不留神可能会发现自己挡住了
突然到来的一辆车,或者一辆自行车。而日本行人只管走吧,是最优先的,车子会让着。
中国还要一种眼神压迫术。可以通过眼神告诉别人你很牛逼或者你很柔弱。
在日本比较礼让,大家谦和一点就行,不然大家都累。这就是我觉得日本人大智若愚的地方。
有时我在想为什么日本发展的比较发达,我发现好的事情都对未来对整体有好处的东西,
即使他是违反常识的。
2008年8月6日星期三
2008年8月5日星期二
一次郁闷的skypecast经历
来了一个女孩,声音还挺好听的,我看她个人介绍上写在澳大利亚我问她名字怎么会是日语名呢,她说因为他男朋友是日本人。我说哦。然后一个韩国人竟然问她,你觉得中国男孩和日本男孩那个好,她说她是南京人,我说我在南京也待过,她哼哼笑了一下,我脑子里浮现出南京女孩的形象,我在南京待过10年,从没遇到品德高尚的南京女孩,还不止一次有告诉我,南京人鄙视外地人的优越感。虽然作为无锡人的我丝毫没有觉得其中的必要。我快速摇了一下头,让这种成见消失。然后她很明确的说,日本男孩好,中国男孩不好。在场的中国男人们深受伤害,正欲发飙把她赶出聊天室,我把矛头引向韩国人,我说这是问题不好,人家都有日本男友,当然说日本男生好了。不过,这样的女孩说话还真是不带脑子呢。丝毫不为他人着想,也不会强调说只是自己的感受,也能保持莫名的优越感。似乎每一点都是缺点。那个韩国人说他夫人是韩国人,但是在北京留学的时候交过北京的女友。我想我虽然是中国人也没有交过多少中国女友啊。我脑子里似乎又出现见到外国人哪怕是韩国人的哪怕是外国破产者就贴上去的高贵女孩。我于是又晃了一下头,让这种偏见消失。我挺喜欢和各种文化背景的人一起聊天,日语英语中文韩国马来西亚。但是之所以写这篇是因为过了好几天,还记得并且无法消解对那个南京女孩的郁闷。
订阅:
评论 (Atom)
博客归档
-
▼
2008
(233)
-
▼
八月
(24)
- 下午的梦
- mod_python global value study
- successfully install ubuntu 8.04 linux on laptop h...
- 没事不要整理硬盘
- 小地震
- 无底洞
- 存在感
- 又投降了
- 新闻你到底要告诉我什么?
- shell to kill and wait weblogic server
- 落込み雨
- Jpeg java decoder and a testcase
- 通用bootsect
- 能量太小,打不进去
- 话题
- 简单生活的焦虑
- 关键时刻,要能不能
- 东京湾的夏天
- 脑子也可以锻炼
- 日本人的走路神态
- 如果我有了空
- 無題
- 一次郁闷的skypecast经历
- 智力下降
-
▼
八月
(24)