Visualizing the Philippine election scene Part 2
via Twitter SteamGraph
The chart shows how the frequency of the words change over time. This gives you an idea on what people are talking about over time.
via Twitter Spectrum
The chart shows the words commonly associated with Villar and Noynoy. Words at the center are common to both candidates. Look how the words ‘magnificent’ is commonly associated with Noynoy while ‘mudslinging’ is for Villar. Of course, this chart simply shows how many times the words were mentioned and not the context. It’s amazing that ‘#erap’ is at dead center. Does this mean Erap can still influence the election?
via TwitterVenn
The chart above shows the frequency of the words ‘villar’, and ‘noynoy’ as well as the overlap of the two in a single tweet. From the looks of it, Villar and Noynoy don’t come together that often. The chart also shows a word cloud of the most common terms related to Villar and Noynoy. Just like the spectrum chart, Erap is frequently mentioned along with the top 2 presidential candidates.
The following charts were created using Jeff Clark’s visualization projects. Here are the links to TwitterVenn, Twitter Spectrum, and StreamGraphs. Since the charts depend on the latest tweet, you may get a different result.
The secret history of Silicon Valley
from YouTube’s description:
Today, Silicon Valley is known around the world as a fount of technology innovation and development fueled by private venture capital and peopled by fabled entrepreneurs. But it wasn’t always so. Unbeknownst to even seasoned inhabitants, today’s Silicon Valley had its start in government secrecy and wartime urgency.
In this lecture, renowned serial entrepreneur Steve Blank presents how the roots of Silicon Valley sprang not from the later development of the silicon semiconductor but instead from the earlier technology duel over the skies of Germany and secret efforts around (and over) the Soviet Union. World War II, the Cold War and one Stanford professor set the stage for the creation and explosive growth of entrepreneurship in Silicon Valley. The world was forever changed when the Defense Department, CIA and the National Security Agency acted like today’s venture capitalists funding this first wave of entrepreneurship. Steve Blank shows how these groundbreaking early advances lead up to the high-octane, venture capital fueled Silicon Valley we know today.
How Ruby, Java, C, and PHP fanboys see each other
Some people when they get bored, they go to the mall or play video games. For me, my solution to boredom is to write code unrelated to my current job. I admit this is not exactly what most people’s definition of fun is.
Anyway, last night while I was scanning Twitter for something interesting, I noticed a lot of posts about the Philippine presidential election, which is less than 2 months away. I guess things are heating up en route to the big game. Hmmn. I been studying data visualization recently, so why not take a shot at these Twitter posts and see what I can find. After a few hours of trial and error, I hereby present a visualization of the Philippine election based on Twitter posts.
Step 1: Click the button below:

Step 2: The fun part
Type keywords ‘Villar’ (without the quotes) and press Enter
You can enter 1 or several keywords and it will show you the context in which those keywords appear. For example, if you enter ‘Ruffa’, you will see the image below. I don’t know the issue between Ruffa and Noynoy Aquino but apparently her mother (as usual) is involve.
When I tried ‘Kris’, I learned that Noynoy’s survey ratings dropped. OK, enough with the spoilers! I suggest trying out different keywords and share what you have discovered.
You can also click on the keywords on the chart. This is cool for exploring the different posts available.
Now, for some geekspeak.
The chart you are using is called a word tree. A word tree allows you to search for words or phrases and present it to you it a tree-like structure. Notice some words are larger than the rest. The size of the word represents how many times the word was found. In essence, the largest word is the most talked about topic related to Villar and Noynoy during the past 4 days.
The cool thing about Twitter is it is programmatically easy to get tweets by people a few days back. First, I tried to pull tweets as far as Jan 1 but unfortunately, Twitter has an artificial limit of 1,500 tweets only. As of this writing, I was able to collect posts between Mar 7-11 only. The date range wasn’t intentional by the way.
The charts was created using the Many Eyes website – a visualization project sponsored by IBM Visual Communication Lab. You can try their visualization tools for free and all data sets are widely available. You can find my Twitter data sets here.
I will continue collecting data until election is over (or maybe until the new president is proclaimed). I am thinking of creating charts on a weekly basis instead of lumping everything because I think it is fruitful to get a visualized snapshots of the election on a weekly basis.
What do you think? Please leave a comment for any suggestions and violent feedback
Update: The chart doesn’t load on Chrome/OSX but works fine in Safari and Firefox (both on Mac). Sorry, I haven’t tested it in IE and no plan to do so
Enjoy!
How to explain the financial crisis to your kids
How to create a class on the fly in Ruby
“So what if Ruby is dynamic?”
This is often the reaction I get whenever I tell friends that Ruby allows you to fiddle with your program at runtime; followed by an emotional discussion on dynamic vs. static way of programming. Instead of adding more fuel to the fire, I’ll just show how Ruby’s dynamic nature makes programming more fun.
In this post, we will learn how to create a functioning class at runtime.
The static way of starting with an object-oriented language is to define a class. In Ruby, to create an instance of this class we would use the ‘new’ method. If you are new to Ruby, I am using ‘irb’ to write the program and I suggest you start it now so you could follow me.
>> class Table >> end >> t = Table.new >> t.class => Table
Every time you use the ‘class’ keyword, you are adding a new item in your program’s namespace. Imagine a namespace as just a directory of names you can use in your program. So if you have the 2 classes defined, you have 2 names available in your program. (Technically, you will have more than 2 but for simplicity let’s leave that topic for another post, shall we?) For example:
>> class Book >> end >> class Shelf >> end >> b = Book.new => #<Book:0x5c6a48> >> s = Shelf.new => #<Shelf:0x5c286c> >> t = Student.new => NameError: uninitialized constant Student
If you try to use Student, your program barks because it can’t find ‘Student’ in your program’s namespace.
In our first and second example, the way to make Student available to our program is to use the keyword ‘class’. Now what if we don’t know the name of the class yet – the only time we would know it is when the program is already running.
Now, let’s make our “dynamic” journey more interesting by creating a class based on some user input. For example, the user would give you a name (i.e. as a string), and you’ll create a class based on that name. Let’s see how this is done:
>> class_name = "Student" # assume this is inputted by the user >> klass = Object.const_set(class_name, Class.new) >> instance = klass.new => #<Student:0x5e08a8> >> instance.class => Student
Voila! We have created a Student out of thin air! For those coming from a static way of doing things, it is alright to take a break; a cup of coffee also helps
Ok, you’re back.
>> Object.const_set("Student", Class.new)
This line adds the name “Student” in your program’s namespace and make sure it behaves like a normal class as if we defined it using the ‘class’ keyword. Thus, if we try to use Student this time, our program does not complain.
>> t = Student.new => #<Student:0x5b1828>
Now, we have two ways of creating a student:
>> s1 = Student.new => #<Student:0x5cba0c> >> s2 = klass.new => #<Student:0x5c34b0>
But wait! There’s more. It wouldn’t be fun if our class does nothing. So let’s add some attributes to it. Let’s go back to our static ways. During your early days with with Ruby, you probably define attributes this way:
>> class Student >> def name >> @name >> end >> >> def name=(_name) >> @name = _name >> end >> end
But now you know ‘attr_accessor’, which is a shortcut for creating get/set method pairs like we have in the previous example.
>> class Student >> attr_accessor :name >> end >> s = Student.new => #<Student:0x5d3720> >> s.name = 'greg' => "greg" >> s.name => "greg"
But how can we add the attributes in a class that we have not defined yet? Simple, we open its brain and add our attributes – at runtime.
>> attrs = ['name', 'age'] >> klass.class_eval do >> attr_accessor *attrs >> end >> >> s = klass.new => #<Student:0x5d2f78> >> s.name = 'greg' => "greg" >> s.age = 24 => 24
The magic here is done by the ‘class_eval’ method. It executes all the code between the ‘do’ and ‘end’ as if you have written the class. Using ‘class_eval’, you can also add methods to a class at runtime.
All these stuffs so far are cool but what the heck would you use it for? You can’t certainly use it to pick up girls in a bar. Otherwise, a lot of Ruby programmers would not spend their time writing blog posts on metaprogramming
If you like this post, please buy me a book for my birthday.
Globe Labs launches mobile API
This me doing a demo using our Ruby API wrapper and Twitter. You can look at the API in my github repository.

This is Mel using Java to access the Globe mobile API and Google Calendar.

And these are the hundreds of geeks itching to try the API and get a piece of the more than 1M pesos in cash prizes.

More pictures from the Globe Innovation Convention.
p.s. Yup, this is 2 weeks ago. Talk about being lazy
The 10 Commandments of Web Design
- Thou shalt not abuse Flash.
- Thou shalt not hide content.
- Thou shalt not clutter.
- Thou shalt not overuse glassy reflections.
- Thou shalt not name your Web 2.0 company with an unnecessary
surplus or dearth of vowels. - Thou shalt worship at the altar of typography.
- Thou shalt create immersive experiences.
- Thou shalt be social.
- Thou shalt embrace proven technologies.
- Thou shalt make content king.
via BusinessWeek
1st Philippine Open Education forum
The mini-conference aims to inquire upon the feasibility and development of private initiatives to contribute in the Philippine educational or learning system, as alternative else collaborating actors in this matter.
— Philippine Commons
23 April 2008
830-900 :: Registration
900-915 :: Invocation
915-1000 :: Introduction to Open Education
Speaker/org: Creative Commons Philippines
Atty. Jaime “Jimmy” Soriano
1000-1015 Q&A
1015-1030 :: Break
1030-1115 :: Creative empowerment and liberal education
Speaker/org: Friedrich Naumann Stiftung fur die Freiheit
Mr. Sigfried Herzog
1115-1030 Q&A
1130-1215 :: The public direction of Philippine education (primary and secondary)
Speaker/org: Department of Education
Atty. Geronimo “Indy” Sy
1215-1230 Q&A
1230-130 :: Lunch Break
130-215 :: Private initiatives towards open education: International/Local
Speaker/org: Creative Commons Philippines
Atty. Michael Vernon “Berne” Guerrero
215-230 Q&A
230-315 :: Private initiatives towards free and open books
Speaker/org: Bayanihan Books
Mr. Greg Moreno
315-330 Q&A
330-345 :: Break
345-430 :: commercial/business reaction to open content
Speaker/org: Vibal Foundation
Ms. Kristine Mandigma
430-445 Q&A
445-500 :: Closing remarks
Can you tell this dancer to change direction?
Does the image below rotate clockwise or counter-clockwise? It depends whether you are using the left-side or the right-side of your brain. What’s cool is you can tell your brain to change the dancer’s rotation and it will.

Found via Kaye’s blog






