5/27/2012

超大文件排序

16:00
我报的错是 /tmp/sortA3aLjF: No space left on device。直接用HPC无法解决gigabyte级别的排序问题了,估计得用外排序做。晚点po结果
19:30
其实bash里面的sort是可以做到的。因为这个sort本来就是n路merge外排序。默认临时文件存在/tmp目录下。因为我的/tmp目录下空间不足,所以会报错。使用-T换至自定义的路径即可

http://vkundeti.blogspot.com/2008/03/tech-algorithmic-details-of-unix-sort.html
http://www.linuxquestions.org/questions/linux-newbie-8/sort-big-files-tmp-sorta3aljf-no-space-left-on-device-823971/

5/19/2012

Fast-forward to other forks

For convenience to develop and not to mix with my original project (Moonlyt/Moonlyt) in the team, I forked the project to my own repository (Wenling/Moonlyt) and do local development. But actually I have no idea how to keep my repo up-to-date with the original one, and this brought me a lot of trouble like I have to clone one to my local path then delete the old one of mine...

It's quite easy to reserve my own branch.

Reference:
http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

# switch to a new branch
git checkout -b upstream/master
# bind the branch to the remote original one 
git remote add upstream git://github.com/moonlyt/moonlyt.git
# usually fetch is better as it don't automatically implement the merge command for 
# you. Pull request for update from original (upstream) to my repo (master)
git pull upstream master
# switch to my master branch
git checkout master
# merge upstream and my master branch
git merge upstream/master
# push 
git push origin master




ctrl-z和ctrl-c都是中断命令,但是他们的作用却不一样.
ctrl-c是强制中断程序的执行,
ctrl-z是将任务中断,但是此任务并没有结束,他仍然在进程中他只是维持挂起的状态,用户可以使用fg/bg操作继续前台或后台的任务,fg命令重新启动前台被中断的任务,bg命令把被中断的任务放在后台执行.
恢复挂起的程序命令:
1、用jobs 查看被挂起程序的序号x
2、用fg %x 恢复被挂起程序(如果只有一个被挂起程序,那直接fg就可以恢复了)

5/07/2012

DPLL implemented with c++


First C++ code written... I think it's quite efficient with all the test set included in path data.

The simplest data set looks like:
-1 -3 0 -1 -5 0 -3 -5 0 -2 -4 0 -2 -6 0 -4 -6 0 1 2 0 3 4 0 5 6 0

used vector saving clauses and map saving assignments.
the main recursive function looks like following:
/*
1. If the set of clauses is empty, it returns true
2. Otherwise, if the set of clauses contains an empty clause, it returns false
3. Otherwise, if there is a unit clause, it applies unit propagation and then calls itself recursively
4. Otherwise, if there is a pure literal, it applies the pure literal rule and then calls itself recursively
5. Otherwise, it applies either the resolution rule or the splitting rule and calls itself recursively
*/

Git Repo: git@github.com:Wenling/DPLL-Algorithm.git
Google Drive: https://docs.google.com/file/d/0B0mZhauSOmW4dFZESVRtMGRpWms