Sony Arouje

a programmer's log

Neo4jD–.NET client for Neo4j Graph DB

with 18 comments

Last couple of days I was working on a small light weight .NET client for Neo4j. The client framework is still in progress. This post gives some existing Api’s in Neo4jD to perform basic graph operations. In Neo4j two main entities are Nodes and Relationships. So my initial focus for the client library is to deal with Node and Relationship. The communication between client and Neo4j server is in REST Api’s and the response from the server is in json format.

Let’s go through some of the Neo4j REST Api’s and the equivalent api’s in Neo4jD, you can see more details of Neo4j RestAPi’s here.

The below table will show how to call Neo4j REST Api directly from an application and the right hand will show how to do the same operation using Neo4jD client.

Neo4j Api Equivalent Neo4jD Api
Create Node

POST http://localhost:7474/db/data/node
Accept: application/json
Content-Type: application/json
{"FirstName" : "Sony"}

Response (click here to see full response)

{
  "outgoing_relationships" : "
http://localhost:7474/db/data/node/……..,
  "data" : {
    "foo" : "bar"
  },…..

}

Node sony=new Node();
sony.AddProperty(“FirstName”,”Sony”);
sony.Create();

Get Node by ID
GET http://localhost:7474/db/data/node/3

Response (click here to see full response)

{
  "outgoing_relationships" :
http://localhost:7474/db/……….,
  "data" : {
    "FirstName" : "Sony"
  },
  "traverse" :
http://localhost:7474/db/data. . .{returnType},
..........
}

Node sony=Node.Get(1);
Assert.AreEqual(“Sony”, sony.GetProperty(“FirstName”);

The Neo4jD will create a Rest request to fetch the Node with Id 1 and parse the json response and set the properties and required field.

Create Relationship between two Nodes

POST http://localhost:7474/db/data/node/1/relationships
Accept: application/json
Content-Type: application/json
{"to" :
http://localhost:7474/db/data/node/2, "type" : "wife"}

Response

(click here to see full response)

Node sony=Node.Get(1); //Get an existing node
//Create a new node
Node viji=new Node();
viji.AddProperty(“FirstName”,”Viji”);
viji.Create();

RelationShip relation=sony.CreateRelationshipTo(viji, “wife”);

 

Client lib is still missing some basic features and I am working on it.

The next important part of the library is Graph traversing. Neo4j supports REST api, Cypher and Germlin for Graph traversing. I am currently writing a query creator for Germlin. So the initial version of Neo4jD will only support Germlin.

If any one wants to join the project feels free to send me a personal mail or add a comment. You all can have a look at the code in Git.

Neo4jD Part 2  Neo4jD Part 3  How to Persist Static typed Entities

 

Neo4jD Git Repository

Written by Sony Arouje

February 3, 2012 at 2:28 pm

Posted in .NET

Tagged with , , ,

2011 in review

with 2 comments

The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.

Here’s an excerpt:

The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 46,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 17 sold-out performances for that many people to see it.

Click here to see the complete report.

Written by Sony Arouje

January 1, 2012 at 9:18 pm

Posted in .NET

Multi client Asynchronous TCP Server

with 48 comments

This post is based on a tracer I am currently working on. My current project requires a TCP server implementation where other client could establish communication and perform data processing. The server should be able to handle multiple request from client. I never did any work with TCP Listener, initial one hour struggled a lot to get it working.

First approach I took was kind of Server – Server communication. That means there is no client both system act as server, it’s bit complex but I created a working prototype in next couple of hours. Yes it is complex, client app needs lot of work to establish a connection.

I need the server more simple and less code for the client to establish connection. So I started searching for simple TCP based client server approach. I stumble upon this post, where the author does a multi client communication. I got a start for my second tracer, a true client server model. I modified it and removed looping construct and used Async model instead. You all can see the code below.

TCP Server

    private static TcpListener _listener;
    public static void StartServer()
    {
        System.Net.IPAddress localIPAddress = System.Net.IPAddress.Parse("10.91.173.201");
        IPEndPoint ipLocal = new IPEndPoint(localIPAddress, 8888);
        _listener = new TcpListener(ipLocal);
        _listener.Start();
        WaitForClientConnect();
    }
    private static void WaitForClientConnect()
    {
        object obj = new object();
        _listener.BeginAcceptTcpClient(new System.AsyncCallback(OnClientConnect), obj);
    }
    private static void OnClientConnect(IAsyncResult asyn)
    {
        try
        {
            TcpClient clientSocket = default(TcpClient);
            clientSocket = _listener.EndAcceptTcpClient(asyn);
            HandleClientRequest clientReq = new HandleClientRequest(clientSocket);
            clientReq.StartClient();
        }
        catch (Exception se)
        {
            throw;
        }

        WaitForClientConnect();
    }
}

Here I use a async wait approach rather than waiting in a loop. So whenever a client connect OnClientConnected will fire and it handover the request to Client Request handler. After that it will again go back to wait mode for the next request. The advantage of this approach, the application is responsive and less CPU intensive compare to the looping approach.

Let’s see the client request handler

public class HandleClientRequest
{
    TcpClient _clientSocket;
    NetworkStream _networkStream = null;
    public HandleClientRequest(TcpClient clientConnected)
    {
        this._clientSocket = clientConnected;
    }
    public void StartClient()
    {
        _networkStream = _clientSocket.GetStream();
        WaitForRequest();
    }

    public void WaitForRequest()
    {
        byte[] buffer = new byte[_clientSocket.ReceiveBufferSize];

        _networkStream.BeginRead(buffer, 0, buffer.Length, ReadCallback, buffer);
    }

    private void ReadCallback(IAsyncResult result)
    {
        NetworkStream networkStream = _clientSocket.GetStream();
        try
        {
            int read = networkStream.EndRead(result);
            if (read == 0)
            {
                _networkStream.Close();
                _clientSocket.Close();
                return;
            }

            byte[] buffer = result.AsyncState as byte[];
            string data = Encoding.Default.GetString(buffer, 0, read);

            //do the job with the data here
            //send the data back to client.
            Byte[]  sendBytes = Encoding.ASCII.GetBytes("Processed " + data);
            networkStream.Write(sendBytes, 0, sendBytes.Length);
            networkStream.Flush();
        }
        catch (Exception ex)
        {
            throw;
        }

        this.WaitForRequest();
    }

}

Here also I converted the waiting in loop to Async wait model. The looping model causes a constant hike in CPU utilization. This post explain how to asynchronously read request from client.

That’s all the server side. The client side is shown below

public class TCPClient
{
    System.Net.Sockets.TcpClient clientSocket = new System.Net.Sockets.TcpClient();
    NetworkStream serverStream;
    public void ConnectToServer()
    {
        clientSocket.Connect("10.91.173.201", 8888);

    }

    public void SendData(string dataTosend)
    {
        if (string.IsNullOrEmpty(dataTosend))
            return;
        NetworkStream serverStream = clientSocket.GetStream();
        byte[] outStream = System.Text.Encoding.ASCII.GetBytes(dataTosend);
        serverStream.Write(outStream, 0, outStream.Length);
        serverStream.Flush();
    }

    public void CloseConnection()
    {
        clientSocket.Close();
    }
    public string ReceiveData()
    {
        StringBuilder message = new StringBuilder();
        NetworkStream serverStream = clientSocket.GetStream();
        serverStream.ReadTimeout = 100;
        //the loop should continue until no dataavailable to read and message string is filled.
        //if data is not available and message is empty then the loop should continue, until
        //data is available and message is filled.
        while (true)
        {
            if (serverStream.DataAvailable)
            {
                int read = serverStream.ReadByte();
                if (read > 0)
                    message.Append((char)read);
                else
                    break;
            }
            else if (message.ToString().Length > 0)
                break;
        }
        return message.ToString();
    }
}

As you can see most of the function is very simple to understand except ReceiveData(). I haven’t concentrated much on the client side as client of the actual TCP server will not be a .NET one. I am not discarding the fact, I will refactor ReceiveData().

+Sony Arouje

Written by Sony Arouje

November 25, 2011 at 6:46 pm

Posted in .NET

Tagged with , ,

Decouple Data interchange format from Domain Model

with one comment

I was doing a client app to display some data, the client receive data in xml format. One design constrain for me was, consumer’s domain model should have less impact even if the interchange format changes. So once the domain is loosely coupled, it can work on any type of data. The data can be in XML, JSON, or what ever it is.  This post explains how I achieved it, it’s a very simple approach based on Strategy and Iterator Pattern.

For simplicity, I read the xml data from a file. Below is the xml

<Library>
  <Books>
    <Book Name="CLR via C#" Price="30"></Book>
    <Book Name="Algorithm Design Manual" Price="40"></Book>
  </Books>
</Library>

Parsers

I created a parser class to parse the xml files. Below is the contract and the parser.

public interface IBookDetailsParser:System.Collections.IEnumerator
{
    string getName();
    double getPrice();
}
public class BookDetailsXMLParser:IBookDetailsParser
{
    private int _nodeCount;
    private int _position;
    private XmlDocument _bookDetails;
    public BookDetailsXMLParser(XmlDocument bookDetails)
    {
        this._bookDetails = bookDetails;
        this._position = -1;
        this._nodeCount = _bookDetails.SelectNodes("/Library/Books/Book").Count;
    }
    public string getName()
    {
        return this.getValue("Name");
    }

    public double getPrice()
    {
        return Convert.ToDouble(this.getValue("Price"));
    }

    private string getValue(string attributeName)
    {
        var node = _bookDetails.SelectSingleNode("/Library/Books/Book[" + (_position + 1).ToString() + "]/@" + attributeName);
        if (node == null)
            return string.Empty;

        return node.Value;
    }
    public object Current
    {
        get { return _bookDetails.SelectSingleNode("/Library/Books/Book[" + (_position + 1).ToString() + "]"); }
    }

    public bool MoveNext()
    {
        _position++;
        return (_position < _nodeCount);
    }

    public void Reset()
    {
        _position = -1;
    }
}

As you can see the parser is based on the enumerator pattern.

Domain Model

public class Book
{
    public Book(string name,double price)
    {
        this.Name = name;
        this.Price = price;
    }

    public string Name { get; private set; }
    public double Price { get; private set; }
}
public class BookList
{
    private IBookDetailsParser _bookDetailParser;
    public BookList(IBookDetailsParser bookDetailParser)
    {
        this._bookDetailParser = bookDetailParser;
    }

    public IList<Book> GetBooks()
    {
        IList<Book> books = new List<Book>();
        while (_bookDetailParser.MoveNext())
        {
            Book book = new Book(_bookDetailParser.getName(), _bookDetailParser.getPrice());
            books.Add(book);
        }

        return books;
    }
}

BookList is not aware of what kind of data format it operates on. In case of XML data we can inject the xml parser provided above. Later if we want to change to JSON format then write a json parser implemented by IBookDetailsParser and pass the new json parser to BookList. In this approach any change in data interchange format wont make any impact to our model.

BookService combine all these things together.

public class BookService
{
    public IList<Book> GetAllBooks()
    {
        ServerDataReader dataReader=new ServerDataReader();
        System.Xml.XmlDocument booksXML = dataReader.GetBooks();

        BookList bookList = new BookList(new BookDetailsXMLParser(booksXML));
        return bookList.GetBooks();
    }
}

Any change in the interchange format will affect the BookService. We can make it loosely coupled here as well but that’s not the intention of this post, here I just want to show a loosely coupled domain model from data format.

Written by Sony Arouje

November 16, 2011 at 5:01 pm

Galaxy Tab Oil slick issue–Samsung’s response

with one comment

After I wrote this post, I sent the Link to Samsung India customer support via email. The response was fairly quick, I got a call from technical department and instructed me to contact Samsung UK. So I contacted Samsung UK through email.

Contacting Samsung UK via email is bit tricky as their was no direct link to open the Email popup window, but Samsung India has that option. I noticed that Samsung India’s SITE_ID is 50 and Samsung UK’s is 31. I decided to give a try by copying the email link from Samsung India and just change the SITE_ID from 50 to 31.

The URL for emailing Samsung UK is https://contactus.samsung.com/customer/contactus/formmail/mail/MailQuestionProduct.jsp?SITE_ID=31

Then pasted the new URL in chrome and sent a mail like what I sent to Samsung India. Hoping that I will get some lame excuses some days later. To my surprise I got the response from Samsung UK within 24hrs and they accepted that Samsung is aware of the Oil slick issue. Below is the response I got from Customer support.

Dear Sony
Thank you for contacting Samsung.
In response to your query, please be advised that the "oil slick" issue is something that we are aware has effected a small number of devices within the UK. Do you have a UK residence or an address in the UK? We are offering a service or replacement of these devices within the UK. If you require any further assistance, please contact Samsung again and we will be more than happy to help.

Kind regards
xxxxxxxxxx
Online Support Team
SAMSUNG Customer Support Centre

I provided my contact address in UK and they provided me a service centre address (free and a paid posting address). I had some further clarifications and the support team was very helpful in resolving all the my questions. At last I sent my tab to the address customer support provided. Hopefully I will get my Oil slick free tab in another two weeks. I will update the status once I got my tab in hand.

Written by Sony Arouje

November 15, 2011 at 12:31 am

Diagnostic Trace (SVCLog) configuration for WCF

leave a comment »

Whenever I write any WCF service, I need to search in my snippets to find out the configuration to add Diagnostic traces for WCF. This post help me to pick the configuration any time when ever I need it.

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "F:\Sony\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

 

Adding this configuration allows the WCF to log all the communication between the client and host in xml format. You can view svclog using SvcTraceViewer.exe, it shipped with Visual Studio and can found out in WCF installation location (C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin)

Written by Sony Arouje

November 10, 2011 at 2:34 pm

Posted in .NET, WCF

Tagged with , ,

Read app.config setting during installation

with 2 comments

I am working on a windows service and some specific reason the service name is stored in app.config file. One of the issue I have to solve while creating the installer is reading the service name from app.config of the service. I thought I can read it using ConfigurationManager (default approach). But it will not work out, ConfigurationManager will always return the serviceName as null, even though app.config has value. The reason behind this is the exe running my Installer is InstallUtil.exe and ConfigurationManager will look for InstallUtil.exe.config, so end up getting wrong result.

Google search shows that I have to load the config explicitly and then read the settings. To load the config file we need to specify the file path, I used reflection to get the path. The code is below

Assembly executingAssembly = Assembly.GetAssembly(typeof(WinServiceInstaller));
string targetDir = executingAssembly.Location;

Configuration config = ConfigurationManager.OpenExeConfiguration(targetDir);
string serviceName = config.AppSettings.Settings["ServiceName"].Value.ToString();

 

I called the above code in the constructor of WinServiceInstaller class. Now I am able to access the serviceName from the installer class.

 

 

 

Written by Sony Arouje

November 4, 2011 at 7:06 pm

Posted in .NET, Misc

Tagged with , ,

A Microsoft KB Article–Example of How not to write code

leave a comment »

Couple of weeks back I was doing some parsing of xml string and want to replace the special characters in the data. I didn’t remember the list of special characters, like others I fire up a search in Google. One of the google search result leads to a Microsoft KB article. I got what I wanted, list of special character I have to deal with. The article also provided a special character replacement logic, to my surprise the code was very lengthy and looks odd to me.

I decided to scan the code in little more detail. Below is the code from the article.

Dim filepath As String = "C:\customers.xml"
Private Sub ReplaceSpecialChars(ByVal linenumber As Long)
        Dim strm As StreamReader
        Dim strline As String
        Dim strreplace As String

        Dim tempfile As String = "C:\temp.xml"
        Try
            FileCopy(filepath, tempfile)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

        Dim strmwriter As New StreamWriter(filepath)
        strmwriter.AutoFlush = True

        strm = New StreamReader(tempfile)


        Dim i As Long = 0
        While i < linenumber - 1
            strline = strm.ReadLine
            strmwriter.WriteLine(strline)
            i = i + 1
        End While

        strline = strm.ReadLine
        Dim lineposition As Int32
        lineposition = InStr(strline, "&")
        If lineposition > 0 Then
            strreplace = "&amp;"
        Else
            lineposition = InStr(2, strline, "<")
            If lineposition > 0 Then
                strreplace = "<"
            End If
        End If
        strline = Mid(strline, 1, lineposition - 1) + strreplace + Mid(strline, lineposition + 1)
        strmwriter.WriteLine(strline)

        strline = strm.ReadToEnd
        strmwriter.WriteLine(strline)

        strm.Close()
        strm = Nothing

        strmwriter.Flush()
        strmwriter.Close()
        strmwriter = Nothing

    End Sub

    Public Function LoadXMLDoc() As XmlDocument
        Dim xdoc As XmlDocument
        Dim lnum As Long
        Dim pos As Long
        Dim Newxml As String
        Try
            xdoc = New XmlDocument()
            xdoc.Load(filepath)
        Catch ex As XmlException
            MessageBox.Show(ex.Message)
            lnum = ex.LineNumber
            ReplaceSpecialChars(lnum)

            xdoc = LoadXMLDoc()

        End Try
        Return (xdoc)
    End Function
 

The user calls the LoadXMLDoc() function, the function loads the xml file located in the disk. The weird thing is, the function does a recursive call in the catch block until all the special characters are replaced. Have a look at the line in red.

Let’s go to the ReplaceSpecialChars() function. It creates a temp copy of the original xml file and does the character replacement with several number of IO operation. Think a scenario where we need to deal with an xml data that has some thousand line and each line has special character, we end up doing IO operation thousands of time. Wow what a logic.

Refactored Approach

I rewrote the logic, I used C# as my choice. My approach is simple, read the xml file then format it the way we need it and load it to XMLDocument. Let see my piece of code.

public XmlDocument LoadXMLDoc()
{
    XmlDocument doc = new XmlDocument();
    string xmlToLoad = this.ParseXMLFile();
    doc.LoadXml(xmlToLoad);
    return doc;
}
private string ParseXMLFile()
{
    StringBuilder formatedXML = new StringBuilder();
    StreamReader xmlReader = new StreamReader("CustomerData.xml");
    while (xmlReader.Peek() >= 0)
        formatedXML.Append(this.ReplaceSpecialChars(xmlReader.ReadLine()));
    return formatedXML.ToString();
}
private string ReplaceSpecialChars(string xmlData)
{
    int grtrPosAt = xmlData.IndexOf(">");
    int closePosAt = xmlData.IndexOf("</");
    int lenthToReplace = 0;
    if (grtrPosAt>closePosAt) return xmlData;

    lenthToReplace= (closePosAt<=0 && grtrPosAt<=0)?xmlData.Length:(closePosAt-grtrPosAt)-1;
    //get the string between xml element. e.g. <ContactName>Hanna Moos</ContactName>, 
    //you will get 'Hanna Moos'
    string data = xmlData.Substring(grtrPosAt + 1, lenthToReplace);
    string formattedData = data.Replace("&", "&amp;").Replace("<", "&lt;")
                               .Replace(">", "&gt;").Replace("'", "&apos;");
    xmlData = xmlData.Replace(data, formattedData);
    return xmlData;
}

I took reactive approach rather than waiting the XMLDocument to throw error and rectify it then try loading. ReplaceSpecialChars() function formats the xml string and return it. I spend just 10 minute to come up with this function, so may not be the best one but definitely better than what mentioned in KB article.

Point to note In my approach

  • The IO operation is only once, first time to read the xml file.
  • XMLDocument will get a clean formatted xml to do it’s operation.
  • No recursive call in catch block.
  • LOC is less, so easy to understand.

If you find any better approach, update that in the comment section.

Note: I send a feedback to Microsoft couple of weeks back about the issues in the code but no response yet.

Happy coding …..

Written by Sony Arouje

October 21, 2011 at 2:12 pm

Think twice before buying Samsung Galaxy Tab 10.1

with 5 comments

A month ago I bought a brand new Samsung Galaxy Tab 10.1 (Wi-Fi model, Android 3.1) from UK. Every thing was fine until I reached Bangalore, my luck ran out and it started showing the famous OIL SLICK (Newton Ring) issue. I called up Samsung Customer Care also sent a mail regarding the issue. I got a reply from Customer care that, I should visit a Service center in Bangalore. As per the instruction I went to the Service center to try my luck. Service center told that my issue is a Manufacturing Defect and my Tab 10.1 doesn’t have international warranty so they cant do any thing with my tab. This states one thing that Samsung’s Customer care and Service center are not in sync, pathetic.

I regret my decision of buying Galaxy Tab 10.1, I could have buy iPad2 or any other Android tab. I bought an Android tab because I wanted to do some development in Android world. Galaxy tab 10.1 showcased as one of the best tablet in Android world and I fall into that trap.

Samsung should have guts to admit that their Tab has manufacturing defect and will replace from any where. But till now not a single word from Samsung about this issue, how pathetic.

My advice to others are don’t buy Galaxy Tab 10.1, today or tomorrow your tab also shows Oil Slick issue. If you still want to buy then.

  • Make sure you have a room that’s very cold like refrigerator, research shows that keeping Tab 10.1 in refrigerator for 5 minutes will remove Oil slick for some time. So if you have a very cold room and you work on your Tab in that room, Oil Slick issue may not arise again.
  • Try to win a lottery or wait until you win the lottery. So that you can make sure that you are lucky and the probability of getting Tab without Oil Slick is high (Just buy a low cost lottery, it is to make sure you have luck)
  • Wait until Samsung declares that the Oil Slick issue is permanently resolved.

If you are not specific about Android OS better go for iPad2. I can guarantee that Apple’s customer support is wonderful. I bought an iPhone 3G when it first launched and my phone’s touch screen has some defect. I went to a Apple’s customer care center, after the examination they simply replaced it with a new one. They haven’t asked a single question, no bills, no warranty card just gave me a new phone. As a customer we expect these kind of Customer support what Apple provides not the pathetic and unprofessional support what Samsung is providing.

 

I am not Alone

Google search shows that I am not alone, couple of links talks about this issue. You can search your self and search will come up with more than 10 page search result.

http://galaxytablife.com/2011/07/galaxy-tab-10-1-moisture-oil-slick-problem/

http://forums.cnet.com/7723-13973_102-540466.html

http://www.galaxytabforums.net/forum/galaxy-tab-10-1-help/953-i-have-dreaded-oil-slick-under-screen-problem-my-gt-10-1-what-do.html

 

Some owners replaced their Galaxy tab several times, that shows how wonderfully Samsung manufactured the Tab 10.1. Please spread the awareness to keep people away from purchasing this buggy Galaxy Tab 10.1 

 

Spread the Awareness

Friends spread the news, you may save your friends or family falling into the trap of Galaxy Tab 10.1. If you own a Galaxy Tab let me know your experience by updating in comment section.

All the best if you still considering to buy a Galaxy Tab 10.1

Edit: see the response from Samsung Customer Support UK

Written by Sony Arouje

October 17, 2011 at 11:38 am

Continuous learning and Pet projects

with 4 comments

As a software professional we are living in a world of knowledge explosion. A new framework will introduce in a matter of time to solve our hardship or another vendor introduce a framework superior to the existing ones. Our world is changing day by day, so how we will cop up with the ever changing world of Software industry. Simple answer is Treat programming as a passion not just a profession and Continuous learning.

Learning is not just reading some books or blogs, it also includes implementing what you read by writing a simple application. I can fly an aero plane using Microsoft Flight simulator but how foolish I am If I think that I can fly a real plane because I can fly in simulator. Same applies to software world as well, we have to practice what we read using language of our choice.

In hiring process if I ask about WCF or any xyz prominent framework, one answer I hear most of the time from candidates are “I read about it but never used it, because my  current project is not using it”. To succeed in Software industry are we relying only on our official project?  Its like a F1 driver telling that I will touch the driving wheel only in F1 Race track, does he win the race?

Pet Projects

One of the best way to expand our horizon is working on pet projects. It gives immense opportunity to learn new things that we wont get in official projects. The advantages of a pet project is

  • Their wont be any deadlines.
  • Opportunity to implement what ever you are learning in day to day life.
  • You can scrap the project and start it from the scratch with a new improved design.
  • Test different frameworks and use the best one.
  • Knowledge you gained from pet project can be used in official one.
  • You are the boss do what ever you want with it.
  • And a lot….

A year or two back I was doing some research in Collective intelligence, and I learned couple of algorithms as part of it. I never knew that I will be using what I learned in those days in a completely different context, I used it for counting colors in an image just like how human does. I implemented it it in an official project. Yes time spend in Collective Intelligence paid me off. 

Most of my pet projects wont even see the light, but all of those are high learning curve for me. I learned WPF through a pet called iTraveller. Three years later I scrapped that project and developed in MVVM using Caliburn Micro with a new architecture. It helped me to learn a lot other frameworks, you can see the details of iTraveller here.

Recently I read a post of Ayende and that invites lot of negative feedbacks. Most of the commenters tells lack of time outside official work to do some pet projects or want to spend time with family, etc. With all respect I strongly disagree that, I think most of us can spend an hour every day to sharpen our knowledge. In a long run it will definitely help you.

Learn new Languages

As Pragmatic Programmer book says, learn a new language every year. It’s a wonderful experience and full of challenges. I was working in .NET for so many years and one day got an urge of learning Scala. It was very challenging, I got introduced to new semantics, new IDE, a completely new world. But I learned functional programming. I may not use Scala in my day to day life but I learned lot of good stuff that I may can use in .NET. If you are a WP7 developer, do some thing in Android. Trust me it’s will be a new experience.

Once we start broaden our knowledge, it will shatter our ego and will realize how less we know in the ocean of knowledge.

I was like a boy playing on the sea-shore, and diverting myself now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me. – Isaac Newton

Share what you learn

It will help others if you share what you have learned. If you don’t have a blog start one. A blog is not just for others, it will also help you if you want to look back and find how you solved a scenario before. I consider my blog as a log of solutions, where I can read it when ever a similar situation arise.

 

The post is just a repetition of all other great minds said. I just portrayed through my experience.

 

Happy coding…

Written by Sony Arouje

October 2, 2011 at 10:38 pm

Posted in Misc

Tagged with ,