Common Rules in Programming

Writing code is never been easy.

Well, let me re-phrase: Writing readable code is never been easy.

Many programmers work on their code alone. They define and write the specification, design the system, write codes and library and write documentation, all by them self. They never have a problem with version control, never experience a single conflict, and never have to deal with different approach and algorithms. Everything is on their head and they just write it out. No problem.

On the other hand, few programmers (if not many of them) struggling hard to read someone else’s code trying to understand on what he/she was doing at the time he/she wrote their codes. The later will always have to understand the logic, flow and “magic” around their former friend’s code. This is not an easy task considering every programmers had already have their own style. But still, they need to introduce massive unstructured yet not logic code into their brain. Continue reading

Thanks Yahoo! Koprol, Challenges Ahead

It’s been a great ride for me and one of those important milestones to reach at this time.

I joined Yahoo! at October 4th, 2010. Prior to that, I was doing web development for one of the good tech company in Bandung, Voucha. Having a great leader and colleagues were like your family at Voucha, it’s a tough decision to move on. After a little bit discussion with my wife and my family, I decided to move to Yahoo! and still kept the good relationship with them, Voucha’s big family.

First day at Yahoo! was really formal. I rarely wore a suit and a fancy shoes. Deep in my heart, I know it’s (used to be?) a technology company so I should comfortable wearing my best t-shirt or any shirt I like to wear. It’s just not common in here, Indonesia, wearing a t-shirt in a first day of employment. So here I was, wearing all those things like a salesman working for IBM, except for the fancy tie.

I was assigned to Koprol, a social location-based service Yahoo! had acquired earlier. The atmosphere was really different here. The first day I stepped in to Koprol’s office, I felt different. I felt comfy and I just thought, “I like it! This is like having a hacker-culture on a startup even though it’s already bought by the Internet giant. But this whole thing is… awesome!” Continue reading

Simple Links Extractor Using Python

Those who already registered in Search Engine class by Sebastian Thrun and David Evans (both of them are Professors) should familiar with the title. Last week, we had finished the first homework of grasping the Python concept while learning about how search engine’s worked in a simple way. We learned about String and integer manipulations. We learned about finding certain keywords within the string. We learned how to extract a specific text based on the pattern we wanted.

This is a fundamental concept on how web crawler and search engine indexing machine’s worked. I’m experimenting a little bit more on this based on the first lecture to create links extractor. Since the first lecture didn’t explain about how to crawl the links more than one-level depth, I’ve just finished the extractor with no depth at all. I’ll update with more features when the lectures went deep. I will also put the source code on Github just in case anybody in the class interested modify the codes to fit the current lectures or any other purposes.

So, without further ado, here is the code.

I’m really excited with where this class is moving its direction into. Challenges ahead.

Welcome to 2012. Welcome New Resolutions.

It’s been a while since the last time I’ve updated this blog. I have so many reason to say right now but I think it’s just another version of apologies. So what’s up?

As you might know, I have been catching up my self learning NodeJS and MongoDB and it turns out I like them. NodeJS is not new to you who has been playing around with JavaScript. Simply put, you just “move” your point of view from the client side (we often call it “the browser”) to the server side. Of course, there’s a bunch of features you had never seen before. But if you love JavaScript, you’ll love NodeJS.

MongoDB. It’s my second choice to MySQL when it comes to database or data storage. Why MongoDB? Lots of nosql databases out there and why I choose MongoDB? One reason: simplicity. And it blends seamlessly with NodeJS. Perfect couple of the year.

What else? I have one resolution that I thought I could achieve in 2011 but I missed it. It was “Mastering Regular Expressions”. And what I mean about “mastering” was really mastering it. Literally. But how can I measure it when the parameter was only the clueless word you’ve probably think it’s silly enough to say? But then, I have a clue. If I could understand more than two third of this book, then it’s time for me to move on onto the next target.

So, as the title of this post said, goodbye to the last year and welcome to the new year. Let’s take a look at some (not all) of my resolutions: Continue reading

AirAsia saves me big time

That was the first time I used AirAsia in my flight. It’s not because I’ve choose it myself but it’s because someone choose it for me. Some of you might probably know that I was the one who still worried about the flight in terms of safety. I’ve read so many articles and scientific research about the safety in flight and I’ve got so many answers, even proved facts, that the flight was and still safe until today. I want to ask to those who still worried about the flight, what would you do? The answers might vary but most of you will have this: a distraction. Continue reading

Octave and Gnuplot in Mac

Some radical movement. From Nodejs and MongoDB to Octave and Gnuplot.

I know, I know, but trust me, I can’t stand waiting for the next post (about Nodejs and MongoDB) just to post a single yet easy-to-solve problem I have with Octave and Gnuplot in Mac.

If you have already knew about Matlab from MathWorks (and using it regularly), you probably need no introduction about Octave. Otherwise, I will tell you that Octave is similar, often called the free version of, Matlab. Read Octave’s explanation about itself. Continue reading

Nodejs and MongoDB, A Beginner’s Approach

This is not a book and I didn’t try to sell a book to you.

The term “A Beginner’s Approach” reflects my self when finding a hard way out to connect Nodejs to MongoDB. There are lots of libraries available to use when connecting Nodejs to MongoDB. If you were trying to make your feet wet, and that’s what I’m doing until today, you probably want to try this approach. I can’t promise anything but at least, you will not get a headache.

First, read about Nodejs. After that, MongoDB. If you’re already familiar with it, skip it and install both on your system. There maybe vary depending on your system. If you use Mac and Homebrew (or MacPorts), you’re lucky. Just do this: Continue reading

Linear Algebra, The Second Chance

Linear Algebra is back.

This week, I had an opportunity to repeat something what I’ve left behind. I still remember years ago sitting down in a class with a pen and paper ready just to write everything the lecturer wrote on the board. I thought it was 2001 when I was taking a class named Elementary Linear Algebra.

Back in time when this subject was one of my favorites because of the lecturer was, of course, one of my favorites too, beside him and her. I always taking the first row with my friends. I even still remember how she explained matrix and vectors in an elegant way. Everything was elegant at that time but the bad news was, I only got B. Continue reading

Android WebKit Inconsistency

Apologize for the title. It’s not a big deal.

Really.

I have experienced a little (but annoying, at the same time) problem with the Android’s WebKit. There will be a time when you want to render images using WebView object inside your application to support pinch zoom (in and out), download, and store it in your own library. The image itself typically simple. Anything with you-already-knew extensions such as .jpg, .jpeg, .gif, .bmp, and so on.

So, I first start with these codes: Continue reading

Problem Updating Homebrew

I have been joining a club as a Mac user for about 4 months and I found Mac is a friendly environment for most developers. Back to the old days when I used Windows, I used to think that there was only a single installer, with the extension mostly .exe and .msi, and all I had to do was just click on the icon and Windows will do the rest.

Mac, as you all might know, has that mechanism, too. Only the file named Apple Disk Image with the extension mostly .dmg (.smi or .img in the earlier version of Mac). At this point, I will let the Apple fan boys explain about this and I will skip the discussion right into the purpose I’m writing this. The Homebrew problem.

It’s obvious to most of the Homebrew users to update their package by doing this: Continue reading