Tuesday, May 13, 2014

SIP client for using VOIP account on Fedora - Linphone

It has been long I used voip on my linux desktop, just used android app of phoneindia.com which does not have a windows phone support. Okay, I want to buy a Windows phone soon and was wondering is there any good working solution for it. Web searching lead me to a client called "Linphone" which seems to work for many and the developers seem to be actively improving it, which is a good sign (you can notice the change of negative comments to positive just after the new version release date).

I saw there is a linux desktop client and I started setting it up. I downloaded the latest code from their website and saw the README which listed some required packages like "libtool, intltool, belle-sip..." to name a few. I started installing the required ones using yum.



I could not find "belle-sip" package and then searched for it, realised that is also available as source using git clone and then did ./autogen.sh, ./configure which cried for "libantlr3c" package. Probably you can go on and resolve bits and pieces.

Suddenly, I thought let me do, "yum install linphone". Surprisingly there was a package available with dependency resolution. Once installed, I right away tried my account with voip512.com and it just worked! Pain-free. My desktop is Fedora 20 and the version of linphone installed through yum is 3.6.1! HTH.

Wednesday, February 26, 2014

java/vlc/skype killed by SIGSEGV on fedora fc20

I came across a strange behaviour in FC 20 for java, skype, vlc etc that they seemed to crash with a error log, "<something> crashed" and "<something>" killed by SIGSEGV".

After many attempts to look for the solution, I came across this post. The answer just worked for me, tried to up-vote the answer but seemed like I don't have enough reputation for stackoverflow, hence writing the bit here.

Anyway the solution, though strange it may sound, the package google-talkplugin is faulty. Removing it, makes life easier.
yum remove google-talkplugin
If this solution works for you as well, please do let me know in comments.

Monday, July 29, 2013

Cross-Language Information Retrieval - Resource based Approach

This post is intended to discuss how to handle traditional information retrieval in cross-language setting. This environment mainly allows for measuring the similarity between the information need (query) and information (indexed documents) across languages. The cross-language similarity estimation techniques can be generally categorised in two sets, depending on the similarity space: i) vector space, and ii) latent space. The former models aim to calculate the similarity in the vector space i.e. the terms are matched across languages using some external resources like bilingual dictionaries, transliteration systems, wordnets etc. The latter models measure the similarity in latent concept space. This post aims to review the former (vector space based) approach. Future post will include some discussion on latent space models to address CLIR.

This post assumes that the reader has basic knowledge about vector space based models like TF-IDF weighting schemes and cosine similarity. Also, the awareness of basic information retrieval (IR) modules like indexing and retrieval is assumed. If you are not sure about it, just go through a couple of pages at this link. The focus will be to explore more on the cross-language part of the IR problem.

As briefly discussed, in vector space the documents are compared in the original high dimensional space. In order to handle cross-language similarity either a query or the documents are translated to the language of comparison. This post considers the query-translation based approach where query is translated to the language of comparison. How the cross-language variant of IR system differs from its mono-lingual counterpart can be seen in the following figure.  


As can be seen in the Figure above, there is an additional module called "Query Translation Module" in CL variant. This module may be supported by cross-language resources like Bilingual dictionary, transliteration system or a complete machine-translation system like Google Translate API. In order to facilitate these systems, you may also require a morphological analyser and or stemmer. Usually you pass the query through a term-pipeline same as the documents when they were indexed. Below is more details on the term-pipeline.

1. Indexing

 First of all you want to index the source collection using a standard IR toolkit like Lucene, Terrier, Lemur, Xapian etc. There are different ways to index the collection with different indexing configurations. The most common ways are
 -  either to remove stop-words or not
 -  either to stem the terms or not, if yes then with what stemmer,
 - what should be considered a unit of terms like single-word-gram, n-word-gram or n-character-gram.

Hint for n-gram indexing
If your favourite IR library does not have n-gram (word/character) tokeniser than you can safely achieve this by a quick pre-processing script. For example, if you want to index 2-word-grams, joint each consecutive words to appear as 2-word grams by connecting them and putting a delimiter (in this case, #) between the terms just for the sake of readability.


Input = This is an example of n-grams.
Processed Input = This#is is#an an#example example#of of#ngrams

Don't forget to tokenise the query also the same way!


2. Query Translation

To achieve this, you first have to decide what you want to use and an availability of that for that particular language. If you have the access and the luxury, then you can get your query completely translated to the language of comparison by a complete MT system like Google Translate, Bing Translator, Apertium etc. Usually it is costly (also monetarily). Alternatively, you can use cross-lingual resources and systems like dictionaries (hand-made or statistically trained), transliteration system to normalise the language. Morphological analyser usually helps to look-up in the dictionary and to transliterate. The best way to load a dictionary in the code is to load as a HashMap or something similar for quick look-up. Sometimes this independent modules are connected in a sequential way, for example, if the term is not found in the dictionary then transliterate and so on. But it completely depends on the application and your expectation.

3. Retrieval (Ranking)

Finally you are ready to measure the similarity in the language of comparison. The vector space based models like TF-IDF, BM25 (probabilistic) and Language Models are the most popular ones. Usually all the toolkits have infrastructure to retrieve the document with its score based on the model you selected.

All these steps of IR system with Terrier are explained in the slides and the code is publicly available here.

I hope with this post you can start your basic CLIR system using one of your favourite IR toolkit.

Sunday, April 7, 2013

Mortality Vs. Saturation

Recently I read an article. Between the lines, it passed a very strong message of how short the life is. The article was about making a balance in life, giving time to family and loved ones because "having a promotion on the day of your break up is not enjoyable" and so on.. It was discouraging the idea of working stressfully on the weekdays and giving time to the family *only* on the weekends. It very objectively said, if you live say more 50 years from now then, its just 2600 weekends in your life left. So make a balance and live each day fully. Okay, the message is very ordinary which we hear often. But I must say, I had never seen so direct measurement of my life and visualise the end of the life in few hundred weeks time. This is directly related to mortality.

A few days later, a thought on  Indian Vedic Ashram System came to my  mind. More objectively the third stage "Vanaprasthashram". Most of the above-average-ambitious people think to achieve a goal for their life or professional life (more suitable here) and they think, after that they would like to get settled and take it easy with life. Ambition is a very good virtue and mostly the success is driven by an ambition. But ambition is quite dangerous as well. How? You will know in a minute. Now lets talk about over-ambition. The problem with over-ambitious people is, most of the time what they had tried to achieve, sooner or later they could achieve. And that's how they had become over-ambitious from being ambitious. Nobody is born over-ambitious, its a gradual transformation from being ambitious. Now here is the catch, for them, finding a new height in the life is not difficult and most of the time they know, they can do it and how. This becomes a loop and they find joy in it even though at some point their family stops enjoying it. Naturally, time flies and finally, how much does it take for a weekend to pass  when you are chasing a longer goal (may be one after another). These people start noticing harm in this when their body starts to show them the age.

Now let me relate this to Saturation. Saturation from life. This is a feeling of relief in life. Which in Hindi is called "Santripti".

For example,

Situation 1: You just have drunk two glasses of water and somebody told you that there is no water in the world for 2 hours.

Situation 2: You are damn thirsty and somebody told you that there is no water in the world for 2 hours.

Yes, this is as simple as that. The over-ambitious people mostly find themselves in the Situation 2. Many people just get settled and start enjoying life. Why some people desire immortality so much? Because they are thirsty. They did not have enough water before water was gone. If you have had enough water already, you really don't care about water and that's the ideal situation. I think the worst case can be "dying thirsty". I think the whole point of Vanaprasthashram is to make you drink enough water and minimize the probability of dying thirsty to almost zero. So, don't forget to drink enough water!

Wednesday, January 30, 2013

Installing the Printer with IP address in Fedora KDE

Whenever you move to a new place, it takes a while to get started at  your workplace. Especially if your favourite OS is linux. It happens to me quite often that whenever I go to a new office, I need to setup OS, printers, softwares, checkout SVN repositories etc.

My favourite flavour is Fedora with KDE. So here are some simple tips if you looking to set up a printer with Fedora KDE. Usually the information you should know is the IP address of the printer and its model number (exact). Mostly the companies' or departments' IT help-desk or personnel have the user guidelines to access the resources from the variety of OS but sometimes they become so selfish to provide information just for Windows and/or Mac. Nonetheless, they can provide you the IP address and the model number.

Go to the "System Setting" and choose "Printers". Now you will see there are some options under Network Printers. I see that in Fedora 18 they have come up with the feature which automatically tries to find the connected printers in the network. At least for me it is not working properly but you may give it a try if it does the job for you. Otherwise, if you have this information that your printer protocol is "IPP" or "LPD/LPR" then choose that option and fill the necessary fields like host -> IP address, "queue" is usually the name/id of the printer on that host. Otherwise, if only the IP address is known, safe option is to go for "AppSocket/HP JetDirect".

In case of "AppSocket/HP JetDirect",

  • Enter the IP address. Dont change the automatically filled port number except you know exactly what it is. Usually it is 9100.
  • Click on the "Next".
  • Here you have to supply the proper driver for your printer. Most of the companies and their printer model drivers are already available in the list. If yours is there select it. For example, mine is HP LaserJet P4015dn. If your printer is HP then go for the one with CUPS. If not then try "yum install hplip" which should bring you all the HP drivers in the system and follow the steps from the beginning.
  • Now, once the printer is setup its annoying that system automatically disable/pause/block it. So you have to see from every settings/configurations options that that printer is enabled/resumed/unblocked. Once this is done, try to print the test page. 
  • With this It should be fine. Usually with different fedora systems like 16, 17, 18... things are little bit changed but you should keep on figuring out the above points and in the end you will be able to print something. 
Do let others know by comments if this worked or some problems are still there.

Thursday, November 22, 2012

Shame: Arresing someone for expressing an opinion on Facebook?

This is the perfect example of how the democratic nation should *not* behave. It is more shameful because it happened in the world's biggest democracy - India. I was taught in the school that in a democratic nation you get a freedom of speech.

Background:

There was a "shutdown" announced in Mumbai for one day after the death of Shri Balasaheb Thackeray. A girl expressed her opinion on the shutdown. She was arrested based on the FIR lodged by the same party member. Moreover, her friend was also arrested for "like"ing that post. Before arrest a clinic of an uncle of the girl was also ransacked.




I deeply admire Balasaheb for his personality, sensitivity and of course sharp fearless remarks. I think he also might not have liked this kind of arrest where freedom of citizens is at risk. What amuses me more is when an FIR is lodged, without investigation a young girl was spontaneously arrested. Though later released on bail it is questionable that was it necessary and more importantly legal to arrest someone like this? Even more miserable is the friend who was arrested, because she just "liked" the post.

Now the government of Maharashtra is facing strong remarks from across the nation. Justice Katju was nice to write personally a series of emails to chief minister of the state to release them immediately, dismiss the charges and take actions against those who were involved. I admire you sir that you work out of your way to uphold the values of democracy and freedom of the people.

In the hope to have a better and safe future "Satyamev Jayate"!

Monday, October 29, 2012

Gujarat Assembly Elections: what an occation!

Gujarat Assembly elections are set to be held from 13th to 17th December. Well what a magnificent time to be in Gujarat and it can never be any bigger! When I was a school kid, elections meant to me just for some school holidays but now when I am concerned about the country and especially the region where I grew up, its feels amazing to follow the news.

On one hand, Modi is preparing hard to become the fourth time Chief Minister of one of the fastest developing states contributing the most to the national economy. On the other side talks are taking strolls about him to take a bigger national role.

Last month I was in Trento, Italy and with some friends we were discussing the Modi (with passionate Dhaval talking about "Vikas" -> "Development" in Gujarat) about what can be his strategy this time to win.

In any case, the Assembly elections were never so interesting without Modi. I grew up in Gandhinagar - the capital of Gujarat where all these ministers live and do campaign very often. I remember last time when Modi set the stage just few meters away from my house and how the people gatherd! He is really an ear-candy! His typical outspoken, blunt and direct personal remarks take heart whether it can be Prime Minister of India, President of opposition party or Army Chief of Pakistan. This time in news I see Modi calling Prime Minister "Moun Mohan Singh" and Shashi Throor's wife "50-crore-rupee girlfriend"!! I can imagine how it will be in Gujarat and I miss it, hopefully when I am back to Gandhinagar this December, at least once I see him live.



On the other hand, If he fails this time which looks extremely difficult, it would be chaos in Gujarat, because the next CM will definietely not be able to keep up with the speed he has created. I have always be opposer of Modi and probably will be because of 2003 elections but I think the Time and Nation really needs some one like him. USA rejected his visa and he responded "I don't need visa of US but I want to see them taking visa of Gujarat.." and ironically in Gujarat Vibrant Summits many international delegates just queue up to invest. After running the state for last 3 terms cumulated to more than 10 years, Gujarat is all set to evaluate the government and it would really be make or break time for him. Lets see!

Update: He won the fourth time. From then, he has started addressing public in "Hindi", increased his visits and appearances in Delhi, there is excitement in BJP about him with outlook for 2014 national elections but there is agitation too over him. 

Tomcat JSP MySQL Linux -- A Starting Kit

This is just to get you started if you are interested in the above configuration. I spent a lot of time exploring many forums for the errors encountered meanwhile which I try to dump here.

First you need following packages:

1. tomcat, tomcat-webapps, tomcat-admin-webapps -- try to get through yum or apt-get repositories.
2. mysql -- again try to do the same to get it

Start all the services:
service mysqld start
service httpd start
service tomcat start

To check if these things are working properly:

1. mysql:

mysql -hlocalhost -uuser -ppassword -e "show databases;"


Note: there is no space between "-u" and "user".

This should show the present databases created by the specified user.

Alternatively you can access the mysql from the browser through:

http://localhost/phpMyAdmin/

For this will need the package "phpmyadmin" installed. Make sure, each time you do some administrative changes, restart services.

2. tomcat:

You should be able to view the examples provided by the tomcat in the browser. To start with a new project, the place of interest will be "webapps" directory where you have to put your project root directory. Create a directory say "test" in "webapps" and in which create a small static html page say "test.html". Try to access the page from your browser with URL

http://localhost:8080/test/test.html

With that you are ready with your basic set up and should move forward with the mysql integration.
Now the basic page which accesses some table of a mysql database is shown below:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.sql.*" %>

<form>
<head>
<title>Testing the structure of jsp, mysql and tomcat!</title>
<style>
* { font-size: 12px; font-family: Verdana }
</style>
</head>
<div>

<%

Statement stmt = null;
Connection con = null;
ResultSet resultSet = null;
String url = "jdbc:mysql://localhost/dbname?characterEncoding=UTF-8";
%>lang1
<h2>Display of data from Database</h2>
<table>
 <tr>
  <th>col1</th>
  <th>col2</th>
  <th>col3</th>
  <th>col4</th>
 </tr>
 <%
 try {
  String input = request.getParameter("lang1");
  Class.forName("com.mysql.jdbc.Driver");
  con = DriverManager.getConnection(url, "username", "passwd"); 

  stmt = con.createStatement();
  resultSet = stmt.executeQuery("select * from table where col1 = \""+input+"\"");
  while (resultSet.next()) {%>
   <tr>
    <td><%=resultSet.getString(1)%></td>
    <td><%=resultSet.getString(2)%></td>
    <td><%=resultSet.getFloat(3)%></td>
    <td><%=resultSet.getInt(4)%></td>

   </tr>
  <%}
 } catch (SQLException e) {
  e.printStackTrace(System.out);
 } 
 finally {
  try {stmt.close();} catch (Exception e) {
  }
  try {resultSet.close();} catch (Exception e) {
  }
  try {
   if (null != con) {con.close();}
  } catch (SQLException ex) {
   ex.printStackTrace(System.out);
  }
 }
 %>

</table>

</form>
</body>
</html>
In summary, the above code gets a string from the previous page some input in terms of form data. Tries to access the database and gets all the records where col1 value is equal to input and prints it. If you get some java-like errors saying that MySQL is unknown class then you should perform following operations.
The files of interest is:
/usr/share/tomcat/conf/catalina.policy

First you should grant the permission to access the mysql.
grant codeBase "file:${catalina.base}/webapps/test/-" {

     permission java.net.SocketPermission "localhost:8080", "connect";

};

And then make mysql known to tomcat by adding jar in classpath and for that, put mysql-connector-xyz.jar in tomcat_home/lib directory. Add its reference to the classpath by adding following line in tomcat_home/bin/catalina-tasks.xml between

<fileset file="${catalina.home}/lib/mysql-connector-xyz.jar"></fileset>

and restart tomcat service!

Sunday, July 1, 2012

Two-Days-a-City

Recently I have started travelling around a bit. My travel pattern is quite weird because I usually go to a country or most of the time city for 1 week duration to attend a conference or something similar and then I spare two days for me to visit the places around. Under this pattern, I have visited Kolkata, Geneve, Istanbul and soon Seoul. Until Istanbul, it was not so exciting because I was a new traveller and had not much idea how to get maximum out of those two days.

The first trip was to Kolkata, during the time I was in India in 2010. I and Sameer aka Shambaji visited IIT Kharagpur to attend a conference and then we used two days to roam Kolkata city. That was the first trip under the series of Two-days-a city. We were not sure how to do the most out of it. What we did was to roam one day on our own to eat the street food, see the neighbourhood that we stayed (Park Street) and have a local feel of the city. The second day we realised, at the end of the day we were just localised in the neighbourhood and did not get a big picture of the city. So second day, we collected some names from the Guest house reception - some names of famous places to visit. Then we hunted for some taxi drivers with the motto "Maximum places - Minimum price". Once we set that trade-off with a taxi driver, we got off. It was fantastic. Just to make sure everything goes good, we did not bargain too hard in order not to spoil the mood of the driver, because he was going to be the guide of the day too!


In the end, it was fantastic and Shambaji was too happy to say "Chal yaar 50 Rupaiye jyada de dete hai.."  means "Buddy lets give 50 Rupees more.."

Then next, I visited the Switzerland for a winter school in Zinal, Sion. At the end I planned to visit Geneve again under the scheme of "two-days-a-city". Ultimately there were more attendees of the school like me who also adopted the same scheme hence we merged up.  


The tourist office of Geneve was having a lot of good material for the guided tours and we opted one and it was fine. Still I missed some more important places like UN building.

Then, together with my advisor, Paolo, I went to Istanbul. The different element of Istanbul compared to Geneve was its size. Istanbul is world's second most populated city and falls under the category of really large cities. Again, we had a conference there and spared 2 days for tourism. I had a sense that any of the former plans (Taxi or Guided tour) are not going to work for me and we will need some real course to follow to experience the city.


Then, Paolo introduced me to "Lonely Planet" concept. Its a series of Lonely Planet city guides. One day I had a time to do tourism and Paolo was working, so that day Lonely Planet helped me in such a big way that I felt like living that city. The biggest help was zeroing down my choice to buy something for my dear ones. So, the lesson learnt was if you are going to do "two-days-a-city" do buy one of such professional guides even though sometimes they are quite expensive but they do have an edge over most of the tourism literature that you may find elsewhere.


Inspired by that experience, I have already bought the book for Seoul yet another large city next on my list of "Two-Days-a City" series and I am looking forward to it!! If you are also following this kind of travel pattern then try such a book once. Disclaimer: This is not the advertisement of a particular brand of books but this is the suggestion of the concept :D. Ciao! 

Thursday, May 31, 2012

External process calls from java: Runtime.exec() hangs

My recent blog was about calling wget from Java which was talking about a temporal solution. The solution was just to mute the output of the external process so that the output buffer never gets exhausted. Unfortunately, it doesn't solve the bigger problem of calling external processes from Java through Runtime.exec() which can very easily exhaust the system buffer and cause a deadlock at Process.waitFor().

I read a hell lot of articles and spent a couple of hours, looking for the solutions. I got many but all of them were not solving my problem. Then I checked one of the solutions and discussed it at #fedora-java at freenode to see if the problem is really with Java in Fedora! With the help of mizdebsk I was able to spot the concurrency issue in the code which I have posted here. The conclusion after the incorporation of the following code was the external process took some abnormally more time at some point in the program but in the end it was successful to finish rather than waiting forever. I have just defined the block to handle output here, similar block for ErrorStream should be included and if your process expects some input then it should be added too.


class ExecCommand {
private Semaphore outputSem;
private String output;
private Semaphore errorSem;
private String error;
private Process p;

private class OutputReader extends Thread {
 public OutputReader() {
  try {
  outputSem = new Semaphore(1);
  outputSem.acquireUninterruptibly();
  } 
  finally {
   outputSem.release();
  }
 }

 public void run() {
  try {
  StringBuffer readBuffer = new StringBuffer();
  BufferedReader isr = new BufferedReader(new InputStreamReader(p
   .getInputStream()));
  String buff = new String();
  while ((buff = isr.readLine()) != null) {
   readBuffer.append(buff);
   System.out.println(buff);
  }
  output = readBuffer.toString();
  outputSem.release();
  } catch (IOException e) {
  e.printStackTrace();
  }
 }
}

public ExecCommand(String command) {
 try {
  p = Runtime.getRuntime().exec(makeArray(command));
  new OutputReader().start();
  new ErrorReader().start();
  p.waitFor();
 } catch (IOException e) {
  e.printStackTrace();
 } catch (InterruptedException e) {
  e.printStackTrace();
 }
}

public String getOutput() {
 try {
   outputSem.acquireUninterruptibly();
 } 
 finally {
   outputSem.release();
 }
 String value = output;
 outputSem.release();
 return value;
}

private String[] makeArray(String command) {
 ArrayList<String> commandArray = new ArrayList<String>();
 String buff = "";
 boolean lookForEnd = false;
 for (int i = 0; i < command.length(); i++) {
  if (lookForEnd) {
  if (command.charAt(i) == '\"') {
   if (buff.length() > 0)
   commandArray.add(buff);
   buff = "";
   lookForEnd = false;
  } else {
   buff += command.charAt(i);
  }
  } else {
  if (command.charAt(i) == '\"') {
   lookForEnd = true;
  } else if (command.charAt(i) == ' ') {
   if (buff.length() > 0)
   commandArray.add(buff);
   buff = "";
  } else {
   buff += command.charAt(i);
  }
  }
 }
 if (buff.length() > 0)
  commandArray.add(buff);

 String[] array = new String[commandArray.size()];
 for (int i = 0; i < commandArray.size(); i++) {
  array[i] = commandArray.get(i);
 }

 return array;
}
}


Add this class to your code and use the following code to call it for you.
String command = "your external command command";
         
ExecCommand e;
e = new ExecCommand(command);

This takes care of almost all the things, parsing the command line and printing the output to the console. Moreover, sometimes I have noticed that adding a sleeptime in the ExecCommand constructor also helps.
p = Runtime.getRuntime().exec(makeArray(command));
  new OutputReader().start();
  new ErrorReader().start();
  int sleeptime = 1000; // Try to make an educated guess 
                        // about the sleeptime
  Thread.sleep(sleeptime);
  p.destroy();


This block of code is the corrected version the code given <Here>. Basically the changes are related to outputSem.acquire() to outputSem.acquireUninterruptibly() and adding the finally block. Without them it was easily leading to a deadlock.

Monday, April 23, 2012

"wget" gets blocked Java

Recently I faced an interesting problem. I wanted to crawl some pages from the internet and chose wget as the weapon. But, as I am a lover of Java, I wanted to call it from Java. Though I regretted a lot last hours  not following my initial plan to call it through Perl (or theoretically any scripting language) but now happy finding a hack.

Why regret? It hangs!! Just after downloading a couple of pages it sleeps to never come back alive. Well, digging out revealed, it completely occupied the stdout and the process is stuck. That means you need to flush the stdout to move forward. This can be handled by either stopping the buffering or continuously flushing the buffer!

So better would be to silent wget before it "silent"s your process. Adding the options -nv and -q, no verbose and quiet respectively, make the wget silent and your process does not get blocked.

So  at the end of the day you choose to call wget from Java, dont worry but mind to add the options -q and  -nv in your command!

Wednesday, April 11, 2012

Bag of 'Bugs'

A couple of days before, I met a coder. We started talking casually about the things and I noticed that he was carrying a small diary. Usually I am very bad at noticing unless something is really conspicuous, just in case my girlfriend is reading this. In the conversation I realised, that was the log of errors and the 'hack' he had come across so far in the life of coding. This reminded me my undergrad days when the easiest measure for geek quotient was the number of bugs one can spontaneously reciprocate. People are also used to search the error messages a lot on the web to seek the solution which I can notice from the "query suggestions" in the search engines. Okay let me say something about how the "query suggestions" work. Basically the search engines keep the track of all the queries fired and accumulate the frequencies and some advanced statistics on that. Based on these statistics, the probability of the most likely query for your already typed word/s or characters is calculated and presented in the decreasing order of probability/score as the suggestions. Mostly the query suggestions come from the previous queries and the top suggestion is the most frequent one and so on. Sometimes, these suggestions become really funny, for the fun type "nobody uses" in Google and see what are the suggestions!

Okay coming back to the original point, I think at the end of the day the knowledge is how many bugs you can solve. Here, the scope of the term "bug" is quite large. I see a strong analogy to this in the life. We call somebody 'veteran', why? Because s/he possesses a long experience of the field and intuitively can handle/hack most of the situations arise in that domain. That knowledge comes from an experience and ends up in some physical or virtual diaries somewhere which I refer as a 'bag of bugs'.

Sunday, February 5, 2012

How you want to be treated?

The first point that arrives in picture when you take any service which can be from simple dining out to a long international trip : "How would I be treated?". More than five years ago, I remember when I underwent a summer training of customer dealing, I was taught "Remember! You are the face of the company. You portray the image of the company to the customer. So think of your actions and words." This is so true. Each good and bad experience with the companies around reminds me the same lines. I try to see the same point from the both perspective an employee and a customer.

The rule of the world is very interesting: the customer is an employee somewhere and deals with fellow customers directly or indirectly. This makes the situation very easy to understand. For example, we all know that how the bureaucracy sucks sometimes, but only one person sitting on the other side of the table has the power to turn our experience upside down or otherwise. If that person "treats the people as he wants to be treated" the world of bureaucracy will be much simpler. Unfortunately, this is somewhat related to corruption but I do not want to talk about it at the moment. On the contrary, the inverse is also true that "I am treated very badly and the same will now be reflected in my services!" :) So these are directly related nodes of the chain "the customer and the employee".

I hope to see the chain in proper direction and would end with related lines: "Treat the people around the same way you want to be treated!"

Saturday, November 19, 2011

Do you have 'Frames'?

Yesternight I was watching Vinod Dua Live on NDTV, well its my one of the favourites and I feel bad when I miss it. He has the vision and is outspoken though he does his research before making any point. Basically an ideal piece of impressive and effective journalism. He speaks only for 15 minutes and it feels like he has conveyed something that some ordinary person will take whole day to convey.

This is just a recent show video for your reference (Click on the image):



Personally I don't want to be judgemental about his reports nor am here to increase his fan following because it is none of my business though I am a big fan of the show.

Okay coming back to the title: 'Frames' a concept I was taught by somebody in the school that "If you don't want/like something then just put a denial frame in your mind and then you will realize, that thing is no longer a problem for you. Basically your mind learns to ignore that thing very easily."

We have lots and lots of frames in our mind. I don't want to enlist them because they also include some of the social stigmas. Now, why I introduced Mr. Dua's show? Whenever I watch his show and listen to his sharp comments, I feel he tries to break the frames in the minds of India - the frames which are very bad but we are not ready to break them. He tries to make the point and if a citizen tries to incorporate some of them to which she herself agrees, significant improvement would be visible in the society. Basically I don't like to give any advice but I am extremely sorry to say this piece of advice here as I couldn't help it. I think those frames are so strong in our minds that even such strong opinion and sharp journalism is weak to break them.

"Isi Umeed me ki hamara aanewala kal aaj se behtar ho" I sign out!

Sunday, October 16, 2011

Dust is settling down in Spain!

The whole experience of coming over abroad and settle here was beautiful and very emotional. The experience can be seen in three different phases. I try to see an analogy between the situation with the sequence of the events when you first time go for a sky diving. The phase one, is the pre-processing step: It is the time until the day of the flight. I would call that part 'Excitement'. I was so happy and excited to come over and start my work because I was taking a very well deserved vacation of 3-4 weeks after finishing some tight deadlines like: Master's Thesis, Google Summer of Codes, PAN-2011 track participation etc. In the excitement you generally don't think the topic which in this case is to "go abroad", in more depth and knowingly you don't let any negative thought come about your adventure because you are just excited. You want to experience it and also you have to stand by your decision. It is same, when you have decided to go for sky diving and you enjoy your decision, thinking that what a great time you are going to have. Then comes the day of flight. On that day the situation seems real and apparently more real on the airport when you see your family bidding you the final goodbye. Remember, you are still in the excitement phase. As soon as you land, you find somebody to pick you up and you chit-chat for a while and then you go to the house. Rarely you find that you have reached the destination and your luggage has not! Yeah, exactly that happened to me and I was told that my luggage will not be available for two more days because on Tuesday Turkish Airlines does not have any flight to Valencia from Istanbul. Murphy's Law. Then you go to home and sleep tight because you are so tired of the journey and Jet-Lag. The very next day starts the phase called 'Nervousness'. You feel nervous because you are in a completely different environment. You see different people around, sometimes it happens they don't speak your language and even worse that they don't understand your language. Somehow the day is spent and gradually you see your over-ambition for the trip. As soon as you reach home back, you are all alone and you don't have internet and a phone to connect to your world. Now what you have is, a photo of your family and some letters from your girlfriend or wife. That's it, this is the night you are going to cry and repent the decision of coming over. All the negative thoughts which were forced underneath will come out. You somehow take hold of yourself and go asleep. This is the moment which is very crucial for one's stay abroad. It feels the same as when, you are in the airplane for sky diving and your other three friends have already dived and now its your turn. You have to deal with that crucial moment and yes it is crucial because you have always a choice of not to dive! I have seen many people returning to the home country in merely some weeks or a couple of months saying it was very bad there and they didn't like it at all. At that time I used to think why would someone do that. Now I realise, it comes under the phase of 'Nervousness'. Actually in the days of phase 2, if someone doesn't think much about going back and try to see the good things around, it would really help. I started crawling over all the plans I had made before coming over and was searching the reasons which really made me excited to come over. I suddenly noticed, doing that makes me comfortable and I liked that feeling. I notice the improvement in the mental comfort day by day and week on week. Now I really like it here. The dust has settled! Now I realise that I have time for all those things which I wanted to do like walking, cooking, spending lot of time on the research problem I am dealing with and much more. Yes I cook my dinner and weekends' lunch as well most of the times. You can see some of the photos here.



Now starts the third phase called 'Thrill'. The moment you dive, in some time you start enjoying your adventure and you are thrilled! Exactly same is the feeling when you convince yourself that I like it here. In this whole process of settlement, I rejoiced my confidence in self and it is an earned confidence and not the granted one because you see how beautifully you have tackled the situation. This experience is great and has taught me a lot for life!

Sunday, July 24, 2011

A new born baby in FOSS world!

FOSS is Free and Open Source Software. I had a long deprived desire to contribute to the Open Source world. But all I did before 3-4 months, was just to use open-source. I switched my OS to Fedora one year ago. On 20th December 2009 my desire went beyond its upper bound and I searched on google "how to contribute to open source". I found a lot of information but one advice seemed to be the easiest and I chose it. It was "If you want to contribute to the open source then at first you should use it as much as possible." Hence I switched to Fedora officially for almost all of my work.

During my Information Retrieval course I used to use a lot of Open Source academic softwares and that added more respect for FOSS and so the desire to contribute got even bigger. But ideally I couldn't pay much back. Then on 29th Macrh 2011 there was a mail from Paolo [my to be Ph.D. advisor] about Xapian Search Engine Library about their participation in Google Summer of Codes 2011. As I love something related to Information Retrieval I right away started investigating about the whole program and what it is. I learnt that its a great initiative by Google in order to turn more students towards Open Source and to cultivate the knowledge base. I learnt on the very day that last day to submit the application was 8th April means merely 10 days left! I went on #xapian IRC channel which was going to be my life for next 4 months and threw some random questions. Soon there was a reply from Olly a.k.a ojwb [an uber cool geek] for my questions and I was told that still there is a room to discuss the possibility of a new project.

That day itself I thought that Learning-to-Rank can be a great project for Xapian as I have done a lot of research on the topic for my M.Tech thesis. I have used many such search engine libraries like Terrier, Lemur etc but they don't have Learning-to-Rank support. So I went on discussing the project with them and this time there was Richard Boulton a.k.a rboulton [Yet another yet effective Geek] who was going to be my Primary Mentor for the project. They asked me to submit an official proposal for the further discussion. That way it all started. Mostly on 28th August 2011 Xapian is going to be the first open source search engine library with Learning to Rank support in the world. On 25th of April this year the list of selected GSoC students published and my name was there too. It was an overwhelming moment.

At that particular time I was much occupied in my thesis work and hence most of the time during "Community Bonding" period I was working on my thesis and in the later half I started my project for Xapain. I quickly learnt there are quite a few weapons which help you to do good like, SVN, GIT, GNU automake, bugzilla, doxygen etc. So I issued a book from library on them and started my flight. I chose svn for version control repository [git might had been a sane option which I am planning to learn soon] .

Just two weeks before, Mid-term evaluation has got over and I am on my schedule to finish the project. It is such a great feeling - a feeling of self satisfaction that I could give something back to the community who makes a lot of interesting things for the world to use for free. It truly reminds me about the line of movie Antitrust "The knowledge belongs to the world!". GSoC has actually given me a birth in FOSS world and I feel like living there very long.

Thursday, June 30, 2011

Plagiarism Detection

Today the results of the 4th International Competition on Plagiarism Detection Challenge PAN : http://pan.webis.de are declared. We [ I and my collogues] at DA-IICT are regular participants of the competition. Many people ask me that why are you working on this and its a solved problem so what is the scope of research in there?

Well there are pretty good challenges which still require good amount of research. Plagiariser may not be writing the document as a verbatim copy of some other text. He/She may copy the text or matter with slight or high modifications starting from simple addition or deletion of words to more complex manual paraphrasing. With the good translation facilities available, a plagiariser may also translate the contents from source documents. Another challenge may be what to consider as source documents, in some cases you may have to take whole web as source documents. There are plenty of commercial plagiarism detectors available but they are good only when the plagiarised passages are exact copies from the source documents.

Plagiarism Detection has always been a very computationally complex and resource-hungry task. Because it involves sentence to sentence matches [Please don't consider matches as exact matches] and sometimes the documents being compared are some MBs big of raw text.

With the last years proceedings of PAN, it can be seen that many people have tried very innovative ideas to handle above challenges. But translation seems to be still a big challenge.

From translation I can remember of another big challenge. The machine translation technology for Indian languages is still in its infancy phase. You may have read the news of google has extended support for more 5 indian languages in its translation facility but still the quality of machine translation is very bad compared to European languages. You may try it there using some complex or long english statement and trying to translate it in hindi or so.

One such interesting challenge is going to happen in FIRE at IIT Bombay and the task name is CL!TR and its webpage is http://users.dsic.upv.es/grupos/nle/fire-workshop-clitr.html.

Sunday, May 29, 2011

Listening to Your Heart!

One thought dwindled in my mind for last couple of months, that Am I doing What I really want to Do? You may also think of it in this way that you really want to go out for some great natural pictures if you are a photography lover, or you may just want to sit with your guitar and want to try some great songs, or you wanna see whole bunch of movies in your 1 TB hard disk in one week or may be you wanna code something really useful and wanna produce your masterpiece. You may feel indifferent if what you wanna do is not listed above but if its there then you may certainly feel excited. We will consider all those things you want to do as listening to your heart. So you really want to do something but something is stopping you from doing it may it be your job or studies or laziness or any thing. But you should really ask this question to yourself that is it worth not listening to your heart?

I am just coding for my Google Summer of Code project in my college lab and got struck in one nasty error, which I just managed to solve after playing with it for last 5 hours. A sudden smile came to my face as I solved it and that inspired me to share this thought with you all. We can be really very happy if we choose to work what we really like. It is very rare that you get a profession which is very close to something what you really wanted to do in your heart and if you belong to that set then all cheers and you are enjoying what I mean. But if you don't fall in that category then you really should listen to your heart and figure out what is stopping you from doing it and take some time out of your routine and plunge into hearty desires. You will smile someday. Its true. And best thing about it is, smile doesn't take much long to come and you will enjoy.

Another benefit of doing this is you spend some time with yourself, and a bit away from those social networks and you get to enjoy some eternal moments which exclusively created by you and exclusively for you which you really don't want to flaunt on those profiles.

So the idea is you must listen to your heart i.e. should do something what you really like. That may fetch a great happiness to you and sometimes recognition is a by-product of the process.

Wednesday, April 20, 2011

Great Entries at "A Day in India" Campaign of TOI

Earlier I posted on the "A Day in India" campaign of TOI. Now portal has made the entries public. There you will find some videos, photos, cartoons etc on various themes. They may not be that artistic but surely will let you feel something for India. Looking at some of the pictures you may feel pity or shame or proud or a sudden smile may drop by your face. Ultimately you will enjoy.

Well this campaign is little bit nostalgic to me because I was also once upon a time associated with a "Theme based photography contest" called 'Clickerzparadise'. :) !

Yeah don't forget to check the entries out at http://adayinlife.timesofindia.com/photos

Wednesday, April 6, 2011

F.A.L.T.U : A Plagiarised movie from Hollywood movie 'Accepted' : Who will detect Plagiarism?

Those who have seen movie F.A.L.TU. may want to know the fact that it strongly resembles with the Hollywood Flick 'Accepted [2006]'.






"A high school slacker who's rejected by every school he applies to opts to create his own institution of higher learning, the South Harmon Institute of Technology, on a rundown piece of property near his hometown." [IMDB Page of 'Accepted']

Don't these lines make you think of the plot of Bollywood movie F.A.L.T.U? Yes its true, its the same story with a little makeover and in my opinion, they had to do those changes because they were inefficient even to reproduce the same story :D . Well I seriously pity on the debutant director who starts the career from such a plagiarised story and talks about creativity and passion in the movie.

This is not the only plagiarised movie, The list is long and includes some of the big names like 'Gajni' from 'Memento', 'Partner' from 'Hitch' . Sometimes songs are copied from some other songs, and our Anu Malik and Pritam are famous for that.

Plagiarism is prominent also in text, like we use someone else's work or text without explicitly acknowledging the person or source. “You know the feeling while reading an article on a topic related to your own research, you gradually become aware of a strong similarity between the ideas expressed and those you published some time ago. A quick glance at the references cited shows you that your article isn’t mentioned. ”[Garfield, 1980]. Here, as I have given the reference to Garfield so it is not Plagiarism! You may find it very frequent in student reports, even there are very funny cases like professor publishing book from the Ph.D thesis of his/her student.

As one of my research area is Natural Language Processing and somewhat plagiarism detection in text, this kind of incidents provoke me to write something about it. Plagiarism Detection has much moral and social impact than merely a profitable application. Because we help directly the society by making life of the plagiariser hard and promote the original work at the same time make the environment more ethical and authentic.

I sign off with a hope not to come across such cases again!