Simple Links Extractor Using Python

by ksetyadi on February 29, 2012

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.

by ksetyadi on February 20, 2012

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: Read the rest of this entry »

AirAsia saves me big time

by ksetyadi on December 6, 2011

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. Read the rest of this entry »

Octave and Gnuplot in Mac

by ksetyadi on October 24, 2011

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. Read the rest of this entry »

Nodejs and MongoDB, A Beginner’s Approach

by ksetyadi on October 20, 2011

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: Read the rest of this entry »

Linear Algebra, The Second Chance

by ksetyadi on October 16, 2011

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. Read the rest of this entry »

Android WebKit Inconsistency

by ksetyadi on October 12, 2011

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: Read the rest of this entry »

Problem Updating Homebrew

by ksetyadi on October 10, 2011

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: Read the rest of this entry »

Enabling “Move to SD Card” Installation on Android

by ksetyadi on September 8, 2011

It’s quite simple.

Open your AndroidManifest.xml and add this attribute in the <manifest> element.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto"
...>

There are two values you can use: auto and preferExternal. Use auto to let the system decide which one to install your application to, whether on the phone storage or external storage such as SD card. Another value, preferExternal, will give the system priority to save your application on the external storage first. If the system can’t install your application on the external storage because of one or more things (full, unmounted, etc.), the system will then decide to store your application to the phone storage.

For more details about this, you can visit the official Android documentation here: App Install Location.

Nudity Detection using JavaScript

by ksetyadi on August 18, 2011

To those who are wondering how JavaScript can detect nudity on images and videos:

http://www.patrick-wied.at/static/nudejs/

Please keep ini mind that this is an open-source project so there are lots of improvements to do. Contributions are very welcome whether you want to improve the source codes or just create a nice demo.

I think this is interesting. Let’s make a simple demo.