Thursday, November 29, 2007

Firefox Setup for Heavy Research

I use Firefox quite routinely for searching things. However, it can still be quite confusing when I do heavy research. I sometime felt lost when the amount of links and followup explode. A little more structurized approaceh and workflow could help here. After quite some time trying things out, I currently settle with the setup below.

The extensions used :
  • Advanced Bookmark Search and Locate in Bookmark Folders. I think without these folder in Firefox's bookmark is only half useful (or half useless, depends on your preference) since you cannot trace back search to folder hierarchy. I don't like storing things in Firefox Bookmark when I find this out. These extensions enable me to depend on it again.
  • Scrapbook. I rarely saved any page again, at least not conventionally. I can save and organize page just by dragging things around using this extension.
Mechanism used :
  • Something that need to be read is saved in Scrapbook while useful links are gathered in bookmark. It's not exclusive though, a link can be both go to scrapbook and bookmark.
  • Setup designated folders, both in Bookmark and Scrapbook. Some folders that used a lot in research : project, task and tmp folder. Project is for long term (more than a day) work while task is for immediate task that I do. Both actually almost one to one mapping from Project and Task in GTD. If a project or task need researching, I made folder with it's name in Bookmark and Scrapbook. However, I usually only add them when there's at least one link/page. The tmp is to dump everything else.
  • Drag links and pages in relevant folder to keep the tab to reasonable size. If a link/page can't be decided instantly to go into project or task folder, drag them to tmp to be followed up later.
  • Archive links and pages when done. Move them to a more "stable" folders for future reference.
I find this setup and mechanism makes my browsing more focus and help a lot in avoiding mindless wandering around. It also helps in preserving the resources I find along the process with more ease.

Wednesday, November 28, 2007

When Boost Came into Picture

It is not long after I use STL before I realize it has lots of potential that is not fully realized. It has useful construct like for_each but it's use is hampered by the fact that we need to make a Functor for each function that we would to "inject" to containers, no fun. There's also auto_ptr that has a promising future in helping use deal with nasty memory problems, but alas it's very raw to be useful.

Then comes boost. I find this library pick up some of what STL and standard C++ left off. It helps extend some hard-to-use construct into something that can be used in daily coding with more ease, thus making it's adoption more rapid. It enable us to use for_each the way most of us had in mind i.e: just "plug" a unnamed (lambda) function to it. It adds higher level abstractions and myriad of tools that help tame the complexity working in C++.

What I feel is another interesting feature of it is that it does things in a way that is very align with STL and Standard C++. It feels like an extension of the language rather than a library. It also has a little portion of something that looks like Foundation Library that we typically find in language like Java or C# i.e: Filesystem handling, Thread, Time.

C++ with it's feature like template promise something that STL help realize to some extent. Boost then pick up what STL left off into something more practical, useful and accessible.

Tuesday, November 27, 2007

Greatness and a Whole Person Model

One lesson I find interesting from Covey's "8th Habit" is that Greatness is actually quite simple and not that special. Greatness could be viewed as living by paying attention to our whole self. Being great means being a "normal", Whole Person human being. What I mean normal is in the sense that it is perfectly normal for us to fulfill our needs for our spiritual side, mental, social, physical and the rest of our self.

When you deny someone from fulfilling his greatness is like denying someone to eat and breath. When you deny yourself to be great it is like willingly choose to be 40 % human. Allowing ourselves to be less than great means we allow some part of our self to suffer, lack of nutrition and fulfillment.

However, in this model, Greatness has nothing to do with relative achievement/ownership. It has more to do with knowing yourself and knowing how to care and fulfill every side of it (including those nagging inner voice that we are trained/conditioned to ignore). It is self-defined. Other people condition/opinion then become the context in which you express yourself rather than a standard into which you judge/value yourself.

Greatness definition will vary a lot in it's detail, but it seems quite accurate to see it as a result coming from fulfillment of our whole self.

Monday, November 26, 2007

When to Extract/Merge Modules

Extract some part of the code into it's own module/library from Application Code when :

  • Another Application needs it.
  • You need to encapsulate it's complexity from the rest of the code such as in the case of cut-and-pasted , boiler plate, legacy code.
Merge the library back into Application code when :
  • You don't feel the cost of it's maintenance as a separate library is justified.
  • You want to make more aggressive optimization.
  • The library is getting specialized and hacked to fit to the Application code until it seems natural to just let it be a direct "member" of the Application code.

Sunday, November 25, 2007

Trouble with Activesync? Try Waiting

I've seen several times people post about their problem with PocketPC (Windows Mobile) and Activesync and it happen to me personally too. One common problem is that Activesync occasionally fail to connect with no message at all.

Recently I just find out some non-technical "fix" that could help me deal with most cases when this happen.
The solution is to just wait. I found this out accidentally when I left my device still connected although it seems to fail to connect through Activesync. I usually disconnect it when this happen, reset it and try reconnect it again until it connected (as you might guess, it's quite annoying). Then, to my surprise, after about 12 minutes just letting it alone by itself, the connecting process was finally starting and succeed.

I now do this when it happen and it works almost every time. When it doesn't work, resetting still can be utilized as the last resort, but I do this relatively rare now. This trick helps me utilize my PocketPC more for now (since I now can just plug it in and ignore and let it choose whenever it decided to connect). This saves a little time and trouble of resetting also avoid some unnecessary frustration/anger :).

Friday, November 23, 2007

Using Linux-like Directories in Windows

Being a linux user at home and using it at my previous work place for some years left a mark in me that carried away to other OS (in this case, MS Windows). One of them are directory structure and naming, the goold-old bin, doc, man etc. I've used to looking for documentation of libraries and applications on the same dir e.g: /usr/local/share/doc, having an executable in one dedicated place (the mighty /bin directory) and so on. Having files collected by the function is quite intuitive in most cases.

I can't do too much to replicate those in MS Windows since it has it's own convention in doing things. However, some "hack" based on the principle above still useful and makes things easier. Here's what I do :

  • Put documentation together in doc dir, especially for libraries. Even when they are installed by default in their own dir, I would copy them under it. This make searching for something like an API doc very convinient, especially in a development that use several libraries at a time.
  • Put command-line based tools under bin dir and put this dir on PATH environment variable. It makes PATH variable less cluttered and you have your tools accessible wherever directory you are currently in. I puts tools like ctags, cscopy, sort, custom scripts and sytem hacks here.
  • Put libraries outside work source tree, use a dedicated lib dir. Despite their source, how they are used and accessed, I put libraries used in development in one single dir. I find this practice easier for me to just take a glance and in an instant I saw all libraries that I used (or used to used/tried). It's also make the working dir of active code cleaner and give me more clarity. I don't find any urgency to "localize" library within working directory of actively-worked code so far and find this setup to be better.
I find it useful to have more exposure to other way of doing things. It gives us insights and useful tricks to be used in other context which we won't get otherwise.

Thursday, November 22, 2007

Why Bother with STLPort in Visual Studio?

Why would someone bother going through the hassle of setting up STLPort to use quite basic use of the language (if you consider STL as part of the basic of using C++). Why not just use the one already built-in in Visual Studio?. Well, two things : Standard-Compatibility and Efficiency (speed and memory wise).

It was from the early years I do C++ in production setting, me and a friends decided to use STL full-time i.e: use all feature it has to offer that is relevant and makes sense to the work at hand. It was not long until we stumble upon STLPort. We do some test and it didn't take a while to convince us. We didn't need to go far in testing, even for quite typical operation e.g: doing some heavy processing using for_each on vector already show very visible difference. Also, many said that it's more standard compatible, so the tought of using less compatible implementation when the more compatible one already exist makes us uneasy. The switch was decided and we never look back.

Of course, using STLPort means more work, but it's certainly worth it, especially if you'd like to see your code with STL run as "advertised" in the book.

Wednesday, November 21, 2007

Uninterrupted Coding Time : First Thing in The Morning

There are many books about software development that emphasize this : have uninterrupted time for coding. I find it useful to really put this to the extreme : not doing any task at all beside coding, first thing in the morning, not even mails, reading, reviews, none. The exception would be only for the task that block me completely to do coding if not get done first, or some thought-capturing that sometime happen in the beginning of the work (in this case, just capture everything to be reviewed later). I find this really set the mood and pace for the rest of the day and make me (feel) more productive.

There's some strange feeling if I don't get something coded significantly in one day even though I have done many other non-coding tasks that day, it feels like that something is missing, some disorientation. It's probably a general feeling for every profession : having done significant task related to what someone perceive as a forward movement in his scope of responsibility will bring a good feeeling of accomplishment. A guitarist who don't touch his guitar in one day probably feeling the same way. A writer with blank paper all day probably feel quite worse.

So, make a coffee, and code away.

Tuesday, November 20, 2007

Vista Gadget for Multisite Development

I don't use Vista gadget too much, only use it for showing analog clock (using standard pre-installed gadget), which is better then looking at tiny digital clock at the systray, and sticky note for putting occasional notes/reminders. But I just find a good use for it recently : showing clock from different timezone.

It's not explicitly obvious, but at a moment, I just thought, hey I could actually add two instance of the same gadget here, why not add two clock showing different timezone. It works and now what's left is to add label to each clock to show which showing what zone, and no surprise here, there's a "Clock Name" field I could fill in this gadget option.

This would be useful for multisite development e.g: multisite software company or an open source programmer coordinate working with peers on a different timezone.