type opera:config in address bar, and search for "opacity" in the search field.
change the value from default 52 to 0, and apply. The window will no longer dim .
memo
Monday, September 5, 2011
how to control "double click" popup menu of opera
open file ui\standard_menu.ini, and search for "copy to note". Modify following section, and "copy" will be moved to No. 1 position.
[Hotclick Popup Menu]
Item, MI_IDM_DOCCOPY = Copy
Item, MI_IDM_SELSEARCH = Hotclick search, 200,,, "Search Web"
Item, MI_IDM_SELSEARCH = Hotclick search, 200,,, "Search Web"
Submenu, MI_IDM_SEARCH_DUMMY_PARENT, Internal Search With
--------------------1
Item, M_COPY_TO_NOTE = Copy to note
Platform Win2000-Unix-Mac, Feature Voice, Item, M_HOTCLICK_MENU_ITEM_SPEAK = Speak selection
[Hotclick Popup Menu]
Item, MI_IDM_DOCCOPY = Copy
Item, MI_IDM_SELSEARCH = Hotclick search, 200,,, "Search Web"
Item, MI_IDM_SELSEARCH = Hotclick search, 200,,, "Search Web"
Submenu, MI_IDM_SEARCH_DUMMY_PARENT, Internal Search With
--------------------1
Item, M_COPY_TO_NOTE = Copy to note
Platform Win2000-Unix-Mac, Feature Voice, Item, M_HOTCLICK_MENU_ITEM_SPEAK = Speak selection
mips instruction encoding
Instructions are divided into three types: R, I and J. Every instruction starts with a 6-bit opcode. In addition to the opcode,
R-type instructions specify three registers, a shift amount field, and a function field;
I-type instructions specify two registers and a 16-bit immediate value;
J-type instructions follow the opcode with a 26-bit jump target.
The following are the three formats used for the core instruction set:
Type format (bits)
31-26 | 25-21 |20-16 |15-11 | 10-6 | 5-0 |
R: opcode (6) | rs (5) |rt (5) |rd (5) | shamt (5) | funct (6) |
I: opcode (6) | rs (5) |rt (5) |immediate (16) |
J: opcode (6) | address (26) |
UDI instructions are added to MIPS24Kc core.
R-type instructions specify three registers, a shift amount field, and a function field;
I-type instructions specify two registers and a 16-bit immediate value;
J-type instructions follow the opcode with a 26-bit jump target.
The following are the three formats used for the core instruction set:
Type format (bits)
31-26 | 25-21 |20-16 |15-11 | 10-6 | 5-0 |
R: opcode (6) | rs (5) |rt (5) |rd (5) | shamt (5) | funct (6) |
I: opcode (6) | rs (5) |rt (5) |immediate (16) |
J: opcode (6) | address (26) |
UDI instructions are added to MIPS24Kc core.
Thursday, June 30, 2011
python example (jpeg timestamp)
This is a combination usage of:
iterator
callback
yield
image processing
Created/updated by BA43B09F0725,qunshan@newsmth
import os, sys, time
import Image, ImageDraw, ImageFont
def findfiles(path, *callbacks):
for root, dirs, names in os.walk(path):
for name in names:
filename = os.path.join(root, name)
info = tuple(x(filename) for x in callbacks)
yield (filename,)+info
def addString(filename, timestr):
font = ImageFont.truetype(os.path.join(os.environ['windir'], 'Fonts', 'AGENCYB.TTF'), 108)
im = Image.open(filename)
x, y = im.size
draw=ImageDraw.Draw(img)
#draw.ink = 0 + 255*256 + 0*256*256
draw.text((x-640,y-128), timestr, font=font)
img.save(filename)
def addTimeString(filename, mtime):
timestr = time.strftime("%Y-%m-%d %H:%M", time.localtime(mtime))
addString(filename, timestr)
os.utime(filename, (time.time(), mtime))
if __name__ == '__main__':
for filename, mtime in findfiles(sys.argv[1], os.path.getmtime):
if filename.lower().endswith(('.jpg', '.jpeg')):
addTimeString(filename, mtime)
iterator
callback
yield
image processing
Created/updated by BA43B09F0725,qunshan@newsmth
import os, sys, time
import Image, ImageDraw, ImageFont
def findfiles(path, *callbacks):
for root, dirs, names in os.walk(path):
for name in names:
filename = os.path.join(root, name)
info = tuple(x(filename) for x in callbacks)
yield (filename,)+info
def addString(filename, timestr):
font = ImageFont.truetype(os.path.join(os.environ['windir'], 'Fonts', 'AGENCYB.TTF'), 108)
im = Image.open(filename)
x, y = im.size
draw=ImageDraw.Draw(img)
#draw.ink = 0 + 255*256 + 0*256*256
draw.text((x-640,y-128), timestr, font=font)
img.save(filename)
def addTimeString(filename, mtime):
timestr = time.strftime("%Y-%m-%d %H:%M", time.localtime(mtime))
addString(filename, timestr)
os.utime(filename, (time.time(), mtime))
if __name__ == '__main__':
for filename, mtime in findfiles(sys.argv[1], os.path.getmtime):
if filename.lower().endswith(('.jpg', '.jpeg')):
addTimeString(filename, mtime)
Thursday, June 23, 2011
停车技巧
停车技巧:
非字形停车位:右侧车身 距离车位线1.5m,向后倒车; 在驾驶位位于隔一个停车位正中央时,向内侧打满轮,至车正,回正。
一字形停车: 右侧车身 距离车位线0.5m,向后倒车;在后视镜和前车B柱平行时,向内侧打满轮,继续倒车,至车呈45度角,反向打满轮,至车正,回正。
斜线停车位:后视镜对停车位近端边线时,向外侧打满轮,至车身和车位平行,回正,入车位。
非字形停车位:右侧车身 距离车位线1.5m,向后倒车; 在驾驶位位于隔一个停车位正中央时,向内侧打满轮,至车正,回正。
一字形停车: 右侧车身 距离车位线0.5m,向后倒车;在后视镜和前车B柱平行时,向内侧打满轮,继续倒车,至车呈45度角,反向打满轮,至车正,回正。
斜线停车位:后视镜对停车位近端边线时,向外侧打满轮,至车身和车位平行,回正,入车位。
自动档驾驶学习
N档的作用:
转自http://club.autohome.com.cn/bbs/thread-c-413-824998-1.html
1、被拖车时用: (拖行距离不超过50公里)。
2、长时间(超过1分钟至数分钟内)等红灯时用: (在我们这里,红绿灯都有数字递减显示。就可以根据上述原则,采取“①挂N,拉手闸。②保持D档,拉手闸。”)
3、汽车启动、熄火时: (所有汽车说明书都是讲点火要挂在P档,但问题在于: 当在P档点火后,要挂入D档前,是一定要经过R(倒车档)档,当经过R档时,车辆会自然震动一下,这是挂R档的缘故,从P档到D档过程中,等于先入了R档再入D档,无形中多了一次入R档的组合和磨擦,
我的做法是:踩着刹车打开钥匙第一级--挂N档--打火--挂D档--松手刹、放脚刹起步。
自动档熄车也有讲究,我是这样操作的: 熄火前踩着刹车挂N档--拉手刹--放开脚刹--关钥匙第一级--入P档--关钥匙第二级并取出钥匙。 其道理是:停车时,当踩着刹车入P档,拉手刹放开脚刹时,车辆会惯性地向前或向后移动一点位置,这是因为停车场不平整或有少许斜坡而造成的,不要小看这一点点移动,它会对自动变速箱中的锁止栓有一定的冲击,日积月累会对锁止栓有损害,就会出现过锁止栓断开的故障)。
转自http://club.autohome.com.cn/bbs/thread-c-413-824998-1.html
1、被拖车时用: (拖行距离不超过50公里)。
2、长时间(超过1分钟至数分钟内)等红灯时用: (在我们这里,红绿灯都有数字递减显示。就可以根据上述原则,采取“①挂N,拉手闸。②保持D档,拉手闸。”)
3、汽车启动、熄火时: (所有汽车说明书都是讲点火要挂在P档,但问题在于: 当在P档点火后,要挂入D档前,是一定要经过R(倒车档)档,当经过R档时,车辆会自然震动一下,这是挂R档的缘故,从P档到D档过程中,等于先入了R档再入D档,无形中多了一次入R档的组合和磨擦,
我的做法是:踩着刹车打开钥匙第一级--挂N档--打火--挂D档--松手刹、放脚刹起步。
自动档熄车也有讲究,我是这样操作的: 熄火前踩着刹车挂N档--拉手刹--放开脚刹--关钥匙第一级--入P档--关钥匙第二级并取出钥匙。 其道理是:停车时,当踩着刹车入P档,拉手刹放开脚刹时,车辆会惯性地向前或向后移动一点位置,这是因为停车场不平整或有少许斜坡而造成的,不要小看这一点点移动,它会对自动变速箱中的锁止栓有一定的冲击,日积月累会对锁止栓有损害,就会出现过锁止栓断开的故障)。
Sunday, June 12, 2011
cache - set associative
Cache Associative:
Full-Associative
If the replacement policy is free to choose any entry in the cache to hold the copy, the cache is called fully associative.
Direct-Mapped
At the other extreme, if each entry in main memory can go in just one place in the cache, the cache is direct mapped.
N-Way-Associative
Many caches implement a compromise in which each entry in main memory can go to any one of N places in the cache, and are described as N-way set associative.
If there are N places to which the replacement policy could have mapped a memory location, then to check if that location is in the cache, N cache entries must be searched. Checking more places takes
*PROs: caches with more associativity suffer fewer misses
*CONs: more power, chip area, and potentially time.
From direct mapped to 2-way, or from 2-way to 4-way, has about the same effect on hit rate as doubling the cache size.
Associativity increases beyond 4-way have much less effect on the hit rate
Example:
An 4K cache is often organized as a set of 256 lines(slots) of 16 bytes each.
Accordingly, a 4-way associative 4K cache has 64 sets, each set having 4 lines mapped.
A 32b address is divided into
[31:10] [9:4] [3:0]
tag set offset
For a given physical addr, first find the set with A[9:4] in cache.
Then search in all 4 slots to see if the tag A[31-10] matches the tag in the slot.
Full-Associative
If the replacement policy is free to choose any entry in the cache to hold the copy, the cache is called fully associative.
Direct-Mapped
At the other extreme, if each entry in main memory can go in just one place in the cache, the cache is direct mapped.
N-Way-Associative
Many caches implement a compromise in which each entry in main memory can go to any one of N places in the cache, and are described as N-way set associative.
If there are N places to which the replacement policy could have mapped a memory location, then to check if that location is in the cache, N cache entries must be searched. Checking more places takes
*PROs: caches with more associativity suffer fewer misses
*CONs: more power, chip area, and potentially time.
From direct mapped to 2-way, or from 2-way to 4-way, has about the same effect on hit rate as doubling the cache size.
Associativity increases beyond 4-way have much less effect on the hit rate
Example:
An 4K cache is often organized as a set of 256 lines(slots) of 16 bytes each.
Accordingly, a 4-way associative 4K cache has 64 sets, each set having 4 lines mapped.
A 32b address is divided into
[31:10] [9:4] [3:0]
tag set offset
For a given physical addr, first find the set with A[9:4] in cache.
Then search in all 4 slots to see if the tag A[31-10] matches the tag in the slot.
Subscribe to:
Posts (Atom)