FC1 reading digest

Following is the reading digests for reading the FullCircle 1:

  1. Page 5, remember visit www.ubuntutribe.com for recent updates for Ubuntu Tribe Movie.
  2. Page 6, OLPC’s current status?
  3. Page 19, Scribus series.
  4. Page 18, MythTV on Ubuntu.
  5. Page 29, try GRAMPS, and try to read its sourcecode, and its implementation of the relationships. Its relationship could also be applied to the company structure. And the relationship representation, I mean, its images are well described as the relationship.
  6. Page 34, Deluge’s author interview is very good. Then we can also view his code and see deluge’s present and its comparison to other torrent software, seems azura is vanished?
  7. Page 38, Burn your DVD into other formats, for example, mp3 or other videos.
  8. Page 38, My story says beryl, and here they also said beryl, and two websites www.gnome-look.org and www.kde-look.org, try to visit and get its latest status.
  9. Page 39, try to customize your own desktop like the author’s.
  10. Page 40, game, battle for wesnoth and neverball try.

Work At Home

###FullCircle 1 BROCHURE: 小册子
Feisty Fawn: 勇敢的小花鹿
flavor: 情味,风味,推荐
gramps: 爷爷,外公(gramp的复数)
deluge: 洪水,泛滥
roaring: 喧闹的,狂风暴雨的,咆哮
genealogy: 宗谱的、族谱的
speculate: 猜测
spark: 火花,鼓动,求婚,发动,鼓舞
bravo: 好极了
hedgehog: 刺猬
badger: 獾
fawn: 小鹿
edgy: 急躁的
eft: 水蜥,小蜥蜴
metamorphosis: 变形,本质
newt: 蝾螈;笨蛋;新手
species: 物种,种类,物种上的
aquatic: 水生的,水栖的
violate: 违反,侵犯,妨碍,亵渎
patent: 专利
giant: 巨人,伟人
intellectual: 智力的,聪明的,理智的
intellectual property: 知识产权
prosecute: 检举,贯彻,从事,起诉
violation: 违反,妨碍,强奸,违背
problematic: 问题的,有疑问的,不确定的
tribe: 部落
euskara: 巴斯克语
staff: 供给
documentary: 纪录片
cyber: 网络的,计算机的
romantic: 浪漫的
cyberomantic: 数码浪漫的
trailer: 预告片
OLPC: One Laptop Per Child
inclined: 趋向于……的
faculty: 科、系、全体教员
gecko: 壁虎 Mozilla Firefox’s web engine.
intuitive: 直觉的,凭直觉获知的
alternative: 可供选择的,交替的,可供替代的选择
benevolent: 仁慈的,慈善的,亲切的
dictator: 独裁者,命令者
SABDFL- Self- Appointed Benevolent Dictator for Life
fraction: 部分,分数,小部分
nifty: 俏皮的,漂亮的
derivative: 衍生版
defrag: 整理磁盘碎片
defect: 缺点,缺陷
enchanted: 被施魔法的,使着魔
rocking: 摇摆,振动
biscuit: 小点心
peripherals: 外设
shrunk: 收缩(shrink的过去分词)
mothership: 航母
scratch: 草稿
whatnot: 放古董的架子,不可名状的东西
quirk: 怪癖,急转,借口
alleviate: 减少的,减轻,缓和。
hassle: 激辩,争论
depict: 描述,描画
supplementary: 补充的,追加的
Ubuntu/MythTV LiveCD
partial: 局部的,偏爱的,不公平的
tuner: 调谐器
fledge: 长羽毛
fledged: 成熟的,会飞的,羽翼丰满的
synaptic: (染色体)联合的
paramount: 最主要的,至高无上的
tweaking: 捏,扭,拧,对……稍做调整
variant: 变体,变种
remedy: 补救,治疗,纠正,赔偿
cope with: 处理,应付
excess: 超过
appropriate: 适当的
pedigree: 血统,家谱,纯种的
qualitative: 定性的,质的,性质上的
credibility: 可信性,确实性
collate: 核对,校对
pros: 赞同者
cons: 反对意见?缺点
credit: 赞誉,归功于
decent: 正派的,得体的,相当好的
DHT?
incorporate: 包含,吸收,体现,把..合并
outright: 全部的,完全的,彻底的,直率的,一直向前,痛快地
streak: 飞跑,疾驰,加上条纹,倾向
dominate: 控制,支配,占优势
budding: 萌芽的,发育期的
neat: 优雅,整洁的,灵巧的
spotlight: 聚光灯
grill: 烧、烤,严加盘问
interviewee: 被接见者,被访问者
interviewer: 进行面试者,面谈者
council: 委员会
yummy: 好吃的,愉快的,美味的
lizard: 蜥蜴
chameleon: 变色龙
slam: 猛地关上,砰地关上
wobble: 摇摆不定
unsung: 未被诗歌歌颂的,埋没的
thoroughly: 十分彻底的
alas: 唉(悲伤、遗憾、恐惧等)
institution: 制度,建立,习俗
tribulation: 苦难
banging: 消声器内爆炸
frustration: 挫折
prompting: 激励
cease: 停止,终了
cold sweats: 冷汗
hurdles: 障碍
fruition: 完成,成就,结果实。
criteria: 标准,条件
utilise: 使用,利用
massive: 巨量,海量
rip: 撕,锯
far right: 极右派,非常好的?
blend: 混合,协调
folks: 人们
snazzy: 华丽的,时髦的
striplight: 长条灯,带状灯
dapper:短小精悍的, 整洁的,整齐的
whee: 哟,表示兴奋的语气
arcade: 游乐场
addictive: 上瘾的
orb: 球,天体,圆形物
campaign: 运动,活动,战役
troops: 军队
aide: 协助,保护
formidable: 强大的,可怕的,令人生畏的
stunning: 极好的,使人眩晕的
relieve: 解除
stressful: 紧张的,有压力的
blast: 爆炸
tilt: 倾斜

###FullCircle 2

有关并发(3)

当一个程序的正确性依赖于一个线程需要在另一个线程到达Y点之前到达它控制流中的x点时,就会发生竞争。竞争是因为程序员假定线程按照某种特殊的轨线穿过执行状态空间,而忘了另一条规则规定的,多线程程序必须对任何可行的轨线都正确工作。
例子如下:

/* 
 * race.c - demonstrates a race condition
 */
/* $begin race */
#include "csapp.h"
#define N 4

void *thread(void *vargp);

int main() 
{
    pthread_t tid[N];
    int i;

    for (i = 0; i < N; i++) 
	Pthread_create(&tid[i], NULL, thread, &i); //line:conc:race:createthread
    for (i = 0; i < N; i++) 
	Pthread_join(tid[i], NULL);
    exit(0);
}

/* thread routine */
void *thread(void *vargp) 
{
    int myid = *((int *)vargp);  //line:conc:race:derefarg
    printf("Hello from thread %d\n", myid);
    return NULL;
}
/* $end race */

运行结果如下:

[Trusty@DashArch chapter12]$ ./race 
Hello from thread 3
Hello from thread 1
Hello from thread 2
Hello from thread 3

可以看到程序的执行流并非我们想象的。因而我们可以对程序做改造。改造后的代码如下:

/* 
 * norace.c - fixes the race in race.c
 */
/* $begin norace */
#include "csapp.h"
#define N 4

void *thread(void *vargp);

int main() 
{
    pthread_t tid[N];
    int i, *ptr;

    for (i = 0; i < N; i++) {
	ptr = Malloc(sizeof(int));                    //line:conc:norace:createthread1
	*ptr = i;                                     //line:conc:norace:createthread2
	Pthread_create(&tid[i], NULL, thread, ptr);   //line:conc:norace:createthread3
	printf("Now create the %d thread.\n", i);
    } //line:conc:norace:endloop
    for (i = 0; i < N; i++) 
	Pthread_join(tid[i], NULL);
    exit(0);
}

/* thread routine */
void *thread(void *vargp) 
{
    int myid = *((int *)vargp);
    Free(vargp); 
    printf("Hello from thread %d\n", myid);
    return NULL;
}
/* $end norace */

运行结果如下:

[Trusty@DashArch chapter12]$ ./norace 
Now create the 0 thread.
Hello from thread 0
Hello from thread 1
Now create the 1 thread.
Now create the 2 thread.
Hello from thread 2
Now create the 3 thread.
Hello from thread 3

可以看到, 为ID分配独立块,再把指向这个块的指针传递给线程是一个很好的主意。但是注意线程需要释放这些块,以避免存储器泄漏。

Convert PDF from Markdown

There are 2 ways for me to convert Markdown into PDF.

pandoc Way

Simple way for converting:

pandoc a.md -o b.pdf

Convert with embedded font:

pandoc jailbreak.md -o jailbreak.pdf --latex-engine=xelatex -V mainfont="WenQuanYi Zen Hei"

But if you includes the images, then the format maybe wrong.

RStudio Way

Install rstudio in archlinux via:

yaourt -S rstudio-desktop-bin

When installing you will meet curl need ssl certification problem, simply add following line into the pkg make file.

==> Edit PKGBUILD ? [Y/n] ("A" to abort)
==> ------------------------------------
==> y

Please add $EDITOR to your environment variables
for example:
export EDITOR="vim" (in ~/.bashrc)
(replace vim with your favorite editor)

==> Edit PKGBUILD with:  vim

Add Following:   

DLAGENTS=("https::/usr/bin/curl -k -o %o %u")

After you installed rstudio, open the markdown file in the browser,and you have to install following packages:

> install.packages("knitr")
> install.packages("devtools")
> devtools::install_github("rstudio/rmarkdown")
> library(rmarkdown)
> render('test1.Rmd', pdf_document())

Makesure your pandoc is the latest version before you really install the rmarkdown package.
If the markdown is written as in octopress, you have to specify the absolute position of the file:

>  render('/home/Trusty/code/octo/heroku/Tomcat/source/dancecrf.markdown', pdf_document())

Now in the same file you will get the generated pdf.

CURL Error in Yaourt

When downloading package, the yaourt complains:

	yaourt curl: (60) SSL certificate problem

The solution is via: Add following lines at the top of the pkg build file:

	DLAGENTS=("https::/usr/bin/curl -k -o %o %u")

Then restart the yaourt, you can pass through the building.