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

Thursday, October 11, 2012

Solved... IE 8 navigation issue when using "Request.UrlReferrer.ToString();" and javascript navigation...

Solved... IE 8 navigation issue when using "Request.UrlReferrer.ToString();" and javascript navigation...

Scenario: I have a page1.aspx where I have a button and JS click event with window.location.href to page2.aspx. Now when I click cancel on page2.aspx it should nav back to page1.aspx. But since IE8 has security restrictions, it gives “Request.UrlReferrer” as NULL and cant navigate back.

Resolution: when you know you are just going to navigate why to use javasript. Just wrap the button around a href and it will work J also same href can b clicked using a JS right?

J

#trivedimehulk@gmail.com

Thursday, August 23, 2012

The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..

The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..

Client is using basicHTTP and server is exposting wsHTPP or something like that since both uses diff version of SOAP

Soap 1 – text/xml
Soap 2 - */xml

Regards,
#trivedimehulk@gmail.com

Monday, March 26, 2012

Big data...


Big data is data that exceeds the processing capacity of conventional database systems. The data is too big, moves too fast, or doesn't fit the strictures of your database architectures. To gain value from this data, you must choose an alternative way to process it.
The hot IT buzzword of 2012, big data has become viable as cost-effective approaches have emerged to tame the volume, velocity and variability of massive data. Within this data lie valuable patterns and information, previously hidden because of the amount of work required to extract them. To leading corporations, such as Walmart or Google, this power has been in reach for some time, but at fantastic cost. Today's commodity hardware, cloud architectures and open source software bring big data processing into the reach of the less well-resourced. Big data processing is eminently feasible for even the small garage startups, who can cheaply rent server time in the cloud.
The value of big data to an organization falls into two categories: analytical use, and enabling new products. Big data analytics can reveal insights hidden previously by data too costly to process, such as peer influence among customers, revealed by analyzing shoppers' transactions, social and geographical data. Being able to process every item of data in reasonable time removes the troublesome need for sampling and promotes an investigative approach to data, in contrast to the somewhat static nature of running predetermined reports.
The past decade's successful web startups are prime examples of big data used as an enabler of new products and services. For example, by combining a large number of signals from a user's actions and those of their friends, Facebook has been able to craft a highly personalized user experience and create a new kind of advertising business. It's no coincidence that the lion's share of ideas and tools underpinning big data have emerged from Google, Yahoo, Amazon and Facebook.
The emergence of big data into the enterprise brings with it a necessary counterpart: agility. Successfully exploiting the value in big data requires experimentation and exploration. Whether creating new products or looking for ways to gain competitive advantage, the job calls for curiosity and an entrepreneurial outlook.

What does big data look like?

As a catch-all term, "big data" can be pretty nebulous, in the same way that the term "cloud" covers diverse technologies. Input data to big data systems could be chatter from social networks, web server logs, traffic flow sensors, satellite imagery, broadcast audio streams, banking transactions, MP3s of rock music, the content of web pages, scans of government documents, GPS trails, telemetry from automobiles, financial market data, the list goes on. Are these all really the same thing?
To clarify matters, the three Vs of volume, velocity and variety are commonly used to characterize different aspects of big data. They're a helpful lens through which to view and understand the nature of the data and the software platforms available to exploit them. Most probably you will contend with each of the Vs to one degree or another.

Volume

The benefit gained from the ability to process large amounts of information is the main attraction of big data analytics. Having more data beats out having better models: simple bits of math can be unreasonably effective given large amounts of data. If you could run that forecast taking into account 300 factors rather than 6, could you predict demand better?
This volume presents the most immediate challenge to conventional IT structures. It calls for scalable storage, and a distributed approach to querying. Many companies already have large amounts of archived data, perhaps in the form of logs, but not the capacity to process it.
Assuming that the volumes of data are larger than those conventional relational database infrastructures can cope with, processing options break down broadly into a choice between massively parallel processing architectures — data warehouses or databases such as Greenplum — and Apache Hadoop-based solutions. This choice is often informed by the degree to which the one of the other "Vs" — variety — comes into play. Typically, data warehousing approaches involve predetermined schemas, suiting a regular and slowly evolving dataset. Apache Hadoop, on the other hand, places no conditions on the structure of the data it can process.
At its core, Hadoop is a platform for distributing computing problems across a number of servers. First developed and released as open source by Yahoo, it implements the MapReduce approach pioneered by Google in compiling its search indexes. Hadoop's MapReduce involves distributing a dataset among multiple servers and operating on the data: the "map" stage. The partial results are then recombined: the "reduce" stage.
To store data, Hadoop utilizes its own distributed filesystem, HDFS, which makes data available to multiple computing nodes. A typical Hadoop usage pattern involves three stages:
·         loading data into HDFS,
·         MapReduce operations, and
·         retrieving results from HDFS.
This process is by nature a batch operation, suited for analytical or non-interactive computing tasks. Because of this, Hadoop is not itself a database or data warehouse solution, but can act as an analytical adjunct to one.
One of the most well-known Hadoop users is Facebook, whose model follows this pattern. A MySQL database stores the core data. This is then reflected into Hadoop, where computations occur, such as creating recommendations for you based on your friends' interests. Facebook then transfers the results back into MySQL, for use in pages served to users.

Velocity

The importance of data's velocity — the increasing rate at which data flows into an organization — has followed a similar pattern to that of volume. Problems previously restricted to segments of industry are now presenting themselves in a much broader setting. Specialized companies such as financial traders have long turned systems that cope with fast moving data to their advantage. Now it's our turn.
Why is that so? The Internet and mobile era means that the way we deliver and consume products and services is increasingly instrumented, generating a data flow back to the provider. Online retailers are able to compile large histories of customers' every click and interaction: not just the final sales. Those who are able to quickly utilize that information, by recommending additional purchases, for instance, gain competitive advantage. The smartphone era increases again the rate of data inflow, as consumers carry with them a streaming source of geolocated imagery and audio data.
It's not just the velocity of the incoming data that's the issue: it's possible to stream fast-moving data into bulk storage for later batch processing, for example. The importance lies in the speed of the feedback loop, taking data from input through to decision. A commercial from IBM makes the point that you wouldn't cross the road if all you had was a five-minute old snapshot of traffic location. There are times when you simply won't be able to wait for a report to run or a Hadoop job to complete.
Industry terminology for such fast-moving data tends to be either "streaming data," or "complex event processing." This latter term was more established in product categories before streaming processing data gained more widespread relevance, and seems likely to diminish in favor of streaming.
There are two main reasons to consider streaming processing. The first is when the input data are too fast to store in their entirety: in order to keep storage requirements practical some level of analysis must occur as the data streams in. At the extreme end of the scale, the Large Hadron Collider at CERN generates so much data that scientists must discard the overwhelming majority of it — hoping hard they've not thrown away anything useful. The second reason to consider streaming is where the application mandates immediate response to the data. Thanks to the rise of mobile applications and online gaming this is an increasingly common situation.
Product categories for handling streaming data divide into established proprietary products such as IBM'sInfoSphere Streams, and the less-polished and still emergent open source frameworks originating in the web industry: Twitter's Storm, and Yahoo S4.
As mentioned above, it's not just about input data. The velocity of a system's outputs can matter too. The tighter the feedback loop, the greater the competitive advantage. The results might go directly into a product, such as Facebook's recommendations, or into dashboards used to drive decision-making.
It's this need for speed, particularly on the web, that has driven the development of key-value stores and columnar databases, optimized for the fast retrieval of precomputed information. These databases form part of an umbrella category known as NoSQL, used when relational models aren't the right fit.
Microsoft SQL Server is a comprehensive information platform offering enterprise-ready technologies and tools that help businesses derive maximum value from information at the lowest TCO. SQL Server 2012 launches next year, offering a cloud-ready information platform delivering mission-critical confidence, breakthrough insight, and cloud on your terms; find out more at www.microsoft.com/sql.

Variety

Rarely does data present itself in a form perfectly ordered and ready for processing. A common theme in big data systems is that the source data is diverse, and doesn't fall into neat relational structures. It could be text from social networks, image data, a raw feed directly from a sensor source. None of these things come ready for integration into an application.
Even on the web, where computer-to-computer communication ought to bring some guarantees, the reality of data is messy. Different browsers send different data, users withhold information, they may be using differing software versions or vendors to communicate with you. And you can bet that if part of the process involves a human, there will be error and inconsistency.
A common use of big data processing is to take unstructured data and extract ordered meaning, for consumption either by humans or as a structured input to an application. One such example is entity resolution, the process of determining exactly what a name refers to. Is this city London, England, or London, Texas? By the time your business logic gets to it, you don't want to be guessing.
The process of moving from source data to processed application data involves the loss of information. When you tidy up, you end up throwing stuff away. This underlines a principle of big data: when you can, keep everything. There may well be useful signals in the bits you throw away. If you lose the source data, there's no going back.
Despite the popularity and well understood nature of relational databases, it is not the case that they should always be the destination for data, even when tidied up. Certain data types suit certain classes of database better. For instance, documents encoded as XML are most versatile when stored in a dedicated XML store such asMarkLogic. Social network relations are graphs by nature, and graph databases such as Neo4J make operations on them simpler and more efficient.
Even where there's not a radical data type mismatch, a disadvantage of the relational database is the static nature of its schemas. In an agile, exploratory environment, the results of computations will evolve with the detection and extraction of more signals. Semi-structured NoSQL databases meet this need for flexibility: they provide enough structure to organize data, but do not require the exact schema of the data before storing it.

In practice

We have explored the nature of big data, and surveyed the landscape of big data from a high level. As usual, when it comes to deployment there are dimensions to consider over and above tool selection.

Cloud or in-house?

The majority of big data solutions are now provided in three forms: software-only, as an appliance or cloud-based. Decisions between which route to take will depend, among other things, on issues of data locality, privacy and regulation, human resources and project requirements. Many organizations opt for a hybrid solution: using on-demand cloud resources to supplement in-house deployments.

Big data is big

It is a fundamental fact that data that is too big to process conventionally is also too big to transport anywhere. IT is undergoing an inversion of priorities: it's the program that needs to move, not the data. If you want to analyze data from the U.S. Census, it's a lot easier to run your code on Amazon's web services platform, which hosts such data locally, and won't cost you time or money to transfer it.
Even if the data isn't too big to move, locality can still be an issue, especially with rapidly updating data. Financial trading systems crowd into data centers to get the fastest connection to source data, because that millisecond difference in processing time equates to competitive advantage.

Big data is messy

It's not all about infrastructure. Big data practitioners consistently report that 80% of the effort involved in dealing with data is cleaning it up in the first place, as Pete Warden observes in his Big Data Glossary: "I probably spend more time turning messy source data into something usable than I do on the rest of the data analysis process combined."
Because of the high cost of data acquisition and cleaning, it's worth considering what you actually need to source yourself. Data marketplaces are a means of obtaining common data, and you are often able to contribute improvements back. Quality can of course be variable, but will increasingly be a benchmark on which data marketplaces compete.

Culture

The phenomenon of big data is closely tied to the emergence of data science, a discipline that combines math, programming and scientific instinct. Benefiting from big data means investing in teams with this skillset, and surrounding them with an organizational willingness to understand and use data for advantage.
In his report, "Building Data Science Teams," D.J. Patil characterizes data scientists as having the following qualities:
·         Technical expertise: the best data scientists typically have deep expertise in some scientific discipline.
·         Curiosity: a desire to go beneath the surface and discover and distill a problem down into a very clear set of hypotheses that can be tested.
·         Storytelling: the ability to use data to tell a story and to be able to communicate it effectively.
·         Cleverness: the ability to look at a problem in different, creative ways.
The far-reaching nature of big data analytics projects can have uncomfortable aspects: data must be broken out of silos in order to be mined, and the organization must learn how to communicate and interpet the results of analysis.
Those skills of storytelling and cleverness are the gateway factors that ultimately dictate whether the benefits of analytical labors are absorbed by an organization. The art and practice of visualizing data is becoming ever more important in bridging the human-computer gap to mediate analytical insight in a meaningful way.
Wow!
#trivedimehulk@gmail.com