Tuesday, 24 April 2012

GSoC 2012 - Networking Dashboard

My proposal for 'Networking Dashboard' for 'Mozilla' got selected for GSoC 2012 today :).
I have been a contributor to Mozilla for a long time now. Till now mostly it was bug fixes.
But now I will be working on something real for Mozilla. My project is to make a tool for developers which allows them to have an insight of Mozilla networking. Google chrome already has something similar - "chrome://net-internals". This tool will be implemented as an add-on. The link to my proposal is here. It has a description about what functionality will be implemented. I wish I have a link to the add-on soon. I might blog about my experience with necko and about my progress in future. Stay tuned.

Fun with Flotype

I came across this new start up Flotype through a blog at hacker news.
It provides cross-language services to expose data and realtime updates to client devices and browsers.
They have simple APIs which can be used right away.  So I created a new account and started playing with the beta version. My first idea is to setup the server on my laptop and client on my android phone. So whenever server receives the message, it makes a system call for the message. That way I could use my laptops terminal remotely. Since it's available only in Javascript,Java,Ruby and Python, I chose Java.
First of all I created a server on my laptop:
 import com.flotype.bridge.*;  
 class ChatObj implements BridgeObject {  
   public void message(String sender, String message) {  
     System.out.println(sender + ":" + message);  
     Process execAcrobatPrs=null;  
     try{  
       execAcrobatPrs = Runtime.getRuntime().exec(new String[]{"sh", "-c",message});  
    }  
    catch(Exception ex)  
    {  
              System.out.println(ex);  
       if(execAcrobatPrs!=null)  
       {  
          execAcrobatPrs.destroy();  
       }  
       ex.printStackTrace();  
       System.exit(-1);  
    }  
   }  
 }  
 public class AuthServer {  
   public static void main(String[] args) throws Exception {  
     Bridge bridge = new Bridge()  
     .setApiKey("myprivatekey");  
     bridge.joinChannel("channel-name", new ChatObj());  
     bridge.connect();  
   }  
 }  
and the client for android:
 package com.jiten;  
 import java.io.IOException;  
 import com.flotype.bridge.*;  
 import android.app.Activity;  
 import android.os.Bundle;  
 import android.util.Log;  
 import android.view.View;  
 import android.view.View.OnClickListener;  
 import android.widget.Button;  
 import android.widget.EditText;  
 interface RemoteChat extends BridgeRemoteObject {  
   public void message(String sender, String message);  
 }  
 public class MessageSenderActivity extends Activity implements OnClickListener{  
   /** Called when the activity is first created. */  
   @Override  
   public void onCreate(Bundle savedInstanceState) {  
     super.onCreate(savedInstanceState);  
     setContentView(R.layout.main);  
     Button b = (Button) findViewById(R.id.button1);  
     b.setOnClickListener((android.view.View.OnClickListener) this);  
   }  
      @Override  
      public void onClick(View arg0) {  
           if(arg0.getId() == R.id.button1) {  
                EditText t = (EditText) findViewById(R.id.editText1);  
                Bridge bridge = new Bridge().setApiKey("myprivatekey");  
          RemoteChat channel = bridge.getChannel("channel-name", RemoteChat.class);  
          channel.message("Jiten", t.getText().toString());  
          try {  
                     bridge.connect();  
                } catch (IOException e) {  
                     // TODO Auto-generated catch block  
                     e.printStackTrace();  
                }  
           }  
      }  
 }  


That's it. Now I can run any terminal command from my laptop through my android phone.
This still is not interactive so it's of no use for commands like 'ls' but you can run applications in which you don't need interaction.
Well, I can't think of any important use for this but it was fun starting 'Catalyst' in my laptop through a command in my mobile phone. In future I might improve it for interactivity. 



Wednesday, 4 January 2012

Electives!!!

"Which electives are you going to take?" - asked one of my friends. This was the 5th time today someone asked me about my electives this semester.I hadn't even thought this much over my college selection.
              Sem 6 - probably the most feared(or hyped) semester here at DA-IICT. It is said that if you survived 3rd and 6th semester here, then you can survive DA-IICT. The main source of this fear is SEN(Software Engineering) - the course in which you have to develop a software throughout the semester from scratch in a team of 9-10 students not of your choice. It doesn't stop there. There are one and half hour lectures and 3 hour of lab and exams too and evaluation process in which you have to prioritise your team mates at the end of the  semester in order of the efforts he/she has put in the process. This is just too much. You have to screw all other subjects in order to excel in this only one subject which is forced on us. God knows what is to come.
First lecture - Every one had heard rumours about the course and wondering what bombs of surprise the instructor had in his mind. He began spelling his rules, going through the slides one-by-one and with every change of the slide, there were expressions like  'oh shit!' or 'oh fuck!' and people just staring each other's faces in despair. Well, I just wanted to get out of there.

Back to elective. You have to follow some rules or prerequisites in order to graduate. Here are rough rules:
1) You must finish 143 credits  except the credits of pass fail courses -> mine - 109.5 so far
2) You must have taken 2 or more Group Electives -> done.
    If you take more than 2 GE, it will be converted to technical elective.
3) You must have taken 2 or more Science Electives - > 0
4) You must have taken at least 1 and at most 3(or 4 not sure) Open Elective->done(thank god :) )

Here are the slots -



Since  I hadn't taken any SE in last semester and had taken 2 GE instead, I shall take one SE in this semester. So, my choices are
Slot 1 - Introduction to Information Retrieval
Slot 2 - Artificial neural networks and Fuzzy systems
Slot 3 - Operating System(Though I wanted to take ESP, I have to take this course              because it is necessity for an IT student to have on his transcript )
Slot 4 - Coding Theory
Slot 5 - Digital Image Processing

             And last but definitely not the least
Slot 6 - SEN (Software Engineering)


Since there are many electives to choose from, the whole batch will be divided and the lectures will be in small CEP rooms which I think is a good thing because I have always hated the huge Lecture Theatre in which I can't concentrate on what the instructor is teaching(It's a weird thing). I hope I will be able to pay more attention in the lecture in small class rooms and also have improvement on my grades.

(This is my first blog ever. I hope there are not much grammatical mistakes and I am lazy to recheck the post for mistakes)