佳音的博客

2010/08/25

关于 ubuntu 下 eclipse 代码编辑区域 在代码 补全 后不能编辑 的笔记

Filed under: Uncategorized — 佳音 @ 12:25 pm

以前没有发现这个问题, 今天下了一个eclipse3.6 装了之后,发现编辑代码时,补全之后 编辑器貌似还在获得焦点,
但是不能type 字符,很奇怪,
google 了一下,没有找到,解决方案,
这次baidu很出息,找到是scim问题, 据说还是一个老问题,

修改
/etc/X11/xinit/xinput.d/scim
将原来的
GTK_IM_MODULE=xim
QT_IM_MODULE=xim
改成
GTK_IM_MODULE=scim
QT_IM_MODULE=scim

之前在切换 terminal 的之后, 开始的时候键盘反应慢的问题也解决了。

2010/07/25

Twitter 更新 for 2010-07-25

Filed under: Uncategorized — Tags: — 佳音 @ 4:20 pm
  • firefox + foxyproxy + ssh 比vpn 好用多了 #

Powered by Twitter Tools

Twitter 更新 for 2010-07-25

Filed under: Uncategorized — Tags: — 佳音 @ 4:20 pm
  • firefox + foxyproxy + ssh 比vpn 好用多了 #

Powered by Twitter Tools

2010/06/03

High.Performance.MySQL2nd.Edition

Filed under: 电子书 — 佳音 @ 4:46 pm

O’Reilly.High.Performance.MySQL,2nd.Edition
O’Reilly.High.Performance.MySQL,2nd.Edition中文版

2010/05/15

git手册

Filed under: Uncategorized — 佳音 @ 11:41 am

http://progit.org/book/zh/

2010/05/14

pylons 部署 + fastcgi

Filed under: Uncategorized — 佳音 @ 4:54 pm

http://www.rightbrainnetworks.com/blog/deploying-a-pylons-app-to-production-step-by-step-part-2-of-2/comment-page-1/#comment-27

2010/05/13

python datamodel 貌似这页应该好好看下

Filed under: Uncategorized — 佳音 @ 11:19 pm

http://docs.python.org/reference/datamodel.html

2010/05/12

the.Definitive.Guide.to.Pylons.Dec.2008.pdf

Filed under: python — 佳音 @ 12:35 am

Apress.the.Definitive.Guide.to.Pylons.Dec.2008

2010/05/01

python epoll demo

Filed under: python — 佳音 @ 2:03 pm

from http://www.codexon.com/posts/debunking-the-erlang-and-haskell-hype-for-servers
epoll.py

  1.  
  2. import select
  3. import socket
  4.  
  5. EPOLLIN = select.EPOLLIN
  6. EPOLLOUT = select.EPOLLOUT
  7.  
  8. epoll = select.epoll(60000)
  9. connections = {}
  10.  
  11. class Server(object):
  12.     def __init__(self):
  13.         sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  14.         sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  15.         sock.setblocking(0)
  16.         sock.bind((, 8050))
  17.         sock.listen(60000)
  18.         self.socket = sock
  19.  
  20.         fileno = sock.fileno()
  21.         connections[fileno] = self
  22.         epoll.register(fileno, EPOLLIN)
  23.  
  24.     def onInput(self):
  25.         sock, address = self.socket.accept()
  26.         Client(sock)
  27.  
  28. class Client(object):
  29.     input  =
  30.     output = "HTTP/1.0 200 OK\r\nContent-Length: 5\r\n\r\nPong!\r\n"
  31.  
  32.     def __init__(self, sock):
  33.         sock.setblocking(0)
  34.         fileno = sock.fileno()
  35.         epoll.register(fileno, EPOLLIN|EPOLLOUT)
  36.         connections[fileno] = self
  37.         self.socket = sock
  38.  
  39.     def onInput(self):
  40.         newdata = self.socket.recv(1024)
  41.         if len(newdata) is 0:
  42.             self.close()
  43.         self.input += newdata
  44.  
  45.     def onOutput(self):
  46.         sent = self.socket.send(self.output)
  47.         self.output = self.output[sent:]
  48.         if len(self.output) is 0:
  49.             self.close()
  50.  
  51.     def close(self):
  52.         fileno = self.socket.fileno()
  53.         del connections[fileno]
  54.         epoll.unregister(fileno)
  55.         self.socket.close()
  56.  
  57. Server()
  58.  
  59. while 1:
  60.     for fd, event in epoll.poll():
  61.         if event & EPOLLIN:
  62.             connections[fd].onInput()
  63.  
  64.         if event & EPOLLOUT:
  65.             connections[fd].onOutput()
  66.  
  67.  

2010/04/30

了解 epoll 之 python

Filed under: python — 佳音 @ 11:46 pm

http://scotdoyle.com/python-epoll-howto.html

Older Posts »

Powered by 00RZ