Thursday, November 15, 2007

Solitude

Happy the man, whose wish and care
A few paternal acres bound,
Content to breathe his native air
In his own ground.

Whose herds with milk, whose fields with bread,
Whose flocks supply him with attire;
Whose trees in summer yield shade,
In winter, fire.

Blest, who can unconcern'dly find
Hours, days, and years, slide soft away
In health of body, peace of mind,
Quiet by day.

Sound sleep by night; study and ease
Together mixed; sweet recreation,
And innocence, which most does please
With meditation.

Thus let me live, unseen, unknown;
Thus unlamented let me die;
Steal from the world, and not a stone
Tell where I lie.

Alexander Pope

Wednesday, November 14, 2007

Create Custom Web config Section

You can build a custom section in web.config file. All you have to do is write a class that will parse that custom section. And it is up you that you may build a data structure from that.

Write the following section anywhere in you configuration node.
<configsections>
<sectiongroup name="CSettings">
<section name="CGroup" type="type name" allowLocation="true" allowDefinition="Everywhere"/>
</sectiongroup>
</configsections>

<csettings>
<cgroup>
<csection name="Shiblee" connectionstring="Password=15236545;Persist Security Info=True;User ID=sa;Initial Catalog= Shiblee;Data Source=CYCOSPS\SQL_SERVER;Timeout=86400" displayname="Shiblee">
<csubsection name="Hand">
<csection>
<cgroup>
<csettings>

Here I defined a custom section and its subsection. Now I will write a class that help to parse this XML node.
[Serializable]
public class CGroup : System.Configuration.IConfigurationSectionHandler
{
private List<csection> sections = new List<csection>();
public CGroup()
{
}
public List<csection> Sections
{
get { return sections; }
set { sections = value; }
}
#region IConfigurationSectionHandler Members
public object Create(object parent, object configContext, System.Xml.XmlNode section)
{
foreach (XmlNode child in section.ChildNodes)
{
if (XmlNodeType.Element == child.NodeType)
sections.Add(new CSection(child));
}
return this;
}
public CSection this[string name]
{
get
{
foreach (CSection sec in sections)
if (sec.Name == name)
return sec;
throw new Exception("No such section define");
}
}
#endregion
}

[Serializable]
public class CSection
{
private Dictionary<string,object> data = null;
private List<csubsection> subSections = null;
public XMLRepository()
{
data = new Dictionary<string,object>();
subSections = new List<csubsection>();
}
private string this[string key]
{
get { return data.ContainsKey(key) ? data[key] : null; }
set { data[key] = value; }
}
public CSection(string name, string connStr, string displayName):this()
{
this.Name = name;
this.ConnectionString = connStr;
this.DisplayName = displayName;
}
public CSection(XmlNode sectionNode) : this()
{
this.Name = sectionNode.Attributes["name"].Value;
this.DisplayName = sectionNode.Attributes["displayName"].Value;
this.ConnectionString = sectionNode.Attributes["connectionString"].Value;
foreach (XmlNode child in repositoryNode.ChildNodes)
if (XmlNodeType.Element == child.NodeType)
this.vaults.Add(new CSubSection(child));
}
public string Name
{
get { return (string)this["name"]; }
set { this["name"] = value; }
}
public string ConnectionString
{
get { return (string)this["connectionString"]; }
set { this["connectionString"] = value; }
}
public string DisplayName
{
get { return (string)this["displayName"]; }
set { this["displayName"] = value; }
}
}

Similarly we can CSubSection too. This is a pretty simple implementation. All you have to do is just implement the interface IConfigurationSectionHandler. And you will get total Xml Node and now you can access it.

System.Configuration.ConfigurationManager.GetSection("CSettings/CSection");

You will get back CGroup object, that’s it.

Tuesday, November 13, 2007

Stream of life

Well, I am being asked by few of my friends about version. This is something funny of course. But there is an inane reason behind it. I just track down major changes in my life. Like version control software. Ok, let me explain a little bit more.

Human being reacts differently with different situation. Even in same kind of situation they may react differently. This is not unusual. And this is not guilt. This cannot be hypocrisy at all. Most of the reaction of human being depends upon time and available information. Ummm, let me explain with an example.

I encounter different things like chocolate, ice-cream, toys etc at our everyday life. But these things do not bring same sort feeling or eagerness. Like once I want to have them every time I saw them. But now these bring nothing inside me. I just want to tell that none of them is false, none of them is lie. Both of them are my feelings. It is time which makes may reaction different. So, the most important conclusion is, if I love you today that do not mean I can’t hate you tomorrow. Again If I hate you tomorrow that does not mean my yesterday was false or I am a hypocrite.

In course of life, people encounter different situation and deceive knowledge from them. And this knowledge helps to decide in future situation. You may achieve some sort of experience that insists you react differently in same kind of situation. This is not crime, this is natural human behavior. Human beings are changing. Only dead body cannot change. This version control phenomenon is just like the same. It just remind me that “How I think that day?” I am trying to notice every major changes in my life, that’s it nothing else.

I will end up with a weird experience of my life. Once I had a friend. At the certain age of our relation I realize that I love her. We spend lot of our time together. And after a certain time later I realize that I don’t love her anymore. But this is my arrogance that perceives me that this is crime. None of us changed. Why don’t you love her anymore? You are a nasty hypocrite. So I always think that I love her. But it was a mistake. Still I don’t know what change my feelings? But I least I can say that none of them was false, none of them was fake. They are just different responses of different time from same person toward same human being.

Wednesday, November 7, 2007

Love & Hate

Love should go toward where it should go, so as well hate. Love is the most intense emotions felt by man; another is hate. If you try to love everyone you only lessen your feelings for those who deserve your love. Repress hatred can lead to many physical and emotional ailments. By learning to release your hatred towards who deserve it, you cleanse yourself of these malignant emotions and need not take your pent-up hatred out on your loved one.

You cannot love everyone; it is ridiculous to think about that. If you love everyone then you just loose your natural power of selection and wind up being a pretty poor judge of character and quality. If anything is used too freely it just looses its true meaning. You don’t have any right to rundown other who deserve your love. Please just consider those who deserve your love before loving everyone.

I don’t find any good reason to spit on your enemies and just let them go thinking “God will punish him”, instead of humiliating them by yourself. This is because of your failures; you don’t have enough courage to show your enemies what they deserve. I don’t find any reason of being happy when they are misfortune by superior power. Never let them go without what they ought to have. Please don’t be skeptic on any occasion.

Frozen

You only see what your eyes want to see
How can life be what you want it to be
Youre frozen
When your hearts not open

Youre so consumed with how much you get
You waste your time with hate and regret
Youre broken
When your hearts not open

Chorus:

Mmmmmm, if I could melt your heart
Mmmmmm, wed never be apart
Mmmmmm, give yourself to me
Mmmmmm, you hold the key

Now theres no point in placing the blame
And you should know I suffer the same
If I lose you
My heart will be broken

Love is a bird, she needs to fly
Let all the hurt inside of you die
Youre frozen
When your hearts not open

(chorus)
(verse)
(chorus, repeat)

Madonna

Friday, November 2, 2007

Sunshine on My Shoulders

Sunshine on my shoulders makes me happy
Sunshine in my eyes can make me cry
Sunshine on the water looks so lovely
Sunshine almost always makes me high

If I had a day that I could give you
Id give to you a day just like today
If I had a song that I could sing for you
Id sing a song to make you feel this way

Sunshine on my shoulders makes me happy
Sunshine in my eyes can make me cry
Sunshine on the water looks so lovely
Sunshine almost always makes me high

If I had a tale that I could tell you
Id tell a tale sure to make you smile
If I had a wish that I could wish for you
Id make a wish for sunshine all the while

Sunshine on my shoulders makes me happy
Sunshine in my eyes can make me cry
Sunshine on the water looks so lovely
Sunshine almost always makes me high
Sunshine almost all the time makes me high
Sunshine almost always

John Denver-Poems, Prayers and Promises'1971

Thursday, November 1, 2007

Babu and I

Babu and I at my home together. This is one of the most beautiful nights as always we have. Sometime we feel if we are of opposite sex or gay, may be we will be the happiest couple in the entire universe.

Just before sleep and we are high

We are friends, we are brothers, we are what we are probably beyond anyone's imagination.

New bonus feature in Version 1.1

A new bonus feature is coming with version 1.1, better communication skill. So, in repercussion better marketing skill as well. This was not supposed to release with version. But, cruel reality taught me that skill. In course of all this process I became aware of these sorts fucking skills. Then, may be this fucking skill help me out to pursue my clients. Hope for the best, may be it will leads me toward my goal.

Tuesday, October 30, 2007

Recursive Database Query

Hi, it is quite a long time I am not writing any technical blog. One important reason is I am out of technical stuffs for long time. And another one is I am not learning any new things. I repeat some boring works regularly.

Whatever, I encounter very interesting thing. At least I found it interesting to me. Recursive Database query. Things are like; say you have a content table in database called ItemContent. And your content is hierarchical. That means some content have parent child relationship among them. And you got a separate table called ItemHierarchy. The relationship is defined in this table. Now you need all the descendant of any item those meets your requirement or May you need descendant required until a specific level. Here I show an interesting recursive query for these sorts of phenomena. This is highly Microsoft SQL specific implementation; you may try it on other database system.

WITH RecursiveTable(ID,Depth) AS

(

SELECT ID,1 FROM [ItemContent] as IC WHERE [Name] = 'root' UNION ALL

SELECT childID,RT.Depth+1 from ItemHierarchy HT inner join RecursiveTable RT ON RT.ID = HT.parentID AND T.Depth <5

)

SELECT ID FROM RecursiveTable;

The query is pretty simple, only interesting thing inside it, it is recursive. The first part sort out the specific parent and the rest will recursively find their descendents. That’s it.

Monday, October 29, 2007

Blog born from Loneliness

This is well known philosophy that people those are lonely maintain dairy. At least some people believe on that way. Blog is a kind of diary. With the blessing of modern technology we are now maintain our diary in website so that people can read it and know about us. They can communicate with us through blog to relief from our loneliness for little bit of moment.

Now days, I am writing blog more frequently than before. Does it mean I am becoming lonelier day by day? May be, this is true. I am becoming lonelier day by day. May be this loneliness insist me to write blogs. Because, I don’t find anyone in my surrounding to whom I share my feelings and that’s why I write them to my blog with the intension of share them with thousands of people. Sometime time I feel I am so lonely that loneliness itself leaves me alone.