Fork me on GitHub

Sunday, January 27, 2013

Wanda The Fish in Ubuntu Unity (Precise 12.04)

When I upgraded my Ubuntu OS to 12.04 I was really really happy at the way things were. The new interface is a huge improvement over the old Gnome environment. And the launcher is such a brilliant idea it makes you wonder why it took so long for someone to come up with it. But I was missing a rather fun little applet- Wanda The Fish was gone. So I decided to do what all Linux users do and wrote it myself.

I have used  GTK+  with Python to access the fortune database and display fortunes. (I didn't like the Indicator-fish port because of the absence of a "Speak Again!" button.) The code for resurrecting good old Wanda is hardly a page long. Here it is.

Code:


#!/usr/bin/env python
from gi.repository import Gtk
import os


class Wanda(Gtk.Window):

    label = None

    def __init__(self):
        Gtk.Window.__init__(self, title="Wanda The Fish Says...")
        self.set_default_size(700,300)
        self.label = Gtk.Label()
        self.label.set_line_wrap(False)
self.label.set_justify(Gtk.Justification.CENTER)
self.display_fortune()                             #first fortune when it starts up.
        self.set_icon_from_file("wanda.jpg")
     
        table = Gtk.Table(1, 2, True)
        table.set_row_spacings(200)
        table.set_col_spacings(50)
self.add(table)

        button1 = Gtk.Button(label="Speak Again!")
        button1.connect("clicked", self.on_button1_clicked)

        button2 = Gtk.Button(label="Enough Wisdom for Now!")
button2.connect("clicked", self.on_button2_clicked)

table.attach(self.label,0,1,0,1)    
        table.attach(button2, 1, 2, 1, 2)
        table.attach(button1, 0, 1, 1, 2)
     
    def on_button1_clicked(self, widget):
         self.display_fortune()

    def on_button2_clicked(self, widget):
self.display_fortune()
        self.iconify()
 
    def display_fortune(self):
      os.system("fortune -a > .last.txt")
       with open(".last.txt") as f:
        text = str(f.read())
self.label.set_label(text)
self.resize(700,300)    
   
win = Wanda()
win.resize(700,300)
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()



You could make it a Start up application and then lock it to the launcher. Wanda will continue to swim on our desktops peacefully for many years to come.
For complete instructions follow this link to github:
Wanda

Wednesday, January 16, 2013

Why social ads may take off on Graph Search

Facebook fired a missile directly at Google this week by launching what it calls Graph Search. In essence, the graph search is a version of search which can take arbitrary queries and process them in the 'social context' - that is exactly like Google processes your search query to find relevant web pages. The key difference is that the search results you get through Graph Search include results not from the web, but from your Facebook connections.

For example, you can search for 'Friends who haven't watched 'Life of Pi' ' and the Graph Search may look through the friends' status updates and filter those who have made a status update or commented on the movie (a possible indicator that  they have seen it) and give you a list of those whom it thinks haven't seen it and you could then invite them to watch it with you. That's just an example of what Mark Zuckerberg says Graph Search can do according to this wired article. Now, I hardly know any friends who click on the ads they see on Facebook pages. How many times have You clicked on an ad on your profile?

'Social Ads' have not performed well on Facebook. (At least not till now.) I explored a cause for this in my blog before. Logging in to your Facebook account and seeing who is online and connecting with them is like being at a party - virtually. No guest at a party will notice the huge advertising billboard right across the street. Instead, they concentrate on talking to  people, meeting new people and catching up on stuff. That's exactly the kind of atmosphere which exists on a typical Facebook user's homepage. He doesn't even notice the ads for about 90% of the time. So clicking them is probably out of question and if he does click, its probably by accident.

All that could change with the Graph Search. Just consider the scenario I described earlier. If you could see all the theaters near you which are playing the movie 'Life of Pi' along with the show timings and the ticket prices (as ads) alongside friends who haven't seen it yet, you could find out which theater is most convenient for your friends and yourself and decide to book tickets online right away- WITHOUT using Google to find out the movie and theater information.

That's the key point. It seems now that Google receives one less query thanks to Graph Search. But multiply that one query by millions of Facebook users and you have a substantial amount of queries that don't reach the Search Giant. So Facebook may in fact have an edge over Google here. Social ads may propel Facebook's revenues and thus, its market value.

Of course, the relevance of Social Ads needs to match that of Google's or there won't be any takers. And Google is a veteran in that field. So there are hurdles that Facebook must cross before it can (if ever) overtake  (takeover?) Google. But Facebook seems to be on the right course. If it can even partially cut into the search share of Google, it means billions more in ad revenue for the Social Network.

We'll just have to wait and see what Google has to counter this missile launch. I'm betting on its android  products and Google Glasses and the rising popularity of Google+.  Whatever the end result is, its way more interesting to watch companies out-do each other through innovation rather than watch as one company takes over the world and accept its monopoly.