jump to navigation

LaTeX, LyX, and TeXmacs October 31, 2009

Posted by Da in Uncategorized.
3 comments

I have been typing LaTeX quite a bit recently (with lots of math), and the current tools I am using is: Vim-LaTeX sutie + okular (auto-reload for preview). Vim-LaTeX suite has many convenient shorthands for efficient typesetting, such as “FBF” expands to “\textbf{}” and “SSS” expands to “\subsubsection{}”, all with proper placeholders. However, when typing complicated math formulas, it still takes some brain power to make sure all the brackets are properly placed and matched. I have defined many macros to simplify some common notation, but it could still be better. So I look into two alternatives: LyX and TeXmacs. However, both does not satisfy my needs (yet), so I have to stay with my Vim-LaTeX suite, and below is a quick summary:

LyX
Pros:

  • much more intuitive math input
  • other WYSIWYG features: such as tables, etc.

Cons:

  • Poor macro support: the math macro support is somewhat primitive and hard to use, and non-math macros are not supported at all (you can only embed them as LaTeX code, which defeats the purpose of WYSIWYG).
  • Project management: it seems to me that LyX cannot easily separate a document into multiple files (the \input mechanism in LaTeX) and I cannot find a way to define mathmacros in a separate file and share it among multiple documents.
  • Not all LaTeX features are not supported, such as “\bigl”, etc.

For a person converting from regular LaTeX to LyX (with many macros), I find the poor macro support a turn-off and will wait until it gets improved. But for a person starting to learn LaTeX, I think LyX will be a great tool.

TeXmacs
Pros:

  • intuitive math input
  • WYSIWYG
  • Support with computer algebra systems, so you can call Maple or Maxima inside TeXmacs and the output will be nicely formated. Very cool!

Cons:

  • Poor macro support
  • Again, it seems that it is difficult to “\input” or “\include” any files into a document.

So for the same reason, I have to give it up.

In conclusion, the WYSIWYG LaTeX editing systems are very nice, but basically they are something different from LaTeX. You can only go one way or the other (at least for now), and any non-trivial migration from LaTeX to them will be very painful. I hope the interoperability of LyX and LaTeX will eventually be better, so that we can get the benefits of both worlds. For TeXmacs, it appears to be more difficult as the back-end is quite different from LaTeX.

Set application to half-screen in Gnome October 12, 2009

Posted by Da in Development.
Tags: , , , , , ,
1 comment so far

I recently got a 24′ LCD monitor and one good thing about this large monitor is you can do things side-by-side. However, manually adjusting windows are not fun… After a bit googling, I am amazed to find that Compiz already had this kind of function implemented in the “Grid” plugin, where you can press a customized hotkey and then send a window to the left/right/top/bottom half of the screen, or upper/lower left/right corner of the screen. Very nice job! This is not the mostly showed feature of Compiz, comparing to those rotating cube stuff, but I think it is a lot more useful for me.

Update: for users who do not want Compiz on their X, an alternative is: QuickTile

p.s.   For Mac users, they can get TwoUp or SplitUp.
p.s.2 For Windows users, I believe Windows 7 has this built-in. I can feel that Windows 7 will be a great product, and I think the hand-writing math-input will be a killer feature for people in academia.

A visit to Bose Corporation October 12, 2009

Posted by Da in Personal.
Tags: ,
add a comment

Thanks to Al’s organization, many students in our department got to meet with Dr. Bose, the founder of Bose Corporation, and a very wise person. We chatted with him on various topics and viewed a demo on one of Bose’s recent products, a revolutionary car suspension system, and I encourage all of you to take a look at—it is simply fantastic!

And my laziness allows me only to write a few of the points that Dr. Bose made:

  • MIT is one of the largest employer in Massachusetts.
    • As a large organization, it suffers from politics, which is everywhere in academia, industry, …
  • Work takes most of the time in life. Work on something you are really excited at!
    • Have you bag packed. If you find a workplace unpleasant. Make a change.
  • The worst job is the job that earns you money (only).
  • Research is a kind of intellectual stumbling. However, this stumbling process cannot be taught, and can only be learned during the process.
    • When people write about their results, they usually take the direct route.
    • Al commented that this is a problem that faced by many new graduate students, who knew how to solve well structured problems from textbook, but don’t know how to get started in research.
    • It is not a bad thing to get further from the goal during the stumbling process, as long as you learn something.

Ubiquity rocks! September 16, 2009

Posted by Da in Development.
add a comment

See http://labs.mozilla.com/ubiquity/ . Basically you now have a launcher in your Firefox now! Very convenient!

Also check out other cool projects at the Mozilla Labs. Somehow Microsoft are never able to do these kind of cool things in their IE (maybe it is just that I don’t know, since I have not used IE for ages…)

Google tools for coding September 11, 2009

Posted by Da in Development.
Tags: ,
add a comment

Google has make some of their software library available to public via Google code, and I found the following quite useful or interesting:

And you may want to take a look at Google Style Guide. My feeling is that learning the philosophy reflected by a style guide is usually helpful.

Resuming blogging September 2, 2009

Posted by Da in Personal.
1 comment so far

People usually say they are too busy to blog, and that’s the reason I would use for not writing much here in the past half year. But no more excuse… there are stuff I found interesting and I will talk about them here. So I will resume blogging, with the hope that I will be able to write on a weekly basis.. let’s see how far can this go..

A funny story from qdb.mit.edu September 2, 2009

Posted by Da in Uncategorized.
add a comment

Quite outdated now, but somehow I found it funny:

Student walks into elevator with random woman holding flowers.

Student: Nice Flowers, what’s the occasion?

Woman: I won the Turing award.

Read more or add yours at: http://qdb.mit.edu

Efficient Simulation Management? September 2, 2009

Posted by Da in Research.
2 comments

Simulation is an important research tool to reveal insight and for performance demonstration (but not proof). Sometimes, it is not uncommon that we obtain large amount of output from simulations and need to process them in different ways, which poses two questions: how to efficiently output the data, and how to store them.

The first question is quite important when you want to simulate really fast — writing data to the disk is very very slow so you don’t want that to slow down the entire program. A solution is to use a separate thread to do it, if your programming language supports it. For example, I use the Boost Thread library if I wrote my program in C++. The data sharing between the main program and the writer thread can, most of the time, be implemented in a producer-consumer queue.

The second question is equally important, because we want to automate this process as much as possible, when facing large volume of data. A good candidate would be sqlite, which can be accessed from many programming interfaces, and then you can manipulate the data via regular SQL statements.

In general, writing to a database may take longer as there is more work to do, so one may want to simply flush it to disk in files, and import it to a database later..

Above are some experience from myself, anyone has any other ideas on the tools or methods to deal with these kind of problems? That’ll be much appreciated!

Focus on the fundamentals, they don’t change that often. February 19, 2009

Posted by Da in Research.
Tags: , ,
2 comments

Dr. Irwin Jacobs said so when I asked him about his insight on fundamental research v.s. practical relevance. He also elaborated a little bit on this, which is enlightening, but I am too lazy to write it here…

那一年 我们都没有钱 (from web) December 30, 2008

Posted by Da in Personal.
1 comment so far

不知道从什么时候开始穿阿迪 耐克
也忘记了什么时候开始用香水 唇膏
以前的冷狗现在叫鲜奶提子
以前的三色杯现在不知所终
你为什么会痴迷于打钩的东西
你又为什么想要一身产品牌子
再然后你会知道Prada和Gucci
然后会用LV的包穿Armani的衣服
直到你死去的那天
当你最后微笑着看着你身边哭泣的人们
然后慢慢回想起自己的过去
你的回忆里
是不是会充满这些牌子 牌子 牌子
还是会想起那一年 我们都没有钱的时候

我们穿着简单但是干净的衣服
略带皱褶但是整洁的鞋子
背着书包
也许路上会遇到顺路的同学
会聊起校园里的故事
那校园里的老槐树
还有透明的窗户狭窄的走道和嬉闹的孩子们
会在谈起某个同学的时候莫名地脸红
然后若无其事地岔开话题
会在体育课上尽情地欢呼
会在美术课上自由地涂鸦
然后
当班主任从窗口经过的时候赶紧收起抽屉里的漫画
抱背做好假装很认真但是内心很忐忑
会在每天做操的时候
踮起脚尖搜寻某个让自己魂牵梦萦的背影
然后在错身而过的瞬间
高傲的扬起头来
却在离开之后为自己的胆怯懊恼不已
会在收作业的时候
假装不经意的翻看检查下她的作业
其实无非就是想看看她一手漂亮的字
然后鸡蛋里挑骨头的告诉她
其实还有个简单的方法
会在早上进门的时候短暂地停留
不过就是为了能看见某个下一秒会出现在楼梯口的身影
又或者是系一系根本没松的鞋带
理一理没有被风吹乱的头发
趾高气扬的留下一个仓皇的背影
会在楼道上悄悄伸出身子
只为了能看清那个让你心跳停顿的女孩
然而当有人从你身边经过的时候
抬起头看远处的风景
把天边的云想像成她的样子

那一年 当我们没有钱的时候
每天只是幻想着某天长大了以后
背着和身体差不多大的旅行包
带着心中的那个人
走遍这个世界的每一个角落

那一年 我们还都没有钱
可是在许多年后
当我们开始注意到周围的人
他们背着LEVI‘S的、REEBOK的书包
穿G-STAR的衣服
出没在星巴克或者哈根达斯
周末的时候不是去打球而是去逛街
拿到衣服的第一反应不是适不适合
而是看看是什么牌子
会去鄙视那些穿干净的却不知道是什么牌子的孩子
会在手上挂满乱七八糟的丁丁坠坠
他们不再用激情洋溢到哀伤的情书去诉说一段感情
甚至他们会不断追求不同的女孩子去寻求刺激
然后在人群中大谈如何如何
去换取近乎嘲笑的惊叹

对DUNK了若指掌却不知道宫保鸡丁的做法
常常换着不同的发型然后假装自己很低调
又或者打电话的时候故意说些其实和自己无瓜葛的经济现象
然后再很正经地说SUPER-STAR黑灰版式多么好看

心中的对象开始划出价格
然后送名贵的香水和戒指
爱情在这个年龄被商品化
或者 商品被爱情化

男女孩子开始游弋于众多男女孩子之间
这样
人们会称之为
成熟

若当真如此
我情愿回到那一年
当我们都没有钱的时候