LaTeX笔记(1)

取消连字符
\sloppy: 弱命令
效果不是很明显,但是基本保证布局美观

\pretolerance=10000: 强命令
效果很明显,几乎可以去掉所有连字符,但是对布局影响很大
10000是一个阈值,可以适当变小,可能会有比较折中的效果
补救措施:在字符间距非常大的地方用 \- 命令强制生成连字符

引号
` ` : 左双引号(两个小撇,和波浪号同一个键)
` : 左单引号(一个小撇,同上)
‘ ‘ : 右双引号(两个单引号)
‘ : 右单引号(一个单引号)
P.S.请不要直接复制粘贴,中间有空格,为了HTML下的显示需要

强制不分行
\mbox{content here will not be split up}

四级标题
\section{}
\subsection{}
\subsubsection{}
\paragraph{*.*.*.* }

波浪线
\~{}

上角标
\textsuper{}: 非数学环境
^{}: 数学环境

首段缩进(默认不缩进)
\usepackage{indentfirst}

推荐的格式设置
\documentclass[a4paper,12pt]{article}: 纸张类型,主体字号,文档类型
\usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry}: 页边距

简历模板

http://www.ctan.org/tex-archive/macros/latex/contrib/tucv

超链接去边框和颜色
\usepackage[colorlinks,allcolors=black]{hyperref}

嵌入所有字体
dvips -Pdownload35 inputfilename.dvi

Android平台下FreePascal的交叉编译器

0) Preface
0.1) The Operating System is Ubuntu 10.10
0.2) All the softwares are the latest stable version by April 12, 2011

1) Download the Source of Free Pascal Compiler
The ‘fpc-2.4.2.source.tar.gz’ on http://sourceforge.net/projects/freepascal/files/Source/2.4.2/

2) Install the fpc-source. Just extract it.
The root folder of fpc-source for me is ‘/home/victorhu/fpc-source’

3) Download the Arm-Eabi (Sourcery G++ Lite 2010.09-50 for ARM GNU/Linux)
The ‘IA32 GNU/Linux Installer’ on http://www.codesourcery.com/sgpp/lite/arm/portal/release1600

4) Install the Arm-Eabi (Sourcery G++ Lite 2010.09-50 for ARM GNU/Linux)
The installation need the system shell to be bash not dash which is default for Ubuntu. So
4.1)

sudo dpkg-reconfigure -plow dash

Choose NO to make the bash as the system shell.
4.2) Goto the root folder of Arm-Eabi for me is ‘/home/victorhu/toolchain/’
4.3)

chmod +x arm-2010.09-05-arm-none-linux-gnueabi.bin

4.4)

./arm-2010.09-05-arm-none-linux-gnueabi.bin

5) Get the Cross Compiler
5.1) Goto the root folder of fpc-source
5.2)

make crossall CPU_TARGET=arm OS_TARGET=linux OPT="-dFPC_ARMEL -O- -gl"  CROSSPORT="-O-" CROSSBINDIR=/home/victorhu/toolchain/arm-none-linux-gnueabi/bin

5.3) The ‘ppcrossarm’ under ‘/home/victorhu/fpc-source/compilers/’ is just what we want.
Note: CROSSBINDIR is depend on the folder of Arm-Eabi.

6) Write a Hello Word in Pascal
The path for me is /home/victorhu/hello.pas

Program hello;
begin
writeln('Hello World!');
end.

7) Compile the Hello World in Pascal via CrossCompile Environment.
7.1) Goto the folder contains ‘ppcrossarm’
7.2)

./ppcrossarm -Tlinux -O- -XP -Fu/home/victorhu/fpc-source/rtl/units/arm-linux/ -FD/home/victorhu/toolchain/arm-none-linux-gnueabi/bin /home/victorhu/hello.pas

Note: -Fu is the unit path, -FD is the compiler utilities path.
7.3) The ‘hello’ under ‘/home/victorhu/temp’ is just the what we want (not hello.pas).

8) Test the Crosscompiled Hello World in Android Emulator
8.1) the tools under Android SDK or the ADT of Eclipse is where we can find it.
8.2) Goto the adb root folder under Android SDK .
It’s ‘platform-tools’ under the main root folder of Android SDK now while it’s ‘tools’ before.
8.3) Test whether is device is connected.

./adb devices

If it shows somthing like ‘Emulator-5544 device’ (for me), then it’s right.
8.4) Push the program into Android Emulator.

./adb push ~/hello /data/hello

8.5) Run the program on the Android Emulator.

./adb shell data/hello

If it shows ‘Hello World!’ (the result of the original program), then everything is done now!

9) Reference
9.1) http://alexmogurenko.com/blog/programming/android-building-free-pascal-compiler-for-android/
9.2) http://wiki.freepascal.org/Android_Interface
9.3) http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM

P.S.本文参与“第二届 Google 暑期大学生博客分享大赛 – 2011 Android 成长篇”,感谢大家支持

无题

其一

离开你的体温
一切都变得阴冷
漆黑的屋顶
闯入的光影
这是梦中惊醒
还只是另一个梦
梦中全身每一个细胞都在呼唤着——想你

2011.03.17凌晨
于家

其二

我常忍不住思考
两个人在一起的
意义甚至是目的
或许有些问题
就没有答案
只因为你是你
只因为命中注定

2011.03.22
于南信南阶

我喜欢黑夜、思考还有你

夜里11点左右从宿舍来实验室,悠闲的骑行在人迹稀少的道路上,一直很享受深夜的宁静,只是因为喜欢,所以很享受。

米兰.昆德拉说过“人类一思考,上帝就发笑”,人类相对于世界是渺小的,但这不是说人类不应该思考,生活不能没有思考。

从一开始痛苦纠结,甚至用颓废麻痹自己,后来发现那只能带来更多的愧疚。记不清是什么原因,拾起了已经遗忘很久的书香。除了专业书,有小说,有散文,有书信,甚至还有绘本;有人生的,有心理的,有感情的,甚至还有宗教的,数量并不多,覆盖面却出奇的广。

认识了不少新朋友,也和一些以前仅仅认识的有了更深的交流,还和一些以前的朋友恢复了联系。聊了很多,从一开始近乎吐槽的倾述,到后来更多的讨论人生、理想。

从小学到大学,不仅教科书没好好读,其他书也看的越来越少,思考更少的可怜。不知道自己真正想要什么,只是大家都在努力的学习,只是想考一所更好的学校。然而一切想法到此为止,等到去了更高一级的学校,就开始了新的轮回。

很庆幸能在这样一个时间段里适当的放缓脚步,很认真的看书,很真诚的交流,很努力的思考。想明白了很多,那些虚荣的暧昧,那些现实的顾虑,那些自扰的困惑,究竟什么是感情,什么是喜欢,什么是相爱,还有很多很多。更重要的是,我知道了自己想要的,怎样做才是对的。我不会再犹豫,不会再顾虑,更不会再婆婆妈妈的。

我喜欢你,黑夜。我喜欢你,思考。我喜欢你,我的晓。

我只是想简简单单的生活……

最近不是很忙,在实验室也散散漫漫的,但也没怎么闲着,折腾VPS,整理了不少东西。

昨晚心里乱乱的,很冲动的找了lsn同学,拉着TA陪我去KFC聊天,一直说到了天亮,莫名其妙的就通宵了。吃了早饭才回去睡觉,一直睡到了中午,脑子还是乱乱的……

说了很多话,也想了很多事。我从来没有想过一切会变得如此纠结,让人困扰,却又无法放弃。

我从没有觉得自己很优秀,我想要的也只是简简单单的生活……

P.S. 感谢lsn同学的陪伴,真的很感谢~