2013年9月9日

摘要: 由于都是平时学习的时候积累的一些detail的点,所有很碎,很杂,没什么条理。但是都是经常会用到的,或者是不容易记住的,个人感觉还是很有用。一直记在Evernote里,现在贴在这里,但愿有一条半条的对您有用。:)!$ - the last string in the last command.$? - the return value of last commanALT+./ESC+. - the parameters in the last command^old^new - replace the 'old' with 'new' in last comma 阅读全文
posted @ 2013-09-09 23:19 name2579 阅读(1091) 评论(0) 推荐(0) 编辑

2013年8月23日

摘要: Today i installed the CoLinux with Ubuntu package, but the default locale setting of the system is German, especially the keyboard is different from the U.S. keyboard. I tried many times to map some special symbols, e.g. symbol '-' is mapped to key '?', ':' is mapped to ' 阅读全文
posted @ 2013-08-23 00:17 name2579 阅读(708) 评论(0) 推荐(0) 编辑

2013年8月22日

摘要: Sometimes we want to open another file in the same folder with current editing file, what we can do to avoid typing the whole path?For better understanding, it's better to know the info showing in the table. (when making the table, i learned how to rotate a table in Excel)Now let's see how t 阅读全文
posted @ 2013-08-22 22:29 name2579 阅读(965) 评论(0) 推荐(0) 编辑

2013年8月21日

摘要: VS2003并不官方支持Win7,目前大家遇到的主要是两个问题:1. 在debug的时候,*.pdb文件在会被devenv.exe给lock住,当调适过一次之后,再进行编译的时候会有lnk1201的链接错误,说对*.pdb没有写权限,只有重启VS;2. 在进行全局搜索的时候(至少当前文件搜索没问题),整个VS2003就没有反应了,只能强行退出。解决办法:1. 这个没有简单的办法或者设置可以解决,网上已有的比较靠谱的就是用Windows Sysinternals的工具Handle(下载地址)。 首先下载Handle.exe, 然后将如下脚本保存为freepdb.bat@echo offcd /. 阅读全文
posted @ 2013-08-21 22:46 name2579 阅读(9923) 评论(18) 推荐(2) 编辑

2013年5月8日

摘要: 网上有人做了一个例子,来说明return语句在try-catch-finally语句中的执行。这里就不贴原文了,只是简单说明一下: 1 /* 情况1:没有exception发生,try 中的return 被finally中的return替换了。 2 */ 3 public class test { 4 public static void main (String[] args) { 5 System.out.println("returnInTryCatchFinally() = " + returnInTryCatchFinally()); 6 } 7 8... 阅读全文
posted @ 2013-05-08 23:57 name2579 阅读(1051) 评论(2) 推荐(4) 编辑

2013年4月24日

摘要: 1. 一个有意思的例子 1 class myClass { 2 public static void main(String[] args) { 3 Integer a = 127; 4 Integer b = 127; 5 System.ou... 阅读全文
posted @ 2013-04-24 23:06 name2579 阅读(259) 评论(0) 推荐(0) 编辑

2013年2月25日

摘要: 原文链接:http://xy7.cn/blog/post/63.html5月某天,Google将扩展工具库网址中的Extensions,全部跳转到Webstore,页面统一了。这样做的后果是:原本“右键--另存”就能下载到CRX包,现在则不能了。任何人都必须点击那个傻拉八叽的INSTALL按钮去使用喜欢的扩展……点击INSTALL之后,会发现窗口底部的下载器还是会弹出,只不过很快消失,这时打开Chrome内置下载器去寻找CRX,已经晚了,Chrome自动删除了CRX。Google真是霸气,苹果在线商店也没你们这么狠啊!我觉得,把常用扩展随身携带,这其实不是个坏习惯。比如火狐用户,谁没用扩展?C 阅读全文
posted @ 2013-02-25 14:51 name2579 阅读(282) 评论(0) 推荐(0) 编辑

2013年2月21日

摘要: 今天在看园子里的sed文章,了解到pattern space和hold space. 但是看到逆序输出文件内容的例子时有些卡壳了。虽然了解之后觉得很简单,但是对我等菜鸟来说还是需要揣摩揣摩的。说到底还是不能用Unix的方式来思考和看待问题,还需努力。sed的用法是: sed OPTIONS... [SCRIPT] [FILE...]简单说下sed的工作流程。pattern space和hold space默认都是空的。sed读入一行内容,删除尾部的换行符,存入pattern space, 然后执行SCRIPT,如果OPTIONS里没有 -n, pattern space里的内容会被输出到std 阅读全文
posted @ 2013-02-21 21:17 name2579 阅读(2491) 评论(2) 推荐(1) 编辑

2013年2月18日

摘要: 今天在调试一个小脚本时想要注掉几行代码,:(. how?刚接触shell, vim, 还没习惯其思考方式。google了一下,最简单的就是vim中的查找替换了。比如注释掉10到20行::10,20s/^/^#/g又想起来以前看过vim里有个录制宏的功能,温习了一下,步骤如下。将光标移至想要注释掉的第一行行首->ESC->qa->i->#->ESC->j->q qa: q是开始录制,后面紧跟名字,这里是a,也可以是其他最后一个q表示结束录制@a会重复刚刚录制的a10@a会重复10次还有一种方法,就是块操作:Ctrl+v,选中行,I, #, ESC开始的时 阅读全文
posted @ 2013-02-18 17:04 name2579 阅读(3404) 评论(10) 推荐(2) 编辑

2013年2月17日

摘要: 1. echoi=3;j=5;let sum=i+j;echo "sum = $sum";echo can set the text attributes and color:echo -e "\e[1;31m This is the red text \e[0m; usage:echo -e "\e[attribute_code;text_color_code;background_color_codem text_content \e[0m" attribute_code: 00-none 01-bold 04-underscore 05- 阅读全文
posted @ 2013-02-17 13:34 name2579 阅读(347) 评论(0) 推荐(0) 编辑
摘要: The caculation of Integer: 1. leti=3;j=5;let sum=i+j;let sum++;echo $sum; 2. $(())sum=$((i+j)); 3. $[]sum=$[i+j]; 4. exprsum1=`expr i+j`sum2=$(expr $i+10)The caculation of Float: 1. bc result=`echo "scale=2; 2/3" | bc`;echo $result; 阅读全文
posted @ 2013-02-17 11:22 name2579 阅读(570) 评论(0) 推荐(0) 编辑

2013年1月28日

摘要: file="class.cpp"name=${file%.*}ext=${file#*.}echo "name=$name, ext=$ext"Output:name=class, ext=cppif file="/proj/class.cpp", name will be "/proj/class".% - means to delete the matched pattern from right to left, it is non-greedy, %% is greedy;# - means to dele 阅读全文
posted @ 2013-01-28 17:17 name2579 阅读(567) 评论(0) 推荐(0) 编辑
摘要: '\n' in the replace pattern in sed command doesn't work in Mac OS X.On Debian, we can get bellowing result:root# echo abc | sed 's/[^\n]/&\n/g'abcroot# But on Mac, it goes like this:user$ echo abc | sed 's/[^\n]/&\n/g'anbncnuser$Solution is to add \'$' bef 阅读全文
posted @ 2013-01-28 16:02 name2579 阅读(252) 评论(0) 推荐(0) 编辑

2013年1月16日

摘要: bash的函数,不知道还是否有其他取得返回值的方法,这里用了$? - 上一条指令的返回值$@ - 所有传入参数, 不加引号时与$*相同。加引号后"$@"="$1" "$2" ... 而 "$*"="$1 $2 ...", $@比$*用的时候多$1 - 第一个传入参数fibonacci.sh : 1 #!/bin/bash 2 3 function fibonacci 4 { 5 if [ "$@" == "1" ]; then 6 return 1; 7 阅读全文
posted @ 2013-01-16 19:45 name2579 阅读(622) 评论(0) 推荐(0) 编辑

2013年1月10日

摘要: 心血来潮给命令行提示符上了色.vi ~/.bashrcPS1="\e[32m\w \e[33m'\t' \e[36m\$ \e[0m"之后在输入长的命令时,一行显示不下之后,光标跳到当前行的开头,覆盖之前的文本,总之很乱。解决方法,给颜色设置加括号PS1="\[\e[32m\]\w \[\e[33m\]'\t' \[\e[36m\]\$ \[\e[0m\]" 还没研究是为什么??? 阅读全文
posted @ 2013-01-10 00:26 name2579 阅读(637) 评论(0) 推荐(0) 编辑

2012年10月19日

摘要: shell为GNU bash 3.2.48我想要求用户输入数字5或者6作为参数,本人参考的是鸟哥的入门课程,里面没有(目前为止)提及条件的结合,所以做过多种错误尝试: 1 # incorrect ones 2 #while [ -z "$input" || ( ! "$input" == "5" && ! "$input" == "6" ) ] 3 #while [ -z "$input" || \( ! "$input" == " 阅读全文
posted @ 2012-10-19 15:58 name2579 阅读(566) 评论(0) 推荐(0) 编辑

2012年10月15日

摘要: 1. Edit or create file ~/.bash_profile.2. To add new alias 'll' in ~/.bash_profile with bellowing line:alias ll="ls -laG | less" 3. To add global variable:export u="/Applications/Utilities/" Save the file and open a new terminal window, those alias and variables are useab 阅读全文
posted @ 2012-10-15 11:34 name2579 阅读(237) 评论(0) 推荐(0) 编辑

2012年9月14日

摘要: Issue:error MSB6006: "mt.exe" exited with code 31Solution:project options, linker, manifest, Generate Manifest-> NO.Link:http://connect.microsoft.com/VisualStudio/feedback/details/682867/error-msb6006-mt-exe-exited-with-code-31 阅读全文
posted @ 2012-09-14 20:44 name2579 阅读(2503) 评论(0) 推荐(0) 编辑
摘要: Issue:LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-1_44.lib'Solution:Define preprocessor macro BOOST_ALL_NO_LIB in your project. 阅读全文
posted @ 2012-09-14 20:41 name2579 阅读(1098) 评论(0) 推荐(0) 编辑

2012年9月11日

摘要: Issue:编译一个InDesign CS6 Plug-in,用到boost时遇到如下编译错误:WinSock.h has already been included原因是Windows 有WinSock.h和WinSock2.h两个版本,windows.h默认include的是WinSock.h。而InDesign CS6 SDK 里用的1.44版本的boost要求WinSock2.h.Solution:1. 在一般的C++ project 中可以通过定义宏WIN32_LEAN_AND_MEAN 来解决,或者在#include <windows.h>之前加入#include &l 阅读全文
posted @ 2012-09-11 23:23 name2579 阅读(2234) 评论(0) 推荐(0) 编辑
摘要: Issue:今天在用boost 1.44时,在VS2010中遇到如下编译错误:error C2440 : cannot convert from 'boost::interprocess::mapped_region' to 'boost::interprocess::mapped_region &&'You cannot bind an lvalue to an rvalue referenceSolution:在project property中定义宏BOOST_NO_RVALUE_REFERENCES。 阅读全文
posted @ 2012-09-11 23:15 name2579 阅读(373) 评论(0) 推荐(0) 编辑

2012年9月5日

摘要: Issue:我的project 的prebuild里用到了一个自己写的exe,之前用在VS2005和08中都没有问题,在升级到VS10后,在一台win7出现如下编译错误:Error 1 error MSB3073: The command "my.exe:VCEnd" exited with code 14001The application has failed to start because the side by side configuration is incorrect please see the application event log or use t 阅读全文
posted @ 2012-09-05 23:44 name2579 阅读(2737) 评论(0) 推荐(0) 编辑
摘要: 命令提示符及批处理下字符串的最大长度:Microsoft Windows XP 或更高版本 : 8191 个字符。Microsoft Windows 2000 或 Windows NT 4.0 : 2047个字符。Solution:将参数放在文本文件中Link:http://support.microsoft.com/kb/830473 阅读全文
posted @ 2012-09-05 22:11 name2579 阅读(4141) 评论(1) 推荐(1) 编辑

2012年8月30日

摘要: http://blog.csdn.net/zhangyafengcpp/article/details/6847821 阅读全文
posted @ 2012-08-30 21:48 name2579 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Issue:VS2010以前一直用命令devenv.exe /rebuild release my.sln /project "my.vcxproj" /ProjectConfig "MyReleaseConfig" /out "D:\out.txt"编译程序,但升级到2010之后出现了编译错误1>Error: The operation could not be completed. No such interface supported========== Rebuild All: 0 succeeded, 1 failed 阅读全文
posted @ 2012-08-30 21:34 name2579 阅读(751) 评论(0) 推荐(0) 编辑

导航