Archive

Archive for October, 2010

Bill Gates on energy: Innovating to zero!


The technical geek talking about Energy. A very good work.  Can it be possible to bring CO2 altogether to 0(Zero)? This TED talk explains some possible ideas.

Advertisements
Categories: Technology

Steven Johnson: Where good ideas come from


I’m a very big fan of TED talks. These talks are very informative and provoke new ideas.  There are thousands of these some of them are really interesting. Here is the one I liked.

 

BLUE PRINT event in NITK


Here I want to share my experience by being a part of event called “BLUE PRINT”(Paper presentation). The program was very good first of all I’ve to say that the papers were selected with great care, allowing only new creative ideas. The evaluation was made by very efficient and right persons. Many people have presented very well until judges started asking questions, Though the ideas are worthy some don’t aware that their ideas may fail because of several business or financial issues. This kind of events are very good in terms of exchanging ideas and presenting them to eminent professors and enthusiastic young minds. Really the event was very good it provided great platform expressing young minds ideas. Here I’ve to specifically mention that the judges have given their input to the presenters which will provide immense improvement to their ideas. Sometimes its really depressing when judges say the model or the idea may not work but taking the feedback and working on why it doesn’t work will help students because these professors are guiding many graduate and post graduate students for years.

Peter Norvig’s Video conference


Today attended Peter Norvig’s Video conference which was held as a part of “Engineer 2010” Tech fest in SJA auditorium. Peter norvig the Director of Research (formerly Director of Search Quality) at Google Inc. Started his talk with taking the example of image search how the features of an images are extracted and compared to produce a graph like structure. Then he went on to the quote “There is no correct model, but some are useful” He explained this with an example of model of F=ma which might be not totally 100% correct without including minor details but it is very useful in many areas.

He explained about the Picassa and then how to see the world with the text information mode. He explained how sophisticated the problems of search engine with out the power of the Artificial Intelligence. One reason for this is that in English we cannot say something is semantically syntactically correct with whole set of grammatical rules. He explained his own algorithm of AI how to segment the given sentence for example “earthgravitation” earth gravitation. This classification of two words we as humans can do very easily, but how to teach to the lifeless computers? Is it using the sophisticated set of grammar rules of English? No. He used his segmentation algorithm which was trained for 2 million words which has showed enormous increase in the search results fastness with out incurring much costs. He showed some of his “Python code snippets”.

As the data grows more and more the algorithms become better and better”

He has spoken about the translation of one language into other. How it is done. Many of the google algorithms are related to Artificial Intelligence based on Randomized technique method which are very powerful and robust in nature. Genetic Algorithms also comes into this category.

Question and Answers:

1) How often does google update its search databases?

Ans: Hourly now(36 hundred seconds).

2) What are the current trends in Google or Google now is more concentrating now?

Ans: Mobile related

Localization search in order to best suit the maps and nearest shops stores etc.,

Can the personalization of user search used in google for search results?

Ans: Yes, but not fully, it has some weight but more weight will be given to returning the highest page ranked results. The reason for the above argument is that, A person most of the times searches for a query to learn something. He may not try for the same results too often so it is very important to return the results which are having hight page rank rather than giving high weightage to the individual personalization.

 

Apply your ubuntu MAC theme


Here I’ll give the method I’ve used to apply mac theme to my ubuntu. I have been trying to apply MAC theme for many days but recently I  successfully applied it. The below is the code to download and install the XMAC theme.

wget https://downloads.sourceforge.net/project/macbuntu/macbuntu-10.04/v2.2/Macbuntu-10.04.tar.gz -O /tmp/Macbuntu-10.04.tar.gz
tar xzvf /tmp/Macbuntu-10.04.tar.gz -C /tmp
cd /tmp/Macbuntu-10.04/
./install.sh

 

copy and paste the above lines in your terminal it downloads and installs the MAC theme on your linux machine. But after installing the theme, your previous settings may have lost or you may not get the bottom panel(I had the same problem). Now in order to restore the previous settings use below code:

rm -rf .gnome .gnome2 .gconf .gconfd .metacity
Once restart your system now you can get the true look and feel of MAC theme.

Swapping two numbers in Python


Swapping two numbers in Python is damn easy. It doesn’t require another temporary variable or complicated assignments if the swapping to be done with in one line.

Swapping of two numbers in C with in one line Here

Swapping of two numbers in C using Bitwise operators Here

Both of the above programs do not require the additional temporary variable but I have to say, they are some what complicated but in case of Python just one assignment. Take a look at the below code

def swap(a,b):
	print 'Before swapping a=%s b=%s' %(a,b)
	a,b=b,a
	print 'Before swapping a=%s b=%s' %(a,b)

def main() :
	a=raw_input("Enter a:")
	b=raw_input("Enter b:")
	swap(a,b)

if __name__=='__main__' :
	main()

Find a path between two vertices using Python


Representation of the graphs and their usage is very easy with the concept of Dictionaries in Python. Dictionaries come very handy in representing Graphs in Adjacency list form.

Here is the Python code:

def Graph():
    graph={}
    size1=int(raw_input('Enter the size of the graph:'))

    for i in range(size1):
        node=(raw_input('Enter a node:'))
        adj=[]
        ad=(raw_input('Enter adjacent vertex:( enter -1 when done):'))
        while(ad!='-1'):
            adj.append(ad)
            ad=(raw_input('Enter adjacent vertex:( enter -1 when done)'))
        graph[node]=adj

    visited={}
    for i in graph.keys():
        visited[i]=False
    print visited
    start=raw_input('Enter start vertex:')
    end=raw_input('Enter start vertex:')
    print find_path(graph,start,end)

def find_path(graph,start,end, path=[]) :
    path=path+[start]
    if start==end :
        return path
    if not graph.has_key(start) :
        return None
    else :
        for node in graph[start] :
                 if node not in path:
                    newpath = find_path(graph, node, end, path)
                 if newpath :
                    return newpath
        return None

def main() :
    Graph()

if __name__=='__main__' :
    main()