nick chen2023-08-05T07:49:02+00:00http://vazexqi.github.comNick Chentmux, vim and zsh2015-07-05T00:00:00+00:00http://vazexqi.github.com/posts/2015/07/05/triumvirate<p>It’s been about two years since I started working at Salesforce.com. It’s been
an eventful two years. There are plenty of interesting and challenging
problems to work on. And we have a good set of internal tools that we use to
get our stuff down.</p>
<p>We work using a variety of different languages with a very large code base.
And, most of the time, the three tools that I have found indispensable are
tmux (or your favorite terminal multiplexer), vim (or your favorite terminal
editor) and zsh (with the oh-my-zsh plug-ins).</p>
<p>In fact, I would say that these three tools, when adequately configured, are
the most useful things that one can have in their repertoire of developer
tools. They work almost everywhere – this is very important when you are not
sure which machine you need to be working on locally or remotely. They are
good are what they do – handling everything from the simple cases to the more
complex ones where loading full fledge GUI application through the internet is
just not feasible.</p>
<p>So if you have any time at all, I think it is a good investment to start
learning how to use these tools. I started off during my years at the
university. The initial learning curve might be steep but you can always start
small and move on from there. All of these tools that I will be talking about
are easily configured. To get you started, I’ve shared my configuration files
in my <a href="https://github.com/vazexqi/dotfiles">dotfiles</a> repository on Github.</p>
<p>Let’s start with the most essential, tmux.</p>
<h2 id="tmux">tmux</h2>
<p><a href="http://tmux.sourceforge.net/">tmux</a> is a <em>terminal multiplexer</em>.</p>
<blockquote>
<p>It lets you switch easily between several programs in one terminal, detach
them (they keep running in the background) and reattach them to a different
terminal.</p>
</blockquote>
<p>Why is this useful?</p>
<p>Everyday, I get to my office, open the terminal at my workstation and hack
away. I open several programs in the terminal – usually a combination of vim,
perforce, etc. I do my work and go home. Sometimes, at home I would like to
reconnect to my workstation and continue working from home. tmux lets me
<em>reattach</em> to the same terminal at my workstation so I get the same opened
programs. So I can manipulate all my opened programs easily.</p>
<p>When I am done at home, I just detach tmux and I can reattach it again the
next day at the office.</p>
<p>This is not limited to working at the office and at home. I can reconnect to a
terminal on a remote machine from any other terminal and have access to all my
programs and the state that they were in.</p>
<p>As a bonus, because I can <em>multiplex</em> between different programs from a single
terminal, I eliminate the need to open multiple terminal windows. Opening
multiple terminal windows for each new program gets unwieldy pretty quickly.
How often do you see your co-workers desktops littered with a ton of open
terminal windows without a clear way to identify the right one quickly?</p>
<p>There is at least one other alternative to tmux:
<a href="http://en.wikipedia.org/wiki/GNU_Screen">screen</a> which has been around for a
longer time. It is worth learning simply for the fact that you can count on it
being installed on most systems whereas you would probably need to install tmux
on your own.</p>
<p>Regardless of which one you choose to learn, being able to use at least one
terminal multiplexer is a good investment especially if you frequently use
different machines to work on. I would recommend reading <a href="http://pragprog.com/book/bhtmux/tmux">Pragmatic
Tmux</a> to get up to speed quickly on tmux.
Here’s a video of the author, Brian Hogan, promoting the usefulness of tmux:</p>
<div class="videoWrapper">
<iframe width="420" height="315" src="//www.youtube.com/embed/JXwS7z6Dqic" frameborder="0" allowfullscreen=""></iframe>
</div>
<h2 id="vim">vim</h2>
<p>I’m not going to turn this into a vim vs emacs post (though check out
<a href="https://github.com/syl20bnr/spacemacs">spacemacs</a>) so you can just pick
whichever text editor you are comfortable with. In fact, if you prefer to use
nano or pico, that is probably fine too. You just need to be able to use a
terminal-based (not GUI-based) editor fairly well.</p>
<p>I am not bashing full-featured text editors such as TextMate or its,
now-more-sexy counterpart, Sublime Text. Those GUI editors are wonderful
and I use them too. However, sometimes you just don’t have the luxury of
installing and configuring a GUI-based too. What if the computer you are
trying to connect to doesn’t allow to load a UI instance? You need some
fallback plan.</p>
<p>vim (and other venerable text editors) are almost always around on any
*nix based machines. Therefore you can always rely on them on remote
machines especially when you are trying to edit some configuration file.</p>
<p>Another advantage that I have found with such editors is that they are
really fast compared to full IDEs. Now, don’t get me wrong, I think IDEs
are indispensable (heck, I worked on creating useful tools that plug
into Eclipse as part of my PhD). However, sometimes they can be just too
slow. And for dynamic languages such as JavaScript, current IDEs do not
offer any advantage over a well-configured text editor. The usual
features that IDEs have for statically-typed languages such as Java or
C# – code completion, call hierarchy, find all references, etc – are
not available for JavaScript meaning that you are pretty much left
with regular expression search.</p>
<h2 id="zsh">zsh</h2>
<p>Here are my favorite zsh features:</p>
<ul>
<li><em>Easily</em> themeable prompts. I configured it to show <code class="language-plaintext highlighter-rouge">git status</code> so I can tell
at a glance whether I have a dirty local git repository. For a detailed article
on how to customize your zsh prompt, take a look at this
<a href="http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/">guide</a> by Steve
Losh.</li>
<li>Auto-completion on steroids. Whenver you need to get into
/myDirectory/with/a/long/name, you can easily just type /m/w/a/l/n, hit tab and
choose from the different completions.</li>
<li>Sharing of a command history buffer across all shells. At the beginning of
this article, I wrote that I use tmux. Well, with tmux, I open multiple windows
and each window is a zsh shell. It sure is nice if whatever command I typed into
each window can also be searched and recalled in another window. With zsh,
that’s possible — I have never figured out how to do that reliably with bash.</li>
</ul>
<p>I am sure that you can configure bash to do most of the things mentioned above.
However, zsh with the oh-my-zsh plug-ins makes it much simpler and has a vibrant
community to bout. For instance, when I ran into issues using the up arrow on
Mac OS X Mavericks, I found the solution at this
<a href="https://github.com/syl20bnr/spacemacs">link</a>.</p>
<h2 id="conclusion">Conclusion</h2>
<p>There you have it, my trio of tools that are indispensable to my daily tasks. I
have been using them since graduate school and I continue using them everyday.
So I think my investment paid off (and will continue to do so). Hope you pick up
some of those tools. Or if you have any other suggestions, feel free to comment
below.</p>
What is a PhD?2013-07-04T00:00:00+00:00http://vazexqi.github.com/post/phd/2013/07/04/what-is-a-phd<p>This is the first in a series of articles that I have always wanted to
write. I just needed to wait for the right time to write it. I think the
time is right – I just completed (defended and deposited) my PhD a few
weeks back, so I feel that I am now in a <em>better</em> position to opine
about this topic. These are all thoughts that I have always held dear
but never wrote down.</p>
<p>What, specifically, is the topic of this post? It is about the things
that no one tells you about what a PhD is. This is just a natural side
effect from fact that unless you grow up in a campus town, not many
people you know will have a PhD.</p>
<p>A PhD is <em>just another degree</em>, much like your Bachelor’s and Master’s
degrees. A Bachelor’s degree is the most structured of them, much like a
high school diploma. To earn a Bachelor’s you take the required courses
and get decent grades in them. A Master’s is less structured. You need
to take some courses and perhaps work on a large project. A PhD is the
least structured (it is, thankfully, becoming more structured now). You
take more classes and then you need to come up with a specific area to
work on. Then you need to demonstrate to a group of <em>at least</em> four
other professors that your topic has valuable <em>intellectual merit</em>.</p>
<p>Many people have a romanticized view of a PhD. Initially, I shared this
view too. We think that PhDs are the world’s smartest people who can
solve any problem given to them. This is not really true. Instead of
using the term smartest, it is more appropriate and accurate to describe
PhDs as <em>reasonably smart people who have persevered to become experts
in specialized fields under an academic environment</em>. The keywords are
“experts”, “specialized” and “academic”.</p>
<p>In this post, I will clarify why I have chosen those words. And,
finally, I will explain why I chose the phrase “reasonably smart”.</p>
<p><strong>Expert</strong>. This implies that you are now one of the leading authorities
on the topic of your PhD. It means that you have worked long and hard on
a subject and understand most of the subtleties behind it. The
subtleties are things that they don’t teach you in a textbook because
they are too messy to model and explain to a beginner. The subtleties
are the things that most people sweep under the rug because it is simply
too hard to explain it until you have worked on the topic for a
sufficiently long time.</p>
<p>In fact, if you give them enough time, PhDs can talk about all the
subtleties of their particular topic – way more than any normal person
would care to listen to.</p>
<p><strong>Specialized</strong>. This keyword is very important and needs to be combined
with the previous word, i.e., expert. For instance, when you complete a
PhD in Computer Science, it does not mean that you are an expert in
Computer Science. In fact, even if your topic is in, for instance,
Parallel Programming, it does not necessarily mean that you are an
expert in it. You need to drill down more. For instance, while my topic
was in parallel programming, it focused deeply on semi-automated
analyses and transformations for a particular style of parallel
programming. That is the specialized field that I am an expert on.</p>
<p><strong>Academic</strong>. This is another very important keyword. Remember what I
wrote about earlier about demonstrating intellectual merit to a group of
four professors? Well, turns out that there is a <em>preferred</em> way of
demonstrating intellectual merit in an academic setting.</p>
<p>First, let’s see how things work in the real world. If you were in
charge of a large project in the real world, you demonstrate competency
to your employers by building a complete, reliable and working system
that others can use. You are rewarded for making something practical
that works.</p>
<p>This is not how it actually works in an academic setting. You
demonstrate competency by building a partial and mostly-working
prototype that is sufficient for proving what you claim it does. It does
not need to be working perfectly. In an academic setting, there is a
threshold, above which, doing extra doesn’t get you any other
appreciable recognition from your peers. Thus, improving your prototype
into a complete working system is usually not seen as a profitable way
to spend your time. Your time is better spent working on building the
next prototype to demonstrate your future claims.</p>
<p>The unfortunate consequence of this is that sometimes that prototype
that you build could be rather detached from the real world. In extreme
cases, since you are the only one working on it, it might not even work
for other people. Building something that is practical is a good thing
to do but it is not pivotal to getting a PhD. I’ve read enough papers
where the proposed technique was so complicated that most people would
shy away from using it in real life.</p>
<p>So those are the three main keywords. Now let’s talk about the phrase
“reasonably smart”. Getting a PhD is more about perseverance than
intellect. You do not need to be the smartest person, you need to be the
one who is willing to persevere the most. This means investing time on
your topic: reading published papers, building prototypes, discussing
your ideas, publishing your own papers, etc. Some of these activities
can get very tedious and repetitive over time. So the ones who
eventually end up completing a PhD are the ones who are steadfast in
what they are doing.</p>
<p>Hopefully this post has helped clarified what a PhD actually is. Like I
mentioned, unless you frequently interact with PhDs, it is not
immediately obvious what it means to have a PhD. Most technical
interviewers have the wrong idea of what a PhD is and, thus, tend to
have wrong expectations during the interview process.</p>
Never hoard old technology2013-06-21T00:00:00+00:00http://vazexqi.github.com/posts/2013/06/21/do-not-hoard<div class="media span4 pull-left">
<a href="http://db.tt/chc6c8cR">
<img src="http://db.tt/chc6c8cR" class="media-object noshadow" /></a>
</div>
<p>I am in the process of moving out of my old apartment and am just
astonished by the amount of old gadgets that I have to either dispose of
or donate.</p>
<p>I have three old computers (two were my roommates): a 2002 iBook, a 2003
Powerbook and an Eee PC. The iBook has never been turned since 2006. The
Powerbook has a broken hinge. The Eee PC is still functioning but no one
has used it for a long time.</p>
<p>I have lost the power cables for both the iBook and the Powerbook and,
thus, I can no longer power them on to erase the data in them. I had to
spend several hours dismantling (not an easy task, mind you, because the
used rather weird screws: a combination of Torx-8, Allen Key and
Phillips screwdriver) the machines to remove the hard disk drive so that
no one could recover the data when I threw the machines away.</p>
<div class="media span4 pull-right">
<a href="http://db.tt/UyAlCw3l">
<img src="http://db.tt/UyAlCw3l" class="media-object noshadow" /></a>
</div>
<p>Another example. I found my old Palm Tungsten from 2003. Fortunately, I
found the old charging cradle and managed to plug it in. I even have the
fold-up keyboard accessory. After a few hours of charging, everything
was still working – even the touch screen and the stylus. However, this
is now a defunct piece of technology because Palm no longer makes the
software and it is now impossible to get the data in/out of the gadget.</p>
<p>I ended up donating it to the local goodwill but I am not sure whether
anyone would be able to benefit from it. It seems much more convenient
(and still cost-effective) to purchase a new smartphone.</p>
<p>Which brings me to the point of this post. I have now learned a rather
painful lesson – do not hoard old technology. When you purchase a new
gadget, it is so convenient to just say “Oh, let me keep that old
gadget, I never know when I will ever need to use it again”.</p>
<p>STOP!</p>
<p>It is very unlikely that you will ever use that old gadget again.
Purchase an iPhone/iPod touch? You will never use that old iPod again.
Purchased a faster and lighter laptop? You will never use your old
laptop as much anymore.</p>
<p>Best to sell the old gadget immediately or donate it to a friend/family
member. If you sell it when it is still recent enough, you might be able
to get some money back. If you give it away while it is still in trend,
some friend or family member would be able to make use of it and be
happy. However, hoard it for just a few more years and it will be
completely worthless. The company making the gadget might go bankrupt,
the software might be outdated, the device might fail, etc.</p>
<p>So this post is just an explicit reminder to myself to never hoard old
technology. The inconvenience caused – the wasted storage space, the
wasted time trying to destroy data – just isn’t worth the “I might need
this sometime” that you trick yourself into believing.</p>
Things to watch out for when selling your car on Craigslist2013-05-11T00:00:00+00:00http://vazexqi.github.com/posts/2013/05/11/selling-your-car-on-craigslist<p>This is a true account of a newbie’s (that’s me!) experience selling his
car on Craigslist. The transaction happened a few days ago and I had
some time to reflect on it more. The purpose of this post is to document
some of the things that, in hindsight, seem suspicious <em>and</em> to let
others know what to watch out for while selling their vehicle. Note that
most of what I have written are quite speculative – there is no way for
me to prove or disprove them. I am just documenting why I think they
were (very) suspicious. If you are ever thinking of selling/buying a
car, you might want to read through this to form your opinion.</p>
<p class="text-info"> By the way, one thing you should know about me is
that I am a rather cynical and skeptical person. Unless I can verify it,
I usually don't believe anything that people tell me. Blame this on
getting duped by religion for a good decade of my life. So I
<em>might</em> be viewing everything too suspiciously. OK, enough about
that, let's get on with the story.</p>
<p>My roommate, posted a Craigslist’s ad for our 2001 Volkswagen Passat at
1 am on Thursday. Our car didn’t pass the smog and emissions checks and
we were reluctant to take it to California with us. We were second
owners of the car and the car is in pretty good condition. We were aware
of a few minor defects (like the seat not reclining completely, etc). We
weren’t asking for a high price. We were asking for $4600 which was
decent given the known defects. We paid $9995 for the car when we bought
it about 7 years ago. It’s a GLX so it has all the nice extras such as a
V6 engine, leather seats, heated front seats, styling, etc. It has
150,000 miles on it so it’s not a new car but it has been
well-maintained.</p>
<p>We were leaving campus soon and we wanted to sell off our car quickly.
We were prepared to lower the price quite a bit. The money we get back
will help subsidize the down payment for a new car.</p>
<p>Though we posted the ad at 1 am, by next morning, we had around 5
requests to see the car. One person was prepared to offer $3750 in cash.
There were a few others who tried to bargain it down immediately. One
person was even more prompt: he requested to see the car at 10.15.</p>
<p class="text-info">
Let's call this person F. F is the main character of the story since he
ultimately ending up purchasing the car.
</p>
<p>F came by and looked at the car. He told a story about how he was
purchasing this car for his daughter who was going to study at Georgia
State in the fall. He was looking for something that would be good for
her. Because of the broken seat that couldn’t recline, he was not able
to test drive it. So he wanted to ask his sister to come by later
to test drive it. His daughter was not around to test drive it now.</p>
<p class="text-info"> One of the easiest way to form rapport is to tell
a story about a family member in a similar situation. In this case, he
used the story of his daughter who was going to college. As college
students ourselves, we can definitely associate with that and would be
more sympathetic to his requests. Whether his story was true or not
doesn't really matter. He was trying to form <i>rapport</i>.</p>
<p class="text-info">Dale Carnegie wrote the book <i>How to Win Friends
and Influence People</i> with very good advice on how to form rapport.
It's been some time since I read it but I believe that this was one of
the techniques. Carnegie, obviously, wasn't advocating for his
techniques to be used in such devious ways....</p>
<p>F also asked if the price could be lowered because of the seat. We were
aware of the seat and had anticipated lowering the price based on that.
That was not a problem. We got a quote from the dealer on how to fix the
seat and it was going to cost $241 for parts. Labor will probably cost
another $100. At this point, he wanted to lower the cost to $3800, which
we agreed to. Again, this might seem like a lost, but we felt it was all
right – more on this later.</p>
<p>He said he can get $3800 in cash for the same day. And that we should do
a buyer’s check at his mechanic. This was a reasonable request because
when selling your car, you should always do a buyer’s check at the
buyer’s mechanic of choice. It seems only fair.</p>
<p>So we met up at 6 pm to go to his mechanic. He was in his own car with
three young children. I talked to him a bit and he said that they were
all in elementary school.</p>
<p class="text-info">
It felt a bit weird to me that he will bring his kids with him to
buy/sell a car. This is my most speculative suspicion in this post, but
I think he might have done that again just to build some rapport. By
showing that he is a family person with many kids to support, it makes
us more likely to reduce the price. Again, this is pure speculation but
I am not even sure if the kids are his. Maybe one of them was his and
the rest were either his nieces or just some school friends.
</p>
<p>His mechanic – call him J – seemed quite knowledgeable. He pointed
out a few problems with the axle that we were aware of from talking to
our own mechanic. They were not immediate issues but they were things
that had to be taken care off if you were going to drive the car in the
long run. All in all, the cost of repairs could be a few hundred dollars
– maintaining a Volkswagen isn’t cheap since all the parts have to come
from overseas. Repairing the timing belt alone could be $1000 according
to our own mechanic.</p>
<p>The only issue with J the mechanic? He was operating from a <strong>very</strong>
suspicious location. Basically, it was from a storage unit! If you have
ever watched an episode of <em>Breaking Bad</em>, this almost felt like some
shaddy location where they would do one of their exchanges. Fortunately,
I had someone else come along with us in a different car. And I had told
all my friends where I was going. So here’s another lesson for you:
always bring someone else with you especially if you are going to sell
the car and need a ride back. Don’t take the ride back from the buyer
since you would be at his mercy.</p>
<p>After J pointed out the issues, F bargained to lower the price down to
around $3100. Again, I didn’t mind since we wanted to sell this off and
the issues the mechanic raised seemed fair (and matches with what our
mechanic told us). This is also, where his story of buying the car for
his daughter becomes useful. If it were true, we certainly would want
this daughter to drive a car that had been properly fixed (timing belt
changed, car axles taken care of, etc).</p>
<p>At this point, he mentioned that he only had $3000 in cash and asked if
it would be all right to have the remaining $100 in check. We said fine.
Why did we agree? At this point, we (my roomate and I) agreed $3000 was
a good price. Whether we got the remaining check or not (maybe it will
bounce) was not a problem to us.</p>
<p>The astute reader might have caught on the fact that he said that he was
going to buy the car for $3800 cash. And now he only mentioned that he
had $3000? Where did the remaining $800 go? Clearly he wasn’t prepared
to pay the $800. This was very suspicious. If we were not prepared to go
down to $3000, we would have canceled the deal immediately.</p>
<p>So we drove to his house to pick up the money. It was raining that day
and I believe that he took the most circuitous route to arrive at his
place. It was much longer and further than it needed to be. And he used
all the backroads. I am speculating that this was a ploy to tire us out
mentally. It was already late in the day, raining and we simply didn’t
want to have to deal with these hassles again if the deal didn’t go
through.</p>
<p>At his house, he took his time trying to get the cash. He was fumbling
around and finally said that he couldn’t find his wife’s check book to
write us the $100. Again, at this point, as sellers this was a red flag
and you should cancel the transaction immediately instead of giving the
buyer the benefit of doubt. He said that he will bring the check to us
tomorrow at our place. We managed to get the $3000 though, in cash,
which was important. So we sign off on the title and handed him the car.</p>
<p class="text-info">
As mentioned earlier, we weren't counting on getting the $100. There was
the real possibility of his check bouncing. Or him no showing up the
next day.
</p>
<p class="text-info">
Anyway, as any good researcher would do, I took this as an opportunity
to conduct an experiment. If he had actually showed up with the check
the next day, my faith in humanity would be restored. If he didn't show
up, then it just proves that you can never trust people when it comes to
money.
</p>
<p class="text-info"> F, however, did something really unexpected the
next day.... </p>
<p>I was about to contact him the next day for the remaining $100 when he
called me first. He told me that after talking it over to his wife he
decided that he didn’t think the car was a good match for his daughter’s
needs. They would prefer something that she could drive immediately
without having to make the repairs. Then he was “nice” enough to say
that he return the car and give us a “few hundred back” for our time.</p>
<p>I told him that the sale was final and he had seen the car and its
condition. Since he talked to his mechanic, he should also be aware of
the cost and time of repairs. I also said that we had signed off on the
title.</p>
<p>F then replied that he “talked” to people at the DMV and that usually
buyers and sellers have a “48-hour period” to back off. He also
mentioned that it was possible to just restore the original title at the
DMV.</p>
<p>I said no. He seemed fine with the decision. But it was not clear if he
would pursue the “48-hour period” issue.</p>
<p>I was really concerned about the “48-hour period” issue he raised. If
this were my own home country, it would be easy to call this <em>bollocks</em>.
There is no such rule from where I am from. However, this is the United
States. If you buy something there is always an accompanying return
policy, usually a very permissive one. I wasn’t sure if this applied to
cars sold privately.</p>
<p>So, now I have something else on my plate. I needed to go seek legal
services to see if what he said has merit. Perhaps he would pursue legal
matters to settle this. And I just didn’t have the time to deal with
this unexpectedness.</p>
<p>We talked to a couple of my American friends. Most of them said what F
said was plain nonsense. However, none of them are legal experts so I
still couldn’t be sure. I made an appointment with student legal
services to get to the bottom of this.</p>
<p>When I finally met with student legal services, the lawyer confirmed
that there was no such “48-hour period” thing. Once the title has been
transferred and the payment has been received, the transaction was over.
When I asked if I should prompt F for the remaining $100, the lawyer
advised against it. His words were “let sleeping dogs lie”, which I
completely agree with.</p>
<p>Of course, after all this, the issue of the remaining $100 was never
raised again. So F got what he wanted – a good car for $3000. This was
probably his ploy from the beginning.</p>
<p>All in all, I don’t mind selling the car at a cheaper price to F.
Getting $3000 was good enough for us because it can be used as a down
payment for a new car. I just wished he didn’t pull the stunt with trying
to return it. He might be a professional buyer who prowls Craigslist for
cheap luxury cars from university students and then tries to sell them
for higher later. Nothing wrong with that. It’s a workable business
model. But he just didn’t need shit to pull that off. The fact that he
knew what to say, how to handle the business transaction, etc seems to
strongly suggest that he has done this before.</p>
<p>To summarize here are the list of suspicious things that you should
definitely watch out for while selling your car:</p>
<ol>
<li>Watch out for people telling a story about buying a car for his/her
close family member. It’s <em>probably</em> a way to form a connection with
you as the seller. It’s probably best to be as apathetic as possible.</li>
<li>Know the condition of the car before selling it. Do your own check at
a mechanic you can trust. That way you can see if both assessments
match.</li>
<li>Be firm on the price that you are willing to accept and don’t go
below this. Ours was $3000.</li>
<li>Know that you have should walk away from the deal anytime you feel
something is suspicious. Always do all the transactions in public
spaces and be sure to have a witness.</li>
</ol>
<p>Again, like I mentioned at the beginning of this post, I have no way to
prove any of what I have written. It’s all speculative. However, given
the number of red flags, I think it is safe to say that F definitely had
something up his sleeve from the beginning.</p>
How I trained for the Illinois Half Marathon2013-04-27T00:00:00+00:00http://vazexqi.github.com/posts/2013/04/27/running-half-marathons<div class="media span3 pull-left">
<a href="http://db.tt/AhA0Vr9F">
<img src="http://db.tt/AhA0Vr9F" class="media-object" /></a>
</div>
<p>A few hours ago today, I finished my second half marathon. About a year
ago, I finished my first half marathon. On both accounts, I feel great
(minus some minor leg pain) after completing the race. It takes quite a
bit of effort to finish running 13.1 miles. Yes, it is not the <em>full</em>
marathon (26.2 miles) but it is not a simple exercise that you can do
without any training.</p>
<p>The purpose of this post is to share some of the training that I did.
Writing this post also helps me keep a written record of what I did and
what worked for me so I can look back in the future and compare.</p>
<p>My training is a bit unusual for two reasons. First, I am a fairly
skinny person. I am about 1.7 meters tall but only weigh about 55
kilograms. Second, before completing my first half marathon in 2012, I
was not a serious runner. I didn’t run regularly, if at all.</p>
<div class="media span3 pull-right">
<a href="http://db.tt/bmuGDm3n">
<img src="http://db.tt/bmuGDm3n" class="media-object" /></a>
</div>
<p>My ectomorphic body type coupled with my lack of previous running
experience make training for the race a bit challenging. My legs are
really skinny – chicken-leg size skinny, if that helps give you a
mental picture. That means that when I started running, there simply
wasn’t enough muscle to propel myself to run faster. On the other hand,
because I weigh so little, it is also easier on my knees for long
distances.</p>
<p>The first time I ran the race, it was by sheer determination alone. I
had started training with another friend. She followed a more typical
route: running the 5k, 10k and <em>then</em> the half marathon on subsequent
races. I learned quite a bit from her as I started running. The first
two pieces of advice come from her and her friends. And they are
essential for finishing the race for the <em>first</em> time.</p>
<h3 id="get-proper-shoes">Get proper shoes</h3>
<p>For long distance running, you need proper shoes. Period. You should not
go to any retail store and just simply pick out a pair just based on a
whim. Instead, you should go to a athlete store that will measure your
<em>gait</em>.</p>
<p>Fortunately, there is such a store in the Champaign-Urbana area: <a href="http://www.bodynsolesports.com/">Body
N’ Sole</a>. They have some simple
equipment to video capture your leg movements as you run on the
threadmill. Using this, they determine that I was an
<a href="http://www.runnersworld.com/running-shoes/pronation-explained?page=single"><em>overpronator</em></a>. This means that my feet tend to <em>roll</em> as I run.</p>
<p>For short distances, having your feet roll is not a big deal. But for
longer distances, having your feet roll will very easily lead to shin
splints and other complications. For overpronators like myself, it’s
important to get a pair of shoes with <em>more</em> support.</p>
<p>In addition, unlike your typical retail store, the people working there
are also trained to identify other issues with your feet. They were able
to tell me that I had narrow feet and that I required narrower shoes.
And they were able to recommend a brand that produced narrower shoes.</p>
<p>In short, the first step is to get proper shoes. Recently, I shared this
piece of advice with another of my friends who was just starting to run.
It was miraculous. Prior to having his gait examined, he was buying the
wrong shoes. He was wearing a size too big because he had some toe pain,
which he had mistakenly attributed to the size of his shoe. Turns out
it was he also needed more support at the heel and also a different way
to tie his laces.</p>
<h3 id="set-up-a-training-routine">Set up a training routine</h3>
<p>The first time you run a mile, it will feel really hard.</p>
<p>That’s fine. You just need to keep at it. Soon, you will be able to do
1.5 miles, 2 miles, etc. But you won’t be able to increase your distance
if you don’t run consistently.</p>
<p>My training schedule started off with running twice a week. I’ll start
with 5K and slowly increase the distance each week. I wasn’t aiming for
time. I was simply aiming for distance. When I started out, I was
<em>slow</em>. It took me about 12 minutes to complete a mile.</p>
<p>My training routine lasted about four months. I stared in January, and the
race was at the end of April. Before the race, I could only run up to 11
miles (not the full 13.1 miles).</p>
<p>The first time I ran a half marathon, all I was aiming for was to finish
it. I didn’t care how long I took as long as I finished it. I even had to
walk halfway as well because I was too tired to run continously. Being
able to finish it in 2:11:03 was a surprise and a bonus.</p>
<hr />
<p>The first two pieces of advice above were all I did the first time I ran
the race. Of course, when I was training for the second time, I realized
that just sheer willpower wasn’t going to help me improve my time. And I
was beginning to notice that as I started running more frequently and
longer, I was also getting injured more.</p>
<p>That’s when I started doing other things. The following sections are a
little less developed because I just started doing them this year. Thus,
I am merely following what I found on the Internet and don’t have the
time to incorporate my own experiences yet.</p>
<hr />
<h3 id="set-up-a-cool-down-routine">Set up a cool down routine</h3>
<p>Once you start running regularly, it’s important to start thinking of
routines to help you recover. A simple thing to try is to just <em>not</em> urn
everyday. Rest a day between runs.</p>
<p>Another thing I started incorporating were some cool down routines. I
primarily did two: <em>Butterfly Pose</em> and tracing the alphabet with my
toes.</p>
<p>The <a href="http://running.about.com/od/strengthtraining/ss/Yoga-Poses-For-Runners_5.htm">Butterfly
Pose</a>
is a yoga pose to relieve tightness in the lower back and hips.</p>
<p>Tracing the alphabet with my toes helps reduce the chances of shin
splints, which is an injury that is very common with overpronators (like
myself).</p>
<h3 id="do-strength-training">Do strength training</h3>
<p>To improve my speed, I needed to do strength training. Remember how I
said, I had skinny legs? Well, I needed to both increase my strength to
be able to run faster. Because of how light I weigh, it is not
sufficient to just run more frequently or longer distances to build
strength and muscle.</p>
<p>To improve my strength, I did two things:</p>
<ol>
<li>Squats, lunges and calf raises following the advice from [Scooby's
Workshop](http://scoobysworkshop.com/leg-exercises/)</li>
<li>Standing hip abductor and single-leg squats from
[Runner's World](http://www.runnersworld.com/running-tips/strength-exercises-help-you-run-faster)</li>
</ol>
<h3 id="vary-your-runs">Vary your runs</h3>
<p>As I began to run more frequently and for longer distances, things began
to feel a little boring.</p>
<p>Fortunately, there are many ways to vary your run. I follow this
<a href="http://www.runnersworld.com/race-training/whats-difference-between-fartlek-tempo-and-interval-runs">article</a>
and do a combination of fartlek and tempo runs. Fartlek runs are
particularly fun for me since they break the monotocity of long distance
runs.</p>
<hr />
<p>So those are what I did while training for the half marathon. I hope
that some of you might find it useful as you train for your first half
marathon. I’ll be happy to read about any comments you have.</p>
Creating Useful Tools using JavaScript for our Coursera Course2013-04-20T00:00:00+00:00http://vazexqi.github.com/posts/2013/04/20/javascript-tools-in-coursera<p><em>Disclaimer: I’d like to state upfront that this article is about the
work that we – the teaching staff for the VLSI CAD: Logic to Layout
course – have done for our particular course. We are just sharing our
experiences; this post does not reflect what Coursera is doing for any
of their other courses in terms of tools or services.</em></p>
<p>As instructors, we usually need to provide simple, yet useful, auxiliary
tools for our courses. Auxiliary tools include specialized math
calculators, visualizations, etc for a small part of the course
material. Such tools enhance the learning process and provide students
with new ways to experiment and try things out. In traditional courses,
such tools are usually made available in the form of applications that
students run. Sometimes these applications require specific versions of
operating systems, frameworks or libraries. There is the assumption that
the students will have access to computing resources, e.g., their own
machines or lab computers that are capable of running those
applications. In an online learning environment such as Coursera with
tens of thousands of students, we cannot assume that all students have
access to the same computing resources. <em>What is the best way to
implement and deploy such tools?</em></p>
<p>There are several solutions. We could choose only to use applications
that run on all major operating systems. For instance, we could ask
students to use applications written in Java, which runs on Windows, Mac
and Linux. While this works, it might be too much to expect students to
install the support for running Java. Recall that we are dealing with
<em>auxiliary</em> tools. These tools are meant to be simple to use. Forcing a
student to install a whole runtime just to be able to run a simple tool
is not the best solution. We deem this solution to have too much
overhead.</p>
<p>A more attractive solution would be to run the tools inside the web
browser. After all, the web browser is the quintessential tool for
online courses. Again, there are several approaches that we could use in
a web browser. We could consider using an in-browser runtime environment
such Java Applets, Adobe Flash or Microsoft Silverlight. All of these
are wonderful environments that allow you to build all forms of useful
tools. Unfortunately, as proven
<a href="http://search.us-cert.gov/search?utf8=%E2%9C%93&affiliate=us-cert&query=flash&commit=Search">time</a>
and
<a href="http://search.us-cert.gov/search?utf8=%E2%9C%93&sc=0&query=silverlight&m=&embedded=&affiliate=us-cert&filter=moderate&commit=Search">time</a>
again, they are also the source of many security vulnerabilities so most
students do not install them or have them disabled – as they rightfully
should.</p>
<p>Fortunately, even without installing any in-browser runtime
environments, web browsers themselves are becoming more capable
computing platforms <em>out-of-the-box</em>. A few years back, developing for
web browsers used to be a very unpleasant experience. There was no
standardized support for different functionalities and it was common for
applications to work in one web browser and not another. Modern web
browsers have begun to change that experience. Now, we can safely expect
most web browsers to support web standards such as HTML, CSS, SVG and
JavaScript consistently. More importantly, we can expect that the
applications we write will work gracefully on all web browsers. It is
feasible to do this without a dedicated team of developers testing
on multiple versions of web browsers on multiple versions of operating
systems. Several teaching assistants with some programming experience
should be able to easily create such auxiliary tools using a combination
of HTML, CSS, SVG and JavaScript. <em>There is no need for a dedicated web
server and complicated client/server programming</em>.</p>
<p>Indeed, that has been our experience so far. We have implemented three
tools for our <a href="https://class.coursera.org/vlsicad-001/wiki/view?page=WebbasedTools">VLSI CAD: Logic to
Layout</a>
Coursera Course. The first tool is a simple <em>calculator</em> for solving
linear equation systems. The second and third tools are <em>visualizations</em>
for two core assignments for the course. We are pleasantly surprised by
how well this has worked for us. And we would like to share some of our
experiences creating such tools.</p>
<p>By leveraging several popular JavaScript frameworks, we were able to
implement each tool in less than 700 lines of code. All of them are
released under the University of Illinois / NCSA Open Source License so
you are free to use them as you see fit.</p>
<div class="media">
<a href="http://db.tt/yhq13USO">
<img src="http://db.tt/yhq13USO" class="media-object noshadow" />
</a>
</div>
<h3 id="simple-linear-system-solver">Simple Linear System Solver</h3>
<p>We have implemented a very simple interface for solving systems of
linear equations directly from the web browser. Systems of linear
equations are common in many engineering disciplines. For simple
systems, it is possible to solve them by hand. However, for realistic
problems, the standard way is to use some solver in a dedicated (and
costly) application such as Matlab or Mathematica. These applications
can easily solve linear systems with thousands of equations.</p>
<p>For the purposes of a class, it is usually sufficient to have a solver
than can solve up to 10 equations. This is something that can be
reasonably done inside a web browser.</p>
<div class="media">
<a href="http://db.tt/AqkMReZq">
<img src="http://db.tt/AqkMReZq" class="media-object noshadow" />
</a>
</div>
<p>The interface for our solver is simple. Students enter the input matrix
A and the input vector B, click on the “Solve” button and the result is
presented to them directly. As can be seen in the above figure, the tool
itself can also be directly embedded into the Coursera web page, giving
it proper <em>branding</em> so that students know that they are still using a
tool from the course website.</p>
<p>We use the <a href="http://www.numericjs.com/">Numeric.js</a> library by <a href="http://www.ma.hw.ac.uk/~loisel/">Sebastien
Loisel</a>, Lecturer in Mathematics,
Heriot-Watt University. The library implements many functions that you
would expect from a numerical library, all of which are rewritten in
JavaScript. Numeric.js has decent
<a href="http://www.numericjs.com/benchmark.html">performance</a>; it’s capable of
reaching several hundred million of floating point operations per second
(MFLOPS).</p>
<div class="media">
<a href="http://db.tt/CCdveHTN">
<img src="http://db.tt/CCdveHTN" class="media-object noshadow" />
</a>
</div>
<p>While we have only used its solver, Numeric.js comes with many different
functionalities as exemplified in its
<a href="http://www.numericjs.com/documentation.html">documentation</a>. It should
be a useful library for many different engineering courses that require
the use of a numerical library. If desired, it also comes with a
dedicated <em>prompt</em> where you can issue commands directly to the library
and see your results printed in real time.</p>
<p>The source code is available from
<a href="https://gist.github.com/vazexqi/5316339">https://gist.github.com/vazexqi/5316339</a>.</p>
<h3 id="placer-result-visualization">Placer Result Visualization</h3>
<p>For another assignment, we had students implement a placer. A placer
<em>places</em> the gates on a chip. A good placer will distribute and place
chips as evenly as possible, while following some constraints. The
result of a placer is usually a text file that describes where each gate
ends up on the chip, in the form of a x and y coordinate.</p>
<p>Because there can be thousands of such gates for an assignment (and
millions for an actual industrial chip), it is not easy to make sense of
the text file. Thus, it is important to be able to visualize the result
of the placer. The visualization should help students determine how well
their implementation has distributed the gates on the chip.</p>
<div class="media">
<a href="http://db.tt/rlnAfIu5">
<img src="http://db.tt/rlnAfIu5" class="media-object noshadow" />
</a>
</div>
<p>Visualizing the result is simple: use a scatter plot. However, how could
we get the data to the visualization tool? Unlike the simple linear
equation solver tool, there are thousands of such gates and we cannot
expect the student to type all of them in. Instead, we leverage the
<a href="http://www.html5rocks.com/en/tutorials/file/dndfiles/">File API</a> that
is part of the HTML5 standard. Using this interface, the student only
has to drag-and-drop her file into the web browser. The web browser then
reads the file and displays the results. Everything is done locally
inside the web browser.</p>
<p>You can see the tool in action in the video below:</p>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/s3b6PBOYWKs?rel=0" frameborder="0" allowfullscreen=""></iframe>
<p>We used the <a href="http://d3js.org/">d3.js</a> library by Mike Bostock. Mike
obtained his PhD under <a href="http://hci.stanford.edu/jheer/">Jeffrey Heer</a> at
the Stanford Vis Group. Their group has studied and produced many useful
ideas and software for visualization of information. d3.js is a very
rich library that is capable of many different
<a href="https://github.com/mbostock/d3/wiki/Gallery">visualizations</a>. There is
a learning curve to using the tool. However, once we understood the
architecture it was easy to customize and add new visualizations.</p>
<p>Before using d3.js, we implemented a version using <a href="https://developers.google.com/chart/interactive/docs/gallery/scatterchart">Google Scatter
Chart</a>.
While it was easier to use initially, it was difficult to change the
graph to look the way we needed it to. For instance, we had a very
specific requirement on how the axes needed to be drawn in the graph.
Google’s Scatter Chart API did not provide a way to do this. And because
it was close source, we could not modify the source code to do what we
wanted. Thus, we switched to d3.js because it provided more control
overall.</p>
<p>In our experience, the tool was seamless to use for the students and it
provided a useful visualization for them to verify their results.</p>
<p>The source code is available from
<a href="https://gist.github.com/vazexqi/5316324">https://gist.github.com/vazexqi/5316324</a>.</p>
<h3 id="router-result-visualization">Router Result Visualization</h3>
<p>For our last programming assignment, we had students implement a router.
A router <em>routes</em> wires from a source pin to a destination pin. A good
router will route as many wires as possible, while avoiding obstacles
and minimizing the amount of “bends” that it needs to make to reach its
destination. The result of a router is usually a text file that describes
the path from a source pin to a destination pin.</p>
<p>Again, because there can be hundreds of such routes (and millions for an
actual industrial chip), it is not easy to make sense of the text file.
Thus, it is important to be able to visualize the paths. Visualization
helps students <em>eyeball</em> problems with their routing implementation,
e.g., if two routes intersect or if the routes go through an obstacle.</p>
<div class="media">
<a href="http://db.tt/dDMhuR4m">
<img src="http://db.tt/dDMhuR4m" class="media-object noshadow" />
</a>
</div>
<p>For this tool, we used the same drag-and-drop interface provided
through the File API in HTML5. And we used the d3.js visualization
library.</p>
<p>We were able to successfully visualize a 1000 by 1000 grid with 1000
routes. To give you a scale of how big this is, if we were to print it
out, it will require a 144 in x 144 in paper. It took less than 10
seconds and consumed 256 MB of memory on Google Chrome on a 2010 MacBook
Pro with a 2.53 GHz Core i5 processor and 8 GB of RAM. In summary, we
thought that its performance was decent for what we needed to do. And it
did not demand too much from the student’s computer.</p>
<p>One student found the tool useful enough to leave the following
feedback:</p>
<blockquote>
<p>BTW, congrats for the visualizer. I remember when I studied CS more
than 10 years ago and I was taught the A* algorithm on paper [a
routing algorithm] and with a single small example on the blackboard.
Learning is a lot better implementing it and trying it, and your
visualizer certainly helps a lot. This way of learning is fun, the
other method was boooring [sic]. Good job guys!</p>
</blockquote>
<p>You can see the tool in action in the video below:</p>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/4m0V6fpwROA?rel=0" frameborder="0" allowfullscreen=""></iframe>
<p>The source code is available from
<a href="https://gist.github.com/vazexqi/5385456">https://gist.github.com/vazexqi/5385456</a>.</p>
<hr />
<h3 id="summary">Summary</h3>
<p>Our experiences with creating these auxiliary tools have convinced us of
the possibilities of doing <em>as much as possible</em> from the web browser.
Before we implemented the tools, we were concerned about the performance
of JavaScript-based tools inside web browsers. We were worried that it
would be too slow or take up too much resources on the student’s
machine.</p>
<p>It is safe to say that our fears were alleviated. Our VLSI CAD: Logic to
Layout course has about 17,000 students registered. Of this, about 1,000
are actively doing the assignments and using the tools.</p>
<p>As future work, it is worth exploring how far we can take this approach
of doing everything inside JavaScript. My colleague who is a teaching
assistant for the University of Illinois’s <a href="https://www.coursera.org/course/androidapps101">Creative, Serious and
Playful Science of Android Apps
course</a> on Coursera is
looking into using <a href="http://int3.github.io/doppio/about.html">Doppio</a> to
enable students to program with Java inside their web browser.</p>
<p>Other projects such as
<a href="https://github.com/kripken/emscripten">Emscripten</a> will also be worth
exploring. For our course, we had the luxury of being able to
re-implement everything from scratch. Sometimes, however, instructors
have old versions of C/C++ programs that they would like to run in the
web browser. In those cases, Emscripten might prove to be a useful first
approach toward migrating legacy code to the web browser.</p>
Visualize Router Result using d3.js2013-04-14T00:00:00+00:00http://vazexqi.github.com/posts/2013/04/14/router-visualization<div class="media pull-left">
<a href="http://db.tt/JHZjMRlC">
<img src="http://db.tt/JHZjMRlC" class="media-object noshadow" />
</a>
</div>
<p>This is another post about how we are using d3.js for our visualization
needs in our <a href="https://www.coursera.org/course/vlsicad">Coursera
course</a>. As part of the last
programming assignment for the course, we are asking students to design
and implement a router. The core algorithm for the router resembles the
<a href="http://en.wikipedia.org/wiki/A*_search_algorithm">A Star Search
Algorithm</a>, with a few
more constraints. Students are supposed to take a file describing the
grid that they are operating on (along with its constraints and cost
model) and a list of nets (with starting and ending positions) that they
are supposed to route. They produce an output file describing the paths
to take to route each net.</p>
<p>Of course, with any path routing assignment, it makes sense to provide
some form of visualization. It is just more rewarding and intuitive to
<em>see</em> the final routing than to try to imagine it by looking at a text
file with numbers.</p>
<p>A simple example on a 6x5 grid with two nets is shown above. The blue
cells show obstacles on the first layer (yes, this is a 3D problem) and
the orange cells show obstacles on the second layer. If you squint, you
can also see some gray cells – those are cells that have some cost
associated with them. I’d like to show a bigger example but because this
is an assignment, I don’t want to reveal any of the answers.</p>
<p>A blue route specifies a path through the first layer. Correspondingly, an orange route specifies a path through the second layer. Paths can go up and down layers. When they do, we denote this using the cross symbol. A green square denotes the start of a route; a red square denotes the
end of a path.</p>
<p>So far we have tried it up to a 500 x 500 grid with about 20 paths and
it has been pretty responsive. This just shows how far SVG performance
has come in modern web browsers and how suitable it is for medium scale
visualization. Of course, real routing problems for industrial
benchmarks are much larger, but with the right tweaking, it is probably
possible to use Javascript and SVG to handle most of the visualization.</p>
<p>The code is available from this
<a href="https://gist.github.com/vazexqi/5385456">gist</a> (it’s about 600 lines of code so
it’s not wise to embed it here) and it is licensed under the
Illinois/NCSA Open Source license. d3.js was quite instrumental in
producing this form of visualization. Using d3.js, I was able to
incrementally add features as we went along. It was easy (taking less
than an hour) to add a new feature as we were using the tool itself when
we implement our own version of the router. It was also easy to
<a href="/posts/2013/04/04/visualize-d3.html">tweak</a> the layout to meet our
exact needs – something that would have been quite hard or impossible
to do if we were using a library.</p>
<p>You can see a video of the tool in action below:</p>
<iframe width="640" height="360" src="https://www.youtube-nocookie.com/embed/4m0V6fpwROA?rel=0" frameborder="0" allowfullscreen=""></iframe>
Visualizations using d3.js2013-04-04T00:00:00+00:00http://vazexqi.github.com/posts/2013/04/04/visualize-d3<p>In my last
<a href="http://vazexqi.github.com/posts/2013/03/20/visualize-netlist.html">post</a>,
I mentioned how I was using the Google Scatter chart API to visualize
some data that was pertinent for our <a href="https://www.coursera.org/course/vlsicad">VLSI CAD: Logic to
Layout</a> course.</p>
<p>Well, it turns out that Google Scatter chart has some drawbacks – like
all blackbox software, it’s not really customizable. It’s great for
quick-and-dirty charting but when you need something very specific,
there is just no way to get it done.</p>
<p>In our case, we wanted a very particular way of displaying the grid
lines. Instead of the regular interval of 10, we need something more
unusual, i.e., 12.5. The reason for this is because of the way the
algorithm works. It subdivides our 100x100 region in 8x8 regions where
each region has height and width of 12.5. These 8x8 regions are
important because they are where the algorithm should place things. If
the algorithm is carried out correctly, then each of those 8x8 regions
should have approximately the same amount of <em>gates</em> in them.</p>
<p>There just wasn’t a way to accomplish this using the current Google
Scatter Chart API. Others have
<a href="https://groups.google.com/forum/?fromgroups=#!topic/google-visualization-api/kH3XwfQSFE8">requested</a> for this as well.</p>
<p>Well, enter <a href="http://d3js.org">d3.js</a>. For those unfamiliar with d3, it’s
one of the best visualization libraries out there for Javascript –- and,
trust me, there are a lot of visualization libraries for Javascript. In
my opinion, what really sets d3 apart from the rest is the <em>conceptual
integrity</em> of its design. Conceptual Integrity is a term made popular by
Fred Brooks in <em>The Mythical Man-month</em>. It refers to a software that is
properly designed such that every component that you examine has a
cohesive design that resonates with the other components. If that sounds
too <em>meta</em> for you, then just think of it as very well designed piece of
software with very few hidden surprises. Once you grasp how it works,
the same ideas permeate the entire design; there are very few corner
cases.</p>
<p>While this is my first time using d3, I had used its predecessor,
<a href="http://mbostock.github.com/protovis/">Protovis</a>. I was very happy with
it because it was flexible enough to handle everything that we needed.
Here is the particular visualization that we had to do with it for my
health instrumentation <a href="http://db.tt/HNP8YH2w">project</a>:</p>
<div class="media">
<a href="http://db.tt/TLVlgykM">
<img src="http://db.tt/TLVlgykM" class="media-object noshadow" />
</a>
</div>
<p>The figure above shows the amount of exercise we were getting for each
hour of the day for 7 weeks. The amount of exercise was measured using a
pedometer. A mini pie chart is drawn for each active hour. The size of
the pie chart corresponds directly with the amount of exercise. We used
a pie chart because we wanted to also distinguish <em>rigorous</em> activity
from just <em>normal</em> activity. The darker sections of the pie chart
represent rigorous activity.</p>
<p>Anyway, before I digress, here’s the end result of using d3. If you
compare it with the previous post, there is very little visual
difference, which is good. The point is to remain consistent with the
previous visualization while being able to add important visual cues.</p>
<div class="media">
<a href="http://db.tt/Xgb68Qd4">
<img src="http://db.tt/Xgb68Qd4" class="media-object noshadow" />
</a>
</div>
<p>The main advantage d3 has is the fact that you can control everything
from the axis position and title to the way that you want the graph
rendered, animated and displayed. If you scrutinize closely, you will
see that the blue dots are segregated into the 8x8 regions pretty
nicely. Had we not been able to control the gridlines, this visual cue
would have been harder to detect.</p>
<p>The code is available from
<a href="https://gist.github.com/vazexqi/5316324">https://gist.github.com/vazexqi/5316324</a>.
I am fairly new to Javascript so the code might be less idiomatic that I
like. But I’m getting there :-)</p>
<p>I already have another visualization done using d3 and I will post about
it when it is finally completed. Needless to say, d3 is now part of my
arsenal of visualization toolkits.</p>
Visualizing Netlist files using Google Scatter Chart2013-03-20T00:00:00+00:00http://vazexqi.github.com/posts/2013/03/20/visualize-netlist<p>One of the assignments for our <a href="https://class.coursera.org/vlsicad-001/class/index">VLSI CAD: Logic to
Layout</a> will require
students to write a placer. A placer is basically a program that
determines the best layout for placing gates on a chip subjected to
certain constraints such as minimum wire length, even distribution on
the chip, etc.</p>
<p>It turns out that the file format for describing the final placement is
very simple:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="c1"># Each line has three components: <gate id> <x-position> <y-position></span>
<span class="mi">1</span> <span class="mi">75</span> <span class="mf">93.75</span>
<span class="mi">2</span> <span class="mf">14.5833</span> <span class="mf">62.5</span>
<span class="mi">3</span> <span class="mf">19.7917</span> <span class="mf">87.5</span>
<span class="mi">4</span> <span class="mf">47.3111</span> <span class="mf">64.5833</span>
<span class="mi">5</span> <span class="mf">62.5</span> <span class="mi">25</span>
<span class="mi">6</span> <span class="mf">43.0778</span> <span class="mf">87.5</span>
<span class="mi">7</span> <span class="mf">44.5839</span> <span class="mf">45.5646</span>
<span class="mi">8</span> <span class="mf">31.25</span> <span class="mf">87.5</span>
<span class="mi">9</span> <span class="mi">25</span> <span class="mf">45.0639</span>
<span class="mi">10</span> <span class="mf">42.487</span> <span class="mf">23.2346</span>
<span class="mi">11</span> <span class="mf">87.5</span> <span class="mf">22.8231</span>
<span class="mi">12</span> <span class="mf">62.5</span> <span class="mf">40.625</span>
<span class="mi">13</span> <span class="mi">25</span> <span class="mf">21.8506</span>
<span class="mi">14</span> <span class="mf">73.4375</span> <span class="mf">89.0625</span>
<span class="mi">15</span> <span class="mf">68.75</span> <span class="mf">62.5</span>
<span class="mi">16</span> <span class="mf">88.2292</span> <span class="mf">66.4583</span>
<span class="mi">17</span> <span class="mf">88.5634</span> <span class="mf">88.7695</span>
<span class="mi">18</span> <span class="mf">88.125</span> <span class="mf">44.1667</span></code></pre></figure>
<p>Now a very effective way to quickly check if your placer is working is
to <em>visualize</em> it. Now, there are many ways to visualize such things.
Most engineers would resort to using R or Matlab (or its open source
equivalent, Octave). However, with an enrollment of 15, 000+ students,
we want a means that is the easiest.</p>
<p>What can be easier than using Javascript in the browser? Everyone has a
browser (or two, or three) installed on their machine. It also turns out
there are a ton of great visualization frameworks out there for
Javascript. I chose the simplest one: <a href="https://developers.google.com/chart/">Google
Charts</a>.</p>
<p>I’ve used an earlier version of the Google Charts API to visualize some
performance benchmarks and it was pretty easy to set up. However, that
required using other language (Scala, Groovy) to read in a file and
generate the data.</p>
<p>Can we do it all in Javascript? That is, can we read in a file directly
from Javascript? With HTML 5 we
<a href="http://www.html5rocks.com/en/tutorials/file/dndfiles/">can</a>.</p>
<p>So by combining modern HTML5 features and a great visualization library,
we get useful visualizations for <em>free</em>. And turns out Javascript and
SVG is fast enough in the web browser to display around 12, 000 points
with no problems.</p>
<p>Here it is in action:</p>
<div class="media">
<iframe width="640" height="480" src="https://www.youtube-nocookie.com/embed/KcXd3D0kiGA?rel=0" frameborder="0" allowfullscreen=""></iframe>
</div>
<p>You can find the code on my Github page
<a href="https://github.com/vazexqi/CourseraVLSICAD/blob/704aee5070ef890362e1abd3d92356d591d3475d/NetlistVisualization/visualize.html">here</a>.</p>
Using a Headset to Record on a MacBook Pro (2010)2013-03-10T00:00:00+00:00http://vazexqi.github.com/posts/2013/03/10/mic-macbook-pro<p>I am in charge of producing some short 5 minute screencasts to introduce
some VLSI CAD tools for our
<a href="https://www.coursera.org/course/vlsicad">Coursera</a> course. Our resident
audio/video (AV) expert recommended that I use an external headset to do
the recording to get the best possible sound. The particular headset
that he had? The <em>classy</em> Califone 3066Av, as shown below (mine comes in
beige, which is even more old school).</p>
<div class="media">
<a href="http://www.califone.com/products/3066.php">
<img src="http://www.califone.com/images/products/3066av.jpg" class="media-object" />
</a>
</div>
<p>Now as you can see from the photo above, there are two cables: a red one
(mic) and black (headphones). Intuitively, one would expect to plug the
red cable into the “audio in” on the MacBook Pro and the black cable into
the “audio out”. Here’s what I did initially:</p>
<div class="media">
<a href="http://db.tt/9L5rpcan">
<img src="http://db.tt/9L5rpcan" class="media-object" />
</a>
</div>
<p>Unfortunately this did not work! My MacBook Pro was not able to pick up
any audio signal from the microphone. This caused some initial confusion
because I thought that the headset was broken. I verified that it was
indeed working by trying it out on a Windows machine which had a
dedicated sound card.</p>
<p><em>So, what could be causing it to not work on a MacBook Pro?</em></p>
<p>There are two interesting things that I discovered:</p>
<ol>
<li>The audio-in jack on the MacBook Pro requires that the signal is
amplified before coming in. If you are using the audio-in jack for
sound recording through some amplifier, then you are OK. However, it
will not work for a normal pheadset.</li>
<li>The audio-out jack on the MacBook Pro can <em>sometimes</em> function as an
dual audio-in and audio-out. This seems to work for the iPhone
headset. Plug the iPhone headset in and you can use it both for
recording and for listening.</li>
</ol>
<p><em>But neither of these discoveries help me solve my problem.</em></p>
<p>The only other solution is to get a USB headset. Those have been known
to work on the MacBook Pros. However, according to our resident AV
expert, most USB headsets are designed for VoIP applications and, thus,
contain active noise cancellation. When used for audio recording, they
produce muffled sound, or as he would call it “truly shit recordings”.</p>
<p><em>What was the final solution?</em></p>
<p>Because I didn’t want to produce “truly shit recordings”, I needed to
find a different work around. Fortunately, I found an old Philips PSC805
Aurilium external <a href="http://download.p4c.philips.com/files/p/psc805_17/psc805_17_dfu_aen.pdf">sound
card</a>
lying around. I plugged the USB connection into my USB port and
connected the headset to <em>its</em> mic in and headphone jacks, like so:</p>
<div class="media">
<a href="http://db.tt/0WENuZFQ">
<img src="http://db.tt/0WENuZFQ" class="media-object" />
</a>
</div>
<hr />
<p><strong>UPDATE</strong>: Turns out that the Philips PSC805 Aurilium had actually
stopped working for the microphone. So I bought a <a href="http://us.store.creative.com/Creative-Sound-Blaster-XFi-Go-Pro/M/B0044DEDC0.htm">Creative Sound
Blaster X-Fi Go!
Pro</a>
(now that’s a mouthful) instead. The nice thing? This external soundcard
is about the size of a USB thumbdrive – it’s tiny! There’s no driver
for the Mac (and it claims to not be Mac-compatible) but it does work
when you plug it in.</p>
<p>The conclusion: if you are using an external non-USB headset with your
MacBook Pro, you might want to consider getting an external sound card
or something that can amplify the audio signal. It’s not that the
headset doesn’t work; it’s that the MacBook Pro by itself does not
amplify the signals through the audio-in jack.</p>
Gradle GUI2013-03-03T00:00:00+00:00http://vazexqi.github.com/posts/2013/03/03/gradle-gui<p>I’m really enjoying the <a href="http://www.gradle.org/">Gradle</a> build tool for
my JVM-based projects. All of our <a href="https://www.coursera.org/course/vlsicad">Coursera VLSI
CAD</a> course backend software is
built, tested and deployed using Gradle.</p>
<p>One feature that I just discovered recently is the <a href="http://www.gradle.org/docs/current/userguide/tutorial_gradle_gui.html">Gradle
GUI</a>
feature. In short, Gradle comes bundled with a very simple GUI, as can
be seen below:</p>
<div class="media">
<a href="http://db.tt/bm9Tuquc">
<img src="http://db.tt/bm9Tuquc" class="media-object noshadow" />
</a>
</div>
<p>At first glance, I was quite impressed by it since no other build tool
that I have used comes with a GUI built-in. It’s probably useful for new
users of Gradle who might be less familiar with its options. Or it could
be useful for taking a quick glance at the list of tasks and their
descriptions for bigger projects.</p>
<p>Unfortunately, this feature seems to be less important and useful for
intermediate and advanced users of Gradle. As you use Gradle more, you
begin to <em>remember</em> most of its usual commands and the names of your own
custom commands. Even if you don’t remember them, it’s usually easier to
just use the history function of your shell (up and down arrows) to
recall a particular command <strong>or</strong> to use a gradle shell
<a href="https://github.com/robbyrussell/oh-my-zsh/pull/428">plug-in</a> for
auto-completion.</p>
<p>One feature that I think might be useful to add to the GUI for both new
and old users of Gradle would be some form of a dependency tree
structure. Those things are hard to “visualize” from just reading the
build.gradle file and having a graph of that (e.g., the Gradle Java
plug-in relationship between task
<a href="http://www.gradle.org/docs/current/userguide/img/javaPluginTasks.png">diagram</a>) would be useful.</p>
Logging to file using SLF4J2013-02-24T00:00:00+00:00http://vazexqi.github.com/posts/2013/02/24/groovy-slf4j<p>Part of being a TA for our <a href="https://www.coursera.org/course/vlsicad">VLSI CAD: Logic to
Layout</a> is the very important task of
implementing the auto-graders that power the assignments. The auto-graders are
run on the Coursera servers and auto-scaled (new instances are spawned) as
necessary. With about 10, 000 students registered for the class, the possibility
that somethings goes wrong is <em>highly</em> probable.</p>
<p>Thus, it is extremely useful to have some file of logging implemented,
preferably one that has the ability to log to file and rotate the logs as
necessary.</p>
<p><em>Fortunately</em>, there is no shortage of logging frameworks for Java. I say that
in a tongue-in-cheek way because as I was starting to implement this a few days
ago, I was overwhelmed by the sheer number of different logging frameworks from
the built-in java.util.logging, <a href="http://commons.apache.org/logging/">commons
logging</a>,
<a href="http://logging.apache.org/log4j/1.2/index.html">log4j</a> to
<a href="http://logback.qos.ch/">logback</a>.</p>
<p>After reading more about the different frameworks, I realize that I necessarily
have to fully <em>commit</em> to one. I could use, yet another framework, to <em>decouple</em>
the dependency. Thus, enters <a href="http://www.slf4j.org/manual.html">SLF4J</a>.
According to the website:</p>
<blockquote>
<p>The Simple Logging Facade for Java or (SLF4J) serves as a simple facade or
abstraction for various logging frameworks, such as java.util.logging, log4j and
logback. SLF4J allows the end-user to plug in the desired logging framework at
deployment time.</p>
</blockquote>
<p>There is even a nice image on the SLF4J website that shows how this works under
the hood:</p>
<div class="media">
<a href="http://www.slf4j.org/images/concrete-bindings.png">
<img src="http://www.slf4j.org/images/concrete-bindings.png" class="media-object" />
</a>
</div>
<p>Because setting up logging can be quite complicated the first time one uses it,
the purpose of this post is to serve as a quick reference (possibly for myself
in the future too, when I have to do this again from scratch). I am going to
showcase how to do logging in <a href="http://groovy.codehaus.org/">Groovy</a> using the
<a href="http://www.gradle.org/">Gradle</a> build tool.</p>
<hr />
<h3 id="setting-up-the-files">Setting up the files</h3>
<p>Gradle follows a sensible <em>convention-over-configuration</em> scheme on where to
place your source files. Instead of making things more complicated, we are going
to stick with that scheme. This means, that all source files should go into
<code class="language-plaintext highlighter-rouge">src/main/groovy</code>. Here’s a screenshot of where the files should go to help:</p>
<div class="media">
<a href="http://db.tt/RzuGL16Y">
<img src="http://dl.dropbox.com/u/11541918/Blog/images/logging_directory_structure.png" class="media-object noshadow" /></a>
</div>
<p>For each of the files that I will describe below, stick them in the right
location following the convention above.</p>
<h3 id="setting-up-gradle">Setting up Gradle</h3>
<p>We are going to use Gradle to set up the dependencies, manage the build process
and the lauching of our example.</p>
<script src="https://gist.github.com/vazexqi/5024526.js"></script>
<p>The script above will fetch all the dependencies for you.</p>
<h3 id="the-myexample-class">The MyExample class</h3>
<p>This is the example class that we will be using. It’s a very simple program that
prints a heartbeat every 30 seconds (so you can easily see something happening
to the console).</p>
<script src="https://gist.github.com/vazexqi/5024557.js"></script>
<p>This code snippet uses a bit of Groovy <em>magic</em> available since version
1.8. It uses the <code class="language-plaintext highlighter-rouge">@sfl4j</code> type annotation to introduce a new variable
called <code class="language-plaintext highlighter-rouge">log</code> that maps to a call to the logger. That way, you no longer
have to write ugly code that instantiates a logger for each of your
classes.</p>
<h3 id="the-logbackxml-file">The logback.xml file</h3>
<p>By default the loggers will all output only to console. Since the purpose of
this post is to show you how to actually log things to file with a
rotating/rolling log file, I’ve also included the configuration file that I have
used.</p>
<script src="https://gist.github.com/vazexqi/5024574.js"></script>
<p>The configuration file above creates two kinds of <code class="language-plaintext highlighter-rouge">Appenders</code>. The first one
called <code class="language-plaintext highlighter-rouge">STDOUT</code> appends to the console, and the second one called <code class="language-plaintext highlighter-rouge">FILE</code> appends
to file. We configure the <code class="language-plaintext highlighter-rouge">FILE</code> appender so that it uses a rolling scheme. It
will create a new log file daily and keep up to 7 days’s worth of history.</p>
<p>The logback website has a rich set of <code class="language-plaintext highlighter-rouge">Appenders</code> that one can use. There is
even one that can e-mail the logs to your account. Check out
<a href="http://logback.qos.ch/manual/appenders.html">http://logback.qos.ch/manual/appenders.html</a>
for more code snippets.</p>
<h3 id="running-the-example">Running the example</h3>
<div class="media">
<a href="http://db.tt/kw3flQg9">
<img src="http://dl.dropbox.com/u/11541918/Blog/images/logging_running.png" class="media-object noshadow" /></a>
</div>
<p>Assuming that you have gradle installed, you just need to execute <code class="language-plaintext highlighter-rouge">gradle
runMyExample</code>.</p>
<p>It should print “Still alive…” every 30 seconds or so <strong>both</strong> on the console
and into the log files.</p>
<hr />
<p>If you wish, you can download the files for this project from
<a href="http://db.tt/W6rY4hRI">here</a>.</p>
Being a proud citizen of HJKL-land2013-02-19T00:00:00+00:00http://vazexqi.github.com/posts/2013/02/19/hjkl<div class="media pull-left"> <a href="http://www.catonmat.net/images/why-vim-uses-hjkl/adm-3a-hjkl-keyboard.jpg">
<img src="http://www.catonmat.net/images/why-vim-uses-hjkl/adm-3a-hjkl-keyboard.jpg" class="media-object" /></a> </div>
<p>Over the past year, I’ve been working hard to indoctrinate my fingers to
become better citizens of HJKL-land. To be a good citizen of HJKL-land,
one must train in the way of Vim: resist all urges to move the hands to
the arrows keys or to the mouse; strive to keep your fingers on the home
row; think in terms of text motions instead of simple keyboard motions;
and, of course, endeavor to remove all wasted motion in one’s daily text
editing.</p>
<p>Being a citizen of HJKL-land is indeed a rewarding experience.</p>
<p>But it wasn’t easy. Sure, one could make progress by reading a
<a href="http://pragprog.com/book/dnvim/practical-vim">book</a> watching some
<a href="http://vimcasts.org/">screencasts</a>, installing a couple of
<a href="https://github.com/carlhuda/janus">plug-ins</a> and even reading about
<a href="http://learnvimscriptthehardway.stevelosh.com/">Vimscript</a>. But just
using Vim occasionally isn’t going to help indoctrinate you to be a good
citizen. Until one starts using Vim for the essentials, it just isn’t
going to click.</p>
<p>For a developer, this means being in Vim-mode for the tools you use
daily: your shell, your terminal, your web browser (don’t laugh, just
time how much time you spend in your web browser reading Stackoverflow
each day) and your <em>other</em> IDEs (for when you can’t use Vim).</p>
<p>There are many excellent tutorials out there about Vim. This isn’t one of
them. Instead, the point of this post is to illustrate how to get some of the
tools that you use daily into Vim-mode. Spending as much time in Vim-mode (or
Vim-like-mode) as possible is the best way to train.</p>
<h3 id="zsh">zsh</h3>
<p>zsh is my current shell right now. The magic incantation to turn Vim-mode on
for zsh is <code class="language-plaintext highlighter-rouge">bindkey-v</code>. However, just turning that on isn’t going to buy you
much. In fact, it might even make you less productive because a lot of the
keyboard shortcuts that you are used to might no longer work (e.g.,
reverse-search of commands).</p>
<p>Instead, I suggest using zsh with the useful .oh-my-zsh framework. I have a
simple fork of at
<a href="https://github.com/vazexqi/oh-my-zsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh">https://github.com/vazexqi/oh-my-zsh/</a>.
I added some useful features to enable incremental search of history. The
details are in my modified <a href="https://github.com/vazexqi/oh-my-zsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh">vi-mode
plug-in</a>
file.</p>
<p>Enable the vi-mode plug-in by adding it to the <code class="language-plaintext highlighter-rouge">plugins</code> variable in your
.oh-my-zsh genarated .zshrc file.</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash">plugins <span class="o">=</span> <span class="o">(</span>vi-mode history-substring-search<span class="o">)</span></code></pre></figure>
<p>If you are still using bash, then I recommend subscribing to Tom Ryder’s
Arabesque <a href="http://blog.sanctum.geek.nz/">blog</a>. He is an active Vim user
who also happens to use bash as his shell. In fact, my tip for tmux
comes from him.</p>
<h3 id="tmux">tmux</h3>
<div class="media"> <a href="http://db.tt/QnxvT7um"> <img src="http://db.tt/QnxvT7um" class="media-object noshadow" /></a>
</div>
<p>To prevent a proliferation of tabs or windows, I manage all my terminal
sessions using <a href="http://tmux.sourceforge.net/">tmux</a>. I won’t have time
to go into all the features of tmux so I would recommend reading
<a href="http://pragprog.com/book/bhtmux/tmux">Pragmatic Tmux</a> which is concise
introduction to the features of tmux.</p>
<p>Here are some tweaks that I put into my .tmux.conf file to make it mimic
Vim. The top portion corresponds to tweaks to simulate Vim motions for
selecting different panes. The bottom portion corresponds to tweaks to
make tmux’s selection more behave like Vim. I’ve credited the original
authors where possible. For my entire .tmux.conf, please refer to this
<a href="https://gist.github.com/vazexqi/4993432#file-tmux-conf-L5">gist</a>.</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Simulating Vim motions</span>
<span class="c">########################</span>
<span class="c"># splitting panes</span>
<span class="c"># START:panesplit</span>
<span class="nb">bind </span>v split-window <span class="nt">-h</span>
<span class="nb">bind </span>s split-window <span class="nt">-v</span>
<span class="c"># END:panesplit</span>
<span class="c"># moving between panes</span>
<span class="c"># START:paneselect</span>
<span class="nb">bind </span>h <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-L</span>
<span class="nb">bind </span>j <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-D</span>
<span class="nb">bind </span>k <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-U</span>
<span class="nb">bind </span>l <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-R</span>
<span class="c"># END:paneselect</span>
<span class="c"># Pane resizing</span>
<span class="c"># START:paneresize</span>
<span class="nb">bind</span> <span class="nt">-r</span> H resize-pane <span class="nt">-L</span> 5
<span class="nb">bind</span> <span class="nt">-r</span> J resize-pane <span class="nt">-D</span> 5
<span class="nb">bind</span> <span class="nt">-r</span> K resize-pane <span class="nt">-U</span> 5
<span class="nb">bind</span> <span class="nt">-r</span> L resize-pane <span class="nt">-R</span> 5
<span class="c"># END:paneresize</span>
<span class="c"># Vim-style keys in select mode</span>
<span class="c">###############################</span>
<span class="c"># enable vi keys.</span>
<span class="c"># START:vikeys</span>
setw <span class="nt">-g</span> mode-keys vi
<span class="c"># http://blog.sanctum.geek.nz/vi-mode-in-tmux/</span>
<span class="c"># https://github.com/sjl/dotfiles/blob/master/tmux/tmux.conf</span>
<span class="nb">bind</span> <span class="nt">-t</span> vi-copy v begin-selection
<span class="nb">bind</span> <span class="nt">-t</span> vi-copy y copy-selection
<span class="nb">bind</span> <span class="nt">-t</span> vi-copy Escape cancel
<span class="c"># END:vikeys</span></code></pre></figure>
<h3 id="pentadactyl">Pentadactyl</h3>
<div class="media"> <a href="http://www.catonmat.net/blog/why-vim-uses-hjkl-as-arrow-keys/"><img src="http://5digits.org/img/screenshots/dactyl-buffers-all.png" class="media-object" /></a> </div>
<p><a href="http://5digits.org/pentadactyl/">Pentadactyl</a> is a browser add-on for
Firefox that enables Vim-like motions for browsing the web. Because
browsing the web isn’t exactly like editing text, there is some
impedance mismatch between some of the key mappings. But for the most
part, it’s pretty intuitive. It’s also one of the main reasons why I
tolerate Firefox as my main web browser.</p>
<p>Chrome has <a href="http://vimium.github.com/">Vimium</a> but it just feels like
<em>ersatz</em> Pentadactyl.</p>
<p>If you have heard of or use Vimperator before, Pentadactyl is similar.
There is an FAQ <a href="http://5digits.org/pentadactyl/faq">entry</a> discussing
the (political) differences, which I won’t get into.</p>
<p>There are a ton of features for Pentadactyl so I am going to list my top
<strong>three</strong>.</p>
<ol>
<li>
<p>Follow hints: Type ‘f’ on your keyboard and all links are immediately
marked with unique key sequences. Typing out a key sequence (very short;
about 2 characters) will open that link. For more information, see this
help <a href="http://5digits.org/help/pentadactyl/hints.xhtml">entry</a>.</p>
</li>
<li>
<p>Quickmarks: Assign one character shortcut keys to your favorite
bookmarks. For instance, I assign ‘G’ for Gmail. I can easily open GMail
in the current tab by executing <code class="language-plaintext highlighter-rouge">goG</code>. Or I can open it in a new tab by
executing <code class="language-plaintext highlighter-rouge">gnG</code>. <code class="language-plaintext highlighter-rouge">go</code> stands for “open in current tab” and <code class="language-plaintext highlighter-rouge">gn</code> means
“open in new tab”. I have several quickmarks for Gmail, Github, Google
Voice, Facebook, Twitter, etc. This saves me tons of time each day.</p>
</li>
<li>
<p>Jump to top of page and bottom of page quickly: Just do as you would
for Vim. Hit <code class="language-plaintext highlighter-rouge">gg</code> for top of page. And <code class="language-plaintext highlighter-rouge">G</code> for the bottom of the page.
No need to use the scroll button on your mouse of hit the page up keys
repeatedly.</p>
</li>
</ol>
<h3 id="vrapper-and-ideavim">Vrapper and IdeaVIM</h3>
<p>I am bit ashamed to admit that I use these last two tools but, hey, I
code in several JVM languages (Java, Groovy, Scala) and without an IDE
with smart auto-completion of libraries, it is a pain to type everything
manually.</p>
<p><a href="http://vrapper.sourceforge.net/home/">Vrapper</a> extends the Eclipse text
editor with Vim-like input scheme.</p>
<p><a href="https://github.com/JetBrains/ideavim">IdeaVim</a>, is the same, except
that it works for IntelliJ IDEA.</p>
<p>Both of these do <strong>not</strong> fully emulate all the Vim shortcuts. However,
they are pretty decent. Vrapper, in particular, has an embedded version
of Tim Pope’s <a href="https://github.com/tpope/vim-surround">Surround</a>. If you
use Sublime Text as your text editor, then I would say that both these
plug-ins are comparable to <a href="http://www.sublimetext.com/docs/2/vintage.html">Vintage
Mode.</a>.</p>
<hr />
<p>And that’s my list of tools and how I tweaked each one to behave more
Vim-like. Every little tweak helped me embrace Vim more and train my
fingers until the motions become second-nature. If you know of other
tools and how to make them behave more Vim-like, I’d be interested in
hearing more.</p>
Made to Stick2013-02-08T00:00:00+00:00http://vazexqi.github.com/posts/2013/02/08/made-to-stick<div class="media pull-left">
<a href="http://www.heathbrothers.com/madetostick/">
<img src="http://bks2.books.google.com/books?id=DhRlRwAACAAJ&printsec=frontcover&img=1&zoom=1&imgtk=AFLRE70qTJ9S86TDlIDEbBLMaBZd3OgQhfltmmaebaTHSzko55q3rUDYOMJzunwwnejEyAd8WazoCRdCIut1vQOeN_jRAVv3flgW0TW6nhkiJbS0qj-NwsO0f9VhRQCH17C3iCcAGikH" class="media-object" /></a>
</div>
<p><em>Made to Stick</em> is one of the most influential books that I have ever
read. Period. It’s a book so important that I cannot stop recommending
it to everyone who is about to give any kind of talk, pitch or
presentation.</p>
<p>The message is simple: there are six key steps to making a
successful presentation that <em>sticks</em>. A successful presentation isn’t
necessarily the one that is most beautify; it’s not necessarily the one
with the most data. It’s the one that everyone will remember after
talking to you.</p>
<p>The best way to illustrate this – following the advice from the book
itself – is to give a concrete example. This concrete example is taken
from the first chapter of the book, which you can conveniently read at
the authors’
<a href="http://www.heathbrothers.com/madetostick/chapterone.php">website</a>. It’s
a story about something mundane that we usually don’t think twice about
consuming: movie popcorn.</p>
<p>In 1992, the Center for Science in the Public Interest (CSPI) found out
something interesting: a typical serving of popcorn from a movie theater
could contain up to 37 grams of saturated fat.</p>
<p>Now unless you are a nutritionist, hearing the term 37 grams of fat is
unlikely to cause any form of panic. However, it turns out that the
recommended daily intake of saturated fat for a typical adult is 20
grams – a single serving of that movie popcorn had nearly double the
recommended daily amount!</p>
<p>This is serious news. And being the CSPI, one of their main interests
was to raise public awareness about this phenomenon. Imagine that you
were working for the CSPI, how would you launch a public campaign to
spread the news?</p>
<p>I confess that before reading this book, what I would have done would be
to create a pretty bar chart with two bars: one that shows the amount of
recommended daily fat and another that shows the amount of fat in a
serving of popcorn. My main idea being that it <em>should</em> be obvious that
popcorn has almost double the amount of recommended fat from just
<em>looking</em> at the chart. <em>It should be clear, shouldn’t it?</em></p>
<p>Turns out there is a much better way to do this. Instead of a fancy
graph, the better approach would be to phrase it like this:</p>
<blockquote>
<p>A medium-sized ‘butter’ popcorn at a typical neighborhood movie theater
contains more artery-clogging fat than a bacon-and-eggs breakfast, a Big
Mac and fries for lunch, and a steak dinner with all the trimmings —
combined!</p>
</blockquote>
<p>Why is that sentence so much more effective than the graph idea that I
had? Well, it’s <em>short</em>, <em>unexpected</em>, <em>concrete</em>, and it forms an
<em>emotional story</em>. People are able to identify with it immediately. And
that’s what an important presentation must accomplish – make people
identify with what it is that you are doing.</p>
<p>Here’s a quick chart that summarizes the six key steps from the book:</p>
<p><img src="http://everything-pr.com/wp-content/uploads/2009/07/succes.jpg" /></p>
<p>So what has this got to do with programming? Not much actually. But it
has a lot to do with how you sell yourself, your skills and your
products to other people. Just because you have the world’s greatest
code doesn’t mean anything unless you can get people to pay attention to
you. And now there is a readable non-nonsense book that describes the
process for doing so.</p>
<p>I’ve used the techniques in the book myself during my presentations and
during my interviews. I have recommended the book to my colleagues who
are about to make presentations. And when people embrace those ideas,
there is definitely a positive effect on their presentations <i class="icon-thumbs-up"></i>.</p>
<p>By the way, the story happened in 1992. I was unable to find any
continuation of the story in the present time. So I would assume that
movie popcorn has probably less saturated now compared to back then.</p>
Making Objective-C Land More Habitable2009-12-17T00:00:00+00:00http://vazexqi.github.com/2009/12/17/making-objective-c-land-more-habitable<p>
Over these past few months, I have been working on a long-term class project using OS X technologies in both Objective-C and <a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html">Javascript</a>. Overall, the experience was pretty good (except for the Javascript part) -- and I suspect much easier compared to having to use Java. Using Java would require us to hunt down various libraries and then filter through them since there are probably 10++ different libraries for each thing that we need to do. So using OS X was a good choice.
</p>
<p>
However, there are a few tools that I wished I had known earlier....
</p>
<h2>GHUnit</h2>
<p>
Unit testing using Cocoa is pretty complicated. In fact, it's unnecessarily more complicated than Java, Ruby or Smalltalk. It's <em>only</em> less complicated than unit testing C++ (which doesn't say much)! There are <strong>two</strong> things that particularly irk me:
<ul>
<li><strong>Not seeing green/red!</strong> - You have to actually <strong>read</strong> the text in the build log to see which of your tests pass and fail. This is completely ridiculous - it's so easy to miss a failing test case because of this. Anyone who has used the <a href="http://en.wikipedia.org/wiki/XUnit">Xunit</a> testing framework family is accustomed to seeing <span style="background: green; color: white;">green</span> for passing tests and <span style="background: red; color: white;">red</span> for failing tests.
</li>
<li><strong>Not being able to debug your unit tests</strong> - You have to perform some boilerplate <a href="http://chanson.livejournal.com/120740.html">steps</a> on your own. Such steps should be automated for you!</li>
</ul>
</p>
<p>
Fortunately, <a href="http://rel.me/2009/02/21/unit-testing-for-mac-os-x-and-iphone-ghunit/">GHUNit</a> comes along. And at least solves those <strong>two</strong> problems. It has become my choice for unit testing in Cocoa and all my future projects will use it. It's released under a very liberal open source <a href="http://github.com/gabriel/gh-unit/blob/master/LICENSE">license</a> so using it in your own project shouldn't be a problem. Apple and the Xcode team should integrate this directly into Xcode.
</p>
<div style="text-align:center;">
<a href="https://bytebucket.org/vazexqi/healthmonitor/wiki/Images/GHUnitTest.png?token=6d5d3f18ec25f1df9844ce05c6cafbf0eb05b4f1" title="View 'Create an External Build System project' on Flickr.com">
<img src="https://bytebucket.org/vazexqi/healthmonitor/wiki/Images/GHUnitTest.png?token=6d5d3f18ec25f1df9844ce05c6cafbf0eb05b4f1" alt="GHUnit in action" border="0" width="50%" /></a>
<br/>
<small>GHUnit in action</small>
</div>
<h2>F-Script</h2>
<p>
The cocoa libraries are nice. But sometimes the documentation can be a bit confusing. So, the best way to find out what a method or class does it to write some code for it and try it out. But honestly, would you like writing a small program each time to try a method or class out?
</p>
<p>
That's when you need <a href="http://www.fscript.org/">F-Script</a> which allows you to call run Objective-C like you would run a scripting language. Need to find out how that NSString method behaves? Just type in into the F-Script REPL workspace. You can even play around with <a href="http://www.fscript.org/documentation/LearnFScriptIn20Minutes/index.htm">Core Image</a> easily in the F-Script workspace!
</p>
<div style="text-align:center;">
<a href="http://www.fscript.org/images/screenshots/shell.jpg">
<img src="http://www.fscript.org/images/screenshots/shell.jpg" alt="GHUnit in action" border="0" width="50%" /></a>
<br/>
<small>F-Script shell in action</small>
</div>
<p>
But wait! F-Script has even more to offer. Using <a href="http://pmougin.wordpress.com/2009/08/29/f-script-anywhere-on-snowy/">F-Script <em>Anywhere</em></a> allows you to inject the F-Script environment into any Cocoa application. That way you can quickly figure out and play around with other people's application!
</p>
<p>
The only thing you need to do is spend about 20 minutes learning the F-Script syntax which is very similar to Smalltalk's - so it only took me about 5 minutes.
</p>
<h2>Clang Static Analyzer</h2>
<p>
One area where Java really shines is the abundance of high-quality tools for static analysis. Using these tools allow you to avoid a lot of silly mistakes before you even compile or run your Java code.
</p>
<p>
Previously, Objective-C was definitely lacking in this area. However, the <a href="http://clang-analyzer.llvm.org/">Clang Static Analyzer</a> hopes to change that. In fact, if you are using the latest version of Xcode under Snow Leopard, it should be <a href="http://developer.apple.com/mac/library/featuredarticles/StaticAnalysis/index.html">integrated</a> already. Here's the static analyzer in action:
</p>
<div style="text-align:center;">
<a href="https://developer.apple.com/library/mac/#/legacy/mac/library/featuredarticles/StaticAnalysis/FeaturedArticle.html">
<img src="https://developer.apple.com/legacy/mac/library/featuredarticles/StaticAnalysis/Art/uninitialized.jpg" alt="Unintialized Variable Error" border="0" width="50%" /></a>
<br/>
<small>Uninitialized Variable Error</small>
</div>
<p>
For our particular project, we needed to use OS X Leopard so followed <a href="http://clang-analyzer.llvm.org/scan-build.html">these</a> steps to get the static analyzer to work. Even though it took a few more steps, the extra trouble is worth it since it catches a lot of garbage collection issues that we might have missed otherwise.
</p>
<p>
The Clang Static Analyzer is based on the <a href="http://llvm.org/">LLVM</a> compiler infrastructure developed here the University of Illinois at Urbana-Champaign.
</p>
<h2>BWToolkit</h2>
<p>
Interface Builder is awesome. It definitely beats any other interface builder that I have tried. However, it can be too <em>basic</em> at times. It works very well, if you are doing a simple UI. But it lacks the palettes for some of the more advanced (but pretty commonplace) UI that you see in Mail.app, iCal.app, etc.
</p>
<p>
That's when <a href="http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/">BWToolkit</a> comes in. It offers a plethora of different palettes which makes designing your UI extremely easy. And you can use all of them using drag-and-drop from Interface Builder.
</p>
<div style="text-align:center;">
<a href="http://brandonwalkin.com/blog/images/transparent3.png">
<img src="http://brandonwalkin.com/blog/images/transparent3.png" alt="BWToolkit" border="0" width="50%" /></a>
<br/>
<small>BWToolkit's suite of controls for HUD windows</small>
</div>
<p>
It's released under the liberal BSD license so you don't need to worry about using it for your projects. GHUnit itself uses it and that's actually how I discovered this wonderful toolkit.
</p>
<hr />
Overall, OS X has a lot to offer in both <a href="http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/OSX_Technology_Overview/About/About.html">libraries</a> and <a href="http://developer.apple.com/tools/">tools</a>. And when it falls short, some other developer out there is usually passionate enough to create and share their tools with you. It just takes <em>too</em> long sometimes to find those tools. So hopefully, this list will be useful to some other aspiring OS X developer.
Modifying plugin.xml of Existing Eclipse plugins2009-10-11T00:00:00+00:00http://vazexqi.github.com/2009/10/11/modifying-plugin-xml-of-existing-eclipse-plugins<p>
I have been taking a deeper look at <a href="http://mercurial.selenic.com/wiki/">Mercurial</a> for some of my projects. And I was interested in looking at its source code. I usually do a lot of Java development and have gotten used to all the nifty navigation features that Eclipse/NetBeans/IntelliJ have to offer such as "Jump to Declaration", "Open Type Herarchy", etc. So I wanted to find a good IDE for going through the Mercurial source code, which is written in Python. Apparently, there isn't a de-facto IDE for Python. But <a href="http://pydev.org/">PyDev</a> comes close.
</p>
<p>
Unfortunately – I am not sure whether this was intentional or not – the keyboard shortcuts for PyDev aren't very platform friendly. Instead of the default modifier key (Ctrl on Windows/Linux and ⌘ on Mac) the developers have hardcoded the modifier to Ctrl for all platforms. So to invoke the I would have to use Ctrl + Shift + T instead of ⌘ + Shift + T.
</p>
<p>
So how do we change the keybindings? Well, there is an extension point in the Eclipse plugin architecture for specifying the keybindings. Take a look at <a href="http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_bindings.html">org.eclipse.ui.bindings</a> And those keybindings are stored as plain text in a plugin.xml file. For PyDev, it would be in the <em>plugins</em> folder of your Eclipse installation. In my case, it was under eclipse-galileo/plugins/org.python.pydev_1.5.0.1251989166/plugin.xml
</p>
<p>
So we can edit the plugin.xml file by looking for the
<pre>
...
<key
sequence="Ctrl+Shift+T"
contextId="org.python.pydev.ui.editor.scope"
commandId="org.python.pydev.editor.actions.pyShowBrowser"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
...
</pre>
and changing the Ctrl to M1 which stands for the default modifier key on your platform i.e.
<pre>
...
<key
sequence="M1+Shift+T"
contextId="org.python.pydev.ui.editor.scope"
commandId="org.python.pydev.editor.actions.pyShowBrowser"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
...
</pre>
</p>
<p>
Unfortunately, we are not done. And it took me some time to figure out the problem. Apparently, Eclipse doesn't read the plugin.xml every time. Instead, it caches a version of it somewhere. So even if we modify the plugin.xml, Eclipse might not know about it.
</p>
<p>
What we have to do is to <em>tell</em> Eclipse to clean its cache. And we can do that by using the <code>-clean</code> option in its eclipse.ini file. On the Mac, this file in located in Eclipse.app/Contents/MacOS/eclipse.ini (you need to right-click on the Eclipse application and select "Show Package Contents").
</p>
<p>
Change the first line so that it read something like this:
<pre>
-clean
-startup
../../../plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
...
</pre>
</p>
<p>
Now when Eclipse starts up, it will clean its cache and read the newly modified plugin.xml file. Once we are done with this step, we should remove the <code>-clean</code> option since this causes Eclipse to start up slower. And <strong>who</strong> would want Eclipse to start up any slower than it already does?!
</p>
<p>
And this is what the keybindings look like after the changes:
</p>
<a href="/files/pydev.png" title="PyDev with Mac-friendly Keybindings"><div style="text-align:center;"><img src="/files/pydev.png" alt="PyDev with Mac-friendly Keybindings" border="0" width="375" height="340" /></div></a>
Hacking Lua (in Xcode)2009-02-15T00:00:00+00:00http://vazexqi.github.com/2009/02/15/hacking-lua-in-xcode<p>
I have always been fascinated by <a href="http://en.wikipedia.org/wiki/Comparison_of_application_virtual_machines">application virtual machines</a>. And I have been trying to find a simple but well-documented one to work on for fun. There is a proliferation of Javascript VMs out there but they are pretty big (V8 is the latest kid on the block and it's about 100 000 lines of C++, not my favorite language) and aren't as well documented.
</p>
<p>
There are some smaller ones like <a href="http://code.macournoyer.com/tinyrb/">tinyrb</a> and <a href="http://www.tinypy.org/">tinypy</a> but the goal of such projects aren't really clear. I am not sure how much of Ruby/Python they are trying to support. They are great for hacking on if you have some experience with VMs already and can contribute to the design/implementation. But otherwise, it can be pretty hard to comprehend what is going on.
</p>
<p>
Both tinyrb and tinypy did mention that they were trying to emulate the Lua VM. So I decided to check it out. The Lua VM (like the <a href="http://www.parrot.org/">Parrot VM</a>) is a register-based VM, which is pretty unusual since most VMs are stack-based. Its use of registers instead of a stack makes it more fascinating to study.
</p>
<p>
And I like what I have seen so far. There is good documentation on <em>multiple</em> levels: the language itself, the architecture of the VM and plenty of examples. Also, the code is in C which is less messy than C++. The Makefile is simple and isn't using any cryptic tricks. And Lua itself seems like a simple language to learn.
</p>
<p>
So my plan is to dive into the source for Lua and then see what can be done to improve tinyrb. But first, I need to set up an environment to develop in.
</p>
<p>
I could certainly continue to use vim/TextMate, but I have been using Xcode more because I am doing some iPhone development and have gotten use to some of its features. And I like its built-in debugger which saves me from having to interact with gdb directly for the common tasks. In fact, I am not sure if there are <em>better</em> C/C++ IDEs for OS X. The Eclipse CDT project is the closest that I can think of but I haven't used it much.
</p>
<p>
So here are my steps for doing this: from getting the source into Xcode and also starting a debugging session. I am using the All-in-one look for Xcode so your UI might look different.
</p>
<p>
Grab the source for Lua-5.1.4 from <a href="http://www.lua.org/ftp/lua-5.1.4.tar.gz">http://www.lua.org/ftp/lua-5.1.4.tar.gz</a>. Unarchive it. For this article, I will be unarchiving it in ~/Xcode.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3282596714" title="View 'Create an External Build System project' on Flickr.com"><div style="text-align:center;"><img src="http://farm4.static.flickr.com/3602/3282596714_e4bea7e203.jpg" alt="Create an External Build System project" border="0" width="500" height="372" /></div></a>
<p>
Fire up Xcode and create a new External Build System project. I called my project Lua. You can put the project wherever you want. It doesn't need to be in the same directory where you unarchived the Lua source code since we will be <em>referencing</em> the source files anyway.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775589" title="View 'Add the existing Lua files' on Flickr.com"><div style="text-align:center;"><img src="http://farm4.static.flickr.com/3289/3281775589_e28284b40e.jpg" alt="Add the existing Lua files" border="0" width="500" height="363" /></div></a>
<p>
Right-click on the project and add the <em>entire</em> directory where you unarchived the Lua source code. In my case it would be ~/Xcode/lua-5.1.4.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3282596760" title="View 'After adding the files' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3426/3282596760_5cd1fca875.jpg" alt="After adding the files" border="0" width="" height="" /></div></a>
<p>
This is what it looks like after adding all the files.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775761" title="View 'Make changes to the Makefile for OS X' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3248/3281775761_3d00ee18bf.jpg" alt="Make changes to the Makefile for OS X" border="0" width="" height="" /></div></a>
<p>
Next, we need to edit <strong>two</strong> of the Makefiles. First, we need to edit the top level Makefile in ~/Xcode/lua-5.1.4. Change <strong>line 8</strong> to PLAT= macosx since we are targeting the OS X platform. Then, we need to make changes to the Makefile in ~/Xcode/lua-5.1.4/src. Change <strong>line 17</strong> to MYCFLAGS+= (we want the + symbol). Change <strong>line 108</strong> to $(MAKE) all MYCFLAGS+=-DLUA_USE_LINUX MYLIBS="-lreadline" (again, we want the + symbol). In fact, by default, it should have the + symbol so that we can easily accumulate our own settings. I suspect that this is a careless omission in the Makefile for Lua.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775837" title="View 'Changing the parameters of the Lua target' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3156/3281775837_ebc0be8f0d.jpg" alt="Changing the parameters of the Lua target" border="0" width="" height="" /></div></a>
<p>
We need to make some changes to the Target configuration for our Project. So navigate to the Lua target in your Groups & Files (it's the left navigation pane). And double-click the Lua target. Then edit it so that it resembles the image above. Notice the line that says "Settings show Debug" near the top of the window; we are changing the settings for Debug (and not Release).
</p>
<p>
You need to change the directory to the location where you unarchived the Lua source so that it can find the top-level Makefile.
</p>
<p>
Then you need to add a new build setting, MYCFLAGS so that we can pass the -g flag (for debug) to the compiler. Without this flag, we cannot debug our program effectively with the debugger (it doesn't have all the necessary debugging information).
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775787" title="View 'The result of the build (for debug)' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3586/3281775787_05edcafb11.jpg" alt="The result of the build (for debug)" border="0" width="" height="" /></div></a>
<p>
Now we can build our project by going to Build > Build. And notice that we are building for the Debug configuration i.e. on the menu item at the top it says 10.5 | Debug | i386. The settings that we made for our Lua target are reflected in the output of the build e.g. gcc -O2 -Wall -g .... (the -g flag that we specified in the settings).
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775925" title="View 'Executing Lua in the command line' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3411/3281775925_52caa58b17.jpg" alt="Executing Lua in the command line" border="0" width="" height="" /></div></a>
<p>
Now that the project builds, we can proceed to debug it (or rather we just want to step through its execution in the debugger to find out how it works). The image above shows how we would run that executable (notice that we are passing some arguments to it). We want mimic this and run the program in the debugger.</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775649" title="View 'Create a new executable that you can launch from Xcode' on Flickr.com"><div style="text-align:center;"><img src="http://farm4.static.flickr.com/3568/3281775649_5c9532ee50.jpg" alt="Create a new executable that you can launch from Xcode" border="0" width="500" height="375" /></div></a>
<p>
So we create a new Custom Executable. We call it Lua.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775899" title="View 'Parameters for Lua custom executable' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3659/3281775899_4a60fdbe58.jpg" alt="Parameters for Lua custom executable" border="0" width="" height="" /></div></a>
<p>
In the dialog that pops-up, remember to specify the location of the lua executable (you will only have it after you have built the project).
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775869" title="View 'Don't load symbols lazily' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3501/3281775869_58ff456e07.jpg" alt="Don't load symbols lazily" border="0" width="" height="" /></div></a>
<p>
Before we can debug the lua executable, there is one more setting that we have to perform: change the way debugging symbols are loaded. So, open up the preferences for Xcode, and switch to the debugging tab. Ensure that the "Load symbols lazily" is <strong>unchecked</strong>.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3281775609" title="View 'Build and Debug your program' on Flickr.com"><div style="text-align:center;"><img src="http://farm4.static.flickr.com/3373/3281775609_29b58f2147.jpg" alt="Build and Debug your program" border="0" width="500" height="375" /></div></a>
<p>
Now we need to set a breakpoint. Notice in the image above that I have set one on line 378 in the lua.c (Xcode/lua-5.1.4/src/lua.c) file. After that we can invoke the debugger from the Build > Build and Debug menu.
</p>
<a href="http://www.flickr.com/photos/37092324@N00/3282597014" title="View 'Debugger in action' on Flickr.com"><div style="text-align:center;"><img src="http://static.flickr.com/3662/3282597014_dbb8e2e57d.jpg" alt="Debugger in action" border="0" width="" height="" /></div></a>
<p>
And finally we have our debugger in action.
</p>
<p>
The steps above are applicable for any other external project that you need to work on (sans the modifications to the Makefiles since that is Lua-specific).
</p>
Online Gradebooks - Something Worth Hating2008-12-19T00:00:00+00:00http://vazexqi.github.com/2008/12/19/online-gradebooks-something-worth-hating<p><a href="http://www.its2.uidaho.edu/blackboard/help_docs/Instructor/gradebook/reorder.htm">Instructor Help: Reorder Grade Book Columns</a>:
</p>
<blockquote cite="http://www.its2.uidaho.edu/blackboard/help_docs/Instructor/gradebook/reorder.htm" title="Instructor Help: Reorder Grade Book Columns"> "The following tutorial shows how to reorder and hide/show columns in the Grade Book. Each Grade Book view tab (Grades, Members, View All, Custom View, SCORM Grades) has its own independent display order. The order for a specific view tab can be changed by pressing the Reorder Columns button when viewing that tab. If you wish all of the views to display in the same order, use the Reorder Columns button for each view."
</blockquote>
<a href="http://www.its2.uidaho.edu/blackboard/help_docs/Instructor/gradebook/images/reorder_02.gif">
<div style="text-align:center;">
<img src="http://www.its2.uidaho.edu/blackboard/help_docs/Instructor/gradebook/images/reorder_02.gif" width="326" align="center">
</div></a>
<p>
The University of Illinois uses the same grading system that the University of Idaho does. And it is fortunate too since I was having a hard time trying to figure out who to reorder some of the columns. It is so hard that I actually need to search for instructions on how to do it from the internet. It is always a bad sign when something as simple as reordering some columns requires the user to read a manual.
</p>
<p>
I had optimistically assumed that in this modern age of AJAX that a mundane task like reordering columns was basically <strong>solved</strong>. I was proven wrong.
</p>
<p>
Before you read more, it might be best to read the instructions above first to see how unintuitive the UI is for the <a href="http://www.blackboard.com/products/academic_suite/learning_system/index">Blackboard Learning System</a> really is.
</p>
<p>
Compare this to how a simple (and useful app) like Basecamp does it:
</p>
<p><a href="http://www.basecamphq.com/help/todos/#reorder_items_lists">Basecamp help: To-do lists</a>:
</p>
<blockquote cite="http://www.basecamphq.com/help/todos/#reorder_items_lists" title="Basecamp help: To-do lists"> "To the left of each title, you'll see the reorder icon (it looks like four arrows). Click the icon and drag the list up or down to the location you want."
</blockquote>
<p>
Simple: drag-and-drop.
</p>
<p>
And to make matters even worse, the entire Blackboard system is written in Java, takes a <strong>long</strong> time to load and does not even take advantage of all that Java has to offer. I am sure someone can come up with a better UI in Java. How hard can it be to support drag-and-drop in Java?
</p>
<p>
No one (student or instructor) that I have talked to likes using this online gradebook. So it really makes me wonder, is this the best that software developers can do for online gradebooks? Or is it this bad just because there aren't enough competitors in this field?
</p>
Who The Hell is Bob Costas?2008-08-08T00:00:00+00:00http://vazexqi.github.com/2008/08/08/who-the-hell-is-bob-costas<p>
At the recommendation of my mom back home, I decided to watch the opening ceremony of the 2008 Summer Olympics. Disappointingly, I did not have right cable package so I could not watch it live with them.
</p>
<p>
Instead, I had to wait until 7:30 pm (it was happening live at around 7:00 am local time in Beijing) to watch the delayed telecast on NBC. I was actually looking forward to it based on what I had heard and read from the Internet earlier today.
</p>
<p>
The telecast started off well with the spectacular performances in the <a href="http://en.wikipedia.org/wiki/Beijing_National_Stadium">Bird's Nest</a> stadium. I was really impressed by what the Chinese had put on. By this point, the commentator had already begun to annoy me a bit with his weird, uncalled-for and out-of-place comments. But there was nothing really bad about his comments yet.
</p>
<p>
Then the time came for all the contingents to come marching in. And here is where Mr. Bob Costas started making all sorts of weird comments. I cannot remember all of them, so I have to paraphrase it.
</p>
<blockquote>
"Of the xxx number of countries participating here, most of them will not receive a medal".
</blockquote>
<blockquote>
"Malaysians are rather particular about people knowing where their country is. They get upset when people don't. So let's see where the country is...."
</blockquote>
<blockquote>
"The president of xxx promised that the athlete who brings home a medal will be awarded a dream house... looks like he has nothing to worry about since there probably wouldn't be one."
</blockquote>
<blockquote>
"This nation's flag bearer was chosen through a series of text messages. She had 73% of the votes. I bet she was sitting there texting in her name all day..."
</blockquote>
<blockquote>
"And here are the xxx who have won more medals at the Math Olympiad..."
</blockquote>
... And many others that I can't remember. I am sure someone else will blog about this soon.
<p>
I don't think I am overly sensitive to his comments. I can definitely take a joke or too, but the inanity of his comments just puts me in an unhappy mood.
</p>
<p>
It seems that this is not the first time he has done something like this. His <a href="http://en.wikipedia.org/wiki/Bob_Costas">wikipedia entry</a> tells of his past faux pass (if one can still call them that; they seem more like <em>verbal crimes</em>):
</p>
<blockquote cite="http://en.wikipedia.org/wiki/Bob_Costas#Olympics" title="Bob Costas - Wikipedia, the free encyclopedia"> "During the 1992 Barcelona and 1996 Atlanta Opening Ceremonies, Costas' remarks on the China Team's possible drug use caused an uproar among the American Chinese and International communities. Thousands of dollars were raised to purchase ads in the Washington Post and Sunday New York Times, featuring an image of the head of a statue of Apollo and read: 'Costas Poisoned Olympic Spirit, Public Protests NBC'."
</blockquote>
<p>
I will be looking forward to the closing ceremony but hopefully not with Bob Costas. I am also rather surprised with NBC's decision to put Bob Costas as one of the commentators given his less-than-impressive history with making such blunders.
</p>
A Pattern Language for Screencasting2008-06-02T00:00:00+00:00http://vazexqi.github.com/2008/06/02/a-pattern-language-for-screencasting<p>
<a href="http://blog.vazexqi.com/articles/2007/09/30/on-screencasts">About 9 months ago</a>, I said that I will be looking into collecting different patterns for screencasting. So finally....
</p>
<p>
I just finished writing a pattern language for screencasting based on my experiences producing and observing various screencasts on the internet. Through my experiences I have noticed various patterns that myself and other screencasters have used. Applying those patterns would certainly help the presentation of your screencast but, more importantly, I believe that the patterns enhance the teaching-learning experience of screencasts. And ultimately that is what matters most.
</p>
<p>
Interested readers may view the patterns <a href="http://softwareengineering.vazexqi.com/files/screencast_patterns.html">here</a>. The pictures that I have included are based on software for the Mac since that is what I use for my screencasting.
</p>
<p>
At the moment, it's a rather complete version of what I had originally envisioned for such a document. It can definitely be improved but I would like to get a version out on the web for people to read in case anyone is interested in providing feedback or suggestions.
</p>
<p>
I do maintain copyright on the document in case I ever decide to publish it at some pattern conference.
</p>
Drag and Drop on Mail Dock Icon2008-05-30T00:00:00+00:00http://vazexqi.github.com/2008/05/30/drag-and-drop-on-mail-dock-icon<p><a href="http://www.quotegarden.com/programming.html">Programming Quotes, Sayings about Programmers, Software Developers, Application Development</a>:
</p>
<blockquote cite="http://www.quotegarden.com/programming.html" title="Programming Quotes, Sayings about Programmers, Software Developers, Application Development"> "The only way for errors to occur in a program is by being put there by the author. No other mechanisms are known. Programs can't acquire bugs by sitting around with other buggy programs. ~Harlan Mills"
</blockquote>
<p>
The last time I updated to OS X 10.5.2, some developer inserted this extremely annoying bug into Mail-- dragging any file onto its dock icon would crash it!
This is particularly annoying because I already had it wired onto my reflexes to perform a drag and drop every time I want to send an attachment to someone.
</p>
<p>
Eventually I was able to find the <a href="http://discussions.apple.com/message.jspa?messageID=6903761#6903761"><em>solution</em></a>: change Mail's composing preference to RTF instead of plain text. Well that isn't really a <em>solution</em> since that means that I will have to compose all my e-mails as RTF which is something that I don't agree on. <strong>E-mail messages should be plain text whenever possible!</strong> RTF might be better than HTML but it is still egregious compared to plain text.
</p>
<p>
Anyway, I found an alternative solution. Instead of dragging the file to the dock icon, create a new empty message first and then drag the file onto the body of the message. This involves the extra step of creating a new empty message but at least it does not crash Mail nor force me to use RTF. Being able to drag the attachment into the mail message body without crashing it (even with the plain text setting) just illustrates that this is a bug that could have been avoided/fixed since there is nothing inherently wrong underneath with Mail. Instead it's probably just the drag and drop component that needs some reworking.
</p>
<p>
Yesterday I upgraded to OS X 10.5.3 because I wanted to install the latest iPhone Beta SDK. The README specifically said that OS X 10.5.3 is required.
</p>
<p>
And I was rather disappointed (but not really surprised) to discover that this Mail bug <a href="http://discussions.apple.com/message.jspa?messageID=7139032#7139032">has <strong>not</strong> been fixed</a> yet. Fortunately I could use the alternative solution which will suffice until this bug gets fixed (if ever). I'd rather have less features (for instance remove the useless Stationary/Template feature from Mail) than to have a program crashed on the most rudimentary of tasks.
</p>
Antony Blakey's Efforts on VisualWorks2008-05-30T00:00:00+00:00http://vazexqi.github.com/2008/05/30/antony-blakeys-efforts-on-visualworks<p><a href="http://www.cincomsmalltalk.com/userblogs/antony/blogView?showComments=true&printTitle=The_end_of_LLVM/WebKit_VW_integration_and_layout_improvements.&entry=3389549973">The end of LLVM/WebKit VW integration and layout improvements.</a>:
</p>
<blockquote cite="http://www.cincomsmalltalk.com/userblogs/antony/blogView?showComments=true&printTitle=The_end_of_LLVM/WebKit_VW_integration_and_layout_improvements.&entry=3389549973" title="The end of LLVM/WebKit VW integration and layout improvements."> "Over the last 18 months or so I've put a lot of work into enhancing VisualWorks with WebKit integration, GCCXML, and later LLVM integration, as well as improving the GUI layout system. I've stopped development on these projects, primarily because there seems to be no external interest in these projects."
</blockquote>
<p>
I am really sad that Antony Blakey is going to stop work on the GUI layout improvements for VisualWorks. His work actually made the VisualWorks UI <em>pleasant</em> and usable. Here's a screenshot to illustrate what I mean.
</p>
<div><a href="http://www.flickr.com/photos/37092324@N00/2536550223" title="View 'VisualWorks 7.6 on Mac' on Flickr.com"><img src="http://static.flickr.com/2004/2536550223_9bff204d6f.jpg" alt="VisualWorks 7.6 on Mac" border="0" width="" height="" /></a>
<br />
<small>On the left is the version enhanced with Antony's packages. And on the right is the original UI look of VisualWorks for the Mac. Notice how the tabs, find menu bar and the fonts look so out-of-place for the version on the right. And notice how they look more <em>native</em> for the version on the left. If you just glanced at this you might not find them to be much different but if you had to use the layout everyday, which would you actually prefer?</small>
</div>
<br />
<p>
I am glad that he has pushed his GUI layout work onto the Cincom public repository so we could actually look at it and modify them as necessary. A cursory glance reviews that all of the code is written in Smalltalk without the need for calling C code. So there is the possibility that I can actually decipher the code and make changes if necessary. I am not an expert on VisualWorks so this might still prove to be rather challenging.
</p>
<p>
On the other hand, while I am definitely impressed by his work on LLVM/WebKit integration, I am not sure if I have the right level of knowledge to hop on board and contribute. I definitely would like to and perhaps after a year of using VisualWorks I would be able to. But right now, I wouldn't be of much help. Moreover, if I read his blog entries on these subjects correctly, the LLVM/WebKit integration involves diving into the VM source code and actually changing the internals of the system. I think it even requires a custom version of the VM. Also, he hasn't pushed all of his work on LLVM/WebKit integration onto the store (he has an interesting <a href="http://www.cincomsmalltalk.com/userblogs/antony/blogView?showComments=true&printTitle=Store_is_the_boat_anchor_that_will_sink_VisualWorks&entry=3389572049">article</a> on why the Cincom public store is not really suitable for collaborative development)
</p>
<p>
Most people might argue that the VisualWorks UI is actually much better than the one for Squeak with all its colorful windows and non-standard layout. But here's a quote that exemplifies what UI design (taken literally as a quote like I would from Shakespeare with none of all the mumbo jumbo of religion):
</p>
<blockquote cite="http://www.biblegateway.com/passage/?search=rev%203:16&version=31;" title="BibleGateway.com - Passage Lookup: Rev 3:16"> "So, because you are lukewarm – neither hot nor cold – I am about to spit you out of my mouth. – Revelation 3:16"
</blockquote>
<p>
So the Squeak UI isn't all that bad. It's different enough that your mind just accepts it as being different. On the other hand, the standard VisualWorks UI for OS X tries to blend in but does it in a way that is just <em>lukewarm</em>... This isn't to say that the Squeak UI or the VisualWorks UI can't be improved on....
</p>
<p>
In short, I am really impressed by Antony Blakey's efforts. He definitely has some radical ideas for improving (<em>modernizing?</em>) Smalltalk, hence, the title of his blog: "The creation of a new order of things". I will definitely continue to monitor his future work on Smalltalk.
</p>
(Finally) Some Good Use for the Camera Phone2008-04-05T00:00:00+00:00http://vazexqi.github.com/2008/04/05/finally-some-good-use-for-the-camera-phone<p>
<a href="http://www.flickr.com/photos/37092324@N00/2391181360" title="View 'Evernote' on Flickr.com"><img src="http://static.flickr.com/2336/2391181360_943d577d87.jpg" alt="Evernote" border="0" width="" height="" /></a>
</p>
<p>
I've been reading some mentions/reviews of <a href="http://www.evernote.com/">Evernote</a> on various sites so I decided to try it out for myself. Right now, the latest beta version is by-invitation only. I tried my luck at their <a href="http://www.evernote.com/about/prereg/">invitation-only beta registration</a> and was lucky enough to get an invite the next day. Since then I have sent out 5 (of the 10 invites) to my friends.
</p>
<p>
The coolest feature of Evernote is its ability to recognize text within images (see this <a href="http://www.youtube.com/watch?v=i_ncr1Ee9e8">demo video</a>). The ability to recognize text in images is not something new but this is the first time I have seen it offered in a consumer application. Because of this, I finally found a good use for the built-in camera of my iPhone.
</p>
<p>
Text recognition is not built-in to the application itself. Instead anything that you store in Evernote is synchronized with the Evernote's servers (this allows you access your notes from the web). The text detection/processing is done at the servers and the metadata is sent back to your application. That means that unless you sync with the servers, you can't actually get text recognition. I think this is a good idea since it lets Evernote change its recognition algorithm without bothering the user with some software update.
</p>
<p>
So how good is the text recognition? I decided to do some experiments and come up with the following observations. These are merely observations so they are not rigorously tested. Also, expect the recognition capabilities to increase over time.
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2390454511" title="View 'Old Intel Logo' on Flickr.com"><img src="http://farm3.static.flickr.com/2193/2390454511_bb74aa0ac1.jpg" alt="Old Intel Logo" border="0" width="326" height="500" /></a>
<br />
<small>It recognizes some non-standard letters like Intel's old logo on this mouse pad.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2391286636" title="View 'Vertical Intel Logo' on Flickr.com"><img src="http://farm3.static.flickr.com/2024/2391286636_4d263f864b.jpg" alt="Vertical Intel Logo" border="0" width="327" height="500" /></a>
<br />
<small>It does not recognize vertical text well.</small>
<br />
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2390454529" title="View 'Is there an 'i' there?' on Flickr.com"><img src="http://farm3.static.flickr.com/2295/2390454529_4e39d2b55a.jpg" alt="Is there an 'i' there?" border="0" width="327" height="500" /></a>
<br />
<small>In fact, for vertical text, its recognition seems to be pretty off; recognizing things that are not there.</small>
<br />
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2391297940" title="View 'DTrace Event Poster in Evernote' on Flickr.com"><img src="http://farm3.static.flickr.com/2161/2391297940_505fd63d69.jpg" alt="DTrace Event Poster in Evernote" border="0" width="326" height="500" /></a>
<br />
<small>It probably only recognizes words in the English dictionary since it can't recognize "DTrace".</small>
<br />
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2390465813" title="View 'DTrace Event Poster in Evernote' on Flickr.com"><img src="http://farm3.static.flickr.com/2275/2390465813_9b1ac67ce5.jpg" alt="DTrace Event Poster in Evernote" border="0" width="327" height="500" /></a>
<br />
<small>It recognizes most words but might have some trouble pinpointing their exact location.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2391298048" title="View 'Symbol recognition in Evernote' on Flickr.com"><img src="http://farm4.static.flickr.com/3030/2391298048_c9ff6146d9.jpg" alt="Symbol recognition in Evernote" border="0" width="500" height="428" /></a>
<br />
<small>I don't think it recognizes symbols well; it's probably optimized for numbers and letters.</small>
<br />
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2391297974" title="View 'Multicolored Word in Evernote' on Flickr.com"><img src="http://farm3.static.flickr.com/2181/2391297974_9060587545.jpg" alt="Multicolored Word in Evernote" border="0" width="500" height="426" /></a>
<br />
<small>It seems to have trouble with multi-colored words like the Google logo.</small>
<br />
</p>
<p>
So for better results, the text should be horizontally written, unicolored and contain only alphabets and numbers. But it works pretty well for most cases. It certainly beats having to enter information by hand.
</p>
<p>
So, will I continue using Evernote after its beta period? I am expecting that it will require a paid subscription for the ability to sync and recognize text within images but if the price is reasonable, I might continue using it. Moreover, if they decide to create a native iPhone app (an offer it for free for paid subscribers), the likelihood of using it is even higher for me. After all, there isn't a convenient way to sync notes between my iPhone and my computer. I'll definitely keep <a href="http://www.barebones.com/products/yojimbo/">Yojimbo</a> around though since it handles PDF and has some nice predefined containers for storing image, serial numbers, etc.
</p>
External Monitor Setup2008-03-21T00:00:00+00:00http://vazexqi.github.com/2008/03/21/external-monitor-setup<p>
After spending about a year with two huge and bulky CRT's in my office, I decided to spend about $700 to get a new 24 inch widescreen display from DELL. It wasn't only the physical size of the CRT but also its blurriness that annoyed me. Here's a picture to show what my desk looked like before:
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2349752093" title="View 'Old Setup' on Flickr.com"><img src="http://farm3.static.flickr.com/2358/2349752093_965e1cf647.jpg" alt="Old Setup" border="0" width="500" height="375" /></a>
<br />
<small>Both CRTs are <a href="http://support.dell.com/support/edocs/monitors/M993s/en/index.htm">Dell M993s</a>. Surprisingly those monitors could display 1600x1200 pixels! However, that comes at the expense of blurriness and eye-ache after a couple of hours.</small>
</p>
<p>
Here's a picture to show what my desk looks like with the new monitor:
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2349752139" title="View 'New Setup' on Flickr.com"><img src="http://farm4.static.flickr.com/3170/2349752139_cf74b09b44.jpg" alt="New Setup" border="0" width="500" height="375" /></a>
<br />
<small>The Dell 2408WFP monitor connects to my MacBook Pro. The other smaller monitor connects to my Windows machine. I share the mouse and keyboard using <a href="http://synergy2.sourceforge.net/">Synergy</a>.
<br />
The smaller monitor is <i>borrowed</i> from my colleague's table since he won't be around until Fall 2008.
</small>
</p>
<p>
Using a large monitor is not without its challenges and problems. The main problem on the Mac (and possibly Windows and Linux) is that it becomes rather troublesome to resize the windows. Here's why: all windows manager that I know have three buttons on each window: close, maximize(expand) and minimize. On a small monitor, clicking the maximize button expands the window to fill your small screen -- usually a desired behavior so you can see more of the contents in the window. On a large monitor, clicking the maximize button, expands the window to fill your <em>large</em> screen -- usually an undesired behavior since you are wasting screen space.
</p>
<p>
Unfortunately, I have not found a nice way to resize the windows yet. I do have a trick though. Since my external display is powered by a MacBook Pro, I can always move the window over to the MacBook Pro's smaller screen, maximize it and then move it back to the external display! It's cumbersome but it works. And I get uniformly sized windows -- I am rather particular about having my windows be about the same size.
</p>
<p>
Fortunately things are better with my browser since I can just rely on javascript bookmarklets:
</p>
<p><a href="http://pimpmysafari.com/bookmarklets/">Pimp My Safari: bookmarklets</a>:
</p>
<blockquote cite="http://pimpmysafari.com/bookmarklets/" title="Pimp My Safari: bookmarklets"> "Resize to 1024x768"
<br />
<code>
javascript:void(window.resizeTo(1024,768))
</code>
</blockquote>
Updated to Typo52008-03-20T00:00:00+00:00http://vazexqi.github.com/2008/03/20/updated-to-typo5<p>
So I <em>discovered</em> that my web host just upgraded to Rails 2. How did I make the discovery? Well, both my blogs were <strong>malfunctioning</strong>. And when a rails web application malfunctions, it is usually a good idea to check if they had upgraded it. Previous experience with Typo should have taught me that but sometimes I forget such things.
</p>
<p>
I should definitely <a href="http://support.tigertech.net/freeze-rails">freeze</a> the rails version right now so that I don't encounter such problems in the future.
</p>
<p>
Anyway, I grabbed the latest version of <a href="http://typosphere.org/">Typo</a> and installed it. I must say the latest version really looks <a href="http://typosphere.org/articles/2007/08/26/screenshots">slick</a>. I chose to use the same Scribbish theme for this blog but there are two new themes that are pretty nice too.
</p>
<p>
One caveat is that some of the plug-ins have been removed from the base Typo installation. This caused me some problems as I migrated my blog over. I could have just installed the old plug-ins following the instructions from <a href="http://typosphere.org/articles/2007/08/26/typo-plugins-directory">here</a> but I decided to stay fresh. I am not sure whether there is an easier way to do this, but I basically went into the database and remove the sidebars table:
<br />
<code>DELETE from sidebars;</code>
</p>
<p>
I am going to upgrade the <a href="http://softwareengineering.vazexqi.com">softwareengineering.vazexqi.com</a> blog in the next few hours so it should be back up by tonight.
</p>
vazexqi.com updated2008-03-16T00:00:00+00:00http://vazexqi.github.com/2008/03/16/vazexqi-com-updated<div style="text-align:center;"><a href="http://www.flickr.com/photos/37092324@N00/2339083089" title="View 'vazexqi.com updated!' on Flickr.com"><img src="http://farm4.static.flickr.com/3287/2339083089_4b0a0b84d8.jpg" alt="vazexqi.com updated!" border="0" width="500" height="375" /></a></div>
<p>
After delaying for a <em>very long</em> time, I have finally updated the root <a href="http://www.vazexqi.com/index.html">vazexqi.com</a> site and turned it into something that reflects more of what I am doing as a Ph.D. student. I was only compelled to do it because the CS department demanded a curriculum vitae from each of its students. I wanted to put a web address on my CV so that people can keep up with what I am doing and find. However, I did not feel that it was appropriate to put my blog address directly on it; after all, a website that starts with the word "blog" might not sound professional enough to some academic peers (it should be fine for a developer's blog though).
</p>
<p>
I was too lazy to actually write everything from scratch so I decided to give <a href="http://www.realmacsoftware.com/rapidweaver/">RapidWeaver</a> a try. I had used it before for various tasks but I am only needed to use the demo version since I would just borrow (and credit) their templates and then code everything up by hand. But this time, I decided that since vazexqi.com was going to be mostly static content, I needed a convenient way to easily update it using some application. Also, I am not really a web designer so I would like to be able to quickly change the template without having to do too much work on my part.
</p>
<p>
Overall, I think the new look is pretty decent. There are things that still need updating but overall it's a good start. There are two things now that I <strong>must</strong> remember to do: constantly update the static pages and upload a picture of myself to the front page....
</p>
<p>
I don't really subscribe to the idea of putting yourself out there on the web for everyone (like this <a href="http://www.slideshare.net/slgavin/meet-charlie-what-is-enterprise20">guy</a>) but I do think that it is important to have a clean web page where your peers can easily find you.
</p>
Thoughts on the iPhone SDK2008-03-10T00:00:00+00:00http://vazexqi.github.com/2008/03/10/thoughts-on-the-iphone-sdk<small>
As I am writing this, I am also partly listening to the <a href="http://www.apple.com/quicktime/qtv/iphoneroadmap/"><em>Apple March 6 Event</em></a> where the iPhone SDK was first introduced. And halfway through, I cannot help but notice that Scott Forstall was practically <strong>emulating</strong> Steve Jobs. He even used phrases like "... a <em>screamer</em>...", "... we made it <em>even</em> better...", "... the iPhone is <em>the most advanced</em>... ", "... years ahead of any other...". He is definitely a smart guy but I think he is emulating Steve too much. It would have been nice to see his own personality. On the other hand, this also means that I probably have watched too much of Steve Jobs to know how he talks....
</small>
<br />
<p>
So, I downloaded the free version of the <a href="http://developer.apple.com/iphone/program/">iPhone SDK</a>. It comes in at a whopping 2.1 GB so it took about 20 minutes to download.
</p>
<p>
After extracting it, the README has this to say:
<ol>
<li> It requires about 5.3 GB for installation.</li>
<li> It requires OS X 10.5.2 on <strong>intel</strong> machines (some <a href="http://www.iphoneatlas.com/2008/03/10/surprise-iphone-sdk-also-works-on-powerpc-macs/">claim</a> that it can work on powerpc as well).</li>
</ol>
</p>
<p>
There is the option to keep Xcode 3.0 and Xcode 3.1 Beta that comes with the iPhone SDK on the same machine. I did not choose this option so it replaced my original developers tools (meaning that I did not need to sacrifice extra disk space at the expense of a possibly buggy beta version Xcode 3.1).
</p>
<p>
I tried some of the sample apps from the iPhone developer site (it uses a generic URL of http://developer.apple.com/iphone/samples/index.action which checks to see if you are authenticated).
</p>
<p>
Here are the ones that I tried:
<ul>
<li>
<strong>Kalimba</strong> - Supposed to be a replica of an African thumb piano. We should be able to strike each bar and have a musical note sound. It failed miserably on the iPhone simulator -- sound will not play and the piano refused to rotate to landscape mode. See this <a href="http://discussions.apple.com/thread.jspa?threadID=1433035&tstart=15">thread</a>. Here's a picture to show what I mean:
</li>
<br />
<a href="http://www.flickr.com/photos/vazexqi/2325087451/" title="Kalimba on the iPhone Simulator by vazexqi, on Flickr"><img src="http://farm4.static.flickr.com/3176/2325087451_cd1f2de533.jpg" width="500" height="404" alt="Kalimba on the iPhone Simulator" /></a>
<br/>
<small> This is one of the examples for the iPhone SDK. Unfortunately, it does not seem to work properly on the simulator – sound doesn't work and it refuses to rotate into landscape mode. </small>
<br />
<li>
<strong>Jigsaw</strong> - Just a simple jigsaw puzzle. Works fine.
</li>
<br />
<li>
<strong>TheElements</strong> - Shows the periodic table with the possibility to view each element's page on wikipedia. When I clicked on the link to wikipedia, the simulator crashed gloriously -- no warnings, no output to console. It just crashed. <em>After some playing around, I discovered that it crashes when you run it immediately after it opens up in the emulator. Instead, if you go to the home screen and then activate TheElements application, then opening a link would work!</em>
</li>
<br />
<li>
<strong>GLGravity</strong> - Draws the canonical OpenGL teapot and allows you to rotate it by rotating and tilting your iPhone. This refused to run on the simulator -- claiming that it needs to run on an iPhone.
</li>
</ul>
</p>
<p>
I have to agree that the iPhone SDK has a lot to offer. If you don't believe me, just watch the <a href="http://www.apple.com/quicktime/qtv/iphoneroadmap">video</a>. The demo comes on at about 30 minutes through. It's akin to writing for a mini version of OS X with the addition of an impressive user interface, multi-touch control and internal accelerometers. Games will definitely benefit from this. So it should be easy for most developers to get started once they familiarize themselves with the new human interface guidelines.
</p>
<p>
<a href="http://www.flickr.com/photos/vazexqi/2325987514/" title="Spore on the iPhone by vazexqi, on Flickr"><img src="http://farm4.static.flickr.com/3023/2325987514_8fcf01ea82.jpg" width="500" height="380" alt="Spore on the iPhone" /></a>
<br />
<small>Spore on the iPhone. It uses the accelerometer on the iPhone for controls. </small>
</p>
<p>
However, as impressive as the SDK is, it also has some shortcomings which can't be ignored. Here's why (some of these might change when iPhone 2.0 debuts but I doubt it):
</p>
<ol>
<li><strong>No garbage collection.</strong>
<br />
<a href="http://developer.apple.com/iphone/gettingstarted/docs/creatingiphoneapps.action">Creating an iPhone Application</a>:
<blockquote>
Note: iPhone OS does not support memory management using the garbage collection feature that is in Mac OS X v10.5 and later.
</blockquote>
Maybe most Objective-C developers love doing manual reference counting but this seems like something that should be addressed. After all, <a href="http://code.google.com/android/">Google's Android</a> platform supports this. Moreover, Objective-C 2.0 already supports it so garbage collection could have been enabled from the beginning.
<br />
<br />
Some might argue that garbage collection adds extra performance overhead. But consider what happens when your app starts leaking memory all over the place. And with all the <a href="http://www.cs.utexas.edu/users/oops/papers.html">rich history</a> that garbage collection has, it's really amazing that companies don't really start to take it seriously.
<br />
<br />
In fact, during the video, they showcased several different developers creating fantastic prototypes for the iPhone in two weeks. I suspect that development and debugging time could have been reduced <em>more</em> if only garbage collection was enabled. =)
</li>
<br />
<li>
<strong>Crippled simulator</strong>
<br />
Not sure if this will change in the future but the current simulator is rather dumb and featureless. You cannot even trigger the hard buttons (like the volume UP/DOWN, silencer, top button). The only button you can activate is the home button -- the one at the bottom of the screen. And no, you can't simulate the features of the accelerometer.
<br/>
<br />
It does however support the two-finger gesture if you hold on the OPTION key on your keyboard.
<br />
<br />
I suspect that this is a ploy by Apple to get people to i) buy iPhones to test on b) subscribe to the $99/year developer deal to get your app on to the iPhone. After all, how are you going to test your next greatest app that relies on the accelerometer if the simulator cannot even handle it. However, of my three criticisms, this might be the easiest one to fix.
<br />
<br />
Google's Android emulator is currently better but that could be because there <em>isn't an actual phone</em> to run it on yet!
</li>
<br />
<li>
<strong>$99/year (yes, it's PER YEAR!)</strong>
<br />
<a href="http://www.apple.com/pr/library/2008/03/06iphone.html?sr=hotnews">Apple Announces iPhone 2.0 Software Beta</a>
<blockquote>
During the beta iPhone SDK program, a limited number of developers will be accepted into Apple’s new iPhone Developer Program and offered the ability to get code onto iPhones for testing. The Standard Program costs $99 (US) per year and gives members an iPhone SDK and development tools; access to pre-release iPhone software; technical support; the ability to get code onto iPhones for testing; and distribution of applications via the new App Store. The Enterprise Program costs $299 (US) per year.
</blockquote>
<br/>
To even get your app <em>for testing</em> onto the iPhone you need the special version of the SDK or a special license. This is weird since that means that I cannot even write an app for <strong>MYSELF</strong> and install it on my phone just for my own <strong>PERSONAL</strong> use.
<br />
<br />
Plus, right now no one can install your app unless you list it on iTunes (which minimally also requires the $99/year contract).
<br />
<br />
You can argue that this annual fee is not really a problem with the SDK but I think it is. After all, without paying the fee, your SDK basically allows you only to experiment and not actually get anything onto your iPhone.
<br />
<br />
I think the $99/year (or $299 for Enterprise) fee is somehow used to do code signing which I think is a weird way to guarantee that your program is non-malicious. I could be wrong.
<br />
<br />
Also, after having to pay $99 would anyone release your app for free??!! I look forward to seeing how many free apps there will be. My prediction is that apps that are somehow tied to a desktop app that costs money (for instance, Transmit, NetNewswire, etc) might be free since the cost is absorbed by the desktop app.
<br />
<br />
It would be interesting to see how it would compete with Android in terms of interested developers. I am not sure if it is a good idea to actually get developers to pay to actually use the development tools.
<br />
<br />
I do like the idea of paying the yearly fee to have Apple list your product for you on iTunes but it would be good to offer developers the choice of distributing their own applications if they want. In fact, just being able to install your <strong>own</strong> app on your <strong>own</strong> phone would be fantastic!
</li>
</ol>
<p>
So while the SDK definitely has a lot to offer, it also has some serious shortcomings that might discourage some developers. But with all things Apple, they certainly won't mind ostracizing some developers in favor of others....
</p>
Alan Kay's Talk at TED2008-03-10T00:00:00+00:00http://vazexqi.github.com/2008/03/10/alan-kays-talk-at-ted<small>
There are certain events that are just so exciting that I feel compelled to blog about them immediately after I experience it. This is one such event.
</small>
<p>
<a href="http://en.wikipedia.org/wiki/Alan_Kay">Alan Kay</a> recently gave at talk at <a href="http://www.ted.com/">TED</a>. You can view his video from <a href="http://www.ted.com/index.php/talks/view/id/228">here</a>. Like all TED talks, it's about 20 minutes long so it's short and straight to the point. The rest of my post will make references to the video, so reading it without watching the video might not make much sense.
</p>
<p>
Unsurprisingly, in the video, Kay demonstrated the canonical moving car example for <a href="http://wiki.laptop.org/go/Etoys">Etoys</a>. The moving car demo is something that most people familiar with Squeak would have seen. It's really simple but it lets kids experience programming in a fun interactive way. Unfortunately, this is something that most modern languages have failed to enable. After all, which is more fun: printing text to the screen or watching your creation actually move on screen?
</p>
<p>
However, the second part of Kay's demo was even more interesting. He shows what you can do to help illustrate some simple math and physics properties in an insightful manner. It uses all the features of Etoys (or maybe the full Squeak implementation) to let students experiment by themselves.
</p>
<p>
<a href="http://www.flickr.com/photos/vazexqi/2324602402/" title="Virtual Tape Meter by vazexqi, on Flickr"><img src="http://farm3.static.flickr.com/2187/2324602402_efbcd473c6.jpg" width="500" height="366" alt="Virtual Tape Meter" /></a>
<br />
<small>Experimenting with this would have been so much cleaner than using a tape meter. It's actually even cooler when you watch the animation or code it up yourself in Etoys.</small>
</p>
<p>
For instance (and this was something that impressed me), you could design a simple car that drop dots along as it moved. So, a car that is accelerating will be dropping dots further and further apart from one another. This is basically the same idea as using a tape meter. However, the animation of the car moving and dropping dots seem so much cleaner to me. You can easily illustrate the concept of velocity and acceleration without having to talk about friction, etc. Something that is unavoidable with a real experiment. This helps especially when you are teaching a younger audience about the basic principles of motion.
</p>
<p>
Toward the end of the talk Kay showed an example running on the <a href="http://laptop.org/">OLPC</a>. So I was curious whether all courseware on the OLPC will be interactive or whether they will be like normal textbooks only in digital format. Either way, it's already hard enough to actually get good content onto the OLPC. As far as I know, there is no group dedicated to creating content for the OLPC yet.
</p>
<p>
However, I was able to find a couple of interactive learning environments at <a href="http://wiki.laptop.org/go/OLPC_Courseware_Review">OLPC Courseware Review</a> but, from the list, it seems that <a href="http://wiki.laptop.org/go/DrGeo">Dr. Geo II</a> is the only one that has been ported to run on the OLPC. It would be interesting to see if there is a Google Summer of Code project for creating/porting an existing interactive learning environment to the OLPC.
</p>
<p>
Incidentally I was reading "A Mathematician's Lament" by Paul Lockhart which also talks about how to revamp the current K-12 mathematics education. The paper is available from <a href="http://www.maa.org/devlin/LockhartsLament.pdf">here</a>. Basically, Lockhart says that there is not enough experimentation with math going on in the class rooms. And that most of math is rote memorization with little appreciation for the <em>beauty</em> of math.
</p>
<p>
The math education back in Malaysia is not much better either. In school, the teachers are more interested in finishing the syllabus. So students either <em>get-it</em> in school or have to rely on paid tutors to teach it to them. There's very little appreciation on the derivation of the proofs of math. Either the derivation is skipped entirely while teaching or it follows the route of the boring derivation on the board that doesn't engage students.
</p>
PhD Qualifying Exam2008-03-07T00:00:00+00:00http://vazexqi.github.com/2008/03/07/ph-d-qualifying-exam<p>
So every student doing a PhD at UIUC (and I think any US university) is expected to pass a qualifying exam. The <a href="https://agora.cs.uiuc.edu/display/cs428sp08/2008/02/29/Reading+for+the+Midterm">qualifying exam</a> gauges whether a student is competent enough to continue in the PhD program. However, it's much more than that. I think it's more of a test to see how well you can do a presentation and answer tough questions during the presentation; as well as trying to not sound stupid in front of a very smart audience.
</p>
<p>
Anyway, I took my exam two weeks ago. It was an oral presentation where I was assigned two papers:
<a href="http://portal.acm.org/citation.cfm?id=1297105.1297029">The jastadd Extensible Java Compiler</a> and <a href="http://groups.csail.mit.edu/pag/pubs/test-factoring-ase2005-abstract.html">Automatic Test Factoring</a>. Both papers were about tools (something that I interested in as I mentioned in my research statement to the exam committee).
</p>
<p>
It's interesting to note how the two papers are somehow connected with me. I first saw the JastAdd system while I was at OOPSLA '07. I had even talked to the authors of the paper, attended their poster session and even their demo session. Fortunately (or unfortunately) I did not attend their presentation session so my presentation was not influenced by theirs. I was already interested in studying this paper in-depth because of the system. And having it chosen as my qualifying exam paper gave me even more motivation.
</p>
<p>
The second paper was interesting because, Danny, one of my colleagues from the same research group is now working under <a href="http://people.csail.mit.edu/mernst/research/students.html">Prof. Michael Ernst</a>. Danny had referenced some of Ernst's work before. So I was familiar with some of the terminology in the paper and was able to use that to my advantage.
</p>
<p>It's just interesting to see what a small world it is....</p>
<p>
My slides for the presentations are available here: <a href="/files/JastAdd.pdf">JastAdd.pdf</a> and <a href="/files/AutoFactoring.pdf">AutoFactoring.pdf</a>. I am not sure how interesting they would be on their own but they are <em>pretty</em> to look at.
</p>
<p>
<strong>And I just found out that I passed!</strong> The committee had this to say:
</p>
<blockquote>
"The committee were impressed with his performance and background knowledge".
</blockquote>
<p>
So that's one crucial step toward completing my Ph.D! :)
</p>
Rubber Bands2008-02-29T00:00:00+00:00http://vazexqi.github.com/2008/02/29/rubber-bands<p>
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/moBRQ2E5QE0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/moBRQ2E5QE0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
<p>
<p>
My girlfriend and I decided to join the <a href="http://eweek.stanford.edu/2008/">Innovation Tournament Video Contest</a>. The video above is our submission. It could definitely be improved. However, considering the fact that we are only a two-person team and that the weather here is less than conducive, I think we did OK. Overall, it was an interesting experience -- something that I normally would not have done.
</p>
<p>
<strong>Update</strong>: Well, turns out that we won! We get to have breakfast with <a href="http://en.wikipedia.org/wiki/Henry_Petroski">Henry Petroski</a>, an author whose books I enjoy <strong>and</strong> a visit to <a href="http://www.ideo.com/ideo.asp">IDEO</a>. I wasn't aware of this before but turns out that Henry Petroski did his Ph.D from UIUC! My advisor, Ralph Johnson and my colleague, Maurice are both fans of his writing. It is great to be able to meet Mr. Petroski in-person!
</p>
<p>
The prizes were sort of interesting because there were slightly more prizes than participants. So this means that a) everyone who participated was really a prize-winner and b) each team got to choose more than one prize. Some prizes, like the opportunity to attend breakfast with Mr. Petroski, were not limited or exclusive so multiple teams could choose the same prize.
</p>
Session restore (sort of) in Eclipse with Mylyn2008-02-02T00:00:00+00:00http://vazexqi.github.com/2008/02/02/session-restore-sort-of-in-eclipse-with-mylyn<p>
<small>This was something that I really wanted to blog about for a long time...</small>
</p>
<p>
Last year I wanted to know a way to save <em>sessions</em> in Eclipse like I could for Firefox. For instance, Firefox allows you to save the open tabs and windows into a new session and restore that session in the future. That way if you ever need to recall a set of tabs for reference, they can be easily activated by restoring the saved session.
</p>
<p>
In fact, any decent, editor or IDE should the option to save sessions. Heck, <a href="http://www.vim.org/tips/tip.php?tip_id=1037">Vim</a> and <a href="http://www.phys.ufl.edu/docs/emacs/emacs_423.html">Emacs</a> have this feature out-of-the-box. Sessions are really useful when you have to work on groups of related files at the same time but don't want to have to remember which they are.
</p>
<p>
So why was there apparently no way to do this in Eclipse? Initially, I thought that <a href="http://wbeaton.blogspot.com/2005/11/leanin-on-working-sets.html">Working Sets</a> might be the solution. However, they only allowed you to <strong>group</strong> files into sets. They don't actually remember the editors that are opened and what state you were in. So Working Sets were not even a poor man's implementation of sessions.
</p>
<p>
Then epiphany struck! We could use the <a href="http://www.eclipse.org/mylyn/">Mylyn</a> plug-in to accomplish this. In fact, as you shall see, Mylyn can do even better than just saving sessions - it infers them automatically based on what you are doing! Mylyn comes installed standard now on Eclipse 3.3 and higher. In fact, the Mylyn view is even shown by default; it's not activated though.
</p>
<p>
Anyone who does not use sessions has a) an incredible memory, b) an inhumane ability to do context switching between tasks AND c) the luxury of not having to close his IDE ever. <strong>Or</strong> the developer just doesn't know that such an excellent tool exists out there...
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2237337520" title="View 'The Mylyn View' on Flickr.com"><img src="http://farm3.static.flickr.com/2200/2237337520_8904796f46.jpg" alt="The Mylyn View" border="0" width="500" height="377" /></a>
<br />
<strong>This is Mylyn</strong>
<br />
<small>I have readjusted my perspective a bit so that everything can fit nicely in a 800x600 window. The picture above shows the Mylyn view with some sample local tasks.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2236546165" title="View 'Activate a previous context' on Flickr.com"><img src="http://farm3.static.flickr.com/2001/2236546165_8f5ef58a29.jpg" alt="Activate a previous context" border="0" width="500" height="377" /></a>
<br />
<strong>Activating a previous session</strong>
<br />
<small>I am activating a previous session. By default, Mylyn automatically remembers the last context that you were in before closing the editor and will restore that.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2237337558" title="View 'The editors from a previous context are restored' on Flickr.com"><img src="http://farm3.static.flickr.com/2395/2237337558_23cfccea58.jpg" alt="The editors from a previous context are restored" border="0" width="500" height="377" /></a>
<br />
<strong>Previous session restored</strong>
<br />
<small>You can see that Mylyn remembers the files that were opened in that session and has restored them in the editors. The current active task (see the Task List view) has a blue bullet next to it. In the Package Explorer view, you can even see the other files that I might have referred to in a previous session but did not open in any editor.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2236546213" title="View 'Creating a new local task' on Flickr.com"><img src="http://farm3.static.flickr.com/2259/2236546213_7e8d634ab3.jpg" alt="Creating a new local task" border="0" width="500" height="377" /></a>
<br />
<strong>Creating a new local task (context)</strong>
<br />
<small>Mylyn allows you to create local task for your own use. With the proper server, you can also create sharable tasks in a Bugzilla or JIRA repository. That way, you can share the same session with yourself when you are <strong>working on a different machine</strong> or <strong>with your other teammates</strong> so that they can take a look at the same things that you are looking at.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2237337616" title="View 'Editing a local task' on Flickr.com"><img src="http://farm3.static.flickr.com/2278/2237337616_bbd0aa050d.jpg" alt="Editing a local task" border="0" width="500" height="377" /></a>
<br />
<strong>Editing a local task (context)</strong>
<br />
<small>You can easily associate other metadata with each task. In fact, Mylyn was originally created to be a task-oriented system. It allows you to split your work into little tasks to help you focus.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2236546269" title="View 'Reveal all files or focus on active task' on Flickr.com"><img src="http://farm3.static.flickr.com/2264/2236546269_f67d511b41.jpg" alt="Reveal all files or focus on active task" border="0" width="500" height="377" /></a>
<br />
<strong>Deciding to show everything or just the active task</strong>
<br />
<small>You can easily switch between showing <em>all</em> the files in the Package Explorer or focusing on the active task by clicking on the Mylyn button.</small>
</p>
<p>
Mylyn has a <strong>whole</strong> bunch of other features. Some of the interesting ones include:
<ul>
<li>
The ability to share a context with different tasks. You can clone the current context and <em>paste</em> it into a different task.
</li>
<li>
It cleverly <em>remembers</em> what editors and files that you have accessed and stores those into its session.
</li>
<li>
It intelligently <em>forgets</em> editors and files that you have not looked at for extended periods.
</li>
<li>
You are always in control - you can override the behavior easily and promote/demote certain files from sessions.
</li>
<li>
It records how long you spent on each task so that you can actually report that figure with certainty.
</li>
<li>
It's well integrated with different perspective and views in Eclipse. And it is constantly being improved upon.
</li>
</ul>
</p>
<p>
Mylyn is great for helping you focus on your programming tasks. It stays out of your way for the most part but is easily accessible when you need it. Once you start using it, you really wished that every IDE out there (including the venerable IntelliJ) supported it.
</p>
Why tools can make it a pleasure to learn a new framework2008-01-15T00:00:00+00:00http://vazexqi.github.com/2008/01/15/why-tools-can-make-it-a-pleasure-to-learn-a-new-framework<p>
I was reading the book <a href="http://www.manning.com/walls3/"><em>Spring In Action</em></a> in my attempt to learn about Spring. More importantly, I needed to know enough to be able to incorporate refactoring support for it as part of my project.
</p>
<p>
Unfortunately, the book had some typos which were actually technical errors. And this was just in Chapter 1! If you are trying to learn something for the first time and there are typos, you might not be able to detect it. And this can lead to hours of frustration....
</p>
<p>
Fortunately, IntelliJ has support Spring. And it detects the errors for you! So even if the technical reviewers did not detect the error, at least your IDE (a good one) can do it for you and save you time.
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2194909419" title="View 'Error detection' on Flickr.com"><img src="http://farm3.static.flickr.com/2123/2194909419_8460951860.jpg" alt="Error detection" border="0" width="500" height="139" /></a>
<br />
<small>IntelliJ 7 has support for Spring. In this case, it detected that something was wrong with the xml configuration file.</small>
</p>
<p>
<a href="http://www.flickr.com/photos/37092324@N00/2194909447" title="View 'Error correction' on Flickr.com"><img src="http://farm3.static.flickr.com/2322/2194909447_ff7f3207c4.jpg" alt="Error correction" border="0" width="412" height="179" /></a>
<br />
<small>It even offers the ability to correct the error!</small>
</p>
<p>
I wonder if the error in the book could have been detected had the reviewers use a better tool. Or at least attempt to run it using some automated tool.
</p>
Leave No Stone Unturned2008-01-07T00:00:00+00:00http://vazexqi.github.com/2008/01/07/leave-no-stone-unturned<p>
<img src="http://ecx.images-amazon.com/images/I/41w37VxTFXL._SS500_.jpg" width="200" height="200" />
<img src="http://ecx.images-amazon.com/images/I/410UkKG0LcL._SS500_.jpg" width="200" height="200" />
</p>
<p>
I spent the previous week reading two very interesting - and some might say controversial - books. The titles of the books speak for themselves. However, that is not the main reason for this post. Instead, this post is about what I think is an important point of both books; something that might be hidden underneath both the hype and criticism surrounding the books.
</p>
<p>
Both books advocate the need to question <em>everything</em> -- even religion. Religion has always been considered a taboo subject and its veracity has always been taken for granted. More often than not, religions rely on a divine book that has been perpetuated by a deity as the source of truth. And this source of truth, according to its followers, shall not be questioned. This is <strong>faith</strong>.
</p>
<p>
And that is where a potential <em>problem</em> lies. While I am certain that both authors have tried their best to verify what they have written, they are not ashamed or adamant about making corrections to their books when the evidence shows otherwise. With sufficient evidence, both authors might even be converted toward religion. I doubt the same could be said about religious texts. Religious texts might have been perpetuated by a divine deity, but they are still transcribed by human beings.
</p>
<p>
Now, it might very well be that religious texts are indeed infallible. However, without testing, without questioning, we can never be sure. At least, we cannot be sure without just relying on blind faith alone. To put this into perspective, most people are not going to sit in a plane after being told that it is powered through <em>sheer faith-power alone</em>.
</p>
<p>
If anyone doubts the need to question, just look around us. All modern inventions come about through some form of questioning. If we just accepted everything as being <em>magical</em> then we would never have many of the inventions that we take for granted today. The scientific theories that we have today might not be complete but they sure do a fine job of making our lives better. And those theories are continuously being subjected to testing and questioning to refine them: obsolete ones are <em>rejected</em>, <em>replaced</em> or even <em>removed</em>.
</p>
<p>
Religion might be true; it might be false. Religion might be necessary; it might be unnecessary. But like everything else, it should be investigated and questioned. And every individual should be free to draw his or her own conclusion based on the evidence and <strong>not</strong> just on the words of <em>influential</em> figures. It goes the other way around too. Just because the authors of both books claim something, it does not mean that it is true. Again, the facts and evidence must be evaluated.
</p>
<p>
For many religious devotees the veracity of religion is not necessarily an issue. And that is fine. However, for some other people, the quest for verifying the truth is important. They should be granted the freedom to question such things and make their own decision without any backlash from members of religious communities. Both books present examples of reactions from religious communities on this issue of <em>seeking</em> the truth. Some reactions being more harmful than others.
</p>
<p>
And what happens when the truth is discovered? Probably nothing much. People are still free to choose whether or not to believe in religion. Neither author strongly suggest the need for getting rid of religion. What they do is merely present their ideas and the evidence to support it. But they never force anyone to abandon their beliefs.
</p>
Zen and the Art of (Pair) Programming2007-12-23T00:00:00+00:00http://vazexqi.github.com/2007/12/23/zen-and-the-art-of-pair-programming<p>
<img src="http://ecx.images-amazon.com/images/I/4179B1HMKFL._SS500_.jpg" width="250" height="250"/>
<br />
<small>Since this book is so <em>general</em>, it can be interpreted in many different ways. I choose to interpret some of the advice it offers in terms of programming.</small>
</p>
<p>
Programming is an intellectual activity. It takes <em>sufficient</em> intellect, <em>great</em> concentration and <em>lots of</em> patience. And there are some things that can easily sap a programmer's concentration and patience. Robert Pirsig, author of <a href="http://en.wikipedia.org/wiki/Zen_and_the_Art_of_Motorcycle_Maintenance"><em>Zen and the Art of Motorcycle Maintenance</em></a> uses the term <em>gumption</em> as a reference to the gasoline that motivates a person to continue working on what he needs to get done. And he calls the little things that retard the progress of work <em>gumption traps</em>.
</p>
<p>
Anyone who has done programming before is certainly aware of some gumption traps. When your IDE that has been working fine for the whole day suddenly starts throwing peculiar errors and exceptions, you feel infuriated. Or when you try to chase down a bug that prevents your program from working only to discover that you had somehow used a stale version of the source file and that the bug had already been fixed. It is not the <strong>encounter</strong> with these incidents that causes you to lose your zen as you are programming; rather it is your <strong>reaction</strong> to these incidents that cause the state of zen to be broken.
</p>
<p>
An anecdote would illustrate this better. Pirsig uses the <a href="http://www.utexas.edu/student/cmhc/booklets/perfection/perfect.html#anchor20454942" title="Perfectionism"><em>South Indian Monkey Trap</em></a> parable to illustrate this:
</p>
<blockquote>
The "South Indian Monkey Trap" was developed by villagers to catch the ever-present and numerous small monkeys in that part of the world. It involves a hollowed-out coconut chained to a stake. The coconut has some rice inside which can be seen through a small hole. The hole is just big enough so that the monkey can put his hand in, but too small for his fist to come out after he has grabbed the rice.
<br />
<br />
Tempted by the rice, the monkey reaches in and is suddenly trapped. He is not able to see that it is his own fist that traps him, his own desire for the rice. He rigidly holds on to the rice, because he values it. He cannot let go and by doing so retain his freedom. So the trap works and the villagers capture him.
</blockquote>
<p>
The normal reaction a programmer has for a gumption trap is to lash out and probably try to find the solution fast. However, like the case of the monkey trap, sometimes even when the solution is apparently within your grasp, you tend to forget that there could be a different solution. It takes a great amount of brain power (to use the cliche term) to perform a <a href="http://en.wikipedia.org/wiki/Paradigm_shift" title="Paradigm shift - Wikipedia, the free encyclopedia">paradigm shift</a> and try a different route even if the end goal is within your grasp.
</p>
<p>
As a concrete example, think of how many times you had fixed a bug only to realize that it was but a tiny manifestation of a bigger bug? Or that the bug that you are seeing could be a transient one that exhibits itself every 500 hours and that it would be better to provide some <em>tolerance</em> for it rather than trying to fix it?
</p>
<p>
<img src="http://upload.wikimedia.org/wikipedia/commons/4/45/Duck-Rabbit_illusion.jpg" width="260" height="175" />
<br />
<small>Look one way and you see a duck. Look another way and you see a rabbit. Different ways of looking at the same thing requires a paradigm shift. And programmers need to be able to do this numerous times each day.</small>
</p>
<p>
This idea of taking a step back from what you are doing to actually think about your actions is also highlighted in Edward De Bono's <a href="http://en.wikipedia.org/wiki/Six_Thinking_Hats" title="De Bono Hats - Wikipedia, the free encyclopedia">Six Thinking Hats</a>. De Bono proposes six different colored hats: white, red, black, yellow, green and blue. The blue hat captures this notion that you need to be cognizant of the bigger picture and how to react accordingly.
</p>
<p>Which brings me to my point: pair programming might help alleviate some of the gumption traps. After all, it is rather unlikely that two programmers with completely different mind sets would fall into the same trap at the same time. Having someone watch over your shoulders does prevent some rather embarrassing episodes of barking up the wrong tree since you now need to convince your partner to do the same.</p>
<p>
Even if you do not have the luxury of having someone to pair program with, you can easily just keep a log of all the tiny mistakes or observations that you have encountered during your programming sprint. It's those moments of "a-ha" that seasoned programmers reflect upon to give them the edge over the newbies.
</p>
<p>You can find more information about gumption from Chapter 26 of the book. It's a book that has continuation from chapter to chapter but you can easily grasp the advice that Pirsig dispenses by reading each chapter independently. Like I mentioned in the beginning, the book is general enough that you can interpret it differently and mould it to fit various situations.</p>
Searching Menu Items in OS X Leopard2007-11-17T00:00:00+00:00http://vazexqi.github.com/2007/11/17/searching-menu-items-in-os-x-leopard<p>
A few months ago, I posted an <a href="http://blog.vazexqi.com/articles/2007/07/17/search-your-menu-items">entry</a> about being able to search your menu items and how it can be useful. Well, it seems that OS X Leopard actually has this feature now.
</p>
<a href="http://www.flickr.com/photos/vazexqi/2042619388/" title="Searching Menu Items in OS X Leopard by vazexqi, on Flickr"><img src="http://farm3.static.flickr.com/2035/2042619388_1379536eca.jpg" width="500" height="244" alt="Searching Menu Items in OS X Leopard" /></a>
<br />
<small>Searching Safari menu items in Leopard.</small>
<p>
So, by going to the Help menu you can actually search for a phrase and if that phrase appears in the menu items, it highlights it for you. And the blue arrow actually animates by moving slightly.
</p>
<p>
Of course, this would be more useful with a keyboard shortcut. And the keyboard shortcut that you are looking for is ⇧ ⌘ /. In case those symbols did not show up properly, they're Shift + Command + /.
</p>
Thoughts on Mac OS X Leopard2007-11-16T00:00:00+00:00http://vazexqi.github.com/2007/11/16/thoughts-on-mac-os-x-leopard<p>
When Panther was first announced, I remember pre-ordering it and waiting eagerly to install it. I had the same excitement when Tiger was announced and I pre-ordered it too. However, when Leopard was announced, I was not that excited about it. I am not really sure why. It could be a combination of things. For me there wasn't anything really enticing about Leopard that warranted a head-first jump into installing it. When Panther came, there was Expose and I could really see myself using something like that. In fact, I use Expose daily and I cannot imaging working without it. And when Tiger came, there was Spotlight which I thought was going to be really useful until I realized how slow it was. But there were other redeeming features of Tiger that made the upgrade worthwhile.
</p>
<p>
When Leopard came out, there were a plethora of new features like <em>Time Machine</em>, <em>Spaces</em>, <em>Coverflow</em>, <em>Stacks</em> and<em> Quick Look</em>. <em>Time Machine</em> by itself was not really compelling since I did regular backups often; however, Time Machine is an excellent way to showcase the underlying technologies built-in OS X to support it. But, I was actually rather disappointed with the cheesy space interface. <em>Spaces</em> is not something that I was eagerly anticipating. I was never a real fan of virtual desktops since every implementation that I had tried seemed to have some annoying feature that just drives me nuts. Instead I prefer to use the "Hide Application" command to keep things tidy. <em>Coverflow</em> is something that I don't think is useful <strong>at all</strong>. Period. In fact, of the 4 browsing interfaces available in Leopard, I only utilize the Icon View and List View. Fortunately, <em>Stacks</em> and <em>Quick Look</em> are actually pretty useful. In fact, I was using a poor man's version of it in the Preview View of an older version of <a href="http://www.cocoatech.com/" title="Welcome to Cocoatech">Cocoatech's PathFinder</a>. The Preview View allows you to quickly view PDF and Images in the file manager itself.
</p>
<p>
Moreover, some of the other <a href="http://www.apple.com/macosx/features/300.html" title="Apple - Mac OS X Leopard - Features - 300+ New Features">300</a> features of Leopard such as the new functionalities of Mail and iChat are just plain <em>ridiculous</em>. For instance, how frequently would you want to send a fancy HTML message from Mail? How many times do you want to use a fancy background for your iChat sessions? Nonetheless, Leopard seems to be the best selling version of Mac OS X to date with <a href="http://www.macnewsworld.com/story/60071.html" title="Mac News: Software: 2 Million Leopards Run Loose in Opening Weekend">2 million copies</a> sold during the opening weekend. So, there must be people out there who really do care about those features (not including developers who are probably interested in the new development tools that Leopard offers).
</p>
<p>
Those rather non-compelling features of Leopard and the fact that I was using software that might break on it prompted me to wait three weeks before installing Leopard. So I installed it yesterday and was pleasantly surprised to see the 10.5.1 update released today. Surprisingly, despite all the rants from the early adopters about how hideous the Leopard user interface is, it did not really bother me. The translucent menubar and the 3D dock complement the new theme of Leopard pretty well. What I did notice was that Apple Mail gets more hideous with each incarnation. Naturally, the first thing I did after installing Leopard was change the tacky wallpaper of the galaxy. Also, as usual with every OS upgrade, I did a clean install of Leopard so I don't run into any weird problems caused by my previous configuration. Regardless of what other people might tell you, doing a clean install is always <em>beneficial</em>. The slight inconvenience caused by having to migrate your data manually from your backup is easily alleviated by the peace of mind that you wouldn't suffer from all the cruft that has accumulated from your previous OS.
</p>
<p>
I have read about some rather compelling features that Leopard has to offer for developers. The Objective-C 2.0 language now supports garbage collection and that is really nice. Xcode is also supposed to have refactoring support built-in. And there is better support now for Ruby, Rails and RubyCocoa which I use extensively. So these are the features that are really appealing for me as a developer. I look forward to playing around with those next week during Thanksgiving break. So for me, Leopard seems to be an OS that is mostly catered for Developers and they had to throw some of those features on top of it to attract the normal users. And it is in this area that Apple still has the last say. If you are a developer who wants to use the latest tools, you have no choice but to upgrade. And hopefully convince enough of your customers to upgrade with you.
</p>
<p>
Here are some of the tools that I use on a daily basis and how they fare on Leopard:
<ul>
<li><strong>Application that broke</strong>: <a href="http://www.bronsonbeta.com/mailappetizer/" title="Bronson Beta - Mail.appetizer">MailAppetizer</a> does not work! I feel unproductive with my e-mails without this little tool. To replace it, I will be looking for <a href="http://growl.info/documentation/growlmail.php" title="GrowlMail documentation">GrowlMail</a> once it has been updated to work properly with Leopard.</li>
<li><strong>Applications which I expected to break but are <em>working</em></strong>: <a href="http://blacktree.com/?quicksilver" title="Blacktree">Quicksilver</a>, <a href="http://growl.info/" title="Welcome to Growl!">Growl</a>, <a href="http://perian.org/" title="Perian - The swiss-army knife of QuickTime® components">Perian</a>, <a href="http://homepage.mac.com/holtmann/eidac/software/page5/page5.html" title="smcFanControl">smcFanControl</a>, <a href="http://software.landryhetu.com/synergy/" title="SynergyKM: The Missing GUI">SynergyKM</a>. There is a problem with <a href="http://blacktree.cocoaforge.com/forums/viewtopic.php?t=7777&highlight=spaces&sid=ae77eda7ac9845863e98d754bf361151" title="Blacktree - Forums - View topic - Custom mouse triggers not working with spaces">mouse triggers in QuickSilver and Spaces</a> though but overall it is working fine enough. Some people are having <a href="http://groups.google.com/group/perian-discuss/browse_thread/thread/5dcdb53ee6919772" title="Leopard and Perain -
perian discussion |
Google Groups">issues with some videos</a> with Perian but it has been working fine for me so far. SynergyKM is working fine and I can still control the Windows machine in my office with it.</li>
<li><strong>Applications that I knew were not going to break but could behave <em>weirdly</em></strong>: I was really worried about how Java would work on Leopard. Fortunately my fears were alleviated when both <a href="http://www.eclipse.org/" title="Eclipse.org home">Eclipse</a> and <a href="http://www.jetbrains.com/idea/" title="IntelliJ IDEA :: The Most Intelligent Java IDE">IntelliJ IDEA</a> ran fine. However, I did experience a couple of crashes with Eclipse which was rather unusual since it has rarely crashed on Tiger. There was a lot of <a href="http://www.javalobby.org/java/forums/t102936.html" title="So Long Apple. The Party's Over">uproar</a> about Leopard not having the latest Java 6 packaged but that was not really an issue for me since I only used features in Java 5.</li>
<li><strong>Applications that I am glad still work</strong>: Adium, Textmate, VLC, Transmit, Unison, GraphicConverter, Yojimbo, Path Finder. I could easily find replacements for these tools but I have been using them so frequently that I am glad that I don't need to. </li>
<li><strong>Application that I am glad to remove <em>completely</em></strong>: <a href="http://www.logitech.com/index.cfm/494/3129&cl=us,en">Logitech Control Center</a>. I have replaced it and its sneaky idea of installing <a href="http://unsanity.com/haxies/ape/">APE</a> with the much superior <a href="http://plentycom.jp/en/steermouse/">SteerMouse</a>. In fact my Revolution MX mouse never felt as responsive.</li>
</ul>
</p>
<p>
After a few more months, more people will be using Leopard and probably all the tools will be updated by then. However, the fact remains (as with Vista) that it is getting harder and harder to actually make compelling features for the OS. Most features can easily be implemented by developers given the right API. So what new features should actually be part of the OS? And would those features be compelling enough to get people to upgrade?
</p>
Convention Preserving Refactorings2007-10-17T00:00:00+00:00http://vazexqi.github.com/2007/10/17/convention-preserving-refactorings<p><a href="http://www.artima.com/weblogs/viewpost.jsp?thread=217080">Refactoring Dynamic Code</a>:
</p>
<blockquote cite="http://www.artima.com/weblogs/viewpost.jsp?thread=217080" title="Refactoring Dynamic Code"> "These tools, along with the relatively small amount of Ruby code required to implement the desired features, made life easy during the first few iterations. With each new feature, however, the amount of refactoring required to keep the codebase clean increased. Although Rails' adherence to the DRY principle helped reduce duplication, each refactoring had to change numerous code artifacts. Some of the changes, admittedly, were needed to keep the code in line with Rails' convention-over-configuration philosophy.
<br />
Renaming an entity class, for instance, requires renaming the corresponding database tables, including other columns and indexes referencing the model's table, renaming the model class, changing the corresponding controller, helper classes, and every reference to the entity class in the views, as well as renaming the directory containing the view classes and templates. And, of course, you have to similarly rename the associated tests and all references to the model, controller, and views in the tests and fixtures."
</blockquote>
<p>
One of the advantages of being under Prof. Ralph Johnson is that we are <em>indoctrinated</em> to think of programming as a series of program transformation. From the humble HelloWorld program (just think of when you are reediting the program to add some comments or change what gets printed out to the console) to more complex programs out there, almost everything can be viewed as a series of transformations.
</p>
<p>
<em>Refactoring</em> is as a form of program transformation. Refactoring is a process where you restructure your code without affecting its observable behavior -- where behavior is defined pretty loosely. Why would anyone want to do something like this? If you have never done refactoring before this might seem like a worthless task. After all, if you aren't modifying the behavior of the program, you aren't adding new features to it. And features are what the customer cares about, right?<sup>1</sup>
</p>
<p>
Well, turns out that you refactor to make your code easier to understand. Code that is easier to understand is also easier to modify. So essentially, refactoring helps prepare your program for the next feature, and the next feature, and the next feature... that you want to add; making those features easier to add.
</p>
<p>
Certain refactorings can now be automated through an intelligent IDE. And IDEs have generally done a very good job of it -- until you being to cross the traditional language barrier. For instance, look at Rails. Rails is a framework that relies on Ruby, erb, Javascript, SQL, etc. When you perform a refactoring on your Ruby code does that refactoring percolated correctly through the entire program? If you rename a method in your Ruby code, will it change the name of the method to the new one everywhere that it was called before? Would it also be able to change the method call inside the erb file?
</p>
<p>
Furthermore, because Rails relies on the <em>convention-over-configuration</em> idea, it is desirable that your refactoring preserves those conventions as well. So now, your refactoring tool not only needs to know Ruby but it must be configured to understand the Rails framework itself! Renaming your Rails model should also make the appropriate changes to the controller and your erb file just because the framework expects them to be related <em>by name</em> in a predetermined manner. Failing to do so would actually cause your program to fail.</p>
<p>
If another framework comes along, your tool has to be <em>taught</em> to function for that framework too. And a programmer might choose to use numerous frameworks together. How would you ensure that the refactoring tool would work for any combination of frameworks?
</p>
<p>
The point of this post is to illustrate the <strong>need</strong> for multi-language refactoring support. We can think of complex frameworks as basically an extension of the language itself. Frameworks have their own set of conventions to be followed. Following those conventions is essential for a framework such as Rails. For other frameworks, following those conventions would be desirable to make the code easier to reason about.
</p>
<p>
So the main challenge is how to capture those rules that a framework specifies so that our refactoring tool can understand them and make the appropriate changes toward the entire code base.
</p>
<hr />
<small>
<sup>1</sup> You can actually think about adding features as another form of program transformation but it is not really viewed as a refactoring since adding a feature is not behavior preserving.
</small>
On Screencasts2007-09-30T00:00:00+00:00http://vazexqi.github.com/2007/09/30/on-screencasts<p><a href="http://blog.jayfields.com/2007/09/are-screencasts-future.html">Jay Fields Thoughts: Are Screencasts the Future?</a>:
</p>
<blockquote cite="http://blog.jayfields.com/2007/09/are-screencasts-future.html" title="Jay Fields Thoughts: Are Screencasts the Future?">He [<a href="http://nubyonrails.com/">Geoffrey Grosenbach</a>] sent back a few more reasons why he believes in screencasts as good teaching tools.
<ul>
<li>Efficiency of time: It takes dozens of hours to read a 300 page book straight through. But a screencast can pack the most relevant information into an hour.</li>
<li>Passive/Active: You can sit back and pick up whatever elements are interesting to you. Some people say the most valuable part is learning auxiliary shell shortcuts or workflow tips.</li>
<li>Graphical/Textual: I don't know any tech publisher who pays an artist to draw helpful diagrams. Screencasts are inherently graphical and it makes sense to include a few diagrams that explain the topic better than paragraphs of text would.</li>
</ul>
</blockquote>
<p>
I have been experimenting with doing screencasts for the class that I am a teaching assistant for. As far as I know, no other classes have been using this approach. I suspect that the HCI classes might use them but I have yet to verify that.
</p>
<p>
Like the quote above, I believe that certain things are easier explained and demonstrated through screencasts. For instance, I started the first screencast for the class to illustrate how to handle resolving conflicts during a wiki edit. For people who have never used a wiki before, handling conflicts during an edit can be a confusing task. Especially if they have no idea what to do and why a conflict would occur. And so, they tend to ignore the conflict warning and erased a previous person's edit.
</p>
<p>
After some students inadvertently destroy previous edits on the wiki, my initial thought was to write a short article on how to prevent this from happening in the future. It would have to contain numerous screenshots to actually show what was going on at each step. And then I realize how long it was going to be. Moreover, it would be hard to actually describe the conflict. Instead I opted for a screencast approach.
</p>
<p>
I opened two browser windows side-by-side and edited the same page on the wiki. I then had one browser commit earlier than the other to simulate a conflict. From there I just recorded what I needed to do to resolve the conflict. The video took about 3-5 minutes and I was able to show the real scenario and what actually happens. I did not use audio in this screencast but opted to use the "show text" feature of Quicksilver to type out important messages as the video progressed. I think it worked well.
</p>
<p>
I am also a fan of using <a href="http://en.wikipedia.org/wiki/Pattern_language">pattern languages</a> to describe best practices. So over this week (hopefully) I will have a set of screencast patterns done. I have already drafted the patterns map out and how each pattern related to another. I will admit that I am not expert in making screencasts but I have seen enough of them that I can tell which are good and which are confusing. I think my screencasts still fall into the category of the latter and would need some work on :)
</p>
Metrics and Code Coverage in Eclipse 3.3 Europa2007-09-30T00:00:00+00:00http://vazexqi.github.com/2007/09/30/metrics-and-code-coverage-in-eclipse-3-3-europa<p>
This is actually something that I spent two days on trying to get to work properly. There were a couple of variables that made this harder than necessary: the documentation on getting the latest version of <a href="http://www.eclipse.org/photran/" title="Photran - An Integrated Development Environment for Fortran">Photran</a> to compile was a bit out-dated (we need the latest version of the CDT from HEAD for the tests to run) and the fact that we are switching to Eclipse 3.3 which might not work well with all the plug-ins out there.
</p>
<p>The plan was to run some metrics and code coverage measurements on the Photran code base. Using the data that we gathered we could evaluate sections of code that needed refactoring and/or testing. We could only use free tools since we wanted the students to be able to run them on their own computers. Naturally, if we did not have this <em>major</em> restriction we would have chosen some better commercial tools.</p>
<p>The <a href="http://eclipse-metrics.sourceforge.net/" title="Eclipse Metrics Plugin - State Of Flow">State of Flow Metrics</a> was the first one I tried but it does not do a good job. The UI and visual feedback were so bad that I did not even know if it was working. So, I ran the tool on a smaller project; it completed the analysis. However the information it provides is not presented intuitively. Instead it adds a little icon on the left margin of the editor that does nothing more than indicate that it had analyzed that method. Then the data is presented in the <em>Problems</em> view along with all the other errors and warnings. For small projects, this is fine but for larger ones with 100s (or 1000s like the CDT) of warnings, you <strong>cannot</strong> even determine which are warnings from the metrics tool (vs warnings from the Java compiler). So this is pretty much <strong>useless</strong> for large projects or workspaces with 1000s of warnings. It has an export feature that is supposed to export the data to HTML and CSV forms but it refuses to complete for me.
</p>
<p>The second <a href="http://metrics.sourceforge.net/" title="Metrics 1.3.6">metrics</a> plug-in I tested was much better. It had failed to work the first time I used it because it was not able to access the data that it had collected from the analysis. However, after upgrading to the latest version of Eclipse 3.3 (Version: 3.3.1 Build id: M20070921-1145) this problem vanished. </p>
<p><img src="http://metrics.sourceforge.net/view.gif" width="400" height="218" />
<br />
<small>Metrics view using the Metrics Eclipse plug-in</small>
</p>
<p>
So, now we needed a code coverage tool or more specifically one that could analyze the tests that have been written for Photran. This is <em>slightly</em> more tricky. We need code coverage tools that can measure coverage on <strong>JUnit plug-in tests</strong> (vs the normal JUnit tests). JUnit plug-in tests must <a href="http://dev.eclipse.org/newslists/news.eclipse.tptp/msg02546.html" title="[news.eclipse.tptp] Junit headless plug-in testing code coverage?">launch</a> an instance of Eclipse to successfully execute to completion. So a majority of the test coverage tools mentioned <a href="http://java-source.net/open-source/code-coverage" title="Open Source Code Coverage Tools in Java">here</a> cannot do a decent job.
</p>
<p>
For instance, in Photran, if you just ran the normal JUnit tests there are only 125 such tests vs 1566 if you run the JUnit plug-in tests. So the coverage is going to be low for the former execution.
</p>
<p>
There was only one free tool that I could find that offered support for measuring JUnit plug-in tests: <a href="http://www.eclemma.org/" title="EclEmma - Java Code Coverage for Eclipse">EclEmma</a>. The first time I installed EclEmma it corrupted my entire workspace and I had to restore everything from the repository. I installed EclEmma again today on the latest version of Eclipse 3.3 and I <em>think</em> I know the proper way to invoke it so that it will not corrupt the workspace: always create two different run configurations and never mix them. So, when running the Photran, you should always create 2 configurations — one that EclEmma will run and one that normal Eclipse will execute without coverage. And the workspace should also always be cleaned after running EclEmma.
</p>
<p>
<img src="http://www.eclemma.org/images/screen.png" width="450" height="352"/>
<br />
<small>EclEmma code coverage in action. </small>
</p>
<p>
I believe that the Eclipse update fixed something to make EclEmma work properly on Mac OS X. Yesterday, there was no clean separation of an EclEmma run-time from a normal run-time. In fact, both of them were always merged in the same dialog. This could be why the workspace was being corrupted since EclEmma's instrumentation was replacing the normal ones.</p>
<p>
Bottom line, if you want to a good metrics and code coverage tool, go with the Metrics and EclEmma plug-ins. Of course, if you can afford it, go for a commercial tool like <a href="http://www.atlassian.com/software/clover/" title="Atlassian Clover — Code Coverage Analysis">Clover</a>.
</p>
Crimes Against Logic2007-09-30T00:00:00+00:00http://vazexqi.github.com/2007/09/30/crime-against-logic<img src="http://www.mhprofessional.com/covers/Jpeg_140-wide/0071446435.jpeg" alt="Crimes Against Logic" />
<p>
After reading the <a href="/articles/2007/08/23/would-you-call-the-1-800-number-on-a-soap-bar"><em>Tipping Point</em></a> by Malcolm Gladwell, I have been slowly following a trail of books that were part of the "Customers Who Bought This Item Also Bought..." list from Amazon. And I can say that this approach seems to work quite well. All the books that I have picked up so far have been really enjoyable.
</p>
<p>
This method of choosing new books to read also has it drawbacks -- mainly that I am only reading the same sort of things over and over. However, while browsing for the book at the local Borders (I am a member so I get 20% discount coupons each week to buy some new book) I also see some other books that are interesting and would be buy them once I run out of recommendations to read. One that has caught my fancy is <a href="http://www.amazon.com/Zen-Art-Motorcycle-Maintenance-Inquiry/dp/0060589469/"><em>Zen and the Art of Motorcycle Maintenance</em></a>.
</p>
<p>
I have almost completed <a href="http://www.amazon.com/Freakonomics-Revised-Expanded-Economist-Everything/dp/0061234001/"><em>Freakonomics</em></a> and while it is an interesting read (full of unexpected outcomes) it does not warrant any real blogging on my part. In fact, I find those stories to be more entertaining -- think of coffee table conversations material with someone whom you have just met -- but not really useful in any other sense. I have some reservations toward the anecdotes in the book since there isn't enough proof to convince me of their credibility. Again, like I said, it's a book worth reading just to stump your friends on some aspect of life in the US.
</p>
<p>
But <em>Crimes of Logic</em> by Jamie Whyte is something different. And did I mention that this book is thin, being around 130 pages, so you don't have to make a great commitment to read it. Probably all you need is about 4 hours before bed time. And since the chapters are short and non-continuous, you could easily read one or two during the times you are free and the book will still feel coherent.
</p>
<p>
Compared to <em>Blnk</em>, <em>The Tipping Point</em> and <em>Freakonomics</em>, there are no out-of-the-box anecdotes that would stump most people. In fact, Whyte uses only simple examples that everyone has probably heard about through the media. And using this simple examples, he points out logical fallacies about them! And he writes with such clarity that it is impossible to miss the punch-line at the end of each chapter. And when you get it, you would be thinking to yourself: how did I fall for that in the first place?!
</p>
<p>
I was surprised too that I had fallen for some of the logical fallacies while reading the newspaper or listening to the news. In fact this was <em>really</em> surprising. When I read academic papers, I tend to be more critical in my reading and can detect if certain sections are there just to finagle the reader into believing the paper. On the other hand when I read a non-technical article such as an article in a magazine or the newspaper, sometimes it feels that I just turn off part of my brain that does logical thinking. Yes, this is a very illogical thing to do since fallacies present themselves in all forms of writing and they especially abound in journalism.
</p>
<p>
So why does my logical side of my brain turn itself off? Probably because I don't really care about the news that much so I cannot be bothered to analyze it. Or more likely that I had somehow succumb to the journalistic writing style that favors gossip and shenanigans such that those elements seem more interesting than the gist itself. Whatever the reason, Whyte has certainly produced a nice little catalogue of common fallacies that people commit and how to detect them.
</p>
<p>
Now all he needs to do is convince the people who commit such fallacies to read them.
</p>
Apple Mail and plain text e-mail2007-08-30T00:00:00+00:00http://vazexqi.github.com/2007/08/30/apple-mail-and-plain-text-e-mail<p><a href="http://rixstep.com/1/1/20070716,01.shtml">Apple Mail - Again? - The Technological</a>:
</p>
<blockquote cite="http://rixstep.com/1/1/20070716,01.shtml" title="Apple Mail - Again? - The Technological"> "Now to add insult to injury it's become known Tiger's Apple Mail stores plain text mail as good old HTML cruft - even if you the user explicitly request to deal solely in plain text.
<br />
It's easy to demonstrate. Fire up a Panther system, start a new message within Apple Mail, type in something trivial, save the message as a draft, and then hit [OPT+COMMAND+U] to see the raw code."
</blockquote>
<p>
This is as bad as Microsoft Outlook (Express?) trying to be smart and sending two copies of the same message: one in plain text and one in HTML. I have received a couple of those over the past few days and I really hate how they display.
</p>
<p>
But I really hate the behavior of Apple Mail because it's a pernicious bug. As long as you type out your e-mail and send it without saving it as a draft then it will obey your preferences to send it as plain text. The problem happens unsuspectingly after you choose to save the message as a draft.
</p>
<p>
This is an important issue because it makes me feel like a hypocrite. I always tell people to send me plain text e-mail and here I am sending them HTML e-mail. In my defense, it's all Apple Mail's fault.
</p>
<p>
Update: In general, I think the <a href="http://www.birdhouse.org/etc/evilmail.html">acceptance</a> for HTML e-mail has risen somewhat over the past few years. I don't mind receiving them once in a while but I generally do not send them for fear of them being filtered out by a recipient who detests HTML format. So the fact that my mail client silently sends them is still an issue to me.
</p>
Would you call the 1 800 number on a soap bar?2007-08-23T00:00:00+00:00http://vazexqi.github.com/2007/08/23/would-you-call-the-1-800-number-on-a-soap-bar<p>
In case some of you have not noticed, products sold in the US have the distinctive property that there is almost always a 1 800 number written somewhere on the back of it. Now, this seemed rather weird to me the first time I saw it. My initial thought was that this must be part of some weird law or requirement similar to the bizarre warning - Caution: Contents may be HOT - that you can find on coffee cups. After all, when someone purchases a bar of soap, would they really want to call that number other than to complain about something?
</p>
<p>
Well, it seems that there is indeed such a group of people who do care about such things. In his book <a href="http://www.amazon.com/Tipping-Point-Little-Things-Difference/dp/0316346624"><i>The Tipping Point</i></a>, Malcolm Gladwell labels such people <i>Mavens</i> . <a href="http://en.wikipedia.org/wiki/Maven">Mavens</a> are people who seek to be experts in their respective field. You can think of them as the equivalent of the computer geeks but in the <i>real world</i>. Mavens are people who devote themselves to finding out anything and everything they can about a product. They then propagate this information to anyone who is willing to hear them out. And since normal people like you and me don't really care so much about that bar of soap, the 1 800 number is generally reserved for the Mavens.
</p>
<p>
What's the point of all this? Well, turns out that Mavens are people who might actually affect whether something sells or not. Not everyone cares about a bar of soap but most people will care about something that they are going to invest a lot of money in, say, a car. No one is going to get a car without consulting <i>a friend or a friend's friend</i> who has more experience on a car. And this is where Mavens play a very important role. You are probably going to trust what the expert says. And smart companies are going to try their best to win over these experts.
</p>
<p>
Mavens occupy a very precise role in influencing the selling point of a product. Sometimes, their roles seem so inconsequential. But at other times, their opinions carry so much weight that it is almost suicidal for a business to ignore them. Of course, it is important to be able to distinguish the <i>real</i> Mavens from the wannabes.
</p>
<p>
<i>The Tipping Point</i> contains lots of tit-bits like the above. While the book itself is lacking a cohesive theme, it redeems itself by presenting lots of interesting cases and it lets the reader form his or her own conclusions. Reading the book is probably not going to change your life - which never was the intent of the book. Instead, the book aims to bring together a collection of these observations and present them as plausible theories of how the tipping point might come about.
</p>
Subtitle Tracks in .mkv files on Mac OS X2007-08-20T00:00:00+00:00http://vazexqi.github.com/2007/08/20/subtitle-tracks-in-mkv-files-on-mac-os-x<p>
Summer is the time when I spend way too much time watching <a href="http://en.wikipedia.org/wiki/Anime" title="Anime - Wikipedia, the free encyclopedia">anime</a>. And when you are watching that much anime, you really want to make sure that you get the subtitles to display decently or your eyes will just hurt. Usually this is not a problem since most <a href="http://en.wikipedia.org/wiki/Fansub" title="Fansub - Wikipedia, the free encyclopedia">fansubbed</a> anime embed the subtitles directly into the movie (.avi, .mp4, etc) file itself. However, nowadays, the <a href="http://www.matroska.org/technical/index.html" title="Matroska Technical Details">Matroska</a> .mkv file format has been gaining popularity. In the .mkv format, the subtitles are no longer embedded into the movie track but included as a separate resource that you can enable/disable at will.
</p>
<p>
Till now, there are two popular applications that can be used to open .mkv files on the mac: <a href="http://www.videolan.org/vlc/" title="VLC media player - Overview">VLC</a> and <a href="http://www.mplayerhq.hu/" title="Entering MPlayer homepage">MPlayer</a>. I prefer VLC because it has a better interface and is updated more frequently. And VLC seems to be open almost all video file formats. Now, there is a new plug-in called <a href="http://perian.org/" title="Perian - The swiss-army knife of QuickTime® components">Perian</a> for QuickTime that has been updated to enable .mkv files to be played inside QuickTime itself. And I must say, the results are fantastic. Here are some comparisons
</p>
Spam measures for this site2007-08-06T00:00:00+00:00http://vazexqi.github.com/2007/08/06/spam-measures-for-this-site<p>
Seems like I was hit by some comment spammers this afternoon which cause this site to be down.
</p>
<p>
As as a precaution, I have disabled trackbacks site wide and also limit comments so that they can only be entered via the web interface (meaning that you need to use the Ajax interface). This should not be a problem since I get very little feedback anyway and I definitely do not want the site to go down again because of spam.
</p>
<p>
I do have <a href="http://akismet.com/">Akismet</a> protection but it did not seem to protect against the kinds of spam that were hitting me.
</p>
Fewest dropped calls? Doesn't matter when everything else is bad2007-08-06T00:00:00+00:00http://vazexqi.github.com/2007/08/06/fewest-dropped-calls-doesnt-matter-when-everything-else-is-bad<p><a href="http://en.wikipedia.org/wiki/AT&T_Mobility#_note-NYT-Telephia">AT&T Mobility - Wikipedia, the free encyclopedia</a>:
</p>
<blockquote cite="http://en.wikipedia.org/wiki/AT&T_Mobility#_note-NYT-Telephia" title="AT&T Mobility - Wikipedia, the free encyclopedia"> "The research company later stated that Cingular did indeed have a 'statistically-significant lower dropped-call rate than the competition across some market/time period groupings,' but that Telephia had 'no knowledge of the specific methodology (markets, time periods or statistical thresholds) that Cingular used for its 'lowest dropped call' claim.'"
</blockquote>
<p>
If you live in the US and watch television, you would have certainly come across one of the AT&T commercials where they claim that they have the fewest dropped calls. The commercials are definitely funny to watch but having the fewest dropped calls might not even matter all that much....
</p>
<p>
Especially when your calls do not even get through in the first place! This is not even funny. This is the epitome of unreliability. Important calls cannot even get through to me. This has happened not once, not twice, but more than 10 times in the one month that I switched to AT&T from T-Mobile. Most calls are not that important and people will try a couple of times. But last week I was expecting a call from my insurance agent and he was not able to get through. He was not even able to hit my voice mail! It was as though my phone was turned off. Since it was a Friday and they don't work on weekends, he was only able to get to me on Monday morning.
</p>
<p>
I do realize that calls cannot get through if I am using the EDGE service on my iPhone but rest assured that I was not using that. The times that people told me that they were not able to get through to me were times when I was not even using the phone! It was either just sitting on the table or in my pocket. And since it is in my apartment, I get great reception and the phone was showing full bars.
</p>
<p>
And not only that, today I was not even able to make calls. I had to redial twice or thrice to get through. That is more annoying than dropped calls.
</p>
<p>
Furthermore, ever since getting onto AT&T my mom has also been complaining that every time I call her the voice quality is not as good as last time. Previously I had a Razr and was on T-Mobile. Because the iPhone is tied down to AT&T it is impossible to tell which one is the culprit for the lousy voice quality. I do not exonerate the iPhone from all blame since it is not possible to test it on any other network. So the iPhone could potentially be the culprit here.
</p>
<p>
Moreover, compared to T-Mobile, AT&T has terrible international calling rates. I have a brother who is studying in Australia and to call him using AT&T I need to pay $3.67 a minute (it's $0.25 a minute if I sign up for AT&T World Connect which costs $3.99 a month). With T-Mobile, I pay a mere $0.34 a minute without signing up for anything. I don't call that often and I don't want to sign up for World Connect.
</p>
<p>
What about international roaming? In Malaysia, T-Mobile charges $1.99 a minute to make a call. AT&T wants to charge me $2.29. They charge $1.99 if I sign up for AT&T World Traveller! Another stupid plan that I need to sign up for before I get decent rates that T-Mobile is able to give me.
</p>
<p>
And AT&T is really evil. I am not sure if this is even legal but they signed me up for a <i>trial</i> of their road side assistance service! It'll cost me $3.99 a month if I decide to continue with it. I did not even sign up for it! I just received a letter one day telling me that I had been automatically enrolled in their Asurion road side assistance program. And they have been sending useless offer letters to my mailbox. I never received this kind of stuff from T-Mobile.
</p>
<p>
So, I would gladly take a few dropped calls from other networks (actually I have never experienced dropped calls with T-Mobile at all) compared to having important calls not even reach me in the first place and all the other crap that I have to take. Rest assured that if T-Mobile begins to support the iPhone in the US I will <b>gladly</b> pay the early termination fee of $200 and just get away from AT&T. Verizon or Sprint are not really options since they are even more ridiculous - their phones do not use SIM cards!
</p>
Multilingual Developer2007-08-05T00:00:00+00:00http://vazexqi.github.com/2007/08/05/multilingual-developer<p><a href="http://martinfowler.com/bliki/OneLanguage.html">MF Bliki: OneLanguage</a>:
</p>
<blockquote cite="http://martinfowler.com/bliki/OneLanguage.html" title="MF Bliki: OneLanguage"> "For many developers, the one-language notion is a sign of lack of professionalism. This is best exemplified by the Pragmatic Programmers' advice to learn a new language every year. The point here is that programming languages do affect the way you think about programming, and learning new languages can do a lot to help you think about solving problems in different ways. (It's important to learn languages that are quite different in order to get the benefit of this. Java and C# are too similar to count.)"
</blockquote>
<p><a href="http://catb.org/~esr/faqs/hacker-howto.html">How To Become A Hacker</a>:
</p>
<blockquote cite="http://catb.org/~esr/faqs/hacker-howto.html" title="How To Become A Hacker"> "LISP is worth learning for a different reason - the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot. (You can get some beginning experience with LISP fairly easily by writing and modifying editing modes for the Emacs text editor, or Script-Fu plugins for the GIMP.)
<br />
It's best, actually, to learn all five of Python, C/C++, Java, Perl, and LISP. Besides being the most important hacking languages, they represent very different approaches to programming, and each will educate you in valuable ways."
</blockquote>
<p>
For simplicity, let's assume that there are two types of programmers out there: 1)those who are only extremely proficient in one language (most likely C++, Java or C#) and know <i>everything</i> about the language including the obscure corner cases of its implementation 2) those who know multiple programming languages and enough of each to be able to write applications with it with some form of reference by their side. Now, these are two extreme ends of the gamut and any programmer worth his or her pay will definitely be able to use multiple languages.
</p>
<p>
Imagine that you are trying to solve a programming problem. You go ask a developer from category 1). He replies that you should try to use language feature #x together with library #z and that you should be careful of some of the dependencies - make sure that you use version 2.1 even if it is in the unstable branch since previous versions cannot work with library #z. Now, you go ask a developer from category 2). He replies that he has seen this problem in one of the languages that he knows and that it is called the "some person's name problem". He explains what the gist of the problem is, some solutions that people have proposed and what he thinks is the best approach to the problem without suggesting a specific language or library (he gives a few that you could try but never ever just one).
</p>
<p>
Which developer would you prefer? If you go with developer 1), you get the exact language feature and library to use to solve your problem. You might of course run into problems later but for the most part you can get started immediately. If you go with developer 2), you are now able to understand the problem better, possibly google the "some person's name problem" and be able to form you own conclusions on the matter. With 1) you get an immediate solution but with 2) you get a solution that you can potentially apply again and again in different environments.
</p>
<p>
Of course, the choice of which developer to go with depends on your current situation. The gist of the example above, is that by knowing a few more languages, you are able to distill the actual problem (the "some person's name problem"). From my experience this comes from the fact that most languages are able to solve certain problems better. Furthermore, if you ever read the literature, you will discover that programming languages were invented to address certain inadequacies in other programming languages. Programming languages are turing-complete so you can solve all the solvable problems (problems that do not reduce to the halting problem) with them.
</p>
<p>
Consider the simple <a href="http://en.wikipedia.org/wiki/Quicksort">Quicksort</a> algorithm. I remember learning about this in my introductory CS class. The explanation was easy to understand but when we had to actually implement it in Java, the beauty of the algorithm was lost amidst all the <i>noise</i> that the programming language had. Contrast this to the naive - it's naive because it uses list concatenation which is slow - Haskell implementation below:
</p>
<p><a href="http://www.haskell.org/haskellwiki/Introduction#Quicksort_in_C">Introduction - HaskellWiki</a>:
</p>
<blockquote cite="http://www.haskell.org/haskellwiki/Introduction#Quicksort_in_C" title="Introduction - HaskellWiki">
<code>
qsort [] = []
<br/>
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)"
</code>
</blockquote>
<p>
While you do need to know a bit of Haskell syntax to comprehend the snippet above, once you do, it becomes almost ethereally clear and concise. The Haskell snippet expresses not only the implementation but also the algorithm itself clearly. The time that you invested in learning a <i>different</i> language like Haskell pays off because it allows you to think about the problem and how to solve it. In the Haskell implementation you solve it using list comprehension whereas in the Java/C version you manipulate data structures with indices or pointer arithmetic. Don't worry too much about the syntax since it is just a way to express the underlying idea.
</p>
<p>
I claim that the ability to think about the problem itself is an important skill. In the simplest case, it allows you to formulate a query to feed into google. You will be amazed at how many people do not know how to formulate a good query to feed into google.
</p>
<p>
But isn't it a waste to know so many languages but not be able to use them together? Sure, most languages are able to interface with C because C is still the language to use when you need performance (Fortran programmers will probably disagree since they live in their own world of super high performance computing where the laws of normal CS no longer apply to them). So while the bridge from C to "your favorite language" is pretty good, the bridge from "your favorite language" to "another language that you need" is not that good.
</p>
<p>
Things are beginning to change of course. I think that the advent of projects like the <a href="http://en.wikipedia.org/wiki/Common_Language_Runtime">CLR</a> and <a href="http://www.infoq.com/news/2007/07/jlr-project">JLR</a> will be able to make multilingual programming possible. There might be other implementations out there but admit it, the Java Virtual Machine and the .NET virtual machine are the two most popular ones right now.
</p>
<p>
As far as I know, right now the way to use different languages would be to create libraries in one language and then export it. You can then use that library in either Java or one of the .NET core languages. Even the JVM supports Javascript and Ruby, I don't think that you can use them together yet.
</p>
Eclipse WTP: A hidden gem2007-07-31T00:00:00+00:00http://vazexqi.github.com/2007/07/31/eclipse-wtp-a-hidden-gem<p>
In my previous <a href="http://blog.vazexqi.com/articles/2007/07/27/setup-struts-project-in-eclipse-more-choices-than-necessary">post</a>, I lamented how hard it was to find the right tools to get started with developing Struts (and other web applications) in Eclipse. The solution I finally found was to use the Eclipse Web Tools Platform (<a href="http://www.eclipse.org/webtools/main.php">WPT</a>) plug-in.
</p>
<p>
Today, I was trying the <a href="http://www.springframework.org/">Spring Framework</a> out and wanted to quickly set it up in Eclipse. I was following along the tutorial from the sample chapter of <a href="http://www.sourcebeat.com/books/springlive.html" title="SourceBeat | The Spring Primer"><em>The Spring 1.x Primer</em></a>. Personally I think it is a terrible tutorial. There are too many things going on in that chapter; the author expects that the user should set up decently-sized web application with Spring, Hibernate, Struts and Ant and then refactor this web application through the book. The whole chapter was basically a set of instructions: do this, do that, don't worry about that since we will get to it in a later chapter. Needless to say, I think this is a bad way to introduce a framework especially if you are bundling it with other huge frameworks. This forces the user to come to grasp with four different things at the same time.
<p>
Moreover, the author was advocating using his tool to create a skeleton for the project. While I agree that this is a good approach - it was almost as simple to use as the Ruby on Rails generator - but his tool was a bit outdated. It was using an older version of Hibernate and an older version of Spring. Moreover his tool generated an older version of a project file for IntelliJ that had to be updated. At this point, I was rather frustrated because of all the dependency issues that had to be resolved.
</p>
<p>
Fortunately, a search for "best spring book" revealed <a href="http://forum.springframework.org/archive/index.php/t-18095.html">this link</a>. I found it useful to read through the articles on Dependency Injection before even attempting to program with Spring. There are two well-written articles on the web for that: <a href="http://www.martinfowler.com/articles/injection.html">one</a> by Martin Fowler and <a href="http://www.devx.com/Java/Article/21665">another</a> by Javid James. Both authors give good examples that motivate the use of Spring without the needless coupling with other frameworks. I respect them both as good authors since they are able to explain things succinctly without having to confusing the reader.
</p>
<p>
Anyway, I downloaded the source code for <a href="http://www.devx.com/Java/Article/22134">this article</a> and then just set up a new Dynamic Web Project in Eclipse. The WTP plug-in created a directory structure that mimics what a normal web application should look like and I was able to just copy the source code into my project. WTP was clever enough that it has a pseudo library called <i>Web App Libraries</i> that will mimic what was stored in the WEB-INF/lib folder without making me configure it. The XML editor even had decent code-completion based on the XML schema. Additionally, it was easy to set up the project to work with Tomcat 5.5 and I could test the application out in Eclipse itself using the built-in web browser. All in all, I was pleasantly surprised with how well integrated the WTP is.
</p>
<p>
I am sure there are other hidden features of WTP that I have yet to discover. A cursory inspection reveals that there is built-in support for adding data sources either from a file, web service or database. However, if you need <i>dedicated</i> support for Spring (and not just an easy way to get started), then you should either use <a href="http://www.jetbrains.com/idea/" title="IntelliJ IDEA :: The Most Intelligent Java IDE">IntelliJ</a> which has great support for Spring, Hibernate and Struts or you can try out the <a href="http://springide.org/blog/">Spring IDE</a> which is based on Eclipse. Personally, I believe one would have a higher chance of success with IntelliJ since using multiple plug-ins in Elcipse (especially plug-ins that are not part of the official Eclipse project) creates lots of nasty dependency and versioning issues.
</p>
<p>
There are two articles on the web discussing how to use an older version of the Eclipse WTP. One details how to <a href="http://jdj.sys-con.com/read/152270.htm">create web applications with WTP</a>. Another details how to <a href="http://java.sys-con.com/read/216320_1.htm">create a web application that uses Struts and Hibernate with the WTP</a>. There are rather good articles and I was surprised that not many people had bookmarked them on <a href="http://del.icio.us/">del.icio.us</a>. Maybe most people just have not heard of the WTP plug-in.
</p>
<p>
The Eclipse WTP <a href="http://www.eclipsewtp.org/">book</a> was also recently published. I have always viewed the publication of a book for an open source project as a good indication that you will not be screwed in the future using it. A book is a good indication of user momentum; there are people who are interested in finding out how to use it. I have not read the book since I am only doing basic things with WTP and the help documentation suffices for my needs but I expect that it will be useful when you are dealing with more complex issues.
</p>
Setup Struts project in Eclipse - more choices than necessary2007-07-27T00:00:00+00:00http://vazexqi.github.com/2007/07/27/setup-struts-project-in-eclipse-more-choices-than-necessary<p>
One would expect that that given the popularity of Eclipse that there would be an easy way to setup Struts with it. However, this does not seem to be the case. There are various resources on how to use some non-standard Eclipse installation (EasyEclipse, MyEclipse) or some outdated plug-in (StrutsConsole, EasyStruts). But it is really hard to find one on how to use a standard Eclipse installation. The definition of what is a standard Eclipse installation is <b>debatable</b> since there are just so <i>many</i> different combinations of it.
</p>
<p>
In fact, here is a list:
<ul>
<li><a href="http://www.ibm.com/developerworks/library/os-ecstruts/">Developing Struts with Easy Struts for Eclipse</a></li>
<li><a href="http://www.laliluna.de/first-steps-using-struts-tutorial.html">First Struts Tutorial using Eclipse, MyEclipse</a></li>
<li><a href="http://www.laliluna.de/first-steps-using-struts-tutorial.html">How to setup a basic Struts project using Eclipse IDE</a> - this one actually comes pretty close to what I need but it is outdated.</li>
</ul>
</p>
<p>
However, in my case, I would like just like to use a simple installation that just enables me to launch my Struts application from within Eclipse. I don't really need any of the more complicated features. If I needed those features, I would be using IntelliJ which has great integration with Struts (and almost everything else that you usually use Java with e.g. Hibernate, Spring, etc) built-in.
</p>
<p>
Fortunately, I found <a href="http://www.mail-archive.com/user@struts.apache.org/msg63546.html">this thread</a> after some searching. The instructions are a bit terse but you can definitely follow along with some trial and error. Just make sure that you have one of the supported servers installed. In my case, I was using the <a href="http://tomcat.apache.org/">Apache Tomcat</a> server but there are adapters for other servers as well. Also, make sure that you follow (or to be more specific, <i>obey</i>) the folder structure imposed. It's a pretty conventional and there should not be a reason to not put things in their recommended folders.
</p>
<p>
All that is required is to have the Web Tools Platform (<a href="http://www.eclipse.org/webtools/main.php">WTP</a>) plug-in installed. My past experience with installing the Web Tools Platform had me downloading a whole bunch of required plug-ins before it could work. Needless to say, it was not a pleasant experience. So I was happy to see that they have released all-in-one package for the WTP project <a href="http://download.eclipse.org/webtools/downloads/drops/R2.0/R-2.0-200706260303/">here</a>. This is definitely a time-saver. The WTP is a comprehensive project that is maturing toward the usability and stability that one associates with the Eclipse Java Development Tools (<a href="http://www.eclipse.org/jdt/">JDT</a>).
</p>
<p>
Now that everything is working - after much time-wasting - I believe that I have reconfirmed my view that having too many choices is not always good! It's really annoying when all you are trying to do is get some prototype up quickly and you are not able to do that because you have to make a decision between product A, B or C. Sure you can go ahead and read the comparisons and user reviews but most of it is not going to make that much sense to you if you have never used similar products before. And the reason you have never used them before is because you are just beginning to create your first prototype!
</p>
<p>
I find the situation of having too many choices to be really prevalent in the Java world. I am not against having different choices but I know that when I am just beginning to use some new tool, I would really like everything bundled together so that it just works out of the box! I don't want to select product AA only to be told that before I can use product AA I need to install <i>either</i> product A.1 or product A.2! Just give me a working combination that I can quickly use to see if my prototype can even work in the first place!
</p>
<p>
And don't get me started on the XML configuration files that are necessary before you can begin running that Java application....
</p>
Getting Into College: The Things People Do2007-07-24T00:00:00+00:00http://vazexqi.github.com/2007/07/24/getting-into-college-the-things-people-do<p><a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2007/07/22/MNGDKR2ORM1.DTL">Teens trade lazy summer days for jobs / Work experience seen improving college prospects</a>:
</p>
<blockquote cite="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2007/07/22/MNGDKR2ORM1.DTL" title="Teens trade lazy summer days for jobs / Work experience seen improving college prospects"> "Instead, many college-bound young people are in summer school, doing volunteer work, or on a trip to the Third World -- sometimes more to spice up their college applications than out of genuine interest, admissions officers say.
<br />
Admissions deans are loath to suggest that certain types of experiences are better than others, and say they do not hold a lack of paid work against applicants. Still, deans at several elite schools said they are taking more notice when students have unglamorous jobs."
</blockquote>
<p>(Via <a href="http://digg.com/offbeat_news/Teens_accused_of_taking_summer_jobs_just_to_improve_College_applications">Digg.com</a>.)</p>
<p>
Back in my country, I have seen students in my school join clubs and societies just for the sake of putting it down on their university applications. They would show up during the early weeks of the school term to every club and society meeting so that they may be elected as committee members. And the education system in my country has a completely bogus and ridiculous scoring system for club participation: It is scored on a scale of 1-10. You are scored between 1-4 if you are just a normal member - length of participation determines what score you get. You get a 5 if you are one of the committee members. The only way you can get above a 5 is if you have represented your school, district, state or country. This forces everyone to compete for a position in the committee even if they are not fit for the post in the first place.
</p>
<p>
And not surprisingly, it is usually the loud-mouths who manage to get the position. They will try to convince their friends and teachers that they are suitable for that position. And when they finally get that position, they do not live up to their promises. The normal members end up doing much of the work without receiving any credit (remember the bogus system? You cannot get above a 5 if you are not a committee member). And what is worse is that our education system does not really rely on recommendation letters. So even if the teacher decides to write a letter for you, it is not going to be read by the admissions committee.
</p>
<p>
This was during my high school years and they might have already abolished this system. However, I seriously doubt it since I still hear tales of people doing these activities as a means to boost their application.
</p>
<p>
I have also heard stories of students who try all sorts of methods to get into medical school in this country. There was someone who was working in a lab during his undergraduate years where he received proper training. He exhibited great leadership, motivation and potential. Thus, he was able to garner a good recommendation letter from his mentor. Then poof, once he got accepted into medical school, he stopped showing up to the lab altogether. When contacted, he just brushed it off as saying that he is now extremely busy.
</p>
<p>
I don't pretend to have a solution for this. There is no bullshit detector at the moment nor will there ever be one. It's just sad that such things are so prevalent. And it's even more sad that just because everyone is doing it, good honest kids are also compelled to follow. What happened to being who you are and sticking to your own opinions?
</p>
Harry Potter2007-07-22T00:00:00+00:00http://vazexqi.github.com/2007/07/22/harry-potter<p>
Unless you have been living under a rock - or just could not be bothered - you would have at least heard the news that the 7th and final book of the Harry Potter series has been released much to the delightfully anticipation and solemn realization of many. Delightful since this is the concluding book; and solemn since it marks the ending of a tale that has spanned a decade.
</p>
<p>
Truth be told, I was not an early fan of the Harry Potter series. In fact I had merely dismissed it as <i>another</i> work of fiction when the first book appeared during my teens. I am not one who enjoy modern works of fiction since I have found them to be rather shallow in nature. However, as a kid, I did however remember reading the works of <a href="http://en.wikipedia.org/wiki/Enid_Blyton">Enid Blyton</a> and thoroughly enjoyed them. When I hit my teens most modern fiction books out there really began to feel repetitious with heavy borrowing from one another. And there never was a compelling series to commit myself to.
</p>
<p>
My interest in Harry Potter only started during the long holidays when I was done with school. In my country, that mean after the exams that one has to take during Form 5. By that time, four Harry Potter books have already been released. My mom had somehow procured them from one of her friend's daughter who was studying overseas. Moreover, by this time, I was curious about the hype and controversy that the Potter series had spawned. The hype was undeniable so much so that one of my more radical church friends (forgive him as he was (is still?) young and naive), brainwashed by his church, condemned the book as a vessel for demonic works.
</p>
<p>
It was by reading the four books in my hands at that time that I think I understood how Harry Potter could captivate the hearts of children and adults alike. There was an endearing quality to it. It did not dismiss the acts of violence as most other children's book would have done; neither did it superficially inject violence into the series. Sacrifices do have to be made sometimes for the greater good. Moreover, its conversations were not cloaked under the shroud of pretense: adult conversations (be they <i>muggles</i> or wizards) will always be punctuated with implied swearing. It is this honesty that separates this book from the works of the other authors who try too hard and yet at the same time, reveal too little human nature.
</p>
<p>
Anyway, it was certainly fun reading the last installment of the series. I was determined to finish it as soon as possible to avoid the possibility that my girlfriend would spoilt the ending for me. She has already attempted to do so by flipping to the last few pages of the book and reading the text aloud. Without spoiling it for anyone else, I would say that the ending brought a nice satisfactory conclusion to the series. It was a most appropriate ending after the midst of sadness that had transpired during the last few books of the series.
</p>
<p>
Now, if you'd excuse me, I must search for some other series to follow.
</p>
Search your menu items2007-07-17T00:00:00+00:00http://vazexqi.github.com/2007/07/17/search-your-menu-items<p><a href="http://www.codinghorror.com/blog/archives/000887.html">Coding Horror: Incremental Feature Search in Applications</a>:
</p>
<blockquote cite="http://www.codinghorror.com/blog/archives/000887.html" title="Coding Horror: Incremental Feature Search in Applications"> "I'm a big fan of incremental search. But incremental search isn't just for navigating large text documents. As applications get larger and more complicated, incremental search is also useful for navigating the sea of features that modern applications offer."
</blockquote>
<p>
I cannot agree more. These days, it is almost impossible to find where the latest features are. And if you are relying on the myriad of keyboard shortcuts for different applications, it can get a bit overwhelming. Was it ctrl+F11 or ctrl+alt+F11 to compile and run that program again? It gets worse when the program you are using allows for plugins. Each plugin tends to have its own keystrokes. And sometimes the most useful features are buried so deep down the menu that you will never find them! Lastly, some keyboard combinations just do not make that much sense. How in the world am I suppose to press those three keys simultaneously?!
</p>
<p>
Anyway, not every application out there is going to over incremental search on its menu items but fortunately, two of my favorite apps offer this functionality.
<ul>
<li><a href="http://macromates.com/" title="TextMate — The Missing Editor for Mac OS X">TextMate</a>: Access incremental menu item search using Ctrl+Apple+T</li>
<li><a href="http://www.jetbrains.net/confluence/display/IDEADEV/Selena+EAP" title="Selena EAP - JetBrains.net">IntelliJ Selena</a>: Currently you need the latest EAP version for this to work. Access incremental search using Apple+Shift+A</li>
<li><a href="http://www.eclipse.org">Eclipse 3.3</a>: To use this feature, you just do Apple+3.</li>
</ul>
</p>
<p>
And on the Mac, there is an alternative if the application that you are using does not support incremental search on menu items: <a href="http://quicksilver.blacktree.com/" title="quicksilver:
computing at the speed of thought">Quicksilver</a>. There is a command that allows you to access the menu items. Follow the instructions <a href="http://the.taoofmac.com/space/blog/2006/01/01/1800" title="The Tao of Mac - Making the Mouse Redundant">here</a>. I mapped the command to opt+space so that I can easily access it.
</p>
<p>
So give incremental search a try and you will wonder how you can ever live without it in the first place!
</p>
<p>Update: InfoQ has also picked up on Jeff Atwood's original article and has featured it on their <a href="http://www.infoq.com/news/2007/07/incremental-search">page</a>. An important thing to realize about incremental search is that not all search methods are as good. For instance, the ones in TextMate and Quicksilver are easier to use because they search for fragments of the word in any location. Sometimes this gives spurious results but it easier for the user since you do not need to remember the exact character that the word starts with.
</p>
flickrPreviewR2007-07-16T00:00:00+00:00http://vazexqi.github.com/2007/07/16/flickrpreviewr<p>
For the past couple of days I have been creating an application that I think I would use. And maybe some other people might find it useful too (possibly as an example for doing things in RubyCocoa). For the lack of a better name, I decided to call it flickrPreviewR and hopefully I would not be sued.
</p>
<img src="http://farm2.static.flickr.com/1091/826036668_f527242991.jpg" alt="flickrPreviewR"/>
<br />
<small>flickrPreviewR screen. It even has the typical flickr logo design from <a href="http://flickr.nosv.org/">flickrlogomakr</a>. The line to the right is the the side of a window that apparently shifted a bit to my other screen and included in the image capture.</small>
<p>
It all started when Flock released a new version of their browser sometime last week. I downloaded it since I was eager to see what the <i>perpetually-in-beta</i> browser has created this time. This time I was really disappointed. The only reason for my using Flock was its integration with Flickr. I just like to quickly browse photos without having to use Flickr's interface. Unfortunately, this new version of Flock really left a sour taste in my mouth. Its interface is <i>hideous</i> and the newly revamped Flickr integration seems buggy and <b>really slow</b>. What does it need to do that requires that much computation power? It just needs to fetch the damn photos damnit!
</p>
<p>
Anyway, this provided the motivation and gave me another reason to play with RubyCocoa. The last time I dabbled with RubyCocoa, I created a version of the RaiseMan application from the book <i>Cocoa Programming for Mac OS X</i> with bindings. Since then, RubyCocoa has had additional changes and I was curious whether it is now easier to develop programs for it. My conclusion: nothing much has changed in terms of the cosmetics of language (there are underlying changes for optimizations, etc), but overall there was nothing new to pick up.
</p>
<p>
For the backend of this application, I relied on <a href="http://rubyforge.org/projects/rflickr/">rflickr</a>, the Ruby API kit for accessing flickr. I needed to make some slight changes to the code to accommodate some changes in the flicrk API. rflickr source is bunbled as part of the source code. I did want to not rely on it being a gem since I am not sure how RubyCocoa handles gems and I did not want to add a dependency for the gem; so I just bundled it. flickrPreviewR is under the Creative Commons Attributions License. This might violate the rflickr license and if it does, then let me know and I will see what I can do.
</p>
<p>
You can find the set of images on my <a href="http://www.flickr.com/search/?w=37092324%40N00&q=flickrpreviewr&m=tags">flickr account</a>. I do not have a pro account so I cannot create a set for it. You should read the description of each photo if you are planning on using this. As usual, use this at your own risk. I am doing this as a personal application that I would use and as the developer, I am aware of its limitations and I do not push them while using the application.
</p>
<p>
One very important limitation that I need to stress is the inability for it to update itself.
</p>
<blockquote>
There is a weird quirk with using threads in RubyCocoa and NSNotifications. I have not figured out how to get the view to refresh once all the images have been downloaded. Right now, there is the VERY cumbersome need to click on ANOTHER favorite or photoset to force a refresh. The best way to see if the photos have finished loading is to view the progress bar at the drawer.
<br />
<br />
THIS NEEDS TO BE FIXED once I figure out how.
</blockquote>
<p>
Here are some things that I picked up while doing this:
<ul>
<li>Interface Builder is a great tool for quickly laying out the interface. I cannot imagine how I would have done this with some other GUI toolkit. Even with my familiarity with Java, it would taken much longer just to get all the pieces aligned properly.</li>
<li><a href="http://www.cocoadev.com/">CocoaDev</a> is <b>the</b> site for almost all the questions that you can have on how to do things in Cocoa. Without CocoaDev, it would have taken me a longer time to get things done.</li>
<li><i>Cocoa Programming for Mac OS X</i> is a decent reference book once you know your way around how certain things in Cocoa work. That still does not make it a good book to start learning Cocoa programming.</li>
<li>You can save yourself great pains if you make all your classes subclasses of OSX::NSObject explicitly instead of normal Ruby classes. This will save you trouble when you get weird behavior and crashes. Like me, you might want to use normal Ruby classes sometimes because YAML works well with the regular Ruby classes. In that case, make sure that your class is being used as simple data structure with simple functions that do not rely on any of the Cocoa libraries.</li>
<li>Threading is hard to do with RubyCocoa and there is little reference on what works and what does not.</li>
<li><a href="http://www.rubynoob.com/articles/2006/8/21/how-to-download-files-with-a-ruby-script">Downloading images</a> with Ruby net/http library did not work for me. The image will always end up corrupted. Thus, I had to rely on curl to download the images.</li>
<li>WebKit is an excellent piece of work. I used it as the primary backend for displaying the images. To intercept the handlers, I made each preview image be a link an imaginary 'flickr://' protocol. I then overwrote <code>webView_decidePolicyForNavigationAction_request_frame_decisionListener</code> to intercept the call and perform the appropriate actions.</li>
</ul>
</p>
<p>
For those who are interested, the source code is <a href="http://blog.vazexqi.com/files/flickrPreviewR.zip">here</a>. I did not package it as a stand-alone application because I am not <i>sure</i> what you actually need to run this application. You probably need RubyCocoa and the Ruby 1.8.5. So for simplicity, I just provided the project folder for XCode. If you can build it then you can probably run it.
</p>
iPhone2007-07-01T00:00:00+00:00http://vazexqi.github.com/2007/07/01/iphone<p>
<img src="http://farm2.static.flickr.com/1042/690089960_9dd9d96e5e_m.jpg" />
</p>
<p>
The iPhone was released at an opportune time. I was already waiting for something to replace my Razr. I was generally happy with my Razr (as I am with most electronic devices with the exception of a computer running Windows Vista <i>but that is a story for another time</i>). Probably because I read the manual before using it, I usually know what I am doing; thus, nothing disastrous has happened. This is rather miraculous since the Razr has one of the worst user interfaces out there. This applies to Motorola phones in general and is attested by many other people including friends from the Human Computer Interaction group.
</p>
<p>
However, I was also waiting for something more user friendly. It was almost impossible to use my phone for any other thing except for calling and basic SMS. Some would say that this is sufficient and yes if those are your needs then indeed it is sufficient. Nonetheless, with the current technology, I believe that there is something more that you can actually do with your phone. And that there is a way to do it without making things more complicated than they need to be. That is where the iPhone comes in.
</p>
<p>
Initially I was reluctant on getting one. After all, it is pretty expensive. And I already had a fully functional iPod that I am very happy with. However, after watching the videos (I did not even bother actually testing one hands-on when I was at the shop since I had confidence that it would work as advertised - a faith that is currently only bestowed upon Apple products) I was convinced that it would be a useful gadget to acquire; that it would make my life easier just like acquiring an secondary external monitor or the Griffin elevator.
</p>
<p>
The only thing that I am worried about is the customer service from AT&T. My previous carrier was T-Mobile and I had great experiences with their customer service. They were always friendly and provided real assistance without wasting my time or making things harder than they need be. I had heard terrible tales of bad customer service from AT&T and I was worried that I would have to suffer through that for the duration of my contract - two years mind you! I finally convinced myself that since AT&T is Apple's partner in this, it should not be too bad lest they want to face the wrath of every Apple fanboy out there ; )
</p>
<p>
On the day the iPhone launched, I tried to just casually go to the sole AT&T store that was carrying the device in my area. Needless to say, such optimistic actions were met with a line that was 50 people strong! I was last in line and did not manage to get the phone on its launch day. Surprisingly, the people who were first in line were not CS or ECE graduate students - something that you would expect from a campus town. Instead they were middle-age people who did not seem like the crowd that the iPhone would appeal to. Furthermore, these middle-age people were not just there to <i>take a look</i>; they came, they saw, they bought! One each. Amazing.
</p>
<p>
Fortunately, I happened to be going down to Chicago the next day and could grab one from the Apple Store off North Michigan Avenue. I was in and out in 10 minutes without any hassle. I even manage to start the activation process using the wireless connection offered in the Apple Store. And, surprisingly, I ran into very few problems activating my phone. I was even able to port my number over from T-Mobile. Calling AT&T was also surprisingly pleasant. They answered my calls professionally even in the midst of all the chaos that the iPhone has rippled.
</p>
<p>
I believe that the iPhone will actually change the way that other cell phones are created. Like my girlfriend said, this is one device that you will <i>have</i> to refer by name: "I am going to make a call on my iPhone" <b>not</b> "I am going to make a call on my cell phone". <i>Now that is product loyalty</i>.</p>
Debugging Tree Grammars in ANTLRWorks2007-06-14T00:00:00+00:00http://vazexqi.github.com/2007/06/14/debugging-tree-grammars-in-antlrworks<p>
The current version of <a href="http://www.antlr.org/works" title="ANTLRWorks: The ANTLR GUI Development Environment">ANTLRWorks</a> does not support tree grammar debugging directly. However, there is a way to get it to work using remote debugging. The <a href="http://www.antlr.org/wiki/pages/viewpage.action?pageId=1977" title="How do I broadcast debug events to multiple listeners? - ANTLR 3 - ANTLR Project">ANTLR FAQ for debugging</a> has some information on setting up remote debugging but it does not show the remaining steps for tree debugging.
</p>
<p>
<div style="background: #000000; color: #ffffff">
<pre>
<font color="#fcf305"> 1 </font><font color="#ff80ff">import</font> java.io.*;
<font color="#fcf305"> 2 </font><font color="#ff80ff">import</font> org.antlr.runtime.*;
<font color="#fcf305"> 3 </font><font color="#ff80ff">import</font> org.antlr.runtime.tree.*;
<font color="#fcf305"> 4 </font><font color="#ff80ff">import</font> org.antlr.runtime.debug.*;
<font color="#fcf305"> 5 </font>
<font color="#fcf305"> 6 </font><font color="#80a0ff">/*</font>
<font color="#fcf305"> 7 </font><font color="#80a0ff">Sample file that shows how to connect to AntlrWorks</font>
<font color="#fcf305"> 8 </font>
<font color="#fcf305"> 9 </font><font color="#80a0ff">Remember to change the following to suit your own project</font>
<font color="#fcf305">10 </font><font color="#80a0ff"> - XMLGrammarLexer</font>
<font color="#fcf305">11 </font><font color="#80a0ff"> - XMLGrammarParser</font>
<font color="#fcf305">12 </font><font color="#80a0ff"> - XMLTree</font>
<font color="#fcf305">13 </font>
<font color="#fcf305">14 </font><font color="#80a0ff">*/</font>
<font color="#fcf305">15 </font>
<font color="#fcf305">16 </font><font color="#60ff60"><b>public</b></font> <font color="#60ff60"><b>class</b></font> TreeTest {
<font color="#fcf305">17 </font>
<font color="#fcf305">18 </font> <font color="#60ff60"><b>public</b></font> <font color="#60ff60"><b>static</b></font> <font color="#60ff60"><b>void</b></font> main(String args[]) <font color="#60ff60"><b>throws</b></font> Exception {
<font color="#fcf305">19 </font> CharStream input = <font color="#ffff60"><b>new</b></font> ANTLRFileStream(args[<font color="#ffa0a0">0</font>]);
<font color="#fcf305">20 </font> XMLGrammarLexer lex = <font color="#ffff60"><b>new</b></font> XMLGrammarLexer(input);
<font color="#fcf305">21 </font>
<font color="#fcf305">22 </font> <font color="#80a0ff">// MODIFY: change document to the root rule </font>
<font color="#fcf305">23 </font> ParseTreeBuilder builder = <font color="#ffff60"><b>new</b></font> ParseTreeBuilder(<font color="#ffa0a0">"document"</font>);
<font color="#fcf305">24 </font>
<font color="#fcf305">25 </font> <font color="#80a0ff">// create a debug socket proxy to ANTLRWorks</font>
<font color="#fcf305">26 </font> <font color="#80a0ff">// MODIFY: change the name of the grammar file</font>
<font color="#fcf305">27 </font> DebugEventSocketProxy AW = <font color="#ffff60"><b>new</b></font> DebugEventSocketProxy(<font color="#ffa0a0">"/Users/vazexqi/Antlr/handGeneratedXMLGrammar/XMLTree.g"</font>);
<font color="#fcf305">28 </font> AW.handshake();
<font color="#fcf305">29 </font>
<font color="#fcf305">30 </font> DebugEventHub hub = <font color="#ffff60"><b>new</b></font> DebugEventHub(builder, AW);
<font color="#fcf305">31 </font>
<font color="#fcf305">32 </font> CommonTokenStream tokens = <font color="#ffff60"><b>new</b></font> CommonTokenStream(lex);
<font color="#fcf305">33 </font> XMLGrammarParser parser = <font color="#ffff60"><b>new</b></font> XMLGrammarParser(tokens);
<font color="#fcf305">34 </font> XMLGrammarParser.document_return root = parser.document();
<font color="#fcf305">35 </font>
<font color="#fcf305">36 </font> CommonTreeNodeStream nodes = <font color="#ffff60"><b>new</b></font> CommonTreeNodeStream((Tree)root.tree);
<font color="#fcf305">37 </font> XMLTree walker = <font color="#ffff60"><b>new</b></font> XMLTree(nodes, hub);
<font color="#fcf305">38 </font> <font color="#ffff60"><b>try</b></font> {
<font color="#fcf305">39 </font> <font color="#80a0ff">// MODIFY: change to the rule that you want to follow</font>
<font color="#fcf305">40 </font> walker.document();
<font color="#fcf305">41 </font> } <font color="#ffff60"><b>catch</b></font> (RecognitionException e) {
<font color="#fcf305">42 </font> e.printStackTrace();
<font color="#fcf305">43 </font> }
<font color="#fcf305">44 </font>
<font color="#fcf305">45 </font> }
<font color="#fcf305">46 </font>}
</pre>
</div>
</p>
<p>
The original file is available from <a href="/files/TreeTest.java">here</a>.
</p>
<p>And when you generate the relevant files for your grammar, you must use the <code>- debug </code> option as such:
<pre>
<code>
java org.antlr.Tool XMLGrammar.g
java org.antlr.Tool -debug XMLTree.g
</code>
</pre>
Notice that you should not use the <code>-debug</code> option for the normal grammar file (the one that contains the parser/lexer). If you use the <code>- debug</code> option then it will try to debug the XMLGrammar.g file <em>in addition</em> to the XMLTree.g file and cause this error:
<pre>
<code>
error(10): internal error: org.antlr.runtime.debug.DebugParser.reportError(DebugParser.java:88): java.net.BindException: Address already in use
</code>
</pre>
</p>
<p>
Compile the necessary java files and run the program using <code>java TestTree someFile</code>. Then in ANTLRWorks, select Debugger > Debug Remote....
</p>
Meta-Object Protocol implementation for programming languages2007-05-23T00:00:00+00:00http://vazexqi.github.com/2007/05/23/meta-object-protocol-implementation-for-programming-languages<p>
The past week I had the opportunity to play around with <a href="http://groovy.codehaus.org/">Groovy</a>. Groovy is an "agile dynamic language for the Java Platform". In short, you can think of Groovy as adding dynamic features to the Java language with some syntactic sugar to the Java syntax. Like <a href="http://jruby.codehaus.org/">JRuby</a> and <a href="http://www.jython.org/Project/index.html">Jython</a>, Groovy runs on the JVM and plays well with Java code.
</p>
<p>Groovy offers functionality similar to that of Ruby, Python and other dynamic languages. Of course, Groovy has its own way of doing things but some of the most interesting things that I have seen are: </p>
<ul>
<li>Integrated support for XML processing <i>directly</i> via <a href="groovy.codehaus.org/GPath">GPath</a> (akin to XPath)</li>
<li>Support for <a href="http://en.wikipedia.org/wiki/Multiple_dispatch">multimethods</a>. The <i>type</i> of an object is determined at run-time. This leads to the interesting behavior that even if you write <code>Object foo = "Hello"</code>, foo actually has the type <code>String</code> instead of <code>Object</code>.</li>
<li>Option to declare the type for variables. Though not required, you have the option of declaring the static type of an object. The only other system that I have seen that offers this option is <a href="http://www.strongtalk.org/">Strongtalk</a>.</li>
</ul>
<p>
While Groovy is certainly an interesting and useful language (personally, any language that reduces the verbosity of Java is <b>useful</b>), what is more interesting is the way in which the dynamic features are done. Groovy relies on an internal implementation of the <a href="http://en.wikipedia.org/wiki/Metaobject">Metaobject Protocol</a>. As far as I know, the term <i>Metaobject Protocol</i> was first made popular in the book <a href="http://books.google.com/books?id=3X5Gnudn3k0C&pg=PP1&ots=Zp8zmKv1bR&dq=The+Art+of+the+Metaobject+Protocol&sig=_Od_XIOKiLknUkeV6ZlbAJAzSoU"><i>The Art of the Metaobject Protocol</i></a>. You can read more about this concept from any of the previous links but in a nutshell, designing a programming language so that it conforms to some Metaobject Protocol is a <i>good</i> thing. It allows the programmer (and not only the designer) to change the semantics of the language so that it can not only modify the current features of the language but also incorporate <i>new</i> features easily.
</p>
<p>
This might seem like an absurd thing to do if you are used to programming in more traditional languages like C which does not even offer the ability for <a href="http://en.wikipedia.org/wiki/Reflection_%28computer_science%29">reflection</a>. However, the ability for actually modifying the programming language itself is becoming more useful. Modifying does not only mean adding some form of syntactic sugar on top of the existing language but also the ability to add <i>new</i> features to the programming language itself. For instance, the <code>foreach</code> control structure could be viewed as some form of syntactic sugar. <code>foreach</code> could be easily implemented as a macro that is expanded before execution into the normal <code>for</code> loop or <code>while</code> loop. On the other hand, adding object-oriented features on top of a "non-object-oriented" language would be viewed as adding a new feature (and not just syntactic sugar) to the language itself. This was what was done with <a href="http://en.wikipedia.org/wiki/Common_Lisp_Object_System">CLOS</a> in Lisp.
</p>
<p>
One could always argue that there is no need for such a feature to be an inherent part of the programming language. A valid argument against implementing something like the Metaobject Protocol is the issue of speed and performance. Having the infrastructure to modify the behavior of the programming language is going to have some form of overhead on the execution of the program. Furthermore, the ability to change the programming language would lead to problems with a proliferation of different versions of the same programming language with subtle differences. Moreover, one might also argue that if a feature is that important, why not just add it in the next version of the programming language. That is exactly the case with Java and C#; newer editions keep adding features to the language.
</p>
<p>
While those arguments are certainly valid, the ability to be able to modify the semantics of the programming language should not be discounted. As computers get faster, the speed overhead from having the Metaobject Protocol built-in to the language is negligible save for the most performance intensive machines. And how many people actually want to wait for the designers of the programming language to add some new feature? The desired feature might not be important for everyone and might not be added to the core of the language. Should that be a reason why it is not there if your application actually requires it? For instance, as the ability to express domain knowledge clearly in programming languages become more important, more and more forms of domain-specific languages are surfacing. These domain-specific languages provide a concise way to express essential concepts of the domain which might otherwise be hidden through the syntax and semantics of a traditional programming language. No sane programming language designer is going to design multiple domain languages and give them multiple names such as C-Telecommmunication, C-Accounting, C-Transactions<sup><a href="#fn1">1</a></sup>.
</p>
<p>
While the idea of having a full-fledged Metaobject Protocol might be too idealistic for some, some of the newer ideas in the software engineering world are taking advantage of a more moderate form of it. The designers of programming languages can certainly vary the degree of dynamic behavior. For instance, Ruby does not have a fully modifiable underlying semantics but it does provide <i>enough</i> for programmers to accomplish most of what needs to be done.
</p>
<p>
In conclusion, I feel that more and more languages would incorporate some form of the Metaobject protocol. Dynamic languages are becoming increasingly prominent in the software engineering world today and the logical next step would be to expand on their dynamic behavior to improve on the extensibility<sup><a href="#fn2">2</a></sup>. It should be possible for <b>both</b> programming language designers and programmers to modify and/or features to the programming language in a hygienic way without resorting to ugly hacks.
</p>
<small>
For an example use of the Metaobject Protocol in Groovy, take a look at <a href="http://www-128.ibm.com/developerworks/java/library/j-pg09205/"> Pratically Groovy: Of MOPs and mini-languages</a>.
</small>
<hr />
<p id="fn1"><sup>1</sup> An alternative would be to design your own language from scratch if it is simple enough. Tools like <a href="http://www.antlr.org/">Antlr</a> and even <a href="http://fsl.cs.uiuc.edu/index.php/K:_a_Rewrite-based_Framework_for_Modular_Language_Design%2C_Semantics%2C_Analysis_and_Implementation">Maude</a> have made this process less painful. Even then, designing a language from scratch -- albeit being fun -- requires a lot more devotion than modifying an existing language. </p>
<p id="fn2"><sup>2</sup> Some features might also be extremely hard if not impossible to add to an exiting system whether or not it has an Metaobject Protocol. For instance, (I think) having the ability to do <a href="http://www.cs.rice.edu/~taha/MSP/">multi-stage programming</a> might require extensive changes to the language itself and is not accomplishable with just some hacking on the language itself. </p>
Joyent Slingshot2007-05-10T00:00:00+00:00http://vazexqi.github.com/2007/05/10/joyent-slingshot<p><a href="http://developers.joyent.com/">Joyent Slingshot</a>:
</p>
<blockquote cite="http://developers.joyent.com/" title="Joyent Slingshot"> "Joyent Slingshot allows developers to deploy Rails applications that work both online and offline (with synchronization), and with drag/drop into and out of the application as in a standard desktop application. For a high level overview of the design goals and the basic idea behind Slingshot, head over to Joyeur to read in more detail about what we're trying to do."
</blockquote>
<p>(Via <a href="http://www.rubyinside.com/joyent-slingshot-10-make-your-rails-app-work-offline-484.html">Ruby Inside</a>.)</p>
<p>
Joyent really sounds like a fascinating technology. I am going to take a look at it over the summer to see if it is stable enough to use for deployment. I plan to update the grading application for the class that I was a teaching assistant for. While the grading application still works fine, it is not user friendly when the number of students increase. Right now grading can be a pain especially when there are a lot of students.
</p>
<p>
The ability to actually run it as a desktop application might motivate the moderators to grade their students on time. The interface is going to be the same but I guess the ability to have it function as a desktop application might make it seem more usable.
</p>
<p>
I have been reading an interesting article called <a href="http://worrydream.com/MagicInk/">Magic Ink: Information Software and Graphical Interface</a> and I am interested in seeing what better user interface I can come up with for the grading application. Maybe it is time to use some of the Ajax stuff that Rails supports.
</p>
Changing the way programmers program2007-04-09T00:00:00+00:00http://vazexqi.github.com/2007/04/09/changing-the-way-programmers-program<p>
I was fortunate enough to attend a very interesting talk by Professor Brad Myers of Carnegie Mellon University on the topic of <a href="http://webtools.uiuc.edu/calendar/Calendar?ACTION=VIEW_EVENT&calId=994&skinId=47&DATE=4/9/2007&eventId=43546">natural programming</a>. Natural programming is a broad term and there can be a lot of spurious claims about what is <i>natural</i> so Myers actually narrows what the term means by using user studies on programmers. By doing so, he was able to actually observer the real behavior of programmers instead of naively relying on what intuition might say otherwise.
</p>
<p>
Myers managed to cover a lot of ground (it is a shame that the lecture was not recorded but fortunately a lot of the topics he touched on can be found at the CMU HCI! <a href="http://www.hcii.cmu.edu/">website</a>). Here are some of my thoughts on some topics which really intrigued me. Hopefully I provide enough context so that people who did not go to the talk can actually understand what I am trying to say.
</p>
<p>
<ul>
<li><b>User studies</b> Myers's group did not waste time trying to come up with sophisticated tools to record how programmers work. They did not create some heavy-weight plugin for the IDE. Instead, they used a video recorded and/or a screen capture device. This leads to a lot of data that has to be analyzed but at least <i>everything</i> is captured. I think that in such studies, it is really important to record everything that the user is doing. Contrast this to using your own recording plug-in tool. Your tool probably records what you are interested in only (meaning your tool is probably biased) and ignores the rest. Therefore, you are not able to truly observer the real behavior of the programmers. The downside of using the video capture tool would be the sheer amount of man power that is required to analyze and distill the information.</li>
<li><b>Starting small</b> A lot of people were skeptical of the results shown in the lecture. Most of the examples have been done using what some would call a toy environment. For instance, there was a demo of WHYLINE using the <a href="http://www.alice.org/">Alice</a> environment. The results of the WHYLINE was pretty impressive but there were a lot of questions on whether the results would be beneficial to a <i>real</i> programming environment. First of all, it is pretty important to realize that something like this has never been done before. So there is no data to suggest whether this will succeed or fail. The only way to find out is to construct a system to test it. When you are doing research in uncharted territory, you usually start small and then build up on your previous results. I believe that it is important to realize the importance of the paradigm shift brought upon by Myers research. His WHYLINE approach might not extend directly to other programming environments but at least he has shown that there exists viable alternatives to how we have been debugging for the previous decades. </li>
<li><b>Improving the text editor</b>. The text editor in most IDEs are really abysmal. They only support the most minimal of word editing operations. I really like the clustering idea that Myers presented (he did not actually use the term <i>clustering</i> but I feel that it is a suitable term). Programming activities seldom involve just one file. Usually it involves reading a couple of files and making small changes to them. There are at least two things that makes this form of editing complicated in current IDEs. First, it is very hard to locate the relevant files because there might not be direct dependencies between the files. For instance, most functionalities of a program are scattered across multiples files that might not exist in the same form (some parts could be documentation files, some configuration files, some files that are in different languages). Second, once you do locate the relevant files, how do you keep the relation between those files clear. For instance, how can you <i>tell</i> or <i>record</i> in your IDE that those files are related so that the next time you work on a similar task, you would like your IDE to show those related files again and more importantly remind you of what the relation between those files were.</li>
</ul>
</p>
<p>
HCI is a broad topic and not everything about it interests me. There are certain parts of it that strike me as being too vague but there are other parts like improving the programming environment that seem really interesting and doable. The topic of natural programming is becoming more important because (based on the data Myers showed) in the next couple of years, everyone who uses a computer will undoubtedly be doing some form of programming no matter how simple.
</p>
<p>
The computer has become powerful enough that it will be able to support a lot of things that people did not think were possible many years ago. It is visionary research like this that will help us make full use of future computers. I'll definitely be monitoring what Myers's group can come up with next.
</p>
Updated to Typo 4.12007-03-19T00:00:00+00:00http://vazexqi.github.com/2007/03/19/updated-to-typo-4-1<p>
I just updated to Typo 4.1 today. It seems to have fixed the theme issues that I was having. Either way I just defaulted to using the <i>scribbish</i> theme until there is a compliant theme for Typo 4.1.
</p>
<p>
Typo 4.2 is going to be out in the next couple of months. One feature that I look forward to is the support for multiple blogs with a single Typo instance. Hopefully the developers add the ability to easily merge existing blogs into one single instance. You can read about the rest of planned features <a href="http://fredericdevillamil.com/articles/2007/03/10/typo-4-1-in-the-house">here</a>.
</p>
Better performance from Java IDEs2007-03-17T00:00:00+00:00http://vazexqi.github.com/2007/03/17/better-performance-from-java-ides<p>
I have been using <a href="http://www.eclipse.org/">Eclipse</a> as my primary Java IDE for some time now. I like most of the features that it offers. However, to get the best performance you have to forgo everything you know about <i>low memory requirement</i> software. Eclipse is not one of those. In fact it is a memory hog.
</p>
<p>
In fact, if you just use Eclipse straight out the box, you are probably going to feel that is the most sluggish IDE around. This sluggishness is not limited to Eclipse only though (more on this below). So, to get the best performance, you have to weak the settings for the amount of memory that it uses to counteract the effects of Java's garbage collection.
</p>
<p>
In OS X, you want to hunt for the file <code>eclipse.ini</code>. You can find this file in <code>Eclipse.app/Contents/MacOS/eclipse.ini</code>. To get to that folder, you need to right-click on Eclipse and select "Show Package Contents". Find the lines that read -Xms<some_number> and -Xmx<some_number>. The former number represents the minimum heap space size and the latter refers to the maximum heap space size. Change the numbers to something more <i>reasonable</i> like 256 for the minimum memory and 512 for maximum memory. If you run Eclipse now you will <b>feel</b> the difference.</p>
<p>
Just a couple of days ago, I downloaded <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a> touted as the most <i>intelligent</i> Java IDE. Well, it does live up to its name. The error and warning messages convey clearer meanings compared to the ones in Eclipse. However, using it out-of-the-box was a bit of an experience. IntelliJ IDEA has a very conservative initial heap space allocation - a meager 32MB. That is definitely not enough. After a couple of minutes of using IntelliJ, it was already doing its garbage collection!
</p>
<p>
So, it is time to tweak the VM. In OS X, hunt for the file <code>IntelliJ IDEA <some_version>.app/Contents/MacOS/info.plist</code>. <code>info.plist</code> is a XML file that you can open in a text editor. Look for near the end of the file for the <code>VMOptions</code> key and change its string value to something like <a href="http://piotrga.wordpress.com/2006/12/12/intellij-and-garbage-collection/">this</a>. Unix and Windows users can refer to <a href="http://confluence.atlassian.com/display/DOC/Allocate+more+memory+to+IDEA">this page</a> to get the location of the configuration file.
</p>
<p>
Note that the developers of IntelliJ also agree that the default memory settings are not always the best for your larger projects. Therefore, they have also posted an >a href="http://blogs.jetbrains.com/idea/2006/04/configuring-intellij-idea-vm-options/">article</a> on their blog that details the settings that they use. An important fact that they point out is that allocating a lot of RAM to IntelliJ is not always the best choice since the garbage collector might have to potentially free up a whole bunch of stuff all at once.
</p>
<p>
IntelliJ has a lot of non-commercial plug-ins available but the <i>better</i> and more complicated ones are usually commercial. These commercial plug-ins can cost more than an academic license for IntelliJ. Their exorbitant cost is one good reason why I will still have to use Eclipse for certain tasks. Another reason is the total number of plug-ins: Eclipse has <i>way</i> more plug-ins than IntelliJ. The last time I checked, there were <a href="http://www.eclipseplugincentral.com/">827 plug-ins</a> for Eclipse and <a href="http://plugins.intellij.net/">370 plug-ins</a> for IntelliJ. That is more than twice the amount so if you are looking for a plugin for some language you are more likely to find as an Eclipse plug-in.
</p>
Path Finder 4.6 review2007-03-13T00:00:00+00:00http://vazexqi.github.com/2007/03/13/path-finder-4-6-review<p>
I have been using <a href="http://www.cocoatech.com/pf4/">Cocoatech's PathFinder</a> for a couple of days now. PathFinder is a viable replacement for Apple's Finder. There are some features that make it really compelling as an <i>addition</i> to Apple's Finder. I used both of them side-by-side. I like the normal Finder for its simplicity especially when I am just browsing around. If I need to do more complicated stuff I will switch over to Path Finder.</p>
<p>
Here are some things that I really like about Path Finder:
<ul>
<li><b>Tab sessions</b>. The ability to save a bunch of tabs that I frequently use is very useful. For instance when I am installing a unix program, I like to have /usr/local, /usr/local/src, etc. within easy reach. With the normal Finder, I would need to open multiple windows and I might accidentally close one of them.</li>
<li><b>Folder history</b>. The ability to quickly click on a list of most recently viewed folders is really useful. After all, when I view a folder a few hours ago, I am likely to view it again soon.</li>
<li><b>Navigation/location bar</b>. This bar shows the path to the current folder so that you can quickly navigate to the parent folder. I have used this countless times.</li>
<li><b>No .DS_Store files</b>. I think .DS_Store files are the most notorious things ever created. Every folder just gets littered with them. And worst of it, they show up when you zip your folders as well. Thank goodness Path Finder does not use them.</li>
<li><b>Spotlight</b>. I like the Path Finder's interface for searching better than Apple's Finder. It lets me see the parameters clearly before searching and it does not search as I type. Having the search window pop-up separately is also a better design in my opinion. </li>
</ul>
</p>
<p>
And here are some things that I <i>vehemently</i> hate about it:
<ul>
<li><b>Ugly desktop</b>. If you try to show Path Finder's desktop, it looks really ugly. I have been trying to tweak it but it still looks really nasty. The words have weird shadows that make them look fuzzy against my desktop. I tried to reproduce the default Finder desktop look but it was not possible.</li>
<li><b>Extraneous and redundant frameworks</b>. Path Finder includes its own previewer, text editor , terminal and StuffIt framework. All of them are redundant especially the StuffIt framework that comes in at a hefty 12 MB of pure uselessness. It does not replace StuffIt for me! I still need to use SmithMicro's <a href="http://www.stuffit.com/mac/index.html">StuffIt</a> or go to the command line (to use unrar) to open password protected .rar files! I still do most of my terminal work in iTerm and seldom use terminal that comes with Path Finder. Moreover, the terminal with Path Finder does not respect my color settings for iTerm or the terminal. In short, all these frameworks that come bundled are all redundant! Imagine if everyone developer did the same thing and bundled redundant frameworks into their applications!</li>
<li><b>Speed</b>. Path Finder is slow for certain operations. For instance, trying to view a folder that contains a whole bunch of image files takes a while since it needs to generate the preview. Apple's Finder is still faster.</li>
</ul>
</p>
<p>
Bottom line, Path Finder would be better if they trimmed some fat of it. It should perform its task as a file manager and do it well. All the other frills can be handled by other more well-suited applications.
</p>
Typo theme is not working2007-03-10T00:00:00+00:00http://vazexqi.github.com/2007/03/10/typo-theme-is-not-working<p>
The theme for Typo is not working correctly. I am not sure what is wrong. I have tried selecting different themes (even trying the defaults ones: Azure and Scribbish) but to no avail. I have even tried reinstalling Typo but that does not work also. I am using Typo 4.03 and I am not using the unstable versions from Typo trunk so I am really not sure what is going on. It just stopped working one day. I don't think the upgrade to Rails 1.2 broke anything since my other blog at softwarengineering.vazexqi.com is still working fine.
</p>
Two new gadgets added to my collection2007-03-10T00:00:00+00:00http://vazexqi.github.com/2007/03/10/two-new-gadgets-added-to-my-collection<p>
I received the <a href="http://www.griffintechnology.com/products/elevator/">Griffin Elevator</a> for my birthday recently and it has been one of the most useful tools that I have owned. I only regret not buying it earlier. The <i>Elevator</i> has positioned my laptop to a more comfortable position for viewing whenever I am at my desktop. After a few months of using tea boxes (yes they do work!) to elevate my laptop to a more comfortable level, the <i>Elevator</i> is definitely a better alternative. I can finally see the screen of the laptop without having to hunch over. More importantly, it also leaves the bottom of the laptop exposed so the heat can be dissipated more easily.
</p>
<p>
The second gadget that I got was a natural keyboard from Microsoft - the <a href="http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=043">Natural Ergonomic Keyboard 4000</a>. The side closest to the typist is elevated which makes it look a bit funny but it looks pretty cool nonetheless. I have always been skeptical about the usefulness of natural keyboards. However, I have recently been suffering some pains in my wrists recently and I was wiling to try a natural keyboard to see if it would help. I have been using this keyboard for a few hours now and I can testify that I <b>cannot</b> type properly! My finger positions are all wrong and I need some time getting used to this keyboard. Fortunately, I am picking up the habits of proper typing - I am finally using the little fingers for typing instead of letting it dangle aimlessly while I type. Only time will tell whether this keyboard will help lessen or eliminate the pain in my wrists.
</p>
Sessions in vim2007-02-23T00:00:00+00:00http://vazexqi.github.com/2007/02/23/sessions-in-vim<p>
I have not been updating this blog much this couple of weeks because I have not discovered anything particularly interesting. However, today I have discovered something interesting about text editing, especially in Vim.
</p>
<p>
For those of you who have not read <a href="http://www.moolenaar.net/habits.html"><i>Seven Habits of Effective Text Editing</i></a>, you can always check out the <a href="http://video.google.com/videoplay?docid=2538831956647446078">video</a> that shows the newer features in Vim 7 for effective text editing. It was nice to see the creator of Vim talk about it passionately (but not being insular to alternative text editors like Emacs). He has good tips for using Vim effectively but the concepts can be extended to whatever decent editor you are using. Sometimes all you need is just Notepad but there are times when something more powerful is necessary.
</p>
<p>
Sometime during the talk he mentioned about one of the most interesting feature for Vim that I never knew existed: sessions! If you have used the latest version of Firefox then you have a basic idea of what sessions are. When you quite your browser and then reopen it, it will restore all the windows and tabs that were open. Those windows are tabs make up your browsing session. Being able to store this session is really convenient. A lot of times I had to edit a whole bunch of files together and it would be to good to "remember" those files and the buffers.
</p>
<p>
Fortunately, Vim has that. You can read more of it in the manual in Vim itself(:h sessions) or this online <a href="http://www.vim.org/htmldoc/usr_21.html#21.4">version</a>. Basically it boils down to setting the layout, opening the files that you need and then executing <code>:mksession someSession.vim</code>. That command saves the session in the file someSession.vim in the current working directly (you can see the current directly by typing <code>:pwd</code>). Then you can restore this session using <code>:source someSession.vim</code> from within Vim or using <code>vim -S someSessions.vim</code> from the command line. Really convenient!
</p>
<p>
But you do not need to use sessions just for remembering the files that were open. You can use a session as a template. There might be a particular layout that you like to use. For instance, having the explorer bar open on the left side of the screen. You can store this setting in a session and then open it when you want to work.
</p>
<p>
Another related feature is the view feature. Like sessions, views remember the settings for windows but it only does so the current one. I am not sure how useful views would be but the feature is there for those who need it.
</p>
<p>
If only other editors (<i>hint</i>...Textmate) out there supported something like this.
</p>
Smalltalk and native widgets2007-01-23T00:00:00+00:00http://vazexqi.github.com/2007/01/23/smalltalk-and-native-widgets<p>
A product that I have just recently discovered is <a href="http://ambrai.com/index.html">Ambrai Smalltalk</a>. With Ambrai, you now have the option of developing using Smalltalk and interfacing with native OSX widgets. It even <a href="http://ambrai.com/smalltalk/tutorials/tutorial2/index.html">supports</a> .nib files from Interface Builder. This is another option to consider if you want to develop in Smalltalk and still have native widgets for OS X. If you want to develop in Smalltalk but do not care about native widgets, then there is always <a href="http://www.squeak.org">Squeak</a>.
</p>
<hr />
<p>
What's the importance of native widgets? I have always been a fan of native widgets for desktop applications. I have never really been a fan of Java for creating native applications. Sure, the Eclipse IDE has a pretty decent --in fact it is one of the few that look decent. However, the Eclipse look is not for every product. For instance, The Azureus bit torrent client uses the same widget as Eclipse -- the SWT -- and yet it is an eyesore whenever I see it. The rest of the other IDEs like Komodo that use Java for cross platform compatibility really look very bad. The buttons look out of place and the widgets just do not blend in.
</p>
<a href="http://www.i-cherubini.it/mauro/blog/uploads/images/ss_Komodo_rails_large.gif"><img src="http://www.i-cherubini.it/mauro/blog/uploads/images/ss_Komodo_rails_large.gif" width="508" height="420"/></a>
<br />
<small>The Komodo IDE with its squarish tabs and unpolished icons. When viewed in isolation it does not look too bad; but when viewed in the context of the other applications running on OS X, it is garishly out of place.</small>
<br />
<br />
<a href="http://stormwolf.pwp.blueyonder.co.uk/fings/proxyjail/azureus1.png"><img src="http://stormwolf.pwp.blueyonder.co.uk/fings/proxyjail/azureus1.png" width="384" height="295"/></a>
<br />
<small>The Azureus BitTorrent client on OS X. Again, the icons do not feel like part of OS X.</small>
<br />
<br />
<p>
Most people usually do not care but I happen to be very particular about such things. Without a decent UI, I feel that the product is incomplete. I am reluctant to use that product because it feels so different from the rest of my desktop. For instance, I did not use Firefox until there was a way to make the buttons and form elements on the webpage look like the default on OS X. I found it extremely hideous to look at the squarish dark grey buttons on web pages whenever I used Firefox. Thank goodness for the native intel builds with aqua form widgets from<a href="http://www.beatnikpad.com/archives/2007/01/06/firefox-2001"> beatnikpad</a>.
</p>
<p>
However, it is not completely necessary in all cases to have native widgets. For instance, the Eclipse IDE is something that seems to blend in well with OS X. Custom images that serve as navigation cues (tabs, links, images, etc) on web pages can have their own distinct look and still not feel out of place.
</p>
<p>
Interestingly, the contrast between native widgets and non-native widgets seem to be most apparent on OS X. On Windows and Linux, I hardly ever notice the different if an application is using the native Windows form or native linux widgets (whatever that might refer to). I guess there is this discordance of user interface on the other systems that it becomes commonplace to have everything look like they don't belong. And because they do not look like they belong, they actually do not affect you much when you look at them.
</p>
iPhone2007-01-10T00:00:00+00:00http://vazexqi.github.com/2007/01/10/iphone<p><a href="http://www.time.com/time/nation/article/0,8599,1575410-2,00.html">Apple's New Calling: The iPhone -- Tuesday, Jan. 09, 2007 -- Page 2 -- TIME</a>:
</p>
<blockquote cite="http://www.time.com/time/nation/article/0,8599,1575410-2,00.html" title="Apple's New Calling: The iPhone -- Tuesday, Jan. 09, 2007 -- Page 2 -- TIME"> "Because there's no intermediary input device like a mouse or a keyboard there's a powerful illusion that you're physically handling data with your fingers. You can pinch an image with two fingers and make it smaller."
</blockquote>
<p>(Via <a href="http://project.ioni.st/post/1005#post-1005">Projectionist: A tumbleblog</a>.)</p>
<p>
I was actually expecting some announcement about Mac OS X 10.5 Leopard during yesterday's Macworld Conference. Unfortunately, the spotlight seems to be taken by the iPhone and Apple TV. I do not see myself getting the iPhone just yet. It's too expensive, has a touch screen that is probably going to have smudges all over and, I believe, requires a service plan (most probably the higher end ones) with Cingular.
</p>
<p>
However, what is more interesting about the iPhone is the multi-touch display. Most tablet PCs out there today only support interaction via the stylus. This is good. You do not want your fingers to interfere with the process of writing. However, for some tasks, using the stylus is no better than using a mouse in the first place. For instance, for drag-and-drop, the gesture for the stylus resembles using the mouse.
</p>
<p>
With multi-touch display, however, you get more interaction. Like the TIMES article says, you should be able to "pinch" with two fingers and have the image shrink. No more having to point at the corner of the picture and drag. This opens a new world of interaction. HCI enthusiasts should begin analyzing and researching new idioms and metaphors for such interactions.
</p>
<p>
If you have seen the <a href="http://honeybrown.ca/Pubs/BumpTop.html">BumpTop</a> videos, you will notice that it is more suited for use with a multi-touch display rather than a conventional tablet.
</p>
<p>
So, for me, the iPhone itself is not that revolutionary: integrated music player, cell-phone and smart-phone. It's the multi-touch screen that will be interesting in the long run. And it will be nice to see what else can be done with the multi-touch screen for normal computers and laptops.
</p>
First car!2007-01-10T00:00:00+00:00http://vazexqi.github.com/2007/01/10/first-car<a href="http://flickr.com/photos/desireux/sets/72157594470728208/"><img src="/files/vox.jpg" /></a>
<p>
Volkswagen Passat GLX 2001.
</p>
Getting the gist through to students2007-01-05T00:00:00+00:00http://vazexqi.github.com/2007/01/05/getting-the-gist-through-to-students<p>There is an interesting paper by Prof. Michael Loui, Prof. Craig Zilles and J.T. Longino entitled <a href="http://www-faculty.cs.uiuc.edu/~zilles/papers/logic_misconceptions.asee2006.pdf"><em>Student Misconceptions in an Introductory Logic Design Course.</em></a>. It's pretty short -- 12 pages -- but it covers a lot of ground. It shows that there are indeed concepts in Logic Design that most students miss. In fact, I will admit, that there are some concepts that I missed when I took that course as an undergraduate.</p>
<p>While the paper does describe and analyze some misconceptions that students have, I felt that the main reason that some students do not get Logic Design is because they become overwhelmed by the homework. I remember having lots of homework for the ECE class that I took and it took a lot of time to complete them. Even after completing them and having them handed back, sometimes I was not really sure whether my answer was the best approach to solving the problem. While answers are provided for those homework questions, we did not always go through the <em>process</em> of coming up with those answers. We will see the step-by-step solution by there was no justification why that method was chosen (or how that method was synthesized). It would have been better if the lecturer went through some of the harder problems and show how to solve it. Preferably, this would be a live session with pen and transparencies over the projector. It would be even better if it could be recorded so the student can replay this later when they were revising.</p>
<p>Lecturers should seriously avoid doing too much hand-waving while solving those problems. I have found that class with a lot of hand-waving are the most frustrating classes that I have taken. Classes that utilize only PowerPoint slides also tend to be less interesting that those that use normal chalkboard or even transparencies. It is important that each step for approaching the problem domain is properly articulated for the new students.</p>
<p>From my own experience, sometimes, the homework problems seem so repetitious. There was no mention of the motivation for doing those homework problems. Sometimes it was more of doing it for the sake of doing it. The lab component was particularly useless since it focused more on how to use the tool (click, drag, type) instead of showing why people would use those tools. And those tools were too cumbersome to be used for most problems.</p>
<p>For the programming course that I am teaching, I try to motivate deeper understanding by asking students how they approach the problem. It does not matter if the approach is simplistic or naive-- what is important is that the approach works. Getting a working program is important because it forces you to actually get all the details in. It is simple to have a high-level overview of the solution but until you implement it, a lot of details can be easily overlooked. In discussion section, we would then discuss the merits of each approach. I usually have my own solution which I would use as the base for comparison purposes. Students then get another week to make improvements to their program following the discussion that we had. I have found that </p>
<p>I discourage complicated solutions that utilize a lot of heavyweight frameworks or libraries. I made the assignment so that they can be easily solved using basic C/C++/Java knowledge from a prior 100 or 200 level course. Using frameworks hides a lot of the implementation details and makes for a rather terse discussion section. Unless other students are familiar with the framework, what they say will not make sense to the other students. I believe that if you understand the basics, using any framework will be almost trivial (except for those that require proprietary components which must be purchased separately). </p>
<p>I also try to make the examples more motivating that a typical machine problem. Machine problems tend to be really boring. They usually focus on only one concept and do not require much thinking on the part of the student. Some of the machine problems are also either hit-or-miss: meaning that they only have one solution. That hinders students from trying to experiment with their own solutions. Instead, they are more concerned if their solution is the <em>right</em> solution. My machine problems tend to involve lots of visual feedback: images, graphics, interaction. This is based on my own motivation for doing computer science: so that I can create all those cool programs like games, applications, etc. Without this intrinsic motivation, students are less likely to have fun doing the machine problems. I have yet to hear students from other classes calling their machine problems fun.</p>
<p>I realize that it is easier to make programming classes more fun that Logic Design. After all, a lot of the jargon that we use -- XML, Object-Oriented Design, GUI, etc. -- have become rather common parlance for most computer-savvy kids. And there is an abundance of open-source projects where students can actually contribute and draw examples from. But for Logic Design, concepts like duality, Karnaugh Maps, sum-of-products are less well-known. More effort has to be to be taken to motivate the importance of such concepts. It is a shame that there are few open source projects on Logic Design (I might be wrong on this but I have to find anything called logicdesignfourge.net as compared to sourceforge.net</p>
Rubyfication of Raise Manager2007-01-03T00:00:00+00:00http://vazexqi.github.com/2007/01/03/rubyfication-of-raise-manager<p>
I spent a couple of hours transforming the RaiseMan application from <a href="http://www.bignerdranch.com/products/cocoa1.shtml"><i>Cocoa Programming for Mac OS X (2nd Edition)</i></a>. In the RubyCocoa examples folder, there is a version of this but it is based on the first edition of the book. My version includes key-value-binding, undo and redo and also alert panels. I also implemented some of the end-of-chapter exercises that I felt were useful. I skipped the part on Localization though.
</p>
<p>
Rereading the book makes me think of how much I do not like it. There is very little rationale behind each of the examples. Most of the time, the author just says do this or that. And his anecdotes are pretty annoying (I am not sure where he got his stories from). I felt that the book could have been better if the author spent more time explaining why things are done that way instead of listing the API and describing what it does (it's almost identical to the documentation).
</p>
<p>
Things actually made more sense to me this time around because I was exposed to some design patterns and could see the rationale behind the way of doing things. I am not sure if a beginning programmer would appreciate the way of doings things just from reading this book. I have heard better things about <a href="http://www.cocoaprogramming.net/"><i>Cocoa Programming</i></a> but that book is old and has not been updated. I have not read that book yet so I cannot offer my opinions on it.
</p>
<p>
Anyway, here are somethings I learned from this effort that may be useful to people:
<ul>
<li>Before starting, you should read this <a href="http://rubycocoa.sourceforge.net/doc/programming.en.html">page</a> on RubyCocoa to get acquainted with the conventions. You can choose to use <code>somemethodwithargument0_withargument1_withargument2(arg0,arg1,arg2)</code> or <code> somemethodwithargument0(arg0, :withargument1, arg1, :withargument2, arg2) </code>. Once you have decided on one, it is best to stick with it.</li>
<li>Since you cannot drag-and-drop your MyClass.h (we don't have one, we only have MyClass.rb) into Interface Builder to get it to update any new ib_outlets, you need to do this by hand. The easiest way I can think of is to click on the "Classes" tab on the nib file, locate your MyClass and right click to add actions or outlets. That being said, Interface Builder is pretty good for creating user interfaces. The separation between code and user interface is pretty clean and it is not too hard to get things to work the way you want it to.</li>
<li>For key-value-binding to work on an array, use <code>kvc_array_accessor</code>. For an example, look at my <b>MyDocument.rb</b> file. More information on key-value-bindings can be found in <b>oc_import.rb</b> in the RubyCocoa source.</li>
<li>Always, always, always, build and run regularly. There is virtually no good debugging support for RubyCocoa. Sometimes the error message can tell you which file (and in the optimistic case, which line the error occurred at). But in general, it is going to be cryptic. By testing early and frequently, you can at least narrow the error down to the last edit that you made.</li>
<li>Remember to qualify your ib_outlets when you used them with the '@' symbol. For instance, if you have <code>ib_outlet :some_object</code> then in your methods, you refer to that object as <code>@some_object</code>. I am not sure why I keep forgetting this but it has been the cause of many problems.</li>
<li>Remember to always prefix Cocoa classes with <code>OSX::</code>. You can avoid this by using <code>include OSX</code>. Also be careful that you check the spelling for the Cocoa classes (you need the NS prefix, etc). Misspellings have bitten me quite a few times.</li>
<li>Read <b>oc_attachment.rb</b> in the RubyCocoa source code to find out how you can use Ruby idioms like [], []=, etc for accessing arrays and dictionaries. Also decide if you want to use those notations or just stick with <code>objectForKey(), etc.</code></li>
<li>There are some idiosyncrasies with <code>OSX::NSRunAlertPanel</code>. You cannot do Ruby string substitution in the arguments. If you need string substitution, you can do it using the special @ symbol as such: <code>choice = OSX::NSRunAlertPanel("Delete", "Do you want to delete %@ records?","Delete","Cancel",nil, selected.size). </code> <br />
</li>
</ul>
</p>
<p>
One problem that I had was that I was not able to build it for release. I had to build it for debug. I think there could be something wrong with the way the project is setup. Anyway, the file is available from <a href="/files/RubyRaiseMan.tgz">here</a>.
</p>
<p>
<b>Update:</b> I just installed RubyCocoa 0.9 from Subversion. Instructions can be found <a href="http://rubycocoa.sourceforge.net/doc/unstable/">here</a>. I can now successfully built it as a universal binary. The next test I did was to run this RaiseManager application. I was greeted by a successful build... but the application could not create new employees. The error logs report that there is something wrong with the NSUndoManager but I suspect that it has something to do with key-bindings since there is supposed to be some change to how that is done in RubyCocoa 0.9. I will have to take a look at that. On the bright side, RubyCocoa is approaching the 1.0 mark after so many years!
</p>
<p>
<b>Update (Jan 3, 2007):</b> The latest version from the Subversion repository has addressed the issues that I reported above. The current working version (revision 1325) was checked in today by Laurent. Suffice to say that there are major additions from RubyCocoa 0.5 that are worth checking out. It would be good to see how RubyCocoa plays with the new Objective-C 2.0 that is included with Leopard. On a side-note, there is a new Ruby/Objective-C bridge out by Tim Burks <a href="http://www.rubyobjc.com/">here</a>. </p>
Refactoring-aware XML configuration files2006-12-30T00:00:00+00:00http://vazexqi.github.com/2006/12/30/refactoring-aware-xml-configuration-files<p>Lots of Java frameworks rely on configuration files to function. These configuration files are usually written in XML (which I still strongly believe is <b>not</b> human <em>writable</em>). Whilst the IDE usually provides nice auto-completion features for these configuration files, it is not able to reflect refactoring changes made to the Java source files. For instance, if the XML file refers to <code>com.vazexqi.sample.Class</code> and I rename it to <code>com.vazexqi.sample.Class2</code>, the XML file is not updated. I wish to study the feasibility of adding refactoring awareness for these configuration files in the Eclipse IDE. For starters, I will try to hack around with the <a href="http://tools.hibernate.org/">Hibernate Tools</a> plugin.</p>
<p>In case anyone is interested in following along, here are some of the steps that I have taken to get started.</p>
<h4>Getting Hibernate Tools</h4>
<p>I use the Help > <em>Find and Install...</em> feature in Eclipse to install Hibernate Tools. The site URL for Hibernate Tools is http://download.jboss.org/jbosside/updates/development/. There is nothing there for your web browser to load; it contains a site.xml for Eclipse to discover new features. Over the past few days I have had some trouble accessing the site so be patient if you cannot reach it as well. There are three major dependencies that Hibernate Tools has: Visual Editor, Eclipse Modeling Framework and Web Tools Platform (WTP). When you first try to install Hibernate Tools, it will warn you of those dependencies. So you will need to go grab the relevant plugins first. The three of them are listed under Callisto Discovery Site. After installing Hibernate Tools, it is a good idea to find out what features its XML editor provides. I followed the <a href="http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html">tutorial</a> on the <a href="http://www.hibernate.org/152.html">Hibernate</a> website.</p>
<p>There is no need to grab JBoss Eclipse IDE, just Hibernate Tools will do.</p>
<p>The XML editor is based on the one from the WPT plug-in. The original WTP XML editor supports completion based on the XML schema (either DTD or XSD; I don't think it supports <a href="http://relaxng.org/">RELAX NG</a>). Hibernate Tool extends it so that it supports completion for Java class names for the relevant attributes in a XML tag. Completion is suggested via the normal key sequence: CTRL + space.</p>
<p>I played around with Hibernate to discover what features the XML editor supports. This will help me when I need to hack it into submission.</p>
<h4>Getting Hibernate Tool source code</h4>
<p>To ensure that the version of Hibernate Tools you installed does not interfere with the source code when testing, you should disable it. The easiest way to do so, is to go to Help > <em>Manage Configuration</em> and select Hibernate Tools from the list on the left hand side of the screen. Click disable. You should be prompted to restart Eclipse. When you restart Eclipse, it will no longer load Hibernate Tools. If you need to load it again, you can always follow the steps again but this time select "enable" for Hibernate Tools. You need to select the third icon from on the toolbar to see the disabled plugins. </p>
<p>To start hacking away you need to get the source code from the JBoss CVS repository. There are some instructions <a href="http://www.hibernate.org/268.html">here</a>.</p>
<p>I used a slightly different route. I switched to the CVS Repository Exploring view and browsed the CVS repository at anoncvs.forge.jboss.com:/cvsroot/jboss. I then selected the following packages (individually) from HEAD/jbosside:
<ul>
<li>org.jboss.ide.eclipse.freemarker.feature</li>
<li>org.hibernate.eclipse.updatesite</li>
<li>org.hibernate.eclipse.test.feature</li>
<li>org.hibernate.eclipse.releng</li>
<li>org.hibernate.eclipse.feature</li>
<li>org.jboss.ide.eclipse.freemarker</li>
<li>org.hibernate.eclipse.mapper</li>
<li>org.hibernate.eclipse.jdt.ui</li>
<li>org.hibernate.eclipse.jdt.apt.ui</li>
<li>org.hibernate.eclipse.help</li>
<li>org.hibernate.eclipse.console.test</li>
<li>org.hibernate.eclipse.console</li>
<li>org.hibernate.eclipse</li>
</ul>
</p>
<p>The freemaker packages are not really required but without it I get some configuration errors when I run Hibernate Tools and try to manage it with Help > <em>Manage Configurations</em>.</p>
<p>At this stage, you should be able to run the packages above as a single Eclipse application. Make sure that the WPT plug-ins are enabled since there is a dependency for it.</p>
<p>Over the next few days I will be looking at the source code and seeing how Hibernate Tools offer completion for Java class names. From here I will try to find out how the information is embedded (it cannot be in the DTD or XML schema since that form has to remain compatible with other applications that use it). Next, I will try to register the plugin to receive notifications whenever a refactoring (rename, move, pull-up, etc) has been done and modify the referenced Java classes in the XML file.</p>
<p>Hopefully after this I will get a better idea on how to develop a general framework that will allow support for different types of configuration files.</p>
ri/fastri with rubygems2006-12-24T00:00:00+00:00http://vazexqi.github.com/2006/12/24/ri-fastri-with-rubygems<p>
For some time, I was not able to get <code>ri</code> to read the documentation for the gems that I have installed. There seems to be multiple ways of doing this. I found this <a href="http://atomgiant.com/articles/2006/6">site</a> that gives details on the common ways. Some gems are kind enough to automatically install the documentation files by themselves. This makes it possible for <code>ri</code> to detect the documentation for that gem without any further configuration. However, the gems I am most interested in --the Rails gems-- do not do so automatically.</p>
<p>
The simplest way to get documentation for <b>all</b> your gems is to run <code>sudo gem rdoc --all</code>. Though this is the simplest method, it is also the one that is most fragile. When you run that command, it <b>must</b> finish the process of generating all the documentation for all your gems. A rogue gem that is improperly configured can mess the entire process up. I discovered this the hard way: the terminal would echo the fact that the documentation for the relevant Rails gems (activesupport, activerecord, etc) have been generated but because there was a failure toward the end, none of them were accessible. Most people will be able to run this command just fine and get the documentation for all the gems. However, when it fails, you can try the method below.
</p>
<p>
What I am proposing is a more conservative route for generating the documentation: Generate the documentation for each gem on a as-needed-basis. If the gem can automatically generate the documentation for you then you need not run this step at all. For most people, all they need is the documentation for Rails. And if you are using TextMate, having the documentation detected by <code>ri</code> can be most <a href="http://pinds.com/articles/2005/11/14/rails-accessing-rails-documentation-from-textmate">convenient</a>.
</p>
<p>
Here is what I did. Open two terminal windows. On one do <code>gem list</code>. This gives you a list of all the gems that you have installed. On the other terminal window, do <code>sudo gem rdoc [name_of_gem]</code> where you replace <i>[name_of_gem]</i> with the gem that you are interested in. You can use wilcards such as <code>active*</code> to match activerecord and activesupport. Do this for the gems that you are interested in. This way you avoid generating redundant documentation for gems that are installed as dependencies for other gems.
</p>
<p>
Finally, if you are still using <code>ri</code>, you might want to take a look at <a href="http://eigenclass.org/hiki.rb?fastri+0.1.1"><b>fastri</b></a>. <code>fastri</code> is supposed to be much faster and more intelligent in its searching capabilities. If you are using <code>fastri</code>, you might need to rebuild the index for the server after generating the documentation. This can be done by running <code> fastri-server -b</code>.
</p>
RubyOSA2006-12-20T00:00:00+00:00http://vazexqi.github.com/2006/12/20/rubyosa<p>
RubyConf 2006 had a lot of interesting new ideas for Ruby. There is a nice summary of the main points <a href="http://www.infoq.com/news/how-many-rubies-future">here</a> on the InfoQ website. One feature that actually caught my eye was how Apple was taking part in RubyOSA.
</p>
<p><a href="http://blog.nicksieger.com/articles/2006/10/21/rubyconf-mac-os-x-and-ruby">RubyConf: Mac OS X and Ruby</a>:
</p>
<blockquote cite="http://blog.nicksieger.com/articles/2006/10/21/rubyconf-mac-os-x-and-ruby" title="RubyConf: Mac OS X and Ruby"> "RubyAEOSA is a Ruby wrapper for Apple events, that was started in 2001, but not active since 2003. The code required is unnecesarrily verbose. Instead, you could wrap and execute with AppleScript, but it's slower and limited by knowledge of AppleScript.
<br />
RubyOSA is a new project created by Apple, intended to be a successor to RubyAEOSA, under active development and used today. It has a much more Rubyish API, generating Ruby code on the fly and sending events lazily. Apple events are completely hidden."
</blockquote>
<p>This is an interesting thing for me because I have always wanted to interact more with the applications on OS X but I really do not like the syntax of AppleScript nor the tools that are provided to support it. </p>
<p>A side effect of this is the realization that Apple and other companies such as Sun and Microsoft have actually taken a very strong interest in the Ruby community. Java 6.0 is supposed to have scripting support built-in. However, seeing how the Mac version of Java always lacks behind its other counterparts, we probably will not be using much of this yet.</p>
<p>All the more why I should really try to do some research in this language. Since the idea of refactoring for Ruby is partially take by the <a href="http://rubyeclipse.sourceforge.net/">RDT</a> team, I might consider doing something in metaprogramming refactoring. That seems like a new field and should be interesting to venture into.</p>
RubyCocoa2006-12-20T00:00:00+00:00http://vazexqi.github.com/2006/12/20/rubycocoa<p>
Since I had some free time this week, I wanted to brush up on some Cocoa programming. However, I have not been using Objective-C for some time and would rather not have to program in it. Instead, I decided to use Ruby via the <a href="http://www.rubycocoa.com/">RubyCocoa</a>. I have always had great difficulties installing RubyCocoa on my machine. It never seems to <i>just work</i>. I recall getting version 0.4.3 to work somehow over Spring but the steps seem to elude me now.
</p>
<p>I tried searching on the web but there was no clear answer. Even the <a href="http://rubycocoa.sourceforge.net/doc/build.en.html">installation instructions</a> for RubyCocoa seems incomplete (and might even be auto-translated from the Japanese version). Anyway, I downloaded the source code for version 0.5 and follow the instructions to do <code>ruby install.rb config</code> and <code>ruby install.rb setup</code>. The installation failed -- it was not able to locate some of the symbols.</p>
<p>So I reread the instructions on the website. There was some mention of using Ruby 1.8.5. and I only had version 1.8.4 installed. Since Ruby 1.8.5 has been out for some time, I decided to upgrade my version. There are various discussions on what needs to be done to get Ruby 1.8.5 to compile on OS X but I stuck with the instructions from <a href="http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger">HiveLogic</a> and just substituted the latest version Ruby into the instructions. Everything works fine, even <a href="http://tiswww.case.edu/~chet/readline/rltop.html">readline</a>. I had to recompile <a href="http://rmagick.rubyforge.org/">RMagick</a> though since the links were broken after the upgrade. Some might also find the instructions <a href="http://wincent.com/knowledge-base/Building_and_installing_Ruby_1.8.5_on_Mac_OS_X_Tiger">here</a> useful for upgrading.</p>
<p>
I followed the steps on the RubyCocoa website and tried to build RubyCocoa. It still was not working. Then I realized something. I was actually issuing the following command: <code>sudo ruby install.rb config --build-universal</code>. I removed the build-universal just to try the <b>default</b> settings. And it WORKED! I am not sure how the developers themselves got the universal binary to build but it was not working on my machine. Right now, RubyCocoa is not a universal binary but that matters little. At least it is finally working.
</p>
<p>It's always the simple things that make life so complicated. It also shows that one should always try the default values for <code>configure</code>. After all this, I really think I should have just stuck with rereading some Objective-C. RubyCocoa is a very nice framework but it takes a lot of guess work to get it working. However, as a consolation, I finally got Ruby 1.8.5 installed.</p>
Latex and how to learn it2006-11-29T00:00:00+00:00http://vazexqi.github.com/2006/11/29/latex-and-how-to-learn-it<p>
I spent Thanksgiving break getting acquainted with Latex and its capabilities. I have heard good things about Latex and seen the documents produced using it so it was natural for me to be interested. I have been using a lot of HTML to write my blogs as well as some rather lengthy articles (<a href="http://www.cs.uiuc.edu/class/fa06/cs242/lectures/subversion.html">source control with subversion</a> and <a href="http://softwareengineering.vazexqi.com/files/pattern.html">convention over configuration</a>) meant for the web. However, HTML documents do not print too well. It is hard to add the margins, headers and footers and footnotes. Moreover, if I were to write anything with mathematical equations in it, Latex would be the <i>only</i> way to go. <i>Mathematica</i> is not bad but it is not free either.
</p>
<p>
Since I was already familiar with HTML, I wanted to find the best way to use that knowledge to get started with Latex. Unlike HTML which can be rendered in any browser, Latex needs to be installed. There are various installations out there but since I already had <a href="http://www.macports.org/">MacPorts</a> installed, I just issued a <code>sudo port install teTeX</code> command. Once I got that installed, I just tried compiling some examples to get things working. Some examples for testing can be found <a href="http://www.windowsdevcenter.com/lpt/a/4670">here</a>.
</p>
<p>
When starting with a new language, it is best to have a nice IDE with some convenient features. I remembered when I started with HTML I used to like Macromedia Dreamweaver before it became bloated. For Latex there are some visual editors (like word processors) out there but they do not have any obvious advantage compared to writing the commands by hand. After watching the Latex <a href="http://www.insidehighered.com/workplace/2005/11/30/tips">screencasts</a> for Textmate, I found that I like the features that it offers. So that is what I am using. <a href="http://www.xm1math.net/texmaker/">TexMaker</a> is a nice alternative if you want toolbars and all that. Having a proper editor makes editing and compiling easier. This is useful to have especially if you are tying out new commands.
</p>
<p>
After deciding on a editor, it is time to find some decent documentation. There are a lot of built-in commands in Latex in the default package that it can be overwhelming. What I look for in documentations are two things: a detailed reference that I can refer to when I need to get something unusual done and a quick guide that I can flip through to get things done. I found a couple. For detailed reference, I like the <a href="http://sarovar.org/download.php/120/ltxprimer-1.0.pdf">Latex Tutorial - A Primer</a> and <a href="http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf">The Not-So-Short Guide to Latex</a>. For quick reference and to get started I like the guide on <a href="http://en.wikibooks.org/wiki/LaTeX">Wikibooks</a> since it has well divided sections.
</p>
<p>
I will browse through the detailed documentation to get a rough idea of the features in the language. I might read some sections in-depth if they interest me. But generally, the idea is to get an overview of the features that are available and <i>what</i> those features are called. Knowing the terms for the features makes searching for them easier in the future.
</p>
<p>Also, don't forget that the local installation of TeTex also comes with documentation. The key to this is the command <code>tetex <i><some_package></i></code>. This is really useful if you want to lookup the documentation and examples on how to use certain packages.</p>
<p>
With all that setup, the best way to learn is now to experiment and use Latex for most of you writing tasks.
</p>
<p>
And finally, once you get into the hang of thing, you discover a few tools that you should have. One useful tool for reading dvi files (most of the local documentation for Latex are in .dvi) is <a href="http://www2.ing.unipi.it/~d9615/homepage/texniscope.html">TeXniscope</a>. For making bibliographies, nothing beats <a href="http://bibdesk.sourceforge.net/">BibDesk</a>. And finally, if you need to embed math equations into presentations, <a href="http://ktd.club.fr/programmation/latexit.php">LaTeXiT</a> is very useful.
</p>
<p>
There is still a lot that I need to learn about Latex but at least what I have here can hopefully help other get started. Latex is not for everything. I use Word less and less but when I need to have a paper written, I write the text in Word to get the benefit of its grammar checker. And even with the excellent and professional <a href="http://latex-beamer.sourceforge.net/">Beamer</a> package for Latex, using Keynote for creating presentations is still much easier.
</p>
Weasel Words2006-11-10T00:00:00+00:00http://vazexqi.github.com/2006/11/10/weasel-words<p>
While reading about <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect-Oriented Programming</a> on Wikipedia, I came across an interesting term toward the end of the article: weasel words. Being someone who just likes word plays such as this, I decided to visit the link.
</p>
<p><a href="http://en.wikipedia.org/wiki/Wikipedia:Avoid_weasel_words">Wikipedia:Avoid weasel words - Wikipedia, the free encyclopedia</a>:
</p>
<blockquote cite="http://en.wikipedia.org/wiki/Wikipedia:Avoid_weasel_words" title="Wikipedia:Avoid weasel words - Wikipedia, the free encyclopedia"> "Weasel words are words or phrases that seemingly support statements without attributing opinions to verifiable sources. Weasel words give the force of authority to a statement without letting the reader decide if the source of the opinion is reliable. If a statement can't stand on its own without weasel words, it lacks neutral point of view; either a source for the statement should be found, or the statement should be removed."
</blockquote>
<p>
What is interesting is the list of examples of is that most of us actually use such innocuous phrases when we are trying to write objective and unbiased articles. I know that I have been guilty of phrases such as "clearly...", "it is believed that...", "experts say...".
</p>
<p>
However, while avoiding weasel words are important, I think that sometimes they are a good addition to an article. It is almost impossible to be unbiased when you are writing an article. Usually you write an article because you have some strong opinions on it. Thus, your opinion is going to be reflected in that article. Indeed, that is what makes some articles better to read than others. Your tone of voice and the choice of words used speaks to the reader and draws him or her into the writing.
</p>
<p>
Of course, regardless of whether we are writing for an encyclopedia or for our web blog, we should always be careful of weasel words. Using too many of them makes for unclear articles that are hard to follow. In fact, some of the weasel words listed in the article are so common that we even forget that we are using one. Even readers might easily gloss over those words as mere phrases that join sentence together (there must be a term for these kind of words but I can't seem to remember it). On the other hand, trying to stay away from them also makes for articles that are too dry and boring to read. A proper balance is hard to achieve but as long as you are trying to be unpretentious in your writing then it should work out well.
</p>
Testing trackback in Typo2006-10-31T00:00:00+00:00http://vazexqi.github.com/2006/10/31/testing-trackback-in-typo<p>
I am going to refer to my post at <a href="http://softwareengineering.vazexqi.com/articles/trackback/44">softwareengineering.vazexqi.com</a> and see if Typo successfully sends the trackback to the article.
</p>
<p>
Update: This works so I at least know that Typo is not broken. I was just curious to test out its trackback system since there is no field to put the trackback URI. Instead, Typo is supposed to automatically scan the articles that you write for Trackback URI and send a ping to them.
</p>
Ruby Manual Kernel-y2006-10-20T00:00:00+00:00http://vazexqi.github.com/2006/10/20/ruby-manual-kernel-y<p><a href="http://rubymanual.org/module/Kernel/y">Ruby Manual Kernel-y</a>:
</p>
<blockquote cite="http://rubymanual.org/module/Kernel/y" title="Ruby Manual Kernel-y"> "ryan: You know how Kernel.p is a really convenient way to dump ruby structures? The only downside is that it's not as legible as YAML.
<br />
_why: (listening)
<br />
ryan: I know you don't want to urinate all over your users' namespaces. But, on the other hand, convenience of dumping for debugging is, IMO, a big YAML use case.
<br />
_why: Go nuts! Have a pony parade!
<br />
ryan: Either way, I certainly will have a pony parade."
</blockquote>
<p>
I just found this out while browsing the methods in module Kernel in Ruby. In my opinion, this is not even funny. In fact, it is a very inconsiderate thing to do in terms of documentation.
</p>
Zune2006-10-18T00:00:00+00:00http://vazexqi.github.com/2006/10/18/zune<p><a href="http://msnbc.msn.com/id/15262121/site/newsweek/page/3/">Q&A: Jobs on iPod's Cultural Impact - Newsweek Technology - MSNBC.com</a>:
</p>
<blockquote cite="http://msnbc.msn.com/id/15262121/site/newsweek/page/3/" title="Q&A: Jobs on iPod's Cultural Impact - Newsweek Technology - MSNBC.com"> "In a word, no. I've seen the demonstrations on the Internet about how you can find another person using a Zune and give them a song they can play three times. It takes forever. By the time you've gone through all that, the girl's got up and left! You're much better off to take one of your earbuds out and put it in her ear. Then you're connected with about two feet of headphone cable."
</blockquote>
<p>You gotta respect Steve Jobs. With just that one sentence, he has made Zune's main marketing tactic (the ability to share songs wirelessly) sound pathetic. Now anyone who had originally planned to get a Zune will be reminded of this sentence every time they try to send a song to the girl sitting next to them.</p>
smcFanControl2006-10-18T00:00:00+00:00http://vazexqi.github.com/2006/10/18/smcfancontrol<a href="http://www.flickr.com/photos/vazexqi/273390445/" title="Photo Sharing"><img src="http://static.flickr.com/110/273390445_99ea58a583_o.png" width="349" height="263" alt="smcFanControl" /></a>
<p>
<a href="http://www.conscius.de/~eidac/software/page5/page5.html">smcFanControl</a> is a useful little app that enables you to change the fan speeds on your MacBook (Pro). But just setting the speed on both fans to 3000 rpm, the internal temperature of my MacBook Pro dropped by 20 Celcius. Now it is comfortable enough to touch. There spinning fans are barely audible.
</p>
<p>
As usual with tweaks such as this, you should be aware of how it might affect your computer. I don't see any real harm in speeding the fans up, but it might shorten their life-span in the future. On the other hand, you also begin to wonder how much damage might come about from having a computer that is constantly pushing the internal temperature close to 70 Celsius. So there is a tradeoff there. Personally, I think the fans can do a better job of withstanding the increase spinning compared to the long term effect of extreme heat on the machine.
</p>
Nested comments in PHP2006-10-18T00:00:00+00:00http://vazexqi.github.com/2006/10/18/nested-comments-in-php<a href="http://www.flickr.com/photos/vazexqi/273412195/" title="Photo Sharing"><img src="http://static.flickr.com/117/273412195_84b8bb219e_o.png" width="395" height="378" alt="Nested comments" /></a>
<p>
This article has two main reasons. The first is to show how to use the foreign key constraints on MySQL 5 and how to do a CASCADE DELETE and how to use PHP to display nested comments. The interesting thing here is that I do not do multiple SQL queries to fetch the children of each message. Instead, I retrieve all the comments for the page and rely on PHP to do the formating and sorting.
</p>
<p>
The second reason being that I want to see how resoureces work in Typo because this is a feature that I have not used before. I need to at least know if it is working before I start documenting on it. So I have uploaded the files that show how to design the sql tables and how to do the retrieval in PHP.
</p>
<p>
A subreason would be to try out writing this article from within Typo itself and see how well it goes.
</p>
<p>
Here are the files:
<ul>
<li><a href="/files/comments.html">comments.html</a>: the PHP file that shows how to connect to the database and retrieve the data. And then there is a function that recursively displays the messages in a nested manner.</li>
<li><a href="/files/data.html">data.html</a>: the SQL file that shows you how to set up the database in MySQL 5 to make use of referential integrity. It also populates some data into the table so that you can try it out.</li>
</ul>
</p>
<p>
Update: Here are my reactions (writing from within Marsedit)
</p>
<p>
The resources that are associated with this post, gets included as an attachment to the RSS feed for the post. This is kind of like an enclosure. Safari's RSS can detect this enclosure fine but the built-in reader in Flock just ignores it. Also, the resources do not appear in the page when viewing the article. So basically the attachment is only useful for RSS readers.
</p>
<p>
There is a weird UI bug. You can add additional resources that exists on the server (as attachments) to the post IF you have already associated at least one attachment to the article. If you have not associate any attachment, then you cannot attach an existing resource as an attachment.
</p>
GTD for programmers.2006-10-18T00:00:00+00:00http://vazexqi.github.com/2006/10/18/gtd-for-programmers<p><a href="http://www.43folders.com/2006/10/17/robert-peake-part-one/">Guest Post: DavidCo's Robert Peake on "Getting Software Done" (part 1) | 43 Folders</a>:
</p>
<blockquote cite="http://www.43folders.com/2006/10/17/robert-peake-part-one/" title="Guest Post: DavidCo's Robert Peake on "Getting Software Done" (part 1) | 43 Folderss"> "GTD in this way also provides the ultimate "safety net" for making sure stuff doesn't slip through the cracks. Sure, the act of programming in itself is highly linear: you run down the path until you have satisfied your test cases, then you move on to the next thing. However, in addition to bookmarking your progress along the path so that you can get right back to what's important after an interruption, GTD also gives you a complete, trusted inventory of all of the very next steps along all possible paths. Combined with an overall strategy (obviously), this means you can program with greater confidence and peace of mind - can run down the trail knowing it is the perfect trail for you to be running down at this moment - because you have scanned all the other options first, and know this course to be the best. Life, especially the life of a developer, is an open-ended, unknown tree. And the breadth-first approach of GTD is necessarily the most efficient option for traversing that tree."
</blockquote>
<p>
The above is an interesting read on how GTD might be applicable to programmers. The author is a programmer with a degree in poetry so that might explain his metaphorical examples.
</p>
<p>
Be sure to check out the <a href="http://www.43folders.com/2006/10/18/robert-peake-part-two/">second part</a> to this post that compares GTD to Extreme Programming.
</p>
Why some people avoid esoteric languages2006-10-11T00:00:00+00:00http://vazexqi.github.com/2006/10/11/why-some-people-avoid-esoteric-languages<p><a href="http://www.defmacro.org/ramblings/not-ready.html">defmacro - Why Exotic Languages Are Not Mainstream</a>:
</p>
<blockquote cite="http://www.defmacro.org/ramblings/not-ready.html" title="defmacro - Why Exotic Languages Are Not Mainstream"> "Haskell is an excellent programming language. It has features that allow for a tremendous productivity boost. Type inference figures out and lets you examine types of every piece of code that you write so you don't have to baby sit the compiler, yet you get the benefits of static typing. Functions are first class objects so you can build abstractions without writing useless glue code. The language is elegant and has plenty of syntactic sugar that makes it a pleasure to work with. It even has libraries for things you may want to do in a real world project. So why wouldn't you want to pick Haskell for your projects?"
</blockquote>
<p>
There are a <i>lot</i> of great programming languages out there. But having a great language alone will not be able to get people to program in it. There must be the tools to help you be productive in it. No matter how many lines of code savings you could potentially shave from a more expressive language, the returns are not going to be all that great if you have to invest the time to write your own libraries for common tasks. It's actually kind of like a catch-22: people cannot really start using the language unless there are good libraries for it; but libraries will not be written if they aren't enough people using it.
</p>
<p>
One of the reasons for Java's success was backing from Sun Microsystems. They had this incipient language out in 1995 when C++ was still reigning champ of programming languages. However, Java was quickly bundled with lots of libraries that worked together nicely. There was the GUI layer, the enterprise architecture, the sound, etc. At that time, none of the libraries was particularly mature yet but Java was able to entice people who were already were tired of trying to find out how to get different libraries to work together.
</p>
<p>
In the article by defmacro, he also lists another tool that is missing for esoteric languages: a good IDE. A normal text editor - as Vim and Emacs users will tell you - is sufficient for most tasks. But what happens when you need to write lots of code in different packages? Actually, Vim and Emacs are great because of the underlying unix tool support that is built-in. For instance, ctags and cscope really help make a project easier to navigate and Vim and Emacs have support for them. However, ctags and cscope do not support a lot of languages. For people who are spoilt with all the features from an IDE, using a normal text editor that just offers syntax highlighting is barely going to be fun.
</p>
<p>
It's hard to get people to abandon their mindset of what a development environment should be. Most people are already used to the idea of having a debugger, IDE, good reference and libraries at their fingertips for serious productions work. So, if esoteric languages want to really take off some of these things that people take for granted have to be offered first.
</p>
<p>
But then again, esoteric languages might not really want to take off. True, you can use Erlang and Haskell and Forth and ... in everyday situations but that might not be the original intentions of those languages. All I am saying is that certain languages were not created to be mainstream languages. They function well in their own little niche and the few people who use it are already happy with the tools that are provided.
</p>
Agile2006-10-07T00:00:00+00:00http://vazexqi.github.com/2006/10/07/agile<p><a href="http://steve-yegge.blogspot.com/2006/10/egomania-itself.html">Stevey's Blog Rants: Egomania Itself</a>:
</p>
<blockquote cite="http://steve-yegge.blogspot.com/2006/10/egomania-itself.html" title="Stevey's Blog Rants: Egomania Itself"> "How many 2-word anagrams of 'Agile Manifesto' do you think there are?
Guess what? There's exactly one: Egomania Itself"
</blockquote>
<p>
Don't get me wrong. I like Agile methods. I think they are better than the other heavy weight methods out there. But as Jeff Atwoods <a href="http://www.codinghorror.com/blog/archives/000694.html">mentions</a>, the real problem is not even about being agile; it's how to get people to stop using the Waterfall model. And even then, the waterfall model does work pretty well for small projects.
</p>
<p>
But as Steve Yegge has so very well pointed out, there is life outside of Agile.
</p>
Building Unix Squeak VM On Intel Mac2006-10-03T00:00:00+00:00http://vazexqi.github.com/2006/10/03/building-unix-squeak-vm-on-intel-mac<p><a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2006-March/000553.html">Building Unix Squeak VM On Intel Mac</a>:
</p>
<blockquote cite="http://lists.squeakfoundation.org/pipermail/vm-dev/2006-March/000553.html" title="Building Unix Squeak VM On Intel Mac"> "Untar the source, cd to Squeak-3.7-7/platforms/unix
<br />
config/configure --without-x (unless you want to fiddle with not found gl.h files in the X11 display lib)
<br />
vi vm-display-Quartz/sqUnixQuartz.m
<br />
change #define USE_SPINLOCK 1 to 0
<br />
make INTERP=interp
<br />
make INTERP=interp Squeak.app"
</blockquote>
<p>
Following the instructions above and grabbing the latest Squeak Unix source from <a href="http://www.squeakvm.org/unix/">here</a> since the one on the main Squeak site is outdated at 3.7.7, I successfully built and ran the virtual machine with the latest Squeak image. I have not profiled the sample code to see if there are significant gains but overall the user interface feels more snappy. I wished that I had done this earlier in the year when I had my MacBook Pro.
</p>
<a href="http://static.flickr.com/82/260380804_7704154791_o.png" rel="lightbox" title="Squeak 3.9"><img src="http://static.flickr.com/82/260380804_7704154791.jpg" width="500" height="375" alt="Squeak 3.9" /></a>
<p>
Well, some of my favorite packages are not really working yet so I am not sure how comfortable I will be in Squeak 3.9 instead of Squeak 3.8. The three packages that I like are:
<ul>
<li>Shout : for syntax coloring of code</li>
<li>Ecompletion : for code completion</li>
<li>Refactoring Browser : for refactoring support obviously</li>
</ul>
All three are available from the Squeak package loader but so far I have only gotten Ecompletion to work properly.
</p>
<p>
Update, the latest version of Squeak at the moment seems to be a universal binary. So there is no need to mess around with the compilation above. Besides, sound does not really work with the self compilation. So just grab the Squeak VM from <a href="http://ftp.squeak.org/current_stable/mac/Squeak%203.8.12beta4U.app.zip">here</a>.
</p>
Logitech MX revolution2006-09-30T00:00:00+00:00http://vazexqi.github.com/2006/09/30/logitech-mx-revolution<p>
Got a new mouse. It's supposed to be a really good mouse with the best scroll wheel out there. The reviews so far have been pretty good but nothing spectacular about it. And after a few hours of using it, I think I like it a lot too.
</p>
<img src="http://www.logitech.com/lang/images/0/12901.jpg" />
<p>
I have been using a Logitech mouse for some time now and it really feels comfortable in my hand. I had originally planned on buying a Apple Mighty Mouse but dropped the idea since it did not feel nice in my palm. The bluetooth connectivity and laser tracker were nice features in the Might Mouse but the shape was really horrible. It was hard to hold for longer periods and the tiny scroll "nipple" was too small to use properly. Moreover, the side buttons that were meant to be squeezed were not ergonomic at all.
</p>
<p>
There is another version of the revolution mouse: the VX revolution. That is supposed to be more portable since it is advertised as a laptop mouse. I tried it too but it felt too small to be gripped comfortably. So in the end I forked out $20 more for the MX revolution. No point in trying to save some money when the more expensive one feels so much better.
</p>
<p>
The only problem I had with this product is the configuration software that Logitech provided. It's the Logitech Control Center and it is a fine piece of <i>broken</i> software. It's previous version LCC2.0 worked fine for my Logitech keyboard but the current version LCC2.1 is a disaster. I cannot even open the keyboard configuration pane without the pane crashing on me. This is not an isolated case since other people have been <a href="http://forums.macrumors.com/showthread.php?t=227982">reporting</a> this problem too. To make matters worse, this control panel installs the APE application for OS X. If you want to use the mouse then you just have to bear with it. I really hate this but there is nothing that can be done since this mouse has very specific properties that only Logitech can configure.
</p>
<p>
Fortunately, there was not much that I needed to configure on the keyboard. For some of the smart buttons, I just edited the .plist file by hand and reloaded the keyboard driver. More information on how to do this can be found <a href="http://forums.macosxhints.com/showthread.php?t=23331">here</a>. Editing the .plist file by hand was really a fun thing to do. You never know when you will break the XML that the file uses.
</p>
<p>
Apart from the $100 price tag, this mouse is very usable. I like the fact that it comes with a charging station so I do not need to constantly be searching for batteries. Also, the buttons do not require a lot of force to activate. I would prefer if the mouse was less noisy (click, click, click) when scrolling in precision mode. This mouse offers two mode for scrolling: precision mode and free spin mode. In precision mode, it works just like a normal scroll mouse would. But in free spin mode, the scroll wheel disengages from the ratchet and scrolls really fast. The mouse is smart enough to detect when to change modes based on how fast you are moving the wheel. However, engaging and disengaging the ratchet makes loud click sounds that I felt should have been softer.
</p>
<p>
All in all, this mouse is nice and if you are planning to be in front of your computer for hours a day scrolling through long documents, you should consider getting one. And it is not that bulky that you cannot carry it around with you when you are on the go.
</p>
Vista on Parallels Desktop2006-09-22T00:00:00+00:00http://vazexqi.github.com/2006/09/22/vista-on-parallels-desktop<p>
It works! Nothing fancy. It's not that fast but fast enough for normal use. I got everything working: graphics, sound, network, mouse and keyboard. Installation was very simple and took less than 30 minutes with the default Parallels setting.
</p>
<a href="http://www.flickr.com/photos/vazexqi/247962939/" title="Photo Sharing"><img src="http://static.flickr.com/86/247962939_32d69c90e0.jpg" width="500" height="375" alt="Couple of program running in vista" /></a>
<p>
There is nothing really that revolutionary about the UI. At first you might be impressed by it but then you realize that there is nothing really that useful about it. Maybe the UI will look better once Parallels adds 3D graphics acceleration. Most programs that can be found in Windows XP are still in there only with different names. Almost every program now has the word "Windows" appended to it. For those who are in the know, my screenshot shows that I only have <a href="http://www.istartedsomething.com/20060919/vista-choose-own-adventure-ui/">Vista Basic</a> as the UI.
</p>
<p><a href="http://www.codinghorror.com/blog/archives/000683.html">Coding Horror: On Unnecessary Namespacing</a>:
</p>
<blockquote cite="http://www.codinghorror.com/blog/archives/000683.html" title="Coding Horror: On Unnecessary Namespacing"> "On Unnecessary Namespacing
Is it really necessary to qualify everything in Windows Vista with the 'Windows' namespace?"
</blockquote>
<p>
The biggest issue with it now: too many confirmation dialogs for simple tasks. I mean I am an admin, don't bug me with so many questions. And I cannot disable those dialog boxes as well. One pops up everytime you are going to install a driver, or change some network setting, etc. And knowing Microsoft, there is too much text on the dialog boxes. If you can read from the picture above, Windows Mail has a lengthy <i>introduction</i> to it with so much crap that I am not sure who reads it.
</p>
<p>
Maybe I will try installing some other software on Vista just to check how compatible it is.
</p>
<p>
Update:
I dragged the old server box I had and installed Vista on it as well. It scored a lowly 1 as its performance/compatibility with Vista. I am going to use it to try out Visual Studio 2005 and the .NET framework. And also to try out <a href="http://vistascript.net/vistascript/docuwiki/doku.php">Vista Smalltalk</a>. I am still very surprised why Vista needs a 128MB graphics card for Aero. Even OS X and XGL can do a good job with whatever graphics card the system has.
</p>
Javascript is really fun2006-09-22T00:00:00+00:00http://vazexqi.github.com/2006/09/22/javascript-is-really-fun<p>
I have tried to avoid doing Javascript for many years now. I know that it is a simple language. Heck, it was the first language I learned. But the main reason why I shun it was because of the incompatibility across browsers and the lack of a proper debugger.
</p>
<p>
Incompatibility across browsers is a big deal. The first time I did Javascript, there was only Netscape. So everything worked as planned. Then Internet Explorer came along and offered a better DOM. So I did some things in IE which did not work on Netscape. That was hell. Now, there are libraries out there like <a href="http://prototype.conio.net/">prototype</a> that makes some of the programming easier. Also, the standard has sort of settled down after the epic browser wars in the 90s. Even then I am sure that some bastard version of IE, Netscape or Opera will not be able to run my website.
</p>
<p>
The other reason I shunned Javascript was because of the lack of a debugger and proper IDE. I want to be able to inspect things on the web page and manipulate them. I don't want to have to remember the name of the div or span. I want to be able to mouse over each element and see some description of it. Come <a href="https://addons.mozilla.org/firefox/1843/">Firebug</a>. This makes all the difference.
</p>
<p>
If you want to use Safari, you can get the latest <a href="http://webkit.org/">nightly build</a>. It includes a DOM inspector as well. And it comes bundled with Drosera, the Javascript debugger. Folks with Opera might have to try something else. But who really cares about Opera? I mean a browser that cannot even handle: javascript:self.moveTo(0,0);self.resizeTo(1280,screen.availHeight); is probably broken in other ways too.
</p>
<p>
After the past foray with Javascript to get my grading application to do give more hints while grading, I think that Javascript is not really that bad. It's a prototype language after all and has all the dynamic nature that can make it useful. It's probably not going to be good for i/O but it is definitely handy when you want to manipulate stuff around in the website.
</p>
<p>
Since I am toying around with Javascript, I might as well go see what is going in the AJAX world and try my hands with that also. But why stop there? I should definitely come up with some website that has Javascript patterns. Javascript is a slightly different beast because it is pretty attached to the web browser. So when you talk about patterns it is probably going to be tied down to the DOM as well.
</p>
<p>
What I need now is a good source of reference for Javascript. AND. The compatibilities with different browsers.
</p>
Owner of new fish2006-09-18T00:00:00+00:00http://vazexqi.github.com/2006/09/18/owner-of-new-fish<p>
In an series of unlikely events, I am now the owner of 3 fish: two guppies and a algae eater and 2 water frogs. All 5 puny animals reside on a hexagon aquarium in the middle of the sitting room.
</p>
<a href="http://static.flickr.com/96/247147926_603401282d_o.jpg" rel="lightbox" title="Hex aquarium">
<img src="http://static.flickr.com/96/247147926_603401282d.jpg" alt="Hex aquarium"/>
</a>
<p>
You can find more pictures of these fish, if you are so inclined, <a href="http://flickr.com/photos/desireux/sets/72157594290353146/show/">here</a>.
</p>
<p>
What's really funny is that the "fish lady" at PetSmart strongly prohibited my girl friend from buying any fish larger than a quarter. She claims that the aquarium is much too small for anything larger than that. And 5 is like the upper limit on the number of aquatic creatures for that aquarium.
</p>
Installing Vim 7 on CSIL machines2006-09-17T00:00:00+00:00http://vazexqi.github.com/2006/09/17/installing-vim-7-on-csil-machines<p>
Vim 7 has been released for a few months but the machines in the CSIl labs here still have the older 6.3 version. Now, there is nothing wrong with version 6.3. Except that it does not have tabs, does not have built-in spelling checker, does not have that nice omni-complete feature and not to mention that it does not work well with my .vimrc file since I tuned it for version 7.
</p>
<p>
Here's what you need to do. This is not specific to the CSIL machines and should work with any linux installation.
<ol>
<li>Create a directory called downloads in your home directory using <code>mkdir download</code>
</li>
<li>Grab the latest vim source from <a href="ftp://ftp.vim.org/pub/vim/unix/vim-7.0.tar.bz2">here</a> and stick it into the download directory. Just use Firefox or Konqueror to browse to that site.</li>
<li>Untar the file by running <code>tar jxvf vim-7.0.tar.bz2</code></li>
<li>Do <code>cd vim70/src</code></li>
<li>You have to modify the Makefile a bit to get it to install in your home directory. Look for the line (around line 853) that has says "prefix = $(HOME)". Uncomment it. This will install Vim in folder /bin in your home directory,</li>
<li>Do <code>cd ..</code> to get back to the vim70 directory. Then do <br />
<code>
./configure <br />
make <br />
make install
</code>
</li>
<li>There should not be any errors and it takes less than 5 minutes to compile on the newer csil-core machines.</li>
<li>The final step is to get your newly installed version of Vim to run instead of the old one. Add the lines set path = ($path $HOME/bin ) to your .cshrc file. You can edit the .cshrc file by doing <code>cd ; vim .cshrc</code>
</li>
<li>Do <code>source .cshrc</code>.</li>
<li>Now you can type vim or gvim in the terminal and it will run the new Vim 7.0</li>
</ol>
</p>
<p>
Now that you have Vim 7.0 installed, go <a href="http://blog.vazexqi.com/articles/2006/05/03/vim-7-0">look</a> at what you can with it. Also, grab some color schemes from <a href="http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index.html">here</a> to make the syntax highlighting slightly nicer. Another good tool to have for code editing is the <a href="http://www.geocities.com/yegappan/taglist/installation.html">taglist</a> plugin</p>.
<a href="http://static.flickr.com/91/245912063_71095cfaf6_o.png" rel="lightbox" title="Taglist in action"><img src="http://static.flickr.com/91/245912063_71095cfaf6.jpg" width="500" height="314" alt="Taglist in vim" /></a>
Initial impression of iTunes 72006-09-13T00:00:00+00:00http://vazexqi.github.com/2006/09/13/initial-impression-of-itunes-7<p>
Weird user interface that we will all get used to <i>eventually</i>. iTunes is in a class of its own. The iPod tab is pretty hideous. And there is way too much reflection being used. I really don't think that all the eye candy was necessary. People with slower computers will just suffer from all that stuff. iTunes should be something that I can run in the background without taking too much RAM; I want to be able to listen to my music while I do my programming or photo editing. For a good article on this, read <a href="http://theappleblog.com/2006/09/12/itunes-wheres-my-ram/"><i>Where's My RAM?</i></a>.
</p>
<p>
I can really get used to the movies thing. Of course, I would prefer to rent than actually buying. But here is a scenario where something like this really useful: You are throwing party. And after dinner you have nothing planned yet. Then, while having dinner, one of your guests suggest that a movie might be interesting. You just head over to the iTunes store and grab that title. Half and hour later, after dinner, all of you can enjoy the movie.
</p>
<p>
Now, I just wish that I had a better quota for my internet downloads. My 1 GB quota is really not sufficient for a movie. Probably means that I have to go to some internet cafe first and grab that movie file.
</p>
Tutorial for Subversion2006-09-06T00:00:00+00:00http://vazexqi.github.com/2006/09/06/tutorial-for-subversion<p>
I just wrote a Subversion tutorial for my students. It's pretty much geared toward accessing the repository from the computer science labs here but the general ideas can be applied in other projects.
</p>
<p>
What I thought would be a simple task consumed almost 5 hours of my time as I performed each step by hand and captured the output. The entire things was done using textile first and then converted to HTML and formatted with CSS. Surprisingly, it's a decent length of nine pages. Apparently, <a href="http://www.flock.com">Flock</a> has some trouble printing the last page but Safari is fine with it. Hopefully someone identifies the problem. I ran it against the W3C HTMl validator and it passed fine.
</p>
<p>
You can view the tutorial <a href="http://www.cs.uiuc.edu/class/fa06/cs242/lectures/subversion.html">here</a>.
</p>
Refactoring support for the Eclipse2006-09-02T00:00:00+00:00http://vazexqi.github.com/2006/09/02/refactoring-support-for-the-eclipse<p>
It's amazing what results you can miss even if you search with Google. It's all a matter of what you are searching for. And which website you actually search for.
</p>
<p>
After some thought, I figured that it would be best to take a look at how the <a href="http://rubyeclipse.sourceforge.net/index.rdt.html">RDT: Ruby Development Tools</a> are doing. So far they are one of the few open source projects that are moving along pretty well. They have some nice integration with the Eclipse project. And like it or not, the Eclipse platform offers one of the better environments for developing IDEs if you do not wish to waste too much time designing a GUI and all that. There is some pain involved with using Java and all that , but Eclipse itself can help you write Java in a more productive fashion.
</p>
<p>
Anyway, <a href="http://sourceforge.net/mailarchive/message.php?msg_id=15369372">here</a> is the thread in point. If you click on the link, they do have a decent Trac website for it. I have not downloaded the project yet but it seems that there has not been much buzz generated about this project. There was nothing much on the mailing list. And I don't think it is a good idea to point this project out on the Ruby mailing list since it is their project and they decide what to do. I have downloaded their nightly .pdf file describing what they are doing. We shall see how much they have covered. The table of contents does seem to address some of the main issues that I am concern with. And they claim to have done the <i>Rename Local Variable</i> (this is not the same as the more general <i>Rename</i> that goes look for all occurrences and finds out which are safe to replace) and <i>Push Down Method</i>. They have a few other of the normal refactorings that Martin Fowler discusses in his book.
</p>
<p>
After reading a bit more, it seems that this was a term project for the students. It was to be a fourteen week project but they are going to take it further and do it as a diploma thesis. All in all, I am pretty impressed with this project. Here is a group of developers that are doing all the "best practices" of software engineering. They have a repository, bug tracking, milestones, auto-generated integration tests and lots of unit tests.
</p>
<p>
Well, if they have gotten a refactoring tool for Ruby, then it means that I probably have to find something else to do. That is one of the pitfalls of choosing an "in" language. Almost everyone would want to get a hand in it.
</p>
<p>
Anyway, I am going to check out the source code for the RDT into a new Eclipse workspace. Hopefully I remember enough of the Eclipse plug-in development paradigm to understand the code. I left all my Eclipse books back home when I went back for the summer. The nice thing this time though is that I can develop on my Macbook Pro. Enough RAM, plenty of hard disk space and a speedy processor. And of course, Java 1.5 is now working nicely on OS X.
</p>
Wireless printing2006-08-31T00:00:00+00:00http://vazexqi.github.com/2006/08/31/wireless-printing<p>
I decided to get a printer-scanner-copier combo -- something the stores call a multifunction machine. Since Best Buy had an offer on the <a href="http://www.usa.canon.com/consumer/controller?act=ModelDetailAct&fcategoryid=116&modelid=13368">Canon Pixma MP160</a> and it costs about $80, I thought that it was a good deal.
</p>
<p>
And the printer did not disappoint. I installed the drivers and was able to print wirelessly via my Aiport Express. The last time I bought an inkjet printer was almost 5 years ago. I can tell you now that the printing speed has increase dramatically. I printed a 13 page paper that I was supposed to review tonight in less than 5 minutes. I did not pay attention to the total time but it was not much slower than the laser printer in the dorms.
</p>
<p>
And the copier function is really useful. Not only can I use it without interfacing with the computer but I can also specify how many copies of each that I want. I can definitely save a few trips to the photocopier machines on campus.</p>
Refactoring Ruby2006-08-30T00:00:00+00:00http://vazexqi.github.com/2006/08/30/refactoring-ruby<p><a href="http://www.butunclebob.com/ArticleS.UncleBob.RefactoringParalysis">ArticleS.UncleBob.RefactoringParalysis</a>:
</p>
<blockquote cite="http://www.butunclebob.com/ArticleS.UncleBob.RefactoringParalysis" title="ArticleS.UncleBob.RefactoringParalysis"> "I've been working on on the Harry Potter problem in Ruby. I have a version that works, and now I'd like to refactor it. I'm using Text Mate as my 'ide'. I find myself in a state of paralysis. There I things I'd like to change, but I know the cost will be high, so I think and think about them instead of acting. This is not how I work in Java with IntelliJ. With IntelliJ I do my thinking by acting! I change variable names; I extract methods; I create and destroy base classes; in short I refactor madly. But in Ruby, without a good refactoring tool, I sit and stare at the code. I know what I have to do. I just have to break through the fear and start refactoring; and I will. But I was amazed at how intense the fear of changing code is when you don't have the appropriate tools. Jetbrains, or someone, you really have to make a refactoring tool for Ruby!!!"
</blockquote>
<p>
The only apparent project on refactoring for Ruby is <a href="http://www.kmc.gr.jp/proj/rrb/index-en.html">this</a>. And it has not been updated for almost a year. Moreover, it uses Emacs which probably means that everything has to be done using lisp macros.
</p>
<p>
That said, the idea of writing a refactoring browser for Ruby is pretty interesting. And one that I have been thinking of (but not trying to do yet) for almost a year. There aren't that many refactoring browsers for dynamically typed languages.
Smalltalk has one (and, mind you, was the first language to have <i>a</i> refactoring browser). </p>
<p>
So I am going to gather some more information on this subject and propose this as a master's thesis to Prof. Johnson. After all, being with at this university with the pioneers of refactoring means that there is definitely going to be a lot of people with enough experience. And there is always Don Robert's <a href="http://st-www.cs.uiuc.edu/~droberts/thesis.pdf">thesis</a> to help me get started.
</p>
<p>
I would also like to know the importance of a refactoring tool for a dynamic and agile language such as Ruby. All the latest refactoring tools concentrate on Java and C# both heavyweight languages in their own class. Last summer, I worked on <a href="http://www.eclipse.org/photran/">Photran</a>: A plug-in for Eclipse that supports the Fortran language and has some refactoring. Even though I did not work on the refactoring part, I can tell that it was really hard work. Even now, the parser for Fortran is not as fast as most people are used to.
</p>
<p>
Some possible problems I can definitely think of:
<ul>
<li>How to get at the syntax tree for Ruby. To make a refactoring browser, I would have to get hold of the syntax tree. I could scheme on this and make it be based on regular expressions but that would make it too rigid. Any slight variation in coding style would probably break it.</li>
<li>Which application to write it in? You have to write it in an application that people are already using. I know that a lot of people use Textmate and Emacs but both those editors do not provide any real tools to help in parsing the code.</li>
<li>What refactorings should be included? I mean there are a couple of standard options but what are the refactorings that most people use in Ruby? Are those refactorings going to be useful say for Rails?</li>
<li>Who would actually use this tool? Is there a market for this? You might argue that Smalltalk was never a major programming language. However, it was pretty big at the time the refactoring browser for it was being developed.</li>
<li>Smalltalk is a pure object-oriented language. Ruby allows you to write things without classes? Would this make a difference? I am not too sure. There is a C refactoring browser written by one of Prof. Johnson's students so refactoring for procedural languages is definitely possible.</li>
<li>Is this even doable for a master's thesis? I am definitely going to try to get into the Ph. D program but if I cannot, I want to make sure that this is doable.</li>
</ul>
</p>
<p>
By the way, there definitely is interest in refactoring Ruby on the web:
<ul>
<li><a href="http://jutopia.tirsen.com/articles/2005/10/18/refactoring-for-ruby-a-solution-to-the-first-component">Refactoring for Ruby: A solution to the first component?</a></li>
<li><a href="http://jutopia.tirsen.com/articles/2005/10/17/refactoring-for-ruby">Refactoring for Ruby</a></li>
<li><a href="http://dogbiscuit.org/mdub/weblog/Tech/Programming/Ruby/RubyMethodRenamed">Refactoring "Support" for Ruby</a></li>
</ul>
</p>
Parsing Ruby2006-08-30T00:00:00+00:00http://vazexqi.github.com/2006/08/30/parsing-ruby<p><a href="http://www.sapphiresteel.com/IntelliSense-and-Parsing-Ruby">SapphireSteel :: IntelliSense and Parsing Ruby</a>:
</p>
<blockquote cite="http://www.sapphiresteel.com/IntelliSense-and-Parsing-Ruby" title="SapphireSteel :: IntelliSense and Parsing Ruby"> "However, it did strike me that what I was doing was generating a successive approximation to a Ruby parser. The actual C Ruby parser is a combination of Matz's meanderings and bug fixes over the years - and it's neither pretty nor elegant. I can get closer and closer to the real thing but the amount of effort required to do that increases. For example, the one construct I won't deal with at present is nested <i>here</i> documents. For various technical reasons, they are hard hard work to implement. And how many people use them, anyway? I've only come across two examples so far in all those 2600 files."
</blockquote>
<p><a href="http://jutopia.tirsen.com/articles/2005/10/18/refactoring-for-ruby-a-solution-to-the-first-component">Refactoring for Ruby: A solution to the first component?</a>:
</p>
<blockquote cite="http://jutopia.tirsen.com/articles/2005/10/18/refactoring-for-ruby-a-solution-to-the-first-component" title="Refactoring for Ruby: A solution to the first component?"> "The great thing with <a href="http://www.zenspider.com/ZSS/Products/ParseTree/">ParseTree</a> is that it's guaranteed to parse all Ruby code as it actually steals the AST directly from the interpreter. The problem with ParseTree is that it discards everything that is not interesting to actually executing the Ruby code. Things like formatting, comments and so on may not be interesting to the Ruby interpreter but it certainly is interesting to humans reading and writing the code. So we don't want to loose all that interesting (to us) stuff when we execute a refactoring."
</blockquote>
<p>
So far, there are two solutions to the parsing question. First, use ParseTree. But as stated above, your lose all the useful information such as comments and formatting. The other would be to use Antlr, write your own little grammar that would preserve those comments and formatting. I have not used Antlr before, and like the first quote above mentioned, getting the entire grammar for Ruby to work is not easy. There are some weird nuances that need to be detected.</p>
<p>
I know that some <a href="http://rubyforge.org/projects/rubygrammar">people</a> are working on the Antlr grammar for Ruby. However, the project seems pretty abandoned. I might be able to get something out of it as a starting point though. For a fairly large language like Ruby, the <a href="http://rubyforge.org/plugins/scmsvn/viewcvs.php/grammars/antlr-v3/trunk/ruby.g?revision=57&root=rubygrammar&view=markup">cases</a> are rather extensive.
</p>
<p>
The other possibility would be to look at JRuby's implementation of a parser and see what we can get out of that. I really do not want to have to write the grammar for Ruby.</p>
<p>
Update: Seems like I found something that might be useful: <a href="http://seclib.blogspot.com/2006/02/first-release-of-rubyfront.html">RubyFront</a>: Ruby parser powered by Antlr. And they have been kind enough to include the ruby.g file that contains the grammar. And the good news, it parses everything, including the notorious here docs.</p>
Sub-blog at softwareengineering.vazexqi.com2006-08-29T00:00:00+00:00http://vazexqi.github.com/2006/08/29/sub-blog-at-softwareengineering-vazexqi-com<p>
I have created a <a href="http://softwareengineering.vazexqi.com">sub-blog</a> that deals with software engineering (mostly software architecture at this point). It's part of my CS 527: Advanced Topics in Software Engineering online journal project.
</p>
<p>
So far, there are three articles on it. And more would be added soon since we have to keep a journal about the papers/ books we read. Most of the content should be appreciable even if you do not read the original paper or book. At least that is what I hope since I do spend some time making it useful for people to read.
</p>
<p>
Whenever possible I have also included a link to the paper. But when the article is about the two mandatory books for the class, it can be a bit hard to follow. Anyway, in case anyone is interested, the two mandatory books for the class are <a href="http://www.amazon.com/exec/obidos/ASIN/0321154959">SAIP: Software Architecture in Practice</a> and <a href="http://www.amazon.com/exec/obidos/ASIN/0321125215">Domain Driven Design</a>. I have read a bit on Domain Driven Design and I can say that it is definitely a book worth getting. I have no opinion yet on SAIP but I am wary of stuff produced by the Software Engineering Institute (SEI) because they do tend to be a bit dry.</p>
Performance... performance... performance2006-08-27T00:00:00+00:00http://vazexqi.github.com/2006/08/27/performance-performance-performance<p><a href="http://www.butunclebob.com/ArticleS.UncleBob.PerformanceTuning">ArticleS.UncleBob.PerformanceTuning</a>:
</p>
<blockquote cite="http://www.butunclebob.com/ArticleS.UncleBob.PerformanceTuning" title="ArticleS.UncleBob.PerformanceTuning"> "All this just leads back to the title. Performance tuning is perverse. What you think is going on is seldom what really is going on. Who could have guessed that limiting the outer iteration to the square root of the maximum would yeild just a 2X increase in performance? Who could have guessed that the algorithm itself was linear?!"
</blockquote>
<p>
Optimizing is a dangerous game. It's always tempting to try to make small tricks here and there which you think are going to help your program run faster. However, unless you actually check out the speed increase, you will realize that those small tricks do not matter significantly.
</p>
<p>
I used to do little tricks such as that in C/C++ or Java as well. Maybe it's the nature of the language that allows such "optimizations". I don't do such optimizations when using Smalltalk or Ruby. At this stage, some of you might decide to jump in and say: 'cos that languages are so darn slow to begin with. Ruby might be slow (for now) but there are variants of Smalltalk that run almost on par with C.
</p>
<p>
For instance, in a function, I might think that a calling another function (say pow()) a couple of times is going to really slow. So I cache this value whenever possible by assigning it to some variable. Sure, <i>everyone</i> knows that calling pow() is going to slow so caching that value especially if you are going to use is going to make great difference right? Not true. Caching variables for something like this is what a compiler ought to be able to do by itself. Caching variables can be something short-termed because when you actually have to modify your code, you might forget to change all the places where you use that cached variable. Maybe you cached the value for pow(number, 3) and used it in four different places, then if you ever need to use pow(number, 2) you have to allocate a new variable and all that again. The changes that need to be made to your code to accommodate that change might not be trivial.
</p>
<p>
So unless you have a profiler at hand <b>and</b> real world usage data, your suspicions on what part to optimize is going to be wrong. For an algorithm that is always going to be linear, O(n) at most what you can do is speed it up by a constant amount. Unless you change the algorithm, there is no way you can suddenly get to O(lg n) performance.</p>
<p><a href="http://www.joelonsoftware.com/articles/FiveWorlds.html">Five Worlds - Joel on Software</a>:
</p>
<blockquote cite="http://www.joelonsoftware.com/articles/FiveWorlds.html" title="Five Worlds - Joel on Software"> "Embedded Software has the unique property that it goes in a piece of hardware and in almost every case can never be updated. This is a whole different world, here. The quality requirements are much higher, because there are no second chances. You may be dealing with a processor that runs dramatically more slowly than the typical desktop processor, so you may spend a lot of time optimizing. Fast code is more important than elegant code."
</blockquote>
<p>
But then again, such tricks are important when you do not have a great compiler. For instance, on embedded systems. It's hard for people to write great C compilers for every microchip there is out there. You can be pretty sure that the C compiler you are using for the ATMegatel chip is not going to be as good as the one you have your desktop. In such cases, little tricks on the developer's part does work. That was pretty much the reason why people wrote in assembly last time when the first C compiler came out: it just wasn't good enough yet for demanding tasks like games that push the limits of the computer.
</p>
<p><a href="http://blog.qualityaspect.com/2006/08/26/the-emperors-new-clothes-syndrome/">The Emperor’s New Clothes Syndrome</a>:
</p>
<blockquote cite="http://blog.qualityaspect.com/2006/08/26/the-emperors-new-clothes-syndrome/" title=""> "The problem is that although we know exactly what doesn't work right and how it should be fixed, most of us will never say anything. We don't say anything because there's a very good chance the minute we do we will be marked as uncooperative, pessimistic, or simply detached from the business reality."
</blockquote>
<p>
So the next time your team member suggests so clever little optimizing trick, please think it through before actually implementing it. Most clever little tricks that used to work great in the past might not be so necessary anymore. Things like loop unravelling should definitely be left to the compiler so that you do not generate weird amounts of code that no one else can clean up after you. Seriously, think about it. The same goes for over-engineering, I guess but that would require more articles before I can come to a valid conclusion.</p>
<small>I read the three articles I quoted at different times during the week but I clobbered them together just now and they actually fit rather nicely. I hope.</small>
Installed Lightbox 2.022006-08-23T00:00:00+00:00http://vazexqi.github.com/2006/08/23/installed-lightbox-2-02<p>
Lately, I have been seeing all those cool effects on other people's blog that shade the entire web page in dark grey while the picture that the visitor just clicked is displayed prominently in the middle. Not only is that really cool, it's pretty useful as well especially if you just want to view a larger image without leaving the page. In other words, I think it is efficient use of screen estate.
</p>
<p>
Also, I just realized that Typo 4 actually ships with a version 1.0 of Lightbox. The effects are simpler as compared to version 2.02. You can get a nice preview of it <a href="http://www.huddletogether.com/projects/lightbox2/">here</a>. So, here are the steps I took to upgrade Lightbox.
<ol>
<li>Grab the latest version of Lightbox from <a href="http://www.huddletogether.com/projects/lightbox2/">here</a>.</li>
<li>Unzip the file to get all the good stuff.</li>
<li>FTP/SFTP to your Typo 4 blog and navigate to your /public folder. Replace the lightbox.js file in /public/javascripts with the one you just downloaded. Do the same for the lightbox.css file in /public/stylesheets </li>
<li>Also, upload the images found in the folder you just unzipped to /public/images. You need to upload all the images except image-1.jpg and thumb-1.jpg. </li>
<li>Navigate to /themes/<your theme >/layouts. Modify default.rhtml so that you includes the following 4 lines (if they are not there already)
<br />
<code>
<%= javascript_include_tag "prototype" %>
<br />
<%= javascript_include_tag "scriptaculous" %>
<br />
<%= javascript_include_tag "lightbox" %>
<br />
<%= stylesheet_link_tag "/stylesheets/lightbox.css" %>
</code>
</li>
</ol>
</p>
<p>
As an added bonus, you can also use the built-in filter for Typo to quickly generate the html to overlay the image. This is the easiest way to try out Lightbox. Here is a sample that loads an image from Flickr. The magic number is the UID for the picture on Flickr.
<br />
<code>
<typo:lightbox img="201524385" thumbsize="medium" displaysize="original" alt="Jacking up the car" />
</code>
<br />
Just a quick reminder. If you do not have a Flickr Pro account, you should not set the displaysize parameter above to "original" since you do not have that feature. Instead set it to "large" or something else.
</p>
<p>
For more help, refer to the documentation at http://< your blog >/admin/textfilters/macro_help/lightbox</p>
<p>
Right now, if you click on any of the images on this main page you will be able to see the effects. I am not going to update the previous images I have posted since that will take too much time.
</p>
Upgraded CS242 grading application2006-08-20T00:00:00+00:00http://vazexqi.github.com/2006/08/20/upgraded-cs242-grading-application<p>
This was something that I wanted to do since the beginning of summer but could not really do back in Malaysia because of the slow internet connection which I <i>enjoyed</i> there. The grading application worked fine but there were some minor features that needed to be implemented. For instance, my initial idea of having each criterion be a checkbox did not turn out as useful as I expected. True, sometimes it is easier to just check something off but sometimes there is really a need to assign some points to that criterion. Also, being able to assign specific points from a range makes it easier to tally the points and determine which student gets the A in class.</p>
<p>
Another feature I added was the summary page that will display everyone's marks for each assignment. I really wished I had this feature last semester especially when we were trying to determine who did all the assignments at the end of the class. To implement this feature, I used multiple parameters in the URL. This turned out to be pretty ugly so I used the routes.rb to map the connections into prettier URLs. More on that can be found <a href="http://www.ruby-forum.com/topic/76861">here</a>. Using routes.rb is pretty useful and I can see myself using it in the future. Moreover, I was able to rerouter cs242.vazexqi.com to cs242.vazexqi.com/login/login automatically without relying on http-headers or javascript.</p>
<p>
A minor improvement was the use of a variable width CSS file. Last semester, as the number of projects increased, the number of tabs would also increase making the layout look unprofessional. Using the variable width CSS file, the entire interface stretches to the size of your browser window and is no longer constrained to a mere 800 pixels.</p>
<p>
I deployed the final application by using <code>svn export</code> to remove all the hidden .svn files. Rails actually has a neat deployment application called Capistrano but I have not had the time to experiment with it yet. </p>
<p>
This time around, I am also more careful and have setup a cron job to backup the MySQL database as suggested <a href="http://wiki.railsplayground.com/railsplayground/show/How+To+Automatically+Backup+Your+MySQL+Databases">here</a>.
</p>
<p>
I did not implement any nifty AJAX features yet. Probably that is something worth looking into as well. I really wish that I could get the application working with FastCGI since it is running rather slowly using normal CGI. However, I have not had any success with FastCGI and I do not feel like having the application die on the students every now and then this semester.</p>
TA Orientation2006-08-18T00:00:00+00:00http://vazexqi.github.com/2006/08/18/ta-orientation<p>
The past few days had been rather fun. After returning from Malaysia, I had to squat over at my friend's place for a few days. Then, I had to quickly get all the registration stuff done. And then, move over to my new apartment. Before I could actually enjoy the comforts of my new apartment, I had to go for three days of teaching assistantship (TA) orientation.</p>
<p>
There was some fairly interesting issues that were covered during the orientation. For instance, what a TA should do when a student comes with a personal problem, how to grade fairly and consistently and also how to plan your lesson so that it is both informative and engaging at the same time. Most of those things are pretty much common sense. But the tips on how to deal with diversity and sensitive issues in class was rather useful for me. Moreover, lunch was provided as well so that was nice.</p>
<p>
We even had an international TA orientation to familiarize incoming international students on how the classrooms work in college here. Interesting issues such as interpreting American slang and how to actually talk to your students in a non-invasive manner were presented. </p>
<p>
All in all, I am glad that the university decided to spend so much time on TA orientation. It really helps first time TAs become more confident with teaching. And it also helps everyone see the importance of teaching.
</p>
WWDC 20062006-08-08T00:00:00+00:00http://vazexqi.github.com/2006/08/08/wwdc-2006<p>
This time around, Leopard appears to be the center of attention. Of course, the new Mac Pro was introduced. But the entire keynote focused on Leopard. And most of the features for Leopard seem to be nothing more than visual eye-candy for the most part. There aren't any significant updates to most applications. However, as Steve Jobs puts it, some features are still hidden to prevent Vista from copying it. I seriously doubt that Vista will try to emulate some of the features for OS X. The ship date for Vista is fast approaching and Microsoft has yet to iron out all the bugs from Vista. But, one can never be too sure, as the WWDC '06 keynote has shown. I have yet to watch it but I heard that it pokes fun at Vista.</p>
<p>
All in all, I feel that the real improvements to Leopard are under the hood. XCode 3.0 and Objective-C 2.0 seem to be really major improvements. One of the major features for Objective-C 2.0 is garbage collection. It would be interesting to see how fast Objective-C 2.0 runs compared to its predecessors. Also, Leopard will support 32-bit and 64-bit applications natively. In fact, Leopard itself is designed to run on both 32-bit and 64-bit machines. </p>
<p>
Nonetheless, I do not really see myself using all the new features that have been previewed today. In fact, most users will not care about the new features too. I suspect, however, that most developers will be thrilled by the new features brought in. </p>
<p>
So, what I am going to do is list the top features of Tiger and how relevant they have been to me this past year. Then, I shall predict how useful the features in Leopard are going to be. The list of features for Tiger is taken from <a href="http://www.apple.com/macosx/tiger/">here</a> and the list of features for Leopard is taken from <a href="http://www.apple.com/macosx/leopard/">here</a>.</p>
<p>
<b>Tiger</b><br />
<ul>
<li>Spotlight<br />
For the most part, I only use Spotlight to find some really funky file. For instance, if I suspect that the file name is going to be fairly uncommon, I will go ahead and type it for Spotlight to locate. A good example would be searching for the preference list for some application that I have just uninstalled. If I know the exact location of a particular file, I will navigate there to open it. Somehow the idea of using Spotlight to find it and sieve through a whole list of files seems counterproductive to me. And since I <em>always</em> know where my files are, Spotlight is not in the limelight of my daily computer interaction.</li>
<li>Dashboard<br />
On my Powerbook G4, Dashboard was really a pain to use. Moreover, some of the widgets just ate up all the available resources. However, on my MacBook Pro, I find Dashboard to be bearable. So far, there isn't a whole lot of useful widgets so I have stuck to my usual 3: BackpackIt, Weather and Dictionary. I probably will not miss Dashboard that much since most of the widgets I use can be integrated into the web browser.</li>
<li>Safari<br />
I use Safari everyday. Enough said.</li>
<li>iChat<br />
I tried using it for a month or so after getting my MacBook Pro since there was no universal build for Adium yet. It was horrible. I cannot stand not having tabs for my open chats. Applications such as <a href="http://www.ksuther.com/chax/">Chax</a> is supposed to fix some of the problems. I only revert back to iChat from Adium when I need to send or receive files. Adium (or rather the underlying gaim library) does not have good support for file transfers. Oh yeah, I do use iChat if I need to do audio or video conferencing with my parents.</li>
<li>Automator<br />
I've only used it for merging .pdf files together since I have uninstalled the memory intensive Adobe Acrobat.</li>
<li>Quicktime<br />
<a href="http://www.videolan.org/vlc/">VLC Player</a> is still the best. It supports almost every file format out there without requiring any third-party plugins. And the H.264 support in VLC is as good as Quicktime as far as I can tell.</li>
<li>.Mac<br />
Contrary to what most people have to say, I still like .Mac. The $99 a year is a bit steep but I like the convenience of creating a photo web page quickly from within iPhoto or iWeb.</li>
<li>VoiceOver<br />
I have never used this since installing Tiger.</li>
<li>Parental Controls<br />
I have never used this since installing Tiger.</li>
<li>Mail<br />
Mail does everything that I need it to. The threading feature is fantastic and I do not know how I can use e-mail without it. I have not used the smart folders feature. I have also not used the slideshow feature in Mail. In fact, if someone send me more than 2 pictures in my mailbox I will probably send it straight to the junk folder. Pictures are meant to be put online so that I can retrieve it later; not flooding my mailbox. </li>
</ul>
</p>
<p>
<b>Leopard</b>
<ul>
<li>Time Machine<br />
Hmmm. Remember <a href="http://www.apple.com/macosx/features/filevault/">FileVault</a>? I wonder how many people actually use it now? Blame it on my gut feeling, but a background process that monitors everything that I do and try to write back to disk is going to steal CPU cycles every now and then. Some of you are arguing that most CPUs are underutilized anyway so why not make use of those extra cycles to do something useful? Most notebooks do not come with a secondary drive. So, if you backup and the drive fails, you are utterly screwed. It's no better than not backing up in the first place. And the visual effect for Time Machine means that it probably is not going to be useful for mass reverting from a backup. All that eye-candy is probably going to take up way more time than using a dedicated backup program. So, I suspect that I will be using Time Machine for files that I would like to have revision control for but am too lazy to chuck it into a Subversion repository.</li>
<li>Mail<br />
The ability to add new to-dos is going to be something interesting. I wonder if it is going to be as intelligent as GMail's integration with Google Calendar. I thin the stationary thing is going to be pretty useless. Almost all interesting e-mail can be expressed in plain text. Having those fancy html mails will only encourage people to compose space-hogging mail messages. I don't see myself using the notes features that much either. The .Mac e-mail page is not as elegant as GMail's. And since all my mail is already forwarded to GMail I prefer using GMail's labels for notes. Also, I really really hate the Stickies application or anything that resembles it.</li>
<li>iChat<br />
I will probably be using this new version. The support for tabs makes it so much more appealing. And I can picture myself delivering a keynote presentation using it. iChat 3.0 is going to be the next great thing.</li>
<li>Spaces<br />
I am not a fan of virtual desktops. Expose is all I need to get everything done. This is probably going to appeal to developers also. Most home users do not need something like this. In fact, virtual desktops add to the confusion of navigating around. I am not sure if even Apple can make virtual desktops really intuitive for almost everyone to use. Come on, if not everyone will be using Spaces, why tout it as some killer feature?</li>
<li>Dashboard<br />
Nothing new here. The web clip feature for Safari is not that appealing to me. I really have yet to see many compelling dashboard widgets. The ones supplied by Apple are decent but just a cursory glance at the new ones found <a href="http://www.apple.com/downloads/dashboard/">here</a> shows that most widgets are doing nothing but taking up screen estate.</li>
<li>Spotlight<br />
Seems that Spotlight is going to be faster this time around. And the new definition category might tempt me to use it instead of the dictionary dashboard widget.</li>
<li>iCal<br />
I already use this extensively. So I am glad to see any new improvements to it. True, it does not support a lot of advanced collaboration protocols but what I need it does it well. I assume that most people also only need iCal. Did I mention that it syncs events nicely with my cell phone? The only bad news? Not everyone I know uses iCal. And the best application that supports the iCal format <a href="http://www.mozilla.org/projects/calendar/sunbird/">sucks</a>. </li>
<li>Accessibility<br />
I don't see myself using this feature much (if at all)</li>
<li>64-bit<br />
Unless I update my MacBook Pro (I don't recall Intel shipping a new 64-bit portable chip) this is not going to be really that captivating.</li>
<li>Core Animation<br />
As long as most applications do not go overboard on the eye-candy, I will be happy with this feature.</li>
</ul>
</p>
<p>
Seems that most of the latest features for Leopard might be under the hood. Ruby on Rails developers will be happy to know that Rails is going to be included in Leopard <a href="http://www.apple.com/server/macosx/leopard/more.html">server</a>. And I am certain that more of the latest technologies will make their mark soon on the Mac platform.
</p>
<p>
By the way, I just realized that there was no mention of the next operating system after Leopard. Could it mean that Leopard is going to be the last of the 10.x series?
</p>
Only in Malaysia: People here do not care enough about cleanliness2006-08-07T00:00:00+00:00http://vazexqi.github.com/2006/08/07/only-in-malaysia-people-here-do-not-care-enough-about-cleanliness<p>
Yesterday, I went to the bakery to buy some pastries for breakfast. While my mom was paying, I caught sight of a cockroach crawling around on the bread counter. So, my first reaction was to shout "Cockroach!". Amazingly, no one even bothered to look at me. Not even the owner. So, I took out my camera phone to take a picture of that roach expecting the owner to take notice of me. No reaction whatsoever from anyone. No one seems to care if I went to report the bakery to the health officers.</p>
<p>
Today, my girl friend and I went to have lunch at KFC. Her meal came with a bun. As she was eating it she noticed that there was actually green mold on that bun! So, she went to the manager and told him. To which he casually replied, "Do you want a new bun?". He did not even bother apologizing for the mold. I wonder how many people had nonchalantly eaten the bun without knowing that there was mold on it.</p>
<p>
In both incidents I could have chosen to make a scene out of it. I could have demanded compensation or something else. But it seems rather pointless to make a big deal out of it. No one else seems to be bothered.</p>
<p>
I don't do these thing just to embarrass the establishment. In fact, I will casually tell the person-in-charge of the matter and be done with it. However, that only works if the person-in-charge is willing to take action to rectify the problem. In both cases, no one even bothered to reassure me that some action would be taken.
</p>
<p>
Things would definitely be different in the United States.
</p>
Upgraded to Typo 42006-08-03T00:00:00+00:00http://vazexqi.github.com/2006/08/03/upgraded-to-typo-4<p>
Typo 4.0 seems to be a major release from Typo 2.6.0. I remember the panic that occurred when Rails 1.1. was released and how it broke my Typo installation. Fortunately, freezing the version of Rails was a good solution that has sustained my blog until today. Anyway, Typo 4.0 was released a couple of days back and there was no major bugs reported for the past few days. So, I took the plunge into upgrading my blog. And in the process moved it over to a new subdomain.
</p>
<p>
Upgrading Typo is a relatively pain free process especially since there is now a ruby gem for first time users. However, there are some issues that deterred me from using the gem. First: railsapphosting.com does not have that gem installed (yet?). Second: the gem wants to use sqlite as the database backend. I much prefer using MySQL since I will save myself the trouble of converting my previous blog entries into sqlite format.
</p>
<p>
Anyway, here is how I upgraded. Some of these steps might not be necessary especially if you have a decent backup of everything. However, I am using the safe route here because I really do not want to lose any of my previous blog entries.
</p>
<p>
<ol>
<li>Create subdomain<br />
I created a subdomain called blog.vazexqi.com from the CPanel interface. This is probably specific to railsapphosting.com but all other hosts should have some web-based interface for doing this. Anyway, the steps are clearly described <a href="http://wiki.railsplayground.com/railsplayground/show/How+To+Use+Rails+at+RailsPlayground">here
</a>.</li>
<li>Create new database<br />
I plan to keep my old database around for the time being so that the original website can still access it. I noticed that Typo 4.0 has a new schema compared to Typo 2.6 so there is no way to share the same database between different installations. Again, the CPanel in railsapphosting.com offers a good way to set up a new MySQL database. Make sure that you remember the database name, username and password. You will need them when you fill in the database.yml file in Typo.</li>
<li>Transfer old database to new database<br />
There must be an easier way to do this but I did it using two commands.
<ol>
<li><code>mysqldump -u <username> -p <database_to_export_from> > <filename>.sql</code></li>
<li><code>mysql -u <username> -p <database_to_import_into> < <filename>.sql</code></li>
</ol>
Originally, I wanted to use <a href="http://www.theonline.org/cocoamysql/">CocoaMySQL</a> but it was not able to do it and keep throwing NULL errors at me.</li>
<li>Obtain Typo 4.0<br />
Get it and untar it into the directory that we created from Step 1. We must be careful not to overwrite the dispatch.* files inside the public folder.</li>
<li>Fill in config/database.yml<br />
Use the fields from Step 2 above. This should be fairly simple. For the time being, we are going to run it in development mode. So make sure you fill in the right fields in the development slot. Also, fill in the same details for the production mode slot. </li>
<li>Do a rake migrate<br />
In the Typo folder that you have untarred, execute <code>rake migrate</code>. This will migrate the database from version 2.6 to the newer version. Make sure that there are no errors. </li>
<li>Edit config/environment.rb<br />
Uncomment the line that allows you to run your rail application in production mode. This is one way of forcing your application into production mode. And it seems like the easiest way.</li>
<li>Initial login<br />
Since you upgraded from a previous installation, your username/password will still work. Log in to <the_domain_from_step1>/admin. You can tweak around with whatever settings you want. However, the MOST important step is to go to the Themes tab and activate one of the two themes included by default. Without doing this, your blog will not render and will throw a Rails Application Error.</li>
<li>Visit your blog<br />
Try opening your blog at this stage. It should appear with no problems. Also try posting a new entry.</li>
<li>Finishing touches<br />
Install a new theme, configure your domain names and do whatever else it takes to make you satisfied with your new Typo blog.</li>
</ol>
</p>
<p>
In conclusion, upgrading to the latest version of Typo is not as hard as it seems. In fact, it was rather painless for me except for the problems copying my previous database over using CocoaMySQL. </p>
<p>
One new feature of Typo 4.0 is support for macros. One of those macros allow nicely formatted code! At the moment, it only supports ruby, yaml and xml so for Scheme code I will still have to revert to vi for the 2html.vim. Here is a sample of the syntax-highlighted code blocks:
<typo:code lang="ruby" linenumber="true">
class Foo
def bar
"abcde"
end
end
</typo:code>
</p>
<p>
The <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1&topic=">Sparklines</a> macro is also cool. Here is an example: <typo:sparkline data="5 10 15 20 5 3 2 4 5 6 7 82 4 4 5 61 4"/>
</p>
<p>
Here is a <a href="http://blog.aidenbordner.com/articles/2006/07/24/getting-typo-4-0-0-running-on-dreamhost">link</a> to another site detailing how to get Typo 4.0 to work on DreamHost.</p>
<p>
<a href="http://wiki.railsplayground.com/railsplayground/show/How+To+Upgrade+to+Typo+4.x">Here</a> is the guide from the railsplayground wiki. Replace the file with wget http://rubyforge.org/frs/download.php/12330/typo-4.0.2.tgz if you are upgrading to Typo 4.0.2 to fix the issue with Rails 1.1.4</p>
Summer 2006 Reading2006-08-02T00:00:00+00:00http://vazexqi.github.com/2006/08/02/summer-2006-reading<p>
Here, in order, are the books that I have consumed over the summer. The same list can be found <a href="http://www.allconsuming.net/person/vazexqi/">here</a>.
</p>
<p>
<ol>
<li>Little Schemer<br />
I finished the Little Lisper a year ago. Little Schemer is a fresh introduction to Scheme with some revision on the end chapters. I much prefer the derivation of the Y-combinator in this book compared to the one from the Little Lisper. The omission of the end-of-chapter exercises from this edition was much missed although the authors did include more examples this time around. </li>
<li>The Pentium Chronicles<br />
This was a very nice book detailing the process that transpires in the making of a processor. The book was a bit technical and I really appreciated that fact that I had taken ECE 411: Computer Organization and Design. This book really shows you how brilliant people can really create wonders.</li>
<li>Blink<br />
Blink tries to provide some arguments as to why intuition works. Through various examples, the author provides compelling reasons (not really evidence) to support that notion. Blink is an easy book to read and is well worth it for all the interesting anecdotes thrown in.</li>
<li>55 Ways to Have Fun with Google<br />
An interesting book. Mind you, it's not a book on how to search better with Google (there are some of those too in the book). Rather, it showcases all the nifty things that you will never think of doing with Google. Most of the chapters will probably not be useful to anyone, but it is a fun book nonetheless.</li>
<li>The Curious Incident of the Dog in the Night-Time<br />
This book was all right. However, I found that the kid being portrayed was more of a savant that an autistic kid. Personally, I found that the behaviors ascribed to the kid were stereotypical-- they're what we think a autistic kid should be like. Nothing much to be missed for passing this book.</li>
<li>Life of Pi<br />
I will not recommend this book to anyone. Too long for its own good. Half way through, I was just reading it for the sake of completing it. The ending was nothing spectacular either. Moreover, I find the sentences much too long-winded.</li>
</ol>
</p>
<p>
Books that I am in the process of completing:
<ul>
<li>Pragmatic Version Control: Using Subversion (2nd Edition)<br />
I have finished most of it already. Essentially, I have enough knowledge on how to use Subversion. I will probably use this book as a reference in the future.</li>
<li>Refactoring to Patterns<br />
An interesting book on how to evolve your design to fit into well-known patterns. I am halfway through the book and there isn't anything much that I have not seen or read about before. However, the detailed steps on refactoring to patterns might come in handy some day.</li>
<li>The Seasoned Schemer<br />
This is a great companion to the Little Schemer. It's in this book that <code>letrec, let</code> and <code>call/cc</code> are introduced. I would be more inclined to recommend this book had the authors made use of the normal nomenclature for Scheme and functional languages. Most of the terms are not mentioned making it harder to search for more information on the topic on Google since you do not have the proper term to refer to it.</li>
</ul>
</p>
<p>
I think I could have consumed more books had that piqued my interest (I am being very optimistic here) but was not able to do so because it is rather hard to procure the latest books from book stores here. In fact, there has been a dearth of decent book stores and most have been relegated to only selling school textbooks and reference materials. Seems like most Malaysians do not find reading to be a enjoyable hobby.
</p>
Tiny text2006-07-28T00:00:00+00:00http://vazexqi.github.com/2006/07/28/tiny-text<a href="http://static.flickr.com/83/205735727_61bd856687_o.png" rel="lightbox" title="Difference in text size"><img src="http://static.flickr.com/83/205735727_61bd856687.jpg" width="478" height="500" alt="Difference in text" /></a>
<p>
I have always wondered why the fonts in Firefox/ Flock looked so bad sometimes. Why do they allow the fonts to get so small that the text becomes barely readable? Well, I found out today that there is an option to prevent that. Go to Preferences. Select the Content tab. In the Fonts & Colors section, select Advanced... And change the minimum font size. It works wonders! Now, the page does not look so bad anymore.</p>
<p>
I think Safari by default already has the minimum font size set for it. I am amazed that Firefox/ Flock did not do the same.</p>
Friends visit2006-07-24T00:00:00+00:00http://vazexqi.github.com/2006/07/24/friends-visit<a href="http://static.flickr.com/65/201524385_b0ab6e5098_o.jpg" rel="lightbox" title="Jacking up the car"><img src="http://static.flickr.com/65/201524385_b0ab6e5098.jpg"/></a>
<p>
Photos of their one week trip here.
<ul>
<li><a href="http://flickr.com/photos/desireux/sets/72157594213502712/">Part 1</a></li>
<li><a href="http://flickr.com/photos/desireux/sets/72157594217184726/">Part 2</a></li>
<li><a href="http://flickr.com/photos/desireux/sets/72157594218546933/">Part 3</a></li>
</ul>
</p>
<p>
And the main reason why I have not been updating my blog.
</p>
Not everyone's a programmer2006-07-16T00:00:00+00:00http://vazexqi.github.com/2006/07/16/not-everyones-a-programmer<p><a href="http://www.codinghorror.com/blog/archives/000635.html">Coding Horror: Separating Programming Sheep from Non-Programming Goats</a>:
</p>
<blockquote cite="http://www.codinghorror.com/blog/archives/000635.html" title="Coding Horror: Separating Programming Sheep from Non-Programming Goats"> "All teachers of programming find that their results display a 'double hump'. It is as if there are two populations: those who can [program], and those who cannot [program], each with its own independent bell curve. Almost all research into programming teaching and learning have concentrated on teaching: change the language, change the application area, use an IDE and work on motivation. None of it works, and the double hump persists. We have a test which picks out the population that can program, before the course begins. We can pick apart the double hump. You probably don't believe this, but you will after you hear the talk. We don't know exactly how/why it works, but we have some good theories."
</blockquote>
<p>(Via <a href="http://www.codinghorror.com/blog/archives/000635.html">reedit: joel</a>.)</p>
<p>
Here is a direct <a href="http://www.cs.mdx.ac.uk/research/PhDArea/saeed/">link</a> to the original paper. I looked at the test script and all it tested was assignment. And they were not complex assignments that you might expect to see in a program that supports it. For instance, in Ruby, you can do this: <code>a, b = c, d</code>. Nope, nothing like that. Just plain simple <code>a = b</code>.
</p>
<p>Some of you might be wondering why a test like that can actually measure programing aptitude. Here is my opinion on that.
<ul>
<li>You need to understand what variables are. For instance, a and b are just names for some value. And they can be easily replaced by some other name like 'cat' and 'dog'. This indirection is even more important when it comes to pointers and other data structures.</li>
<li>You need to remember state. For instance if you assign a to be equal to 10 at the beginning and change its value somewhere else, you need to remember that a can only take on the latest assignment.</li>
<li>You need to understand what sequence means. Programs do not just jump around,
There is a proper sequence to the execution of each line.</li>
<li>You need to know when words that you do not understand will not affect the outcome much. For instance, regardless of whether you know what 'int' means, you should be able to guess that the next statement does. This is really important when you learn a new language. Good programmers are familiar enough with programming concepts that different syntax will not throw them off.</li>
<li>The ability to notice that sometimes any relations between the value themselves are purely coincidental. For instance, having the first three odd numbers might throw someone else off to think that this question is different from the previous one. While it is important to notice trends in the numbers, it is also important to realize that those trends can be purely coincidental. The underlying principles of assignment do not change with different numbers.</li>
</ul>
</p>
<p>
I looked at the answer script. It does not only demand the right answer. Instead it assigns different categories for different answers. This would be the proper way to grade a test such as this. For instance, some people might prefer to do left to right assignment making the result of <code>a = b</code> being that b gets the value of a instead of the other way around. </p>
<p>
I am going to read the draft of the paper later tonight. Any updates will be posted here.</p>
<p>
Update: It seems that the survey was done only with 61 students. Hardly a conclusive figure I would say. And the paper is a bit too colloquial to merit much academic attention. Therefore, I do not believe that their postulation has been proven. </p>
<p>
Update: Head over <a href="http://lambda-the-ultimate.org/node/1624">here</a> for more discussion on the topic.</p>
Little Summer Project2006-07-14T00:00:00+00:00http://vazexqi.github.com/2006/07/14/little-summer-project<p>
While I was back here, my aunt asked me to help her take some photos for her restaurant. She was in the process of changing their old menu, which was really in dire need of replacement. The old menu did not look inviting, and it was much too messy.</p>
<p>
Originally, Tracy and I were just supposed to take the photos and send them to another person who would arrange the pictures into the new menu. However, after talking to that person, I really did not think he would do a good job since he was doing the new menu using AutoCAD! AutoCAD is an application that engineers use to design stuff. For a menu, it does not offer any advantage. In fact, you might as well be using Microsoft Word.
</p>
<p>
So, I did a simple demonstration of the capabilities of Pages. I took some of the photos, threw in some lorem ipsum dolor and put them out in a nice layout. The only really characteristic thing that I thrown in were the reflections and shadows that Apple applications are so good at doing. Honestly, I have not seen a menu in this part of town that had both shadows and reflections. I felt that the subtle highlights were a good touch to the menu. My aunt liked the idea so much that she asked me to do it (actually, coerce would be a better term). After all, no one else had an Apple machine.</p>
<p>
Anyway, here is a preview of the menu. I printed the first 16 pages of the menu onto this page. I really liked how simple the menu looks. Compared to its previous incarnation, this new look tempts the user to the newly introduced menu items.
<br />
<a href="http://static.flickr.com/51/189405517_66d029c76d_b.jpg" rel="lightbox" title="Menu"><img src="http://static.flickr.com/51/189405517_66d029c76d.jpg" width="386" height="500" alt="Small Combined Menu" /></a>
</p>
<p>
There is definitely room for improvement. I believed that the fonts could have been made slightly smaller. I have never seen fonts that big appear on any restaurant menu in the US. However, my aunt decided that bigger fonts were easier on the eyes.
</p>
<p>
Well, this was definitely one of my summer projects. And it did consume a decent amount of my time. I had to retype all the menu items and their prices since no one had a soft copy of the previous menu. Pages still has some shortcomings. Its auto layout feature does not seem to work as expected most of the time. Also, it had some trouble handling the large image sizes (the pictures were all high-resolution pictures).</p>
<p>
There might be a couple of changes before I fly back to the US but this version of the menu pretty much represents how it would look like.</p>
Y-combinator2006-07-13T00:00:00+00:00http://vazexqi.github.com/2006/07/13/y-combinator<p>
The Y-Combinator is something that has taken up a significant portion of my life these past few days. There are a lot of examples online describing it. However, most of them have not been presented in an intuitive sense (maybe because the Y-combinator is rather counterintuitive?). Also, most of them have not really explain the need for the Y-combinator when using Scheme/Lisp/etc. since we already have stuff like <code>(define...), (letrec...)</code> at our disposal.</p>
<p>
Anyway, the explanation given inside the book <em>The Little Schemer</em> was pretty interesting though I believe that it can be made clearer. As aforementioned, the intent of the Y-combinator could have been presented. Nonetheless, the best derivation of the Y-combinator that I can find on the web belongs to this <a href="http://dangermouse.brynmawr.edu/cs245/ycomb_jim.html">page</a>. Since I have spent the past few days mulling over this, I -- rather presumptuously-- feel that I can do a good job at trying to explain the derivation of the Y-combinator. This derivation is not going to be very formal but will hinge on making things as intuitive as possible. And even if no one else benefits from this derivation, I have the satisfaction of trying to write this clearly to enlighten myself in the future should I need to derive this again. Most of the work here will be inspired and influenced by the link above.</p>
Apple Keyboards2006-07-12T00:00:00+00:00http://vazexqi.github.com/2006/07/12/apple-keyboards<p><a href="http://rentzsch.com/bugs/pullingADoubleShift">rentzsch.com: Pulling a Double Shift</a>:
</p>
<blockquote cite="http://rentzsch.com/bugs/pullingADoubleShift" title="rentzsch.com: Pulling a Double Shift"> "If you have a last-generation PowerBook or a MacBook Pro, here's some weirdness for you to try out:
<ul>
<li>Fire up TextEdit.</li>
<li>Press the Q key. A lowercase 'q' results.</li>
<li>Press and hold the left shift key and press the Q key. An uppercase 'Q' results.</li>
<li>Here's were it gets weird. Press and hold both shift keys and press the Q key. Nothing happens.</li>
</ul>
In fact, when you hold down both shift keys, a bunch of keys go dead. Function keys F1 through F9 become non-responsive."
</blockquote>
<p>I have confirmed this particular weirdness and it happens in other applications as well.</p>
Where's your cave?2006-07-11T00:00:00+00:00http://vazexqi.github.com/2006/07/11/wheres-your-cave<p><a href="http://www.randsinrepose.com/archives/2006/07/10/a_nerd_in_a_cave.html">Rands In Repose: A Nerd in a Cave</a>:
</p>
<blockquote cite="http://www.randsinrepose.com/archives/2006/07/10/a_nerd_in_a_cave.html" title="Rands In Repose: A Nerd in a Cave"> "It's an ominous name: Cave. It alludes to a dark, damp place where you are likely to be eaten by a grue. The irony is that the purpose of a Cave is not to insulate, its purpose is to germinate. I'll explain."
</blockquote>
<p>(Via <a href="http://joel.reddit.com/info/9pt0/comments">joel:reddit</a>.)</p>
<p>
<i>A Nerd in a Cave</i> is one of the most interesting article I have seen in a while. In short, it epitomizes the crux of what being a programming nerd is all about. This is definitely the article to send to someone when you are sick and tired of explaining for the umpteenth time to someone else why you work the way you do.
</p>
<p>
Also, if you have never heard of a cave, you might just be interesting in making your own after reading the article.
</p>
<p>
Also, recommended: <a href="http://www.randsinrepose.com/archives/2003/07/10/nadd.html">Nerd Attention Deficiency Disorder (N.A.D.D)</a></p>
Switchers2006-07-04T00:00:00+00:00http://vazexqi.github.com/2006/07/04/switchers<p>
I read John Gruber's <a href="http://daringfireball.net/2006/06/and_oranges">article</a> about a week ago concerning how <a href="http://diveintomark.org/archives/2006/06/02/when-the-bough-breaks">Mark Pilgrim</a> has switched to Ubuntu after using the Mac operating system since its early days. Though there are <b>very</b> good reasons for switching, I decided that it was not a big deal for some long time Mac users to switch to a different operating system, especially if it is not Windows. After all, there <i>must</i> be a ton of users switching operating systems everyday, right?
</p>
<p>
However, today O'Reilly Radar posted an <a href="http://radar.oreilly.com/archives/2006/06/ubuntu_linux_a_threat_to_mac_o.html">article</a> on Pilgrim's switch. Pilgrim is joined by Cory Doctorow (he might be <i>really</i> famous to some, but to me he is just another contributor at <a href="http://boingboing.net/">BoingBoing</a>, nothing more nothing less). And then after that article was released, it was slashdotted, generating a lot of comments. I suggest you go read that <a href="http://apple.slashdot.org/apple/06/07/03/1934251.shtml">article</a> first since there are a lot of valid points from both sides of the camp on this issue.
</p>
<p>
If this switch were to happen to a Windows user switching over Linux or Mac OS X, there will not be too much hype about it. In fact, Jason Kottke might be a bit presumptuous in saying:
</p>
<p><a href="http://www.kottke.org/remainder/06/06/11361.html">If I were Apple, I'd be worried about this. Two lifelong Mac fans are switching away from Macs to PCs running Ubuntu Linux (kottke.org)</a>:
</p>
<blockquote cite="http://www.kottke.org/remainder/06/06/11361.html" title="If I were Apple, I'd be worried about this. Two lifelong Mac fans are switching away from Macs to PCs running Ubuntu Linux (kottke.org)"> "If I were Apple, I'd be worried about this. Two lifelong Mac fans are switching away from Macs to PCs running Ubuntu Linux: first it was Mark Pilgrim and now Cory Doctorow. Nerds are a small demographic, but they can also be the canary in the coal mine with stuff like this."
</blockquote>
<p>
Switching operating systems is a rather <i>normal</i> part of a computer user's life. Only die hard fan boys will stick to their favorite operating system from bygone years even though there is no longer any support for it. I believe the hype is due to the fact that no prominent figure has yet switched from a Mac to another operating system. Especially since Cory Doctorow is supposed to have a Mac icon tattooed to his bicep somewhere. However, many fail to remember that Steve Jobs himself switched from a Mac (or Apple) to OpenStep. And subsequently, OpenStep was incorporated to become OS X. I am actually glad that he did. Before OS X, the Mac operating system was rapidly crumbling and losing market share. Steve saw that OpenStep was better than what OS 9 was. He took the plunge and was rewarded for it.
</p>
<p>
Similarly, I guess that both Pilgrim and Doctorow have seen that there is something better out there for them. In this case, it happens to be their little pet peeve with closed and proprietary file formats. For most people, this is not going to be an issue. After all, there are open source alternatives to most of the applications that come installed with OS X. However, as Pilgrim himself notes, he is going to <a href="http://diveintomark.org/archives/2006/06/26/essentials-2006">miss</a> a lot of the OS X applications. No, and I really mean no open source software on Linux can compete with iLife. Google's <a href="http://picasa.google.com/">Picasa</a> comes very close though as a decent iPhoto replacement.</p>
<p>
Some people feel that they have been bitten by the closed source formats because they cannot switch applications to view the same files. Nonetheless, few realize that most file formats that Apple uses is actually easily exchangeable with other applications. For text, there is always plain old .txt or even .rtf and .pdf. For images, you can easily organize your photos by folders named by date and keep your photos in .png or .jpeg. Similarly, you can always elect to store your other information in plain txt. And most Apple applications allow you to do this.</p>
<p>Pilgrim himself gives an example of how his iTunes database was corrupted. He postulates that had the iTunes database been open format, he would have been able to try to recover it. I, and some of the people who left comments on this blog, have a better idea: back it up! Corruption is tricky thing. Sometimes recovery is possible, but that is if the file format is designed to support that in the first place by introducing some redundancies. Most of the time, a restore from backup is still the best option.</p>
<p><a href="http://diveintomark.org/archives/2006/06/02/when-the-bough-breaks"> When the bough breaks [dive into mark]</a>:
</p>
<blockquote cite="http://diveintomark.org/archives/2006/06/02/when-the-bough-breaks" title=" When the bough breaks [dive into mark]"> "Why keep running them on an operating system that costs money and restricts my rights and my usage?"
</blockquote>
<p>
Because, as many people will tell you, some of us just do not have the time to fiddle with the settings in an open source operating system no matter how well documented it is. Some programmers just need to code in Java or Ruby. The internals of the operating system matters <i>very</i> little. Or imagine your normal school teacher. Would she care if the file format is proprietary or open source? So the question everyone should ask themselves: do I care enough about open source formats? Don't just drink the kool-aid that all open source software is good and benevolent and all closed source software is bound to lead you down to future incompatibilities. Pilgrim might have the clairvoyance to worry about being locked down to the Mac in the future. However, potential switchers should be prudent enough to weigh their options at the moment and decide on the best time to switch. It's anybody's guess how Apple might change their operating system in the future. While completely making it open source sounds a bit far-fetched (as I recall, all dying operating systems in the past became open source projects during their end of days. I will be interested to see the future of Open Solaris 10) Apple might just be more transparent with their file formats. So, holding off the switch might not be such a bad idea considering the pain that comes from switching from one of the more user-friendly operating systems out there to one where you have to actually edit a text file to change your screen resolution.
</p>
<p>
Anyway, my prediction on this? I supposed that some other people (who are already on the verge of switching, mind you) will see this as the impetus they need to switch from the OS X to some other operating system. However, this number is going to be small. And it is going to be offset by the number of people who switch from some operating system to OS X. Moreover, people who can think objectively by themselves will be able to make up their own decisions. And not be influenced by these two people, be they Mac Nerds or not.
</p>
<p>
Heck, if Steve Jobs leaves Apple, I <i>might</i> be tempted to switch too. Who knows what kind of operating system his successor might approve of. It's all a matter of time and the number of choices available. At the moment, Windows XP is definitely not worth switching to. But who knows, Vista might be able to offer something better? Or Linux distros might have gotten so much better in a few year's time that it is worth switching over? But right now, yes this very moment, I do not see any reason to switch from OS X. It serves me well and I do not really care about open source formats. </p>
<p>
Oh yeah, by the way, no matter how hard Ubuntu becomes for these two prominent figures, I predict that they will NEVER swallow their pride and switch back. Well, maybe they will but that is another story altogether. And then we will get another round of excellent slashdot comments.
</p>
<p>
By the way, here is a <a href="http://www.linuxdevcenter.com/pub/a/linux/2006/06/01/switching-back.html">link</a> to an article on <a href="http://www.linuxdevcenter.com/">LinuxDevCenter.com</a>. The author is a long time linux user and just could not get used to the restrictive nature of OS X. In such a scenario, I agree that it is a perfectly good reason to switch <i>back</i> to Linux.</p>
What's a Ph.D in CS?2006-07-02T00:00:00+00:00http://vazexqi.github.com/2006/07/02/whats-a-ph-d-in-cs<p><a href="http://steve-yegge.blogspot.com/2006/07/wizard-school.html">Stevey's Blog Rants: Wizard School</a>:
</p>
<blockquote cite="http://steve-yegge.blogspot.com/2006/07/wizard-school.html" title="Stevey's Blog Rants: Wizard School"> "You hire a Ph.D., it's hit-or-miss. Some of them are brilliant. But then some subset of virtually every educated group is brilliant. The problem is that the notion of a Ph.D. has gradually been watered down for the last century. It used to mean something to be a Doctor of Philosophy: it meant you had materially advanced your discipline for everyone. Von Neumann, Nash, Turing -- people like that, with world-changing dissertations, they just don't happen that often anymore, at least not in CS. Well, they probably occur at the same frequency, but it's one in a thousand at best.
<br />
<br />
Instead, what usually happens is a bright young Ph.D.-to-be chooses a school based on expedience: finances, or location, or parental pressure. There might be a dozen or so advisors to choose from, and the department as a whole has only one or two really big, prestigious areas of focus, areas for which the school is known (and hence funded). So if a kid goes to a school that does a lot of X, chances are pretty damn good the kid's going to do her Ph.D. thesis in X. But it's probably specialized to death, and the kid will wind up working for years on some tiny slice of almost-nothing: little prototype mobile doodads that track forest monkeys or something. And the kid will lose faith, stop hoping their thesis will ever mean anything, and they'll go through the motions until their advisor pities them and lets them defend."
</blockquote>
<p>
Go read the article. It's (mostly?) fictitious but it does incorporate some snippets of truth.
</p>
Interesting features for Eclipse 3.22006-07-02T00:00:00+00:00http://vazexqi.github.com/2006/07/02/interesting-features-for-eclipse-3-2<p>
<a href="http://www.eclipse.org/">Eclipse</a> is one of the best IDE for Java. As a matter of fact, it if my preferred IDE for developing Java applications. However, writing plug-ins for Eclipse itself is no trivial task. And I have the utmost respect for people who worked on the Java Development Tools (JDT). Here are some of the features that seem useful for Eclipse 3.2
</p>
<p>All the new features can be accessed from the "What's New" menu item in Eclipse 3.2. Since I cannot seem to find the link to the web site (I could only find the one on Eclipse 3.1 <a href="http://help.eclipse.org/help31/index.jsp">here</a>) that details the features so we will have to make do with my descriptions. Whenever possible, I will stick with the Eclipse-given name for that feature.</p>
<p>
<ul>
<li>Introduce Indirection refactoring <br />
Introduce Indirection is a new refactoring that lets you redirect all callers of a method to a new method. The new method calls the original one. You can replace the default implementation of the new method by any other if you like. I think this would be really useful when I need to preserve the API for some old code.
</li>
<li>Refactoring history <br />
Most of the refactorings offered by JDT are now tracked in a Refactoring History. The refactoring infrastructure stores detailed information about refactorings which have been performed on your workspace. With a proper history of all the refactorings, I would be able to revert nicely to an earlier state. Also, it helps people who are reading my code to actually see the evolution of it. If this history can be checked in to a code repository, that would be better since all my team members would have access to it.
</li>
<li>Rename Type updates similarly named elements <br />
The Rename Type refactoring can now rename variables and methods with names similar to the renamed type. This feature helps to keep method and variable names synchronized with type names. For instance, if I have a class called Bar and a class variable called fBar, when I rename the class Bar to Foo, Eclipse can intelligently suggest that I rename fBar to fFoo.
</li>
<li>Category support <br />
Categories can be defined in Javadoc comments for types, methods, and fields using the @category tag. This is actually part of the <a href="http://www-128.ibm.com/developerworks/library/j-annotate1/">annotations</a> features that was introduced in Java 5.0. Basically, Eclipse is smart enough to filter based on the categories. This makes the IDE feel most like Smalltalk where methods are placed in different categories. This definitely makes finding the right method much simpler.</li>
</ul>
</p>
<p>For a more in-depth look at the other features for Eclipse 3.2, there is a nice article <a href="http://www.onjava.com/lpt/a/6644">here</a>.</p>
Deface any website! Including this one2006-07-02T00:00:00+00:00http://vazexqi.github.com/2006/07/02/deface-any-website-including-this-one<p>
<typo:lightbox img="179595283" thumbsize="medium" displaysize="large" alt="Dinosaur on this page" />
</p>
<p>
No, it's not a real defacement, but it is pretty fun. I could picture myself using the shooting mode on some useless sites. To join in the fun, head over to <a href="http://www.netdisaster.com/">netdisaster.com</a>
</p>
Blink2006-06-29T00:00:00+00:00http://vazexqi.github.com/2006/06/29/blink<p>
I just finished <i>blink</i> by <a href="http://www.gladwell.com/">Malcolm Gladwell</a>. Gladwell maintains a column at the pretigious <i><a href="http://www.newyorker.com/">New Yorker</a></i> of which I am an avid fan. I was actually interested in <i>blink</i> when it first came out a couple of months back but never got the time to purchase it. Anyway, I am glad that I did.</p>
<p><i>blink</i> has a lot to offer. Gladwell has done a fantastic attempt at codifying the abstract. How would someone actually try to explain something as ethereal as intuition without sounding like a fortune teller? It is in this area that Gladwell's flair for writing really shines. He begins the book with an example of how some art connoisseurs could tell that a piece of art (a <a href="http://www.gladwell.com/">kourous</a>, to be exact) was fake just by relying on their gut feeling. None of them were able to articulate why they have that gut feeling. In other words, most of them just could not put their finger on something. To them, that piece of art looked jarringly out of place. That intuition is what it means to think in the blink of an eye without actually thinking about it. And it comes from experience.</p>
<p>In fact, a couple of chapters through the book, Gladwell explains why sometimes it is important that you do not force yourself to deliberately articulate why you think something should be this way. Now, this goes against a lot against the principles we have been taught: do not say anything if you have nothing to back you up. However, in an experiment concerning the rating of fruit jams, participants' ratings of jams commensurate more with the experts' ratings when they were just asked to quickly rate the jams in quick succession. When the participants were asked to actually to justify their choices in words before giving a rank, their ratings were very different from the experts' choices.</p>
<p>Now, not everyone can actually describe why one type of jam is better than the next. It requires extensive yet precise terms that only a gourmet would possess. When an ordinary person like you or me is forced to describe food in words, we are not able to describe all the nuances in flavor clearly. As such, our description actually skews our intuition since we now think that description is more logical and thus must be paramount in our decision making. After all, we did spend an awful long time sitting there and coming up with <i>logical</i> descriptions of the jams.</p>
<p>This comes as a great shock to me. I have always believed that a good decision comes after some lengthy deliberation on my part. However, what Gladwell proposes is that in a situation where articulation is next to impossible, we should rely on our gut feeling. Of course, identifying that actual moment or scenario might be harder than we think. As a consolation for me, Gladwell's book does not seem to undermine the importance of actually making decisions. It is my pet peeve when someone is not able to make up their mind on simple decisions such as going out to catch a movie or going to eat dinner. But I digress...</p>
<p><i>blink</i> uses real-life examples to illustrate the points that Gladwell makes. As usual, Gladwell has done some extensive research and interviews and even if you do not believe everything in <i>blink</i> about intuition and gut feeling, you could just finish the book for the sake of knowing some juicy new anecdotes which you can share with your colleagues.</p>
<p>All in all, <i>blink</i> is a fairly quick read; one which you can definitely finish in about half a day especially if you are traveling.</p>
New many-to-many relationships in Rails2006-06-22T00:00:00+00:00http://vazexqi.github.com/2006/06/22/new-many-to-many-relationships-in-rails<p>This <a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3328384435">post</a> on a Smalltalk blog caught my attention. So, I headed over to the link and listened to the podcast. Mind you, I do subscribe to the <a href="http://podcast.rubyonrails.org/">Ruby on Rails podcast</a> but have not been religiously listening to each episode. Maybe I will from now on.</p>
<p>Anyway, something in that particular podcast piqued my interest. No, it wasn't the part about how similar Ruby is to Smalltalk. I came to that conclusion myself when learning Smalltalk after learning and using Ruby for some time. More interesting was the mention of a new construct for mapping many-to-many relationships. The venerable <code>has_and_belongs_to_many</code> now has a new sibling, appropriately called <code>has_many :through</code>.</p>
<p>I was running into some problems using <code>has_and_belongs_to_many</code> for my grading application. I wanted to join two tables using a relationship and I wanted to assign attributes on that relationship as well. It's kind of like the normal E/R diagram that you have showing a relationship on two entities with attributes on the relationship itself. Usually, what one would do is to create a table to represent the relationship and then add some fields to the table. Unfortunately, the previous release of Rails did not have nice support for adding attributes to the relationship. Refer to column "When a Join wants to Be a Model" page 232 of <a href="http://pragmaticprogrammer.com/titles/rails/index.html">Agile Web Development with Rails</a> to see the previously suggested way of handling this scenario.</p>
<p>Anyway, to cut a long story short, the latest version of Rails introduces the ability to clearly represent the join table using <code>has_many :through</code>. No longer would you use the un-object oriented way of <code>push_with_attributes</code> to add attributes to the join table. This makes my life so much easier and is a nice change to have in Rails. Moreover, the second edition of the Agile Web Development with Rails book already features this method.</p>
<p>In the mean time, there is a nice article about all this at: <a href="http://blog.hasmanythrough.com/articles/2006/04/20/many-to-many-dance-off">Many-to-many Dance-off</a></p>
Exploding and swelling laptops2006-06-22T00:00:00+00:00http://vazexqi.github.com/2006/06/22/exploding-and-swelling-laptops<p><img src="http://www.engadget.com/media/2006/06/toastylappy.jpg" alt="Dell Battery Explodes" /></p>
<p>My mom is using a Dell. I sure hope that it is not the same model that exploded above. The hot and humid weather here is just within the ideal temperature range for operating the laptop. But you never know what can happened. I bet they people in the picture were operating that laptop inside an air-conditioned room. It's most probably an isolated case but it is still dangerous. Imagine if your clothes caught on fire. </p>
<p>The MacBook Pro is not that safe as well. There have been pictures circulating about the swelling batteries that plague the earlier models. And here is something that is rather disturbing: a <a href="http://cnet.com.au/laptops/laptops/0,39035649,40063900,00.htm">distended battery</a>:</p>
<p><img src="http://cnet.com.au/i/g/40063900/sc001.jpg" alt="Distended MacBook Pro battery" /></p>
GTD bundle for Texmate2006-06-21T00:00:00+00:00http://vazexqi.github.com/2006/06/21/gtd-bundle-for-texmate<p><a href="http://skiadas.dcostanet.net/afterthought/2006/06/20/yet-another-gtd-bundle/">Yet Another GTD Bundle</a>:
</p>
<blockquote cite="http://skiadas.dcostanet.net/afterthought/2006/06/20/yet-another-gtd-bundle/" title=""> "Mike Mellor has been doing a lot of great work with the GTD bundle, which I must say I have not really followed, basically because I've had no time and my own ideas about how a GTD bundle should be. Here in fact is <a href="http://skiadas.dcostanet.net/uploads/GTDAlt.tmbundle.zip">my take on it</a>. It is kind of inspired by <a href="http://kinkless.com/">Kinkless</a> I guess."
</blockquote>
<p>I have not liked the idea of using a full fledge program just to implement GTD. In fact, I have always preferred just to have some program where I can enter text and check things off as being done or not. Of course, in this case, <a href="http://www.macromates.com">Textmate</a> and <a href="http://www.macvim.org">gVim</a> are both viable options, with me slightly more in favor of Textmate since I can customize it more easily. I do not really need a special organizer like Outlook because if I really need a specific time when I have to do something, I make it a point to put it into iCal so that it gets synched with my iPod and cell phone. Once, I tried using <a href="http://www.chronosnet.com/Products/sb_product.html">Sticky Brain</a> since it offered synching to iPod and Palm. However, I gave up on it because it was just so cumbersome to start it up. Also, Sticky Brain had a plethora of other <a href="/articles/2006/02/26/yojimbo-and-why-applications-should-be-written-this-way">annoyances</a>.</p>
<p>Anyway, there is already GTD bundle included in the subversion repository for bundles. However, I am not too pleased with it. I realized that it is still in its infancy but to me, it looks nothing more than a souped-up version of the TODO list bundle. And the way that it expects you to enter your tasks without being able to group them into nice projects just does not fare well with me. I am sure someone will work out all the kinks in due time. Or <em>maybe not</em> since everyone is jumping on the band wagon with too much ideas. Personally, I prefer a fairly stable conceptual model of the software to be determined before releasing the idea to the public. More often that not, mixing too many ideas from different people turns the original idea into some unrecognizable hodgepodge.</p>
<p>Here enters Haris Skiadas's take on the GTD bundle, appropriately called GTDAlt. I assume the "alt" stands for "alternative". Anyway, Skiadas has done a fairly complete version of the GTD (presumably from scratch?) that implements plenty of features already. I really like the fact that you can nest projects inside one another and the summary page (or the actions for context page) will recognize the relevant project. I also like the fact that you can give is a more natural date scheme: 3 weeks, 1 month, etc. But more importantly, this bundle has syntax highlighting, albeit with some quirks as I type the characters. For me, this mock up bundle has better functionality than the one inside the repository. Nonetheless, this scheme of GTD might no fare well with the other people. </p>
<p>So, I just thought that this will be a good time to write up on this bundle since it is fairly interesting. I am not sure whether Skiadas will follow up on this bundle (he has other bundles to his name but they have not been updated), but I might be interested in being able to have the summary page automatically post events to iCal using AppleScript. At the moment, the granularity for event resolution is based on days and not hours, so this probably might not be plausible.</p>
<p>In case anyone is curious, this entry was also entered using Textmate's blogging bundle. It might just begin to supplant MarsEdit for my blogging needs. It's kind of annoying actually, since I just paid for MarsEdit a few months ago! I am in no way insulting MarsEdit. It's a fabulous piece of software. Just that this blogging bundle is almost as fabulous and free! If you do not count the price of Textmate that is.</p>
<p>This is slightly off topic but I am glad that Textmate's cool features are implemented via bundles and not built-in to the application itself. This certainly prevents software bloat like - dare I say it? - Emacs.</p>
<p>Update: Either I am using the bundle wrongly, or there is something inherently wrong with the regular expression that is being used for syntax highlighting. After typing a few @actions, Textmate suddenly consumes 90% of the CPU and just sits there. I have been trying to debug this. If I remove the scope for the @actions from the language definition then I can type fine. Once I restore the entire language definition, the intermittent CPU spike happens. This is really annoying since this is really a great bundle otherwise.</p>
<p>Update: I changed some of the language definition for the line that is supposed to contain 4 match items. So right now, there is only going to be 2 colors: first color for the @word and another color for the rest of the text. I am not that familiar with regular expression so this is the simplest setting that made it not spike up the CPU usage. Also, I did add a small change to the notes so that the number displays in one color and the actual note in another. Finally, I moved everything into ~/Library/Application Support/Textmate/Bundles instead of ~/Library/Application Support/Textmate/Pristine Copy/Bundles since the original bundle does not like the new location. I cross my fingers and hope that Skiadas will offer a better fix.</p>
<p>Update: And indeed he has. Read the latest details on his new bundle <a href="http://skiadas.dcostanet.net/afterthought/2006/06/25/details-on-the-gtdalt-bundle/">here</a>.</p>
Testing Out the New Blogging Bundle in Textmate2006-06-20T00:00:00+00:00http://vazexqi.github.com/2006/06/20/testing-out-the-new-blogging-bundle-in-textmate<p>I am using the new blogging bundle in Textmate to write this entry. I was pretty impressed by the screencast found <a href="http://macromates.com/blog/archives/2006/06/19/blogging-from-textmate/">here</a> and decided to give it a go. You <i>must</i> take a look at the automatic image upload that happens at the end of the screencast. So far, I am pretty impressed by it. The fact that you can write a bundle to turn Texmate, a text editor into a blogging editor actually attests to how robust the underlying architecture is.</p>
<p>However, there are still some shortcomings that prevent me from using this as my primary blogging software. So far, all the previous posts titles are not cached. That means anytime I want to edit a previous entry, I would have to download the entire list and sort through them. There might be a per blog setting that can copy this list (or even keep a local copy of it) so that Textmate does not need to download the entire list every time. Once, this bundle is able to automatically store local copies of my blog entries, then I would probably to use this more than my current blogging editor, <a href="http://ranchero.com/marsedit/">Marsedit</a>. At the moment, I could definitely generate a folder and fetch each entry and store it into the newly created folder. However, it would be better if this feature was build in to the bundle. That way, I can issue a "synchronize" command and have the bundle check if any of the entries are different. A simple way to tell if they are different would be to check the date field. Anyway, the blogging bundle is still in its infancy but it is pretty useful already.</p>
<p>So I created this entry in Textmate and then uploaded it. I then fetched it again to make some edits. And it works!</p>
Score early; chances of future success is higher2006-06-17T00:00:00+00:00http://vazexqi.github.com/2006/06/17/score-early-chances-of-future-success-is-higher<p>
If there is one thing that the World Cup has taught me is that those who score early usually win the match. There is nothing more devastating than conceding a goal early in the match to your opponent. Conceding that goal not only upsets you and your team's demeanor but also sends you into panic mode for the rest of the game. Moreover, that one-up is even more devastating if it comes from a less well-known team.</p>
<p>
I guess it's the same with business. The company that strikes first usually dominate the market (at least while there is a market for that particular item). It does not matter whether you have the most superior product around; what matters is who gets it out to the consumer first. Once the other team has gotten that advantage, you have a lot of catching up to do. And no matter how much catching up you do, you must realize that your opponent can easily score another against you. You did not expect your opponent to <i>actually</i> wait for you to catch up, did you?</p>
<p>
Under such dire situations, what actions should the company take to help even out the playing field? Again, let's take a football analogy to things.</p>
<p>
<ul>
<li>Home ground advantage<br />
Depending on where you set up your business, there might be certain policies that might give you an edge. For instance, in some countries, you can be exempted from certain taxes for the first few months. Also, some countries encourage foreign companies by enticing them with a cheap work force. So, by choosing your location wisely, you might be able to gain an advantage over your opponent.</li>
<li>Yellow card/ red card<br />
In business, you never know when one of your competitors might have to pull out because of some unrelated reasons (read: management or politics). Or similarly, you never know when you or your opponent might get sued and have to remove something from their product. Such risks must be taken into account and might come in your favor.</li>
<li>Naturalized players<br />
Some football teams try to entice foreign players to play for them by giving them automatic citizenship. This is a hard offer to resist especially if your own country is not politically stable. So, in business, you can also do the same: entice the best people to come work for you!</li>
<li>What the referee cannot see, he cannot book you for<br />
It's true. Usually the referee will miss a couple of offenses because he cannot see it from his position. The same goes for business practices. Some shoddy practices go unnoticed either because no one sees it or someone paid a lot of money to keep the authorities quiet. I am not saying that this is the right thing to do but this really happens in the real world.</li>
<li>Play like there is no tomorrow<br />
Simple. If you are on the verge of losing, just risk everything you have. Some miracle might happen or it might not. However, you will give you opponents a fight that they will not forget anytime soon. Also, it keeps them busy so they cannot launch a well thought out plan against you.</li>
</ul>
</p>
<p>This is probably a weird entry. So blame it on the overdose of the Fifa World Cup.</p>
Why Startups Condense in America (and not somewhere else)2006-06-12T00:00:00+00:00http://vazexqi.github.com/2006/06/12/why-startups-condense-in-america-and-not-somewhere-else<p><a href="http://www.paulgraham.com/america.html">Why Startups Condense in America</a>:
</p>
<blockquote cite="http://www.paulgraham.com/america.html" title="Why Startups Condense in America"> "Singapore would face a similar problem. Singapore seems very aware of the importance of encouraging startups. But while energetic government intervention may be able to make a port run efficiently, it can't coax startups into existence. A state that bans chewing gum has a long way to go before it could create a San Francisco."
</blockquote>
<p>
When smart people talk, we should listen. And once again, Graham has presented us with a fine piece of article on his opinions why start-ups are blooming in America (mind you, mostly in certain <i>fertile</i> areas only) and not in other countries. The points are pretty valid if you read it with an open mind and not fall into the trap of thinking that he is biased toward America.</p>
<p>I believe that Graham is one of the most influential advocate for startups. He believes that most (if not all) great ideas come from individuals who have nothing to worry about but to create great technologically sound products. And that is how he argues in his article. I guess the most important point Graham makes in his article is that you cannot have a big company happen overnight. It must start small, like in a startup. And then from that little startup, it might grow into something big (or it might go down the drain, but that's not too bad since it started small and no one lost too much). On the other hand, if you start BIG, you are most likely to fail since that bloated government funded piece of project is probably not going to reach the critical mass that is necessary to sustain itself in the future without annual funding from the government.</p>
<p>
In short, techies come first. And then the managers. Not the other way around. It's the same way most thriving ecosystems work.</p>
<p>
Based on Grahams observations, it is highly probable that the <a href="http://www.msc.com.my/">Multimedia Super Corridor</a> in Malaysia will not take off. This project was conceived almost 5 years ago and has nothing much to show yet. In fact, news of it seems to have been dwindling exponentially since its conception. Again, based on Graham's postulates, this is probably due to the heavy government investment and the dearth of entrepreneurs in that area.</p>
<p>Of course, one go could on and on arguing on the merits of Graham's arguments. But we shall leave that for the <a href="http://programming.reddit.com/info/6vtl/comments">comment</a> section of his article. The most important thing to draw from his article is that the proper environment and infrastructure must be provided first before anything really interesting can transpire. Artificially simulating an oasis for tech companies will probably not be the ultimate solution. Nevertheless these artificial Silicon Valleys might serve as catalyst for the <i>real</i> ones in the future. But so far nothing really great has transpired.</p>
Wireless service set up2006-06-07T00:00:00+00:00http://vazexqi.github.com/2006/06/07/wireless-service-set-up<p>
Went back to Malaysia and had to bear the slow internet speeds that we have here. Finally managed to install <a href="http://www.tm.net.my/html/pstreamyx.cfm">Streamyx</a>, the only broadband connection that is being offered in Malaysia. Online registration is available but it takes three days for the service to activate. Moreover, even with the online registration, you have to go to the store to pick up a completely useless piece of CD that contained some video tutorials on how to connect the ADSL modem.
</p>
<p>
In the end, everything went alright. The DSL connection is a bit flaky in my area and it takes a couple of minutes for the handshake to be established. I signed up for the 1 Mbps option but was not able to get much more than during normal times. Probably the situation will improve when I use the connection in the wee hours of the morning.
</p>
<p>
Fortunately, I also opted for a wireless router. That way I need to go bury myself in the small room where the computer lies. The wireless connection is pretty steady and at least it provides a better alternative compared to connecting - or god forbid, taking turns to plug into the ethernet port - three notebook computers into a hub.</p>
<p>
Well, the speed is decent and I am able to actually use the service with my MacBook Pro which does not come with a modem so dial-up is not an option. Back to reading my articles and getting all the latest updates. With this decent connection, I will probably be able to post more often to this blog.</p>
Making good use of the Apple Remote2006-06-07T00:00:00+00:00http://vazexqi.github.com/2006/06/07/making-good-use-of-the-apple-remote<p><a href="http://www.iospirit.com/index.php?mode=view&obj_type=infogroup&obj_id=23">Remote Buddy > Overview // IOSPIRIT - fueling creative minds worldwide ..</a>:
</p>
<blockquote cite="http://www.iospirit.com/index.php?mode=view&obj_type=infogroup&obj_id=23" title="Remote Buddy > Overview // IOSPIRIT - fueling creative minds worldwide .."> "The latest Macs ship with a remote control that allows you to control Front Row and a couple of Apple's applications. Beyond that, you can't do much else with it, though. Remote Buddy fundamentally changes this. It gives you control over the rest of your computer via the remote control and also improves the available functionality in those apps that already supported the remote control by themselves"
</blockquote>
<p>(Via <a href="http://project.ioni.st/">Project.ioni.st</a>.)</p>
<p>
I am definitely going to install this. Probably might not be the most stable thing application around, but hey, Front Row was really buggy as well even when it first came out. Also, the integration with Photo Booth alone is enough to tempt me to buy it. I have been showing off Photo Booth to my family and friends but it is really annoying to have to click on the mouse when I want to take a picture.
</p>
<p>
Apple will probably release something else (or they might not) that allows better functionality but for the time being, Remote Buddy is definitely going to help many new Mac owners make use of the Apple Remote.
</p>
Video iPod2006-05-04T00:00:00+00:00http://vazexqi.github.com/2006/05/04/video-ipod<p>
My 3rd Gen iPod which lasted me about 2.5 years finally gave up on me. Well, it did not stop working; it's battery life just got so abysmally short that there was not much point touting that thing around anymore. I tried all means of trying to resuscitate it but to no avail. Interestingly, I just found out that my friend, <a href="http://cheahcf.com">Chin Fei</a> also had the same problems with his iPod, which was a few days younger than mine. The left side of the iPod was slightly protruded as if something had expanded inside.
</p>
<p>
<img src="http://images.apple.com/ipod/images/indexfrontside20051011.gif" />
</p>
<p>
Anyway, I settled for the 30 GB Video iPod. It arrived today with my custom engraving and it works fine. I am pretty sure that this new generation of Video iPod is much better than the one that came out before. It's thin and it does not weight so much. The only downside is that it charges and syncs using a USB port. I am using a Macbook and USB ports are scarce resources! </p>
<p>
Now, what should I do with a 30 GB Video iPod? Fortunately someone has answered that question for me: <a href="http://www.kottke.org/plus/50-ways-ipod/">50 Fun Things To Do With Your iPod</a>. Oh, did I mention that having the album art displayed on the screen is really cool?
</p>
Vim 7.02006-05-03T00:00:00+00:00http://vazexqi.github.com/2006/05/03/vim-7-0<p><a href="http://www.linux.com/article.pl?sid=06/05/01/2235242">Linux.com | First look at Vim 7</a>:
</p>
<blockquote cite="http://www.linux.com/article.pl?sid=06/05/01/2235242" title="Linux.com | First look at Vim 7"> "The final release of Vim 7 is just around the corner, and it brings a number of new features to the venerable editor, including spell checking, omni completion for several programming and markup languages, tab pages, undo branches, and several other features that are worth upgrading for."
</blockquote>
<p>
<a href="http://www.flickr.com/photos/vazexqi/140018811/" title="Photo Sharing"><img src="http://static.flickr.com/49/140018811_214b4e8d72.jpg" width="380" height="500" alt="gVim 7.0 Beta" /></a>
</p>
<p>
As you can see, there is a tab bar (it can be repositioned). The command to invoke the tab bar is <code>:tabnew</code>. And to cycle through those tabs, use <code>gt</code>. Of course, since I am using gVim, the mouse works fine too.</p>
<p>
Another feature is spell completion. You can activate it by issuing <code>:setlocal spell spelllang=en_us</code>. There are some other languages but EN_US is the only one I have tried. You can even get a nice spelling suggestion by doing <code>z=</code></p>
<p>
Finally, there is a new interface for word completion. The same commands are used to invoke it: <code>^N</code>. This feature can now be tied in for some intelligent code completion via <code>omnifunc</code>. Update: To turn this feature on, you can do something like <code>set filetype=on</code> and <code>:filetype plugin on</code>. Enabling those two settings appears to give me some smarter text completion while I was testing it on a HTML page. You invoke the intelligent completion using Ctrl-x Ctrl-o. For instance it knows that the next tag to complete will be the one that I am currently under. The annoying thing is that for the HTML plugin, you can only scroll with the arrow keys (for me, at least) and you cannot continue typing to narrow your search.</p>
<p>
<a href="http://www.flickr.com/photos/vazexqi/142236147/" title="Photo Sharing"><img src="http://static.flickr.com/56/142236147_3b6a145b4e.jpg" width="499" height="338" alt="Auto completion when you have specified the </ characters" /></a>
<br />
<a href="http://www.flickr.com/photos/vazexqi/142236148/" title="Photo Sharing"><img src="http://static.flickr.com/53/142236148_5a3e550275_o.png" width="499" height="338" alt="Auto completion when only the '<' character has been typed" /></a>
</p>
<p>
If you have been using vim for some time now, this should be a good upgrade. Grab the universal build for the Mac<a href="http://macvim.org/OSX/index.php#Downloading"> here</a>.</p>
<p>
Update: <a href="http://www.macdevcenter.com">MacDevCenter.com</a> has a nice <a href="http://www.macdevcenter.com/pub/a/mac/2006/07/11/vim-is-easier-than-you-think.html">article</a> detailing how to install Vim 7.0 on your mac. Also, take a look at this <a href="http://amix.dk/index.py/permanentLink?id=130">page</a> that shows some of the new features of Vim in .gif files.</p>
When a search engine advertises on TV, something is not right2006-04-24T00:00:00+00:00http://vazexqi.github.com/2006/04/24/when-a-search-engine-advertises-on-tv-something-is-not-right<p><a href="http://www.searchengineguide.com/searchbrief/senews/007145.html">Ask.com Promoting Hard Via Commercials</a>:
</p>
<blockquote cite="http://www.searchengineguide.com/searchbrief/senews/007145.html" title="Ask.com Promoting Hard Via Commercials">
"2.) The commercials creep me out. They royally creep me out. I don't think chimps, apes, orangutans or any type of primate is funny. I hate commercials that put primates in people clothes, though not as much as I hate commercials or movies that make people look like apes. It just seems like such a cheap trick to me, old and overdone. I would have expected something more innovative from Ask."
</blockquote>
<p>
If you have not watched them, you can find them <a href="http://blog.ask.com/2006/03/ask_in_primetim.html">here</a>.
</p>
<p>
The features that are highlighted are useful but it would not be the deciding factor for which search engine people use. Just try searching for a phrase and then compare the results from Ask.com and Google. Even with all so called nifty features, Ask.com has much less results. Maybe they would claim that their searches are more relevant compared to those from Google but relevance is a very subjective term. And when everyone is free to define their own relevance, more choices is usually better.</p>
<p>
And those features are nothing new. A couple of other search engines already have it. Unless you have something really nifty that people cannot understand (which means that it is a bad idea in the first place) you should really not be advertising.</p>
<p>
Anyway, back to the point. Advertising on the TV for an Internet search engine seems to imply certain doom. </p>
Using Opera 9.0 Beta2006-04-20T00:00:00+00:00http://vazexqi.github.com/2006/04/20/using-opera-9-0-beta<p>Update: Opera is no longer beta software as of today, June 20 2006. However, they still did not fix the annoying javascript resize bug. I absolutely love being able to resize my window to predetermined widths using <code>
javascript:self.moveTo(0,0);self.resizeTo(1280,screen.availHeight);
</code>. </p>
<p>
Usually I don't like using new web browsers on the Mac especially if they do not conform to the normal UI. However <a href="http://opera.com/download/index.dml?ver=9.0b">Opera 9.0 Beta</a> has some compelling features that make it worth using (kind of). I am not going to use it as my primary web browser; instead I am using its built-in IRC client. Its IRC client seems to be solid so far and enables me to download files using DCC easily. And if you are without a decent newsgroup reader, Opera's built-in one seems to be on par with Mozilla Thunderbird.
</p>
<p>
Previously, I was using <a href="http://colloquy.info/">Colloquy</a> but they have not produced a stable Universal Binary yet. And the nightly builds have been giving me nothing but intermittent loss of connections. And, yes, Opera 9.0 Beta is a Universal Binary.
</p>
<p>
Since I was not able to find any screenshots on this, here is my own:
<br />
<a href="http://www.flickr.com/photos/vazexqi/132137900/" title="Photo Sharing"><img src="http://static.flickr.com/50/132137900_f220d813c7.jpg" width="500" height="387" alt="Chat on opera" /></a>
<br />
It took some time to figure out how to move the toolbars around. Basically, you cannot drag the toolbars around. Instead, you have to remove the buttons and add new ones. Took some time for me to figure that out as well. Also, this is not the default theme for Opera 9.0</p>
<p>
Overall, browsing with Opera is not too bad. In fact, it does not seem to hog all my machine's resources even when I am viewing a page with flash. It does have some annoying bugs at the moment. One of which is that the following javascript does not have any effect on it.
<br />
<code>
javascript:self.moveTo(0,0);self.resizeTo(1280,screen.availHeight);
</code>
<br />
It has been reported and I hope it gets fixed soon. It's a real pain on the Mac to browse without the ability to resize the window to a fixed width I have a non-standard screen resolution (1440 x 900 ).
</p>
<p>
Opera 9.0 also spots integrated BitTorrent support but I have not had the time to try that out yet.</p>
<p>
Anyway, Opera does have a steeper learning curve compared to Firefox. And it does not have as many plug-ins. However, it does feel to be a more solid browser compared to Firefox.
</p>
Software engineer and college professor are the best jobs in America2006-04-12T00:00:00+00:00http://vazexqi.github.com/2006/04/12/software-engineer-and-college-professor-are-the-best-jobs-in-america<p><a href="http://money.cnn.com/magazines/moneymag/bestjobs/">MONEY Magazine's Best Jobs</a>:
</p>
<blockquote> "MONEY Magazine and Salary.com researched hundreds of jobs, considering their growth, pay, stress-levels and other factors. These careers ranked highest.
<br />
1. Software Engineer
<br />
2. College professor..."
</blockquote>
<p>(Via <a href="http://developers.slashdot.org/developers/06/04/12/1353238.shtml">Slashdot | Software Engineers Ranked Best Job in America</a>.)</p>
<p>
Just the motivation I needed to continue with graduate studies in software engineering. I am seriously thinking of working as a software engineer or a college professor. And this decision was before this ranking was announced. It is either one of the other, does not seem that it is possible to be both. A college professor sounds more interesting though.</p>
There are some things that you will regret forever...2006-04-08T00:00:00+00:00http://vazexqi.github.com/2006/04/08/there-are-some-things-that-you-will-regret-forever<p>
And this is one of them: <a href="http://maczot.com/discuss/?p=44">MysteryZot</a>!. I cannot believed that I paid $15 for it. Those are all DUMB programs. Programs that I do not see myself using or paying for. With $15, I could have bought 3 decent meals. This has been a bad purchase. I seriously would suggest not buying these kinds of software. I don't even know who buys those software. The price might sound cheap to some($9.95 is actually not cheap to me) but I don't see how these kinds of software will be useful in the long run.
</p>
<p>
Now, this is only my opinion so other people might find them useful. Though I seriously doubt it.</p>
Designing better teams in classrooms2006-04-08T00:00:00+00:00http://vazexqi.github.com/2006/04/08/designing-better-teams-in-classrooms<p><a href="http://www.oreillynet.com/mac/blog/2006/04/one_reason_why_industry_doesnt_1.html?CMP=OTC-13IV03560550&ATT=How+Instructors+Can+Design+Better+Teams+In+The+Classroom">How Instructors Can Design Better Teams In The Classroom - O'Reilly Mac DevCenter Blog</a>:
<blockquote> "So what's my suggestion for how we can improve the classroom? It's simple: don't distribute the brain power, and keep the standards high. Build teams so that everyone in the team is on equal footing and tailor projects accordingly. That means put the smartest kids together and put the not-so-smartest kids together. For some, that idea will immediately seem unfair and cruel, but think about it. If you faithfully apply this approach throughout an academic career, it should ultimately allow the smart kids to excel far beyond what they could otherwise do in a mediocre team, while forcing everyone else to get with the program, or get out of the program (literally). But in most cases, I really do think that everyone ends up learning more, and for me, that's a big a win-win for everyone. More productivity. More education. Less waste. And less folks end up making it through with a degree that maybe they shouldn't have made it through with (the coasters and clueless.)"
</blockquote>
</p>
<p>
I have been a undergraduate teaching assistant for 4 semesters now. And this is the first time that I have heard this method of forming groups. There are usually two ways that we form groups. One being that we, as course staff, will evaluate everyone based on their scores on homework and exams so far and try to distribute them into groups. Usually there is a sweet spot for the average score of the group members but we also do not lump the smartest together with those at the bottom of the class into an <i>average</i> group. The benefit of this is the diversity we have in groups. Students get to meet with people that you would otherwise not associate with. Also, as my professor says, research done about assigning groups has shown that such groups tend to have a higher success rate of completing their projects. Success in groups is always a good thing especially when it affects your grade.</p>
<p>
The other method for deploying groups would be to let the students form their own groups. Usually this turns out to not be such a good idea. Students who take the course together with their friends will usually form their own groups. Sometimes this can be beneficial since they are familiar with each other's work habits. However, this may also lead to conflict since it is harder to <i>coerce</i> you friend's commitment to the project. And individuals who come in to take the class alone will have to hunt around to find good group members. In the end, to minimize the risk of working with uncommitted people, these individuals would rather work on their own.
</p>
<p>
Getting back to the point here, the method of assigning groups by lumping all the smart kids together might not really be such a good idea. Sure you would get a group of smart students that are probably going to be able to create a great project. However the real world does not work like that (unless you are in academia where all your colleagues have Ph.D's as well). You will meet all sorts of people in the world. There will be those who will not be as smart as you but they have other redeeming qualities. Also, what if you are working for a company? You do not have a choice with whom you work with? What if you are working at Microsoft and Bill Gate's son is being a dumbass? (This is a lame example). A better example (thanks to the lecturer for the class I am teaching) would be that the idiot sitting beside you now in class might turn out to be your future boss. And now, what would you say to that? Working with someone you once considered an idiot? </p>
<p>
Classroom is not only about educating people in technological knowledge. There should also serve as a preparation for getting the students to work in the real world. People need to work together and learn together in the real world. No one will be there to sieve out the smart from the dumb for you. In fact, the same rules in the classroom might not even apply. People living in the real world can potentially cheat their way to achieve something better. There wouldn't be any professor or cheater checkers there to enforce the academic integrity rule.</p>
<p>
So bottom line, I think that the course staff should intervene a bit in group formation. Probably they do not need to upset every group but they should perturb the group demographics a bit. Let the students form their own groups first and then based on some predetermined criteria decide whether those teams should work together or not. The goal of the group project is not so much to get a grandiose project but to ensure that everyone gets a fair shot at contributing to the group and learning at the same time.</p>
<p>
Of course, usually class projects take place at the end of the semester and there is not much time to evaluate how things will go. If possible, I would like to form groups earlier during the semester and then switch members around. That way at least most people get a chance to work with different people and find their more compatible group partners. I believe that everyone has the ability to contribute and all they need is some motivation. By lumping the <i>coasters and clueless</i> together, it would be hard for them to motivate each other. Besides, education is for everyone, not only the privileged few.
</p>
Front Page gone... at last!2006-04-07T00:00:00+00:00http://vazexqi.github.com/2006/04/07/front-page-gone-at-last<p><a href="http://office.microsoft.com/en-us/assistance/HA101205221033.aspx">Microsoft Office Assistance: The next generation of Microsoft application building and Web authoring tools</a>:
<blockquote> "
What happened to FrontPage?
<br />
After nine years of being an award-winning [this is BS; if it is that good why would you discontinue it?] Web authoring tool, FrontPage will be discontinued in late 2006. We will continue to serve the diverse needs of our existing FrontPage customers with the introduction of these three brand-new application building and Web authoring tools using the latest technologies, Microsoft® Office SharePoint® Designer 2007 for the enterprise information workers, Microsoft® Expression™ Web Designer for the professional Web designer and Microsoft® Visual Studio 2005 for the Web developer."
</blockquote>
</p>
<p>(Via <a href="http://channel9.msdn.com/ShowPost.aspx?PostID=180403#180403">Goodbye FrontPage - We will Miss You :-(</a>.)</p>
<p>
I do not usually blog about such things but I find that this is not a sad event but a rather joyful one. I really hate Front Page. I touched it once when it came out in Office 2000. And once again in Office 2003. Both times, it has annoyed me to no end. I cannot put my finger on it. Its interface is really bad for coding. And it does not have a good set of templates. Also, I think it tries to include weird tags that only Microsoft products can use. Eventually I just decided to use <a href="http://www.macromedia.com/software/dreamweaver/">Dreamweaver</a> (although I feel that the latest version is a bit too bloated for its own good as well) and just coding some web pages using raw HTML.
</p>
<p>I am not the only one who thinks that Front Page should just go down the drain. Check out what the <a href="http://channel9.msdn.com/ShowPost.aspx?PostID=180403#180403">Channel 9</a> guys have to say. Also, see what <a href="http://digg.com/software/FrontPage_2003_is_dead">Digg.com</a> has to offer.</p>
<p>
Another product that has been a constant annoyance to me is <a href="http://office.microsoft.com/en-us/FX010857981033.aspx">Visio</a>. However, that is just probably my opinion since all I need is something simple like <a href="http://www.omnigroup.com/applications/omnigraffle/">OmniGraffle</a>.
</p>
The Mac will run Windows..2006-04-06T00:00:00+00:00http://vazexqi.github.com/2006/04/06/the-mac-will-run-windows<p>
using dual-boot or <a href="http://www.kernelthread.com/publications/virtualization/">virtualization</a> technology. That is my prediction. Well, it's no longer a prediction since both options are available right now. However, dual-booting and virtualization are a few of the key features that the next version of OS X will tout. This might have been one of the reasons for switching over to the Intel platform. As far as I know, virtualization support is now being <a href="http://www.intel.com/technology/computing/vptech/">incorporated</a> into the latest Intel chipsets. In fact, the Core Duo chips already support this feature.
</p>
<p>
Anyway, I did not try <a href="http://www.apple.com/macosx/bootcamp/">Boot Camp</a> since I felt that having to restart my machine just to use Windows is not a a good option at the moment. There are other <a href="http://www.macworld.com/2006/04/firstlooks/bootcampfl/index.php">people</a> who have reported success with this setup and the <a href="http://www.furrygoat.com/2006/04/boot_camp_day_1.html">scores</a> for running Windows on a MacBook Pro are pretty impressive overall. However all that might change if some game comes out. After all, why else would someone actually <i>use</i> Windows? Speaking of games, there is a short <a href="http://www.macworld.com/weblogs/gameroom/2006/04/bootcampgames/index.php?lsrc=mwrss">article</a> on how this might affect the Mac game industry.
</p>
<p>Anyway, I spent the whole night trying to install Fedora Core 5 on <a href="http://www.parallels.com/">Parallels</a>. Every step was easy and there were not weird contrived instructions like what <a href="http://openosx.com/wintel/index.html">Open OSX Wintel</a> had me do. I strongly suggest not buying Wintel and instead just get your hands on <a href="http://www.kberg.ch/q/">Q</a>. If you are wondering, I did not buy that product; my friend bought it and I just used it. In fact, Parallels behaved similarly to <a href="http://vmware.com/">VMWare</a> and I was able to get it setup quickly. However, even after trying to install Fedora Core 5 for 3 times, it would not work. Trying the suggestions on the <a href="http://forum.parallels.com/thread27.html">Parallels forum</a> did not help. The installation completed successfully but the post installation failed dumping the <a href="http://homepage.mac.com/vazexqi/images/dump.png">following</a> to the console. I posted to the support forums and am eager to hear what they have to say.</p>
<p>
Fedora Core 5 is not officially <a href="http://www.parallels.com/en/products/guest_os/">supported</a> yet on Parallels so that could be why the installation was failing. So I decided to try Fedora Core 4. Installation went quickly and I was up and running within 30 minutes or so. Here are some screenshots. Networking is working nicely using the ethernet connection. I will try the wireless connection in the next few days. The only thing not working right now is sound, but that is probably not a big factor. Even two finger scrolling works for me. The speed is on par (if not faster) to that of VMWAre on a a Dual Xeon 1.5 GHz with 1 GB RAM. </p>
<p>
<a href="http://www.flickr.com/photos/vazexqi/124546913/" title="Photo Sharing"><img src="http://static.flickr.com/52/124546913_2890733248.jpg" width="500" height="382" alt="Fedora Core 4 on Parallels" /></a>
<br />
<a href="http://www.flickr.com/photos/vazexqi/124546914/" title="Photo Sharing"><img src="http://static.flickr.com/38/124546914_7664c52837.jpg" width="500" height="382" alt="Games in Fedora Core 4 on Parallels" /></a></p>
<p>
Update: It now runs Fedora Core 5! Thanks to the replies I got from the Parallels forum. Interesting enough, the problem seems to occur with having more than 512 MB of RAM allocated for the guest OS. I did not bother trying other amounts, but I know that it works with 516 MB but fails with 600 MB, 700 MB, 768 MB and 1148 MB.
</p>
<p>
Updated (April 17, 2006): If you follow the thread <a href="http://forum.parallels.com/thread451.html">here</a> you should be able to bump the memory up to 1024 MB as the thread claims. I have tried it and Fedora Core 5 runs fine for me at 768 MB. It's definitely snappier than limiting it to 512 MB of RAM.
</p>
<p>
<a href="http://www.flickr.com/photos/vazexqi/124859623/" title="Photo Sharing"><img src="http://static.flickr.com/37/124859623_871bd2710b.jpg" width="500" height="382" alt="Fedora Core 5" /></a>
</p>
<p>
Anyway, the MacBook Pro has turned out to be a very interesting purchase. In fact, with all these new technologies coming up, Apple might actually be on the winning side. Apple might actually gain a lot more publicity from all the noise generated from being able to boot into multiple OS's. And noise generate is always good. I believed that Apple's stock rose after the incidents that occur these past few days.</p>
<p>
The $50 price tag for Parallels is not too much to pay for something that works as good as advertised. In fact, unless OS X 10.5 has something built-in, Parallels would probably be able to make some $$ from Mac users. After all, right now, there is no serious competition yet. VMWare is still Linux and Windows based so Parallel has gotten a good start. Moreover, for people using a combination of Windows machines, Macs and Linux boxes, Parallels will be an excellent option. Unless you want to tinker with something like <a href="http://fabrice.bellard.free.fr/qemu/">Qemu</a> or <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/">Xen</a>.
</p>
<p>
Without stretching the idea too far, the MacBook Pro might well become the ideal development environment with virtualization. Imagine being able to test your app on Windows, Mac and Linux at the same time.</p>
Making full use of the MacBook Pro2006-04-06T00:00:00+00:00http://vazexqi.github.com/2006/04/06/making-full-use-of-the-macbook-pro<p>
<a href="http://ialertu.com/">iAlertU</a> makes use of the sudden motion sensor system built-in to the MacBook to detect when someone moves the computer. You arm this security system like you would on a car, using a remote control - or in this case the Apple Remote.
</p>
<p>
This was something that my friend Ellick was working on last two weeks but this developer beat him to it.
</p>
Haiku2006-03-30T00:00:00+00:00http://vazexqi.github.com/2006/03/30/haiku<p>
Here are some <a href="http://en.wikipedia.org/wiki/Haiku">Haiku</a> that I wrote for my East-Asian Literature class. I had to choose one to submit but I will probably use the rest as part of my e-mail signatures in the future. I did not go through all of them so there might be some errors in the number of syllabus. Also, the raw HMTL is kind of bad since I was trying to use Textile in a weird manner.
</p>
<p><strong>Trusting a rodent</strong></p>
<p><em>Punxsutawney Phil</em></p>
<p><em>Someone shoot that groundhog dead</em></p>
<p><em>Winter six more weeks</em></p>
<br />
<p><strong>Summer Sweat</strong></p>
<p><em>Mosquitoes flutter</em></p>
<p><em>Marshmallows and ghost stories</em></p>
<p><em>Rain puts out the fire</em></p>
<br />
<p><strong>Web surfing</strong></p>
<p><em>404 not found</em></p>
<p><em>Try using google.com</em></p>
<p><em>Page can’t be displayed</em></p>
<br />
<p><strong>Missing</strong></p>
<p><em>Waiting for room mate</em></p>
<p><em>Sad and lonely in the room</em></p>
<p><em>Dog came home instead</em></p>
<br />
<p><strong>Spankin’ New Display</strong></p>
<p><em>First snow, then silence</em></p>
<p><em>Display not found; drivers fail</em></p>
<p><em>Welcome to Windows</em></p>
<br />
<p><strong>Snow flakes</strong></p>
<p><em>Hot cocoa in hand</em></p>
<p><em>Ice flakes falling from the clouds</em></p>
<p><em>There is nothing but</em></p>
<br />
<p><strong>Summer’s night</strong></p>
<p><em>Crickets are chirping</em></p>
<p><em>Nuts and beer on the table</em></p>
<p><em>Men discuss their problems</em></p>
<br />
<p><strong>Capybara</strong></p>
<p><em>The capybara</em></p>
<p><em>It wanted to eat a worm</em></p>
<p><em>It bit its own tail</em></p>
<br />
<p><strong>Spring</strong></p>
<p><em>Wind caressing face</em></p>
<p><em>Flower and trees; twigs no more</em></p>
<p><em>Winter is gone, spring comes</em></p>
<br />
<p><strong>The beggar</strong></p>
<p><em>Lying in the streets</em></p>
<p><em>The pavement is his home now</em></p>
<p><em>What if it were you?</em></p>
<br />
<p><strong>Return from the rain</strong></p>
<p><em>Splatter, splatter, splat</em></p>
<p><em>Frogs and fish come out to play</em></p>
<p><em>Muddy prints on floor</em></p>
<br />
<p><strong>Beach fun</strong></p>
<p><em><span class="caps">SPF 15</span></em></p>
<p><em>Beautiful girls in short skirts</em></p>
<p><em>Look like red lobsters</em></p>
Coding Like a Girl2006-03-29T00:00:00+00:00http://vazexqi.github.com/2006/03/29/coding-like-a-girl<p><a href="http://37signals.com/svn/archives2/beautiful_code_testfirst.php">Beautiful code, test-first - Signal vs. Noise (by 37signals)</a>:
<blockquote> "I was talking with a friend recently and discovered we have a failing in common: we both have a tendency towards a peculiar form of perfectionism. He was telling me how he feels like he has to sit and tweak his code over and over until it not only acts right, but looks right. It cannot be merely functional, it must be beautiful, as well."
</blockquote>
</p>
<p>(Via <a href="http://headrush.typepad.com/creating_passionate_users/2006/03/code_like_a_gir.html">Code Like a Girl</a>.)</p>
<p>
While programming in Squeak, I find that I am compulsive about making the code beautiful. And the Smalltalk language makes that really possible because of its syntax. Also, reading the book <a href="http://www.amazon.com/gp/product/013476904X/104-8464842-4903943?v=glance&n=283155">Smalltalk: Best Practice Patterns</a> helps too. And I do not mean doing ridiculous stuff like making beautiful function headers. I mean making Smalltalk code look like it should: short, simple and human readable.</p>
<p>
I am not an expert at this, but from looking at the source code and reading the book, here are some of the things that I notice.
<ul>
<li>Minimal comments <br />
Some people like having comments there. I agree that sometimes comments are necessary but with code like Smalltalk or Ruby, having comments would easily make the ratio of comments to code increase dramatically.
<br />
<code>
Bin >> run <br />
"Tell my station to process me." <br />
self station process: self <br />
</code>
</li>
<li>Put methods in the right protocols <br />
I am not sure why other languages do not have this facility, but you can group methods in Smalltalk into protocols. This makes it really easy to see those methods that you need. For instance, want to find out how to create the object, look at the methods in the <code> instance creation </code> protocol. Want to convert from objectA to objectB? Look into the <code> converting </code> protocol. Grouping methods into the proper protocols really makes it easier to find those that you need.</li>
<li>Use polymorphism instead of compare statements <br />
Smalltalk did away with long if...else and case statements. And because of that , it forces you to think in a more dynamic sense as well.</li>
<li> Short methods <br />
Most methods in Smalltalk should be about 3 - 4 lines of code. And this is actually enforced by the way that methods are being displayed in the code browser. Unlike traditional source code viewers, in Squeak, you can only view one method in one window at any time. Of course you are free to open multiple windows, but each window can only show one method at a time. And the size of the pane for showing the method is not that big either. So it forces you to write short methods since it is really hard for you to keep track of stuff otherwise.
</li>
<li>Using collections <br />
Smalltalk provides a rich set of collections: Arrays, Dictionaries, OrderedCollections, SortedCollections, Sets, etc. In fact because these collections are so fundamental, they are being used everywhere. It is completely nonsensical to cook up your own data structure when there are so many provided for you.
</li>
<li> Readable code <br />
<code>
chatSession sendMessage: 'Hello there!' to: 'myfriend@friend.com'
</code>
<br />
You understand what it means instantly because it reads correctly. Not many languages out there have the sense to make their parameters key-word based.
</li>
</ul>
</p>
<p>
The point being that code that is not following those standards feel really, really bad and sloppy. It is almost like leaving spaghetti stains on your white shirt. Sure no one would care about it since you are still clothed and all, but it just becomes an eye sore.</p>
<p>
Regardless of the programming language, one should always stick with the proper convention of doing stuff. Program in C, stick to the C convention. Program in Java, stick to the Java style.</p>
Bookmarking habits2006-03-20T00:00:00+00:00http://vazexqi.github.com/2006/03/20/bookmarking-habits<p>
Why do people need so <i>many <sup>1</sup></i> bookmarks? Simple question right? But what is the real answer? Based on my surfing habits, I realize that I really do not need bookmarks all that much. There are going to be a few websites that I consistently accessed so I have bookmarks for those. And the rest of my bookmarks are, for the most part, untouched and unknown. For people with bookmarks in the range of hundreds or so, how many of them do you actually remember? How many do you actually access? And do you store enough information with each website to actually remember <i>why</i> you bookmarked it? Go pick 5 random ones and tell me how much you can tell me about them?
</p>
<p>
Bookmarks are not really useful for the most part. Why? If you surfing and you come across an interesting article, what do you do? Most people would bookmark it. But I will actually save the entire web page into a program such as <a href="http://www.barebones.com/products/yojimbo/index.shtml">Yojimbo</a> so that I can quickly access it next time I need it. This is beneficial in two ways. Firstly, if the website goes down or the author decides to remove that article, I still have a local copy of it. Secondly, I can access this information even if I am offline. These two factors are enough for me to actually consider storing any good articles onto my machine. A bonus factor, if you use Spotlight in OS X Tiger or Google Desktop, is that you can quickly search your computer for keywords and that article will appear.
</p>
<p>
Additionally, with google or wikipedia, you can actually search for stuff quicker than going through you long list of bookmarks. With your bookmarks, what can you possibly identify from the title or the URL or the multiple tags that you assign? The title is at most one sentence that usually does not provide enough information on what you have. The URL reveals nothing except the main site where the article comes from. And unless you try to add all sorts of tags to it, you probably will never be able to identify the subtler points of the articles. What about including some short description of it? Come on, let's be honest. Who actually writes good description of the articles? Whenever you want to search for something, you do not actually go through your bookmark list; you search for it on Google. It's almost second nature for most people. And now since Google is able to store a history of your searches, it might even be easier to locate the page that you want.
</p>
<p>
Bookmarks are also lousy for sites that you wish to follow because they do not let you know if the site has been updated or not. Even if there is a way to see if that bookmark has been updated, there is no way to tell what actually has been updated. If the author decides to update his profile on that page it probably will not interest you much. Moreover, a bookmark is a static link to a page. Even if that page moves to somewhere, your bookmark will not reveal it to you.</p>
<p>
Furthermore, I find that I am able to remember quick bits of information about a page I read not so much based on its title or URL but the time and day that I accessed it. That is why I find my browser history useful for hunting down articles that might be useful but I forget to or make a reference to. And as soon as I find that article, I am going to quickly save a copy of it so that I do not loose it the next time.
</p>
<p>
Now this is not to say that bookmarks are not useful at all. In fact, I find two main uses for bookmarks: sites that you visit frequently and web services. Well, maybe it would be better to count them as one since you can probably find out about the web service by googling -- yes, googling is considered a verb now, so use it! -- it as well. If you are constantly visiting a site and there is no RSS feed for it, a bookmark is definitely convenient so that you do not need to remember the URL. Then again, if you visit this site frequently enough, you might already remember the URL or your browser's auto-completion feature might suggest the URL for you as you type out its first few characters. Web services are something that you might want to bookmark because they are so handy and you want easy access to them. In fact, some even offer bookmarklets (for instance, to post to you del.icio.us account) and those are handy things that you should keep on your menu bar.
</p>
<p>
So, the more important question to ask is not whether I should bookmark this but rather why am I bookmarking this? If there is no good answer for this, that bookmark is probably going to sit there on your desktop or del.icio.us account doing nothing but collect dust<sup>2</sup>.
</p>
<small>
<ol>
<li><i>Many</i> probably refers to a list in the hundreds.</li>
<li>After writing this, I went through my list of bookmarks. Most of them have not been accessed in the last year or so but the resistance to delete those bookmarks is really great. The <i>I know I will need this soon</i> feeling is really overwhelming.</li>
</ol>
</small>
Scheme-ing2006-03-18T00:00:00+00:00http://vazexqi.github.com/2006/03/18/scheme-ing<p>
Nice Spring Break reading: <a href="http://www.ccs.neu.edu/home/matthias/BTLS/">The Little Schemer </a>and <a href="http://www.ccs.neu.edu/home/matthias/BTSS/">The Seasoned Schemer</a>. The Little Schemer is just like The Little Lisper with all the exercises removed. I read The Little Lisper last summer and would like to refresh my memory on some Lisp/Scheme since I have not been using it seriously for a while. I think the authors might have revised some of the contents but there was nothing major. Looking forward to getting the third installment of this series, <a href="http://www.ccs.neu.edu/home/matthias/BRS/">The Reasoned Schemer</a>.
</p>
<p>
What is a nice environment for trying out scheme on OS X? There are a couple of implementations as listed <a href="http://schemers.org/Implementations/#environments">here</a>. <a href="http://www.drscheme.org/">DrScheme</a> is the only one so far that runs on OS X with a nice little IDE and some help files. The only other one that seems viable is <a href="http://schemeway.sourceforge.net/schemescript.html">SchemeWay</a> but hooks itself up as a plug-in for Eclipse. And I really do not feel like starting up Eclipse every time I want to try something.
</p>
<p>
An interesting feature that DrScheme offers -- among the other innovative features that I will not be using yet -- is the ability to embed test cases inside the code. While this might seem like a trivial thing, DrScheme has a nice facility for doing so as can be seen from the screenshot below.
</p>
<p>
<a href="http://www.flickr.com/photos/vazexqi/114030692/" title="Photo Sharing"><img src="http://static.flickr.com/40/114030692_ccad38bafd.jpg" width="447" height="500" alt="Unit Test" /></a>
</p>
<p>
The list of features for DrScheme can be found <a href="http://www.plt-scheme.org/software/drscheme/tour/">here</a>.
</p>
Capybara2006-03-18T00:00:00+00:00http://vazexqi.github.com/2006/03/18/capybara<p>
In my previous <a href="/articles/2006/02/18/jabber-and-squeak">post</a>, I said that my group was working on implementing a Jabber chat client on Squeak. Well, turns out that there might be a few implementations for Jabber on Squeak already. So having our final project be another Jabber client is kind of risky as the professor pointed out.</p>
<p>
Instead of scrapping everything that we have written - we got it up to the point where it could login and send messages - we decided to make use of the Jabber protocol to send notifications to other computers. And that is where Capybara enters. Capybara, for those of you unfamiliar with the word, is
<blockquote>
a South American mammal that resembles a giant, long-legged guinea pig. It lives in groups near water and is the largest living rodent
</blockquote>
The name was chosen as a fun mockery of Squeak and its mouse logo. <i>Who needs a mouse when you have the world's largest rodent?</i>
</p>
<p>
So what is Capybara? I have written something about it on the class <a href="http://swiki.cs.uiuc.edu/cs598rej/233">wiki</a> but I thought that I would repeat some of it here in a less technical manner. Moreover, the information on the wiki might not persist over the semester. Here is another attempt at describing Capybara.
</p>
<p>
Imagine that you are using downloading a file in Squeak using a FTP client. The file that you are downloading is going to take a couple of minutes to download. You want to be notified of when the file completes its download but you do not want to monitor its progress by keeping watch on it. Enter Capybara. By registering the FTP client with Capybara and hooking up a file complete notification, the user will automatically be notified when a file completes via a discrete message box at the top right corner of the screen.
</p>
<p>
Or as another case. Assume that you are using the IRC client in Squeak. If you have ever used IRC before, you know that its "signal to noise ratio" is pretty low. Most of the time you will not be interested in what the other people are saying. However, if someone mentions a word that you are interested in, you would like to be notified of this. Enter Capybara. By registering the IRC application with Capybard and hooking up the detection of words to it, Capybara will send you a notification everytime the word you are interested in appears in the window.
</p>
<p>
The two scenarios above are just examples of when you would like to be notified about things that are of interests to you. With a computer capable of multitasking, there are so many events that are going off in the background. We need a way to be notified of those events in a non-intrusive manner. Capybara is our solution for that. The two examples you see above are local to the current computer but there are events that are going on other computers that you would like to know about as well.
</p>
<p>
Imagine that you and your colleague are collaborating on a programming effort. You would like to be notified whenever one of you has made a change to a file. By registering the application with Capybara and hooking it up so that whenever any changes are made, a notification is send, both parties know when the file has been modified.</p>
<p>
So what does this mean for the user? As we have explained, it means that the user has a way to keep track of all the different information. Capybara also provides a way for users to control the propagation of information. No longer interested in what the program has to notify you off? Just turn on notifications for that program in the Capybara preference pane. In real life, being notified of when a new e-mail message arrives is not as important as knowing that you stock is falling rapidly. With this in mind, Capybara supports priorities for its notification messages.</p>
<p>
What does this mean for a developer? It means that they not need to write their own notification engine. Capybara is application agnostic. Any application that uses our API can hook itself up for notification. No more clumsy user interface. All you need to do is register the application and hook up what to do when that event occurs. And if you really wanted a different notification interface, feel free to write one of your own. Capybara will support custom notifications as plug-ins as long as they support the API.</p>
<p>
In short, Capybara is a nice framework for both developers and users alike. We do not claim credit for coming up with this idea. Instead this idea was inspired by two useful programs for OS X: <a href="http://growl.info/">Growl</a> and <a href="http://oomz.net/Lanosd/">LanOSD</a>. </p>
Why iChat is not usable for serious instant messaging2006-03-12T00:00:00+00:00http://vazexqi.github.com/2006/03/12/why-ichat-is-not-usable-for-serious-instant-messaging<p>
I used <a href="http://www.defaultware.com/proteus/">Proteus</a> before but decided to switch over to iChat to give it a try. After almost 2 weeks using it, I have found it not suitable for my needs. To keep a long story short, here are the three reasons:
<ul>
<li>Cannot change away time
<br />
This is the feature that I need the most. I don't change the setting every time, but I need to be able to set it so that my status is set to away after 5 minutes. Why do I care? Because I do not like giving my contacts a false sense that I am there when I am not. I think iChat defaults to waiting 45 minutes before setting your status as away. That is way too long for me.</li>
<li>Does not notify you of message if your chat window is open
<br />
This has caused me to miss many important messages over the duration that I used iChat. If the chat window is opened, iChat will not notify you of new messages on the dock icon even if the chat window is hidden behind every other window! There might be a setting to change this, but apparently I am not able to find it.</li>
<li>Does not display message history
<br />
This is more of an annoyance than anything. If I open a new chat window, it does not show me the last few messages for the previous conversation. This is even more frustrating if I accidentally closed the chat window and now have no idea what we were taking about before. iChat does store your message history but it is a pain to go through them when you just need the last 5 messages to give you a sense of what you were talking about.
</li>
</ul>
</p>
<p>
If you have only used iChat as your sole instant messaging application, you probably will not miss all those features. But trust me, once you have those features you will not be looking back. There is a reason why GAIM, Adium, Proteus have those features: because they are really useful!
</p>
<p>
I have now switched to <a href="http://www.adiumx.com/">Adium</a>. Proteus is great but it seems to have not been updated for some time. And its file transfer support seems kind of flaky. Probably the only reason I would want to use iChat would be for audio or video chatting.</p>
<p>Update: Seems that there is a program the enhances iChat with some of the features I mentioned. I have not tried it out but it seems promising. It's called <a href="http://www.ksuther.com/chax/features.php">Chax</a> and has an ugly icon but it gets the message across: the band-aid on the iChat icon shows that it fixes what is wrong with iChat.</p>
Interviewing Ruby Programmers2006-03-12T00:00:00+00:00http://vazexqi.github.com/2006/03/12/interviewing-ruby-programmers<p><a href="http://www.oreillynet.com/ruby/blog/2006/03/interviewing_ruby_programmers.html">Interviewing Ruby Programmers - O'Reilly Ruby</a>:
<blockquote> "<i>Compare and contrast Ruby with your second-favorite language.</i>
<br />
...
<br />
<i>Describe any two features you'd remove from Ruby to improve it, and explain what changes would be required in the lexical analyzer, bison parser, and interpreter in order to effect these changes.</i>
<br />
...
<br />
<i>Describe in detail the name-resolution chain for constants (i.e., if you reference a Constant in your function, where does the interpreter look for the definition of that constant?)
</i><br />
...
<br />
<i>If you were to write a Ruby Style Guide for your company, what are some of the things you'd put in it? Would you include a maximum line length? If so, how long would it be?
</i><br />
...
<br />
<i>Can you think of any possible justification for the Ruby on Rails core source code using a line-wrap width of 500 characters, or whatever the hell it is?
</i><br />
...
<br />
<i>Pick any five C++ or Java 'design patterns' and explain how to accomplish the same effect in a tiny amount of Ruby code.
</i><br />
<b>(Can you tell I'm a harsh phone-screener?)"</b>
</blockquote>
</p>
<p>
These are not your average interview questions. Instead of asking how you would solve a problem, they are asking how much you know about the language. In this case, they are asking about some of the features of Ruby that distinguishes it from the rest. Unless you have been programming long enough in Ruby and have used some of its advanced features, this is probably going to be a very bad round of interview for you. There are of course ways to answer all of those questions, but you must ask yourself, is the Ruby way? If those questions were asked in Java, there is also a Java way of doing things. Now, the question remains, who asks such questions?</p>
<p>
The author is certainly a die-hard Ruby fan. But then again, he is trying to recruit the best Ruby programmers. And those questions above are not his only set of killer questions. If you go and read his article, he is going to ask all sorts of other stuff that I doubt most people would know (well, maybe I am wrong, but the people I have worked with do not really know this). Stuff like metaprogramming (which is language dependent) is something that he considers very important for a Ruby programmer.
</p>
<p>
Bottom line, if someone passes all those questions, he is certainly a good candidate for hire. And I mean a real good candidate. For bonus points, if he or she can answer all the above questions (with some modifications) for at least 2 other languages, you definitely have a good hire. Or do you? <i>Wouldn't you be scared that one day he or she will higher paid than you? </i>
</p>
Bioinformatics Summit at UIUC2006-03-08T00:00:00+00:00http://vazexqi.github.com/2006/03/08/seminar-bioinformatics-summit-news-computer-science-uiuc<p><a href="http://www.cs.uiuc.edu/news/seminars.php?id=2006Mar8-1">Seminar: Bioinformatics Summit | News | Computer Science | UIUC</a>:
<blockquote> "The Department of Computer Science will hold its first Bioinformatics Summit next week. We hope this will be a significant step in encouraging more interaction and increasing collaborative research among researchers on campus in the areas of bioinfomatics and computational biology."
</blockquote>
</p>
<p>
Since this is the few times that I have been to a summit, I was curious to find out what usually transpires in one. The Oxford American Dictionary defines summit as:
<blockquote>
a meeting between heads of government
</blockquote>
Since this definition is not really pertinent to our scenario, I consulted the thesaurus and it revealed possible synonyms as meeting, negotiations, conference and talks. Basically, a summit is an event when people can talk about their work. In this case, it was also to help foster more interaction between researchers on campus specifically those from the <a href="http://www.igb.uiuc.edu/">Institute for Genomic Biology</a> (IGB).
</p>
<p>
I attended the session on March 8. While it was a nice start, I felt that it could be better. Here's why:
<ul>
<li>A more tactful coordinator
<br />
I felt that the coordinator was not up to the task. Instead of fostering conversations between the attendees, he was basically dominating the entire conversation with his questions. I understand that he is interested in what is being presented, but as an coordinator, he should exercise more tact and make sure that everyone has a chance to ask a question. Or he could ask "better" questions that might provide deeper insight into what kinds of collaborations that biological scientists would like to have with the CS department.
<br />
Incidentally, Guy Kawasaki, posted about this today in
<a href="http://blog.guykawasaki.com/2006/03/how_to_be_a_gre.html">How To Be a Great Moderator</a>:
<blockquote> "Make everyone else look smart. The goal of the moderator is to make the panelists look smart. It is not to make himself look smart--or grab the most attention. Moderators can make panelists look smart in two ways: first, give them a few softball questions that they can knock out of the park. For example, ‘What do you view as the most pressing issues of the industry?’ Second, extract good information out of the panelists by rephrasing, summarizing, or clarifying what they said. A good moderator accounts for only 10% of the speaking time of a panel--she is the ‘invisible hand,’ not the star."
</blockquote>
</li>
<li>Presentation from CS professors were missing
<br />
This is probably excusable since it is the first summit. All the presenters were from the life sciences department. I would be interested to see how CS professors can contribute to the bioinformatics effort. From an outsider's point of view, it seems that there are very few professors that deal with bioinformatics in the CS department. So, it would be best to at least introduce some of their work.
</li>
<li>No clear emphasis on what technology is needed
<br />
At least that was how I felt about today's session. There was no clear explanation of what kinds of computing technology were needed to help foster the bioinformatics development. There was some mention of massive storage and fast parallel computation but the requirements were not detailed enough to follow up with a more formal analysis of what is needed. Then again, it is unfair to blame this on the presenters. As researchers from outside the CS department, we cannot assume that they are familiar with the computing technology that we have to offer. Therefore, it would be better if someone from the CS department itself accosted the presenters and at least give a suggestion of some possible technological solutions.
</li>
</li>
</ul>
</p>
<p>
One way to solve the communication barrier (CS researchers are not familiar with a lot of terms from the biological world, and researchers from the biological world are not familiar with the technology in computers) is to have a walkthrough in the research lab. It could be in the CS lab or the IGB lab. It does not matter. Both groups just need to see what the other group needs and what they can provide. It's so much simpler than having to attend talks and lectures. Just go tour the lab for a few days and see what they need. I am sure that solutions, though not necessarily optimal ones, shall present themselves over time. Since the field of bioinformatics is relatively new, there aren't that many books written about the best practices of the field. In fact, I would be really wary of a book like that since the field is continually evolving and what you have this month would probably be supplanted by new technology very soon. That being said, there are still some books that could be useful. Look out for these <a href="http://www.oreilly.com/pub/topic/science">books</a> from O'Reilly.
</p>
<p>
Anyway, I am glad that the CS department in UIUC is making an effort to collaborate with the life sciences department. Bioinformatics per se is probably not going to be the next big thing in the future. However, its footprint might have a significant impact on other areas of computing. From my visit to Purdue University, I realize the importance of privacy when accessing this kinds of information. For instance, if company A wants to check some biological information with company B, it should not be able to access other data from company B. Similarly, company A should not be able to access any other information from company B. In short, the transaction should be transparent to both companies in the interest of corporate safety but at the same time, it should foster some kind of information sharing between the two companies since it is impossible for one company to hold all the information about all your clients.</p>
March is Hack-a-Mac month2006-03-07T00:00:00+00:00http://vazexqi.github.com/2006/03/07/march-is-hack-a-mac-month<p><a href="http://www.zdnet.com.au/news/security/soa/Mac_OS_X_hacked_in_less_than_30_minutes/0,2000061744,39241748,00.htm">
Mac OS X hacked under 30 minutes: ZDNet Australia: News: Security</a>:
<blockquote>"Gaining root access to a Mac is 'easy pickings,' according to an individual who won an OS X hacking challenge last month by gaining root control of a machine using an unpublished security vulnerability."
</blockquote></p>
<p>(Via <a href="http://arstechnica.com/news.ars/post/20060306-6321.html">Mac OS X web server security competition over in six hours</a>.)</p>
<p>
What does that article show? Does it show that Macs are not as secure as most people think they are? Somewhat true especially if the owner is trying to be idiotic and enables ports and announces it to everyone. Does it show that all Mac users should go get themselves an antivirus suite? Probably not. McAfee and Symantec are leaping for joy now from all the publicity they are receiving and will probably try to get as many people as they can to buy their products. Does this mean that I can no longer boast to my friends that the Mac is the <i>most</i> secure platform in the world? Probably but then again, to claim that your machine is the most secure and announcing it to the world is probably asking for trouble anyway. There are various other ways to exploit a machine more effectively: social engineering comes to mind.</p>
<p>
The lesson from all this is that <i>every</i> operating system out there has its set of vulnerabilities. Period. Some, like < insert the stereotypical example here > are probably more vulnerable to everything else just because it has been configured that way. Some are going to be more secure because they were designed with security in mind. So, if <i>really great</i> security matters to you, you should probably not be using any of the common operating systems anyway.</p>
<p>
In a sense, OSX is still great because it protects most users from things that most common users will suffer from. Whether or not this is because of the small OS X user base will still have to be determined. Though <b>highly</b> controversial, there is this <a href="http://news.com.com/2100-1040-943519.html">article</a> that says Mac users are slightly more intelligent than their PC-counterparts. So in a sense, Mac users might have better security just because they don't do stupid things. Not doing stupid things is <i>always</i> a good idea.
</p>
<p>
The best attitude to take with security is to NOT take it for granted.
</p>
<p>
Incidentally, Rixstep has some articles on some holes in OS X that should be addressed immediately. Here is <a href="http://rixstep.com/1/20060306,00.shtml">one</a>
</p>
Ruby on Rails article on developer.apple.com2006-02-27T00:00:00+00:00http://vazexqi.github.com/2006/02/27/ruby-on-rails-article-on-developer-apple-com<p><a href="http://developer.apple.com/tools/rubyonrails.html">Using Ruby on Rails for Web Development on Mac OS X</a>: "This article introduces you to Ruby on Rails by building a trivial web application step by step. Consider it a ride on the express train -- an overview of what Rails can do, including a look at features new to Rails 1.0. In the end you'll be better equipped to consider the advantages of powering your web application with Rails."</p>
<p>
The links found at the bottom of the page did help me get started on compiling Ruby and Rails for my MacBook. But more interestingly, the editor of choice is <a href="http://macromates.com/">Texmate</a>?
</p>
Yojimbo and why applications should be written this way2006-02-26T00:00:00+00:00http://vazexqi.github.com/2006/02/26/yojimbo-and-why-applications-should-be-written-this-way<p>
A very simple note-taking app that lets you store snippets of information. <a href="http://barebones.com/products/yojimbo/index.shtml">Yojimbo</a> is the product of Bare Bones software, creator of BBEdit, TextWrangler and MailSmith. Of all their products, I have only used BBEdit. Either way, I decided to try Yojimbo after considering the amount of junk that Sticky Brain installs.
</p>
<p>
On my previous set up, I used <a href="http://www.chronosnet.com/Products/sb_product.html">Sticky Brain</a> to store quite a bit of information. However my main gripe with Sticky Brain is how is stores stuff in the OpenBase database. <i>I want to install Sticky Brain and only Sticky Brain, not the OpenBase application.</i> But somehow the creators of Sticky Brain cannot get that into their heads. Well, if it is only OpenBase, I am somewhat fine with that. However, with version 3.0 onwards they have been adding more and more useless features without giving the user the ability to <b>not</b> install them. For instance, they added a very hideous icon on the task bar for people to use to search. Did they not think of integrating it with spotlight? What about the stupid dashboard widgets that are installed? Do they seriously think it is convenient? Sticky Brain is not the only application out there that tries to be <i>smart</i>. What about Path Finder using its own .pdf and picture viewer? I doubt that their version is better. All these fragmented code that developers use just makes the entire computer experience very fragmented. So much so, that it begins to feel like Windows where all applications can never talk to each other nicely.</p>
<p>
While I am at this, I should go and say, I <b>hate</b> applications that try to install weird things on my computer. For instance, Path Finder tries to install some hook that will enable it use the crash reporter to report back to the company. Or what about Microsoft Office? Why in the world did they stick the User Data folder into the Documents folder? Or the worst of the bunch, Adobe? Why in the world did they stick over 10 shortcut into my right-click menu? Why? Why? Someone ought to just rethink what they are doing.</p>
<p>
Anyway, Yojimbo is not perfect but it does what I need: integrating with spotlight. And also .Mac syncing. You will really like .Mac syncing once you have used it. I used it for Transmit and NetNewsWire and it makes using multiple computer so much easier. Also upgrading from one computer to another is really simple.</p>
<p>
Yojimbo is light, does not try to install things that I do not want. And most of all, it starts normally like an application should. I am sure we can see further improvements to it in the long run. Yojimbo is not the only piece of software that is written correctly. Other companies such as OmniGroup also gets it right but having a very simple install process. The only <i>junk</i> file that is left after uninstalling is the .plist file.</p>
<p>
Now, if only there was a simple way to move everything from the Sticky Brain database over.</p>
<p>The crux of this: applications for the mac should be easily installed. There should not be a need for a complex installer. And dragging the application to the trash should be sufficient to uninstall the application and whatever else it installed completely. Not only does this make it easier to try new applications without risking installing other junk, but it also lets me keep my computer clean for many months to come.</p>
<p>
If you think I am the only one who is being anal about applications installing files surreptitiously, then take a look at <a href="http://the.taoofmac.com/space/Office">this (Tao Of Mac)</a> and <a href="http://daringfireball.net/2006/01/smart_crash_reports">this (Daring Fireball)</a> and <a href="http://friday.com/bbum/2006/01/20/sandvox-hidden-feature/">this (Bbum's weblog-o-mat)</a>.</p>
MacBook Pro is finally here2006-02-24T00:00:00+00:00http://vazexqi.github.com/2006/02/24/macbook-pro-is-finally-here<p>
Fast. Really fast. Especially since I was coming from a 867 MHz G4.
</p>
<p>
Instead of stating the obvious things that other people have already stated, let me point out some differences between this Mac and my old powerbook.
</p>
<p>
<i>Good</i> things first.
<ul>
<li>The keyboard feels much nicer to type on. It has this nice tactile feel to it. The keys just seem to bounce nicely.</li>
<li>The ambient sensor keyboard is the coolest thing around!</li>
<li>The screen is much brighter compared to my powerbook or even my 20.1 inch Dell Monitor.</li>
<li>The bigger track pad really works well. I feel like I have better control over the mouse.</li>
<li>Having the ports on the sides is actually pretty convenient. I don't have to bent over now to hook up my monitor. But since these ports are exposed, I wonder if they will gather dust fairly quickly.</li>
<li>The remote control for front row is really nice. I wonder what happens when the battery runs out though.</li>
<li>Having an iSight camera built-in is actually pretty useful.</li>
</ul>
</p>
<p>
<i>Not</i> so good things now.
<ul>
<li>The speakers sound a bit different - not in a <i>better</i> way. It is definitely louder but the sound seems a bit scratchy as well. The chime that the Mac makes whne it boots up sounds slightly different. But fortunately both left and right speakers are working.</li>
<li>I <i>hate</i> the slot loading CD/DVD drive. Yeah, it's cool but I always feel like it is going to die soon. When I inserted the provided DVD to install, the mechanical sounds it produces is enough to scare most people off.</li>
<li>The MacBook Pro feels rather warm to touch. I am not even running at highest performance but the keyboard area feels warm already. However the fan has not kicked in so that is fine since there isn't that annoying fan noise.</li>
</ul>
</p>
<p>
And now, it's back to installing software. I prefer to do this by hand instead of using the Migration Assistant because I feel like keeping my system clean and I really do want to keep track of which applications are universal binaries.</p>
Any moment now...2006-02-21T00:00:00+00:00http://vazexqi.github.com/2006/02/21/any-moment-now<p><blockquote>
Hello
<br />
We wanted to let you know that your order has shipped. If you ordered multiple items, you may receive separate shipments with no additional shipping charges. An invoice for your shipped products will be emailed to you shortly. Visit Order Status to review your order at any time.
Best regards,
The Apple Store Team</blockquote></p><p>
On another incident altogether, it is sad to note that Apple has not really fixed the Safari bug that surfaced a couple of months back. Basically, if you have the "Open "safe" files after downloading, you can potentially open something like a shell script that will run automatically. Last time, it was a Dashboard widget that would auto install itself. So Apple fixed that by popping up a notification telling you that a widget is trying to install itself. It was a temporary solution that worked for a very specific case.
</p><p>
However, this time around, it is possible to actually hide malicious scripts in a .zip file and have Safari open it automatically, It seems that all .zip files are considered to be safe? I might be wrong but that is what I have gathered from reading the news. Anyway, this is not too serious yet since you have to actually click on a .zip file to download it and after that you have to actually open the malicious shell script. But to unsuspecting users, the misnomer "safe file" might actually prompt them to click the file where otherwise they might have exercised more caution.
</p><p>
Simple solution, just turn off that option. I turn mine off because I hate it when it tries to open PowerPoint when I download a .ppt file. Opening PowerPoint on my powerbook takes a long time and I would rather download all the files first before opening any of them.</p>
<p>
More information <a href="http://www.macworld.com/news/2006/02/21/safari/index.php?lsrc=mwrss">here</a>. And a very detailed article on the deeper underlying principles behind this exploit can be found <a href="http://www.unsanity.org/archives/000449.php">here</a>.</p>
Prototype based languages2006-02-19T00:00:00+00:00http://vazexqi.github.com/2006/02/19/prototype-based-languages<p><a href="http://www.dekorte.com/docs/protos/">steve dekorte - docs - protos</a>:
<blockquote>
"Prototype-based languages are object oriented langauges where a new object instance is 'cloned' from existing live object(a prototype) instead of being constructed by a class. This makes the language simpler by requiring one less data type and solving the infinte regress problem of classes(if you use a class to create an object, what do you use to create a class?). It is also ideal for systems such as GUIs where the pattern of creating one object by copying and modifying another is already handled by the language itself."
</blockquote></p>
<p>
This post is a follow-up to my previous <a href="/articles/2006/02/06/smalltalks-footprint-in-object-and-dynamic-languages">post</a> on learning <a href="http://www.iolanguage.com/">Io</a>. What is interesting is that Javascript is supposed to be a prototype based language, and it is one of the only mainstream languages of this type. Amazing! I have used javascript before the days when each browser tried to define its own DOM and other browser-specific features. But I have never actually used any of its prototype features or heard of it. Sure I created a few functions here and there but nothing else. So either the prototype nature of Javascript is so transparent or I was just not taking enough notice of it. In case anyone is interested, I was using <a href="http://www.amazon.com/gp/product/0138419418/002-2181617-5963211?n=283155"><i>Jumping Javascript</i></a> as my source of learning and reference. In spite of all the negative reviews on Amazon, I would say that this was the first book and Javascript was the first programming language that taught me what programming was all about. Weird but true!
</p>
<p><a href="http://www.mozilla.org/js/">JavaScript</a>:
<blockquote>
"In a nutshell, JavaScript is a dynamic scripting language
supporting
prototype based object construction"
</blockquote></p>
<p>
One of the <a href="http://www.webreference.com/programming/javascript/gr/column18/index.html">examples</a> that I could find on the object-oriented nature of Javascript:
<pre>
// create a base class with one method
function Base(b)
{
this.b = b;
}
Base.prototype.foo = function()
{
alert('foo');
}
...
</pre>
</p>
<p>
After reading the article more, I think I <i>might</i> have actually seen this before. Either way, I might continue playing around with Javascript and its class creations or just default to learning Io. The interesting thing about Io is its OpenGL bindings. With those bindings, I can just recreate my OpenGL projects in Io to see the difference between object-oriented programming and prototype-based languages.</p>
Jabber and Squeak2006-02-18T00:00:00+00:00http://vazexqi.github.com/2006/02/18/jabber-and-squeak<p>
The latest project that my group is working on is a Jabber client for Squeak. We have been toying with this for a couple of weeks now and we finally got it to send and receive messages to another contact on the same server. There are a lot of information on how to actually start a conversation with Jabber and most of them are easy to follow. In fact, <a href="http://wiki.jabber.org/index.php/Programming_Jabber_Clients">here</a> is a link to one of the better resources out here. Although I am not sure if you can actually quote strings in XML with single quotes. I changed all of them to double quotes since that is how I used them in XHTML but you are free to try them with single quotes. If you follow along, you should be able to connect to your Jabber server, authenticate yourself and even send a message to someone else connected to the Jabber server. But how would you actually receive a message from someone?</p>
<p>
Now that is the interesting part. I was not able to find anything on how to actually receive messages once you have connected to the Jabber server. It does not seem to be an automatic thing. There was an elusive middle step that needed to be done. And this step does not seem to be elaborated on much in any website. So, falling back to the book <a href="http://www.oreilly.com/catalog/jabber/">Programming Jabber</a> by O'Reilly, specifically, <a href="http://www.oreilly.com/catalog/jabber/chapter/ch05.html">Chapter 5</a> which they have so kindly made available online.
</p>
<p><a href="http://www.oreilly.com/catalog/jabber/chapter/ch05.html">Programming Jabber: Chapter 5: Jabber Technology Basics</a>:
<blockquote>
<p>
"The <presence/> element is used to convey a Jabber entity's availability. An entity can be available, which means that it's connected and any messages sent to it will be delivered immediately, or it can be unavailable, which means that it's not connected, and any messages sent to it will be stored and delivered the next time a connection is made.
</p>
<p>
For the large part, it is the entity itself, not the Jabber server to which it connects, that controls the availability information. The Jabber server will communicate an entity's unavailabilityif that entity disconnects from the server but will do that only if the entity has communicated its availability beforehand."
</p>
</blockquote></p>
<p>
So, the presence element it not set up by default. Even if your Jabber server identifies you as being online, it does not assume that you are available. And as such, all messages from other people are stored away temporarily. However, all server side messages are still going to be delivered.</p>
<p>
So how you go about solving this? Reading a couple of paragraphs down shows that all you need to do, in the general case is to send this XML stream to the server:
<br />
<code>< presence type="available" /></code>
</p>
<p>And then all your previous messages will come flooding through! Took us a while to figure it out but once we did, it kind of made sense. Just wished that all the examples online would have mentioned this explicitly.</p>
How to Do What You Love2006-02-18T00:00:00+00:00http://vazexqi.github.com/2006/02/18/how-to-do-what-you-love<p><a href="http://www.paulgraham.com/love.html">How to Do What You Love</a>:
<blockquote>
"The test of whether people love what they do is whether they'd do
it even if they weren't paid for it-- even if they had to work at
another job to make a living. How many corporate lawyers would do
their current work if they had to do it for free, in their spare
time, and take day jobs as waiters to support themselves?"
<br />
...
<br />
It's hard to find work you love; it must be, if so few do. So don't underestimate this task. And don't feel bad if you haven't succeeded yet. In fact, if you admit to yourself that you're discontented, you're a step ahead of most people, who are still in denial. If you're surrounded by colleagues who claim to enjoy work that you find contemptible, odds are they're lying to themselves. Not necessarily, but probably.
</blockquote>
</p>
<p>
One thing that I am 100% sure: I would definitely love to study new programming languages all day and toy around with all their advanced features. I wonder what kind of job or research area this would lead to? Playing around with languages is fun, but it is even more fun when you have a real problem to solve that just fits particularly well with that language. For instance, doing low level embedded systems programming just fits nicely with what C is for. Also, for doing quick programs to sieve through all the prime numbers, nothing beats Ruby or Python.</p>
<p>
I guess the perfect job for me to do would be one where we will be using all the different kinds of programming languages and creating a complete system with them. I guess that is why I am so against the idea of using just one kind of language to do everything. Or to say it more clearly, I hate it when what you have to do is just so tied down to a particular programming language or technology. In fact, if you think that there is indeed a grand unified programming language/tool/technology out there, then you are most probably subscribing to the <a href="http://en.wikipedia.org/wiki/Golden_hammer">Golden Hammer</a> anti-pattern.
</p>
<p>
As Graham says, the first step to knowing what you love to do might be to actually discover what you do not like and quickly move away from it. Sticking around with something you do not like will not make you like it in the long run. However, it will probably, at best, render you neutral about something. And when you are neutral about something, that is the worst scenario possible. Not only do you not hate it anymore that you are going to change it, but you also do not love it enough to use it properly. And then you begin to become another common office drone. Kathy Sierra did make another post about sticking on the fence as the <a href="http://headrush.typepad.com/creating_passionate_users/2005/01/be_brave.html">zone of mediocrity</a></p>
<p>
So for me, to actually know what you hate or love to do for that matter is to make sure that you have some opinion on it. Hating it is good because you can eliminate it from your list of things you <i>want</i> to do (or maybe just push it back to the very far end for consideration later). Loving it is good since you can quickly bring it to the front of the queue for further evaluation. Not having an opinion for things is bad since it makes you another herd follower.
</p>
Ruby on Rails featured in Computer2006-02-07T00:00:00+00:00http://vazexqi.github.com/2006/02/07/ruby-on-rails-featured-in-computer<p>
<a href="http://csdl2.computer.org/comp/mags/co/2006/02/r2018.pdf"><i>Will Software Developers Ride Ruby on Rails to Success?</i></a> in the February 2006 issue of <i>Computer</i> from IEEE.
</p>
<p>
It seems like a big deal to be featured in <i>Computer</i>. <i>Computer</i> usually features technology that have had a profound effect on the industry, in other words, mostly Java and C++. So, the fact that they decided to do an article on Ruby on Rails means that somehow the industry is becoming aware that there exists <i>other</i> frameworks out there besides the heavyweight Java frameworks.</p>
<p>
Anyway, the article is rather objective and does not contain all the hype that usually surrounds Ruby on Rails. This is both good and bad. It's good because it will not sound like a marketing scheme and astute readers might actually go and check it out. It's bad because it does not really do justice to what Rails has to offer over the other frameworks. The author chooses to focus on two aspects of the Ruby on Rails design principle: convention-over-configuration and don't-repeat-yourself-principle. I thought a concrete example would have been nice but it already spans 3 pages so an example might not be feasible.</p>
<p>
True, Rails may not be a superscalar framework. But for most purposes, it gives developers a new lightweight system that <i>probably</i> will scale fine even if you take it up to its limits. It's definitely easier than having to implement a multi-tier Java application and the author makes it a point to present that in the article.</p>
Smalltalk's footprint in object and dynamic languages2006-02-06T00:00:00+00:00http://vazexqi.github.com/2006/02/06/smalltalks-footprint-in-object-and-dynamic-languages<p><a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3316628397">Objects and Dynamic Languages</a>:
<blockquote>
"<a href="http://jaortega.wordpress.com/2006/02/05/beyond-mainstream-object-oriented-programming/">José Antonio Ortega Ruiz</a> has a lot of good things to say about Smalltalk, and about some of the prototype/multi-dispatch children spawned from it - <a href="http://research.sun.com/self/language.html">Self</a> and <a href="http://slate.tunes.org/">Slate</a> in particular. It's a long read, but a good read."
</blockquote></p>
<p>
There is a lot of stuff in that post. Enough to keep me occupied for at least a month of experimenting. Two new programming languages which are interesting enough in their own respect have been presented. I downloaded Self first to try it out. It looks like Sun has abandoned the project but the contents are still available at the website. I had not have the chance to try Slate yet.</p>
<p>
Both Self and Slate come with their own "living" environment which is akin to what Smalltalk has to offer. I can say that Squeak's interface is actually slightly better than what Self has to offer for now. But then again, people actually develop stuff on Squeak and Self seems to be more of a research language so the improvements might have been made by the contributors. And, though I am uncertain why, Self actually has an installer for OS X albeit being optimized for the PowerPC, which means that it probably will not run on Intel Macs.
</p>
<p>
However, to actually use a language requires some real applications for it. It was easy to actually learn Ruby because there is already a lot of libraries written for it. Not to mention the buzz that Rails generated for it. However for smaller languages such as these, actually writing a real application might be troublesome. Something like <a href="http://www.rubyquiz.com/">Ruby Quiz</a> might be useful.
</p>
<p>
A while back, I thought of learning <a href="http://www.iolanguage.com/about/">Io</a> as well. Io, Self and Slate are all prototype based languages so there really isn't going to be too much difference in which I choose to learn. However, I might be entirely wrong. The difference could be as great as Java and Ruby.
</p>
<p>
Either way, prototype languages are something interesting to know about. I might also take a look into <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">aspect-oriented programming</a> and see how that compares.</p>
<p>
There is nothing much I can say about prototype based languages except they do seem to fill in the niche for more complex systems that depend on multiple objects to determine behavior. There should be a use for prototype based languages in the future once the industry absorbs it. After all, it took quite a while before object-oriented programming became a buzzword among everyone.
</p>
<p>
Another point I wanted to make in this post: go subscribe to <a href="http://www.cincomsmalltalk.com/blog/View.ssp">Smalltalk Tidbits, Industry Rants</a>. The author really makes it a point to update the blog at least daily and presents rather interesting <a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3316604032">articles</a>. And, unsurprisingly, the blog is powered off Smalltalk.</p>
asCamelCase for Smalltalk's String2006-02-06T00:00:00+00:00http://vazexqi.github.com/2006/02/06/ascamelcase-for-smalltalks-string<p>
Something that might be useful when you are doing meta-programming in Smalltalk and want to quickly create a method name in camelCase from several words. The following was colorized using Vim's <code>:runtime! syntax/2html.vim</code></p><p>Put this as String >> asCamelCase (inside the converting protocol, if you like)</p>
<div style="background: #000000; color: #ffffff">
<pre>
<font color="#00ffff"> 1</font> asCamelCase
<font color="#00ffff"> 2</font> <font color="#00ffff"><b>"Return a copy of the receiver with leading/trailing blanks removed</b></font>
<font color="#00ffff"> 3</font> <font color="#00ffff"><b> and consecutive white spaces condensed. Also the string is camelCased"</b></font>
<font color="#00ffff"> 4</font> <font color="#ffff00"> | trimmed lastBlank |</font>
<font color="#00ffff"> 5</font> trimmed := <font color="#ffff00"><b>self</b></font> withBlanksTrimmed.
<font color="#00ffff"> 6</font> ^ String
<font color="#00ffff"> 7</font> streamContents: [<font color="#ffff00">:stream |</font>
<font color="#00ffff"> 8</font> lastBlank := <font color="#ffff00"><b>false</b></font>.
<font color="#00ffff"> 9</font> trimmed <font color="#ffff00"><b>do:</b></font> [<font color="#ffff00">:c |</font> (c isLetter and: [lastBlank])
<font color="#00ffff">10</font> <font color="#ffff00"><b>ifTrue:</b></font> [stream nextPut: c asUppercase]
<font color="#00ffff">11</font> <font color="#ffff00"><b>ifFalse:</b></font> [c isLetter
<font color="#00ffff">12</font> <font color="#ffff00"><b>ifTrue:</b></font> [stream nextPut: c]].
<font color="#00ffff">13</font> lastBlank := c isSeparator]]
</pre>
</div>
<p>
Some test cases and their expected results:
</p>
<div style="background: #000000; color: #ffffff">
<pre>
<font color="#00ffff">1</font> testCamelCase
<font color="#00ffff">2</font> <font color="#ffff00"><b>self</b></font> assert: <font color="#ff40ff"><b>'t'</b></font> asCamelCase = <font color="#ff40ff"><b>'t'</b></font>.
<font color="#00ffff">3</font> <font color="#ffff00"><b>self</b></font> assert: <font color="#ff40ff"><b>''</b></font> asCamelCase =<font color="#ff40ff"><b>''</b></font>.
<font color="#00ffff">4</font> <font color="#ffff00"><b>self</b></font> assert: <font color="#ff40ff"><b>'this should be camel cased'</b></font> asCamelCase = <font color="#ff40ff"><b>'thisShouldBeCamelCased'</b></font>.
<font color="#00ffff">5</font> <font color="#ffff00"><b>self</b></font> assert: <font color="#ff40ff"><b>'this'</b></font> asCamelCase = <font color="#ff40ff"><b>'this'</b></font>.
<font color="#00ffff">6</font> <font color="#ffff00"><b>self</b></font> assert: <font color="#ff40ff"><b>'this should also be in camel case'</b></font> asCamelCase = <font color="#ff40ff"><b>'thisShouldAlsoBeInCamelCase'</b></font>.
<font color="#00ffff">7</font> ^<font color="#ffff00"><b>self</b></font>
</pre>
</div><p>
This method was inspired by the chapter on meta-programming in <a href="http://www.iam.unibe.ch/~ducasse/FreeBooks/ByExample/">Smalltalk by Example</a> (links to free e-book version).</p>
Unit tests as a intuitive way to implement a small system2006-02-03T00:00:00+00:00http://vazexqi.github.com/2006/02/03/unit-tests-as-a-intuitive-way-to-implement-a-small-system<p>
Unit testing is not only for making sure that your code works. For people familiar with Kent Beck's <a href="http://brain.cs.uiuc.edu:8080/SEcourse/Danny's+summary+on+Test-Driven+Development">Test-Driven Development</a> this should come as no surprise. Even though I am familiar with it, I have not seen it done nicely yet. In fact, most of time I am still tempted to write the code first and then write the code because they system gets too confused by the unit tests when nothing has been implemented yet.</p>
<p>
However, this is not so with Smalltalk. If there is one redeeming factor for Squeak's mouse affinity (maybe that is why they call it Squeak since your mouse practically squeaks from having to move it to every input box), it will be its dynamic programming environment and excellent debugger. Its SUnit Test Runner is also smart enough that it does not choke on code that has not been implemented. Also, it makes it easy to share those test cases with everyone but making it easy to distribute them as projects.</p>
<p>
It feels so much easier to develop with those tests since it obviates most of the long instructions that come with a machine problem. No longer would you have to wade through paragraphs of vague information when the test cases show you what needs to be done. And the tests let you know where you need to implement the methods too since the debugger takes you to the offensive line of code and shows you the call stack up to the point when you click on it.</p>
<p>
But the true beauty of Smalltalk is the fact that you not only test the functionality of your methods, but also get a chance to test if your implementation is what is expected of you. While some of the tests only test the end result, most of the time you are also interested in whether you have fulfilled the non-technical requirements, such as your code organization. Smalltalk makes it possible to do so. Smalltalk's dynamic environment, lets you query the methods and classes themselves. Want to ensure that the students do not implement duplicate code? Just query their classes and their methods. I am sure there are other abilities for Smalltalk that would make it even more suitable to check if you have refactored the code or implemented it with some suitable design pattern. </p>
<p>
Having all the tests for the assignment makes it easy to see when you are actually done. You know what else you have to do and you can proceed with confidence once you have completed a particular subsection. It makes it easier to develop since you do not need to worry whether your current implementation fails part of the requirements.
</p>
<p>
Refactoring also becomes a more controlled process once you have tests to check whether your changes actually broke something. Without good tests, refactoring is almost like a gamble.
</p>
<p>
And did I mention that seeing that bar turn green once all the tests pass is a really great feeling?</p>
Confidence drops exponentially as delay in replying to e-mail increases2006-01-26T00:00:00+00:00http://vazexqi.github.com/2006/01/26/confidence-drops-exponentially-as-delay-in-replying-to-e-mail-increases<p>
Even more so when it has something to do with academia. I really hate it when I e-mail someone and I expect a reply and that person does not get back to me. For each 24 hour time span that the person does not get back to me, my confidence in that person just deteriorates exponentially. That confidence is hard, in fact almost impossible to restore.</p>
<p>It just shows that the person just could not be bothered. I realize that there will be many, if not hundreds of e-mails messages coming through and there is no way for you to reply to all of them. I completely understand this if you are a professor who's teaching more than one course during the semester. That is why I try my best to talk to the professor after class if it is easily settled then. Or I elect to e-mail one of the class TAs instead. However, I cannot understand why a TA does not reply to his or her e-mails. This phenomenon infuriates me even more so when my e-mail has been carefully written (with a meticulously subject line that reflects what class it is for and what the topic is) so as to take less than a minute to reply to. There is no way that a TA does not have enough time to reply to his or her students' e-mails. Period.</p>
<p>
To alleviate my frustration, I suggest that those people do one very simple thing. Auto-reply once they have at least read my e-mail but have no time to respond. I bet there is a way to configure your mail client to auto-reply once that message has been marked as read but you have no time to reply to. A simple reply would do. Something along the lines of: "Hi. I have read your e-mail and will get back to you shortly. " At least that simple reply assures me that you have received my message and are in the process of figuring out how to reply or something.
</p>
<p>
And don't even get me started on people who do not bother checking their e-mails. If you do not bother checking your e-mails, just have the mailer auto reply saying something like: "I am sorry but I do not check my e-mails. Please contact me using other methods". Also, then try to make sure that you do not give out your e-mail address anymore.
</p>
<p>
Finally, if you are working in a group and you are purposely postponing replying to an important e-mail, I think you should have acts of untold suffering performed to all your fingers so that you never need to touch a keyboard again.</p>
<p>
With my students, I try to reply to them as soon as possible. If I do not have an immediate answer but have to wait for higher authority to tell me something, at least I let them know about that too. No one has actually told me to do this. I sort of pick it up myself as a habit. And I think it has been a good habit that keeps students happy.</p>
<p>
By the way, this article could easily fit under the title of "Effective communication with e-mails" or "What not to do with your mailbox" or "How to get your students to hate you" or "Why some people should have their e-mail address as dont_bother_i_dont_reply@devnull.com".</p>
This year's resolution: minimizing meeting times2006-01-21T00:00:00+00:00http://vazexqi.github.com/2006/01/21/this-years-resolution-minimizing-meeting-times<p><a href="http://education.guardian.co.uk/higher/research/improbable/story/0,11109,1687547,00.html">EducationGuardian.co.uk | Research | Bored meetings</a>:
<blockquote>
"1. The more meetings one has to attend, the greater the negative effects; and
<br />
2. The more time one spends in meetings, the greater the negative effects"
</blockquote></p>
<p>(Via <a href="http://37signals.com/svn/archives2/meetings_considered_harmful.php">Meetings considered harmful</a>.)</p>
<p>
The main reason is probably when someone is not prepared. Most of the time, if the main speaker is prepared then it is not too bad. As least the main speaker is trying to impart some useful information to the few that are listening to him. But when the speaker is not prepared, then trouble comes. Either some jack ass starts to hijack the meeting by trying to talk a lot to make himself look good. Or the meeting begins to head off tangentially in all sorts of direction.
</p>
<p>
Also, when you are not prepared for the meeting (like most of the time, especially if it is an ad hoc meeting during one of your busiest days) you are not able to participate at all in it. Most meetings either tell you the things you already know or the things that you will never need to know. Even if it does tell you the things you need to know, you are probably going to forget it unless you write it down somewhere. So, what's the point? Much better to keep it short, and let people know where they can obtain the information for themselves in black and white.
</p>
<p>
So, is it OK for a long meeting if everyone is prepared for the meeting? Definitely not. If everyone is prepared for the meeting, then it is more appropriate to keep it really short. I especially hate it when the meeting can be shortened but because there is this weekly schedule that says that the meeting is supposed to be an hour long, some moron begins talking crap at the end to make it so. It is definitely OK and highly encouraged to end a meeting early.
</p>
<p>
Most of the time, no matter what you are doing, if you can maintain daily (not hourly, mind you) communications with the other person it should be much better than meetings. If you need something from someone, then just ask the person directly; there is no point in getting everyone else involved. If more than one person has asked you the same question, write up an FAQ and put it somewhere.
</p>
<p>
Bottom line: effective communication with the right people is better than trying to get everyone involved in a meeting. Also, ample preparation from everyone is a must for a successive meeting. Finally, when it comes to meetings, shorter is always better. </p>
<p>
And what should you do with all the spare time you gain from avoiding meetings? Spend it working during the day and <a href="http://www.time.com/time/archive/preview/0,10987,1147196,00.html">sleeping</a> at night. Which brings me to my other resolution, get enough sleep at night.</p>
Reuse is vastly overrated2006-01-21T00:00:00+00:00http://vazexqi.github.com/2006/01/21/reuse-is-vastly-overrated<p><a href="http://feeds.feedburner.com/LoudThinking?m=147">Reuse is vastly overrated</a>:
<blockquote>
"Context beats consistency. Reuse only works well when the particular instances are so similar that you're willing to trade the small differences for the increased productivity. That's often the case for infrastructure, such as Rails, but rarely the case for business logic, such as authentication and modules and components in general."
</blockquote></p>
<p>(Via <a href="http://www.loudthinking.com/">Loud Thinking</a>.)</p>
<p>
This is kind of interesting since David actually mentioned this somewhere along in the <a href="http://snakesandrubies.com/event/">Snakes and Rubies</a> event <a href="http://weblog.rubyonrails.org/articles/2006/01/06/snakes-and-rubies-video-now-available">video</a>.
</p>
<p>
So unless you are creating a library/framework I suspect that there is really no need to make your classes/function general enough that you are going to be able to use in the not-so distant future when you really do not even know what to expect.</p>
Squeak Revisited2006-01-15T00:00:00+00:00http://vazexqi.github.com/2006/01/15/squeak-revisited<p>
Using <a href="http://www.squeak.org/">Squeak</a> is imminent. So I might as well make the most of it. At first, the experience was horrendous. The syntax of SmallTalk itself is fine since I know both Objective-C and Ruby, both languages that derive themselves heavily from SmallTalk. The problem lies with Squeak itself. I found it almost impossible to control intuitively (read: meaning without reading some manual) on my PowerBook. After all, there is only <b>ONE</b> mouse button on my notebook!</p>
<p>
I used <a href="http://smalltalk.cincom.com/downloads/index.ssp?content=visualworks">Cincom VisualWorks</a> before and it did not trouble me as much since there was some good introduction available. Not to mention the presence of toolbars so I did not need to bring up the contextual menu. But Squeak seems to have more plug-ins and multimedia stuff available. Also, Squeak will be used for the class that I am taking.
</p>
<p>So to the rescue, are two very nicely written short articles.
<ul>
<li><a href="http://www.mucow.com/squeak-qref.html">Squeak Smalltalk: Basic Language Reference</a></li>
<li><a href="http://www.duke.edu/~bmp5/squeak/usable.html">Squeak Tutorials: Making Squeak Productive</a></li>
</ul>
</p>
<p>
By the way, the guy who wrote the second tutorial comes from Duke and was an intern at Fog Creek Software, which another of my favorite tech writers, <a href="http://www.joelonsoftware.com/">Joel Spolsky</a>, owns.</p>
<p>
So if 2005 was the year that I learned LISP (and did not use it much in the end thanks to the fact that my A.I. class adopted Java!), 2006 will be the year that I learn SmallTalk. So far, what I really like about Smalltalk is how terse the language itself is. Also, I like the dynamic nature of the environment since any changes that are made, including installing new plug-ins, are immediately effective.</p>
<p>
Still the potential for screwing the entire image is there since I am still not too familiar with how Squeak maintains different instances of itself. Different instances as in .image files and not a different project or workspace.</p>
MacBook Pro2006-01-13T00:00:00+00:00http://vazexqi.github.com/2006/01/13/macbook-pro<p>
It was kind of tongue-in-cheek for Apple to release the MacBook Pro with the caption "wishes do come true". However, it is indeed a wish come true. If you recall, a couple of months back I was lamenting the fact that you still could not get a powerful machine even if you had a fortune to spend on Apple. Well, right now, at least we have something that is at least on par with most machines. It is not top of the line, since there are indeed faster core duo specs on other machines but you must admit, the speed difference is rather significant. True, there are a lot of features that might be missing, such as the following (some might be rumors since I could not get official confirmation):
<ul><li>No S-Video</li><li>No modem</li><li>No Sudden Motion Sensor (?) - UPDATE: Yes it does have <a href="http://www.apple.com/macbookpro/design.html">it</a></li><li>60 pixels reduction in height: 1440 x 900 (was previously 960)</li><li><a href="http://www.lemkesoft.de/en/index.htm">GraphicsConverter</a> not pre-installed on the machines.</li><li>Slower dvd/cd drive</li></ul></p><p>
What <i>should</i> run, natively (not using Rosetta):
<ul><li><a href="http://quicksilver.blacktree.com/">Quicksilver</a></li><li><a href="http://macromates.com/">TextMate</a></li><li><a href="http://www.panic.com/unison/">Unison</a></li><li><a href="http://www.panic.com/transmit/">Transmit</a></li><li><a href="http://www.proteusx.com/">Proteus</a></li><li><a href="http://ranchero.com/netnewswire/">NetNewsWire</a></li><li><a href="http://ranchero.com/marsedit/">MarsEdit</a></li><li><a href="http://colloquy.info/">Colloquy</a></li></ul></p><p>Most of them already have universal binaries so everything is fine. Applications such as Adobe Photoshop and Microsoft Word that I use occasionally can run under Rosetta and I will not complain.</p><p>
What extra accessories I might need to get:
<ul><li>Modem</li><li>S-Video adapter</li><li>iWork (mostly for Keynote so that I can use the remote)</li></ul></p><p>
Either way, I should be ordering my own MacBook soon.</p>
Something really interesting is going on...2006-01-07T00:00:00+00:00http://vazexqi.github.com/2006/01/07/something-really-interesting-is-going-on<p>
...with <a href="http://www.macromates.com">TextMate</a>. I am using it and liking everything that I see. However, there are users out there more passionate about it then I am. In fact, they are so passionate about this new editor for the OS X that they are writing articles about it on their blogs. Amazing!</p>
<p>There are many other excellent editors out there for OS X. For instance the veteran <a href="http://www.barebones.com/products/bbedit/index.shtml">BBEdit</a>, the innovative <a href="http://www.codingmonkeys.de/subethaedit/">SubEthaEdit</a> and also the web-developer's arsenal <a href="http://www.skti.org/skEdit.php">SKEdit</a>. There are many people using those editors but I have not really come across any blogs writing about tips on how to enhance their usage.</p>
<p>What blogs are there that write about TextMate? Well, for a quick list, head over <a href="http://macromates.com/blog/archives/2006/01/07/around-the-web/">here</a>. </p>
<p>There could be a few reasons for the passion that surrounds TextMate but here are some that I can come up with at the moment:
<ul>
<li>Extensible plug-ins<br />
People can get up to speed by writing their own language bundles. This not only saves the time for the developer but also ensures that the user really gets what he or she wants. It is easy for a developer to go around developing language bundles but it will probably not be much use for the people that use them. For instance, a web developer will have different needs from a programmer.</li>
<li>Developer blog, mailing list and IRC channel<br />
TextMate maintains an active blog that updates its users with all the new features. Geeks lust for such features and are eager to find out what they can do next. Also, the mailing list provides a good way to ask questions. Also, the IRC channel allows quick answers for most questions.</li>
<li>SVN updates<br />
This definitely has some appeal for most developers. Personally, I liked keeping track each day of all the new bundles being added. I like to stay at the bleeding edge of TextMate and so I do an update almost everyday. It makes me feel good and I feel that this editor has a bright future for it since it is always evolving.</li>
<li>Free advertisement<br />
There is a lot of advertisement going on for TextMate. For instance on the <a href="http://rubyonrails.com/down">getting started section</a> on the Ruby on Rails website:
<blockquote>
"The entire Rails core team is using TextMate on Mac OS X. It's a fantastic editor that ships with Ruby on Rails highlighting and macros..."
</blockquote>
Simple but effective advertising. No doubt anyone on a Mac trying out Ruby on Rails will also check out TextMate. Also, once you get your users talking about the editor, then other users will follow suit. It begins a chain reaction that gets users really passionate about the product.</li>
</ul>
</p>
<p>
I am really looking forward to see what TextMate is going to offer next.</p>
2005 Geek buzzwords2006-01-03T00:00:00+00:00http://vazexqi.github.com/2006/01/03/2005-geek-buzzwords<p>
These words are on my most frequently seen list for 2005. Where did I encounter these words? Mostly from reading blogs and books. Let's see how many of them survive till next year.
</p>
<p>
<ul>
<li>RSS</li>
<li>Blogging (this will probably survive for a while)</li>
<li><a href="http://gmail.google.com">Gmail</a></li>
<li><a href="http://www.getfirefox.com">Firefox</a></li>
<li><a href="http://www.macromates.com">Textmate</a></li>
<li><a href="http://quicksilver.blacktree.com/">Quicksilver</a></li>
<li><a href="http://www.rubyonrails.com/">Ruby (and Ruby on Rails)</a></li>
<li><a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html">Web 2.0</a></li>
<li><a href="http://www.flickr.com/">Flickr</a></li>
<li><a href="http://del.icio.us/">Del.icio.us</a></li>
<li><a href="http://subversion.tigris.org/">Subversion</a></li>
<li><a href="http://www.43folders.com/2004/09/08/getting-started-with-getting-things-done/">Getting Things Done</a></li>
</ul>
</p>
<p>
It's really unfortunate that I did not keep a record of words earlier in the year. I suspect that this list is a bit biased toward buzzwords I stumbled upon in the second half of the year.
</p>
CS242 Programming Studio web application2005-12-31T00:00:00+00:00http://vazexqi.github.com/2005/12/31/cs242-programming-studio-grading-web-application<a href="http://www.flickr.com/photos/vazexqi/80067042/" title="Photo Sharing"><img src="http://static.flickr.com/40/80067042_0d86a972c4.jpg" width="500" height="343" alt="Login" /></a><p>The entire set is available from <a href="http://www.flickr.com/photos/vazexqi/sets/1712127/">flickr</a>. Peruse it to see what features are available.</p><p>For the past week I have been spending about 6 hours each day getting this web application set up. It's powered by Ruby on Rails and uses MySQL as its database back end. Overall, it was really gratifying creating this application since I got a change to use Textmate, <i>the</i> OS X editor to its fullest and also dabble with more Ruby on Rails, this time around being guided by the excellent <a href="http://www.pragmaticprogrammer.com/titles/rails/index.html">Agile Web Development with Rails</a> book.</p><p>Right now the application features the following features that I think are rather important based on my experience as a teaching assistant for the class:
<ul><li>Admin interface that quickly lists all accounts.</li><li>Ability to generate grading rubric based on simple template.</li><li>Students can get feedback quickly.</li><li>Secure system that has user login for access control.</li><li>Intuitive tab based interface.</li><li>Has sidebar for short instructions.</li><li>Clean and simple interface based off <a href="http://typo.leetsoft.com/trac/">Typo</a> and <a href="http://www.realmacsoftware.com/">Rapidweaver</a> template.</li></ul></p><p>
I will get a movie up for this soon once I verify that it is accepted for use. Also, I will be putting it up on <a href="http://www.railsplayground.com/">railsplayground.com</a> either on my current hosting plan or a brand new one depending on how easy it would be. Right now there are some future features that I plan to implement:
<ul><li>Built-in e-mail capabilities to send gradesheet via e-mails to student.</li><li>RSS feed for class announcements.</li><li>Remove restriction that grading rubric has to be a two-level tree structure.</li><li>Implement some AJAX for simple tasks like creating new accounts that have short forms that fit nicely into the current page.</li></ul></p><p>More updates to come. I am glad though that most of the features I envisioned have been implemented.</p>
This is not another Java vs. Ruby post2005-12-29T00:00:00+00:00http://vazexqi.github.com/2005/12/29/this-is-not-another-java-vs-ruby-post<p><a href="http://weblog.hypotheticalabs.com/?p=59">Why Ruby Shouldn’t Be Your Next Programming Language (Maybe)</a>:
<blockquote>
"For example, consider a developer just starting his programming career. The first language he learns is C. The benefit he receives is 100%. Prior to learning C he lacked the vocabulary necessary to reason about computing and develop programs. In a few years he decides to pick up Java. He learns about OOP, distributed systems, and garbage collection. The benefit for learning Java is let's say 50%. He didn't learn as much as his first exposure to programming but he still learned a number of new concepts. He then dabbles in Linux and decides to learn Perl. His benefit for learning Perl is 25%. He still learned a few new ideas and reinforced existing concepts but not as much as when he learned Java nor nearly as much as when he first learned C. Finally he decides to investigate all this Ruby On Rails hype so he picks up Ruby. He learns a few new concepts and gains exposure to a fully dynamic programming environment. His benefit for learning Ruby is 12.5%. And so the progression goes for each new Algol-based language."
</blockquote></p>
<p>(Via <a href="http://digg.com/programming/_Why_Ruby_Shouldn’t_Be_Your_Next_Programming_Language_(Maybe).">Digg</a>.)</p>
<p>My point from the article above: if you learn programming languages from the same family of languages, you are not going to gain much of a paradigm shift in terms of programming. According to the article above, the syntax and semantics of C/ Java/ Perl are similar enough that you can easily pick up one language from another. While I might not necessarily agree with the examples above, I strongly agree that learning C++ and then Java will not make you a better programmer. It just gives you another programming <b>language</b> under your belt, not some new programming <b>methodology</b> under your belt. It's the same with Java and C#. The two languages (at least the current version of C# since future versions will have some nifty features such as closures and LINQ that will distinguish it from Java) are so similar that the only added benefit you gain from learning the other is the number of libraries available at your disposal.</p>
<p>When I first saw Perl, I was really impressed that you could easily construct an array without all the useless typing of " " by using something like %w{Alpha Bravo Charlie}. The idea of creating the %w to actually return an array of strings was a shortcut to me. That means that somewhere out there, someone else thought that it was a complete waste of time to have to do something type something out like this {"Alpha", "Bravo", "Charlie"}; Notice all the useless " ", ',' and ';' Now, some of you might argue that <i>my</i> IDE takes care of that for me. But why? Why not make it part of the language? Are you worried that <i>some</i> people are not able to comprehend such syntax? So, for such people, you decide to <b>limit</b> your language?</p>
<p><a href="http://opal.cabochon.com/~stevey/blog-rants/language-trickery-ejb.html">Language Trickery and EJB</a>:
<blockquote>
"In any case, I've been getting the impression that many Java programmers become uncomfortable when people start talking about features offered by other languages. Not just the Java engineer on the mailing list today, but lots of Java programmers. The majority, maybe."
</blockquote></p>
<p>So, is it safe to claim that some languages out there are better? <b>That those who actually know those languages are better than your average self-proclaimed programmers?</b> I think so. Read on.</p>
<p><a href="http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html">The Perils of JavaSchools - Joel on Software</a>:
<blockquote>
"Instead what I'd like to claim is that Java is not, generally, a hard enough programming language that it can be used to discriminate between great programmers and mediocre programmers. It may be a fine language to work in, but that's not today's topic. I would even go so far as to say that the fact that Java is not hard enough is a feature, not a bug, but it does have this one problem."
</blockquote></p>
<p>In the article above, Spolsky points out how some schools are substituting Java as the default programming language for all courses. While there is nothing wrong with Java per se, Java does hide somethings that computer scientists should know about: low-level bit manipulation and memory addressing. Want to do bit-twiddling in Java? It is going to be harder to actually implement it than to understand what bit-twiddling is all about. (Funny anecdote: I made this same stupid mistake. I wanted to represent a byte in Java. What did I do? I created a <i>class</i> for Byte? What the heck was I thinking? Do you realize that a byte takes up 8 bits in memory but a class takes up so so much more??!!) Want to know about how your machine implements the Von Neumman model of computers (data and code are both inside computer memory)? Err, that is going to be hard too since Java does not really let you deal with memory addresses.</p>
<p><a href="http://www.joelonsoftware.com/articles/TestYourself.html">Test Yourself - Joel on Software</a>:
<blockquote>
"By the time I got to Penn for my first year of college, I thought I was already a pretty good programmer. Completely self-taught, I had written two major systems in Turbo Pascal ... one of them was a complete inventory system for a small factory, while the other scheduled all the production at one of Israel's largest bakeries.
It took me until the midterm exams to realize I wasn't as smart as I thought. I completely screwed up some questions, because I still didn't get pointers and I still didn't get recursion.
Never one to hold a grudge, I share those midterm questions with you... see if you can do better than I did <b>freshman</b> year."
</blockquote></p>
<p>
They are basic concepts that anyone claiming to be a computer science student should know. At this point, it might be best to remind you that computer science student != normal programmer. Go take the test and see if you agree. No matter what language you program in, you should be able to see the subtle requirements of each question.
<ul>
<li>
A normal programmer is someone who churns out programs (they might or might not be great; for instance as an extreme example, you could print 1 2.... in a loop, or you could do it by typing each line out by yourself). A computer science should be someone who can look at a problem and propose different solutions. A computer scientist knows the term polymorphism not only as a buzzword but as a high-level concept that can be used to create better programs.</li>
<li>
A programmer might be proficient in one (or maybe two languages) but a computer scientist knows about the techniques of each language so that he or she does not program in that language but programs into that language. Just because your language does not support blocks or closures, does not mean that you cannot fake it to make your programs simpler.</li>
<li>
A programmer will switch to a different framework/language capriciously, believing that it is the limitation of the framework/language that the task at hand cannot be accomplished. A computer scientist knows that all programming languages are Turing equivalent and what you can do in one, you can do in another. It just how hard it is to actually do it. It is not impossible, maybe just harder.
</li>
<li>
(I could not resist). A programmer is someone who depends on the IDE to tell them what to do since the programming language of their choice has so many libraries and functions that they need. All they have to do is find them. While they do try to avoid doing so, computer scientists are able to whip up a quick algorithm that accomplishes the same task good enough without wasting time hunting down the documentation on how to use those libraries or functions in the first place.
</li>
</ul>
</p>
<p>See, I told you that this was not another Ruby vs. Java article. It was just pure coincidence that my examples included Ruby and Java. I don't really care if you learn Ruby or Java but I advocate that if you are serious about programming, you had better learn C (or assembly language, but C is low level enough), then some object-oriented programming language (does not really matter if they are <i>pure</i> or semi) and maybe pick up a functional language from the Lisp family to actually be able to think differently.</p>
<p>With those skills, you can be sure that no matter what new programming language they throw your way, you would be able to pick it up easily. And you would be in a better position to justify what new language is worth learning and what it not going to make much of a difference to your programming style.</p>
<p>Related readings: <a href="http://www.paulgraham.com/paulgraham/avg.html">Beating the averages by Paul Graham</a> and <a href="http://www.catb.org/~esr/faqs/hacker-howto.html">How to be a Hacker by Eric Raymond</a>.</p>
When procrastination is justified2005-12-26T00:00:00+00:00http://vazexqi.github.com/2005/12/26/when-procrastination-is-justified<p><a href="http://paulgraham.com/procrastination.html">Good and Bad Procrastination</a>:
<blockquote>
"There are three variants of procrastination, depending on what you do instead of working on something: you could work on (a) nothing, (b) something less important, or (c) something more important. That last type, I'd argue, is good procrastination."
</blockquote></p><p>
Graham argues that putting off less important things to accomplish your greatest goal is justifiable. In fact, he believes that is how successful people function: they put off mundane errands and concentrate on their greatest issue at hand. How would you classify something as mundane or important? Graham provides the answer in the form of three questions:
<ol><li>What are the most important problems you have now?</li><li>Are you working on them?</li><li>Why not?</li></ol></p><p>
On the other hand, I have a less rigid belief: that procrastination is fine if you know what you are doing. The hard part is knowing if you <i>actually</i> know what you are doing.</p>
<p>
<b>Procrastinate: delay or postpone action; put off doing something.</b>
</p>
<p>
Surprisingly, everyone has something that we have been putting off. You know you have to do it sooner or later but you just do not want to do it. So, sometimes it keeps nagging you at the back of your head; other times you just completely forget about it until it about due.</p><p>While that might sound like a bad thing, it might not be that bad. True, you will probably feel the stress if you put off something big until the last minute. But most of the time, no one will even notice the difference if you do it early or late. In fact, I have seen many situations where last minute solutions are on par with those that have been planned carefully from the beginning. For instance, as a teaching assistant, I have seen students put together a final project in less than 48 hours before the deadline. And their work is nothing short of spectacular.</p><p>
We live in a society that favors productivity. Everyone expects something from you. They want you to reply their e-mail as soon as possible. They want you to give a reply instantly. By giving them your reply as soon as possible, you make their lives easier but you do not necessarily make <i>your</i> life easier.
</p><p>I guess the most important thing for whatever you are doing (or not doing) is to realize it yourself. For instance, if I am going to laze around, I should be aware that lazing around is something that I really want to do. If I am going to put off doing something, then I make sure that I know that I am putting it off. If you realize that you are putting something off, and it is <i>your</i> choice then you will not feel that nagging feeling in your head. You realize that you are in control. You know exactly when you are going to do it. Even if it is going to be two hours before it is due.</p><p>What I am trying to say: procrastinate under controlled situations. Controlled stress is a good motivator for you to succeed. In fact, controlled stress is better than trying to force yourself to do something when you are not ready to do it. Now, when I am ready to do that important errand, everything else less important just gets put off. Of course, this is definitely not good for productivity since you have to put off more errands just to get the current thing done.</p><p>So, to iterate on Graham's arguments: there will be times when you definitely will procrastinate. And when you do, realize that no one expects you to do everything. Prioritize the stuff that you need to do, and not be too rigid in doing them. There will be a lot of things that you have to do, but you really do not feel like doing. Procrastination does not mean that you will not do the task at hand, it means that you are merely delaying it. As long as it gets done before it is due, it is fine (most of the time, unless you really care about making an impression on someone).</p><p>
In a real-time system, it does not really matter if you get the task done five minutes before or one hour before. What is important is that you meet the required deadline. I think that is how it is with real life tasks as well. Some things can be put off since they have an indefinite wait time; they are non-critical tasks. Some things have to be done quickly: the critical tasks.</p><p>Now, all you have to do is realize which tasks are critical and which are not. Graham believes that the critical tasks are tasks that will help you leave your mark in society. Instead, I think they are tasks that you will feel good after doing them. If you do all the critical tasks only, then you will never have time to savor the less critical ones. Want to try to do both the critical and non-critical ones and achieve a 100% output? Don't bother, there is a reason that they are called non-critical tasks; because delaying them indefinitely will not kill anyone.
</p><p>
In short, stick with Graham's arguments, but change the priority of stuff around once in a while. As long as critical tasks get done, you are fine.</p>
Chronicles of Narnia: Symbolisms2005-12-26T00:00:00+00:00http://vazexqi.github.com/2005/12/26/chronicles-of-narnia-symbolisms<p>
Managed to catch Chronicles of Narnia the other day. It was pretty much how I remembered it when I read the book as a kid. There are seven books in the Chronicles of Narnia, I do not think that I have read all of them but I have definitely read The Lion, the Witch and the Wardrobe since I do remember the Turkish Delight part. Overall, it was a nice story and the special effects were done nicely without overwhelming the story. Some of my friends might not have liked it because of its lack of violence, but then again, this is supposed to be a children's movie.
</p>
<p>
C.S. Lewis, the creator of the series was a prominent Christian writer and has endowed this story with a few symbolisms from the Christian bible. These are a few that I have noticed. Of course, this is based on my own interpretation and might be completely off so do not quote me on this:
<ul>
<li>Aslan <br />
The Christian Bible refers to God as the Lion of Judah so it is befitting that Aslan has the symbol of a lion.
</li>
<li>Sons of Adam and Daughters of Eve <br />
Humans are still God's chosen race even if they are the ones who fall into temptation most often.</li>
<li>The weapons <br />
Peter's weapon resembles the things commonly known as the Armor of God: Shield of Faith and the Sword of the Spirit.</li>
<li>Aslan's self sacrifice <br />
Almost entirely based on the story of Christ dying on the cross for the sins of the people.</li>
<li>Aslan's mockery before crucifixion <br />
The Witch's minions mocked Aslan just before he was crucified. Removing his mane seems similar to putting a crown of thrones of Jesus' head before he was crucified.</li>
<li>Aslan's resurrection <br />
True, he did not take 3 days to resurrect but he did resurrect in the end after being crucified since he was sinless to begin with.</li>
<li>The two girls who were with Aslan <br />
The two were the ones who were most faithful to Aslan just before he was sacrificed and also were the first to see Aslan after his resurrection. This is similar to the incident in the Bible where Mary was the person who prepared Jesus for his sacrifice (she poured expensive ointment onto his feet) and also Mary was the first to see Jesus after the resurrection.</li>
<li>Resurrecting the dead after Aslan's resurrection <br />
After his resurrection, Aslan went to raise the dead denizens of Narnia. In the Christian Bible, after Jesus's resurrection, the dead also raised up from their tombs.</li>
<li>The creatures on Aslan's side and the creatures on the Witch's side <br />
In the Old Testament of the Christian Bible, there were clear rules on what creatures were considered clean and unclean. It seems that most of the creatures on the Witch's side resemble the unclean animals (slimy animals without scales) and those on Aslan's side resembled those mythical creatures such as the seraphic that were usually placed in the temples. </li>
</ul>
</p>
<p>So those are some of my observations on the movie. There could be some subtle symbolisms that I might have missed, but I should have gotten most of them.</p>
About web browsers2005-12-24T00:00:00+00:00http://vazexqi.github.com/2005/12/24/about-web-browsers<p>
<a href="http://performancing.com/firefox">Performancing for Firefox | Performancing.com</a>
</p><blockquote>Performancing for Firefox is a full featured blog editor that sits right within Firefox. Just hit F8 or click the little pencil icon at the bottom right to bring up the blog editor and easily post to your Wordpress, MovableType or Blogger blogs.</blockquote>
<p>
A few months ago, I blogged about <a href="http://www.flock.com">Flock</a> and how it had a neat idea of integrating a blog editor into the web browser. Amazingly, today I stumbled across Performancing and it does for Firefox 1.5 what Flock is famous for. I could be entirely wrong, but right now it seems that Flock might be in some kind of quagmire. Flock is supposed to be a social browser, one that has heavy reliance of what constitutes web2.0 :flickr, blogging, del.icio.us. With the right extensions, Firefox 1.5 can be configured to do all that and more as well. In fact, Firefox might be a better client for all that since the extensions can easily be updated without requiring the whole application to be redownloaded. So, right now, I am really curious to see what the Flock guys have to say. Of course, I might be totally wrong with this post and Flock might have something completely different up its sleeves.</p>
<p>
While I am on the topic of web browsers, I might as well mention that the <a href="http://hmdt-web.net/shiira/en">Shiira Web Browser</a> for OSX is pretty impressive. It uses the same rendering engine as Safari and that makes it really fast. Also, its interface is really nice (much better than any other web browser out there for the OSX: firefox, omniweb, opera). Right now, there is no compelling reason to actually switch over to it unless you are a Safari user in need of a more powerful version of Safari without resorting to plug-ins. By the way, I realize that installing plug-ins for Safari is an almost disastrous move: <a href="http://culater.net/software/PithHelmet/PithHelmet.php">PithHelmet</a> crashes Safari very often, <a href="http://haoli.dnsalias.com/Saft/">Saft</a> makes Safari slow as ever. The only plug-in I have installed right now is just SafariStand and Shiira has most of the features of SafariStand. One really nice thing that I like about Shiira is the fact that it can support bookmarks from different web browsers without actually importing them. Instead of importing, Shirra mirrors them so that you can easily access those bookmarks from Shiira itself. Right now, Shiira supports bookmarks from Safari, Firefox and Opera.
</p>
<p>
By the way, it seems that right now, Performancing is stil having some trouble with Typo. Originally, I had planned to post this from within Firefox itself but had to resort to the default admin page of Typo after suffering from an error message.
</p>
What this semester has taught me2005-12-22T00:00:00+00:00http://vazexqi.github.com/2005/12/22/what-this-semester-has-taught-me<p>
It's that time of the year again where I reflect on what I have learned for this semester. This semester has been relatively kind to me with no subject too dull or difficult. Also, this was the semester where I had to practice for the <a href="http://www.ets.org/gre">GRE</a> and complete my graduate school applications. In addition, I was also an undergraduate teaching assistant for two classes and these two jobs consumed more than 12 hours of my week.</p>
<p>
But I am glad that I took the classes that I did.
<ul>
<li>ART 140: Introduction to Art <br />
After taking this class, at least now I can claim to know more 20th century artists and begin to appreciate art in a new light. Formerly my knowledge of art history was really limited, but right now, I am confident enough to go to an art museum and understand and appreciate the terms that are used to describe a masterpiece. Also,
I think I am capable of identifying different painting styles. But now that I think of it, knowing the nomenclature does not really make the ugly art any better than it is. The selection of topics was thorough enough and the field trips that we had were interesting. The only bad thing was the disorganized nature of the course toward the end of the semester; the lecturer decided to just drop some of the materials from the schedule because she had not plan her schedule properly. In addition, the grading scheme for the exams was too subjective and involved too much writing. Moreover, there were 4 exams and 3 papers. Even though the grading was rather lenient, it was still a lot of work for a 3 credit hour course. Nonetheless, I am glad that I took it.
</li>
<li>CS475: Formal Models of Computation <br />
Decided to take this class to fulfill my Math minor. It is reputed to be one of the harder undergraduate courses for Computer Science majors. Though there were parts of the course that still elude me, I am glad that I took this course, for the simple reason that I managed to survive it and did rather well for it in the end. Also, though most of the theories taught will never be used by me directly, those theories are enlightening in a sense. When someone talks about computational complexity at least I am able to comprehend what is involved.</li>
<li>CS431: Embedded Systems <br />
An interesting course and one that is really useful. The focus of the course was on programming on the <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=2010">ATMega16</a> chip connected to a board that provides serial communication, joy stick support, LCD module and connection to a digital to analog converter. The lab work was done in the C programming language and some of the assignments involved writing code for Linux. The 10 labs were interesting, with the last few labs requiring a program that can automatically balance a swing by draining and filling water on either sides of it. The class covered basic Fourier Transform, PID controllers, Rate-Monotonic scheduling and POSIX programming. I feel that
I left the class knowing a lot more on how to actually program for an embedded device with its limited processor and memory. Somehow, dealing with low level stuff still strikes me as being more interesting than programming for Eclipse.</li>
<li>CS 397: Motes project <br />
An ongoing project that involves more embedded systems programming. It involves interfacing what I did in the embedded systems class with Mica2 motes to exploit their wireless capabilities. See my previous entries for more information.</li>
<li>CS397: Photran project <br />
Involves dwelling into the heart of the <a href="http://www.eclipse.org">Eclipse</a> IDE and writing a plugin for it. Unsurprisingly, the plug-in is called <a href="http://www.photran.org">Photran</a> and serves to make Fortran programmer's slightly happier. The first thing I have to admit, I do not really get the Eclipse framework. It seems that it has been overly abstracted that only a few people understand what is going on. And even with those abstractions, the core of it is still constantly evolving so much so that the difference between version 3.0 and 3.1 can actually break your code. And did I say that it is painfully slow to work with? In fact I cannot even develop this project on my powerbook because of the power hungry nature of Eclipse. What I do like is the fact that I managed to tackle this behemoth project rather well and was able to produce a decent text editor that people are actually using for Fortran development. In addition, I even subscribe to the mailing list and fix bugs. This is about as close as I have gotten to a real open source project where people from around the world give their support. So sometimes when I hear people giving feedback on the mailing list, it does raise my spirits a bit.
</li>
</ul>
</p>
<p>
Nevertheless, as aforementioned, this semester has been a fun semester for me. There was nothing that I particularly loather, even though the Photran project did get on my nerves once in a while. Next semester would also be fun. I will be taking a graduate level course on object-oriented design taught by Prof. Ralph Johnson, co-author of the famous Design Patterns book. I have browsed through some of the syllabus from past semesters and am beginning to learn Smalltalk using <a href="http://smalltalk.cincom.com/gettingstarted/index.ssp?content=trysmalltalknc">VisualWorks</a>. I tried using <a href="http://www.squeak.org/">Squeak</a> but all the multimedia stuff was too distracting.</p>
<p>While the IDE for Smalltalk definitely need some polishing, there is nothing wrong with the language itself. In fact its syntax is so simple, that it can easily fit within a <a href="http://www.esug.org/whyusingsmalltalktoteachoop/smalltalksyntaxonapostcard/">postcard!</a></p>
<p>Also, I will be taking ECE411, something that I am not terribly interested in because I really do not like VHDL.</p>
<p>Anyway, next semester will be my last as an undergraduate so I will try to accomplish as much as possible and hopefully have some fun as well.</p>
Now, TinyOS on Windows2005-12-22T00:00:00+00:00http://vazexqi.github.com/2005/12/22/now-tinyos-on-windows<p>
My previous post on being able to successfully install TinyOS on Red Hat 9 might have been a bit premature. True, I am able to compile applications and upload them through the parallel port and the MIB500 programming board, but I do not seem to be able to get anything from the serial port! I even wrote some simple C programs to test the serial port by using a null modem connected from /dev/ttyS0 to /dev/ttyS1 with a sender running on ttyS0 and a sender on /dev/ttyS1. So, there is nothing wrong with my port even though I was a bit suspicious since I had to enable that port under VMWARE for the guest operating system (there is a setting for this under VMWARE).</p><p>
In case anyone is curious, to actually verify that your TinyOS installation is complete and your motes are working, there is a series of test in the apps/MicaHWVerify folder. Part 1 involves uploading a binary counter program to the motes that will enumerate the LEDs. Part 2 involves reading the ID of the mote and obtaining the value via the serial port. My setup failed part 2 so there was no need to go on to part 3: verifying that motes can communicate with one another wirelessly.
</p><p>
Some google searching revealed that others were having the same problem. There we some suggested solutions but none of them worked for me:
</p>
<p><a href="http://www2.ece.jhu.edu/faculty/andreou/498/ToolsAndLabInfo/MICA_Motes/How2Start.htm">New Page 1</a>:
<blockquote>
"In order to test the Mica2 Motes, we will run a Java program that will attempt to read a mote's serial ID. First, connect the programmer to the serial port, and if you're using the MIB500 you should make sure <b>that the parallel port is no longer connected (may cause problems)</b> and that your serial port is set to 57600bps (that is, for Mica2; if you're using Mica or Mica2dot then you should set this to 19200bps), 8 data bits, no parity, 1 stop bit, no flow control."
</blockquote></p>
<p>
<a href="http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2003-December/002639.html"> [Tinyos-help] mica2 -- java hardware_check failed
</a>:
<blockquote>
"I went to $TINYOSDIR/tinyos-1.x/tools/java and typed 'make', and then cd $TINYOSDIR/tinyos-1.x/tools/java/jni and typed 'make install'. Then recompiled 'hardware_check.java' and it's working now. I think(not sure) that happened because the files in the two dirs above are extracted from the tar ball but not installed by default, and these steps are not specified in the manual prior to running 'hardware_check"
</blockquote></p><p>
So I tried this on my Windows XP installation, also on VMWARE and it works fine, being able to identify the serial number of the mote and continuing to step 3 of the verification process. I think I am going to stick with Windows for the time being just to avoid having to solve hardware and installation problems. The only reason I was going to use Red Hat was because I had some code from someone else that could only work on Red Hat. I guess porting it over from Linux to Windows might be easier than trying to do the entire development in Linux where there are too many possibilities for errors.</p>
<p>
Incidentally, the art of programming the motes is more of a hit and miss technique that is also shrouded in taboo and other superstitions (they do seem to work though). The most obnoxious problem that people seem to face is the infamous flash error bug:
</p>
<p><a href="http://www2.ece.jhu.edu/faculty/andreou/498/ToolsAndLabInfo/MICA_Motes/How2Start.htm">New Page 1</a>:
<blockquote>
"Other people have found that clearing the mote memory by entering
<br />
<code>uisp -dprog=dapa --erase</code>
<br />
at the command prompt can solve the flash error problem. If it doesn't, sometimes clearing the memory multiple times in a row or installing Blink.nc onto the node seems to fix the problem. I particularly found that installing TOSBase.nc was often the best solution."
</blockquote></p>
Installing TinyOS on Red Hat 9: Time consuming task2005-12-22T00:00:00+00:00http://vazexqi.github.com/2005/12/22/installing-tinyos-on-red-hat-9-time-consuming-task<p><a href="http://www.crhc.uiuc.edu/~mjmille2/howtos/installing-tinyos-for-telos-on-linux/">Matthew J. Miller's HOWTO: Installing TinyOS</a>:
<blockquote>
"You can try installing TinyOS from RPMs as suggested on the TinyOS website. If this works for you, I suggest that you leave the office immediately and go buy a lottery ticket. Based on my experience, the more likely scenario is that you'll be on the verge of hurling a laptop through a window after a couple of days of trying to troubleshoot via the TinyOS mailing lists"
</blockquote></p>
<p>
Unfortunately I cannot perform the act of defenestration on my machine since doing so could actually kill someone at the bottom of my dorm! Imagine a 20-pound dual Xeon server crashing down on you. Indeed I am grateful that I stumbled across this page by just searching on Google for the phrase "installing tinyos on linux". Installing <a href="http://www.tinyos.net/">TinyOS</a> on Linux is a necessary part of my Mica2 Mote project since I have to write the application layer for the motes itself.</p>
<p>
Anyway, the <a href="http://www.tinyos.net/tinyos-1.x/doc/install.html">instructions</a> from the TinyOS website were deceptively simple and involved nothing more than installing a couple of RPMs. I was to discover that this is not the case. Fortunately I was using <a href="http://www.vmware.com/">VMWare</a> and had made <a href="http://www.vmware.com/support/ws5/doc/ws_preserve_using_sshot.html">snapshots</a> of my first clean installation. The first time I installed it, the installation just decided to hang the machine and I had to reboot. After rebooting, I could not even log into the machine. The second time around I was more careful but the same mishap happened again. In the end I gave up entirely on the RPMs and ended up compiling everything almost entirely by source (with the exception of the Java RPMs of course). By the way, it seems that trying to compile the Java source files in the tinyos folder is the most elusive step, one that can permanently leave you with a non-working machine.</p>
<p>
Anyway, the ordeal of trying, failing, rolling back to a previous snapshot and trying again took up nearly 2 days! In the end I almost gave up on installing it on Linux since I can easily install TinyOS on windows (amazingly, the installer for Windows works fine on a clean installation of XP). However, luck was on my side and I managed to solve the problem by installing the latest version of the <a href="http://nescc.sourceforge.net/">nesC</a> compiler as suggested by Miller above.</p>
<p>How did I find out that everything was working? Well, I could compile the sample application without any errors, upload it to the Mica2 Mote via a parallel cable and finally get to see the red LED blink every second. I would say that would definitely count as being successful after fiddling with it for 2 days!</p>
<p>
Now all I have to do is become proficient enough with TinyOS and nesC</p>
What manga is all about2005-12-21T00:00:00+00:00http://vazexqi.github.com/2005/12/21/what-manga-is-all-about<p><a href="http://www.mercatornet.com/index.php?option=com_content&task=view&id=192"></a>Manga Mania:
<blockquote>
"The Tokyo comic book market is very different from the US market: Comic
book series launches, ad campaigns to hype the new hero, spin-off
character-based comics playing off flagships like Superman and X-men
are the norm in the US, but not in Japan."
</blockquote></p><p>(Via <a href="http://blogdex.net/track.asp?id=12988964">Blogdex</a>.)</p><p>This article presents what Manga is all about and why it is not <i>about</i> your average spandex-clad super-heroes trying to save the world from some evil egomaniac (of course, you can find manga of that genre if you are interested). You will manga characters from the most unlikely sources: detectives, magicians, robots, normal everyday people living their normal lives. In short, manga tries to cater to a wide range of audience.</p><p>More importantly, it is not <i>all</i> about the drawing but rather the story. True, most American comics have fantastic drawing, inking and coloring but their story line is abysmal. In fact, you will realize soon enough that after reading a few pages, you can easily guess what the next corny line is going to be from an American comic. Why? Most probably because they are just <i>that </i>many story lines for a sci-fi for a comic that you have probably seen them all: time warping, multiple identities, psychological trauma, different eras, etc.</p><p>Because manga tends to focus more on the story line, they employ simple drawing that capture the essence of the story, no more and no less. This makes for a very clean story line without all the distractions that arise from the drawings.</p><p>So go read the Manga Mania article and head over to <a href="http://thelurker.net/">lurker.net</a> to obtain your first copy of a scanlation.</p>
Trim the Services menu2005-12-21T00:00:00+00:00http://vazexqi.github.com/2005/12/21/trim-the-services-menu<p>
I just discovered two great applications to help you get rid of the useless clutter in the Services menu in OSX. Most people will not even know that there is a Services menu in OSX since the entries there are mostly useless stuff that applications decided gratuitously to put there. For instance, who in the world uses the Chinese Text Converter service, or the View in JavaBrowser, etc.
</p><p>
Being the neat freak that I am, I was happy to find a hint on macosxhints.com to show how to get rid of those entries. However, I was even more ecstatic to find these two applications from different authors.
</p><p><a href="http://mjtsai.com/blog/2005/12/21/service-scrubber-10/">Michael Tsai - Blog - Service Scrubber 1.0</a>:
<blockquote>
"Peter Maurer's <a href="http://www.petermaurer.de/nasi.php?section=servicescrubber">Service Scrubber</a> provides a unified interface for hiding services from the menu (thus removing clutter), changing their keyboard shortcuts, and moving them to the top leve"
</blockquote></p><p><a href="http://www.macworld.com/weblogs/mac911/2005/12/trimservice/index.php?lsrc=mac911blog">Macworld: Mac 911: Trimming the Services menu</a>:
<blockquote>
"[Y]ou’re just as welcome to try Blacktree Inc’s free <a href="http://blacktree.com/apps/servicemanager/index.html">Service Manager</a>"
</blockquote></p>
<p>
<p>
For an extreme example of how unkempt the Services menu can be, take a look at this article: <a href="http://www.macworld.com/news/2005/12/21/services/index.php?lsrc=mwrss">Macworld: News: Opinion: The sad state of Services</a>:
<blockquote>
"<b>What’s not to like?</b>
<br />
There are two main issues with the Services feature that really affect its usability:
<br />
Issue #1: Services aren’t available in all applications.
<br />
Issue #2: The Services menu is out of the user’s control.
</blockquote></p></p>
<p>
Also, it's amazing how both MacDevcenter and Macworld is jumping on this story.</p>
Some problems with GUID2005-12-21T00:00:00+00:00http://vazexqi.github.com/2005/12/21/some-problems-with-guid<p>
There were some problems with the guid for articles. Somehow, typo (or rather the validates_uniqueness_of API was telling me that the guid for my new article is NOT unique!). This seemed pretty impossible to me since it is really really hard to get a similar guid since it depends on the time the article was submitted.
</p>
<p>
In fact the code that determines the guid is found in the app/models/article.rb file which is generated by the following line
<br />
<code>
self.guid = Digest::MD5.new(self.body.to_s
<br />
+self.extended.to_s+self.title.to_s
<br />
+self.permalink.to_s+self.author.to_s
<br />
+Time.now.to_f.to_s).to_s if self.guid.blank?
</code>
</p>
<p>
And the line that validates it uniqueness is right at the end of the file:
<br />
<code>
validates_uniqueness_of :guid
</code>
</p>
<p>
Really weird. And there was nothing in the log/production.log file as well. Database also seems to be fine and after posting the article I can even verify that the article guid is indeed unique. Also there was nothing on the Typo mailing list.
</p>
<p>
Anyway, I got rid of the validates_uniqueness_of line and I was able to post new articles. We shall see how it goes for the next few days.
</p>
<p>
So far, I suspect that I must have messed up something somewhere else such that each new article is being posted twice, just before the first one gets into the database. However, I did install Typo over from scratch and still nothing.
</p>
How programming languages are created...2005-12-10T00:00:00+00:00http://vazexqi.github.com/2005/12/10/how-programming-languages-are-created<p><a href="http://www.paulgraham.com/fix.html">What Languages Fix</a>:
<blockquote>
"Cobol: Fortran is scary."
<br />
"Basic: Fortran is scary."
<br />
"APL: Fortran isn't good enough at manipulating arrays."
</blockquote></p>
<p>Seems like most of the other languages created that try to make Fortran less scary are not too successful nowadays. Well Visual Basic is still OK, but it isn't really the Basic language that it was. </p>
<p>The entire list of programming languages and what they try to fix is available from the link above. Kelleher really presents an interesting view to why programming languages were created. In fact, I think, if it were not because assembly language is so cryptic for most people, we would not even end up with C...C++...Java....C#....(what other C variant language?)</p>
del.icio.us: y.ah.oo!2005-12-09T00:00:00+00:00http://vazexqi.github.com/2005/12/09/del-icio-us-y-ah-oo<p><a href="http://blog.del.icio.us/blog/2005/12/yahoo.html">del.icio.us: y.ah.oo!</a>:
<blockquote>
"We're proud to announce that del.icio.us has joined the Yahoo! family"
</blockquote></p>
<p>
Together with its previous acquisition of <a href="http://flickr.com">Flickr</a>, Yahoo seems to be trying to get into the whole hip web-savvy user tools thing. After all, <i>all</i> hip bloggers use flickr for photos and <a href="http://del.icio.us/">del.icio.us</a> for their bookmarks. And don't forget those tags. Hmmm... maybe they are going to go buy up <a href="http://www.43things.com">43things.com</a> soon.</p>
<p>Either Yahoo wants to jump in and get some of the share from this set of hip users, or they just really ran out of ideas of their own and are cashing in on what other people are doing. Not a bad call based on previous opinions on this matter by <a href="http://www.37signals.com/svn/archives2/how_do_you_feel_about_someone_else_making_money_off_your_content.php">Joe</a> and <a href="http://www.dashes.com/anil/2005/10/25/the_interesting">Anil</a>.</p>
Revival: Ruby + Lisp2005-12-04T00:00:00+00:00http://vazexqi.github.com/2005/12/04/revival-ruby-lisp<p><a href="http://redhanded.hobix.com/cult/twoThings.html">Two Things</a>:
<blockquote>
"First, I'm sure you've read a lot of the <a href="http://del.icio.us/tag/ruby+lisp">ruby-lisp equivalence</a> discussions over the weekend. This is great stuff, I hope it gets deeper and we can find some good middleground. The way I feel about Lisp is the way I feel about socialism. Neat ideals and I really wish they worked on humans!"
</blockquote></p>
<p>
I will definitely want to read at least two of the pages bookmarked on the link above. This is definitely an interesting revival of my interest in ruby+lisp -- not that it ever <i>died</i> or anything but it must have diminished during the past few months as I ventured into other stuff. Heck, if this ruby+lisp thing is interesting enough, I might even be able to write a thesis on it.</p>
<p>Errr... so why the post? Nothing much yet, just reserving a place for it here so that I do remember to come back and write about it.</p>
Manga: Hikaru No Go and GTO2005-12-04T00:00:00+00:00http://vazexqi.github.com/2005/12/04/manga-hikaru-no-go-and-gto<p>
It has been some time since I have read something that is really worth posting about manga. But I guess there are two series that I have just completed that are worth mentioning somewhat. I have not read other works from the same mangaku so I would not dedicate full posts to them.</p>
<p>
The first, Hikaru No Go. I think it is supposedly the manga that sparked some Go interest when it was turned into an anime. For those who do not know what Go is, a quick search on Google reveals this <a href="http://en.wikipedia.org/wiki/Go_(board_game)">link</a> which should provide more than enough information. Of course, it is not necessary to know Go to actually read the manga which may or may not be a good thing. Anyway, the manga begins fairly well with the introduction of some spirit called Sai that possesses an old goban (Go game board). Seems like Hikaru (protagonist) is among the few who can see this spirit. So Sai goes along merrily with Hikaru and influences him to play the game of Go. Needless to say Hikaru was resistant to Sai's suggestions as first but in the long run develops a deep interest for Go. At first, I thought that this is indeed an interesting way to start a manga: have a spirit that piques the interest of a boy to play Go. Unfortunately halfway through the series, Sai has to leave the world, fo no apparent reason. That was where I got really annoyed at the story. I really dislike stories that kill off characters for no apparent reason. Worse yet, the series did not even complete the story about the <i>Hand of God</i>. Throughout the series there were allusions to a perfect game of Go that is called the <i>Hand of God</i>. Unfortunately by the time the series ended, the concept of the <i>Hand of God</i> seemed to have been abandoned leaving the story with a poor ending that does not do justice to the series. In other words it was a forced ending. Moreover, they are entire volumes dedicated to nothing but side stories. To me, it shows that the mangaku has already ran out of ideas and it just milking the rest out of his dedicated readers. All in all, I felt that this manga got off to an excellent start but fell short in the end. I am not sure what actually happened to the mangaku who did this series but it could have been much better.
</p>
<p>Onto another series. GTO. Seems to be popular enough that they even made an anime out of it and even had a real drama series for it with real life actors. Though I do wonder how they toned down some of the scenes that were either very violent or just plain weird. Anyway, GTO is fantastic. Here is a story that does not rely on excellent art work but a sound story line instead. Take a gangster and make him into a teacher. (By the way, this gangster has weird (unorthodox ways) of educating problem kids, which makes for the interesting story). And then show what is wrong with the education system. Of course, it has some nonsensical behavior but it also goes to show why part of the education system in Japan is not really working. The only shortcoming that I found was the elaborate plan of the students to actually get rid of their teacher. For this they would even go so far as to plant sleeper students in the class to upset the teacher. Other than that, the story is interesting and not too long. Of course, don't really believe everything that you read in this series. </p>
<p>This post might seem a little out of place compared to the other posts that I have written but I still find it relieving once in a while to write about such things. After all, if it is worth reading, it is definitely worth writing about.</p>
Working on Berkeley Mica2 Mote2005-12-02T00:00:00+00:00http://vazexqi.github.com/2005/12/02/working-on-berkeley-mica2-mote<p>
My latest project involves making use of what we have learned in our Embedded Systems class and interfacing it with the <a href="http://www.xbow.com/Products/productsdetails.aspx?sid=72">Berkeley Mica2 Mote</a>. The mote is definitely capable of more advanced stuff but right now it is just being used to transmit information wirelessly to one another.</p>
<p align="center">
<a href="http://www.flickr.com/photos/vazexqi/69598091/" title="Photo Sharing"><img src="http://static.flickr.com/6/69598091_fd7873ee9f_m.jpg" width="240" height="180" alt="Mica2 Mote" /></a>
<br />
<small>Mica2 Mote</small>
</p>
<p> In a nutshell, this project involves two mote and two AVRBoards. One mote and one AVRBoard make a complete node. So we have two nodes in our scenario. One node will measure the angle of a seesaw and send that measurement to the other node. Based on the sent value, the other node will compute a value to be send to the water pumps to either drain or fill water into the seesaw so that it balances itself. The value computed will be based on a simple <a href="http://www.engin.umich.edu/group/ctm/PID/PID.html">PID controller</a> feedback system.</p>
<p align="center">
<a href="http://www.flickr.com/photos/vazexqi/69591863/" title="Photo Sharing"><img src="http://static.flickr.com/18/69591863_38e3733b17_m.jpg" width="240" height="160" alt="AVRBoard"/></a>
<br />
<small>AVRBoard showing the values of the PID controller.</small>
</p>
<p>Designing the PID controller was already done in a previous lab assignment and was not too hard. What I needed to do was interface the motes with the AVRBoard.</p>
<p align="center">
<a href="http://www.flickr.com/photos/vazexqi/69598092/" title="Photo Sharing"><img src="http://static.flickr.com/9/69598092_1696b698e3_m.jpg" width="240" height="180" alt="Programming board to interface with the mote" /></a>
<br />
<small>Mote programming board with no mote connected.</small>
</p>
<p>By itself, the motes has no way of connecting to the AVRBoard. Instead what we need is to place the mote on a programming board. This programming board features a serial port and a parallel port. The parallel port is used to "program" the mote; that is we send a .hex file to the mote that tells it how to function. For the first stage of the project, one of the motes will be configured to send out a sine wave and the other will be configured to function as a receiver. The wireless signal is based on an implementation of <a href="http://rfc.dotsrc.org/rfc/rfc1663.html">RFC 1663</a> protocol. The settings for this connection is 57600/8/1/NONE.</p>
<p>
The main issue I had over the past few days was getting the programming board connected with the AVRBoard. Both of them have a male-type serial port. At first I thought that just having a converter for a standard serial cable would work. However, it does not. I only realize the problem after consulting with my previous project working with the serial port for another class. What I needed was a <a href="http://www.lammertbies.nl/comm/info/RS-232_null_modem.html">null modem</a>. It basically switched the pins that are used for transmitting and receiving so that the communications can go through.</p>
<p align="center">
<a href="http://www.flickr.com/photos/vazexqi/69598093/" title="Photo Sharing"><img src="http://static.flickr.com/35/69598093_2218880667_m.jpg" width="240" height="180" alt="Completed setup" /></a>
<br />
<small>Mote connected placed on the programming board and connected to a serial cable. </small>
</p>
<p>
So at this stage, I am able to communicate between the sender mote and the receiver mtoe and plot the result on the AVRBoard. The next stage will involve actually marshalling packets to be send over the wireless network.</p>
OmniOutliner has been relegated on my application list2005-12-02T00:00:00+00:00http://vazexqi.github.com/2005/12/02/omnioutliner-has-been-relegated-on-my-application-list<p>
<a href="http://www.omnigroup.com/applications/omnioutliner/">
<img src="http://www.omnigroup.com/images/appicons/128/omnioutliner3.jpg" alt="OmniOutliner icon" align="left" /></a> I suddenly noticed a familiar icon in my Applications folder that has not been touched since I upgraded to Tiger! This is rather interesting because the last time I would take a note on something, I will definitely rely on having the formatting capabilities of OmniOutliner. Nowadays, I just rely on plain text. Well, almost plain text since I format my text using Textile. Why Textile? Because TextMate has some great support for it and I realized that all you ever need is at most 3 levels of indentation and that is easily discernible just from indenting using plain text. Also, I don't really need the folding capabilities that OmniOutliner offers since most of my notes are short enough.</p>
<p>So, my almost daily workflow would involve doing a svn update on the Application Support folder for Textmate and then opening it and running it the whole day. Right now, I use it for almost all my scratch work, not even relying on StickyNotes for simple things.</p>
<p>Well just goes to show, how plain text has once again become the most appealing format to store stuff in. No need for the hassle of hiding stuff now and then. Of course, I am not saying that OmniOutliner is useless; in fact, far from it. Just that right now there is no niche in my workflow that requires the use of a heavyweight outliner.</p>
<p>
Also, it is worth mentioning that the notes I take mostly involve some form of source code so having the text look like source code is also an important feature.</p>
Updated to Typo 2.6.02005-12-01T00:00:00+00:00http://vazexqi.github.com/2005/12/01/updated-to-typo-2-6-0<p>
Finally updated to Typo 2.6.0 and hopefully I have fixed the .fcgi problem where the page refuses to load. Everything looks fine so far, except the format of the new database.yml file was rather interesting when I first glanced at it. Nonetheless, rake migrate went well and there does not seem to be any problems.
</p>
<p>
Anyway, I feel more assured if this test post gets through.</p>
WWFSMD: What would Flying Spaghetti Monster do?2005-10-26T00:00:00+00:00http://vazexqi.github.com/2005/10/26/wwfsmd-what-would-flying-spaghetti-monster-do<p align="center">
<a href="http://www.venganza.org/images/wallpapers/noodledoodle1024_768.jpg">
<img src="http://www.venganza.org/images/wallpapers/noodledoodle1024_768.jpg" alt="By Nilkas Jansson" width="256" height="192" />
</a>
</p>
<p>
Instead of doing a half decent job of explaining what the Flying Spaghetti Monster (FSM) is all about, I would redirect you instead to its excellent entry on <a href="http://en.wikipedia.org/wiki/Flying_Spaghetti_Monster">wikipedia</a>.</p>
<p>More importantly, the FSM is not an attack on Christianity or any other religion. Its main purpose (and the one which I subscribe to) is to let people know that teaching the alternative theory of Intelligent Design in schools will only exposed students to <i>one</i> theory of Intelligent Design. Thus, the creator of FSM, <a href="http://www.venganza.org/">Bobby Henderson</a> came up with his idea of an intelligent designer, the FSM. And he contends that since Intelligent Design is all about teaching an alternative form of human design, the FSM should be included as part of. And if FSM is one of it, then every other religion, belief, conjecture out there also deserve some mention in classrooms. So, there is no end to what it means by Intelligent Design.</p>
<p>
And just for kicks, here are parts of the FSM belief:
<ul>
<li>Prayers to "Him" are typically ended by "Ramen", instead of "Amen".</li>
<li>The monster continues to guide human affairs with his "noodly appendage".</li>
</ul>
</p>
<p>
If they can somehow find a way to teach the theory of Intelligent Design without having it being monopolized by any one religion, then by all means go ahead and do so. Again, it seems more troublesome than it is worth. People who actually care about Intelligent Design would have already joined a religion. And those who do not will also argue vehemently against it.
</p>
<p>
So while, religion and Christianity is a good thing, they should NOT be incorporated in public or private schools. Leave such things to Sunday School where they belong. And while we are at it, let us keep the word God out of all public speeches here. Since whenever anyone uses the word God here, it usually just means the Christian God. No one else is so bold as to profess about <i>their</i> God except the Christians.
</p>
<small>FSM is not a real religion.</small>
What I think about web 2.0 (if anyone cares)2005-10-26T00:00:00+00:00http://vazexqi.github.com/2005/10/26/what-i-think-about-web-2-0-oreilly-network-what-is-web-2-0<p><a href="http://www.oreillynet.com/lpt/a/6228">
O'Reilly Network: What Is Web 2.0</a>:
<blockquote>
"The question is particularly urgent because the Web 2.0 meme has become so widespread that companies are now pasting it on as a marketing buzzword, with no real understanding of just what it means. The question is particularly difficult because many of those buzzword-addicted startups are definitely not Web 2.0, while some of the applications we identified as Web 2.0, like Napster and BitTorrent, are not even properly web applications."
</blockquote><blockquote>
The next time a company claims that it's "Web 2.0," test their features against the list above. The more points they score, the more they are worthy of the name. Remember, though, that excellence in one area may be more telling than some small steps in all seven.
</blockquote></p><p>
Even after reading the article, I still do not get what web 2.0 <i>is</i> exactly but the article does tell of what it should/ would be. In fact the article also does not strive to define what web 2.0 is, only giving examples to contrast what is known as the older web 1.0 and what is now considered to be web 2.0 stuff. Maybe web 2.0 is nothing more than a hodgepodge of technology all loosely linked together. In fact, it is the loose ability to be interconnected that makes web 2.0 so powerful (and prone to abuse). The ability to harness everything else around and shape it as you please, if you have the skills for it (this is what the article means when it says "Users add value"). In short, I think it is the ability to manipulate and interact with different information from across the web. By manipulate, I mean do something to it (filter only the things I want, display it in a certain way) and by interact I mean adding my own thoughts about the information. I hope the last two sentences managed to avoid using too many buzzwords.
</p><p>
Of course, in case you have not noticed, web 2.0 also brings with it a whole new myriad of <i>distractions!</i> Don't believe me? Go to a site like <a href="http://www.digg.com">digg.com</a> or even <a href="http:www.43folders.com">43things.com</a>. Look at the amount of information flowing there with all the user ratings, comments, user pictures, etc. There is a lot of information on one page. Some of the comments are long enough to be considered web articles. It makes you wonder how this people get the time to write all that. And if that were not enough, digg's contents refreshes almost every hour.</p><p>Besides distractions, web 2.0 also brings with it a whole sleuth of personal information issues. There are now so many nifty sites out there that require you to register to get special custom commands. Want to rate a comment of provide feedback on the aforementioned <a href="http://www.digg.com">digg.com</a>? Register first. Want to add to your own list of things to accomplish at <a href="http://43things.com/">43things.com</a>? Register first. And within your user profile, you can even include links to your web blog or <a href="http://43things.com/">flickr</a> account. And now everyone gets to see what you write about and what pictures you have. Consider what happens once the hype about a particular site has died down. You stop visiting it. But you will probably forget to remove your information from the site. And thus your public information is still available there. Ever thought of that possibility? </p><p>What about information overload? We are talking about tons and tons of links from one page to the other. From <a href="http://www.digg.com/">digg.com</a> you can easily click a link to post the current topic to your web blog. This is really nifty and all. But try clicking on some of those blogs. Some of them do provide better insight into the issue at hand. But most of them are just echoing the contents of the topic verbatim on their web blog. Why? If they just want to show that they have stumbled across this topic or want to remember this topic, there is a better way to do this: bookmarks! Or, the uber-cool thing now is to use <a href="http://del.icio.us/">del.icio.us</a>. Or, even better, go ahead and tag this with 10 over tags. Yup, 9 out of which you will probably never ever remember.</p><p>Since we are on the topic of tags, what is the big deal with tags actually? Do they actually help you find information that you need quickly? I have been using them and found them to be really ineffective compared to a simple text based search. For me, tags are more of a way for people to explore things. Consider a tag for "fish" at <a href="http://flickr.com/">flickr</a>. There are so many things that can be tagged as fish. Would you really want to go through all of them? Try it. At this moment, searching for "fish" has returned over <i>42373</i> pictures. And how many of them are actually about angel fish. In a way, tags force you to guess the keyword that you or someone else used.</p><p><small>Even as I write this, I know that there is probably something better that I should be doing instead of going on and on about web 2.0. But fortunately for me, I do enjoy writing and reading what I wrote, so with web 2.0 or not, I will still continue writing.
</small></p><p>
So I am not against web 2.0 or anything. Although I feel that in its inchoate state, there is a lot of possibility for misuse. Some of these things might sound cool now but many of those who embrace these technologies now are just there for the sake of sounding cool. Once the hype dies down, most people will just forget all about it. Remember the personal home page craze a few years back? Boy, I was really into it. Even set up a personal home page with pretty much nothing interesting on it. I was updating it so frequently almost everyday and checking the web stats. But after a few months, the whole thing just died down since there was practically nothing else to talk about myself there. No doubt, web blogs offer more opportunity for content since you do not have to talk about yourself anymore. Instead, now you get to talk about other things that, for all practical purposes, do not concern you.
</p><p>By the way, my short excursion into personal home pages did teach me a few important lessons: how to use HTML, javascript, DHTML and flash. So, it was not all that bad for me.</p><p><a href="http://en.wikipedia.org/wiki/Blake_Ross">Blake Ross</a>, founder of the Firefox project, recently come here to UIUC for the annual ACM Reflections conference. And in his <a href="http://www.acm.uiuc.edu/conference/webcast.php">presentation</a>, he made this very cogent point: not everyone cares about RSS feed and all that fun stuff. People like us who bother reading blogs, subscribing to RSS feeds and are poised to pounce on the latest internet buzzword are actually just a small niche of the users out there. Only recently have most people come to appreciate the web, Google and e-mail. It will probably take them about a decade to come to the level of web 2.0. And by that time, web 3.0 would have surely surfaced.</p>
Theme update(s)2005-10-25T00:00:00+00:00http://vazexqi.github.com/2005/10/25/theme-update-s<p>
There is a new theme competition going on at <a href="http://typogarden.com/">Typo Garden</a> for Typo. One particular theme caught my fancy: Concomitant by <a href="http://marsorange.com/archives/typo-theme-concomitant">Mars Hall</a>. Before the themes (there are set of 4, which can be accessed using the colored buttons on the top left corner) can be used, I had to add a black border around the images because most of my images have a white background; a white background on gray really looks very out of place.
</p>
<p>
Right now I am very satisfied with the theme. The only drawback is that live search is no longer "live" but causes the search page to be returned. Well, that is not that bad. After all, one seldom need to search, right?
</p>
Lisp exercises2005-10-24T00:00:00+00:00http://vazexqi.github.com/2005/10/24/lisp-exercises<p>
My temporary foray with Lisp will take a short break. Previously, I had hoped that my Artificial Intelligence class will be utilizing Lisp as the language of choice for its machine problems. Alas, it did not come to be. Instead the class is wallowing in the revolting scent of Java. Well, not that it matters much since I have officially dropped the class after being nettled by the lecturer's use of catechism to teach.</p><p>
So, here are the source files for the lisp code that I have played around with. Most of these are from the chapter exercises in the book <a href="http://www.amazon.com/gp/product/0023397632/002-7340374-1235213?v=glance&n=283155&v=glance"><i>Little Lisper</i></a> by Daniel Friedman. This book is no longer in print but you should be able to obtain one from your library.
Here are the files, nicely formatted in html for anyone's perusal:
<ul><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/exercise_3.html">Chapter 3 exercise</a></li><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/exercise_4.html">Chapter 4 exercise</a></li><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/exercise_5.html">Chapter 5 exercise</a></li><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/exercise_6.html">Chapter 6 exercise</a></li><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/exercise_5.html">Chapter 7 exercise</a></li></ul><br />
And here are come code from two chapters which I found particularly interesting:
<ul><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/numberGames.html">Number Games</a></li><li><a href="http://homepage.mac.com/vazexqi/docs/lisp/lambdaTheUltimate.html">Lambda The Ultimate</a></li></ul></p>
ROKR?2005-10-22T00:00:00+00:00http://vazexqi.github.com/2005/10/22/rokr<p><a href="http://www.bloomberg.com/apps/news?pid=10000087&sid=aVAltTesg0vE&refer=top_world_news">
Bloomberg.com:
Top Worldwide</a>:
<blockquote>
"Motorola Inc.'s iTunes music phone,
developed with Apple Computer Inc. and unveiled last month in
front of an audience of more than 500, may have flopped."
</blockquote></p>
<p>Do they seriously want people to call it the <i>Rocker</i>? Somehow, I felt that Apple was not putting everything into this product. Instead it was more of a brainchild of Motorola. No Apple logo on the phone <i>at all</i> only the weak association with iTunes. Moreover, the spotlight of the release event was given to the iPod Nano which seems to radiate more techo lust than a Motorola phone. And given all the hype that surrounded it for almost a year (the taoofmac web site even has a <a href="http://the.taoofmac.com/space/iPhone">timeline</a> for it), it is inevitable that everyone would be expecting a little more. For a discussion of why hype is bad, John Gruber has produced an excellent analysis of the situation at <a href="http://daringfireball.net/2005/01/the_rumor_game">daringfireball.net</a> It was as though Apple did not even cared about the leakage of the Rokr even when EnGadget had a <a href="http://www.engadget.com/entry/1234000887049175/">photo</a> of the actual product months ahead.</p>
<p>I don't own one, and I do not plan to own one. So all I can say: I am glad I did not get one. Listening to your music on your phone still seems like a very <i>dumb</i> idea especially when you are stuck with one carrier. And a phone that does not really sync properly with iTunes. Calling it the iTunes phone is a great misnomer. </p>
New Powerbook G4?2005-10-22T00:00:00+00:00http://vazexqi.github.com/2005/10/22/new-powerbook-g4<p><a href="http://www.systemshootouts.org/processors.html">Mac vs. PC System Shootouts - Processor Comparison Chart</a>:
<blockquote>
"[Reports that a 1.67 GHz G4 is about the same speed as a 2.2 GHz Pentium 4 or about as fast as a Pentium M 725 1.6 GHz]"
</blockquote></p>
<p>(Via <a href="http://digg.com/hardware/Processor_Equivalence_Estimates_">Digg</a>.)</p>
<p>
In other words, even if I were to buy the most powerful configuration for the new <a href="http://www.apple.com/powerbook">powerbook</a> (greatest innovation: increased display resolution), it would not be able to compete with what the Pentium M's are capable of. I have had my current powerbook for more than 2 years and its 3 year warranty is going to run out soon. So far, it has perform excellently after 3 OS upgrades: Jaguar, Panther and Tiger. Everything else is working fine too except for the modem which I will not bother replacing. However, its performance is beginning to feel a bit sluggish. After all, it is a 867 Mhz with 512 MB of PC133 RAM. Sometimes when I switch between major applications (i.e. Safari, iTunes, iPhoto) the spinning beach ball comes out. </p>
<p>Even with $3000, I will not be able to get a machine that is on par with the latest Pentium in terms of processor speed. So, the question remains, should I go ahead and get one? Right now, all serious development such as <a href="http://www.eclipse.org/photran">Photran</a> has to be done on my $250 Windows machine. I would really like to be able do more development work on my powerbook.</p>
What's the future of Java?2005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/whats-the-future-of-java<p><a href="http://lesscode.org/2005/08/28/java-tunnel-vision/"> Java Tunnel Vision [@lesscode.org]</a>:
<blockquote>
"I've spent exorbitant amounts of time in the past six-seven years doing endless research around Java community, relentlessly chasing the elusive dream of the possibility of developing apps in a simple, straightforward way. I've tried all the latest and the greatest Java hype, followed religiously every Javaworld and The Server Side and Artima article, but only to in the end throw my hands up in the air in utter desperation. After all was said and done, at the end of the day, all I have is an enormously bloated, <b>to the point of bursting at the seams</b>, Eclipse platform. I am currently nursing countless frameworks, plug-ins, SOA and EMF bullshit is coming out of my ears. My 60 GB laptop with <b>1 GB main memory</b> cannot take it any more."
</blockquote></p>
<blockquote>
<p>
I feel extremely uncomfortable with this situation. I don’t think we, as a community of Java developers, are standing on the solid, firm ground. I think the ground on which we stand is bound to give in under our feet, sooner or later. This is why I’m trying to defect to the Ruby camp, where life is simpler, the air is fresher, and the movement is <b>truly, not nominally, agile</b>.
</p>
</blockquote>
<p>There is an interesting book called <a href="http://www.oreilly.com/catalog/beyondjava/">Beyond Java</a> that I really want to read now.</p>
SCJP2005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/scjp<p><a href="http://headrush.typepad.com/creating_passionate_users/">Kathy Sierra</a> posted some updates for the Sun Java Programmer Certification (SCJP) exam. Seems that this time, question will focus on some of the newer features of Java 5 a.k.a. Tiger. Some of the questions are really tied to the newer features of the language which I have yet to see. Partially because there is no official Java 1.5 for Mac OS X yet. Even then, I have yet to see any new code take advantage of these features. You can check out some of the questions <a href="http://www.wickedlysmart.com/SCJPStudyGuide/Java_5_SCJPquestions.html">here</a>.
</p><p>
I am sure that the purpose of the exam is to certify that you have indeed achieved mastery of the language. However, how is this a useful measurement for your programming skills? Especially since language features are bound to change every now and then. I mean even an old language such as Fortran has been revised several time (F77, F90, Fortran 2003, etc). Chasing the newest features of the language does not seem to be a very practical nor sought-after skill. I mean a good programmer can always pick up such things by reading documentations or just reading other people's code. My professor, of whom I am a teaching assistant for, makes this point by not teaching advanced features of assembly language. He justifies this by teaching only the skills that are going to outlive the features of the x86 instruction set; skills such as writing clear code, debugging code and working in teams. Personally, I would be very wary if the company I wish to work for <b>requires</b> that you are a certified Java/Lisp/.NET developer. Well, maybe .NET might be OK since .NET is a behemoth of a framework and has a lot to offer (and require from its developers).</p><p>Of course, being certified does have a certain status associated with it. After all, it means that you have invested sweat and money going through piles of books that concentrate on one very small subset of development. So, you <i>should</i> be better than the fresh college graduate, right? Maybe. But I have never heard prominent figures such as <a href="http://www.joelonsoftware.com/articles/fog0000000073.html">Joel Spolsky</a> and <a href="http://software.ericsink.com/bos/Closing_the_Gap_Part_1.html">Eric Sink</a> mention that they are going to require specific certification to be considered for a job. In fact what they look for are basic skills that transcend languages. After all, in a worse case scenario, features of the language can be simulated, albeit inelegantly, to serve its purpose. For instance, Java does not have <a href="http://www.martinfowler.com/bliki/CollectionClosureMethod.html">closures</a> (yet?) so make do with the anonymous inner classes. </p><p>
So I am not really sure what one would want a certification in some language. Maybe being certified as a Microsoft Developer (MCSA, etc) might be more useful since it covers a myriad of skills that might actually be useful. Then again, real hackers have other ways to prove their skills: through ingenious code. Who's going to teach you that?</p><p>If I were going to take a certification exam in some language, it would probably be for 2 reasons: because I like the language so much that I feel that being certified shows my <i>passion</i> or because there is something that you can actually learn from that certification that you will find hard to learn unless you spend 2 years on the job. Getting a certification because of a job seems like a weak motivation for me (as of now, but things might change when I really need to get a job).
</p><p>Of course, it could also be another form of passion, as <a href="http://lesscode.org/2005/08/29/vendor-wars/"> Vendor Wars [@lesscode.org]</a> points out:
<blockquote>
"I've always found it curious how easy it is to recruit foot soldiers for a particular vendor. There never seems to be shortage of Microsoft or Java or Oracle etc. apologists, who are canvassing the tradeshows, propagating the vendor of their choice. They appear as if they're working for their sweetheart vendor, but what's fascinating is that all these <b>Herculean efforts are voluntary</b>. No one pays them to do all the free marketing and advertising for Microsoft, Java, Oracle, IBM...
<br /><br />
Why would someone sacrifice so much of their lives to serve some giant vendor? I must honestly say I really don't understand the motivation behind that. However, it neatly explains why so many developers are happily embracing the morecode gospel."
</blockquote></p></p>
Photran: Fortran plug-in for Eclipse IDE2005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/photran-fortran-plug-in-for-eclipse-ide<p>
I cannot believe that I did not mention anything about this project. I have been working on it since Summer 2005 and we have made significant progress. Of course, most sane people would be wondering why in the world are we encouraging Fortran programmers to continue programming in that obsolete and obscure language. Well, academic issues aside, there is still some reason to support the Fortran language: the sheer number of projects that were previously written in it. Fortran, I believe is the oldest programming language. Lisp came after it.</p><p>So what have we accomplished? By we, I mean my <a href="http://www.pairprogramming.com/">Pair Programming</a> partner and myself. Well, we are in-charge of the editor. There is a <a href="http://wiki.cs.uiuc.edu/photran/Possible+Fixed+Form+Editing+Features">list of tasks</a> that we have to do to support Fixed Form Editing. Briefly, Fixed Form editing is a reminiscence of the days of punch cards where you had to carefully write your code starting at designated columns. Here is a picture of what it looks like:
<br />
<a href="http://en.wikipedia.org/wiki/Image:Hollerith_card.jpg"><img src="http://upload.wikimedia.org/wikipedia/en/8/84/Hollerith_card.jpg" alt="Fortran punch card" height="201 px" width="450 px" /></a>
<br />
</p>
<p>So, even though those columns do not really make any sense in a text editor, some of the code has to been maintained just for backwards compatibility. And according to<a href="http://st-www.cs.uiuc.edu/users/johnson/"> Prof. Johnson</a> and <a href="http://www.laputan.org/">Brian Foote</a>, a fixed form source code should be able to compile as valid modern day Fortran code! This makes the task interesting since we have to make it as convenient as possible for the users to edit fixed form code. And, unsurprisingly, most hard core Fortran coders turn to Emacs to help them. So right now, high on our task list is to emulate how Emacs handles fixed form editing. I will confess right now that I am a VIM user and I am not proficient in the Emacs way of things at all, so this is quite a challenge.</p><p>What we managed to come up with so far include a horizontal ruler and vertical lines to indicate important columns. We have also implemented tabbing and auto-indenting to make it easier to code. Additionally, we have also worked on syntax coloring. Fortunately <a href="http://st-www.cs.uiuc.edu/users/johnson/">Jeff</a>, has done a good job by providing us with the proper lexer for this. Here is an explanation why we needed our own lexer:
<pre>
if ( if .gt. if ) then
...
</pre>
Notice that <code>if</code> is being used as a conditional operator as well as identifiers (the <code>if .gt. if</code>)! This is perfectly legal Fortran code. The compiler will infer what is meant based on the context. This will definitely shock some of you. When I first say this, I was really shocked as well. And I am really glad that modern languages are sane enough not to let keywords be used as identifiers. This lexer will also be important once we try to incorporate refactoring facilities into the plug-in.
</p><p>Here is a screenshot of what the program looks like currently. This is still a development version so you cannot grab it yet. You may, however, grab the latest beta version from <a href="http://www.eclipse.org/photran/">Eclipse: Photran</a>.
<div><a href="http://www.flickr.com/photos/vazexqi/54777569/" title="Photo Sharing"><img src="http://static.flickr.com/31/54777569_383fd0deed.jpg" width="500" height="380" alt="Photran" /></a></div></p><p>
So right now, we have also created an installer for Windows that has Photran, <a href="http://www.mingw.org/">MingW</a> with gdb, g77, g95 and make. This convenient installer should make setting up a Fortran development environment as simple as possible. Everything seems to be working now except for g77. After a few more tests, we should be able to release a beta version.</p>
Google Desktop 22005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/google-desktop-2<p><img src="http://desktop.google.com/images/sidebar_hp.gif" alt="Google Desktop" align="right"/><br />
Looks good enough. And you can even integrate it with <a href="http://www.google.com/talk/">Google Talk</a>. What I really like, its handiness. After all, how much more handy can you get besides having it on the right side of the screen? It would be better if you can auto-hide it though. The scratch pad really comes in handy. But the QuickView function is something that I think will be really useful. It stores all your just frequently accessed (or recently) files and web sites.
</p><p>
Of course, with this new product, Google begins to encroach on different turfs. Some argue that Google is becoming evil or, horrors, the next Microsoft. And in fact, they argue that Google is even more dangerous since it indexes your searches, your e-mail and whatever else you access using its services. Well, even Microsoft has really good stuff now and then. So evil might be tolerable to a certain extent.
</p><p>Though the fact that they are requesting your cell phone number as a <i>safe</i> way to prevent people from creating multiple gmail accounts is still questionable. After all, what would they do with those numbers? You think they are going to dispose of them once they send you the pass key? Think about it. Your number is more important to you than some e-mail address (especially one that is created for free). More details on the always excellent <a href="http://radar.oreilly.com/archives/2005/08/twofactor_authe_1.html">O'Reilly Radar</a>.</p>
Flock, Under Those Feathers at PaulStamatiou.com2005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/flock-under-those-feathers-at-paulstamatiou-com<p><a href="http://www.paulstamatiou.com/2005/10/21/flock-under-those-feathers/"> Flock, Under Those Feathers at PaulStamatiou.com</a>:
<div><a href="http://flickr.com/photos/69774033@N00/41847471" title="Flock logo"><img src="http://photos28.flickr.com/41847471_f77380a761_m.jpg" alt="Flickr Photo" align="left" /></a>
"Flock is the latest open source browser, catering especially to bloggers and Web 2.0 savvy users. It is heavily based upon open source code from Mozilla’s Firefox browser and was developed by a group of a 10 guys and a gal in a garage in Palo Alto, California (with lots of contributions from many developers). Flock promises to leave the user with a strong social web browsing experience. With bookmark syncing with del.icio.us, integrated blogging and flickr support, Flock looks like a real treat. But be warned, in this early developer preview there are some nasty bugs and lacking features that should be a must if Flock hopes to lure current Firefox users."
</div></p><p>(Via <a href="http://digg.com/software/FLOCK_REVIEW%3A_Flock%2C_Under_Those_Feathers">Digg</a>.)</p><p>
I actually have a temporary <a href="http://vazexqi.wordpress.com/">blog</a> set up to blog about Flock (I removed it since it was just taking up useless space and I have not maintained it for a while). Or rather just to try out its built-in blogging feature. I really like the concept that they are setting up but Flock, like Firefox does not give me an authentic Mac feel.Speaking of Web 2.0, some people have the guts (I mean this in a good way) to actually point out that it may all just be <i>hype</i>.
<p><a href="http://www.furrygoat.com/2005/10/web_20_just_say.html">The Furrygoat Experience: Web 2.0: Just Say No</a>:
<blockquote>
"As I mentioned a few days ago, I'm pretty tired of 'Web 2.0'. Glad to hear Joel taking a stand against it, and frankly I agree - I'm not going to mention it again on Furrygoat.com (maybe if we ignore it, it will just go away :))."
</blockquote></p></p><p>For all we know, Web 2.0 might turn out to be something that no one is going to care about. Not that it matters to me since I am pretty pleased with what I am seeing. Just that they hyperbole surrounding it makes it seem more phenomenal than it really is.</p>
Finally back!2005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/finally-back<p>After such a long hiatus, this web blog is finally back on the web. First some explanation for the absence. I was waiting for the excellent <a href="http://www.railsapphosting.com/">RailsAppHosting</a> to come up with some plan to replace their beta version. First it was going to be ready in September. Then they suddenly announced that they would be partnering with TextDrive - (<i>everyone's</i> favorite web host?) and that we can expect a release in early October. Then they said that it should be available before <a href="http://www.rubyconf.org">RubyConf</a>:
<blockquote>
"... and, when will we launch? We're (seriously) aiming for just before you need to catch your flight to RubyConf and, looking at our progress right now, we shouldn't have any trouble meeting that deadline."
</blockquote></p><p>Hmmm... that reply was dated September 29 and today is already October 21. Seems like a long time to wait. I am sure that they are doing all they can to hurry it up. I do wish that they would not make false predictions and then fail to meet them. And to placate myself, I keep telling myself that the end product will definitely justify the means they are doing it. But another part of me tells me that, it is time for them to do some early release to see how much their users would actually want those new features. I will be sure to check those features out once they become available.</p><p>So, in the end, I forgo the one-click installation of Typo and jumped ahead to set it up on <a href="http://railsplayground.com/">railsplayground.com</a> with a sandbox account. While they do not offer one-click Typo installation, they do offer q rather nifty control panel that enabled me to set this blog up within 5 minutes and then restore the backup I had took least than a minute. All this for $12 a year which is really decent. I have not had the need to contact their support staff for anything serious yet so I am not sure on their customer service. Though I did e-mail them once to delete my trial account so that I can upgrade to the sandbox account.</p><p>
Anyway, I am glad that I have a web blog to write things on again. Expect some posts to come.</p>
Artificial Intelligence Class2005-10-21T00:00:00+00:00http://vazexqi.github.com/2005/10/21/artificial-intelligence-class<p>
My professor showed some everyday instances that we take for granted and convincingly show why it is hard to get a machine to behave like a human being. Naturally, he showed some rather interesting optical illusions. Since they <i>are</i> optical illusions, is there any need to replicated this behavior in an intelligent and rational agent? After all, are they any benefits for <i>seeing</i> these illusions? Does seeing these illusions make humans more intelligent? Or does it suggest a deeper understanding of how the human mind really works? Well, before this gets too philosophical, it would be wise to get back to the point and show you some of the examples that I find interesting.</p><p>Because I am afraid that the links might actually go missing, I have uploaded the pictures to my flickr account and gave proper credits to the authors. Most of these are also available from the <a href="http://www.mindhacks.com/">Mind Hacks</a> book which I have been trying hopelessly to finish. Whenever possible, the images link back to the original image on their respective websites. If anyone feels that I have violated their copyright, I will gladly remove these pictures.
<ul><li><a href="http://www.faculty.ucr.edu/~rosenblu/VSinvertedspeech.html"><img src="http://www.faculty.ucr.edu/~rosenblu/MargThatcherillusAnim!.gif" alt="Watch the moving face!" /></a><br />
Why does it appear <i>correct</i> when viewed upside down but totally wrong when viewed the right side up?
</li><li><a href="http://web.mit.edu/persci/people/adelson/checkershadow_illusion.html"><img src="http://photos25.flickr.com/37524895_2a9c7f847d_m.jpg" width="240" height="187" alt="Adelson Checker Shadow Effect" /></a><br />
A and B have the same color and shade! Don't believe me? Click <a href="http://web.mit.edu/persci/people/adelson/images/checkershadow/checkershadow_double_med.jpg">here</a>. This is called the Adelson Checker Shadow Illusion.
</li><li><a href=http://www.michaelbach.de/ot/mot_rotsnake/ title="Photo Sharing"><img src="http://photos31.flickr.com/37524896_55efc2af56_m.jpg" width="240" height="180" alt="Rotating Snake" /></a><br />
You have to click on it to see the BIG version for the illusion to work.
</li></ul></p><p>
Another interesting thing I have learned are <a href="http://en.wikipedia.org/wiki/Garden_path_sentence">Garden Path Sentences</a>. Here are some of the more interesting ones that are hard to decipher.
<ul><li>Fat people eat accumulates.
<br /><i>The fat (animal fat, vegetable fat, etc) that people eat accumulates in their bodies.</i></li><li>The prime number few.
<br /><i>The prime (or the prime numbers e.g. 2, 3, 7, 11) amount to only a few.</i></li><li>
The player kicked the ball kicked the ball.
<br /><i>The player was given the ball by someone who kicked it to him. The player then kicked the ball back.</i></li></ul></p><p>
Well, that was an interesting first lecture for that class. Maybe there are more illusions worth sharing later as well.
</p>
You know that iTunes is ubiquitous when...2005-08-22T00:00:00+00:00http://vazexqi.github.com/2005/08/22/you-know-that-itunes-is-ubiquitous-when<p>every other corporation out there is using it to promote their stuff, including the <a href="http://www.1800goguard.com/music.html">National Guard</a>.
</p>
<p>Obviously, Napster is not doing that well (yet?)</p>
It's hard getting a cell phone...2005-08-22T00:00:00+00:00http://vazexqi.github.com/2005/08/22/its-hard-getting-a-cell-phone<p>
Attention: What you are about to read will probably not be of too much interest to you.
</p>
<p>
I said that I wanted to buy the <a href="http://www.nokiausa.com/phones/N90">Nokia N90</a>. But then up till today, it has still not made its debut. Then I decided on the <a href="http://www.nokiausa.com/phones/6670">Nokia 6670</a>, one of the better phones that are available from Nokia USA. After deciding on the phone, I needed to check with a carrier. My only choices were <a href="http://www.nokiausa.com/phones/6670">Cingular</a> and <a href="http://www.t-mobile.com/">T-Mobile</a> due to some special reasons. And none of these carriers have the Nokia 6670 on offer. The cheapest I could find was about $340 with shipping and handling.
</p>
<p>
Then comes how much I wanted to spend a month. According to my friends, Cingular provides better connectivity. However, I am confident that I can live with some connection inconveniences every now and then especially if it means that I could save about $20 a month. <a href="https://www.cingular.com/media/media_net">Cingular's</a> web browsing costs $19.99 a month for unlimited access whereas <a href="http://www.t-mobile.com/services/webandapps.asp">t-mobile's</a> cost $5.99 a month.
</p>
<p>
And it is really hard to find information about cell phones here. For instance, I stopped by at the mall to enquire about the <a href="http://direct.motorola.com/ENS/web_producthome.asp?Country=USA&language=ENS&productid=29302">Motorola Razr</a>. The sales person not only provided wrong information (I verified this by going to another T-Mobile kiosk nearby) but tried to seal the deal by lying that buying the phone from T-Mobile.com does not come with free shipping and that we would have to wait about 7 days! Actually, there is indeed free shipping for 3-5 day delivery.
</p>
<p>
Then there is the question of what phone to get. Some phones are available for ridiculously cheap prices whereas the better ones are also priced exorbitantly. There was a <a href="http://www.engadget.com/entry/2487373304194605/">Samsung D415</a> that retails for about $299.99 but is available for free from T-Mobile.com. However, after wasting 3 days researching the pros and cons of that phone, the deal ended and we were not able to get the phone for free anymore. In fact, T-Mobile discontinued that phone from its line. Well, damage was partially done. Why? After reading up on the Samsung D415, our hopes for our new phones were high. We wanted something that could browse the web using WAP, take some photos and also sync with the computer. What other phone fits that description? None other than the Motorola Razr.</p>
<p>So, now we decided on the Razr. Or did we? The Razr retails for $199.99 online. With that amount, you could also get the Treo 600 or the Blackberry 7100t. So technology lust tempts us again. With the Treo 600 you get a Palm OS powered phone so I could load all my previous Palm applications. And it syncs nicely with my computer.<i>Hmmm.... if a Palm is so great, then why is my Tungsten T sitting on my desk now and serving only as a $400 dollar alarm clock?</i> What about the Blackberry? Wow, a real web browser. And QWERTY keys. <i>I wonder if I will ever use all the features. To utilize all those features would require me to purchase additional services. Also, the Blackberry is bulky phone</i>. The debate goes on. Finally, I just had to convince myself: You are getting a phone to <b>call</b> people. Having a wap browser, a camera and other stuff is nice but remember that you are going to carry this piece of metal around with you everyday. So get something <i>really</i> light.</p>
<p>If you thin the ordeal is over, think again. Now, I have to spend time thinking whether the cell phone will sync nicely with my powerbook. Apple says so on its <a href="http://www.apple.com/macosx/features/isync/">iSync page</a> but someone on O'Reilly has a different <a href="http://www.oreillynet.com/pub/wlg/7594">experience</a>. Why is the ability to sync correctly really important? Besides the fact that it is <i>really</i> easier to enter your contacts info on your computer, I find it essential that my address book on my computer contains everything in case I lose my phone. Also, I have having duplicates of contacts. Changing the information in the phone would require that I perform the same changes on my computer. Oh, did I mention that iSync does not sync Adress Book Pictures and To-do lists with the Razr? I wonder how Windows users are faring.</p>
<p>And now I begin to wonder whether getting the Razr was such a good idea. It runs Motorola's own OS that had been reputed to be fairly clunky and retarded.<i>Would the Nokia Series 60 be a better choice?</i> The cycle continues.</p>
<p>
While I can easily determine what I need in a computer, finding the right cell phone has been really mind boggling.
</p>
<p>And we have not even bought the phone yet!</p>
<hr />
<p>Bought the phone in the end. Sales person gave us a nice deal: buy 2 get the third free. Also bought a leather pouch for it since sales person was offering it at a discounted price.</p>
<p>Impressively the phone works really well with my powerbook. There was no need to purchase or download any additional software. Syncing with Address Book and iCal went smoothly, though I wished that it would sync contact pictures as well. And it charges via the USB cable too. Windows does not support charging via USB unless you are able to find and download the latest drivers.</p>
<p>Windows user on the other hand had to get something called <a href="http://www.google.com/search?client=safari&rls=en&q=motorola+phonetools&ie=UTF-8&oe=UTF-8">Motorola Phonetools</a>. And the last time I heard, version 2 does not support the Razr yet.</p>
<p>T-Mobile Web was a nice addition to. Now, I can check my e-mail on the Razr and also visit some WML sites. Typing using iTap can be a pain sometimes but then it suffices for quick messages once in a while. Some might complain that T-Mobile crippled the phone by installing their own ROM onto the device but I am completely happy with this. It would be a pain to have to set up the phone myself to get it to work with my carrier.</p>
Ruby Symbols2005-08-20T00:00:00+00:00http://vazexqi.github.com/2005/08/20/ruby-symbols<p><a href="http://glu.ttono.us/">Gluttonous</a>:
<blockquote>
"So really, what is a symbol?
Simply, a symbol is something that you use to represent names and strings. What this boils down to is a way to efficiently have descriptive names while saving the space one would use to generate a string for each naming instance."
</blockquote></p>
<p>(Via <a href="http://redhanded.hobix.com/inspect/ifYouDonTGetSymbols.html">If You Don't Get Symbols</a>.)</p>
<p>This is a really informative post on Ruby and symbols. And there is enough of why's influence to make it an easy read. Bottom line, if you want to save some memory space use symbols especially as keys for hashes.</p>
VitalSource...hmmm2005-08-17T00:00:00+00:00http://vazexqi.github.com/2005/08/17/vitalsource-hmmm<p><a href="http://www.vitalsource.com/betterbooks/">VitalSource Technologies, Inc. - Download VitalSource Bookshelf</a>:
<blockquote>
<div align="center">
<a href="http://www.vitalsource.com/betterbooks/"><img src="http://www.vitalsource.com/betterbooks/images/top_image.jpg" alt="Buy your books like you buy music"/></a>
</div>
</blockquote></p>
<p><a href="http://www.macminute.com/2005/08/16/vitalsource/">VitalSource launches digital bookstore | MacMinute News</a>:
<blockquote>
"The Store offers more than 1,000 titles in the VitalBook digital format, starting from US$0.99 to 60 percent off list price of hardcopy versions. The growing inventory of VitalBooks includes classics such as Shakespeare, reference materials, and textbooks in subjects ranging from law to philosophy to medicine."
</blockquote></p>
<br />
<small>By the way, the last time I checked there was about 64 books available for purchase from the bookshelf. So maybe those 1 000 titles are distributed internally at educational institutions.</small>
<p>I think that VitalSource has a bright idea here. By making the books available in electronic format, they are able to bring the prices down. Also, it gives educators an easy channel to distribute their teaching and learning material--though I am still uncertain how easy it is to convert materials to the VitalSource format. Anyway, I am extremely glad that they did not promote their technology as pushing for the <i>digital revolution</i>. For a more thorough discussion of the mythical paperless society, please read Malcolm Gladwell's excellent <a href="http://www.gladwell.com/2002/2002_03_25_a_paper.htm">article</a> published in the <a href="http://www.newyorker.com/">New Yorker</a>.</p>
<p>However, VitalSource seems to be distributing their books in some in-house proprietary format. This might or might not have been avoidable given how easy it is to pirate e-books. So, VitalSource's decision is justified.</p>
<p>Nonetheless, using their own format instead of something more commonplace such as PDF severely limits what the readers can do with the book. So far, most of the books available only have lots and lots of text in them (no pictures) so this might not matter much. Nevertheless, I like to be able to annotate my e-books. And sometimes I do not wish to be limited to highlighting, even if it is with <i>different</i> colors. I need to be able to include links to pages, maybe even pictures. And I would like to share my annotations with other people. <a href="http://www.vitalsource.com/index/downloads">Vitalsource Bookshelf</a> does not seem to allow me to do those things. There might be good reasons for this since younger children are actually using the program, so there is no need to make things too complicated.</p>
<p>Also, other operating systems are not supported. I know that almost 90% of the computer users use Windows or Mac OS X. But most computer science geeks use Linux. And they do not fancy having to read their books in some beautiful GUI window. At most, they would settle for postscript or pdf but not some funky new format. This really hinders VitalSource from being adopted in most universities. Well, maybe VitalSource never intended for this service to be used everywhere. Anyway, VitalSource definitely does not appeal to everyone. Since they are giving the VitalSource Bookshelf application free, their sole revenue depends on the sales of books. So, either they have a large consumer market, or they are maybe going to roll out a more powerful version of their application that would enable readers to do more with their e-books.</p>
<p>Here are some comments on their tagline: "Buy your books like you buy your music". Buying books and listening to music are too different things. When I listen to music, I do not need to take annotations! When I read books which I deem important, annotations are a must. And I can bring my music with me, be it in a CD or iPod. With VitalSource, I need to have the VitalSource Bookshelf program. And unlike, PDF or Word documents, I cannot even put it into my <a href="http://www.palm.com/us/">Palm</a> or <a href="http://www.repligo.com/">cell phone</a>. Furthermore, there is still some solace in being able to curl up with a good book in bed. Sometimes, bringing my laptop to bed does not seems like such a good idea. So you would never buy books like you do music.</p>
<p>Also, by tying the book to one account, I <i>think</i> VitalSource limits you from sharing the book with your families. While I studied in my home country, I usually pass my books to my younger brother or cousins. Since textbooks really do not change that much, we managed to save a decent amount each year. Also, my brother would benefit from the notes that I took.</p>
<p>Installation of VitalSource Bookshelf was via a .mpkg file. As advised by <a href="http://pragmaticprogrammer.com/titles/rails/index.html">rixstep</a> there is seriously no need to distribute applications in this manner. Anyway, the installation created a bunch of folders at places that I really would not like to have them. For instance, it created the Books folder in /Users/Shared. I can understand the rational behind this since you need to be able to share books with different users, each user having a separate account on VitalSource, I assume (or maybe a main account for the entire class). It also created a Books folder in my home directory where it stores the notes that I have made. So <i>maybe</i> there is indeed a way to share notes with people. Bottom line, uninstalling this program is not going to be as simple as dragging the application to the trash. Maybe there is an uninstaller for the Windows version.</p>
<p>Even though the VitalSource Bookshelf for Mac OS X looks polished, its functionality is still too handicapped for most people. For the time being, all you can do with an e-book is to highlight the text in it, add notes to it, or search through it. Of course, you get to use the back and forward buttons to navigate too. You can drag and copy the images that are inside the e-book into another application. On Mac OS X, dragging the picture to the desktop identifies it as a Picture Clipping. Each book appears in a separate window. One good thing is that you can backup the notes that you have made. Backups are saved as .db files which in the sqlite2.1 format.</p>
<p>While this might not prevent piracy, what VitalSource can do is adopt what the <a href="http://pragmaticprogrammer.com/">Pragmatic Programmers LLC</a> does with its e-book: personalized it with your name. My <a href="http://pragmaticprogrammer.com/titles/ruby/index.html">PickAxe</a> and <a href="http://pragmaticprogrammer.com/titles/rails/index.html">Rails</a> book both have the line: Prepared Exclusively for..."your name here" as the footer.</p>
<p>By the way, the only reason I took interest in VitalSource was not because of their catchy tagline: "Buy your books like you buy your music" but because <a href="http://blog.x180.net/">James Duncan Davidson</a> helped develop the web backend for it using <a href="http://www.rubyonrails.org">Ruby on Rails</a>. And he did an impressive job on the website. Still, I think that VitalSource is indeed a good idea. And the fact the VitalSource has gotten Apple and IBM to participate does give it some realistic backing. It's just that I doubt that many publishers would want to use VitalSource to deliver their contents. I cannot imagine O'Reilly doing it.</p>
<p>Now, on to uninstalling it!</p>
What does this resemble?2005-08-16T00:00:00+00:00http://vazexqi.github.com/2005/08/16/what-does-this-resemble<p><div align="center"><img src="http://www.timesdispatch.com/servlet/Satellite?blobcol=urlmainpicture&blobheader=image/jpeg&blobkey=id&blobtable=MGImage&blobwhere=1031784468327&ssbinary=true" alt="Stampede?" /></div>
(Via <a href="http://www.timesdispatch.com/servlet/Satellite?pagename=RTD/MGArticle/RTD_BasicArticle&c=MGArticle&cid=1031784465530">TimeDispatch.com</a>.)
<br /><br />
If I were to just look at it, I would say a riot in some Third-World country. The only things missing are the law-enforcers.
</p><p>
Anyway get the true story <a href="http://www.wired.com/news/business/0,1367,68542,00.html?tw=rss.TOP">here</a></p>
RailsAppHosting deal2005-08-16T00:00:00+00:00http://vazexqi.github.com/2005/08/16/railsapphosting-forum-message-to-all-beta-testers<p><a href="http://forum.railsapphosting.com/topic/show/26">RailsAppHosting Forum - Message to all beta testers</a>:
<blockquote>
"Upon launching we will be offering a once-off 'lifetime hosting' deal for US$100. We will also be accepting two payments of US$50 over two months to make it even more affordable (yes, TextDrive gets the credit for this idea originally). This will allow us to raise some capital for infrastructure and it's a bit of a reward for our beta testers."
</blockquote><blockquote>
500MB disk space per application, 3GB bandwidth per app (the sum of all
traffic in plus all traffic out) per month. So between the three apps a
lifetime account will receive 1.5GB space, 9GB bandwidth per month.
</blockquote></p><p>
Sounds like a good deal to me so I am going to continue hosting this web blog on <a href="http://blog.railsapphosting.com/">railsappshosting.com</a>.
</p>
Excursion into Visual C#2005-08-16T00:00:00+00:00http://vazexqi.github.com/2005/08/16/excursion-into-visual-c<p><a href="http://www.brains-n-brawn.com/">Brains-n-brawn</a> pique me to take a closer look at what <a href="http://msdn.microsoft.com/vstudio/">Microsoft Visual Studio</a> and the <a href="http://msdn.microsoft.com/netframework/">.NET framework</a> has to offer. Brains-n-brawn is a spectacular site with lots of projects which the author has written herself. Because I was really impressed with what I saw, I downloaded Visual C# 2005 Express Edition today to play around with it. I have yet to find out whether this uses features of C# 2.0 as mentioned <a href="http://joe.truemesh.com/blog/000390.html">here</a>. As a college student, I have access to Visual Studio 2003 as part of the MSDN Academic Alliance Program but I am really interested to see how much better C# 2.0 is compared to its previous incarnations.</p><p>Well, Visual C# 2005 Express Edition (that is really a mouthful!) downloaded fine into my computer. Surprisingly the download was only about 50MB without the extra documentation but it required a whopping 800MB to install. And this includes only Visual C# Express Edition and the SQL Express Edition. I kind of expected Microsoft to try and bundle something along, and true enough, SQL Express Edition was part of the deal. Also, there was enough hints at ASP.NET and other Microsoft technologies that you could sense that Microsoft was trying really hard to tie you down to their technologies. There is hardly any mention of open source alternatives and how Visual C# interacts with them. Not that it was unexpected. Also, you could optionally not install SQL Express Edition but knowing Microsoft, some of the examples are bound to require it so might as well do it now. </p><p>I have <i>never</i> used Visual Studio before because it is <i>very</i> much oriented toward Windows development. So, I was pleasantly surprised with what it has to offer. As usual, there are some annoying feature that I would like to customize but do not know how yet. But there are good features as well. First, its speed. It performs as snappy as <a href="http://www.apple.com/macosx/features/xcode/">Xcode</a> does for code completion and indentation. It is definitely more snappy than the sluggish and memory hungry <a href="http://www.eclipse.org">Eclipse</a>. Also, their integrated help browser is really nice. </p><p>Anyway here is what I do not like so far. Of course, I am sure that there must be some way to alleviate these feelings of annoyance once I get used to the program.
<ul><li>Crashes when I did CTRL+S!
<br /> I must have done something else but as I tried to save my project, Windows core dumped on me and restarted the computer!</li><li>Misbehaving code completion.
<br /> For methods that do not expect any arguments, selecting the method from the list suggested should put <code>object1.method1()</code> but right now it puts <code>object1.method</code>. Therefore, I have to type the empty parentheses in myself!
</li></ul><div align="left"><a href="http://www.flickr.com/photos/vazexqi/34478939/" title="Photo Sharing"><img src="http://photos21.flickr.com/34478939_5c11188821.jpg" width="500" height="199" alt="Code Completion" /></a></div><ul><li>No smart typing feature.
<br /> I really like how Eclipse and TextMate auto inserts the closing " for strings.
</li><li> Tabs that do not have an 'x' to close them
<br /> Why have the close button at the far end of the tab row? Would it not be better to have individual 'x' to close the tabs? Kind of what Eclipse has.
</li><li>Counter-intuitive Windows Form "Designer (?)".
<br />The UI builder is still not as intuitive as <a href="http://developer.apple.com/tools/interfacebuilder.html">Apple's Interface Builder</a>. Maybe because it has a lot more windows widgets that need to be accommodated for. Its properties pane for each widget is really complicated though.</li><li>Code generator.
<br /> Some people like code generators. I don't really like them especially when they use weird names that I have to refactor personally. Why doesn't it just asks me for the name of the method in the first place?
</li></ul><div align="left"><a href="http://www.flickr.com/photos/vazexqi/34478940/" title="Photo Sharing"><img src="http://photos23.flickr.com/34478940_1aeaee717b.jpg" width="500" height="228" alt="Code Generator" /></a></div><ul><li>It tries to suck you into using more Microsoft technologies.</li></ul></p><p>And now what I like:
<ul><li>Informative code completion.
<br /> It actually shows you how many overloaded versions of the particular method there are.
</li></ul><div align="left"><a href="http://www.flickr.com/photos/vazexqi/34478943/" title="Photo Sharing"><img src="http://photos22.flickr.com/34478943_f9d15f138a.jpg" width="500" height="166" alt="Overloaded Methods" /></a></div><ul><li>Extensive help file.
<br />Its help file is really huge. And this is only for Visual C#! You seriously wonder how big the MSDN library really is.</li><li>Great resources.
<br />Microsoft would really like to get people to use its tools. Just look at the effort they spend trying to introduce people to these tools: <a href="http://lab.msdn.microsoft.com/express/webcasts/">Visual Studio Webcasts</a>, <a href="http://lab.msdn.microsoft.com/express/beginner/">Absolute Beginner videos</a> and if you register and activate your Express Edition product, you get free access to 3 online books on .NET and ASP.NET.</li><li>Really nice shortcut keys
<br />Want to indent code? Type CTRL+E and then D. Some people will probably hate this. But I like the fact that you don't have to perform finger circus tricks to hold down several keys at the same time.</li><li> C#
<br /> The only language that Microsoft created that I feel is worth learning. Visual Basic is kind of limiting. J# is bastardized Java, enough said.
</li><li>.NET
<br />Like it or not, .NET is going to become the next wave of Microsoft development. If I want to land a job, I better have some grasp of it.
</li></ul></p><p>So what have I done with it? Nothing much yet. Did a simple HelloWorld console program. And also a simple web browser following the instructions <a href="http://lab.msdn.microsoft.com/express/vcsharp/develop/debug/default.aspx">here</a>. While I still don't like the idea that it is so tightly integrated with Microsoft's other tools, I do feel that learning C# would be beneficial. And it would be nice to actually see what .NET is all about for myself.</p>
Ruby Feuds2005-08-14T00:00:00+00:00http://vazexqi.github.com/2005/08/14/ruby-feuds<p>I think it is fun to make fun of different technologies at times. For example, almost everyone likes to make fun of Microsoft. And Microsoft is smart enough about to keep their cool and maintain a good PR. However bad things happen when the loyal fans and zealots begin to take matters into their own hands. Rubyist are fun people. So they do what fun people do: poke fun at Java and Python. Obviously, people in the Java camp are a fun bunch too and can take some snide remarks now and then. However, things get really heated up when Ruby on Rails fans begin to take the 10x faster hype too literally and begin bashing the Java camp.
</p><p><a href="http://tech.rufy.com/entry/19">Lucas Carlson</a> has posted a relatively objective and unbiased discussion of why people use Ruby and why people use Java: it's all a matter of taste. Here are some of the heated online altercations that he has conveniently included in his article:
<ul><li><a href="http://www.lightbody.net/~plightbo/archives/000144.html">Hype: Ruby on Rails</a></li><li><a href="http://www.loudthinking.com/arc/000400.html">That Application is so Stupid</a></li><li><a href="http://rifers.org/blogs/gbevin/2005/3/18/blabla_tada_in_java">Bla-bla: Ta-da In Java (and Laszlo and RIFE)</a></li><li><a href="http://weblog.rubyonrails.com/archives/2005/03/19/bla-bla-list-cloning-a-rails-app-in-rife/">Bla-bla List: Cloning a Rails app in RIFE</a></li><li><a href="http://rifers.org/blogs/gbevin/2005/3/19/revisting_a_rails_app_in_rife">Re: Bla-bla List: Revisting a Rails app in RIFE</a></li>
<li><a href="http://www.theserverside.com/news/thread.tss?thread_id=32723">Move over Ruby on Rails, Java can be concise too!</a></li>
</ul>
Reading the articles above, you really wonder... how does this benefit anyone?
</p><p>
The way that some people are attacking <a href="http://blablalist.com/">Bla-bla list</a> was uncalled for. Then again, <a href="http://rifers.org/blogs/gbevin">Geert Bevin</a> should have just kept his cool and not insult <a href="http://www.tadalist.com/">Ta-da list</a> as a 600-line monstrosity that is stupid and useless. In the end, what we have now is a duplication of a very simple to-do list: one written with Ruby on Rails and the other with Java with RIFE. So what? Whose gain is it? Ta-da list was created in the first place to encourage users to use an online system to organize their stuff. And to <i>ensnare</i> them to use BackPack, a heavyweight version of Ta-da list. Bla-bla list was created for the sake of trying to demonstrate that Java is capable of creating a simple to-do list, the same concept that Geert was criticizing as stupid in the first place. No one ever doubted for a moment that Java could not do something like that. Heck, almost <i>everything</i> can be done with Java. Geert wanted to prove that he could do it in Java just as easily as David did it in Rails. So did he accomplish that? I think the result is a tie. Well, good news is that Bla-bla list is open source so people can take a look at it and see how it is implemented.
</p><p>
Incidentally, I took a look at <a href="http://www.openlaszlo.org/">openlaszlo</a> and thought that it was pretty neat. I did not like the part where it uses XML to design all the interface. But aesthetically, at least the code for it looks like XHTML. And the snazzy flash interface would definitely appeal to some people.
<p><a href="http://www.openlaszlo.org/faq/#q1">OpenLaszlo</a>:
<blockquote>
"OpenLaszlo is an open-source platform for the development and delivery of rich Internet applications on the World Wide Web"
</blockquote></p>
Downloading and setting up openlaszlo was a snap on Windows. And the examples included did a good job at showing off what it could do. The next time I want to do some fancy eye candy, openlaszlo would be on my list of tools to use.
</p><p>In spite of all the hate generated, I am glad that <a href="http://whytheluckystiff.net/">why the lucky stiff</a> has this to say:
<blockquote>
Once I dreamt I had a robot who was made out of watermelons. He had as skin that green rind that's both dark green and light green. And he didn't care if I helped myself to his abdomen.
<br /><br />
He just said, "No, I don't mind. Please."
<br /><br />
He had a job helping cars figure out where to go. I got him his own cat.
<br /><br />
The worst part was when I woke up and realized all the web framework flame wars going on. Man, what a headache.
</blockquote></p><small><p>
[1] For an example of a good nature fun and hilarious poke at Python, look no further than <a href="http://www.whytheluckystiff.net/starry/btdownload.php?type=torrent&file=The+Least+Surprised+-+The+Red+Scared.mov.torrent">The Least Surprised - The Red Scared.mov</a> (torrent file) by <a href="http://www.whytheluckystiff.net/starry/">why the lucky stiff</a>.
</p><p>
[2] For a short discussion by Jason from <a href="http://www.37signals.com">37signals.com</a> on why hype might be needed sometimes to promote a new technology, please read his comment on <a href="http://9rules.com/whitespace/37signals_part_3_and_my_coffin_is_being_prepared.php">Paul Scrivens' blog</a></p></small>
Google Print vs. Publishers2005-08-14T00:00:00+00:00http://vazexqi.github.com/2005/08/14/google-print-vs-publishers<p><a href="http://radar.oreilly.com/archives/2005/08/google_library.html">O'Reilly Radar > Google Library vs. Publishers</a>:
<blockquote>"Google isn't 'borrowing' the books from libraries. They are partnering with libraries to do something that is very much in line with the mission of libraries, which is to store and share human knowledge. "
</blockquote>
</p>
<p><a href="http://googleblog.blogspot.com/">Google Blog</a>:
<blockquote>"In October 2004 we announced a program called Google Print, a way for publishers to make their books discoverable by the millions of people who search on Google every day. Shortly thereafter, we added a complementary program to help find all books more easily by partnering with libraries to index their collections too. The goal of Google Print is ambitious: to make the full text of all the world's books searchable by anyone. These books are hard to find now, and for most of them, no full-text search exists. We think that making books easier to find will have a positive impact on the world, and we welcome the challenge."
</blockquote></p>
<p>I mentioned <a href="articles/2005/07/25/holy-shit-google-print">Google Print</a> in one of my earlier posts. Who would have known that a few weeks later instead of applauding Google for undertaking this selfless endeavor, the debate on whether Google's pet project is infringing copyright laws becomes the focus of this project. There are various responses on this but the most compelling, technically-inclined discussion is none other than the one on <a href="http://radar.oreilly.com">O'Reilly Radar</a>.
</p>
<p>What I really like about Google Print is the fact that you can search through books without going to the library first. Sometimes the books I want are not available at my library and it has to be requested from another library. Before doing so, I would really like to know whether the book that I want is really that good or not. One way to do so would be to search for reviews on <a href="http://www.amazon.com">Amazon</a>. However, as with all reviews, there are subjected to bias. Also, sometimes I would like to form my own opinion of the book. By just letting me see parts of the book, I could actually get a better idea of what it is worth. In fact, Amazon has something that lets publisher let you see parts of the book. Amazon did not suffer any copyright infringement because they only offer parts of the book: the table of contents, the introduction and maybe the index. Google Print, on the other hand, practically has the entire book scanned in. This, I think, is what confuses the publishers and authors. It is quite impossible to read an entire book let alone an entire chapter from Google Print. Try it. In fact, some of the pages are even blanked out if the publisher requests it. Just because the entire book is online does not mean that web users can access the entire thing.</p>
<p>Also, another potential benefit of Google Print is to let people check for plagiarism. For instance, imagine that you are reading someone's paper and come across a phrase that you are familiar with but not enough to put a finger on where you read it before. Enter the phrase in Google Print and see whether anything shows up. I think that most professors and teachers might find this useful while grading papers.</p>
<p>Here is a quick list of things that I think people can do with Google Print:
<ul>
<li>Research: get the topics you need quickly without wasting time going through useless books. Of course, you could also rely on <a href="http://scholar.google.com/">Google Scholar</a>.</li>
<li>Fun: quickly find new books that reference things that you are interested in. Much more reliable than just relying on the keywords that the publisher provides.</li>
<li>Preservation: Good books deserve to be eternalized in electronic form for the future generations to enjoy.</li>
<li>Google!: Yup, search the books like you would any other document out there. Google search literally changed the way people find discover things on the net. So much so, that the word google has become a verb in most conversations. Google Print does so much more than what a library catalog can do.</li>
</ul>
</p>
<p>As always there are also <i>real</i> reasons why Google Print is not such a good idea. Most of the reasons I include here are paraphrased from <a href="http://www.inklingbooks.com/">Mike Perry</a>. Perry argues that different copyright laws apply in different countries. By having Google Print, it undermines the efforts of protecting copyright laws that apply to different countries. Well, personally, I think the web is generous enough that people can actually procure a copy of the book with or without international copyright issues. Furthermore, Perry argues that it is for the authors and publishers themselves to determine if they want their book to be scanned and put online. It is not for Google to decide. Google cannot just walk into some library and start scanning any book that they want. Basically, Perry is saying that Google should be more conservative and only include books that publishers have authorized and not the other way round where they force the publisher to deauthorize which books cannot be scanned.</p>
<p>Right now there are two different policies for Google Print: the <a href="http://print.google.com/googleprint/publisher.html">Publisher Program</a> and the <a href="http://print.google.com/googleprint/library.html"> Library Project</a>. The Library Project is where Google goes to libraries at Univeristy of Michigan, Stanford, Harvard, NYPL and Oxford and scan the books that are already in the library. This includes both books that are already in the public domain and also those that <b>are still under copyright</b>. For books that are still under copyright, Google Print limits the actual amount that is displayed. The Publisher Program allows publisher to include books that have not made it those libraries yet to be scanned by Google. This option also allows publishers to specify which books they want to scan and which should be left out..</p>
<p>Personally, I think most publishers have much more to gain by letting Google Print scan their books in. True, they might feel apprehensive about letting some company scan their entire works and provide it <i>free</i> through the web. But, if the book is good in the first place, doing so would only introduce a larger audience to it. Of course, if the book sucks then you might lose some sales. But then again, bad books always have other ways of making their sales. For instance, by enticing professors to use them as <a href="/articles/2005/01/18/why-books-that-have-websites-are-always-better-books">textbooks</a>!</p>
Clever Pen Tricks2005-08-13T00:00:00+00:00http://vazexqi.github.com/2005/08/13/clever-pen-tricks<p><a href="http://www.pentrix.com/pentix/tricks/index.html">Pentix - Tricks</a>: "Here, you will find all the secrets to the tricks that pen spinners are so proud of."</p>
<p>(Via <a href="http://www.lifehacker.com/software/entertainment/how-to-do-pen-tricks-116802.php">LifeHacker: How to do Pen Tricks</a>.)</p>
<p>
Following the list at LifeHacker, I have mastered 5 of the 6 that are advertised. I did not know that they even have names for such tricks. I learned my first trick when I was 14. Someone in school taught the <a href="http://www.pentrix.com/pentix/tricks/360ThumbNormal.html">360 normal</a> to me. After I had mastered that, I learned the the <a href="http://www.pentrix.com/pentix/tricks/Charge23Normal.html">Charge Normal</a>, <a href="http://www.pentrix.com/pentix/tricks/Sonic123Normal.html">Sonic Normal</a>, <a href="http://www.pentrix.com/pentix/tricks/360ThumbReverse.html">360 Degree Reverse</a> and the <a href="http://www.pentrix.com/pentix/tricks/Sonic123Reverse.html">Sonic Reversal</a>. And then today I stumble across the <a href="http://www.pentrix.com/pentix/tricks/IndexSpinNormal.html">Index Spin</a>. I spent a few minutes trying it out and it seems pretty doable for me. So I hope to master it by tomorrow. It gets easier as you master more tricks. </p>
<p>
I am right handed, but the surprising thing is that I am able to reproduce the same tricks (albeit not as beautifully executed) on my left hand without any training at all! This seems really weird but maybe after you teach yourself how to do it, your left hand just imitates it. Seems to be that way for other games that I have tried: badminton and table tennis.
</p>
<p>
Anyway, just nice to see that someone has actually put up a website to teach people pen tricks. Unfortunately, I was not able to play the videos on my powerbook. I wonder if anyone can actually pick these tricks up by reading. Seems a lot easier when someone just shows you how and you figure out what to do yourself. Some of the instructions are very lengthy and too mechanical. Most of the time, just by practicing, your fingers can figure things out.
</p>
Pictures are now served from flickr.com2005-08-12T00:00:00+00:00http://vazexqi.github.com/2005/08/12/pictures-are-now-served-from-flickr-com<p>
The missing pictures have now been restored. For those that I am not able to recreate, I have tried my best to procure some alternative sources and credit them for the pictures.
</p><p>
I think that <i>outsourcing</i> my images to <a href="http://www.flickr.com">flickr</a> is a good idea. That way I would not have to worry about editing the links everytime I move to different web hosts or a different web blog system. Also, it seems more organized. Anyone who wishes to just have a preview of my images can use flickr's photostream function. If only I had thought of this before I erased all my pictures!
</p><p>For convenience, here are the articles that changed:
<ul><li><a href="/articles/2005/02/25/ece390-snake-game">ECE390: Snake Game</a></li><li><a href="/articles/2005/04/09/massive-portfolio-project">Massive portfolio project</a></li><li><a href="/articles/2005/03/18/my-java-version-of-pixelnhance">My Java version of PixelNHance</a></li><li><a href="articles/2005/03/04/chambana-roids">Chambana-Roids</a></li><li><a href="/articles/2005/04/09/3d-viewing-program">3D Viewing Program</a></li><li><a href="/articles/2005/04/18/42things">42things</a></li></ul></p><p>While regenerating some of the pictures for my Java projects, I notice some problems:
<ul><li>The Java file chooser does not detect files on external hdds.</li><li>The windows do not position themselves relative to an external monitor.</li></ul></p><p>
There are bound to be other broken links especially for articles that cross reference one another. When that happens, the easiest way is to search for that article using the search function at the top right hand corner. Since it is <i>live</i> searching, you do not even need to wait for the page to refresh. All thanks to Ajax!</p>
Interesting site: Lisperati2005-08-12T00:00:00+00:00http://vazexqi.github.com/2005/08/12/interesting-site-lisperati<p>
Finally finished going through the <a href="http://www.lisperati.com/casting.html">Casting SPELs in Lisp</a> tutorial. Really interesting to find something along the lines of <a href="http://poignantguide.net/ruby/print.html">why's poignant guide to ruby</a> complete with its own illustrations and metaprogramming (macros in Lisp). It is also similar to what <a href="http://www.amazon.com/exec/obidos/tg/detail/-/1592000738/ref=pd_sbs_b_1/102-9302624-8528131?%5Fencoding=UTF8&v=glance">Python Programming for the Absolute Beginner</a> does for Python.
</p>
<p>
Another next thing about this tutorial is the use of <a href="http://www.franz.com/">Allegro Common Lisp</a> via <a href="telnet://prompt.franz.com">telnet</a>. This would make it really convenient for people who do not wish to install Lisp on their machines.
</p>
<p>
It gives a nice introduction to what you can do in Lisp. However, I am not sure if someone who does not know Lisp (or any other functional language) can appreciate this tutorial. The author, Conrad Barski, seems to skim over some thing that I view as important. For instance while using <code>mapcar</code> he explains it tersely as:
<blockquote>
"mapcar simply applies another function to every object in the list..."
</blockquote>
Most programming languages do not provide the luxury of using something similar to <code>mapchar</code> as an underlying characteristic of the language. You could hack it in but most people would not do it this way since the language itself does not expose this functionality.
</p>
<p>
Conrad's explanation of macros is a bit short too. A bit too short for people to actually grasp the power of it. He also makes <code>defspel</code> as an <i>alias</i> to <code>defmacro</code> because he believes that most people who think they know macros are being delusional about it. Or as he says it:
<blockquote>
"Often, when I try to explain the concept of macros to somebody who has only used other languages, I'll get a response like "Oh yeah! There's macros like that in C++, too!". The moment this happens, it becomes very difficult to explain "true macros", because of the semantic load on the word "macro". After all, "true macros" really are a lot like C++ macros, in that they are a way to talk to the compiler with modified code..."
</blockquote>
</p>
<p>
I have not been using Lisp long enough to decide whether the liberal use of list (this sounds a bit ironic since Lisp is all about <i>lists!</i>) to store information is a good idea. For this simple example it seems decent enough since you can easily remember that the second list in the <code>location</code> list tells you where to go next. If we were to do this in Java, using arrays to store such things could easily put you as having <i>Primitive Obsession - not using objects for "little" things</i> as coined by Martin Fowler in <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0201485672/102-9302624-8528131?v=glance">Refactoring</a>.
</p>
<p>
Anyway, this short tutorial did expose me to some Lisp concepts which I have not encountered in the Little Lisper (one of the best books possible on Lisp, I think). And it was rather fun to see how one would use Lisp to create a text based game.
</p>
Audion2005-08-12T00:00:00+00:00http://vazexqi.github.com/2005/08/12/audion<p>
<a href="http://www.flickr.com/photos/37092324@N00/33493062/" title="Audion on flickr"><img src="http://photos21.flickr.com/33493062_c2479b6c7c.jpg" width="500" height="405" alt="audion" /></a>
<br />
This was one of my Java projects that I created last semester for the Programming Studios class. This is not really one that I was very proud of because it has some bugs that I could not fix. Mostly because we were using the <a href="http://www.javazoom.net/javalayer/javalayer.html">JLayer</a> libraries and the documentation is not really accurate. The bug was that it was not possible to asynchronously fast-forward, rewind or switch to the next song. Also, the library itself is not multi-threaded so I had to create a separte thread to enable GUI interactions.
</p>
<p>
To compensate for those shortcomings, I implemented an ID3-v1 editor. Also, I made it read and create .m3u play lists. Something which I was particularly happy with is the ability to select the genre via a combo box in the table. That required some time to figure out.
</p>
<p>
Also, this post was made from within flickr itself,so it serves as a test post to see how good flickr's <i>blog this photo</i> service is. And as of this moment, it has failed miserably. So here I am back in <a href="http://ranchero.com/marsedit/">Marsedit</a> editing this.
</p>
Video tutorials: New Way of Learning Programming Languages and Frameworks?2005-08-11T00:00:00+00:00http://vazexqi.github.com/2005/08/11/video-tutorials-new-way-of-learning-programming-languages-and-frameworks<p>
My first encounter with video tutorials was actually with the <i>original</i> <a href="http://rubyonrails.cachefly.net/rails_setup.mov">Ruby on Rails movie</a>. This version did not have sound at all. Instead, whatever important things that needed to be said was done by typing text into the terminal for the viewers to read. For me, this sort of increased its geekiness level. True, sites such as <a href="http://lynda.com/">Lynda.com</a> have been offering video tutorials for many years now. However, (let me rephrase that) my <i>first</i> encounter with <i>free, open-source</i> technology was with Ruby on Rails.
</p><p>
Since then, many have jumped on the bandwagon. Personally, this seems to be a good move. The simplest common sense reason being that you can explain so much more using pictures and videos. It's actually quite hard to understand the common nomenclature that a group of developer uses while dealing with their framework. Secondly, (also another common sense reason), videos can create an great first impression. <a href="http://www.joelonsoftware.com/index.html">Joel Spolsky</a> says in his book <a href="http://www.amazon.com/exec/obidos/asin/1590593898/mockerybird/ref%3Dnosim/102-9302624-8528131">Joel on Software</a> that even if you have the world's greatest program, you will lose to the other competitor if you do not have enough screenshots. Yup, screenshots are that important.
</p><p>
Some of you might snigger now and think that people who fall for screenshots are nothing more than gullible people who eat hype and drink the kool-aid. Not true. In a field where there are so many competitors, gaining a lasting first impression is really important. And, not every technology out there can do it. I doubt that you could create a Java powered blog within 10 minutes! So, as you can tell, the length of the presentation also plays an important role in determining how popular it will be. Make it too long and people actually lose interest in it all together. Too short, and you leave your viewers wondering <i>is that it?</i></p><p>
I guess video tutorials are not limited to teaching people about programming languages and frameworks. Some companies are also using them to teach their users how to use the new technologies. Now, this is an excellent thing because it really shows that you want your users to use those tools. <a href="http://www.37signals.com">37signals</a> uses videos for all their web applications.
</p><p>
If you are looking for tools to make video tutorials, here are some:
<ul><li><a href="http://www.ambrosiasw.com/utilities/snapzprox/">Snapz Pro X (Mac OS X)</a></li><li><a href="http://www.techsmith.com/">Camtasia (Windows)</a></li><li><a href="http://www.unixuser.org/~euske/vnc2swf/">Vnc2swf (*nix)</a></li></ul></p><p>
So, what video tutorials out there are worth watching? Here is my list:
<ul><li><a href="http://www.rubyonrails.org/media/videos/rails_take2_with_sound.mov">ROR: Movie (with sound)</a></li><li><a href="http://media.everamber.com/updated_rails_tutorial.mov">ROR: Movie</a></li><li><a href="http://rubyonrails.org/media/video/clips/components.mov">ROR: Using components</a></li><li><a href="http://www.rubyonrails.com/media/video/rails-ajax.mov">ROR: Using Ajax</a></li><li><a href="http://common-lisp.net/movies/slime.torrent">Lisp: Slime</a></li><li><a href="http://common-lisp.net/project/ucw/docs/hello-world.torrent">Lisp: Uncommon Web</a></li></ul>
I just found several of them today about Lisp so I have yet to watch those.
</p><p>
Also, if you are looking for some <i>free</i> videos, this Del.icio.us <a href="http://del.icio.us/rss/tag/system:media:video">feed</a> has them. Thanks to <a href="http://www.lifehacker.com/software/entertainment/how-to-find-and-add-media-to-your-itunes-library-with-delicious-110812.php">LifeHacker</a> for the tip.
</p>
Moved the blog to railsapphosting.com2005-08-11T00:00:00+00:00http://vazexqi.github.com/2005/08/11/moved-the-blog-to-railsapphosting-com<p>
Finally, the toll of trying to get Apache and FastCGI to work nicely on Windows has worn me down. So, the best move was to head over to Typo's <a href="http://typo.leetsoft.com/trac/wiki/TypoHosting">list of recommended web hosts</a>. <a href="http://www.dreamhost.com/">Dreamhost</a> and <a href="http://www.steelpixel.com/">SteelPixel</a> caught my eye but then I decided to opt for RailsAppHosting because they focus entirely on Ruby on Rails which is basically what I need. Also, they are having some beta testing session now so there is no fee. Well, so far I like what I see. Setting up Typo was not too bad. I did run into some problems though (discussed below).
</p><p>
First was that it was a bit inconvenient to not know the host to connect to for mysql. It was not spelled out explicitly under the <i>Manage MySQL Databases...</i> menu on the left of the control panel page. Anyway, the <a href="http://forum.railsapphosting.com/topic/show/3#3">forums</a> and the <a href="http://blog.railsapphosting.com/articles/2005/08/07/first-movie-available">video</a> provided part of the answer. What they did not mention was that the password for the MySQL database is randomly generated! Fortunately, I inspected /config/database.yml and found that out. Then it was a simple matter of click, click in CocoaMySQL to import my existing database.
</p><p>
But wait! It was not that simple. Somehow, by sheer change I detected this almost imperceptible change. The <code>schema_info</code> table has the field <code>version</code> and in the one-click typo set up, it defaults to 7. However, my older .sql file had the value 9! How the 9 got in there beats me since everything else seems the same. But if you leave the 9 there, Typo balks when you visit the admin interface and chokes on updating the database. So, I did the easy thing, switch the value back to 7. And delete /public/index.html. Also, restart the application.
</p><p>
I cannot wait for the DNS name to resolve itself so that I can just use vazexqi.railsapphosting.com. Anyway, railsapphosting is pretty reliable so far. There may not be many members, but the support team does respond promptly. And they made it easy to set up many Ruby on Rails application. This gives me an opportunity to play with these web applications without trying to figure out how to set them up nicely on Windows. I wonder how much the fee would be. So far, this post on the forum has hinted on a <a href="http://forum.railsapphosting.com/topic/show/17">lifetime membership</a>. The proposed $20 a month for a two application account seems to be a bit pricey especially since Dreamhost and SteelPixel are offering monthly accounts for much less. I will have to wait and see whether the ease and convenience of RailsAppHosting outweights their price. The most I would pay is $10 a month. Period. <i>Unless there is a new offer which I cannot resist :)</i>
</p>
It was bound to happen2005-08-11T00:00:00+00:00http://vazexqi.github.com/2005/08/11/it-was-bound-to-happen<p><a href="http://www.hardmac.com/niouzcontenu.php?date=2005-08-10">Hardmac.com : Le "Macbidouille" in English</a>: "The Apple Developer kit version of MacOSX x86 has indeed been fully cracked!"</p>
<p>(Via <a href="http://www.makezine.com/blog/archive/2005/08/how_to_mac_os_x.html?CMP=OTC-0D6B48984890">HOW TO - Mac OS X Running on Non-Apple Hardware</a>.)</p>
<p>
No big deal. After all it is only the developer version. It would be interesting to see how Apple is going to prevent people from cracking OS X 10.5 Leopard though. It would be a real pain to see OS X running on a Dell.
</p>
80/20 rule - What I never knew2005-08-11T00:00:00+00:00http://vazexqi.github.com/2005/08/11/80-20-rule-what-i-never-knew<p><a href="http://en.wikipedia.org/wiki/Pareto_principle">Pareto principle - Wikipedia, the free encyclopedia</a>: "Pareto principle"</p>
<p>(Via <a href="http://www.lifehacker.com/software/productivity/how-to-work-less-and-succeed-more-116317.php">How To Work Less And Succeed More</a>.)</p>
<p>
Some things that I found interesting:
<ul>
<li>It's known as the <a href="http://en.wikipedia.org/wiki/Vilfredo_Pareto">Pareto</a> Principle!</li>
<li>But, it was first proposed by Joseph M. Juran, so it should be called Juran's Assumption!</li>
<li>It is a cause and effect statement; so using it like such: "20% of individuals in an organization perform 80% of the work" is not a valid statement since it is not known that the individuals <i>contribute</i>to the progress of work.</li>
</ul>
</p>
Site updates!2005-08-10T00:00:00+00:00http://vazexqi.github.com/2005/08/10/site-updates<p>
Typo 2.5.3 was released and it has a much more comprehensive .htaccess file compared to the one that I was using previously. Actually, the one I was using was copied over from Typo 2.0.6
</p>
<p>
Anyway, the problem with my web server is now because of the static pages that Typo uses. Apache does not like serving those. Goodness knows why though, it would just report the infamous <b><pre>posix error: connection reset by peer</pre></b> that I have been seeing the past couple of days. The easiest solution would be to have Typo not create any static pages; that is not to have it cache anything. However, I have not figured how to do that yet.
</p>
<p>
Also, I added new Ruby category for this web blog.
</p>
<p>
Update: Actually after constructing this entry, I tweaked the .htaccess file and commented out the following line:
<pre>
# RewriteRule ^$ index.html [QSA]
</pre>
That prevents it from caching the index.html file so that it will always serve it. At least in this case, most users will not get a half loaded page since it is always regenerated. Of course, you lose some speed on this. But that is always more welcomed than a half loaded page. It seems that I could turn of caching for all files by tweaking with the .htaccess file but I will leave things as they are now. Future Typo releases might have a setting to toggle caching.
</p>
Kathy Sierra on 37Signals and OSCON2005-08-10T00:00:00+00:00http://vazexqi.github.com/2005/08/10/kathy-sierra-on-37signals-and-oscon<p><a href="http://headrush.typepad.com/creating_passionate_users/2005/08/37_signals_pass.html">Creating Passionate Users</a>: "37 Signals Passion Review:
9 out of 10 hearts for the <a href="http://www.37sginals.com">37 Signals</a> folks--as perfect a passionate user rating as I'll probably ever give."</p><p>
By the way, in case you did not know, Kathy Sierra is part of the Head First group at O'Reilly. While I am sure all the Head First books are great, the only one that I have read is <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0596007124/103-1235539-5189438?v=glance">Head First Design Patterns</a>. And, yeah, it is really that good. Not dull and boring like other books that I have to put up with.
</p><p>
I cannot help but agree with Kathy on the importance of passion. With passion, even the impossible seems surmountable. While doing my projects, I find using great software makes the task that much more interesting. And the task seems extremely boring when the textbook itself serves nothing more than being an bulky and expensive paper weight. So, the question that every software company asks is how to make users passionate about your technology. Not many company can do this. Apple is one of the few.
</p><p>
Please head on over to Kathy's <a href="http://headrush.typepad.com/creating_passionate_users/2005/08/37_signals_pass.html">page</a> and read about her review of 37signals.
</p><p>
The other posts that Kathy makes is about Ruby. Yup, Ruby is a <i>poignant</i> language in the words of <a href="http://whytheluckystiff.net/">why the lucky stiff</a>. And the massive growth of Ruby is attributed to the passion that its users have. Passionate enough that they want to wear <a href="http://www.cafepress.com/rubyhappy">t-shirts</a> with Ruby code on them.
</p><p>
I think creating passion is something that is not going to be attainable using common marketing tricks. The developers need to have a burning desire to contribute to their customers' needs and adapt to their needs. No point in making the world's best satellite if not one is passionate enough about it.
</p><p>
Also, I am glad that Kathy has caught the Ruby passion from <a href="http://www.loudthinking.com">David Heinemeier Hansson</a>. Maybe it is the beginning of a new Head First book.
</p>
<p>
Update: Obviously, there is a fine line between passion and being over-zealous. Paul Scriven in his 37signals: <a href="http://9rules.com/whitespace/37signals_part_3_and_my_coffin_is_being_prepared.php"><i>Part 3 and my coffin is being prepared</i></a> entry says that 37Signals have certainly generated a lot of passion from their users. But their latest endeavors have also generated lots more hype than they can handle. Words such as "Getting Real", "Your life", etc are being littered across their product lines. Well, there is always that stage between being a small company and expanding into a bigger one. Maybe 37signals is in that stage of growth and have to try to readjust their priorities and philosophy. Read Paul Scriven's entry. It has some insightful things on what 37signals is up to.
</p>
How to read blogs!2005-08-10T00:00:00+00:00http://vazexqi.github.com/2005/08/10/how-to-read-blogs<p>
<a href="http://www.sauria.com/blog/2005/07/28#1355">Ted Leung</a> has some quick advice on how to read blogs. This comes in handy for people like me who read about <i>600</i> new entries each day. Some of those entries are really short, such as the ones of the <a href="http://www.dashboardwidgets.com/showcase">DashboardWidgets Showcase</a> feed. While, others tend to be long and well worth the time reading.
</p>
<p>
While, you should really read Ted's entry on this, here are a few of my favorite tips. Also, I am glad that he uses <a href="http://ranchero.com/netnewswire/">NetNewsWire</a>.
<ul>
<li>Use the "mark all as read" feature.
<br/>
Sometimes it is easier to just skim through the titles and see what you need to read and what you do not need to. Always trust your instincts. If the entry is really important, other people will probably mention them in their blogs too.</li>
<li>Make use of Del.icio.us, Technorati to find those interesting sites
<br/>
The web is vast. So let other people help you find interesting stuff. In fact, try using <a href="http://opencontent.org/oishii/">Oishii</a> which only lists the most popular entries. Even better, try subscribing to specific feed from Del.icio.us for instance the feeds tagged with ruby, os x, etc. That way you have less to wade through.</li>
<li>Spend time reading thoroughly!
<br/>
Bloggers spend time writing. Read and appreciate what they wrote.</li>
<li>When unsure, use Safari's RSS feature (this is my own idea)
<br/>
Safari RSS is great for testing out new feeds to see if they are going to be worth reading. By putting these feeds on the menu bar, you can quickly see if they are updated regularly. Also, giving them their own toolbar space helps you quickly identify them from the rest of your regular blogs. Once you are convinced that the blog is worth following, chuck it into NetNewsWire.
</li>
<li>
Find out what other people are reading! (also one of my own)
<br/>
Popular blogs attract more people.
</li>
</ul>
</p>
Some slight bashing on Microsoft's smaller Mac products2005-08-09T00:00:00+00:00http://vazexqi.github.com/2005/08/09/some-slight-bashing-on-microsofts-small-mac-products<p>
First of all, this is not going to be a <i>fierce</i> criticism of Microsoft's products. I am sure their products are useful and I use two of them frequently on my Powerbook: <a href="http://www.microsoft.com/mac/otherproducts/otherproducts.aspx?pid=remotedesktopclient">Remote Desktop Connection</a> and <a href="http://www.microsoft.com/mac/products/office2004/office2004.aspx?pid=office2004">Microsoft Office</a>.
</p><p>
Nonetheless, some of their products have really ugly user interfaces. For a while back, it was their latest <a href="http://www.microsoft.com/mac/otherproducts/otherproducts.aspx?pid=windowsmedia">Windows Media Player for Mac</a>. I found the brushed metal theme to be extremely revolting. Windows Media Player for Windows XP looks much better. And the "but Windows XP has a different GUI system" excuse is not going to work. Developers <i>need</i> to realize that brushed metal is a very <b>dangerous</b> theme. You should only, ever use it if your user interface is going to be very simple. And your toolbar icons will have very very simple colors. Not those gaudy icons! For examples of brushed metal windows that does it quite right: Safari, Finder, iTunes, DVD player, Quicktime. Notice how the icons on the toolbars are simple black and white ones? These programs let you focus on the main contents of the window whereas other programs out there use the brushed metal theme and then to take your focus <i>off</i> the main contents. <i>Really, really</i> bad experience. I am glad they did not try to use it on their Office suit for Mac; then it would really feel <i>solid</i>, yup, solid enough to crash and sink.
</p><p>
Then now, it is their updated <a href="http://www.microsoft.com/mac/default.aspx?pid=msnmessenger">Microsoft Messenger for Mac</a>. I am being a little biased here since I did not download it or tried it. But, from first impressions, this is not going to be something that I will use. Sure, most new people would use it but then again, most college kids have AIM accounts. So, I am really not sure who uses the MSN protocol. I know that it was pretty popular in my home country because you get an account every time you sign up with <a href="http://www.hotmail.com">hotmail</a>.
</p>
<p>
Hmmm.. it <i>seems</i> to support other network protocols. I use the word "seems" because it mentions something called Live Communications Server. Wonder what that is.
If I try it, I will update this entry.
</p>
<p><a href="http://www.microsoft.com/mac/products/office2004/using.aspx?pid=usingoffice2004&type=howto&article=/mac/LIBRARY/how_to_articles/office2004/of_messenger.xml">Top 10 questions about Microsoft Messenger for Mac</a>: "If you are a member of an organization that uses Live Communications Server and the organization has enabled this feature, you can chat with people who use a variety of instant messaging services. For example, you can chat with friends who use AOL Instant Messenger (AIM),Yahoo Instant Messenger (YIM),and iChat, as well as those who use Messenger"</p>
Some Ruby programming2005-08-09T00:00:00+00:00http://vazexqi.github.com/2005/08/09/some-ruby-programming<p>
Below is one of my <i>bigger</i> ruby projects that I did for fun. The other projects that I have done mostly involves Ruby on Rails. And so far the biggest and most formidable project is getting Typo to work properly with Apache and FastCGI.
</p><p>
This problem was proposed on <a href="http://www.rubygarden.org/ruby?StarterProblems">RubyGarden's StarterProblems page</a>. Since I had nothing much to do tonight, I decided to try it out. I have a vague idea on how to solve the problem after reading it. It involves using some form of depth-first or breadth-first search since you are trying to find a path. Because the problem only requires one solution, and not all the possible paths, the answer is much simpler.
</p><p>
So, the first thing I did was run through Irb to figure out what methods were available for Strings and Arrays. My original plan was to treat the maze as a String but be able to access each character as though they are part of an Array. Runnning Ri and Irb over and over was getting a bit tiring. Fortunately, I realized that I have a copy of the PickAxe book with me. The documentation for the standard Ruby library is fantastic!
</p><p>
So playing with the syntax of Ruby took me about an hour. In that time, I discovered some very useful features of Ruby. First, if you have an Array that has only 50 elements and you call array[51] on it, you do not get a horrible exception like in Java but you get <i>nil</i>. This is nice because it lets you traverse the maze without worrying too much about null pointer exceptions. Secondly, you should be a little cautious when using the built-in String and Array methods. For instance ["a", "b", "c", "d"].delete("a") returns "a" and not ["b", "c", "d"]. There is of course an advantage to returning the deleted element, but you do have to be careful about such things. Thirdly, you <b><i>must</i></b> remember that Ruby passes things using references so if you want a copy, make sure you explicitly create one.
</p><p>
What really threw me off was not my code, but a typo I made while copying Gushi's version of the maze off the website for testing. Somehow, I added an extra space past the newline and that affected all the offset so my recursive function just terminated without reaching the end of the maze. This carelessness of mine wasted 1 hour of my time analyzing my algorithm. But it did at least convince me more that the algorithm does work. Like I said, my algorithm utilizes some form of depth-first search. At each position, I have two sets: one of the potential positions to go, and the other of the positions that I have already visited. To prevent infinite recursion and also to optimize a bit, I never visit the positions that I have visited prior to the current node. The code shows this more explicitly.
</p><p>
I did two iterations of the program. The first one being using functional programming. And the second time around, I refactored it to be more object-oriented. Nonetheless, there was not much point in making it object-oriented.
</p><p>
Here is <a href="http://homepage.mac.com/vazexqi/docs/ruby/maze_ver2.rb.html">my code</a>, made beautiful through the use of Vim by following the instructions <a href="http://www.chrisruzin.net/index.php/entry/exporting_textmate_code_to_html/">here</a>. Of course, I would have preferred TextMate's coloring but Vim is good enough.
</p>
Nokia: A great company producing great little apps (and phones!)2005-08-09T00:00:00+00:00http://vazexqi.github.com/2005/08/09/nokia-a-great-company-producing-great-little-apps-and-phones<p>
Most Americans I know settle for a Motorola cell phone. I personally think that Motorola phones have one of the worst user interface designs ever. True, their <a href="http://direct.motorola.com/ENS/web_producthome.asp?Country=USA&language=ENS&productid=29302">Razr V3</a> series look really slick on the outside but the embedded operating system is still pretty primitive.
</p><p>
Anyway, in countries in Europe and Asia, most people use a <a href="http://www.nokia.com/">Nokia</a>. Cell phones might be the one area where people in Asia are more technologically advanced compared to their American counterparts. In fact, Nokia notices this too: Asian denizens are more likely to buy new cell phones (or hand phones as they are called there) even if the cost of one is about 2000 dollars in local currency!
</p><p>
What about smartphones? Treo 650's and the rest. Yeah, sure America's wireless companies support <i>smart</i> phones. Hmmm... aren't they just some niche market just like what the Tablet PC is in the computer industry? Heck, don't take my word for it, listen to this guy:
</p><cite><a href="http://www.russellbeattie.com/notebook/1008063.html">
Russell Beattie Notebook - Smart Phones Are One Handed Devices</a>: "Hey, okay. So I can see the new browser is pretty neat, and hell, Palm as a real multi-tasking OS is something to get a little jazzed about. But judging from the pics of the Qool Palm phone there's some disconnect in what I'm reading. Here's a little lesson in mobile nomenclature: If you can't use the phone with one hand, it's not a smart phone. Got it? It's pretty simple. It's a PDA Phone or a Communicator or something. Whatever it is, it's not a smart phone. It's a relic. An elecronic organizer with an antenna. An anachronism. A soon-to-be market failure. Get the idea?"
<br /><br />
Let's go over this again: If it doesn't have a keypad? It's not a smart phone. If you have to use a pen? It's not a smart phone...</cite><p>
And because Nokia is smart enough to use the <a href="http://www.symbian.com/">Symbian OS</a> on most of their high end phones, they can get other people to develop software for their phones. Forget Java MIDP applications, those are really slow and contrary to what people advocate, they do not follow the <i>write once, run anywhere</i> mantra. What I would really like to see would be Irb running on a Symbian phone.
</p><p>
Well, the program that I am most intrigued with now is <a href="http://www.nokia.com/nokia/0,,71754,00.html">Nokia Lifeblog</a>. It lets you take photos and videos on your Nokia cell phone and then upload it to your blog, complete with text as well. This is really what having a camera on your cell phone is all about. I think it is really neat to be able to go on some trip and post live photos of what you are doing to your friends and families. Someone should hold a competition for this. Remember, if there is indeed a competition for cell phone photo blogging, you heard it <i>here</i> first. If you want a more down to earth review of LifeBlog, read <a href="http://digitaljournalist.org/issue0508/trapani.html">this</a> article.
</p><p>
Well, what else can a Nokia do that other cell phones cannot? Actually, cell phones that run Symbian OS can do what Nokia phones are capable of. How about ssh on your cell phone? Unbelievable? Believe it. David Heinemeier Hansson has a <a href="http://www.loudthinking.com/arc/000363.html">list</a> of his applications that he runs on his Nokia 6630. Want another list? Try Russell Beatie's <a href="http://www.russellbeattie.com/notebook/1005581.html">here</a>.
</p><p>
What about my cell phone? Don't have one yet. I am still waiting for the FCC to approve the N90, the new Nokia cell phone with a 2 mega-pixel camera. That will certainly keep my fingers snapping like crazy.
</p>
<p>
Update: By the way, I forgot to mention, there is also an increased risk for viruses to attack Nokia Series 60 phones. <a href="http://www.engadget.com/entry/1234000130054096/">Engadget</a> (Aug 11, 2005) reports that there is a mass outbreak of the Cabir virus in Finland infecting Nokia Series 60 phones via bluetooth. Also, for a more comprehensive review of some of the other malicious code that attack cell phones, read <a href="http://csdl2.computer.org/comp/mags/co/2005/04/r4020.pdf"><i>Mobile Phones: The Next Frontier for Hackers?</i></a> published in IEEE Computer Magazine in April 2005. So, there might be <i>some</i> advantage to sticking with lesser known brands.
</p>
Why defragment?2005-08-08T00:00:00+00:00http://vazexqi.github.com/2005/08/08/why-defragment<p>
I have used my newly acquired Dual Xeon 1.7Ghz machine for about a month. And what happens? The disk need serious defragmenting! No kidding. I do less work on this machine than I do on my Powerbook and yet I never had to defragment my mac. Well, opinions vary on this and some swear by it. By, (ahem, ahem) according to Apple: "...<a href="http://docs.info.apple.com/article.html?artnum=25668">there is little benefit to defragmenting</a>." That is definitely the way a machine should work.
</p>
<p>
For those who simply have itchy fingers and want to defragment their mac, the typical choice would be <a href="http://www.coriolis-systems.com/iDefrag.php">iDefrag</a> and the typical program to stay <b>away</b> from is Norton.
</p>
<p>
I am not sure how Windows work but the disk can get seriously fragmented if you do a lot of file copying and moving. In fact, I had VMWare running and I needed to download a 710MB file. Ran compmgmt.msc on the Windows machine and it told me to defragment right away! Interesting seeing that this disk is new and it has been running for less than 48 hours.
</p>
On Trusted Platform Module and Apple2005-08-08T00:00:00+00:00http://vazexqi.github.com/2005/08/08/on-trusted-platform-module-and-apple<p>
I do not know enough to say anything intelligent, nor would I say anything to speculate on something that clearly is beyond my control. Therefore, I am grateful that John Gruber has produced such <a href="http://daringfireball.net/2005/08/trusted">a fantastic piece</a> discussing this issue that was sparked from two separate articles from <a href="http://www.boingboing.net/2005/07/31/apple_to_add_trusted.html">Cory Doctorow</a> and <a href="http://apple.slashdot.org/article.pl?sid=05/08/01/0421248">Slashdot</a>.
</p>
<p>
Here is what I think:
<ul>
<li>Apple would not do something stupid to jeopardize itself right after hitting the sweet spot with so many developers.</li>
<li>I doubt that Apple or Intel or whatever can force developers to write programs that will utilize this <i>evil</i> technology</li>
<li>Even if there were, there will be definitely some where to <b>crack</b> it.</li>
<li>Why fret over something that you know nothing about? Apple has not even released Leopard yet!</li>
</ul>
</p>
Goodies from OSCON2005-08-08T00:00:00+00:00http://vazexqi.github.com/2005/08/08/goodies-from-oscon<p>
In case you have not noticed, there is a whole plethora of resources for the presentations that were made during OSCON 2005. Here is the <a href="http://conferences.oreillynet.com/pub/w/38/presentations.html">link</a> to get your hands on those resources.
</p><p>
Unfortunately, the best stuff might not be on that page. Why the lucky stiff has been kind enough to provide some links to other presentations <a href="http://redhanded.hobix.com/cult/osconGoodsFromMatzWeirich.html">here</a>. Of course, he has been too modest and conveniently forget to include his own wonderful presentations. So, to grab why's unorthodox presentations, which befitting that term, head over to <a href="http://redhanded.hobix.com/cult/aVideoButLaterMoreWhen.html">redhanded</a> and enjoy some truly hilarious fun with his videos.
</p><p>
My personal recommendations as of today are:
<ul><li><a href="http://www.onestepback.org/articles/10things/index.html">10 Things Every Programmer Should Know About Ruby</a></li><small>I cannot believe that Weirich actually mentions the Sapir-Whorf theory! Shows that what you learn in Anthropology does come in useful sometimes.</small><li><i>All</i> of <a href="http://www.whytheluckystiff.net/starry/">Why's Stary Afternoon Torrents</a></li><li><a href="http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf">Metaprogramming Ruby</a></li></ul></p><p>
As mentioned in my previous <a href="/articles/2005/08/05/foscon-some-people-have-all-the-fun">post</a>, I cannot wait to see what why did with drb. He might really be onto something here: a new, more fun way to teach programming in a new and more fun language. A language that is not designed to appease corporate managers, but one to get hackers together.
</p><p>
In case anyone is wondering, I am posting these links not because there is a dearth of web blogs writing about how awesome OSCON was, but because I really think these presentations are interesting. And I would really loved to be there too.
</p>
Bumped up from Typo-2.0.6 to Typo-2.5.22005-08-08T00:00:00+00:00http://vazexqi.github.com/2005/08/08/bumped-up-from-typo-2-0-6-to-typo-2-5-2<p>
There is something a bit peculiar about this implementation of Typo. For instance, the bug about having NULL values in the text-filter column in the article tables i in the typo database has not been resolved. Thus, I had to actually go in and fix that. Fortunately with <a href="http://www.mysqlfront.de/">MySQL-front</a>
I was able to identify the culprit and followed the instructions <a href="http://rubyforge.org/pipermail/typo-list/2005-July/000344.html">here</a> to fix it.
</p><p>
The default theme is now Azure, again. I wished they stick with the Kubrick theme. But the good new is that the way themes are set up now, switching between themes is simple enough.
</p><p>
I really like the new static web page cache generation thing. This saves a lot of time from having to dynamically generate files that have been requested before.
</p><p>
Anyway, I am going to try to fix the corruption and posix error for files stored in the typo/public/files folder. This has been something that has been bugging me for some time. It seems that I must have screwed something up somewhere because now all my images that I uploaded will not work! This is really really weird.
</p>
<p>
This seems to be pretty serious. I have not been able to fix it yet. Right now, as long as I try to serve any image larger than 40kb in size, it gets truncated. Apache's error logs do not report anything other than a 200 request (which means that the request was good; also the bytes it transmitted corresponds to the actual file size). However, in Safari and other browsers, you get the error of Posix Error: Connection reset by peer! What gives? Some people on the web are having this problem too but theirs seems to be connected to php somewhat.
</p>
<p>
For a simple test, try loading <a href="http://dan0581.urh.uiuc.edu/backpack.gif">this</a> and see if there are any errors.
</p>
FOSCON: Some people have all the fun2005-08-05T00:00:00+00:00http://vazexqi.github.com/2005/08/05/foscon-some-people-have-all-the-fun<p>
From comp.lang.ruby on why the lucky stiff's presentation:
<br /><br />
"He had people fire up irb and then displayed some code they would need to log into his drb server running on his laptop. As each person logged in the colors on the projected screen changed and it would divide into different regions so you could tell how many people were logged in. Audience members could change colors on Why's display by changine their code in irb. It was very cool... though some wise guy changed part of the screen to white-on-white which made it impossible to read the code on that section (but Why got some jokes out of this too).
Why's talk was extremely funny so it can be easy to overlook the fact that this was a very innovative idea for creating an interactive presentation. Most presentations are all one-sided: A speaker delivers some information to an audience - there may be a Q&A session afterwards, but other than that it's not interactive at all. What Why did last night, I've not seen before: He invited the audience to directly participate and even effect his presentation. This aspect deserves a lot more examination.
<br /><br />
One can imagine variations on this theme: For example you could run a webrick server on your laptop and allow audience members to interact with (and potentially effect) your presentation through their browsers. Lots of potential uses: audience voting in real time, for example. Code contests with the audience. It's great for tutorials (This is how Why used it): you get people to actually try out the code you're talking about with some kind of feedback to the speaker. Nobody gets bored.
<br /><br />
I think that Ruby historians and sociologists will look at this event as a seminal development in the direction of interactive teaching.
Oh, and two shadow puppet birds debated teaching methodologies just prior to this part of the show - that was no accident."
</p><p>
More photos are available on <a href="http://flickr.com/photos/tags/foscon/">flickr</a>. I really wish that I was there. It would be interesting to see how to teach ruby with puppets and such. Right now I hope that why releases his irb thingy for public perusal. Why is definitely one creative fellow. He is right up there on the list of people I look up to; right along with David Heinemeier Hansson.
</p>
O'Reilly CodeZoo2005-08-04T00:00:00+00:00http://vazexqi.github.com/2005/08/04/oreilly-codezoo<p><a href="http://www.codezoo.com/news.csp">O'Reilly CodeZoo</a>: "After our launch in April, we received requests for many languages, but no language got more requests than Python. We're happy to have Python represented on CodeZoo, and will be adding still more components to the Python tab over the next few weeks. Visit python.codezoo.com to get right to CodeZoo's 'Reptile House.'
<br />
Seeing all the excitement around Ruby, particularly Ruby on Rails, we felt it would make an excellent addition to CodeZoo. Whenever possible, we're providing a RubyGems-format download as the default (and we'll start up a Gems server shortly). Check out ruby.codezoo.com and see what all the fuss is about."</p><p>(Via <a href="http://lesscode.org/2005/08/04/code-zoo-language-breakdown/">@lesscode</a>.)</p><p>
Though I am neutral for the inclusion of Python as part of codezoo, I am really excited about Ruby's inclusion. Maybe people have really seen what a great language it can be.
</p>
Finally FastCGI is working2005-08-04T00:00:00+00:00http://vazexqi.github.com/2005/08/04/finally-fastcgi-is-working<p>
Update: Seems that fastCGI is not as stable as I had hoped it would be. Sometimes the damn thing just crashes and has to restart itself. I am sure there is a non-obvious simple solution to this (probably by adding some line to http.conf or dispatch.fcgi). The good news is that if there is an error, just reload the page and fastcgi will kick back in with a new instance of itself. The bad news: this is really a pain.
</p>
</p>
<p>By following the instructions <a href="http://wiki.rubyonrails.com/rails/show/HowtoSetupApacheWithFastCGIAndRubyBindings">here</a> I managed to get my typo web blog running on Apache-fcgi. I must say the speed improvements are really noticeable even though it required some rather weird instructions such as not installing mod_ruby or mod_sql.
</p><p>
Now the speed is really comparable to that of MovableType. Even the admin pages load faster. And Marsedit does not suffer from any lag whenever I post a new article. The only way that this could be faster would be to have lighttpd with fcgi installed. When the windows version of that comes out, you can bet that I will be installing it.
</p>
Added a new category: manga2005-08-04T00:00:00+00:00http://vazexqi.github.com/2005/08/04/added-a-new-category-manga<p>
Nowadays my greatest source of entertainment comes from reading manga. My first post on manga was about some patterns in the typical way of producing those that sell well. You can read about it <a href="/articles/2005/01/16/manga-patterns">here</a>. I decided to dedicate a section to it because I have consumed about 1000+ pages of various titles through scanlations (short form for translated scans of the original manga) by various groups. For something that I spend nearly an hour a day on, there must surely be something worth writing about.
</p>
<p>
Although the general rule of thumb is to go buy the manga and not download the scanlations once some company licenses it in your country, I cannot really abide by it. Why? Well, those companies take <i>so</i> long just to get one tokuban out! Sometimes the scanlations are already <i>way</i> ahead on volume 20 while the official tokuban has only reached volume 2! A better compromise would be to continue reading the scanlations until the official versions catch up with them. Another problem actually arises from collecting the official tokubans: physical space! You actually have to find space to store all those graphics novels whereas I can easily fit the entire series into my external usb2 harddisk. Again, I am not advocating privacy, but I would really appreciate it if the Japanese companies released the manga in some electronic form for easy portability.
</p>
<p>
What I will probably include in future posts in this category would the titles of the latest manga that I can get my hands on. By doing so, I get to adorn my web site with some pretty pictures without having to take them myself. Oh yeah, almost forgot about copyright issues. But if I give the proper credits I guess it is all right, isn't it?
</p>
<p>
Anyway, here is my tribute to one of the greatest manga artist of all time: Rumiko Takahashi. She created well-loved series such as Inuyasha, Ranma 1/2, and Urusei Yatsura. She has many other titles under her belt as well. And each new series that I pick up never fails to inspire fits of laughter and hours of enjoyment. For a great website that features a summary of all her works, please visit <a href="http://furinkan.com/">Rumic World</a>.
</p>
<p>
Right now, Cartoon Network is showing the older Inuyasha anime series over the weekdays. And they have the latest season airing every night on Saturdays. This would be a good time to actually watch the series. I am happy that the translation of the anime went pretty well and that the characters do not sound like silly little children with cotton balls stuff down their throats.
</p>
Sometimes this is so true...2005-08-03T00:00:00+00:00http://vazexqi.github.com/2005/08/03/sometimes-this-is-so-true<a href="http://www.penny-arcade.com/view.php?date=2002-07-12&res=h"><img alt="Exotic mac user?" src="http://www.penny-arcade.com/images/2002/20020712h.gif" width="450" height="223" /></a><p>
Sometimes I feel this way. Except I don't drink coffee, I drink Boh Cameronian Gold Blend Tea.
</p>
Ruby on Rails framework creator awarded Best Hacker!2005-08-03T00:00:00+00:00http://vazexqi.github.com/2005/08/03/ruby-on-rails-framework-creator-awarded-best-hacker<p><a href="http://www.loudthinking.com/arc/000489.html">Winning Google/O'Reilly's Best Hacker of '05 (Loud Thinking)</a>: "The ego inflation just culminated in a near pop. The Google-O'Reilly Open Source Awards granted me the great honor of being named "Best Hacker" of the year for the work with Ruby on Rails"</p><p>
Well deserved award! When you see companies such as Google and O'Reilly giving out awards, you know that those awards are not some stupid corporate pieces of bullcrap. This is one real achievement, both for David and also the Ruby on Rails community. There is definitely some essence to all the hype about Ruby and Rails.
</p><p>
Hopefully the next time around, <a href="http://versions.tech.coop/lisp-on-lines/doc/lisp-on-lines.txt">Lips on Lines</a> wins the award. <i>One can dream cant't he?</i></p>
Going to take the plunge...2005-08-03T00:00:00+00:00http://vazexqi.github.com/2005/08/03/going-to-take-the-plunge<p>
And remove MovableType from my server. It was a real pain having to install it on windows on the first place. Not to mention all those stupid Perl modules that I had to obtain. Anyway, the pain is over now.
</p>
<p>
But for safety, I am going to retain the .sql files as well as the mt.cgi file that is exported directly from MovableType. That being said, I am still pretty happy with MovableType has to offer. It is a great blogging system. It <i>definitely</i> beats blosxom. Blosxom was my first blogging system and it did a rather good job at that. Problem is, there is very little support for it. And hardly anything new is being done to it.
</p>
First post for typo!2005-08-02T00:00:00+00:00http://vazexqi.github.com/2005/08/02/first-post-for-typo<p>
Today is the day that I moved my blog from <a href="http://www.sixapart.com/movabletype/">MovableType</a> to <a href="http://typo.leetsoft.com/trac/wiki">typo</a>. Yeah! No more messy perl files to deal with. And with typo 2.0, I gain the Kubrick template as well. So that saves me some time as well.
</p><p>
Right now it is running on Apache2 with cgi only. Now, as most of you have heard, this is not the way to be <i>fast</i>. However, as pointed out in <a href="http://www.pragmaticprogrammer.com/titles/rails/">Agile Web Development with Rails</a> trying to get Apache and FastCGI to work together is no simple task. In fact, I dabbled with it for the past 3 hours with no success. Moreover, I could not even install the fcgi gem!
</p><p>
So, right now, the site seems to be really sluggish. There should be something else that can be configured to make this faster. Right now, it seems that typo is fetching all 70+ articles each time we reload the page. At least, I <i>think</i> so. I am most probably wrong. And I hope I am.
</p><p>
Anyway, I need to spend some time reading the source code and tweaking things. Right now, I am running the default out of the box configuration. Definitely needs some tweaking.
</p><p>
However, this process has been fun and I am sure I will get better at handling the idiosyncrasies of Apache and FastCGI.
</p>
Boing Boing: Apple to add Trusted Computing to the new kernel?2005-08-01T00:00:00+00:00http://vazexqi.github.com/2005/08/01/boing-boing-apple-to-add-trusted-computing-to-the-new-kernel<p><a href="http://www.boingboing.net/2005/07/31/apple_to_add_trusted.html">Boing Boing: Apple to add Trusted Computing to the new kernel?</a>: ""</p>
<p>(Via <a href="http://www.osx86.classicbeta.com/wiki/index.php/Main_Page">ODx86</a>.)</p>
<p>
What does this mean? Right now nothing much, but if it turns out to be true, this will probably become a big deal. Rather than speculating what will happen, it is best just to see how things go. I am pretty sure Apple would not be so audacious to piss off all its users just to satisfy Intel or the <i>music industry</i> that is bent on keeping a tight lease on licensing issues. Anyway, even if this were true, I think we could always count on honest developers not to abuse it.
</p>
<p>
Worse case scenario, fall back to text files, just as what the Pragmatic Programmers suggested in their book: <a href="http://www.pragmaticprogrammer.com/ppbook/index.shtml">From Journeyman to Master</a> and rely on <i>real</i> editors like Vim and Emacs.
</p>
Got myself a 20 inch widescreen monitor!2005-07-28T00:00:00+00:00http://vazexqi.github.com/2005/07/28/got-myself-a-20-inch-widescreen-monitor<p><a href="http://accessories.us.dell.com/sna/productdetail.aspx?c=us&l=en&s=dhs&cs=19&sku=320-4111&category_id=4009"><img alt="Dell 2005FPW" src="http://accessories.us.dell.com/sna/images/products/large/320-4111.jpg"/></a><br />
And the first thing you do when you get such big display is to install <a href="http://homepage.mac.com/khsu/DejaMenu/DejaMenu.html">DejaMenu</a> because when you have a second display, Mac OS X's menubar only appears on the main machine and not on that beautiful 16080 x 1050 screen estate. A real shame.
</p><p>
The second thing you <i>must</i> get is a set of wireless keyboard and mouse because using the powerbook's keyboard is going to cause you really bad neck pains. Apple's bluetooth keyboards are really slick and all but getting one that has more function keys might be more worthwhile. And of course, unless you are a dumb-ass, do not ever get the Apple one-button mouse. If you want a one-button mouse, use the one on the powerbook.
</p><p>
Last but not the least, for such a nice display, you also need desktop pictures that fit. Head on over to <a href="http://www.pixelhuset.se/pixelhuset.html">PixelHust</a> and grab a few. They are free and decent looking. And make sure you turn on the option to change the wallpaper every few minutes because the transition on the large screen is really sweet.
</p>
Holy shit: Google Print!2005-07-25T00:00:00+00:00http://vazexqi.github.com/2005/07/25/holy-shit-google-print<p>
Google keeps coming up with all these cool ideas! Now they have <a href="http://print.google.com">Google Print</a>. It allows you to search for text inside PRINTED books. That is right, printed books! Those kind that you cannot read of a web page.
</p>
<p>
It is even faster than bringing that book out from your shelf, looking through the table of contents and the index to find what you need. Just go to Google Print and if you are lucky, they have already archived that book.
</p>
<p>
Being the smart people that they are, Google has of course not provided an easy way to browse through all the pages from beginning to end. Instead you get to only view pages that match your search criteria. But, bare in mind, this gives you the best of both worlds! You can read your book in its printed format, and then search through it using Google!
</p>
<p>
Excellent! Especially for books that do not have electronic versions.
</p>
Learning LISP2005-07-24T00:00:00+00:00http://vazexqi.github.com/2005/07/24/learning-lisp<p>
After reading Paul Graham's essays and his bias in favor of Lisp, I finally joined in the bandwagon. Surprisingly, WikiPedia has this to say about Lisp:
<blockquote>
Having declined somewhat in the 1990s, Lisp has experienced a regrowth of interest since 2000, partly due to the writings of Paul Graham.
</blockquote>
I never knew that <i>he</i> had that much influence. Well, anyway, I picked up a copy of the Little LISPer from the library. Unfortunately, this book is no longer available for sale (it has been replaced by the Little Schemer, which I hear has about the same contents). Now, the Little LISPer is an interesting book. Instead of having page after page of words, it has page after page of conversations! Each page is formatted into two columns, one for the dialogue of the teacher and the other for the student. And their conversation revolves around LISP, recursion (lots of it) and food! For a sample of what these conversations sound like, I direct you to <a href="http://www.visibleworkings.com/little-ruby/">Brian Marick's</a> implementation of this style of writing for Ruby.
</p><p>
LISP seems to be an interesting language. So far the Little LISPer has focused more on recursion than features of the language, so I am not able to see how to use LISP to do more complex stuff. There are libraries written for it that can do GUI because it was in the tutorial for my IDE. I have also ordered a copy of <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0133708756/qid=1122190974/sr=8-1/ref=pd_bbs_sbs_1/103-0300846-2604644?v=glance&s=books&n=507846">ANSI Common LISP</a> from the library. Paul Graham <a href="http://www.paulgraham.com/acl.html">promises</a> that it has the best explanation for macros. And it even has 20 substantial examples for showcasing the power of LISP.
</p><p>
Anyway, my motivation for learning LISP is to verify how much of what Paul Graham says is true. He believes that languages are evolving more toward what LISP is. Here is a diagram that shows how Ruby came about. I pilfered it from the book
<a href="http://www.amazon.com/exec/obidos/tg/detail/-/0133708756/qid=1122190974/sr=8-1/ref=pd_bbs_sbs_1/103-0300846-2604644?v=glance&s=books&n=507846">Game Programming with Lua, Python and Ruby</a>. I sincerely hope that you do not buy this book. I have browsed through it and am really disappointed with its contents. Then again, I have never been pleased with the Game Developer series; the book lacks depth and tries to make up for it by having a CD that is loaded with all kinds of crap. The reviews for it on Amazon agrees with me. But, anyway, here is the diagram:
<br /><img alt="Ruby Evolution" src="http://photos22.flickr.com/32844685_04100fdb50.jpg?v=0"/></p><p>
No doubt, lambda (or Proc, as they are called in Ruby) seems to the common ground for this languages. Not to mention the fact that metaprogramming is an important feature for LISP. One, that paved the way for its popularity in Artificial Intelligence. Why (yes he is called Why or rather Why, the lucky stiff) has written two nice articles on metaprogramming on Ruby: <a href="http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html"><i>Seeing Metaclass Clearly</i></a> and <a href="http://poignantguide.net/ruby/chapter-6.html#section3"><i>A Sponsored Dragon-Slaying</i></a>.
</p><p>
So, right now, the method that I am deploying for learning LISP falls along the lines of writing little programs and some test cases for them. This methodology is similar to the one suggested by <a href="http://www.clarkware.com/cgi/blosxom/2005/03/18">Mike Clark</a>. And for my IDE, I chose <a href="http://www.lispworks.com/downloads/">LISPWorks Personal Edition</a> as it was recommended on the LISP newsgroup.
</p>
Show your passion: get a t-shirt!2005-07-23T00:00:00+00:00http://vazexqi.github.com/2005/07/23/show-your-passion-get-a-t-shirt<p>
I was planning to get a Ruby t-shirt. So I made the purchase today and bought two:
<ul><li><a href="http://www.cafepress.com/rubyhappy.23269823">Use Ruby be Happy</a></li><li><a href="http://www.cafepress.com/rails_stuff.25707916">Ruby on Rails</a></li></ul></p><p>
Ironically, what motivated me was <a href="http://headrush.typepad.com/creating_passionate_users/2005/07/tshirtfirst_dev.html">this post</a> about Java and people wearing Java t-shirts! No! The Rubyist in me cannot bear to see those guys around totting their Java stuff.
</p>
Design Patterns and Languages2005-07-23T00:00:00+00:00http://vazexqi.github.com/2005/07/23/design-patterns-and-languages<p>
The original authority on <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/qid=1122146830/sr=8-1/ref=pd_bbs_sbs_1/103-0300846-2604644?v=glance&s=books&n=507846">Design Patterns</a> is the Gang of Four book. The Gang of Four includes my Software Engineering professor, Dr. Ralph Johnson. Design Patterns is still a good book and all; however, it focuses a lot more of implementing it using C++. Thus, I bought the <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0596007124/qid=1122146830/sr=8-2/ref=pd_bbs_sbs_2/103-0300846-2604644?v=glance&s=books&n=507846">Head First Design Patterns</a> book. Except for its startling front cover, Head First Design Patterns is an excellent book. I read through 5 chapters of it last night after the book arrived. The exercises in there are fun, with the exception of the crossword puzzles. Why are there crossword puzzles?
</p><p>
Anyway, from what I have read -- and this is still very preliminary -- most of the design patterns seem to be used for delaying initialization to runtime. That is, all functionality should be freely dynamic and can be added and changed at runtime. Thus, design patterns seem more like little hacks (pardon me for a lack of a better word) to get the static type-based languages to be more dynamic.
</p><p>
I do not think that I am the only one to think this. Peter Norvig has some <a href="http://norvig.com/design-patterns/">slides</a> that show how to use design patterns in dynamic languages. In fact, he says that 16 of the 23 patterns discussed in Design Patterns are more easily implemented using Lisp than C++. Needless to say, this is something that I am really interested in finding out more on. And as a side note, this brings me back to what Paul Graham thinks: there is indeed the dream language. It would not do justice to his <a href="http://www.paulgraham.com/icad.html">excellent essay</a> on how he goes on to describe why some languages are indeed better. If you excuse him for his bigotry toward other languages beside Lisp, you might come to agree with him that there is indeed an evolution of languages. New languages tend to be more dynamic and not as type-based. Also, new languages tend to be flexible enough that you are able to define new constructs for the languages so that it models your software better.
</p><p>
Maybe, I am just language-addicted. Dave Thomas, one of the <a href="http://www.pragmaticprogammer.com">Pragmatic Programmers</a>, mentions in a recent Ruby on Rails <a href="http://podcast.rubyonrails.org/">podcast</a> that he is interested in languages too. And that he always strives to spend 3 minutes on each new language that he encounters, devoting more time to it if he finds it interesting.
</p><p>
In short, what I would really want to find out: Are Design Patterns modeled after the limitations of the language? Or do their usefulness transcend between languages?
</p>
Finally.. the BEST widget ever!2005-07-19T00:00:00+00:00http://vazexqi.github.com/2005/07/19/finally-the-best-widget-ever<img alt="BackPack Widget by Chipt" src="http://www.chipt.com/widget/widget_animated.gif" /><p>
Finally, at this very moment I have found the greatest and best widget of all times!
And it is the <a href="http://www.chipt.com/widget.html">Backpack widget</a> by Chipt Productions, LLC. Words cannot describe how useful it is. The quicksilver Backpack plug-in is neat but this is really excellent. And it is all because 37Signals, the creators of Backpack has the brains to expose the BackPack API to developers.
</p><p>
I believe that Chipt is a start-up company. Well, if this is what they are capable of offering, then I cannot wait for what else they have in store for their customers.
</p><p>
Of course, need I add, all this is possible through the clever use of Ruby on Rails.
</p>
Replacing MovableType with Typo?2005-07-18T00:00:00+00:00http://vazexqi.github.com/2005/07/18/replacing-movabletype-with-typo<p>
Ah, the agony. I just stumbled across <a href="http://typo.leetsoft.com/trac/wiki">Typo</a> which is a <i>sweet</i> weblog system written with <a href="http://www.rubyonrails.org">Ruby on Rails</a>! That means that I can actually fiddle with it and that I already understand more than 80% of what is going on. This beats MovableType in a way since MovableType is written in Perl and I am not confident in that language. Again, it gives me time to <a href="http://www.answers.com/topic/eat-one-s-own-dog-food"><i>eat my own dog food</i></a> since I am a big fan of Ruby on Rails.
</p>
<p>
And of course, this provides the excellent opportunity to follow through using the <a href="http://www.pragmaticprogrammer.com/titles/rails/">Agile Web Development with Rails </a> book that I bought but have not fully utilized. Ah, the temptation. The only thing that is holding me back is the lack of templates for Typo. However, that can be viewed as some of motivation as well since now I can no longer rely on someone else's template.
</p>
<p>
Oh, did I mention that someone wrote a script that will migrate my MovableType entries over to Typo? <i>Excellent</i>
</p>
<p>
Plans to install the kubrick template for MovableType is still not happening. The last time I did this, I used the steps highlighted <a href=http://www.josuesalazar.com/kubrick-on-mt/">here</a> but the link has been done for some time. The author says that the website will be up soon, sometime.
</p>
Similar to rails...2005-07-17T00:00:00+00:00http://vazexqi.github.com/2005/07/17/similar-to-rails<p>
<a href="http://www.djangoproject.com/">Django</a> - how do you pronounce this? - seems like the python equivalent of Rails. Python, as I have heard from multiple blogs and newsgroup threads, many other implementations that are similar to the capabilities of Rails. However Django seems to be the new kid on the block. Of course, there is another competition from another Java thing called <a href="http://www.openlaszlo.org/">openlaszlo</a>. Django looks nice but Laszlo looks heavy-weight. <i>Where do they come up with these names?</i>
</p>
<p>
I make it a point to stay current on this kind of technologies. Not because I like taking sides and then switching them when a new competitor comes along, but like the book Pragmatic Programmers says, it is always best to equip yourself and build upon your knowledge base. Learning Rails has made me learn the Ruby language which is an excellent language.
</p>
<p>
Nowadays, I try to stay away from "heavy" languages such as Java. Sure you <i>can</i> do all sorts of things with it. And since you can do all sorts of things with it, you need to only learn one language. Now, <i>who would not want that?</i> Again, doing everything with one language is not always a good thing. The Pragmatic Programmer book has a lot to say about this. Learning new languages is always an advantage.
</p>
<p>
Anyway, these two new technologies are worth checking out. And I will be monitoring the comp.lang.ruby newsgroup for any mention of them. All in all, taking sides is not really a wise thing to do since the platform that you use as a developer is mostly dictated by your customers and the companies you work for. So, unless you can come up with a damn good plan why you are going to use some deviant you have to stick with the <i>common</i> ground. Ah, the joys of owning your own small company.
</p>
Harry Potter Book 6!2005-07-16T00:00:00+00:00http://vazexqi.github.com/2005/07/16/harry-potter-book-6<p>
Finally got it today at about 5 p.m.! It left the delivery center at about 5 am this morning according to UPS tracking system. Well, that is all that needs to be said. It is going to be a weekend well spent on reading.
</p>
First and foremost!2005-07-13T00:00:00+00:00http://vazexqi.github.com/2005/07/13/first-and-foremost<p>
I destroyed my computer's system files last night while trying to be heroic and installed the OS X 10.4.2 update without waiting for it to show up on software update. Now that I think of it, there can be a few reasons why the installation failed miserably. Here are my theories:
<ul>
<li>Intego's virus barrier did something to screw with the installation. </li>
<li>I actually downloaded the wrong package to install! It could have even been the one for OS X Server!</li>
<li>I tried doing what rixstep <a href="http://rixstep.com/1/20050408,00.html"> told </a> me to do to secure the sudo command.</li>
<li>My bootleg version of Tiger finally revealed its true stripes. I bought Tiger but I managed to procure a bootleg version of it before mine arrived. So thinking that I have a license for it, I might as well take the plunge earlier. Hmmm, bad idea.</li>
<li>Some butterfly in Tokyo flapped its wings and caused some imbalance in the amount of bad luck in the world. Thus, Murphy's Law struck harder than expected.</li>
</ul>
</p>
<p>
But the more important thing is that I managed to salvage what I can from my previous weblog. Of course, that is not much since all the pictures are now missing. And some of the posts are also missing. The ones that I managed to restore so far are from an exported file done through movable type itself.
</p>
<p>
The most important thing is that I have come to appreciate the usefulness of syncing with .mac. Because of that, I was able to get a new installation of OS X Tiger up and running within an hour with all the bare minimums. It took me about 3 more hours to install programs that I think I might need. However, this time around, I am more selective of what programs I actually install. Additionally, this fanstastic program called <a href="http://www.scifihifi.com/podworks/">PodWorks</a> saved my iTunes library file for me by transferring the songs back from the iPod will all the latest ratings and play dates. Wonderful. Well worth its $ 8 price tag. Incidentally, <a href="http://www.rixstep.com/2/20050321,00.html">rixstep</a> offers some command line method for doing it. Unfortunately, the instructions were not explained clearly. And my first trial with it caused my music folder to be invisible to the finder. I really have to be careful with what rixstep says.
</p>
<p>
Finally, my greatest worry now is how secure this blog is going to be on windows. I have this feeling that it is <i>not</i> at all.
</p>
<p>
Here are my plans for the next few days:
<ul>
<li>Restore posts from the .sql file that I managed to salvage.</li>
<li>Remove all links to the broken images.</li>
<li>Change the site to use php and generate dynamic archived pages instead of static ones.</li>
<li>Change the template to kubrick, again.</li>
<li>An article on how I painfully got movable type to work on windows! Yeah!</li>
</ul>
</p>
42things2005-04-18T00:00:00+00:00http://vazexqi.github.com/2005/04/18/42things<div align="center">
<a href="http://www.flickr.com/photos/37092324@N00/33508025/" title="Photo Sharing"><img src="http://photos21.flickr.com/33508025_18f51a9c2a.jpg" width="500" height="492" alt="42things" /></a>
</div>
<p>
By the way, the picture above shows my latest project. 42things.com an emulation of 43things.com. All done in Ruby on Rails goodness. Ruby is becoming my favorite language.
</p>
<p>
The actual coding took less than a week. But if you count in total numbers of hours actually spent coding, it is about 24 hours. Most of the time, we were tweaking the database schema so that it is more normalized.
</p>
<p>
Some features supported:
<ul>
<li>Searching</li>
<li>User accounts</li>
<li>Comments</li>
<li>Entries for items the user is doing</li>
<li>Related tags</li>
<li>Related items</li>
</ul>
</p>
New template2005-04-09T00:00:00+00:00http://vazexqi.github.com/2005/04/09/new-template<p>
Did some hasty job of changing the template once I realized that it is no longer winter. Expect a better looking one once I have more time on my hands.
</p>
MCB Open house at UIUC2005-04-09T00:00:00+00:00http://vazexqi.github.com/2005/04/09/mcb-open-house-at-uiuc<a href="https://netfiles.uiuc.edu/ro/www/Ligase/openhouse.html"><img alt="MCB openhouse" src="http://my-expressions.com/up_media/962/pblog/822/1113108238_open%20house1.jpg"></a><p>
Last post for today: it was MCB open house today. That is all. Ok almost all. The official web site for it sucks really bad. It seems to be some template from Dreamweaver MX 2004 but it is done really bad. They should have asked a real web master to do it. Embarrassing.
</p>
Massive portfolio project2005-04-09T00:00:00+00:00http://vazexqi.github.com/2005/04/09/massive-portfolio-project<div align="center">
<a href="http://www.flickr.com/photos/37092324@N00/33494140/" title="Photo Sharing"><img src="http://photos22.flickr.com/33494140_9a412aea48.jpg" width="500" height="398" alt="portfoliogenerator" /></a>
</div>
<p>
This is not meant to be a full documentation of what this program can do. In fact, I have not even written one yet since I doubt that anyone will find any use for it.
Basically, this is a single project file generator. It generates the necessary HTML for creating a nice looking webpage for your files. Here is a preview for it:
</p>
<div align="center">
<a href="http://www.flickr.com/photos/37092324@N00/33493065/" title="Photo Sharing"><img src="http://photos22.flickr.com/33493065_86b92cd1c2.jpg" width="500" height="386" alt="generatedpage" /></a>
</div>
<p>
So far, it has a simple GUI that probably goes against every HCI rule there is out there. Coding GUI in Java without a GUI editor is not a fun task. Adding a new UI element can easily make the layout look like crap. However, I think it is pretty clear how you would use this project generator.
</p>
<p>
You would code your project first with all the necessary files. Then you will fire up this program, include the Author, Title, Description, etc and also the files. Those files will be links to where the user can actually get to them. After that, you will save this file itself in an XML format so that you can read it again and modify it to include more files, source code, etc. Since including source code is not merely sufficient, I added the ability to generate slides for it. Those slides will be written in the Markdown syntax and then automatically converted to HTML and linked together. By that I mean that there will be Prev | Next links at the bottom right of each slide. The engine to convert from Markdown to HTML is provided by <a href="http://markdownj.petebevin.com">Pete Bevin</a>.
</p>
<p>
That is part one of the project and was completed about a month ago. The second part of the project allows the user to place comments on the individual pages themselves.
For that I will be using Ruby on Rails.
</p>
<p>
Using Ruby on Rails makes the project fairly simple. It took me some time to familiarize myself with the new methods of Rails. Currently, Rails is at version 0.11 and the last time I played with it was at version 0.9. There have been some interesting changes but non too drastic that it requires any serious relearning.
</p>
<p>
To get the second part working, we had to set up a MySQL database to store those files. That was not too hard. And using CocoaMySQL made it even simpler. However the main problem came about from the Rails model verification. It seems that every model in Rails should be able to perform some form of referential integrity check using belongs_to and belongs_to_and_has_many. However, I have yet to figure out how to do it. Without figuring out those things, deleting comments violated referential integrity and caused me a lot of headaches.
</p>
<p>
Nevertheless, I am amazed with how easy and fast it was to set up something using Rails. It make it easy to get something up and running so that you can see the results. And the clear separation between model, view and controller makes it hard for you to try to lump everything together like you would do in a PHP program. And that makes it really fun to develop with. Using Textmate helped considerably too.
</p>
<p>
Below are some resources that I have found useful while using Ruby on Rails:
<ul>
<li>MySQL</li>
<ul>
<li>MySQL Cookbook by O’Reilly</li>
<li><a href="http://dev.mysql.com/doc/mysql/en/">MySQL Reference Manual</a></li>
</ul>
<li>Ruby</li>
<ul>
<li>Programming Ruby (The Pickaxe book) by Pragmatic Bookshelf</li>
<li><a href="http://poignantguide.net/ruby/">Why’s (Poignant) Guide to Ruby</a></li>
<li><a href="http://www.ruby-doc.org/docs/UsersGuide/rg/">Ruby’s User Guide</a></li>
<li><a href="http://www.ruby-doc.org/docbar/">Ruby Sidebar for Firefox</a></li>
</ul>
<li>Rails</li>
<ul>
<li><a href="http://api.rubyonrails.com/">RubyOnRails Documentation</a></li>
<li><a href="http://rails.homelinux.org/">Four Days on Rails</a></li>
<li><a href="http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html">ONLAMP.com: Rolling with Ruby on Rails</a></li>
<li><a href="http://manuals.rubyonrails.com/read/book/5">A Guide to Testing the Rails</a></li>
</ul>
</ul>
</p>
<p>
Lastly, though I really like all the documentation and tutorials that people have contributed, I cannot wait for the book on Rails that is supposed to come out soon (within the next 6 months). Having a book that puts everything together using one writing style would make it much easier for the beginner.
</p>
3D Viewing Program2005-04-09T00:00:00+00:00http://vazexqi.github.com/2005/04/09/3d-viewing-program<div align="center">
<img alt="Siebel" src="http://photos22.flickr.com/
32845531_fa1f932162.jpg?v=0">
<br />
<small>Sample solution image</small>
</div>
<p>
This is not one of my best programs, but I am satisfied with it. The model that you see in the picture above is that of the lounge on the third floor of the Siebel building at this university. The lighting and materials need some working on but other than that it does depict the furniture rather well.
</p><p>
There are controls for you to move, rotate and zoom in very much like in Doom but I made it simple for myself and just made the controls accessible via the keyboard and not the mouse. That is going to change for the final project though.
</p><p>
You cannot see this from the picture above, but there is simple key frame animation for a blue bunny somewhere in the background. Again nothing fancy, but it shows how key frame may be done.
</p><p>
Besides the weird color choices, the only thing weird with this program is the "missing" polygons from the given model. And it did not take me too long to get the whole thing up: just a mere 8 hours with testing.
</p><small>The image above was from the course website since I had to reformat my machine and lost all the previous images. Also, fltk and libgfx do not play along well with Mac OS X Tiger.</small>
PSP: I got myself one2005-03-28T00:00:00+00:00http://vazexqi.github.com/2005/03/28/psp-i-got-myself-one<p>
My new toy. There are enough pictures of it around the net that I do not have to upload one. I am still trying to get it to work with my Airport setup. I do not have an Airport base station so I am trying to get the PSP to recognize it. Incidentally, there is an article <a href="http://www.fumanchuu.com/pspdev/">here</a> on how to set up the hidden web browser.
</p>
<p>
There are only a few games for the PSP now. So for testing purposes I went to buy Dynasty Warriors since it seems like the simplest 1 player fighting game that I can actually win at. The graphics are pretty good. Then again, I would not know how much handheld consoles have progressed because I have not been monitoring them. One of the few games that I would really like to see for the PSP would be something along the genre of Final Fantasy. I have always wanted to play Final Fantasy but the thought of sitting in front of the tv or computer to play seems a bit weird. Hopefully they will be releasing more games soon. And also some UMD writer so that I can rip some games.
</p>
<p>
The video and picture viewing capabilities do not matter much to me. The memory stick duo that the PSP uses is not going to be useful for anything else. And there are not going to be cheap since the only devices that use them are Sony devices. I uploaded some photos into the 32 MB memory stick that came with it. The results were pretty good except for the zooming which takes a very long time.
</p>
<p>
So far, the PSP does not disappoint.
</p>
Spring Break entries2005-03-24T00:00:00+00:00http://vazexqi.github.com/2005/03/24/spring-break-entries<p>
Spend time all alone for Spring Break. EOF
</p>
<p>
Though here are some interesting things that happened:
<ul>
<li><i>Had to pay $600 for a new pair of glasses</i>
<br/>
Unfortunately the pair that I own was broken by a toilet roll. I dropped the toilet roll while trying to put in on the top of the cabinet. Though the toilet roll weights only very little, the impact must have loosened the screw. I did try fixing it but I lost the screw in the process.
<br/>
Because of the way the system works here for making new glasses, I had to go for an eye examination first. It was basically the same routine testing like the ones they did back in Malaysia. However because it was done by a certified optometrist, he could charge me $50 for it.
<br/>
The lenses themselves cost $265 + $70. $265 was for the normal lenses. There is no way I was going to get cheap lenses. I had to have multi-coated anti-reflection as well as medium-index lenses. The $70 was for transition lenses.
<br/>
The rimless frame itself was about $200.
<br/>
And that is it. So even if I wanted to save money by not going anywhere, I ended up spending more money that I would have had I gone to Vegas instead. But I can also look at it this way, had I gone to Vegas and broken my glasses too, then I would have ended up spending much more.
<br/>
The new pair of spectacles will only arrive in two weeks so until then I have to make do with my repair and some super-handy super glue.
</li>
<li><i>Manga Marathon</i>
<br/>
Decided to read some manga that I would not have read if I did not have the time. I had always wanted to read Inuyasha because it was a very well-developed manga. And it was really long too. In fact it is one of the longer running mangas that I know. It is currently at its 400th chapter. In fact, Inuyasha is not like most of the manga I am used to. It does not involve fighting tournaments and all the usual stuff. I was really impressed by how the illustrator weave the different characters together. And she has successfully made the story that much more interesting. The number of main characters that she choose was just right too. It was neither too many nor too little and each had the chance to show their character fully. The anime is rather good too.
Also she keeps you in suspense and does not reveal too much of what will happen next.
<br/>
But I also decided to read some romance/ comedy manga. And those prove to be very enjoyable too. It was a nice experience compared to the other types of manga. Besides, the fact that these novels are usually short make them fun to read too. I just spend around 6 hours to finish the whole series.
<br/>
There are of course those that are really long. But they are mostly just to satisfy their loyal fans. I do not really enjoy those since it seems that the story has been protracted just to make the fans happy. Thus the story feels boring because they have to keep introducing new characters. And they are stalling the (inevitable) ending.
<br/>
Also, despite some negative reviews for this manga, Love Hina was a really nice read.
I just finished it an hour ago and it was rather satisfying. I mean there were ridiculous moments but its length was just right. There were no unnecessarily drawings just to make the manga longer. And there weren't too many characters as well. Also the fact that it revolves around the live of students trying to get into a top university makes it slightly pertinent to my current life. The author was also kind enough to write that this is a story and it is not so simple to actually get into a top university.
<br/>
I learned a bit more about how the exam system in Japan works too and it was rather interesting. Having to take public exams and the the university's own entrance exam to get in. I was also to learn about some of the festivals that they celebrate. And the fact that some students actually go to dormitories to study even though their house might be near the place so that they can concentrate.
<br/>
I *would* probably recommend Love Hina to most people. It is really funny. And it has a nice ending. The fact that the characters were not ridiculous looking was also a nice point for it. I really hate manga where the characters are a bit too disproportionate.
</li>
<li><i>Ruby Rocks</i>
<br/>
It is set to become one of my favorite languages. It seems so lightweight. And the fact that is allows these little notations such as
<blockquote>
def myName=(_name)
<br/>
@name = _name
<br/>
end
</blockquote>
makes the language so much more interesting. For those not familiar with Ruby, the above create a setter for the class variable @name. The use of the = sign is just plain genius. In C or Java you would probably call the method setMyName. These simple things do not exist in other languages. It would seem that the Japanese creator actually took some time to think of subtle issues like this. The use of ! as in !gsub for string substitution that replaces the original string and also the use of ? for boolean is a nice change from having to say isValid.
<br/>
Because Ruby's creator is a Japanese, I believe he takes the time to focus on the subtle points. As native English speakers, we might take certain things for granted and do it just as how the other languages have done it but Ruby is really different because of its notations.
</li>
</ul>
</p>
Buggy Dock?2005-03-24T00:00:00+00:00http://vazexqi.github.com/2005/03/24/buggy-dock<a href="http://dan0597.urh.uiuc.edu/archives/image/dock.png"><img alt="dock.png" src="http://dan0597.urh.uiuc.edu/archives/image/dock-thumb.png" width="461" height="36" /></a>
<p>
This has actually happened in the past. However it is the first time that I have captured the event in picture.
It is not easy to reproduce this bug. I belive that the only steps that can cause it involves dragging a folder quickly to the dock while removing another one. It is kind of hard to explain and I am not really sure how it happens.
</p>
<p>
So far I have not seen any other replication of this. By the way, the Finder icon will remain that way until you kill the dock via Activity Monitor or via kill -9 (pid for dock).
</p>
<p>
In this current state, the Finder icon is practically useless. If you run any full screen programs, the stupid Finder icon is the only one visible. It does not go into hiding with the dock.
</p>
My Java version of PixelNHance2005-03-18T00:00:00+00:00http://vazexqi.github.com/2005/03/18/my-java-version-of-pixelnhance<div align="center">
<a href="http://www.flickr.com/photos/37092324@N00/33494138/" title="Photo Sharing"><img src="http://photos22.flickr.com/33494138_5624757c09.jpg" width="500" height="336" alt="pixelnhance" /></a>
</div>
<p>
This is my latest creation for my cs498 class. The basic requirement was to create a program that is capable of loading an image file and then perform some geometric transformations on it. After that, write the modified image to a new file. The project was to be done in Java. (This was a good idea since other GUI toolkits do not enjoy the large audience that Java AWT and Swing have).
</p>
<p>
Anyway, I did some extra things such as adding a tabbed pane and adding filter capabilities to the program. It was not that hard since most of the code for the normal filters such as sharpen, blur, invert, posterize were already available online. The picture that you see above has its original image applied with a invert filter.
</p>
<p>
The inspiration for the layout of the program came from a program called PixelNHance by <a href="http://www.caffeinesoft.com/">Caffeine Software</a>. Fortunately, the company discontinued this program and I think I am allowed to "emulate" some of its filters. As you can see in the picture above, there is a line that shows how the original and the modified image look. I really like this feature since you can compare the transformation side by side.
</p>
<p>
There are still some rough edges to the program. For instance, I am not able to perform certain sequences of filters. Performing those "dangerous" sequences will cause my program to hang. I believe that it has entered into some illegal state of execution. That will be my hunch for debugging it.
</p>
<p>
Anyway, I learned a few things about programming GUI in Java.
<ul>
<li>It is not wise to call removeAll(). This removes all the containers too. You probably want to call getContentPane().removeAll().</li>
<li>Sometimes it is necessary to go a few calls up to retrieve the right parent container. You might need to do myComponent.getParent().getParent().getParent().getParent()</li>
<li>To really get the component to repaint itself, sometimes calling repaint() is not sufficient. You may need to call invalidate(), validate(), repaint() in that order</li>
</ul>
</p>
<p>
Interestingly, I am also curious what is the "right" way to program UI in Java. I have not seen a large UI program for Java. Is it better to use anonymous inner classes as action listeners? Or is it better to create private inner classes? Is it better to lump all the UI into one main class or try to break them into different subclasses even though they are pretty similar? These are the questions I have. And so far there is no article that answers them.
</p>
Cooking competition in space?2005-03-14T00:00:00+00:00http://vazexqi.github.com/2005/03/14/cooking-competition-in-space<p><a href="http://news.bbc.co.uk/2/hi/asia-pacific/4331979.stm">BBC NEWS | Asia-Pacific | Malaysians plan Asian space food</a>: "Malaysian scientists have already conquered most of the technical hurdles involved in sending someone into space. But one major obstacle still needs to be overcome."</p>
<p>
This had better not be real. In times when people are sending astronauts to space to actually try manufacturing cures for diseases and such, my country plans to waste a fair amount of money to investigate how to prepare local cuisines in space?
</p>
<p>
What bugs me more is the fact that the reporter lists this as: one major obstacle. What major obstacle? Are we the only ones who cannot survive in space without tasting something local for one week?! The more I read it the more I think that this report might be insinuating this idea and making fun of whoever proposed this. It is not the first time that a British tabloid has reported something like this.</p>
<p>
Also, the lack of an authoritative source to cite for his comments does not lend credence to this already preposterous article. While I do believe that someone living in Malaysia is capable of suggesting this absurd mission, I am even more in shock that someone actually reported it on <a href="http://news.bbc.co.uk">new.bbc.co.uk</a>. There seems to be no valid reason why someone who want to spend money to investigate how to prepare food in space. I know that not too long ago, someone proposed space tourism so is Malaysia trying to pioneer space cooking competitions?
</p>
<p>
I cannot imagine what people will think of next. On the other hand, if we are indeed that feeble to not be able to survive without our local food, then is it any wonder why we are never part of any serious space expedition?
</p>
<small>Usually I do not add new entries on a Sunday night but the article seems to be too mind-boggling that I want to have a record of when I first heard of this nonsense. </small>
<br/>
<small>I refrain from saying anything about the last paragraph because it is a sensitive issue. My opinions on that will never been seen by public eyes. </small>
TextMate is fairing well on my machine2005-03-11T00:00:00+00:00http://vazexqi.github.com/2005/03/11/textmate-is-fairing-well-on-my-machine<p>
BBEdit is not being used much anymore. GVim is still unbeatable but TextMate is expressing a lot of potential. Recording macros in TextMate is simple and intuitive.
I just hate its key bindings. But there is nothing that can be done about that. Not everyone is going to appreciate it if TextMate uses mode editing just like Vim.
</p>
<p>
What I like about TextMate so far:
<ul>
<li>A real text editor for programmers.</li>
<li>Clean interface for writing macros, snippets, etc.</li>
<li>An active developer that listens to his users.</li>
<li>A rather active user base that is eager to create new bundles for different languages. I believe that there are more language bundles available for TextMate as compared to SubEthaEdit.</li>
</ul>
</p>
<p>
Some of my gripes with it:
<ul>
<li>Poor documentation</li>
<li>It is not free.</li>
<li>Some weird bugs with using it as an external editor for MarsEdit and Transmit.</li>
<li>Using it means using key bindings that are limited to a non-cross platform text editor.</li>
</ul>
</p>
<small>Note: I have replaced both <a href="http://rsug.itd.umich.edu/software/fugu/">Fugu</a> and <a href="http://www.webdav.org/goliath/">Goliath</a> with the excellent Transmit 3.02. It is just excellent.</small>
Ruby & Rails: Resources2005-03-11T00:00:00+00:00http://vazexqi.github.com/2005/03/11/ruby-rails-resources<p>
I should really spend more time learning Ruby and Rails. I am really hooked by the claims that people are making. Here are two newly discovered resources:
<ul>
<li><a href="http://www.slash7.com/">slash7.com</a></li>
<li><a href="http://rails.homelinux.org/">rails.homelinux.org</a></li>
</ul>
</p>
<p>
It does seem that I am easily swayed toward some new technology depending on how passionate its users are talking/ blogging about it.
</p>
If this is the reason that Eclipse is so slow on OS X...2005-03-11T00:00:00+00:00http://vazexqi.github.com/2005/03/11/if-this-is-the-reason-that-eclipse-is-so-slow-on-os-x<p>
I have mentioned before that I am not too impressed by the speed of the Eclipse IDE. However I have always thought that it was because of my slower processor. Today, I came across this <a href="http://cld.blog-city.com/read/1126337.htm">article</a> by Charles Ditzel. Ditzel works for Sun so it is unlikely that his article might be a little bias. But it does contain some truth to it. And for a more serious comparison between SWT and Swing, Ditzel has also written a nice introduction <a href="http://cld.blog-city.com/read/15428.htm">here</a>.
</p>
<p>
SWT has been toted as a better subset of Swing. It does not have all the capabilities of Swing but what it has is supposed to be simpler and cleaner. Personally, I have not developed anything using SWT yet since doing so does not benefit me much. To me SWT and Swing just look plain ugly. When I use them, I do so because they are "portable". If I am going to do any serious GUI application, I need to use the default toolkit for the OS. Any Java application written in Swing or SWT just does not look as sleek as a native Cocoa application. I believe that Windows user feel the same way about Swing applications.
</p>
<p>
Furthermore, there is no way that Swing will ever come to the speed of the native GUI toolkit. So, if I were to consider developing serious GUI stuff, it mandates using the native OS toolkit. Also, using the native toolkit makes it look identical to what other GUI applications look like on the OS. I have yet to see a really successful commercial product for the normal end user that is written in Swing or SWT. Some might claim that <a href="http://azureus.sourceforge.net">Azureus</a> comes close to that. Frankly, I disagree. Azureus looks plain ugly. The only advantage for using a platform-independent GUI toolkit is to make developing applications easier for open-source projects.
</p>
<p>
For the time being, I have not tried apple's bindings for using its GUI with Java. I am not sure how complicated it is going to be. But I am digressing...
</p>
<p>
So anyway, the reason that I am not so satisfied is because Ditzel claims that SWT is optimized for Windows and runs sluggish on the Mac and Linux. That is just plain horrendous.
</p>
<p>
If time permits, I might take a look at Eclipse's other competitors:
<ul>
<li><a href="http://www.netbeans.org/index.html">NetBeans</a></li>
<li><a href="http://www.intellij.com/idea/">IntelliJ IDEA</a></li>
</ul>
</p>
<p>
But of course, I will not ditch Eclipse just because it is running SWT. It was just nice to know SWT is probably the cause of its sluggishness and not my machine. And Eclipse has some nice features not found in other IDEs:
<ul>
<li>You get plug-ins for almost all the popular languages (Python, Ruby, C)</li>
<li>You get great re-factoring capabilities with Java.</li>
<li>You will definitely see more developers writing plug-ins for Eclipse since it has excellent support for those.</li>
</ul>
</p>
<p>
As a side note, my class mate, Kyle, pointed out to me that the name Eclipse was chosen because it was supposed to "eclipse" out the Sun and thus block all other competition. A handy fact to know.
</p>
Textmate...the *missing* editor?2005-03-04T00:00:00+00:00http://vazexqi.github.com/2005/03/04/textmate-the-missing-editor<p>
The latest beta of <a href="http://macromates.com">textmate</a> looks more promising. The fact that they got rid of that stupid evil looking robot icon also makes it more appealing.
</p>
<p>
I am going to test it out for the next 30 days and see how it goes. There seems to be no way to escape seeing it used on the mac for Ruby development.
</p>
<p>
But here are a few things that I do not like about it from glancing at it:
<ul>
<li><i>You have to read the manual to find out how to use it properly.</i>
<br/>
This is not vim but you still have to read the manual to find out how to put it to good use or else you would not be using any of its features.</li>
<li><i>39 euros</i>
<br/>
Hmmm.... that is rather pricey.</li>
<li><i>Weird colors?</i>
<br/>
I really want to change the color scheme asap. But I do not see a fast way to do it so that it associates that color scheme with the file type.
</li>
<li><i>Line numbers</i>
<br/>
I <em>need</em> line numbers on the left margin.</li>
<li><i>The tabs</i>
<br/>
Contrary to macromates claim that the tabs look like real tabs, I still feel that they look disjoint. The tabs do not seem to be attached to the current document.</li>
</ul>
</p>
<p>
I could go on and on but I better stop before I write too much and convince myself that textmate is bad.
</p>
It was my birthday...2005-03-04T00:00:00+00:00http://vazexqi.github.com/2005/03/04/it-was-my-birthday<p>
My girl friend made me a <a
href="http://dgrin.smugmug.com/Tutorials/Photography-Projects/Make-a-Life-Poster-with-iPhoto/1080728_rd2Bqg">life poster.</a>
</p>
<p>
And also threw some surprise party for me during my programming group's weekly meeting. The only one that was surprised was just me; the rest of them were all part of the ploy.
</p>
Chambana-Roids!2005-03-04T00:00:00+00:00http://vazexqi.github.com/2005/03/04/chambana-roids<div align="center">
<a href="http://www.flickr.com/photos/37092324@N00/33493064/" title="Photo Sharing"><img src="http://photos22.flickr.com/33493064_8a4c9df8aa.jpg" width="432" height="500" alt="chambanaroids" /></a>
<br />
<small>This is the sample solution!</small>
</div>
<p>
This is my first real use of Xcode to write something. And I can say that Xcode is not as good as I would have hoped. Its code completion is pretty bad. It could be that I am using it wrongly or the fact that I am just spoiled by Eclipse. I believe that it does a non-intelligent form of code completion that just cycles alphabetically through all the classes that you have included using #include statements. While I believe that there is nothing bad about this, the way that the code completion pops up is pretty annoying. Moreover if you accidentally hit the right arrow key, the code is pasted straight into the document. Also, if you type in a function signature, it tries to guess what the function prototype is and then pastes the whole thing as <em>TEXT</em>. There is no way for you to tab between the previous and next arguments to the function. This is just completely retarded.
</p>
<p>
At least it saved me some time from having to go to the command line and execute the make command every time. Then again, its build is not spectacular. In fact it is very slow. And it gives all the warnings about pre-binding failing. Well enough of Xcode.
Let us talk about the program.
</p>
<p>
The screenshot above is of the asteroids game that we had to write for our graphics class. The graphics was done using openGL and the asteroids and space shuttle was modeled using some primitive form of Newtonian physic; they had angular velocity, translational velocity, acceleration and mass. That also means that the asteroids have both rotational and translational momentum as they moved around. I also discovered that the author of this program could have stolen the idea from <a href="http://www.soi.city.ac.uk/~rob/"> here.</a> The link seems to have a more traditional re-creation of the asteroids game using lines instead of organic images.
</p>
<p>
Amazingly this game did not take too long to write. Other than wasting 4 hours trying to figure out what was wrong with my shuttle's maneuverability only to recall that openGL uses degress instead of radians for its angles, the project went on pretty smoothly. I did try to implement some primitive form of collision detection and it was not too hard at all. Coding it all during one Saturday afternoon was a nice experience.
</p>
<p>
So, I am pretty happy with it. Though had I started earlier, I might have had more time to implement more features. Either way, I think it was a nice excursion into openGL and once again facing the horrors of c++ programming. I am not a big fan of templates in c++ so I do not like using their parameterized data structures.
</p>
ECE390: Snake Game2005-02-25T00:00:00+00:00http://vazexqi.github.com/2005/02/25/ece390-snake-game<div align="center">
<a href="http://www.flickr.com/photos/37092324@N00/33494142/" title="Photo Sharing"><img src="http://photos22.flickr.com/33494142_930e9ca3dc.jpg" width="500" height="271" alt="snake" /></a>
</div>
<p>
One of the few ECE classes that I enjoy is ECE390. That being the only reason why I volunteered to be an undergraduate TA for the class. As a TA, sometimes I have to write a machine problem for the students. For their third machine problem this semester, I decided to write this game for them. It is a simple game of snake that involves interrupts, text video mode and data structures; all done in x86 assembly.
</p>
<p>
Since this is a class assignment, I will refrain from divulging too much about it. Suffice to say the original version that I completed in about 6 hours has about 1050 lines of code. That is a lot of code for assembly. So to help maintain the students' sanity, we decided to trim the amount of code they have to write by half. I would have wanted them to write the whole thing because there are subtle points that can only be illustrated by coding. However, since the assignment still involves writing 19 subroutines after the code trim down, I should not demand more.
</p>
<p>
What I learned while coding this machine problem was the fact that you cannot escape from the code a little test a little mentality. In fact it makes the program that much more fun and less frightening. It is hard to write everything without testing. Even more so when it involves replacing the interrupt vector table with your own interrupt service routines. Do this wrong and it is almost impossible to debug.
</p>
<p>
Here are some details about the game:
<ul>
<li>The snake is implemented using a queue. Using a queue gives the students exposure to how data structures are done in assembly. And it helps them see the real stuff behind the abstraction that we have with higher level languages.</li>
<li>The user designs the layout of the game with the mouse before playing. The walls in the picture above was generated by me before playing the game.</li>
<li>All the graphics is done in text mode. This is not even the popular mode 13h. So although the graphics is crude, it fits nicely for this game since the snake is supposed to be squarish.</li>
</ul>
</p>
<p>
I can think of a few improvements for this program though:
<ul>
<li>Make the snake wrap around the edges. Currently, if you hit the gray border, your snake dies. It would be cool to be able to get the snake to wrap around the edges.</li>
<li>Let the user save the design onto a file that can be laoded. That way the user can actually generate complex mazes and save them for later.</li>
<li>Improve the I/O event loop. The motion of the snake is a bit jerky and can be improved by handling the event loop in a more efficient manner.</li>
</ul>
</p>
<p>
Still this was a simple program and it is my first assignment for my students. We shall see what they think of it. At least they can actually "play" with this game.
</p>
Of Ruby and its "poignance". And a bit of Rails thrown in for good measure.2005-02-19T00:00:00+00:00http://vazexqi.github.com/2005/02/19/of-ruby-and-its-poignance-and-a-bit-of-rails-thrown-in-for-good-measure<p>
Ruby seems to be a nice language to learn. Though I was planning to learn Python at first because it seems to have a much stronger user group, the past few weeks brought about many different encounters with Ruby. The first time I saw it after a long time of not paying attention to it was on 43things.com. Learn Ruby was one of the most highly rated items to do. Then it was when someone in my CS498 class did his presentation on it. Then it was when I saw it on www.rubyonrails.com. Finally I had no choice but to give myself a reason for learning it.
</p>
<p>
And then comes the reason, we will be using RubyonRails for our CS411 database class project. It <i>was</i> my suggestion. For short of any better ideas, we are going to emulate the site 43things.com and without much creativity, call ours 42things.com. And in case you are wondering, our group is called MySQuirreL for a lack of a better name (actually the name was thought up by Mark and it was actually quite creative). Since we are doing this for academic purposes, we hope that we will not be sued. So, with the perfect and unavoidable reason of learning Ruby, I decided to buy the book: "The Pragmatic Programmer's Guide to Ruby". The first edition of this book is available online but it only talks about Ruby 1.6. The current version of Ruby is 1.8.2 and it has undergone substantial changes.
</p>
<p>
While waiting for my book to arrive, I have also been perusing an online guide written by someone by the name of <em>why</em>. I have not found out anything else about his identity and neither would I bother to. Anyway, his poignant guide to ruby can be found at <a href="http://poignantguide.net/ruby/">why's poignant guide to Ruby</a>. This book is written in a very unconventional way that might piss people off. I had a hard time reading this book the first time I saw it. However I decided to give it a second chance. The comic strips in there might throw some readers off. Personally I did not get all why's jokes.
</p>
<p>
The fact that why actually tries to explain object-oriented programming in that manner is quite laudable. While it might annoy some of the purists, it might be easier for the beginner. There is this mistake in chapter 4 though:
<blockquote>
I don’t think reverse is going to cut it. The authorities only need to put a mirror to “airegiN fo noissessop ekaT.” Bust us when starmonkeys start to touch down in Lagos.
</blockquote>
I will probably e-mail him (or her) on that. You do not use a mirror to read something that has just been spelled backwards. Again, his work is praiseworthy.
</p>
<p>
I have also been following the resources at <a href="http://www.rubyonrails.com>rubyonrails.com</a>. Watching the videos was helpful. I would advice anyone familiar with programming to actually watch the video where David explains why he design RubyonRails the way he did. And how it is implementing the model-view-controller design patten. Also, the following <a href="http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1">article</a> on the O'Reilly website is helpful on how to get multiple tables set up.
</p>
<p>
Well that seems to be a decent introduction into my foray with Ruby and RubyonRails. I would encourage anyone reading this to actually go and tinkle with it. For a web application framework setting it up is pretty easy. And its simplicity might well be what it needs to penetrate something dominated by .asp and .jsp pages.
</p>
What the hell is squeak?2005-02-13T00:00:00+00:00http://vazexqi.github.com/2005/02/13/what-the-hell-is-squeak<p>
Latest interest: <a href="http://www.squeak.org/">Squeak</a>.
I want to say more but I cannot. At least not until I meet someone who can actually tell me what it is. Running it seems to show that it is a special environment for coding. Think of it as an uber-environment where objects are created and instantiated on the fly. All using Smalltalk.
</p>
<p>
Actually my interest was piqed by an article about Alan Kay on the recent <a href="http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273">ACM Queue</a>.
</p>
Objective-C and Cocoa Documentation2005-02-13T00:00:00+00:00http://vazexqi.github.com/2005/02/13/objective-c-and-cocoa-documentation<p>
This is a post by a person who might be very ignorant of things. So if you feel that I am wrong please correct me.
<br/>
<blockquote>
Cocoa documentation is pretty bad. It is nothing compared to Java. In fact I believe that it is even worse than C's. And the [ ] is beginning to get to me.
</blockquote>
</p
<p>Actually let me rephrase myself. The provided NS libraries are actually very powerful but their syntax is horrible. Someone should really rewrite the entire documentation.
</p>
<p>
I hope I find something that suggests otherwise. I really like interface-builder and I understand most of the advantages of using key-value observing (KVO) and key-value binding (KVB) but the syntax and documentation just gets to me.
</p>
<p>
Also code completing in Xcode is abysmal. End of story. Another point that I hope Xcode 2.0 will rectify. So far the only promising thing about <a href="http://www.apple.com/macosx/tiger/xcode.html">Xcode 2.0</a> is the Java code completion and the class diagrams. I can't wait to see how it compares to <a href="http://www.eclipse.org">Eclipse</a>.
</p>
CS498: An interesting class2005-02-13T00:00:00+00:00http://vazexqi.github.com/2005/02/13/cs498-an-interesting-class<p>
Subversion is really something that promotes good coding habits. Not that I have had to revert to any previous versions yet but the fact that I have the luxury of doing so is really assuring. Moreover, it actually encourages you to document your progress. The Subclipse plugin for Eclipse is really nice too. And that makes development that much more enjoyable.
</p>
<p>
Of course even with all those tools, without an interesting project there is nothing much that you are going to use them for. That is where CS498 comes in. I really do like the weekly projects that specify certain requirements in a non-rigid manner. There will be a core requirement for the project that week but you are given a liberal amount of choice in how you choose to implement it. So far the projects have been very open-ended and they do seem interesting. Also CS498 is known as programming studios. As its name suggests, you write programs for that class. A lot of code.
</p>
<p>
Sad to say, I am the kind of person that find it hard to do some coding without having someone to actually acknowledge my work. So far none of my peers actually code for "fun". Any coding would be tied to a particular class or MP. I need to be able to discuss code with people to code properly. In short, I need someone that I can talk as I talk to get feedback. Thus this class is just perfect since we have weekly discussion sessions where people get to present their code and we get to comment and ask questions. Don't ask me why I do not bother joining an open source community. It is probably because I do need to see my colleagues face to face.
</p>
<p>
So far I learned that there are definitely a lot of different way to do things. And that I am most comfortable in Java and C. Some other people are more adventurous and have taken upon themselves to dwell into more exotic languages like Ruby, O-Caml, Lisp and maybe a shot at .NET. This presented a new and interesting challenge for myself to learn such languages. I have always wanted to learn Python because I think that it is a nice language for everyday simple programming needs. Being a scripting language, it has the simplicity of being interpretable from the command line. Java is really nice for doing all sort of things but to use it for simple tasks might be overkill. Then again, how do you define simple? What if you need to make the project bigger? Would Python still be a feasible language to program in?
</p>
<p>
Also it is from this class that I have learned that my software engineering class has taught me things that most people are not even aware of. For instance, I discover that whenever I am coding in Java, I tend to rely on Junit tests. The tests just make so much sense to me. I will be honest and admit that most of the tests that I write are not comprehensive enough to be considered industrial standard. However, they are adequate for my needs. Basically I use them to ensure that as I refactor, I do not break any functionality. So far they have served me well. And as a test-infected person might say: Running those test and seeing the bar go green just gives me a boost of confidence.
</p>
<p>
It will be interesting to see how this class turns out. I believe that people who are serious about getting a job at a company take this class and find out if they really like programming or not. Programming MPs and programming these kinds of assignments are a different game all together.
</p>
<p>
PS: The current project we are working on now is a portfolio generator. You open .xml files and manipulate them and then output a website for you. This website can be used by prospective employers to see what kind of programming you have done. It is an interesting assignment and it is open to what you want to do with it. Basically I went a bit overboard and embellished it with a nice GUI. Also I plan to add sftp support and of course <a href="http://www.43folders.com/2005/02/in_praise_of_ma.html">Markdown</a> support so that I can write some simple slides and include them with the portfolio.
</p>
How many lawyers to change a light bulb?2005-02-05T00:00:00+00:00http://vazexqi.github.com/2005/02/05/how-many-lawyers-to-change-a-light-bulb<p>
Q: How many lawyers does it take to change a light bulb?
A: Whereas the party of the first part, also known as "Lawyer", and the
party of the second part, also known as "Light Bulb", do hereby and forthwith
agree to a transaction wherein the party of the second part shall be removed
from the current position as a result of failure to perform previously agreed
upon duties, i.e., the lighting, elucidation, and otherwise illumination of
the area ranging from the front (north) door, through the entryway, terminating
at an area just inside the primary living area, demarcated by the beginning of
the carpet, any spillover illumination being at the option of the party of the
second part and not required by the aforementioned agreement between the
parties.
<br />
The aforementioned removal transaction shall include, but not be
limited to, the following. The party of the first part shall, with or without
elevation at his option, by means of a chair, stepstool, ladder or any other
means of elevation, grasp the party of the second part and rotate the party
of the second part in a counter-clockwise direction, this point being tendered
non-negotiable. Upon reaching a point where the party of the second part
becomes fully detached from the receptacle, the party of the first part shall
have the option of disposing of the party of the second part in a manner
consistent with all relevant and applicable local, state and federal statutes.
Once separation and disposal have been achieved, the party of the first part
shall have the option of beginning installation. Aforesaid installation shall
occur in a manner consistent with the reverse of the procedures described in
step one of this self-same document, being careful to note that the rotation
should occur in a clockwise direction, this point also being non-negotiable.
The above described steps may be performed, at the option of the party of the
first part, by any or all agents authorized by him, the objective being to
produce the most possible revenue for the Partnership.
</p>