pokerII

PokerII mini keyboard


Just bought it – PokerII min keyboard, but so disappointed !!

Since you can’t switch the CapsLock with other keys by hardware settings/options. That means this keyboard is totally useless for me as I’m so comfortable to use the CapsLock as left Ctrl to issue the shortcuts or command in IDE or Emacs.

According to the manual, you can use 4 switch to customize you keyboard.

  1. Switch the CAP with left Win. OMG, the only shortcut I knew about Win key is the Win-E, open a window. And on MacOSX, the Win key works as the mac flower key ( okay, I have to admit I didn’t know the name for the mac key ). It’s more convenient to locate the key in the original place.
  2. Switch the right Ctrl to `~ .  In the Poker1, you have to press the Fn + Q to switch the ESC lock mode. The ESC key works as ESC or `~ characters if you switch the mode. It’s inconvenient to input the ~ or ` character if you are using the VIM. Switch the characters to right Ctrl save the VIM programmer since they can input these characters more quickly, and needn’t to think how to do. Applause !!!
  3. Left win = Fn , Okay I didn’t knew whether this makes sense or not as I don’t believe there are some guys would depend on the programming feature heavily. According the manual, you have to press the PN + key to trigger the defined key sequence.
  4. Protect the programming from writing, means lock the keyboard layout. Should switch it to On if you complete the programming.

In summary, we can say the option1 and option3 are almost useless. I didn’t know other guy’s review, but I would suggest them to change the design.

For my case, I would like to remap the CapsLock to Ctrol, Left shift to CapsLock, then maybe we can use the left Ctrl for character ` and ~.

With PokerII, maybe we can archive that even though I didn’t verify my idea.

  • According to the manual, you can press the FN + right Shift to toggle the PN mode. Now, you don’t press the FN with the key, just press your defined key.
  • So we can remap the Shift to Caplocks, then remap the Caplocks to left control.

But if we can switch the CapsLock by hardware switch, we don’t need to be so tedious. WTF!

By the way, when I was comparing the Poker I and II, I just found the feature of Fn + key was totally forgotten by myself. You would not to press the Fn + ASWD just for moving the arrow, instead I would press the Fn + Space to toggle the arrow mode for right-most four keys to be worked as arrow. PgUp and PgDown, oooh, not, you wouldn’t use it as they are so close, you have to be chicken hands to press them :) Actually on MacOSX or Linux, you often use the Ctrl + key to scroll up/down or use the excellent the touch pad on MBP.

Reference: Poker1 Manual (from a guy’s review)

The mode can be toggled off by pressing FN+Spacebar again. The “arrow lock” becomes very useful when having to do a lot of work with the cursor keys.

FN+Q

Example with “ESC lock” on:
Tilde key = ESC, FN+Tilde key = Tilde

Example with “ESC lock” off:
Tilde key = Tilde, FN+Tilde key = ESC

SW 1 ON: Lock left windows key
SW 2 ON: Windows_L, ALT_L swap position
SW 3 ON: Caps, Ctrl_L swap position
SW 4 ON: Windows_L becomes FN_L

HTTPS Certificate Verification in Java


In Java implementation, a trusted keystore is needed to pass the certificate verification in client side. The right place to put this file is $JAVA_HOME/lib/security/ , and the name is jssecacerts . I forgot whether this file is created from the real certificate as a keystore file, or certificate directly. But when I put a file here, I don’t need to add any code or customize the SSL connection in the code for my project.

Mark this post here as a memo.

Linux内核层面和XWindow层面的键盘映射的一点研究


本文是2008年左右在红旗帮助他们开发新的发布版的时候,发在RF maillist里面的讨论。今天在整理Gmail里面的
邮件时找到,还是比较有保留的价值吧,赶紧往博客里存一篇。

Linux内核层面和XWindow层面的键盘映射研究

Linux内核

以前Rock在mail-list里面发过一个对于键盘的文章,最近我重新安装Debian系统,需要将terminal和X里面的Caps_Lock键和Ctrl键互换,
所以又针对性的研究了一下键盘。在Rock的文章里面已经又提到,系统处理键盘其实是一个挺复杂的过程。这里面要注意几个概念:

scancode 扫描码

扫描码在我们上计算机基础课程的时候,可能会有提及,在DOS系统的键盘处理中首先出现的
就是扫描码。键盘是个硬件设备,其实键盘也是有电路逻辑的,甚至可编程。从键盘中输出的就是
扫描码,这个是由键盘决定的,不是由系统来决定。
由于缺乏各种键盘型号、布局的测试环境,所以我们基本无法测试在Dvarok键盘上的按键是怎么
做扫描码布局的。或许就是扫描码是一样,通过系统设置不同实现布局不同。
键盘上的符号只是默认的缺省扫描码到最终字符的映射的,由于可以修改映射关系,所以也就可以
实现不同的keyboard layout。这个例子可以想像你买了一个二手日文键盘的笔电。

keycode 键码

其实不知道这个是否应该翻译。keycode不是扫描码那么初级的东西了,一次按键可以产生至多6个
扫描码,内核的键盘驱动会进行scancode 的parsing,实现到keycode的转换。keycode目前来说,大部分
是等于scancode的,这一点没有约定,但是这么做容易些。如果有部分按键是特殊的,可能没有对应固定的
keycode。但是从原理上来说每个按键都应该会产生scancode,内核会生成keycode,所以对于多媒体键盘,
应该是每个按键都会产生scancode,这一点我不同意rock的说法。
内核的键盘驱动,一般设定在127个keycode,对于一般的键盘都够用了。press和release产生不同的扫描码,
release事件高位(8th bit)至1。如果存在没有keycode的特殊按键,可以使用setkeycodes来给内核中的scancode
到keycode的mapping table添加entry。

keysyms 键符号

keysym就代码最终按键的处理,例如是给client application输入一个小写字符,还是一个大写字符,
还是执行一个命令。都是可以通过给keycode绑定不同的keysym来实现,我们可以理解keysym代表的是一个
函数,直接输入一个ASCII字符,只是其中的常用功能。keycode到keysyms的映射关系,就是keymap。
内核内部有一个缺省的keymap用来进行转换,典型的就是backspace按键在内核中不是backspace,
而是delete。keymap就是可以理解是linux层的keyboard layout。在/usr/share/keymaps类似的地方,
按照不同的arch存放了多种keymap。在Debian中,使用dpkg-reconfigure console-data可以设置键盘。
我们常用的都是US标准键盘。想像一个Dvarok键盘,keycode和scancode匹配,那么你看到键盘时候就是
看到相应的scancode和keycode的时候,要将keycode转化为键盘的字符,就是找匹配的keymap。
keymap的作用就是将你手头的键盘和你预想中的按键需求做一个链接,找到合适的keymap正确的表现了你键盘的
物理keycode布局和相应的按键字符布局。

那么我们可以理解,

loadkeys << EOF keycode 58 = Control keycode 29 = Caps_Lock EOF 就是实现了将 Control这个keysym赋值给58这个keycode。
关于delete和backspace,好像是bash做了相应的改变, 以实现正常的用法。如果你使用最简单的vi,应该可以体验到backspace的特殊反应。
linux层面的keymap实现,是keyboard layout的一个实现,而且,由于这个实现涉及scancode、keycode、keysym等等,
其中的数据结构需要内核的参与,所以这个实现是需要root权限的,而且一旦改变,host上的所有用户都发生了改变。
所以, 我的设置也是放在rc.local中。

相关程序: loadkeys, dumpkeys, setkeycode, keymaps(5) showkeys kbd软件包

XWindow

那么X层面的keyboard layout ? 首先,我们要了解X没有使用terminal下面的keycode。
X有使用一个类似linux的keymap,也使用keycode这个名称,但是 两者是不同的。
X是运行在Linux上的一个应用程序,所以它的键盘输入来源也是linux内核。
linux键盘驱动有一个raw模式, 在这个模式下,linux不过滤任何信息。
X作为一个操作环境,需要所有的输入信息,包括每个press和release event,所以 它要使用raw模式。
那么X会有自己的键盘驱动,来处理键盘和pointer事件。

下面我们来研究一下,如何改X环境下的Control 和 Caps_Lock。

1. 使用菜单里面的键盘设置,system >> preferences >> keyboard 在layout页面,打开layout option,其中可以设置 swap这两个键。

这个方法有个问题,键盘的LED灯还是按照原来的按键反应按键。可以看出,这个设置,就是在X键盘驱动的上面构建了一层
来实现切换。也就是说X的keyboard layout是逻辑的layout。逻辑的keyboard layout其实是一个不错的概念,但是应该使得
修改按键的方案全面。在Fedora中,似乎是可以正确显示LED灯。

2. 使用xmodmap
X的keymap格式类似linux的,两者不同的是linux下的modifiers是8个,X下是4个。

remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

使用xmodmap可以正确实现键盘布局的改变,由于是从keycode层面改变,所以LED可以正确反应。
xmodmap可以是用户级别的,所以可以在.xsesssionrc中加入xmodmap ~/.xmodmaprc来实现加载修改。

有的文章说,XFree86在2.0后,就会读入系统keymap来初始化X的keymap,但是经过测试,如果仅改变
linux层的keymap,X不会起作用,所以两者应该没有关系。而且,X的键盘设置完全脱离linux的影响,也
可以比较好的保证自己实现的独立性。

相关程序 xev xmodmap xkb( x keyboard extension)

reference :

http://www.linuxjournal.com/article/1080 The Linux keyboard driver
http://tldp.org/HOWTO/Keyboard-and-Console-HOWTO.html

Personal Library = Mendeley + Dropbox


Mendeley is a reference manager for researcher. But it not only can be used to manage your papers and create the citation for researcher, but also you can put kinds of documents into the library. And Mendeley provide the online storage for user to store and share their papers.

Unfortunately it’s very slow to sync the files up in China. Even the 2GB storage quota is very attractive , I have to figure out an approach to sync the files in a high speed between my laptops and iMac. Dropbox can sync the files in LAN, that should make the sync-up very fast.

In the preferences of Mendeley, we can set the files stored in folder ~/Dropbox/Mendeley/Files in tab File Organizer. So we export all files into this folder. The next step is syncing up the database and configuration between the machines. The database of library is in folder ~/Library/Application Support/Mendeley Desktop . So we can copy the files and directores in Mendeley Desktop into Dropbox, then create a symbol link back to original mount point. It’s done :)

~/Dropbox/Mendeley/Files &nbsp;- PDF Files.
cd ~/Dropbox/Mendeley
ln -s ~/Library/Application\ Support/Mendeley\ Desktop .

Should the Product Owner Attend Daily Scrum, Product Owner and Team Engagement


zz Excellent post about PO role in scrum team.  I should try to recite this article to enhance my vocabulary.

Should the Product Owner Attend Daily Scrum, Product Owner and Team Engagement

September 24, 2012

One of the most commonly asked question by the Product Owners (and at times other Scrum Team members) is, should the Product Owner attend the Daily Scrum? And one of the most hotly debated one is, should the Product Owner attend the Retrospective meeting? These and other such questions are related to a rather important question.

How should the Product Owners engage with an Agile teams? How much time should the Product Owners spend with the team and which meetings should she must attend? Let’s break these questions down in different categories.

  • Product Owner in the Daily Scrum
  • Product Owner in the Spring Planning Meeting
  • Product Owner engagement during the Sprint
  • Product Owner in the Sprint Review Meeting
  • Product Owner in the Sprint Retrospective Meeting

Product Owner in the Daily Scrum

The Daily Scrum is a meeting for the Team to inspect the plan it has created during the Spring Planning meeting and take any necessary corrective actions before it gets too late. The Daily Scrum is for the people doing the work, so they can work together to ensure that they remain on-track to meet their Sprint Goal, or take any other action necessary in case they feel they won’t be able to meet the Sprint Goal this time around.

The Daily Scrum is not a status sharing meeting. It’s not the meeting for the Product Owner to get status update from the team. In case she needs such information, she can always take a look at the Sprint Burndown or talk to the Team members, but not during the Daily Scrum. As the Daily Scrum is run within a tight time-box of 15 minutes, if the Product Owner, or other stakeholders keep asking about the status, the meaning of the Daily Scrum gets lost. It becomes a status sharing meeting, instead of an event where the team can effectively inspect and adapt on daily basis.

However, if the Product Owner feels value in attending the Daily Scrum, she may do so, without interrupting (i.e. talking) the team and the rhythm of the meeting.

Product Owner in the Sprint Planning Meeting

The Product Owner has a crucial role to play in the Sprint Planning meeting. She describes the Product Backlog Items (user stories or requirements in other formats) to the team. She works together with the team to ensure that she shares a common understanding of the scope of the Product Backlog Items (user stories etc). They define and refine the acceptance criteria for the user stories that the team will work on during the Sprint. They define (or refine) the Definition of Done to further improve the level of transparency in terms of what the Product Owner expects and what the team understands.

Product Owner participation in a Sprint Planning meeting is a must, otherwise the team may pick items with low value, or no value at all. This leads to waste, confusion and wasted opportunities.

Product Owner engagement during the Sprint

The Product Owner will need to spend time with the customers and project stakeholders during the Sprint. But she should remain available to the team during the Sprint. The exact level of engagement depends on the maturity of the project, is it a new project in which case the Product Owner will need to spend more time with the team or has the project has been in flight and the team understand the product domain rather well.

In a nutshell, the Product Owner should be able to respond to the questions the team may have during the Sprint in a way that it doesn’t hamper the progress of the team during the Sprint.

Product Owner in the Sprint Review Meeting

The Product Owner has the authority to accept or reject work, of course, in the light of the agreed Product Backlog. Sprint Review provides the last opportunity to the Product Owner to accept or reject work. The Scrum team (the Product Owner, the team and the Scrum Master)Â and stakeholders discuss changes in the product direction, market or competitive landscape during the Sprint Review. This discussion leads to an updated Product Backlog.

Thus the Product Owner participation in a Sprint Review meeting is crucial.

Product Owner in the Sprint Retrospective Meeting

The Scrum Team (the Product Owner, the team and the Scrum Master) works together to discuss how the whole product development process is working and how Agile and Scrum is implemented. They talk about the improvement ideas and select a few ideas to implement in the upcoming Sprint. This helps the whole Scrum Team improve continuously.

It is very difficult, if not impossible, for the Scrum Team to improve the way it plans the Sprints, manages and updates the Product Backlog, grooms the Product Backlog, the way it engages with the Product Owner and stakeholders and the way it conducts Sprint Reviews if the Product Owner is not present in the Retrospective meetings. The Scrum Team needs support from the Product Owner to get resources it needs. The Product Owner doesn’t need to be present the whole time though, e.g. when the Scrum team talks about engineering practice improvements etc.

However, it is crucial the Product Owner participates in the Retrospective meetings in a meaningful way.

WordPress themes


Changed the themes for my wordpress blog : leohacker.wordpress.com. Spent several hours to search and test, finally choosing the two themes as candidate theme: Twenty Twelve and Superhero. Since I can’t change the font for design, so the most important factor of a theme is the default font style and size, as well as whether it can be customized a little. Another concern is whether the code can be showed in text box, be better if having syntax highlight.

Twenty Twelve

The old theme of my blog is the Twenty Ten, which has an image bar on the top and sidebar, and the font. The twenty twelve must be the upgrade version,  simpler and cleaner, a font good enough both for English and Chinese. It’d better if the date and tags can be showed in the header of post, and rating stars can be moved to the bottom. The separate bar is good to make the continuous post to be recognized individually. With some themes, the post title is almost same as the text of last post, or just a little bigger size, a bad design.

SuperHero

Even I chose the twenty twelve, the super hero is strongly recommended as candidate. Better layout and beautiful color, but the font size is smaller. And I was used to read the text in font style of twenty twelve. Maybe I would switch the theme back and forth.

Responsive

The responsive design is popular. But this theme has a poor font style and layout, and the issue of can’t find the boundary of posts.

Chalkboard

Chalkboard is a very interesting theme, but I guess you shouldn’t input too many words here. And the any image should be inappropriate for this theme. But if you can’t chitchat, why you need a blog ?

Ryu

Ryu is the theme I liked before. The large size of font, but actually the font size is huge in this theme. I might use it already if the font size of title and text can be smaller. The large font size and one post per page can lead the reader to concentrate on reading, but don’t be huge!

Chunk

I use this theme for my non-technical blog leonote.wordpress.com. Excellent theme if you want to write some critical comment articles. The Chinese characters seem to be render better than other themes. Splendio can be a candiate theme for leonote blog also.

CGLib


HomeURL: http://cglib.sourceforge.net/

Language: Java

SCM: CVS

cglib is a powerful, high performance and quality Code Generation Library, It is used to extend JAVA classes and implements interfaces at runtime. 

MyComments: 我是从”深入理解Java虚拟机”这本书中了解到这个项目。很显然,cglib的作用是在运行时扩展Java的类和动态实现。这个属于Java语言的高级特性,据说在spring和hibernate 这样的项目中也有用到。