Finisky Garden

NLP, 软件工程, 产品设计

Windows下的emacs用起来体验不是太好,对中文的支持也不太行。偶尔打开一次需要输入个中文发现用Ctrl+Space或Win+Space都调不出第三方输入法(如腾讯或搜狗输入法)。

忘了在哪看到过一个简单解决方案:在emacs窗口中,按住Ctrl的同时按下鼠标左键会出现一个Buffer Menu,然后随意点一下别处将此Menu消除,再用预设的输入法切换快捷键(Ctrl+Space或Win+Space之类)即可。

emacs input method

感慨一句,emacs最近用得越来越少,尤其是在有了VSCode Remote Development Extention之后,在Windows下远程SSH到Linux下开发便捷许多,甚至可以远程像本地一样运行和DEBUG。

现在用emacs基本是SSH Linux时编辑些配置文件,不再有以前折腾各种插件和炫酷效果的激情,追求的是光速启动和直达目标,用的是肌肉记忆快捷键的情怀:-)

Recently, I found there were huge amount of files named .com.google.Chrome.* be created in my /tmp folder. Obviously the culprit is Chrome. However, after some research no solution is found to prevent Chrome creating these garbage.

/tmp$ du -csh .com.google.Chrome.*

8.0K    .com.google.Chrome.00OKwD
104K    .com.google.Chrome.013jYf
172K    .com.google.Chrome.015x5t
...
48K     .com.google.Chrome.Zytrhf
16K     .com.google.Chrome.zz233G
36K     .com.google.Chrome.ZzrsZY
163M    total
/tmp$  find /tmp -name ".com.google.Chrome*" -ls| wc -l
3468

Update 2020/12/12 I found there are lots of .com.google.Chrome.* files in /tmp/snap.chromium/tmp :-( . Look at the ncduresults:

--- /tmp/snap.chromium/tmp -------------------------------------------------------------------------
                         /..
    4.1 MiB [##########] /.com.google.Chrome.xTBobr
    4.1 MiB [######### ] /.com.google.Chrome.0hcsFR
    4.0 MiB [######### ] /.com.google.Chrome.YdhzL5
    4.0 MiB [######### ] /.com.google.Chrome.nJ5W3A
    4.0 MiB [######### ] /.com.google.Chrome.unS6es
...
 Total disk usage:   6.8 GiB  Apparent size:  12.1 GiB  Items: 482530
Now the cleanup script has been updated.

阅读全文 »

正确使用异常处理可以让代码逻辑变得清晰,使程序的鲁棒性更好,并可以准确捕捉到一些细节的错误。那么问题来了,异常的使用场景是什么,实践中又有哪些常见问题,本文简单讨论一二。

阅读全文 »

Yesterday, when I login to my VM I found that the disk is full. Even a tab command completion cannot be done. I immediately delete some unused files and the system works. However, when I reboot the system, it stucked at A start job is running for Create Volatile Files and Directories...:

阅读全文 »

半年前写过篇如何换启辉器和环形灯管,得,家里的老式日光灯又坏了,灯开着嗡嗡响,看起来像是镇流器出了问题,但环形灯管的头部也发黑了,灯的频闪也比较重,所以想买镇流器和灯管给换上。

老式荧光灯的构造比较复杂,启辉器+镇流器+灯管,T5/T8 22W 环形灯管20块左右,对应镇流器30块左右。用过日光灯的都知道,启辉器有多容易坏……花50块钱换一堆淘汰不禁用的东西,不大划算。 Old Lamp Original

阅读全文 »

After I changed the HOME folder to another place, I copied the ssh config folder from old HOME to the new place. Supposedly it should directly work, right? However, when I login the server with my private key, the server said: "Server Refused Our Key"...

阅读全文 »

Unity supports three ways of registering types:

  • Instance registration
  • Type registration
  • Factory registration

Typically, Instance registration and Type registration resolve dependencies through ResolvedParameter<T>, while Factory registration resolve dependencies by a factory delegate. In practice, when you want to resolve a List<T> or Dictionary<T1, T2>, Factory registration is what you want. Let's go through how to resolve a collection of customized classes.

阅读全文 »

SVM的函数间隔定义中会用到点到超平面距离的推导,《统计学习方法》中对此没有详细的解释,当然这个问题有许多解法,找到了一种比较直观的解法如下。

阅读全文 »

QuickSort 快速排序是常见的考察代码基本功面试题。简洁易读的实现可以一定程度展现面试者的代码功底。

算法导论对于快排讲解的很透彻,也有伪代码,即便如此,网上许多实现还是错的,不能通过一些边界用例,如数组已排序或数组中有重复元素的情况。还有一些用python的实现不满足原位排序(in-place)的要求,直接新建两个新List,这种方法其实也是取巧,简化了partition函数的实现难度。

阅读全文 »
0%