Wednesday, August 8, 2018

Look with positive attitude...

King - The warrior
Ask yourself - what do you see in above picture?

A great warrior - A king riding on the horse and aiming to shoot down the enemy.

What if I tell you the king had only 1 leg and 1 eye? You will be surprised right?

This is how you see things - if you see the picture positively the king is a great warrior since his only leg is shown and his other eye is covered for aiming.

Look at things positively no matter in which situation you are.

Thursday, August 2, 2018

Build your house and bring happiness for free! - Part of Short Motivational Stories - 2

Building Your House


An elderly carpenter was ready to retire. He told his employer-contractor of his plans to leave the house-building business to live a more leisurely life with his wife and enjoy his extended family. He would miss the paycheck each week, but he wanted to retire. They could get by.

The contractor was sorry to see his good worker go & asked if he could build just one more house as a personal favor. The carpenter said yes, but over time it was easy to see that his heart was not in his work. He resorted to shoddy workmanship and used inferior materials. It was an unfortunate way to end a dedicated career.

When the carpenter finished his work, his employer came to inspect the house. Then he handed the front-door key to the carpenter and said, “This is your house… my gift to you.”

The carpenter was shocked!

What a shame! If he had only known he was building his own house, he would have done it all so differently.

So it is with us. We build our lives, a day at a time, often putting less than our best into the building. Then, with a shock, we realize we have to live in the house we have built. If we could do it over, we would do it much differently.

But, you cannot go back. You are the carpenter, and every day you hammer a nail, place a board, or erect a wall. Someone once said, “Life is a do-it-yourself project.” Your attitude, and the choices you make today, help build the “house” you will live in tomorrow. Therefore, Build wisely!

Find Happiness


Once a group of 50 people were attending a seminar. Suddenly the speaker stopped and decided to do a group activity. He started giving each attendee one balloon. Each one was asked to write his/her name on it using a marker pen. Then all the balloons were collected and put in another room.

Now these delegates were let into that room and asked to find the balloon which had their name written within 5 minutes. Everyone was frantically searching for their name, colliding with each other, pushing around others and there was utter chaos.

At the end of 5 minutes no one could find their own balloon. Now each one was asked to randomly collect a balloon and give it to the person whose name was written on it. Within minutes everyone had their own balloon.

The speaker then began, “This is happening in our lives. Everyone is frantically looking for happiness all around, not knowing where it is.

Our happiness lies in the happiness of other people. Give them their happiness; you will get your own happiness. And this is the purpose of human life…the pursuit of happiness.”

Wednesday, July 25, 2018

Short motivational stories - 1

Short motivational stories - 1



  • Story in life
  • Elephant rope
  • Obstacles
  • School Team
  • The right place


Everyone Has a Story in Life

A 24 year old boy seeing out from the train’s window shouted…

“Dad, look the trees are going behind!”
Dad smiled and a young couple sitting nearby, looked at the 24 year old’s childish behavior with pity, suddenly he again exclaimed…

“Dad, look the clouds are running with us!”

The couple couldn’t resist and said to the old man…

“Why don’t you take your son to a good doctor?” The old man smiled and said…“I did and we are just coming from the hospital, my son was blind from birth, he just got his eyes today.”

Every single person on the planet has a story. Don’t judge people before you truly know them. The truth might surprise you.

The Elephant Rope

As a man was passing the elephants, he suddenly stopped, confused by the fact that these huge creatures were being held by only a small rope tied to their front leg. No chains, no cages. It was obvious that the elephants could, at anytime, break away from their bonds but for some reason, they did not.

He saw a trainer nearby and asked why these animals just stood there and made no attempt to get away. “Well,” trainer said, “when they are very young and much smaller we use the same size rope to tie them and, at that age, it’s enough to hold them. As they grow up, they are conditioned to believe they cannot break away. They believe the rope can still hold them, so they never try to break free.”

The man was amazed. These animals could at any time break free from their bonds but because they believed they couldn’t, they were stuck right where they were.

Like the elephants, how many of us go through life hanging onto a belief that we cannot do something, simply because we failed at it once before?

Failure is part of learning; we should never give up the struggle in life.

The Obstacle in our Path

There once was a very wealthy and curious king. This king had a huge boulder placed in the middle of a road. Then he hid nearby to see if anyone would try to remove the gigantic rock from the road.

The first people to pass by were some of the king’s wealthiest merchants and courtiers. Rather than moving it, they simply walked around it. A few loudly blamed the King for not maintaining the roads. Not one of them tried to move the boulder.

Finally, a peasant came along. His arms were full of vegetables. When he got near the boulder, rather than simply walking around it as the others had, the peasant put down his load and tried to move the stone to the side of the road. It took a lot of effort but he finally succeeded.



The peasant gathered up his load and was ready to go on his way when he say a purse lying in the road where the boulder had been. The peasant opened the purse. The purse was stuffed full of gold coins and a note from the king. The king’s note said the purse’s gold was a reward for moving the boulder from the road.

The king showed the peasant what many of us never understand: every obstacle presents an opportunity to improve our condition.

The Dean Schooled Them

One night four college kids stayed out late, partying and having a good time. They paid no mind to the test they had scheduled for the next day and didn’t study. In the morning, they hatched a plan to get out of taking their test. They covered themselves with grease and dirt and went to the Dean’s office. Once there, they said they had been to a wedding the previous night and on the way back they got a flat tire and had to push the car back to campus.

The Dean listened to their tale of woe and thought. He offered them a retest three days later. They thanked him and accepted his offer.hat time.

When the test day arrived, they went to the Dean. The Dean put them all in separate rooms for the test. They were fine with this since they had all studied hard. Then they saw the test. It had 2 questions.

1) Your Name __________ (1 Points)

2) Which tire burst? __________ (99 Points)
Options – (a) Front Left (b) Front Right (c) Back Left (d) Back Right

The lesson: always be responsible and make wise decisions.

The Right Place

A mother and a baby camel were lying around under a tree.

Then the baby camel asked, “Why do camels have humps?”

The mother camel considered this and said, “We are desert animals so we have the humps to store water so we can survive with very little water.”

The baby camel thought for a moment then said, “Ok…why are our legs long and our feet rounded?”

The mama replied, “They are meant for walking in the desert.”

The baby paused. After a beat, the camel asked, “Why are our eyelashes long? Sometimes they get in my way.”

The mama responded, “Those long thick eyelashes protect your eyes from the desert sand when it blows in the wind.

The baby thought and thought. Then he said, “I see. So the hump is to store water when we are in the desert, the legs are for walking through the desert and these eye lashes protect my eyes from the desert then why in the Zoo?”

The Lesson: Skills and abilities are only useful if you are in the right place at the right time. Otherwise they go to waste.

Friday, August 2, 2013

SignalR and WCF Custom TraceListener Integration

SignalR – recently created a demo application on this. Cool new technology from Microsoft again for  a "real web" experience.

WCF custom TraceListener – created a demo application – custom trace listener on top of a WCF service, hooked it up with SignalR. Now my clients can open a web page and can view what their services are working on....


#trivedimehulk@gmail.com

Tuesday, March 12, 2013

Entity Framework Wrappers – Part 2 – AppFabric and “effective caching” with EF integration aka “second level caching with EF” – simplified!

Entity Framework Wrappers – Part 2 – AppFabric and "effective caching" with EF integration aka "second level caching with EF" – simplified!

Problem statement: I want my SQL data to be cached in a way where my EF calls still work seamlessly without doing any major code change but the data is retrieved either from SQL store or a cache store if it's cached already. Also if the data is updated in my DAL layer using EF context.save() methods, it should invalidate the cache store automatically for that entity.

Solution: Use EF wrappers "http://efwrappers.codeplex.com/" and use caching provider toolkit

Rough diagram for understanding how it works (before/after):

Before:



After:




Description:
The way it works is every simple. With EF wrappers we get to create a new entity connection in the extended object context class. The new improved entity connection executes the T-SQL query generated by LINQ TO ENTITIES code against either the SQL store OR the app fabric.
For SQL store to understand the t-sql query is fine but for appfabric (or any other cache store) cannot understand the t-sql lingo :) ??? 

Bingo! The EF caching wrapper classes [EFCachingCommand.cs] creates the required methods for executing DB readers etc and before going to SQL store a small code snippet like below is injected :) which checks if the cache is already having the required result set OR entity object or anything :)

Required components:
Windows App Fabric Server (installed, configured and running) OR Azure [I haven't tried with azure yet]
VS 2010 or above
A SQL database

Reference material:
A working solution attached in zip file:Link


Tuesday, March 5, 2013

Entity Framework Provider Wrappers - trap the monster!

Entity Framework Provider Wrappers

I want to know what my entity framework code is executing under the hood?

I want to trap the SQL code entity framework is sending to my sql server and wants to inject something?

I want to profile my entity framework object context sql calls?

Answers to all above questions: http://efwrappers.codeplex.com/

A very good handful set of provider wrappers provided by Microsoft which you can plug in and start trapping EF.

I crated my own version which works as a service, provides a trappable entity framework connection to any remote client. J

#trivedimehulk@gmai.com

Monday, January 21, 2013

How do i quickly find and attach the w3wp if i am running multiple sites?

All folks who work on VS and ASP.NET and work on multiple web projects/websites finds its very tedious to find and attach the right solution to right application pool. Go to command prompt, find application pool ID, go to debug -> attach process and attach it…..grrrrrrrrr!

I wrote a small macro which you can put in your macros and give it a short cut and will be really quick to do above of all and attach w3wp easily with 3 keyboard clicks.

=++++++++++++++++++ code snippet
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Imports System.Windows.Forms
'Author: Mehul T - 1/12/2012
Public Module AcmeAttachProcessMacro

    Public Sub AcmeAttachProcess()
        Try
            Dim process = New System.Diagnostics.Process()
            process.StartInfo.FileName = "C:\Windows\system32\inetsrv\appcmd.exe"
            process.StartInfo.Arguments = "list wp"
            process.StartInfo.UseShellExecute = False
            process.StartInfo.CreateNoWindow = True
            process.StartInfo.RedirectStandardOutput = True
            process.Start()
            Dim output As String = process.StandardOutput.ReadToEnd()
            process.WaitForExit()
            Dim PID As String = InputBox(output, "Enter process ID from following list:")
            If PID.Length > 0 Then
                Dim Processes As EnvDTE.Processes = DTE.Debugger.LocalProcesses
                For Each processEach In Processes
                    If (processEach.ProcessID = Int32.Parse(PID)) Then
                        processEach.Attach()
                    End If
                Next
            End If
        Catch ex As Exception
            MessageBox.Show("Error:" + ex.Message)
        End Try
    End Sub
End Module

++================================

#trivedimehulk@gmail.com