wasted

这里会记录我在哪些事情上浪费过时间,记下来争取下回如果需要再配置一番的话不需要再 浪费一次。

1 eclipse在debian底下表用系统自带的

用这个版本装不了android的adt插件,并且也可能装不了eclim。直接从eclipse的网站上去下载一个安装包回来比较靠谱。

2 装eclim的时候eclipse home要选自己下载的eclipse的目录

并且不要点user local目录,例如 ~/.eclipse/org.eclipse.platform_3.7.0_155965261/ , 这个是系统自带的eclipse版本才用的,点上这个之后反而装不上eclim了。

3 vs2008必须装sp1才能避免此错误:

.\stdafx.cpp : fatal error C1902: Program database manager mismatch; please check your installation

泪奔,装sp1是解决不了这个问题的。这个错误只会在用ssh登录上去运行 vccompile的时候才会发生。并且是那种用了 id_rsa 不需要输入密码的情况下。

这种情况下登录上去后看系统的环境变量USERNAME是system,而如果把client端 的 id_rsa 移走,要求输入密码之后登录上去的话,看环境变量USERNAME就是我的 用户名bhj。所以这是一个cygwin的bug,最后的uid取决于登录时是否输入了密码。

所以真正的解决方法是让sshd服务用bhj帐号去启动,这样不管我怎么登录上去的,最后的权 限都是我的用户帐号bhj,而不是变成系统的system帐号。

4 /etc/resolv.conf dns被改掉

/etc/network/interfaces里最好把eth0都去掉,因为它会导致dhclient跑起来,从而让 dns的设置过一段时间就被强行改掉

5 改xp与win7的双启动修复利器:ntbootautofix。dual boot。

6 ~/.fonts下放一个windows下拷过来的symbol.ttf字体文件会导致evince打开pdf文件一些特殊字符显示异常

7 C precedence table

  | NOTE: See also the general page on C Programming.                                            
  |                                                                                              
  | The follow is the order of precedence, from highest to lowest, for the C programming         
  | language:                                                                                    
  |                                                                                              
  |     +---------------------------------------------------------+                              
  |     |                Operator                | Associativity  |                              
  |     |----------------------------------------+----------------|                              
  |     | (expr)    [index]    ->    .           | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | !    ~    ++    --    (type)    sizeof | Right <== Left |                              
  |     | Unary operator:    +    -    *    &    |                |                              
  |     |----------------------------------------+----------------|                              
  |     | *    /    %                            | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | +    -                                 | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | <<    >>                               | Left ==> right |                              
  |     |----------------------------------------+----------------|                              
  |     | <    <=    >    >=                     | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | ==    !=                               | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | Binary operator:    &                  | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | Binary operator:    ^                  | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | Binary operator:    |                  | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | &&                                     | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | ||                                     | Left ==> Right |                              
  |     |----------------------------------------+----------------|                              
  |     | expr ? true_expr :  false_expr         | Right <== Left |                              
  |     |----------------------------------------+----------------|                              
  |     | +=    -=    *=    /=    <<=            | Right <== Left |                              
  |     | &=   ^=    |=   %=   >>=    =          |                |                              
  |     |----------------------------------------+----------------|                              
  |     | ,                                      | Left ==> Right |                              
  |     +---------------------------------------------------------+                              
  |                                                                                              
  | Unary operator:                                                                              
  |                                                                                              
  |     +-----------------------+                                                                
  |     |  Unary   |  Example   |                                                                
  |     | Operator |            |                                                                
  |     |----------+------------|                                                                
  |     | +        | +23209     |                                                                
  |     |----------+------------|                                                                
  |     | -        | -value     |                                                                
  |     |----------+------------|                                                                
  |     | *        | *pointer   |                                                                
  |     |----------+------------|                                                                
  |     | &        | &variable  |                                                                
  |     +-----------------------+                                                                
  |                                                                                              
  | Binary operator :                                                                            
  |                                                                                              
  |     +---------------------------------+                                                      
  |     |  Binary  |       Example        |                                                      
  |     | Operator |                      |                                                      
  |     |----------+----------------------|                                                      
  |     | &        | t = 0xCC; p = 0xAA;  |                                                      
  |     |          | (t & p) == 0x88;     |                                                      
  |     |----------+----------------------|                                                      
  |     | ^        | r = 0xF0; w = 0xCC;  |                                                      
  |     |          | (r ^ w) == 0x3C;     |                                                      
  |     |----------+----------------------|                                                      
  |     | |        | x = 0x99; y = 0x96;  |                                                      
  |     |          | (x | y) == 0x9F;     |                                                      
  |     +---------------------------------+                                                      

8 Emacs grep-mode can not find file under tramp remote editting:

Suppose your remote grep turn out these result, and you press M-g n to try to jump to the first match, it tells you the file is not found. If you just press enter when it ask which file to visit instead, the error message says:

read-file-name: anything-read-file-name: file `/scp:bhj@10.21.131.31:/home/bhj/src/jb-988-bpe.bak2/frameworks/base/telephony/java/android/telephony/gsm/SmsMessage.java' is not matched

The bug turns to be because there is a local /home/bhj/src/jb-988-bpe, which is a symbolic link to /home/bhj/src/jb-988-bpe.bak2. So it seems this local symlink can subtly change the remote grep-mode target directory.

-*- mode: grep; default-directory: "/scp:bhj@10.21.131.31:/home/bhj/src/jb-988-bpe/frameworks/base/telephony/java/android/telephony/gsm/" -*-
Grep started at Wed Dec 12 17:30:57

grep-gtags -e "getSubmitPdu" -p java
gtags: invalid option -- 'u'
Usage: gtags [-ciIOqvw][-d tag-file][-f file][dbpath]
Found total 13 definitions: Entering directory `/home/bhj/src/jb-988-bpe'
frameworks/base/telephony/java/android/telephony/gsm/SmsMessage.java:245: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/android/telephony/gsm/SmsMessage.java:273: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/android/telephony/gsm/SmsMessage.java:303: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/android/telephony/SmsMessage.java:397: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/android/telephony/SmsMessage.java:426: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java:212: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java:233: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java:376: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java:395: public static SubmitPdu getSubmitPdu(String scAddress,
frameworks/base/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java:296: public static SubmitPdu getSubmitPdu(String scAddr, String destAddr, String message,
frameworks/base/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java:326: public static SubmitPdu getSubmitPdu(String scAddr, String destAddr, int destPort,
frameworks/base/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java:363: public static SubmitPdu getSubmitPdu(String destAddr, UserData userData,
vendor/marvell/carrier/BackupRestore/src/com/marvell/bkrs/sms/pdu/SmsPduBackup.java:318: private SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, byte[] header, int encoding, int languageTable, int languageShiftTable, long date) {

Grep finished (matches found) at Wed Dec 12 17:31:00

9 Everytime you change apk resource, you must do a clean build

So that all .java files are recompiled, or else something weird will happen. This is a lesson learned in developping crossdict.

10 acroread: how to open url in a browser

Preferences -> Trust Manager -> Internet Access from PDF … Change Settings -> Allow all web sites

11 org-beamer:

必需有一个大section,然后再能有一张一张的slides。如果光有slides,没有 上级的section,所有的slides会挤到一起去。

12 use openbsd-inetd to start ssh on 443:

cat > /etc/inetd.conf <<EOF
443   stream  tcp nowait root /usr/sbin/sshd sshd -i
EOF

# then update /etc/apache2/ports.conf: remove the following lines.

<IfModule ssl_module>
	Listen 443
</IfModule>

<IfModule mod_gnutls.c>
	Listen 443
</IfModule>

# then restart the services:

sudo systemctl restart openbsd-inetd.service

13 hell of ime hotkeys

If you want to disable the shift+space and control+period hotkeys for windows ime, you can use my no-control-period.reg and no-shift-space-toggle.reg, then you need to open the control panel and the language hotkey setting page, then click to disable the hotkeys, after that, if you click Apply, you will see that the hotkeys are enabled again – this is a Windows bug – but the hotkeys are now changed to Shift+F11 and Control+F11 respectively.