.::output >> /dev/null::.

where otherwise good ideas go to waste

Of Ruby and its "poignance". And a bit of Rails thrown in for good measure.

Posted by Nicholas Chen Sun, 20 Feb 2005 07:56:40 GMT

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.

And then comes the reason, we will be using RubyonRails for our CS411 database class project. It was 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.

While waiting for my book to arrive, I have also been perusing an online guide written by someone by the name of why. 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 why's poignant guide to Ruby. 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.

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:

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.
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.

I have also been following the resources at article on the O'Reilly website is helpful on how to get multiple tables set up.

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.

Posted in , , |

CS498: An interesting class

Posted by Nicholas Chen Sun, 13 Feb 2005 08:30:07 GMT

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.

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.

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.

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?

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.

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.

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 Markdown support so that I can write some simple slides and include them with the portfolio.

Posted in , |

Why books that have websites are always better books

Posted by Nicholas Chen Tue, 18 Jan 2005 11:14:02 GMT

This is a generalization but so far it has served to be a rather accurate one. I like to use books that are written by university professors. The most obvious reason being that the books are written by people who know how to teach and what it is that they are teaching. Teaching from a book is not something that everyone can do. Indeed many have failed at this task. However, not every professor can be a good writer either.

Generally, for books that are meant to instruct and educate on subjects that are more theoretical than just being practical (compare a book about OpenGl and a book about computer graphics or a book about SQL and a book about database system), the professors do it the best. They have been teaching for so long and they know how people learn this stuff. In short, books that are supposed to teach you the foundations of the fields must be written properly.

Another observation I have made is the fact that good books have websites. And the websites are hosted on the university pages. Moreover those websites are updated frequently. This shows that the author is willing to take the effort to maintain the website himself or herself. This dedication to his or her work implies that the author is not out to get money for his book. Moreover it shows that the author takes pride in his or her book. Books that have commercial websites are generally useless. Websites that are under the publisher's domain are generally just thrown together and do not contain anything useful. These websites are seldom updated and contain only the sparsest of materials.

On the other hand, websites that are maintained by the professors themselves are useful. They usually have the latest lecture notes and list of errata. And also they have a comprehensive list of supplementary materials. This list is particularly relevant for books on CS since the field changes rapidly. On these same websites, you can also find the views of the professor on matters that might not be directly related to the book. A good writer is always finding new things to write about. A good sign that the author is a good one is to check when was his latest writing. It need not be a new book but it should be an article that he has written by himself. The article could be something simple, maybe discussing the issues of nature. The point is: people who write in their free time are always better authors. They write because they have strong feelings about things and are passionate about sharing them.

It is even better if the university that the professor comes from uses that book too. And, of course, it will be excellent if the professor is teaching that class too using the same book. I am usually wary of books that have undergone many editions yet the professor himself or herself has not been using that book to teach. Changing chapters around is not a good reason to come up with a new publication. There is no reason to come up with a new edition unless you have discovered a serious flaw with your previous edition. In fact, books that have new editions each year are generally the most useless books on the face of the earth. The authors are probably under pressure from the publishers just to come up with a new book. Pity those poor students who own the worthless books and cannot even sell them now.

Good books always come together with excellent materials. They do not include a CD that is not necessary. Why include a CD unless you are fairly sure that the material is hard to obtain? Especially in the field of CS, whatever is on that CD is probably obsolete by the time the book ships. So instead of having a CD, maintain a website instead. By excellent material, I mean that the book contains a list of references at the end of each chapter. It also contains certain features that help you learn. For instance, some icons to quickly identify important information. And inserting a line of joke or two between the text is always a good idea. Authors with a sense of humor can make the material fun and enjoyable. Of course the purpose of the book is still to read like a book so do not make it so informal until it reads like it was just a recorded version of a lecture.

Furthermore, I also like reading the preface to the book. I like it when the author mentions how the book is structured and why he or she chose such a methodology for presenting the book. A preface that describes what the book teaches and not why or how it is done is not very useful: I can find out what the book teaches through the table of contents. While reading the book, I like finding out if the author really exercises what he or she preached in the preface.

Last but not least, authors that are considerate will ensure that they do the following:

  • Put the diagrams on the same page as the paragraphs that describe it to minimize page flipping.
  • Always finish the last sentence of the page on the same page so that the reader does not need to flip over to the next page.
  • Write in short simple sentences.
  • Leave some margin on the side for the reader to take notes.
  • Use color only where it actually serves to illustrate things better. Having the titles appear in blue is not really useful.

In short, those are the trends of good books that I have personally witnessed. Your personal experience with books will vary but I am fairly certain that if you like to read and learn from books, you will agree with me on some of the things I mentioned.

Posted in , , | no comments |

2005: An experiment in being productive (with a bit of GTD thrown in)

Posted by Nicholas Chen Sun, 02 Jan 2005 07:55:53 GMT

I have decided to make 2005 the year that I try the most software/ techniques to stay productive. Being productive is a subjective term, so I had better define what it means to me. I just want to ensure that I have all my information where I want it and when I want it. In a nutshell, productivity is efficient information management. Only with efficient information management can I be prepared to take on all the tasks and projects that 2005 holds.

I have been reading a lot from 43 Folders. Merlin, who maintains the site calls it the art of Getting Things Done (GTD) after being inspired by this book from David Allen Getting Things Done: The Art of Stress-Free Productivity. I finally went to order it today from Amazon.com together with another book I have been planning to read: Mind Hacks (more on that in another future post). Since the book takes about 5 days to get to me, I decided that even before reading the book I will outline what I plan to do and then compare it to what David Allen says. Of course, what I plan to do has been slightly influence by GTD since I have read some of the things on the web about it.

I have invested in a moleskine pocket-sized notebook which I intend to carry around with me whenever I am out. I have a Palm Tungsten but I decided that it will be more convenient to carry a notebook around. Why? By using the Palm I am limited to taking notes using Graffiti; though I can write pretty fast with Graffiti, it still does not seem natural to me. Moreover, I feel that a notebook will allow me to jot things down as quickly as possible. I will be using this notebook to primarily jot down notes that come to mind and also include sketches (something that is limited in a Palm even when using the Notes application). Since I will be carrying my iPod with me most of the time, I can easily access my address book and schedule. Whatever needs jotting down will be quickly recorded down with pen and paper before it is forgotten: Document it or it is lost! or The faintest ink is better than the mightiest memory!

Anything that I read will also be jotted down now for permanence. This can involve writing it down in my moleskine or just writing things down within the pages of the book. Important quotes will be transferred to the computer so that I can search for them quickly. I will continue to maintain my text file of interesting fortune messages. Here is an excerpt:

A is for awk, which runs like a snail, and
B is for biff, which reads all your mail.
C is for cc, as hackers recall, while
D is for dd, the command that does all.
E is for emacs, which rebinds your keys, and

When I am on my computer, I will be storing whatever websites that I am interested in using bookmarks. And if I find a particularly interesting article, I will store it inside StickyBrain. Too often have I encountered the frustration of not being able to locate that bloody article when I need it even though I can remember what website it is from. Because certain articles may seem important but then lose its importance over time, I will be keeping them inside one main folder in StickyBrain first. And then I will look at them two weeks from now and see whether they should be moved into their own folders. Else that article would be gone for good. This is of course a dangerous situation but it is also another of my methods for GTD: if the article has not been touched within 3 months, it is probable that you will not use it and it will be obsolete when you need to use it.

Using the two methods above, I hope to be able to quickly store what I need and retrieve it easily in the future. When I am not near a computer I will be using my moleskine and when I am near one I will be using StickyBrain. And when I am on a computer that is not my own, then I will be using plain text files that I will send to my gMail account or just sftp them over to my computer. This combination seems to be the best. Writing something down gives it a sense of permanence and having it on my computer whenever possible will allow me to quickly search for the article. And the best (or worst) news is that any article that I have a comment for will quickly be posted to this blog using the MarsEdit bookmarklet. I will be expecting a lot of new posts to this blog.

For my classes, I will be using the large-lined notebook that I have been using. I will continue to meticulously record the date I took the note on the top right corner. And I will jot down class notes using a pencil (since it is easily erasable). When I next review them I will be using a pen to jot down future thoughts. Homework assignments will now be done using separate pieces of paper and not by tearing them from my class notebook. This helps the pages from finishing too quickly and hopefully it does not leave me with more than one notebook for each class I am taking. I particularly dislike this because then I have to use two notebook while revising. I will probably not be using PowerPoint files to jot down my notes anymore since I can still write and illustrate faster than I type. So, I will make it a point to try to print out all the lecture materials for that lecture beforehand. In the event that I do take notes for a class, maybe one that has extensive online materials or I am reading from an article, I will be using OmniOutliner.

Moreover I will be storing all the articles I come across on the web in the respective class folders which I will create. They will either be organized by date, lecture, or subtopic, whichever is more convenient. This files will be backup and should be available on some shared folder which should be easily accessible.

Those steps should take care of information management. I am still looking for some method that will allow me to quickly access all my information and synchronize them over multiple computers. Right now, .Mac seems to be one way but it is limited to macintosh machines. Tasks seems to be a good program to try out but I find its user interface leaves much to be desired. And it does not synchronize with the tools that I am currently using. And I am glad that MovableType supports posting from an external browser using its web interface. So I am still able to quickly recored my thoughts on some site before I forget.

Another thing that I will be doing would be using more "tasks" in my to-do lists. It seems that having a phrase like "complete mp1" is direct and understandable. However, completing mp1 is not a task, it is a project! Tasks are things that can be completed within an hour or so. Breaking "complete mp1" into tasks would of course mean more typing but it makes the current task that needs to be done more tangible. So I am going to try that out.

My iCal and AddressBook will now be as updated as possible so that all data will be synchronized across all my machines. I hope that Mac OS X 10.4 Tiger will bring about better .Mac synchronization.

My desktop shall remain as clutter free as possible. It will only hold files and folders that should not need to remain there for more than a week. If they do, it probably means that I should store them in some folder. I know that Google Desktop search would be able to find everything, but that will not be how I use it. I will be using Spotlight/ Google Desktop search to quickly locate pieces of text that I need. Not locate files that I misplace in the first place.

All in all, this might seem like there is going to be a lot of information to store. And I agree. Nevertheless, the way I have described it seems to be logical to my own mind. I will of course change it if it fails in some way or complicate matters.

This post was written quickly in the spur of the moment so that I can document all the ideas I have got for GTD. So it might be a little choppy.

Updated: Of interest would be this article on the New York Times that compares and contrasts the "fast" productive side and the "slow" but successful side. Resolved: To Do More. Or Less. Or Something

Posted in , , | 1 comment |

ECE vs CS

Posted by Nicholas Chen Mon, 08 Nov 2004 10:24:00 GMT

After much contemplation (and also almost 3 wasted semesters), I have to say that I have discovered that ECE is not really for me. Why? Especially since I am already half way through with my curriculum. The reasons are aplenty but I will list the ones that I think are the most influential.

  1. Materials which I do not envision myself doing 10 years down the road
    I believe that this is the most important reason for me. I am not able to see myself 10 years down the road doing something like this. I do not think that I will be able to design circuits. Neither would I enjoy dealing with all the communications stuff. It is true that ECE is an exciting field. More innovations are going to come out of it I am sure. But for me to be one of those people, I would rather stake my chances at being a biologist. It could be because I do not see things in the world of current, voltages, waves, etc. Or it could be because the materials they teach us for our core classes does not do enough justice to the field of ECE. Most courses do not incite any interests in those of us who do not have much to begin with.
  2. Not created anything useful yet!
    This is the second most important reason for me. I have not created anything! There was ECE 110 that had us build a car that was able to navigate through a path using some sensors. Boy, that was fun! Except for the fact that we did not build the car and all we had to do was wire some cheap circuit up. That might have worked to entice me when I was a kid but I really do not see anything special about being able to do that. In fact, I would have been more impressed had they make us program the car just like the other kids had to do for the LEGO MindStorm. Most labs are too theoretical and I am not able to see how they would be used later on. The lecturers just tell you that this would be useful and it is used for this and that. Well, I still am not doing anything that uses this and that. Bottom line, there is no relation between theory and practice. The lab sessions are nothing more than a tough assignment which you forget once it is done.
  3. Lecturers who do not pique your appetite
    There are of course those that do make the class interesting but the course itself still does not satify reasons 1 and 2 above. Most of the other lecturers just try to impart either a whole lot of knowledge to you or too little and expect you to learn them on your own. I have mixed feelings about methods of teaching but I am pretty sure exploratory learning does not involve having to consult google to find out 90% of what should be taught. What bothers me even more is the fact that some textbooks are utterly horrendous to begin with. There are textbooks that the professors themselves would never read at an undergraduate level. Sure, those books have a lot of stuff in them, but most of them deal with the main ideas in a cursory manner and the student has to go find out about them himself. For me, I expect to have 80% of the facts imparted to me, and the other 20% of the subtle facts revealed to me later on as I do some of the homework.
  4. Less friendly people
    There are of course CS majors who are jerks but the numbers are few in comparison I think. The fact that almost all the CS course I have taken has a community of dedicated newsgroup users help assert that fact. If you were to go into the ECE webboard discussion, you would notice that most people do not bother to reply. Heck, in fact some of the TA's do not even reply to the webboard. What is the use of a webboard then?

Posted in |

Working on HKN website

Posted by Nicholas Chen Fri, 08 Oct 2004 19:30:35 GMT

I have volunteered to help implement a courser review guide for UIUC's HKN web site. We are going to be using an open source project called goodprofornot that was invented by some students in UC Berkeley as their software project. The whole thing is written in python with some of the databases being handled by mySQL. There is more information at goodprofornot

I wasted a considerable amount of time trying to twiddle with the apache server on my powerbook trying to get it to process the .py files that are common to python. After much fiddling I was still not able to get it to work. I am pretty sure that python is installed because I have successfully run command line python scripts. So, after some web searching, I found that the simplest way to get the cgi to serve .py files was just to convert the .py into .cgi. And it was all good.

Then came the part about setting up mySQL. There was no clear mention on how we are going to set that up. And since I have no prior experience to mySQL, this endeavor would have to suffer some delay for the time being

After much contemplating I actually decided that I did not wish to be involve in this project. However, because I had already volunteered for it, there was no way they can put me into any other HKN committee. No committee == no hours earned! And that is bad.

The reason why this is a chore lies in the fact that no one knows how to set up the thing. Setting this site up requires some form of technical expertise with apache, mySQL, and also python. While I am fairly well-versed in python, I am not comfortable brawling my brains against apache and mySQL. Moreover, it requires the use of a linux server since the current IIS server has no python support. Not being one who is familiar with linux network security, I decided that to go head on with the idea of installing a new server will just let to some script kiddie hacking down the HKN site.

So what am I to do? A meeting will probably be scheduled next week with the person-in-charge and we will work something out. Even in the worst case scenario, we can just make the page static html. That is not too bad an idea since static pages with updated info is much better than a dynamic page that never changes. That is, at least, what I think.

Posted in | no comments |

iDia

Posted by Nicholas Chen Fri, 01 Oct 2004 08:47:57 GMT

For a software engineering class I am taking this semester, my group decided to implement a visual graphing program called iDia. iDia is basically Dia, the GTK drawing tool with an 'i'. But, mind you, the 'i' makes all the difference. It mandates the use of the Internet as a gateway for sharing and editing the same document in real time.

Currently, this project is only in its proposal stages and we are uncertain as to what the response of the masses will be. If we do not get enough group members then this project will have to be left to decay. Hopefully that does not happen since I believe that this project is really fun and interesting. Since there is already a website for it I shall refrain from blogging too much on it.

One of the most exciting thing about this project though is the fact that we are going to do a GUI for the first time! :)

And unfortunately as of October 1, 12:12 am, I have to dissolve the project because no one signed up for it. I believe we are partly to blame since we did not do a great deal of advertising to the masses. However, I have this lingering suspicion that learning Qt has a lot more to do with it. Most people in this class seem rather misinformed about newer technologies. Besides Microsoft technologies, most of them only know java. The other few who know some other more "intelligent" systems have already set up their groups and attracted the uber-geeks.

So now we are currently in this group: Dowser and DevonThink uses. And of course, nothing is quite going to beat Spotlight technology on the Mac once it appears in OS X 10.4 Tiger.

Posted in | no comments |