Welcome to Yuva's site

Recent posts

Select the no of posts to be viewed in this page.

'Google listed my name in auto suggest'

 

Its been quite few years back, Google started listing my name in the search auto suggest.

I think this is one of the remarkable achievement in my life.

Yuvaraj delli Search

Yuvahere Search

-Yuva

'Five grains of rice'

A rich man has four sons. As he grows old, he decides to give his property to the son who would value the wealth he had earned. He calls his four sons and gives them each five grains of rice. He tells them that he shall ask for these grains at the end of 5 years & he would give his property to the son who would value these grains the most.
The first son throws away the grains. He decides to show his father some other grains when he would ask for them after 5 yrs, in anticipation that his father would not be able to see the difference between the two sets of grains.
The second son eats the grains. He too decides to show his father some other grains when he would ask for them after 5 yrs, in anticipation that his father would not be able to see the difference between the two sets of grains.
The third son preserves these grains in a silver box and keeps the silver box in the 'puja sthaan' at home, and offers prayers to the box while offering his prayers to God for 5 yrs.
The fourth son sows these grains and cultivates them in the backyard of his house. They grow into crops during the harvest season. He keeps re sowing the grains from these crops. In due course, he has a vast plot of land cultivated with rice.
As apparent from the above mentioned, at the end of 5 yrs, the father gives his property to his fourth son, as he was the most deserving among his four sons.


Moral of the Story:
When you have anything little in your hands, look at opportunity to grow it. Don't feel sad if you have less money today, know that you have it and you can grow it. 

-Yuva

'The History of Hubble'

The Hubble Space Telescope was launched by the Space Shuttle Discovery on April 24, 1990. The launch of a space based telescope was one the greatest advances in astronomy in human history, and it would lead to many other space based observatories. Hubble's mission was to allow humanity to see more, see farther, and see deeper into the past of the universe. Discovery placed the Hubble Space Telescope in an orbit around the Earth at the farthest reaches of the upper atmosphere. The telescope was placed in such a high orbit because it gives astronomers a view of the universe that typically far surpasses that of any ground-based telescopes, due to the fact that the atmosphere distorts and blocks the some of the light that reaches our planet. Hubble is also one of NASA's most successful and longest-lasting science missions. It has beamed hundreds of thousands of images back to Earth, shedding light on many of the great mysteries of astronomy. Its gaze has helped determine the age of the universe, the identity of quasars, and the existence of black holes.

 

Do you know where the Hubble Space Telescope is? It could be overhead or located somewhere else in the sky. When displayed in Sky, you can see where Hubble is projected on the background of stars, and it updates as Hubble moves! Is Hubble visible tonight? Have a look. You will need to switch to Sky in Google Earth 4.2 to view this content.

Currently it is now above California…

image

http://bit.ly/gbknCw –> Click on the link below to track where is Hubble now??

-Yuva

http://Yuvahere.com

'Spotted flight in Google Earth'

 

When I was searching for routes in Google earth, unexpectedly spotted a flight near the Guindy bridge, Chennai. To let know the exact location itz (13.00.20.31 , 80.12.17.14)

image

-Yuva

http://Yuvahere.com

'Terminology in Hacking'

Here’s the few terminology used/ called in hacking sphere.

Hacking run
essentially, a hacking run is a hacking session that lasts longer than normal working times, i.e. a hacking run that lasts for in excess of eight to ten hours.


White Hat
considered one of nice guys, a white hat hacker is one who hacks and the informs the owner of the hacking


Black Hat
in contrast, the black hat hacker is considered a criminal and uses his/her skills to break the law


Gray Hat
as one would imagine, a gray hat hacker sometimes is good, and sometimes is criminal; a combination of the white and black hat

Script Kiddie
a demeaning term, used for those who hack but do so by following directions and not creating anything of their own

Trojan horse
deceptive programs that pretend they do one thing, only to enter the computer system and do another; however, they need not be bad for the computer


Virus
a self-replicating program that inserts itself into executable codes or documents


Worm
also a self-replicating program, but a worm breeds itself in computer systems.

-Yuva

http://Yuvahere.com

'Robotics – Takes control of future'

Yes, Its indeed… As humans are becoming very Costly/ Lazy/ Paranoid/ Phobia/ … What so ever.

Microsoft have also took its stand on this sector.

They have come up with MSRDS (Microsoft Robotics Development Studio)

 

Ever since I have presented a paper on Neural networks and Fuzzy logic in my graduation, I had liking towards this Robotics.

I have started learning this Robotics studio development and the Visual Programming language 2008 R3. This is real exiting.

Here’s the few samples

1. Don’t expect coffee on Sunday’s

Usually I don’t get coffee on holidays in my home, yes, Its an holiday for my mom too. In the usual Sunday morning I woke up my mom and was asking for a cup of coffee. She didn’t respond. Then bored of asking her, I made up a VPL program and asked my robot to ask for a coffee instead of me. Here’s the code.

Then also she didn’t respond, I have increased the looping count to 100 and the rest of the things you can imagine what could have happened.

Order Coffee

 

2. Move your, Lego NXT Tribot (left, right, fwd, bwd)

Now serious one, I have a huge set of simulation environment set up with my computer along with the package. Yes, of course this simulation environments runs based on Physics engine. And also your computer must be smart(Fast) enough to run those simulation environments.

Lego robot is a simple educational robo from Mindstorms. You can program it through MSRDS. For test purpose, here’s the code which can be driven from your computer in the simulation environments provided.

This code below, will move the robo left, right, forward and backwards.

Lego Robo

If you have the robo, and the respective joystick, here’s the same code which runs with joystick.

image

You can see the simulation environment snapshot here…

Lego Simulation

 

Will be posting more cool robotics stuff, hang on and subscribe to the RSS feed.

-Yuva

http://Yuvahere.com

'HTTP errors in IIS 7.0'

Have you installed fresh IIS 7.0 into the server??

Yes, probably you could face this error at first time…

ERROR 1

HTTP Error 404.17 - Not Found

The requested content appears to be script and will not be served by the static file handler.

 

image

 

This is because ASP.net installation was not registered correctly. Try the following steps to register it.

run %windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe –i

And the next possible error very often at first time is

ERROR 2

HTTP Error 404.17 - Not Found

The requested content appears to be script and will not be served by the static file handler.

 

image

This is because you have not enabled the permission for ISAPI and CGI restrictions

Just do the following steps and this will help

# Install the feature that handles this request. For example, if you get this error for an .ASPX page, you may have to install ASP.NET via IIS setup.
# Verify that the Web service extension requested is enabled on the server.

   1. Open the IIS Manager and navigate to the server level.
   2. In the Features view, double-click ISAPI and CGI Restrictions to verify that the Web service extension is set to Allowed.
   3. If the extension is not in the list, click Add in the Actions pane.
   4. In the Add ISAPI and CGI Restrictions dialog box, type the path of the .dll or .exe file in the ISAPI or CGI Path box, or click Browse to navigate to the location of the file.
   5. In the Description box, type a brief description of the restriction.
   6. (Optional) Check "Allow extension path to execute" to allow the restriction to run automatically. If you do not check this option, the restriction status is Not Allowed, which is the default. You can allow the restriction later by selecting it and clicking Allow on the Actions pane.
   7. Click OK.

 

Explore IIS with freedom..

-Yuva

http://Yuvahere.com

'What happens in IIS?'

 

Wanna know in depth on how request and response are processed: go to this link..

http://msdn.microsoft.com/en-us/magazine/cc188942.aspx

 

IIS (Internet Information Server) is one of the most powerful web servers from Microsoft that is used to host your ASP.NET Web application. IIS has it’s own ASP.NET Process Engine  to handle the ASP.NET request. So, when a request comes from client to server, IIS takes that request and  process it and send response back to clients.

 

When client request for some information from a web server, request first reaches to HTTP.SYS of IIS. HTTP.SYS then send the request to respective  Application Pool. Application Pool then forward the request to worker process to load the ISAPI Extension which will create an HTTPRuntime Object to Process the request via HTTPModule and HTTPHanlder. After that the ASP.NET Page LifeCycle events starts.

 

Worker process(w3wp.exe) runs the web application in the web server.

Application pool is the container of the worker process.

image

 

HTTP.sys

HTTP.SYS is Responsible for pass the request to particular Application pool. Whenever we creates a new Application Pool, the ID of the Application Pool is being generated and it’s registered with the HTTP.SYS. So whenever HTTP.SYS Received the request from any web application, it checks for the Application Pool and based on the application pool it send the request.

Now the control request from the remote user moves from http.sys to the application pool and then to the worker process as discussed.

image

 

This is just the basic understanding and the birds eye view of the request processing in IIS.

-Yuva

http://Yuvahere.com

'Web-Farm and Web-Garden'

© from http://abhijitjana.net/2010/10/01/what-is-the-difference-between-web-farm-and-web-garden/

 

I have been asked this question many times by different readers of my blog. They wanted to know about the fundamentals of Web Farms and Web Garden . In this blog post  I am going to explain the what is the exact difference between web farm and web garden, what are the advantages and disadvantages of using them. I have also described how to create web garden in different version of IIS.

Overview :

Visual Studio having its own integrated ASP.NET engine which is used to run the ASP.NET Web application from Visual Studio. ASP.NET Development Server  is responsible for execute all the request and response from client. Now after the end of development, when you want to host the site on some server to allow other peoples to access, concept of web servers comes in between.  A web server is responsible for  provide the response for all the requests that are coming from clients. Below diagram showing the typical deployment structure of a ASP.NET Web application with a single IIS.

Clients request for resources and IIS Process the request and send back to clients. If you want to know more details on How IIS Process the request please read one of my article over “How IIS Process ASP.NET Request ?” .

Web Farm :

This is the case, where you have only one web server and multiple clients requesting for the resources from the same server. But when there is huge numbers of  incoming traffic for your web sites, one standalone server is not sufficient to process the request.  You may need to use multiple server to host the application and divide the traffic among them.  This is called “Web Farm” . So when you are hosting your single web site on multiple web server over load balancer called “Web Farm”. Below diagram showing the over all representation of Web Farms.

In general web farm architecture, a single application is hosted on multiple IIS Server and those are connected with the VIP ( Virtual IP ) with Load Balancer. Load Balancer IP’s exposed to external worlds to access. So whenever some request will come to server from clients, it will first hit the Load Balancer, then based on the traffic on each server LB distributed the request to corresponding web server.  These web server may share same DB server or may be they can use replicated server in the back end.

So, In a single statement, When we host a web application over multiple web server to distributed the load among them  is called Web Farm.

Web Garden :

Now, let’s have a look, what is Web Garden ?  Both the terms  sounds same,  but they are totally different with each other.  Before starting with Web Garden, I hope you have fundamental idea of what is Application Pool and what is Worker Process.  If you have already read the article  “How IIS Process ASP.NET Request ?” article then I can expect that you have now good idea on both of them.

Just to recall,  When we are talking about requesting processing with in IIS, Worker Process (w3wp.exe ) takes care all of these. Worker Process runs the ASP.Net application in IIS. All the ASP.Net functionality inside IIS  runs under the scope of worker process. Worker Process is responsible for handling all kind of request, response, session data, cache data.  Application Pool is the container of worker process. Application pools is used to separate sets of IIS worker processes and enables a better security, reliability, and availability for any web application.

Now, by default each and every Application pool contains a single worker process. Application which contains the multiple worker process called “Web Garden”. Below is the typical diagram for a web garden application.

In the above diagram you can see, on of the application containing the  multiple worker process, which is now a web garden.

So, a Web application hosted on multiple server and access based on the load on servers is called Web Farms and When a single Application pool contain multiple Worker process is called web garden.

Create Web Garden in IIS 6 and IIS 7

Now, I am going to show how you can change the Number of Worker process In both IIS 6 and IIS 7.  For IIS 6,  Right Click on Application Pool > Properties > Goto  Performance Tab.

In the “Performance Tab” Section you would have one option called “Web Garden” where worker process sets to “1”, you can set the number of worker process that you required.

For IIS 7, Right Click on Application Pool > Go To Advance Settings > In Process Model section, you will have “Maximum Worker Processes” . You can change it more than 1 to make it as web garden.

In the above image you can also check the definition of Web Garden also.

You can find one of my previous article on the basic of same over here

Advantages of Web Farm and Web Garden :

Now, let’s have a look in to the advantages of both the Web farms and Web Garden.

Advantages of Web Farm

  • It provides high availability. If any of the server in the farm goes down, Load balancer can redirects the requests to other servers.
  • Provides high performance response for client requests.
  • Provides Better scalability of the web application and reduce the failure of application.
  • Session and other resource can be stored in a centralized location to access by the all server.

Advantages of Web Garden:

  • provides better application availability by sharing request between multiple worker process.
  • Web garden use processor affinity where application can swapped out based on preference and tag setting.
  • Less consumption of physical space for web garden configuration.

How to manage session in Web Farm Mode ?

While using session, requests are distributed among different servers. By default session mode is set to In Proc where session data stored inside worker process memory. But, In Web farm mode we can share the session among all the server using a single session store location my making it Out proc (State Server or SQL Server Mode). So, if some of the server goes down and request transferred to the other server by the Load balancer session data should be available for that request.

In the above diagram,  you can see we can both the IIS server sharing the same session data which is stored in out of worker process.  You can read one of my previous article “Exploring Session in ASP.NET” where I have explained how you can configure session mode for Out Process mode.

How to manage session in Web Garden Mode ?

When we are using Web garden where request is being taking care by different worker process we have to make the session mode as out process session mode as described earlier. For Web Garden we have configure the out process with in same server but for different worker process.

While using Web garden with your application you need do couple of configuration settings in web.config in <process Model> section where you need to set certain properties like cpuMask, RequestLimit, webGarden, ClientConnectCheck etc.

Summary : When we host a web application over multiple web server to distributed the load among them  is called Web Farm and when One application having multiple worker worker process called Web garden.

 

-Yuva

http://Yuvahere.com

'Tough commands used by Professionals in Command Prompt'

netstat
telnet
ftp

nslookup
nslookup www.google.com        --> Port sniffing is restricted in some countries and companies

net
net user
net user <username> <password> /add                  --> to create a new user to the system
net localgroup administrators <username> /add    ---> to add the user as admin to the system

net user <username> *                                            --> this will ask for a new password for the existing user and can be able to change the password of existing user

 

Please know your consciousness and use this only for ethical purpose.

-Yuva

http://Yuvahere.com

'Pinging “Youtube” – DNS is shared as Google'

Yes, this Google have not dedicated a DNS for Youtube.

Here is the trick

Now, copy the Youtube’s IP address and Google’s IP address in your browser, and this will redirect to Google as default.

Earlier, this IP address will direct to Youtube, thus bypassing the blocked sites list. Now we have to find other options.

-Yuva

http://Yuvahere.com

'Yield keyword in C# – Reduces LOC'

Yield keyword is employed to reduce the allocation of arrays and by using a simple foreach iterative control structure.

Here’s a simple program which displays the first five even numbers.

 

   1: private void LearnYield_Click(object sender, EventArgs e)
   2:        {
   3:            // this is the main program
   4:            string result = String.Empty;
   5:  
   6:            foreach (int value in ShowEvenNum(2, 5))
   7:            {
   8:                result = result + " - " + value.ToString();
   9:            }
  10:  
  11:            MessageBox.Show(result);
  12:        }
  13:  
  14:        // this method returns the list of first five even numbers
  15:        public static IEnumerable<int> ShowEvenNum(int number, int multiplier)
  16:        {
  17:            int loopValue = 0;
  18:            int numberResult = 0;
  19:  
  20:            while (loopValue < multiplier)
  21:            {
  22:                numberResult += number;
  23:                loopValue++;
  24:  
  25:                // this yield keyword will directly add to the return list
  26:                yield return numberResult;
  27:            }
  28:  
  29:        }

This code and its comments are self explanatory.

-Yuva

http://Yuvahere.com

'SCSF for Visual Studio 2008 SP1'

This is regarding the installation of SCSF for Visual studio 2008 SP1.

Here you can see lot of issues for the release of SP1 with SCSF

http://smartclient.codeplex.com/wikipage?title=Known%20Issues%20%2f%20Fixes&referringTitle=Home

Yes, The fix is also available for this.

Downoad the solution from the link below

"Download here"

1. Open and build the GuidancePackage.sln solution to generate the installer.
2. Navigate to the SmartClientFactorySetup\Debug folder.
3. Close all instances of Visual Studio.
4. Run the SmartClientFactoryPackageSetup.msi installer.

And now open the VS 2008 instance and check for the new project and you will see the image as below.

Click on the newer version and enjoy coding.

-Yuva

http://Yuvahere.com

'All my career, I have worked for POM, and still …'

This is really pretty, I think.

These POM have dominated my nation for more than a century and have killed thousands of my leaders. They have looted all the wealth from my country and boosted their economy.

But now, I directly work for those and boosting their economy.

I have worked all my career for…

1. NHS – UK hospital for Lorenzo project

2. Torus Insurance for  LossCap project

3. Lloyds bank for PlanNet project

I donno, whether I am doing this right or not???

-Yuva

http://Yuvahere.com

'Silverlight Developer runtime error'

Yup, Silverlight developer runtime has to be installed in any development environment for the debugging and execution of the silverlight applications.

You may face errors like "Silverlight Developer Runtime is not installed"

This is due to runtime not available in your local development system.

To install the runtime exe, download this from here: http://go.microsoft.com/fwlink/?LinkID=188039

And try executing the application again and everything will work fine…

Happy coding !!!

-Yuva

http://Yuvahere.com

'American Vs Australian'

 

This is really a two poles not in direction, the way they communicate and understand…

lets compare few scenarios and have fun

1. In Australia your partner is your mate, and your mate is your partner. In the U.S. one's partner is a person with whom one shares a project, be it a business, a trip, a boat, etc. In Australia, one's partner  is their spouse--married or not, gay or straight. In America, you'd call that person your "mate", but in Australia, your mate is your best friend. If a man introduces you another man and says, "This is my partner." You might think they were business partners instead of a couple and might say something unnecessarily embarrassing.

2. To "table" a subject in an American business meeting is to remove it from discussion until a later date. In Australia, to table something is to put it on the table to discuss immediately.

3. Hottie in Australian means “hot water bottle” and they prefer saying – I always take hottie with me. Aemricans means the different way. Hottie in their term stands for beautiful woman.

4. Ginger is the nick name for the person with red hair in Australia. And never call them Ginger :)

5. Australians say “Flying doctor” meaning the doctors who go in Air for remote rescue. Americans can think this a way totally different

6. Australians call the specialist doctors as “registrars”, but in America the registrars meaning is A person employed to keep a record of the owners of stocks and bonds issued by the company

7. Australians have “Booze Bus” means a police van used in road to catch the drunk drivers. The Americans think this as advantageous way and ask for liquor

8. Australians key in a term “Bunfight” for any argument or dispute, but the American meaning towards the same could be different.

9. “gin” is the offensive word used against the Aboriginal woman in Australia (Aboriginal are the native Australians). Americans have to be very careful in buying a gin in Australia or the reverse.

10. In Australia the double quotation marks are called as 66 and 99. The Americans will get too much confused  by  those terms :)

-Yuva

http://Yuvahere.com

'Optional (or Default) Parameters in C# 4.0'

 

This feature of C# has been obtained from VB.NET. In new C# 4.0 there is an option to pass all the parameters as optional and no need to unnecessarily overload the methods. This is really a great feature to be implemented in all the programming languages.

Hands on:

Prior to that we have to include the using of

using System.Runtime.InteropServices

And our functionality as follows

public void MainMethod()
   {
       int parameter1 = 1;
       int parameter2 = 2;
 
 
       MethodCall1(parameter1);
 
       MethodCall2(parameter1,parameter2);     // This method will call MethodCall2 as usual
       MethodCall2(parameter1);                // This method will call MethodCall2 with only 1 parameter and the other is Optional
 
   }
 
  
   public void MethodCall1(int x)
   {
       // this is an example of ordinary method execution
       Console.WriteLine("MethodCall1 is executed");
   }
 
   public void MethodCall2(int x, [Optional] int y)
   {
       // This method will be called with 1 parameter and also with 2 parameters
 
       Console.WriteLine("MethodCall2 is executed");
   }

-Yuva

http://Yuvahere.com

'Career Ideas from Microsoft'

Hi Folks,

This book provides the various ideas and measures on hoow effective we can self motivate for the endeavouring career goals.

Fun reading and bit more useful too.

http://tinylink.in/CareerIdeas  (or try this)

http://y2qqqw.bay.livefilestore.com/y1pgkVHE1MbMqv_jz8ceFq_CzZUgj26GRd2PTBYTU0-ECoyjv9fJdTfUlmJFxaAI6en99S6y5kBbY2FKANFkfrZqIUPfDXZeZGU/Career%20Ideas%20from%20Microsoft.pdf?download

-Yuva (http://Yuvahere.com)

'Enterprise Library 3.1 – error while installing – Error code 2869'

Yup, there could be errors like the below image while installing “Enterprise Library May 2007.msi”.

The reason I found for this is, this enterprise library version checks for Visual studio 2005 is installed in the system, though Visual studio 2008 is installed.

I have just installed VS 2008 in my system and thus facing the same error.

Solutions:

1. Install Visual Studio 2005 and then install this “Enterprise Library May 2007.msi”.   -->> Don’t waste time doing this.

2. Download latest Enterprise library like 5.0 or 5.0 beta2 from codeplex  -->> http://entlib.codeplex.com/

The latest version of Enterprise library will install perfectly with out any installation errors.

Happy coding…

-Yuva

http://Yuvahere.com

'Thanks Google for my business card'

Now, my visibility is turned on by GOOGLE.

Wanna type, “Yuvahere” and click to “I’m Feeling Lucky” –> this will directly redirects to my website.

-Yuva

http://yuvahere.com

'Wanna see success in'

Further to the written and now have failed in Microsoft’s technical round and bit [!@#$%^] much worried on this…

Really its a pain in slipping off from the dream company and coming out in frustration, Now I have to wait for another 6 months for this opportunity again.

Apart from hurt, they have also made me realize that, I have to learn a lot and much left behind…   :( :( :(    -- itz ok

-Yuva

http://Yuvahere.com

'Chinese year interpretation: Note'

 

The Rat: 1936, 1948, 1960, 1972, 1984, 1996, 2008

The Ox: 1937, 1949, 1961, 1973, 1985, 1997, 2009

The Tiger: 1938, 1950, 1962, 1974, 1986, 1998, 2010

The Rabbit: 1939, 1951, 1963, 1975, 1987, 1999

The Dragon: 1940, 1952, 1964, 1976, 1988, 2000

The Snake: 1941, 1953, 1965, 1977, 1989, 2001

The Horse: 1942, 1954, 1966, 1978, 1990, 2002

The Sheep: 1943, 1955, 1967, 1979, 1991, 2003

The Monkey: 1944, 1956, 1968, 1980, 1992, 2004

The Rooster: 1945, 1957, 1969, 1981, 1993, 2005

The Dog: 1946, 1958, 1970, 1982, 1994, 2006

The Pig: 1947, 1959, 1971, 1983, 1995, 2007

-Yuva

http://Yuvahere.com

'High growth rate of file groups in SQL Server Database'

 

This below query can be used to find all the high growth rate file groups in a SQL server database and

also helps in fine tuning those file groups alone.

USE master
GO
CREATE PROC sp_track_db_growth(@dbnameParam sysname = NULL)
AS
BEGIN
DECLARE @dbname sysname
-- Set the current DB, if dbname is not given input
SET @dbname = COALESCE(@dbnameParam, DB_NAME())
 
SELECT    CONVERT(char, backup_start_date, 111) AS [Date], --yyyy/mm/dd format
    CONVERT(char, backup_start_date, 108) AS [Time],
    @dbname AS [Database Name], [filegroup_name] AS [Filegroup Name], logical_name AS [Logical Filename], 
    physical_name AS [Physical Filename], CONVERT(numeric(9,2),file_size/1048576) AS [File Size (MB)],
    Growth AS [Growth Percentage (%)]
FROM
(
    SELECT    b.backup_start_date, a.backup_set_id, a.file_size, a.logical_name, a.[filegroup_name], a.physical_name,
        (
            SELECT    CONVERT(numeric(5,2),((a.file_size * 100.00)/i1.file_size)-100)
            FROM    msdb.dbo.backupfile i1
            WHERE     i1.backup_set_id = 
                        (
                            SELECT    MAX(i2.backup_set_id) 
                            FROM    msdb.dbo.backupfile i2 JOIN msdb.dbo.backupset i3
                                ON i2.backup_set_id = i3.backup_set_id
                            WHERE    i2.backup_set_id < a.backup_set_id AND 
                                i2.file_type='D' AND
                                i3.database_name = @dbname AND
                                i2.logical_name = a.logical_name AND
                                i2.logical_name = i1.logical_name AND
                                i3.type = 'D'
                        ) AND
                i1.file_type = 'D' 
        ) AS Growth
    FROM    msdb.dbo.backupfile a JOIN msdb.dbo.backupset b 
        ON a.backup_set_id = b.backup_set_id
    WHERE    b.database_name = @dbname AND
        a.file_type = 'D' AND
        b.type = 'D'
        
) as Derived
WHERE (Growth <> 0.0) OR (Growth IS NULL)
ORDER BY [Growth Percentage (%)] desc,logical_name, [Date] desc
END

-Yuva

http://Yuvahere.com

'Windows Mobile Device Center – Not Connected ERROR'

I faced a problem in Windows mobile device center throwing “Not connected” error marked below.

The solution for this I found is

Goto Start –> Internet Sharing  --> Menu –> Connection settings –>Click USB –>

Set USB Connection setting to “Active Sync” and also check Enable advanced network functionality –> CLick Done –> Done

Now the Windows mobile device center will connect automatically.

-Yuva

http://Yuvahere.com

'ASP.NET Object model'

Woow, this asp.net object model is a basic and must learn topic for all.

Msdn has posted a article which explains the core concepts and with samples too.

This will definitely be a quick reference for all.

http://msdn.microsoft.com/hi-in/magazine/cc301320(en-us).aspx

-------------------------------------------------------------------------------------------------

And  now coming to the very basic http object model

The below article will serve the purpose for all.

This article explains the indepth and clear understanding of the pipeline

http://msdn.microsoft.com/en-us/magazine/cc188942.aspx

-Yuva

http://Yuvahere.com

'Getting started with Windows Mobile apps and Compact framework'

 

First Checking the pre-requisites and creating a basic Hello world application :

1. Check whether your mobile device has “Active Sync” Installed.

2. Now to install “Microsoft .NET Compact framework V3.5” in your mobile device.

Go to the path : “C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE”

and you can c the list of cab files…

I have installed the selected one… Since mine is a Windows mobile and Armv4i – Hence “NETCFv35.wm.armv4i.cab” is the right file for me.

Check this with urs and copy the appropriate cab file to ur device storage card and click to install the “Microsoft .NET Compact framework V3.5” in your mobile device.

3. Create a test Application on compact framework and execute in the mobile device.

Goto ur Visual studio 2008 SDK and File -> New –> Project –>

Now a prompt message appears… Check all as per the colored boxes…

New project will appear in your solution explorer and click on the forms and write ur own application…

 

In the toolbox, drag and drop the label control and set its properties text to “Hello World”.

Now as usual build ur project and a .exe file will be placed in the “\bin\Debug” folder. Copy the .exe file to ur device and click to execute.

njoy

-Yuva

http://Yuvahere.com

'Live flight tracking system.'

 

Wow, this is really a cool new technology. The live flight tracking system.

Currently, this is open to public for only 1 city, soon this will be global.

http://casper.frontier.nl/

http://www.radarvirtuel.com/     This is not as dynamic as the above one…

-Yuva

http://Yuvahere.com

'China blocks most prestigious websites'

Mad Chinese have shown the reality now.

They have started blocking all the most hitting and famous sites in the world, to safeguard their society. This will bring in turn more madness to them.

here’s proof: List of websites blocked by CHINA

Includes : Facebook, Youtube, Flickr, Tripod, Technorati, Blogspot, Picasa, Plurk, Wretch, Webshots, Tumblr, Twitter, metacafe … and so on…

and also Hotmail, GOOGLE, YAHOO

-Yuva

Yuvahere.com

'Multiple UNPIVOT in SQL Server'

Learning multiple unpivot option was little interesting for me.

SELECT tempoid,version,dataField,datavalue,dataField1,datavalue1
 
FROM
 
      (SELECT t1.tempoid, t1.version, t1.data1, t1.data2, t1.data3, t1.data4, t2.data1 as d1, t2.data2 as d2, t2.data3 as d3, t2.data4 as d4
 
      FROM table1 t1 inner join table1 t2 on t1.tempoid = t1.tempoid and t1.version = t2.version + 1
 
      WHERE t1.version in (@version)
 
      ) AS p
 
UNPIVOT
 
      (datavalue FOR dataField IN
 
            (data1, data2, data3, data4)) as u1
 
 UNPIVOT (datavalue1 FOR dataField1 IN
 
      (d1, d2, d3, d4)) as u2

That’s it, simple

To under the above query, we will first create two tables and insert few records into

create table table1(OID BIGINT identity,tempoid bigint,version varchar(30),data1 varchar(30),data2 varchar(30),data3 varchar(30),data4 varchar(30))

create table table2(oid bigint identity,tempoid bigint,version varchar(30),fieldname varchar(30),Olddata varchar(30),Newdata varchar(30))

select * from table1

select * from table2

Let us first try inserting through this procedure

CREATE proc procInsert(@tempoid bigint,@version varchar(30),@data1 varchar(30),@data2 varchar(30),@data3 varchar(30),@data4 varchar(30))

AS

BEGIN

INSERT INTO table1 values(@tempoid,@version,@data1,@data2,@data3,@data4)

IF(@version >1)

BEGIN

;with cte as(

select tempoid,version,dataField,datavalue,dataField1,datavalue1

FROM

(SELECT t1.tempoid, t1.version, t1.data1, t1.data2, t1.data3, t1.data4, t2.data1 as d1, t2.data2 as d2, t2.data3 as d3, t2.data4 as d4

FROM table1 t1 inner join table1 t2 on t1.tempoid = t1.tempoid and t1.version = t2.version + 1

WHERE t1.version in (@version)

) AS p

UNPIVOT (datavalue FOR dataField IN (data1, data2, data3, data4)) as u1

UNPIVOT (datavalue1 FOR dataField1 IN (d1, d2, d3, d4)) as u2

)

--select * from cte

Insert into table2

select cte.tempoid,cte.version,cte.datafield,cte.datavalue1  as NewValue,cte.datavalue as OldValue

from cte inner join table1 t1 on t1.tempoid = cte.tempoid and t1.version = cte.version where ((cte.datafield = 'data1' and cte.datafield1 = 'd1')

or (cte.datafield = 'data2' and cte.datafield1 = 'd2') or (cte.datafield = 'data3' and cte.datafield1 = 'd3') or (cte.datafield = 'data4' and cte.datafield1 = 'd4'))

AND cte.datavalue <> cte.datavalue1

END

END

go

procInsert 1,2,'2.1','2.2','2.3','2.4'

procInsert 1,3,'2.1','2.2','2.3','2.5'

Now select the records from both the tables

select * from table1

select * from table2

The required functionality is, the no of columns that are different from current row to its previous version

Those different columns should be recorded in a new table 'table2'

now try inserting new row in table1 like

procInsert 1,4,'2.6','2.7','2.8','2.5' -- I have modified 3 columns here data1, data2 and data3

the result is :

(1 row(s) affected)

(3 row(s) affected)

and the output is

-Yuva

'Cure Blood Cancer - Imitinef Mercilet'

 

Imitinef Mercilet is the medicine, that cures Blood cancer. And also this is available free of cost @ the below locations

Cancer Institutes at Chennai (Adyar), Trivandrum, Kovai (Ramakrishna Hospital) and Bangalore.

No more deaths due to Blood cancer !!! :)

 

Free Heart Treatment for Kids, at Sri Sathya Sai Institute ,Bangalore.
Treatment for Kidney ailments ,at The Bangalore Kidney Foundation, No.489.39th.Cross,8th.Block, Jayanagar,Bangalore 560 082-India

-Yuva

'Protecting tables, Procedures and … in SQL Server 2008'

 

Here is the trigger which protects all the tables and procedures in a database / server.

create trigger triggername
on all server
for create_procedure,alter_procedure,drop_table
as 
    Print 'you are attempting to drop the table or create procedure or drop procedure'
    rollback;

This trigger can also be extended to protect all the verticals like Index, Functions, Views, etc

-Yuva

'Top tricks for SQL Server database development'

1) Always match datatypes in code with the columns in the database
It's important to make sure that your datatypes match across all layers in your application. For example, if a column's datatype is NVARCHAR (50), you should have the code in queries and stored procedures use local variables of the same datatype.

Similarly, the ADO.NET code in the data layer should specify the same datatype and length. Why is this important? Because if the datatypes and queries do not match, SQL Server needs to perform an implicit conversion of the datatypes to match them.

There are also some scenarios where SQL Server cannot use an existing index, even though the referenced column is indexed. Therefore, your query might end up using Index Scan instead of Index Seek, resulting in execution times with longer orders of magnitude than if the variables and columns were of the same type.

2) Do mass updates in batches
Developers sometimes need to modify data in one or more columns for all or most rows in a table. This is usually not an issue as long as the table is fairly small.

If the table is large, however, your update statement will lock the entire table and make it unavailable, even for data reads. Further more, a highly volatile table can bring down the entire application or website for the duration of the update. At times, a large, single transaction like this will greatly expand the size of the transaction log and -- in extreme scenarios -- contribute to running out of disk space on the database server.

It is therefore a good practice to do mass updates in batches, combined with frequent transaction log backups. In my experience, a batch of 10,000 or 50,000 works best. It is difficult to specify a threshold of when you should start considering batching, as it all depends on factors such as how fast you disk I/O is, how heavily the table is used, and more.

There is one guideline you can use though. A typical command timeout in ADO.NET is about 30 seconds. While the update takes place, other processes have to wait until it is finished. So if you expect that your update will take longer than 20-25 seconds, you are better off doing a batch update, otherwise you will end up with application timeouts.

Here is a sample code that shows how to update a column in a table, using 10,000 as batch size:

WHILE ( 0 = 0 )
BEGIN
        UPDATE TOP ( 10000 )
                Person
SET     Status = 2
WHERE   Status = 1
IF @@ROWCOUNT = 0
BREAK
    END

3) Utilize FOR-EACH stored procedures.
Once in a while you might need to perform the same action on all objects of a certain type. For example, you might need to assign a specific permission for all tables in the database. Developers often resort to cursors for tasks like this, but SQL Server comes with two handy stored procedures that make things a lot easier: sp_msForEachTable and sp_msForEachDB.

Each of these takes a command to be executed as a parameter. You can embed a question mark in the parameter as a placeholder for the table or database name in the command. At runtime, SQL Server replaces the question mark with the name of the table or database and executes it.

For example, the following code runs a full backup for each database on the server, except for TempDB:

EXEC sp_msforeachdb 'IF ''?'' <> ''tempdb'' BACKUP DATABASE ?
            TO DISK=''c:\backups\?.bak'' WITH INIT'

Here is another example of how these stored procedures can be useful -- and somewhat dangerous. The following code deletes data in all tables in the database after disabling the foreign key. Naturally, you'll want to exercise caution when using this code:

EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'

EXEC sp_MSForEachTable '
IF OBJECTPROPERTY(object_id(''?''), ''TableHasForeignRef'') = 1
  DELETE FROM ?
else
  TRUNCATE TABLE ?
'

EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'

4) Version your database builds

It's considered a good practice for developers to implement numeric versioning of databases, just like they do with applications.

It doesn't require a lot of effort to implement versioning – you just have to create a table with a version number and additional timestamps. Once you get better at assigning a build number to each set of scripts and updating the version table when you deploy those scripts, it becomes much easier to troubleshoot and compare your databases. You could even code your scripts so that they don't execute if the build number in the database is not higher than the build number in the script. The AWBuildVersion table in the AdventureWorks sample database is a good example to look at.

5) Minimize the number of network calls

This tip applies mainly to Web applications that pull data from a database. Less experienced developers often don't realize that each database call is a relatively expensive operation. It's not a big deal in small applications, but since many websites could become popular and used by thousands of simultaneous users, you need to start thinking about scalability and optimizing your page load times in advance.

One thing to keep in mind is that SQL Server can return multiple ResultSets in a single stored procedure. You can use the DataSet object in ADO.NET and populate a collection of DataTable objects in a single database call

-Yuva

'How to compare two tables in SQL server'

SQL Server is having a command line tool (TableDiff) to compare the data in two tables.It will perform the following task.

  1. A row by row comparison between a source table in an instance of Microsoft SQL Server acting as a replication Publisher and the destination table at one or more instances of SQL Server acting as replication Subscribers.
  2. Perform a fast comparison by only comparing row counts and schema.
  3. Perform column-level comparisons.
  4. Generate a Transact-SQL script to fix discrepancies at the destination server to bring the source and destination tables into convergence.
  5. Log results to an output file or into a table in the destination database.

eg:

"C:\Program Files\Microsoft SQL Server\90\COM\TableDiff.exe" -sourceserver "SERVERNAME" -sourcedatabase "DBNAME" -sourceschema "dbo" -sourcetable "SOURCETABLE1" -sourceuser "sa" -sourcepassword "PASSWORD" -destinationserver "SERVERNAME" -destinationdatabase "DBNAME" -destinationschema "dbo" -destinationtable "SOURCETABLE2" -destinationuser "sa" -destinationpassword "PASSWORD" -dt -o "C:\Documents and Settings\renjuraj\My Documents\diff.xls"

Run the above command in command prompt.Please refer your sql server installation path(C:\Program Files\Microsoft SQL Server\90\COM\TableDiff.exe).

-Yuva

'Nooks in SQL Server – Part 2'

To read the trace file using querying / To Query the trace files from profiler

Do call the below function and results are in grid

 

    SELECT * FROM ::fn_trace_gettable('D:\Test\test.trc', default)

You can alternatively can store the result to a table by using

Select * into tablename…

-Yuva

'The book of Ardha Viraf (In English)- Download'

Wanna know the punishment you will get in hell, here is the book for download “The book of Ardha Viraf”. This book is one of the rare collection in libraries and basically this is the English translation of text and the oldest one too.

The book of Ardha-Viraf is one of the most interesting- works of Pahlavi literature, as it contains the account of an imaginary journey of a pious Parsi priest through heaven and hell, which often reminds one of Dante's Divina Conimedia. Since its contents been hitherto very imperfectly known in Europe through Pope's
English translation which was based only on modern Persian and Gujarati versions,

Click here to download

-Yuva



'Know more about transaction logs and its growth'

1. They usually will grow tremendously due to uncommitted transactions
2. Running DBCC REINDEX, CREATE INDEX operations with the database in Full Recovery model.
3. Doing bulk insert query, and select into statements.

The following are the proactive measures in order to minimize the unexpected log file growth,

1.If you do not want point in time recovery of your databases then you can change the recovery model to Simple.
2.Set the size of the transaction log files to a large value to avoid the automatic expansion of the transaction log files.
3.Configure the automatic expansion of transaction log in terms of MB instead of %.
4.Backup the transaction log regularly to delete the inactive transactions in your transaction log if you are using full or bulk logged recovery model.
5.You can switch the recovery model to Bulk logged from full recovery model if you perform some bulk inserts, select into, bcp, alter index, create index commands because these operations will be minimally logged in bulk logged recovery model and after those operations are completed you can switch over to full recovery model.

-Yuva

'CDATA tag in javascript'

 

With HTML pages on the web you can just include the required Javascript between <script> and </script> tags. When you validate the HTML on your web page the Javascript content is considered to be CDATA (character data) that is therefore ignored by the validator. The same is not true if you follow the more recent XHTML standards in setting up your web page. With XHTML the code between the script tags is considered to be PCDATA (parsed character data) which is therefore processed by the validator.

Because of this, you can't just include Javascript between the script tags on your page without 'breaking' your web page (at least as far as the validator is concerned).

To fix this problem we can do one of two things. The simplest way, particularly if the Javascript contains more than just one or two lines, is to make the Javascript external to the page resulting in their being nothing between the script tags to stop the page validating.

If it is just one or two lines then it is probably not worth making an external script so you will want to leave the content between the script tags and tell the validator that this is to be ignored. We do this by placing the Javascript code within a CDATA tag like this:

<script type="text/javascript">
<![CDATA[
// content of your Javascript goes here
]]>
</script>

'Artificial rain - (Save drought)'

 

The need to develop and improve rain-making techniques in terms of design, operation, monitoring and evaluation by giving them a more scientific character is today's need.

This includes using computers to study cloud formations and help the rain-making operations achieve the goals of the project. The role of weather modification, or rain-making, is an important component in water resource management.

The process involved in artificial rain-making involves three easy-to-understand stages. The first stage is agitation. That is using chemicals to stimulate the air mass upwind of the target area to rise and form rain clouds.

The chemicals used during this stage are calcium chloride calcium carbide, calcium oxide, a compound of salt and urea, or a compound of urea and ammonium nitrate. These compounds are capable of absorbing water vapour from the air mass, thus stimulating the condensation process.

The second stage is called building-up stage. Here the cloud mass is built up using chemicals such as kitchen salt, the T.1 formula, urea, ammonium nitrate, dry ice, and occasionally also calcium chloride to increase nuclei which also increase the density of the clouds. In the third stage of bombardment chemicals such as super-cool agents: silver iodide and dry ice are used to reach the most unbalanced status which builds up large beads of water (Nuclei) and makes them fall down as raindrops.

In planning every stage a high degree of expertise and experience is required, in selecting the types and amounts of chemicals to be used, while taking into consideration weather conditions, topographical conditions, wind direction and velocity as well as the location or delimitation of the area for chemical seeding. Several other ideas are also involved in rain making. Rockets containing rain-making chemicals can be fired into the clouds either from the ground or from aircraft.

A jet of rain-making chemicals is shot from a highly pressurised cannister directly into the cloud base, so as to coerce clouds which normally hang above mountain tops to cluster up and rain on the mountain or their slopes.

Rain-making chemicals are added to super-cooled clouds, i.e., those at altitudes above 18,000 metres, to stimulate the formation of ice crystals in the cloud or cloud cluster.

Artificial rain is produced by spraying clouds with substances like Silver Iodide (costly) or cheaper ones like solid carbon dioxide (dry ice) or even finely powdered Sodium Chloride. The process is called seeding.

Often there are clouds, but no rain. This is because of a phenomenon called supercooling. The temperature of the cloud might be close to zero and there might even be crystals of ice in it.

The water vapour in the cloud does not condense to liquid water. The super cooling gets disturbed by spraying the cloud with the chemicals mentioned above, using a small airplane for the purpose.

The `super' phenomena (cooling, heating, saturation etc.) are perverse in a sense. Very pure water when heated in a clean vessel, often does not start boiling when expected. Crystals of the photographer's hypo (Sodium thiosulphate) easily dissolve in a little water when heated. But on cooling, crystals do not separate out.

If the vessel is shaken vigorously, or if a small crystal of hypo is freshly added, then crystallization starts immediately.

Making artificial rain is a similar way of intervening in the super cooling phenomenon.

This is the only option, that can save India in the future.

-Yuva

'How to create symbols with keyboard'

 

All you need to do is Hold down your "ALT" key and press another key on the keyboard to create a symbol. Here is a list of some you can make. Try out...

  • Alt + 0153..... ™... trademark symbol
  • Alt + 0169.... ©.... copyright symbol
  • Alt + 0174..... ®... .registered trademark symbol
  • Alt + 0176 ...°....... .degree symbol
  • Alt + 0177 ...± ... .plus-or-minus sign
  • Alt + 0182 ...¶....... paragraph mark
  • Alt + 0190 ...¾...... fraction, three-fourths
  • Alt + 0215 .... ×..... multiplication sign
  • Alt + 0162... ¢...... the cent sign
  • Alt + 0161..... ¡...... upside down exclamation point
  • Alt + 0191..... ¿..... upside down question mark
  • Alt + 1.......... ☺... smiley fsce
  • Alt + 2 ......... ☻... black smiley face
  • Alt + 15........ ☼... sun
  • Alt + 12........ ♀.... female sign
  • Alt + 11....... ♂.... male sign
  • Alt + 6......... �™ ..... spade sign
  • Alt + 5.......... ♣.... Club symbol
  • Alt + 3.......... ♥.... Heart
  • Alt + 4.......... ♦..... Diamond
  • Alt + 13........ ♪..... eighth note
  • Alt + 14........ ♫.... beamed eighth note
  • Alt + 8721.... ∑.... N-ary summation (auto sum)
  • Alt + 251...... √..... square root check mark
  • Alt + 8236..... ∞.... infinity
  • Alt + 24........ ↑..... up arrow
  • Alt + 25........ ↓..... down arrow
  • Alt + 26........ →... right pointing arrow
  • Alt + 27........ ←... left arrow
  • Alt + 18........ ↕..... up/down arrow
  • Alt + 29........ ↔... left right arrow

'Domain tools'

 

Find the domain information of any site

http://whois.domaintools.com/yuvahere.com
http://whois.domaintools.com/renjucool.com

Take the screen shot of any site

aviary.com/yuvahere.com

aviary.com/renjucool.com

Will update you more... :)

-Yuva

'Nooks in SQL Server'

 

SQL server mirroring

Operating Modes of mirroring setting

High availability
High safety
High performance

Roles of mirroring

Principal role
Mirror role
Witness role

Different hash algorithms produce different hash values

DECLARE @HashValue varchar(100)
SELECT @HashValue = 'SQL Server'
SELECT HashBytes('MD5', @HashValue)
SELECT @HashValue = 'SQL Server'
SELECT HashBytes('SHA1', @HashValue)
GO

Hash values are case sensitive

DECLARE @HashValue varchar(100)
SELECT @HashValue = 'sql'
SELECT HashBytes('SHA1', @HashValue)
SELECT @HashValue = 'SQL'
SELECT HashBytes('SHA1', @HashValue)
GO

Symmetric keys

CREATE SYMMETRIC KEY MySymmetricKey WITH ALGORITHM = RC4
ENCRYPTION BY PASSWORD = 'A1b2C3#$'
GO
SELECT * FROM sys.symmetric_keys
GO

CREATE TABLE SymmetricKeyDemo
(ID             int IDENTITY(1,1),
PlainText       varchar(30) NOT NULL,
EncryptedText   varbinary(80) NOT NULL)
GO

Symmetric key must be opened before being used

OPEN SYMMETRIC KEY MySymmetricKey DECRYPTION BY PASSWORD = 'A1b2C3#$'
GO

INSERT INTO SymmetricKeyDemo
(PlainText, EncryptedText)
VALUES('SQL Server', EncryptByKey(Key_GUID('MySymmetricKey'),'SQL Server'))
GO

SELECT ID, PlainText, EncryptedText, cast(DecryptByKey(EncryptedText) AS varchar(30))
FROM SymmetricKeyDemo
GO
CLOSE SYMMETRIC KEY MySymmetricKey
GO

Asymmetrics keys – public and private key tokens

Certificates

CREATE TABLE CertificateDemo
(ID             int IDENTITY(1,1),
PlainText       varchar(30) NOT NULL,
EncryptedText   varbinary(500) NOT NULL)
GO

CREATE CERTIFICATE MyCert AUTHORIZATION dbo
WITH SUBJECT = 'Test certificate'
GO

SELECT * FROM sys.certificates
GO
INSERT INTO CertificateDemo
(PlainText, EncryptedText)
VALUES('SQL Server',EncryptByCert(Cert_ID('MyCert'), 'SQL Server'))
GO

SELECT ID, PlainText, EncryptedText, CAST(DecryptByCert(Cert_Id('MyCert'),
    EncryptedText) AS varchar(max))
FROM CertificateDemo
GO

Transparent data encryption

USE master
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<InsertStrongPassword>';
GO
CREATE CERTIFICATE MyServerCert WITH SUBJECT = 'TDE Certificate'
GO

USE SQL2008SBS
GO
CREATE DATABASE ENCRYPTION KEY
WITH ALGORITHM = AES_128
ENCRYPTION BY SERVER CERTIFICATE MyServerCert
GO

ALTER DATABASE SQL2008SBS
SET ENCRYPTION ON
GO

--------------------------------------------------------------------

To find the current identity value of any table

select IDENT_CURRENT('patient')

To read the trace file and display in grid

select * from sys.fn_trace_gettable('\\dev-chen-pc1615\temp\test.trc',-1)

To add custom eror message in SQL server

sp_addmessage 50002,16,'this is custom build message by Yuva',NULL,NULL,NULL

RAISERROR (50002, 10,1) WITH LOG
RAISERROR ('this is temp error %d and %s and %d',16,3,12,'as',13) WITH LOG

-----------------------------------------------------------------------------------

To find the most time consuming stored procedure in a database

SELECT TOP 10
ProcedureName = tex.text,
ExecutionCount = sta.execution_count,
AvgExecutionTime = isnull( sta.total_elapsed_time / sta.execution_count, 0 ),
AvgWorkerTime = sta.total_worker_time / sta.execution_count,
TotalWorkerTime = sta.total_worker_time,
MaxLogicalReads = sta.max_logical_reads,
MaxLogicalWrites = sta.max_logical_writes,
CreationDateTime = sta.creation_time,
CallsPerSecond = isnull( sta.execution_count / datediff( second, sta.creation_time, getdate()), 0 )
FROM sys.dm_exec_query_stats sta
CROSS APPLY sys.dm_exec_sql_text( sta.sql_handle ) tex
-- WHERE ...
ORDER BY
-- statotal_elapsed_time DESC
sta.execution_count desc


Will update more...

-Yuva


'My weekend trek to Nagalapuram with the Chennai Trekkers Club - 9 and 10 May'09'


Hey What you've been up to this weekend .
Guess what -:) went on a trek this weekend with the Chennai Trekkers Club , Reason for doing ;got absolutely bored of the same city life same boring office 9-00-9 kind of life style and I guess all who joined and were part of this trek were also coming from the same line of thought . All wanting to escape from the mundane life and ppl who are actually thrill seekers stuck up bad in their daily bread winning acts.
You could find various ppl from different backgrounds and well established in their own fields but when it came to walking a few yards under the hot sun under the umbrella of mother nature, Which on that particular day seemed to be spitting fire . ... these guys were just not good !!!!!

But each one of us how ever unfit we proved to be at the end ,completed the trek or can call it a major wreck
cause by the end of it there was only wreckage of bodies all over . Trust me it pained in places where i can't even imagine .
I never imagined it would be so much fun when i enrolled . we started off on bikes and cars and these guys went bizzirk man .. Have you ever seen ppl driving cars while standing in the drivers seat guess it happens only in Bollywood .. if you were  not there with us on this trip u for sure missed such visuals. Peter was amazing  I personally have never seen such a thing
Well as we moved on Ram-zan or should I say Tar-zan met with a (kutti which is a major undersatement)  accident,,,lucky i guess to escape only with some minor bruises and after some quick first aid given to him  by our very own on the trek doc Wasim, we carried on without any further incidents to our base camp.
Trust me most first timers thought  that we'd jus be climbing some mountain and walking all along and have a nice little picnic and come back but boy !!! were we wrong .
very soon were climb uphill with the sun beating down as hard as it could and felt particularly hard with the 2-3 kgs backpacks we were carrying all along the way we had some super water spots to replenish and without these pit stops i think i would not have survived the whole thing .


Well the most amazing part of it was it reminded me of the ragging days where  in  my seniors used to say that calamity is the biggest binder  and how true it was according to then they just created the situations for us to get better . Well I can tell u for sure the way ppl helped each other i.e. ppl who probably have met each other for the first time in life was amazing and that is where the heart of such trip actually lies I guess.
All along My laziness and my supreme fitness which i have already told u about !! was getting in my way while we were going through this roller coaster ride over the boulders with no flat land in sight.
If this was not enough after some time we were asked to go up the hill which was at a 30deg incline and then we crossed some 200 mts all along the mountain with only a valley to stare down at with no support  this is point when I was reminded of god the most trust me I along with most others were shit scared , But some how we all managed to complete it and came down the hill sliding on our butts . proof in point most of the guys had their pants torn from behind ......
well after all this we finally reached our base camp fought to get place to sleep on the hard boulders with only the star to cover our head and laid like logs after having some super food cooked by the whole team .
The way back was the same .. we trekked our way back the same way as we came .. but surprisingly it was far it seemed far more easier , may be the fear factor was there no more and had more fun all along .Maybe  we all were more confident by now .

Boy !!!! was the toughest physical ordeal i have been through  yet and the experienced trekkers kept on calling it the simplest of the treks they've ever been to . (Guess that's their standard mantra to motivate ppl and prevent ppl from chickening out)
At the start of the trek Peter told, its just a 10 min walk. This 10 min actually have ended only at dawn. Damn physique, now am craze in getting this tough physique.
But tell you what one of the members form the trek kept on telling us that they need to push us hard so that we come back??? as the pain is the addiction for which ppl  return back and boy  he was so right !!!.Am game for the next trek and with more josh !!
Till the Next trek I guess I can say with a little bit of courage
Suggestion: Every one should try it the one thing you will have is love for your life

Download the fantastic snapshots of Nagalla trek

---------------------------------------------------------------------------------------

NAGALLAPURAM - 25 (Silver Jubilee)

I know the previous one was a medium, only when you have faced the difficult. This is tremendous, and the climb was 880 m high.

I got cramps in both of my legs at the mid of the climb. As a physician was beside me, he helped me relieve this pain. Then I have been pushed back, walking slowly and enjoying the pain.

Peter has advised us to carry 3 liters of water, in spite I carried only 2 liters, as my backpack was too heavy. On the way, I drank all the reserve. While at the hill top, the sun ate all my energy and was very thirsty. You could not have faced this dying thirsty ever in your life. I even have prepared myself to drink the dirty stagnant water lagging in between the rocks. This water is very dangerous, this water contains lot of parasites and this can quickly turn you down with diarrhea and drowsy. In the mean time I met the great Saravana Kumar helped me by giving tiny droplets of water which were left behind in the water bottle. This just wetted my throat, Still alive J. Then quickly we went down for a camp.

The second day was bit ok, as went to magic pool and thereby we went on in the usual way.

In the magic pool, as I was waiting for a swimmer to pass on the pool. I was waiting on the top of the rocks and literally making some noise and this probably could have disturbed this aghori's meditation. He knows I doesn't know swimming, in spite he pushed me into water. Everyone there was shocked of this incident. and the good swimmers were on the other side of the pool. It takes atleast 2 - 3 min to come this side. Imagine this incident, How a non swimmer will struggle in the deep water. Atlast Ritest and Saravana kumar came for rescue. Till the time I have managed to be on the top of the water. I donno how... ?

Please see the snapshots of Nagallapuram 25 - Silver jubilee photos

-Yuva







'How BSE index is calculated?'

 

This is a few mathematical formula, that everyone should know.

Suppose the Index consists of only 2 stocks: Stock A and Stock B. (BSE has allocated x no. of stocks for index calculation).

Suppose company A has 1,000 shares in total, of which 200 are held by the promoters, so that only 800 shares are available for trading to the general public. These 800 shares are the so-called 'free-floating' shares.

Similarly, company B has 2,000 shares in total, of which 1,000 are held by the promoters and the rest 1,000 are free-floating.

Now suppose the current market price of stock A is Rs 120. Thus, the 'total' market capitalisation of company A is Rs 120,000 (1,000 x 120), but its free-float market capitalisation is Rs 96,000 (800 x 120).

Similarly, suppose the current market price of stock B is Rs 200. The total market capitalisation of company B will thus be Rs 400,000 (2,000 x 200), but its free-float market cap is only Rs 200,000 (1,000 x 200).

So as of today the market capitalisation of the index (i.e. stocks A and B) is Rs 520,000 (Rs 120,000 + Rs 400,000); while the free-float market capitalisation of the index is Rs 296,000. (Rs 96,000 + Rs 200,000).

The year 1978-79 is considered the base year of the index with a value set to 100. What this means is that suppose at that time the market capitalisation of the stocks that comprised the index then was, say, 60,000 (remember at that time there may have been some other stocks in the index, not A and B, but that does not matter), then we assume that an index market cap of 60,000 is equal to an index-value of 100.

Thus the value of the index today is = 296,000 x 100/60,000 = 493.33

This is how the Sensex is calculated.

The factor 100/60000 is called index divisor.

-Yuva

'Installing Windows 7 through USB drive'

 

Open the command prompt and do the following procedures

  • Run select disk 1 where the "1" is actually the corresponding number of your USB drive.
  • Run clean.
  • Once the thumb drive is clean, you can run create partition primary.
  • Now make the partition active by entering active
  • Then you need to set up the file system as Fat32 by running format fs=fat32 quick (quick, of course, specifies that you want to perform a quick format to speed up the process).
  • Entering the assign command gives the USB drive a drive letter, making it easy to access from Windows Explorer
  • Then you can copy everything from the Windows 7 installation DVD onto the USB key (a simple drag and drop will do).
  • Now you can insert the thumb drive into the system you want to install Windows 7 onto and boot the system. The installation will now proceed as usual—but faster.
  • Remember to set your boot bias to USB drive.

    -Yuva

    'Redirect html page - 2 methods'

     

    We often deliver a link to the clients / customers which points to a html page.

    Now after the advancements,now if we want to redirect it to another page, we obviously could not publish another url to all our customers. This becomes a tedious process and also the client should not be confused with too many urls.

    Thus the HTML redirection is the best way to do this. There are two ways we can do this.

    1. Java Script

    <script type = "text/javascript">
    window.location= "sample.html"
    </script>

    2. Through meta data

    <meta http-equiv="REFRESH" content="2;url=sample.html"></HEAD>

    this meta tag has to be places in the head tags.

    -Yuva

    'Atom 1.0 Vs RSS Feed'

     

    The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (AtomPub or APP) is a simple HTTP-based protocol for creating and updating web resources.

    Web feeds allow software programs to check for updates published on a web site. To provide a web feed, a site owner may use specialized software (such as a content management system) that publishes a list (or "feed") of recent articles or content in a standardized, machine-readable format. The feed can then be downloaded by web sites that syndicate content from the feed, or by feed reader programs that allow Internet users to subscribe to feeds and view their content.

    A feed contains entries, which may be headlines, full-text articles, excerpts, summaries, and/or links to content on a web site, along with various metadata.

    The Atom format was developed as an alternative to RSS. Ben Trott was one of the advocates of the new format that became Atom. He believed that RSS had problems that ought to be fixed. Since RSS was frozen, and in any case had to remain backward compatible, there could be advantages in doing a fresh design.

    Proponents of the new format formed the IETF Atom Publishing Format and Protocol Workgroup. The Atom syndication format was published as an IETF "proposed standard" in RFC 4287, and the Atom Publishing Protocol was published as RFC 5023.

    'Search for string in the entire database'

    This is the query which searches for string in the entire DB.
    Provide 2 inputs as DB name and Search string.
    This query takes more time, but will sure get you the results.
    You can customize the search criteria…
    ----------------------------------------------------------
    Use [Database_Name]
    go
    declare @SearchChar varchar(8000)
    Set @SearchChar = 'Search_Text' -- Like 'yuva%', '11/11/2006'
    declare @CMDMain varchar(8000), @CMDMainCount varchar(8000),@CMDJoin varchar(8000)
    declare @ColumnName varchar(100),@TableName varchar(100)
    declare dbTable cursor for
    SELECT
    Distinct b.Name as TableName
    FROM
    sysobjects b
    WHERE
    b.type='u' and b.Name <> 'dtproperties'
    order by b.name
    open dbTable
    fetch next from dbTable into @TableName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    declare db cursor for
    SELECT
    c.Name as ColumnName
    FROM
    sysobjects b,
    syscolumns c
    WHERE
    C.id = b.id and
    b.type='u' and b.Name = @TableName
    order by b.name
    open db
    fetch next from db into @ColumnName
    set @CMDMain = 'SELECT ' + char(39) + @TableName + char(39) + ' as TableName,'+
    ' ['+ @TableName + '].* FROM [' + @TableName + ']'+
    ' WHERE '
    set @CMDMainCount = 'SELECT Count(*) FROM [' + @TableName + '] Where '
    Set @CMDJoin = ''
    WHILE @@FETCH_STATUS = 0
    BEGIN
    set @CMDJoin = @CMDJoin + 'Convert(varchar(5000),[' +@ColumnName + ']) like ' + char(39) + @SearchChar + char(39) + ' OR '
    fetch next from db into @ColumnName
    end
    close db
    deallocate db
    Set @CMDMainCount = 'If ('+ @CMDMainCount + Left(@CMDJoin, len(@CMDJoin) - 3)+ ') > 0 Begin '
    Set @CMDMain = @CMDMainCount + @CMDMain + Left(@CMDJoin, len(@CMDJoin) - 3)
    Set @CMDMain = @CMDMain + ' End '
    Print @CMDMain
    exec (@CMDMain)
    fetch next from dbTable into @TableName
    end
    close dbTable
    deallocate dbTable

    ----------------------------------------------

    -Yuva

    'Hyperlink not working in outlook'

     

    "This operation has been cancelled due to restrictions in effect on this computer."

    A very common question in the Microsoft public newsgroups goes something like this:

    When clicking on a hyperlink in an e-mail, I get this Message : "This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator." I get this message every time that I attempt to use the hyperlink. I am the administrator on this stand alone computer. How do I deactivate this feature so that I activate hyperlinks ?

    This is not an Outlook error. The most common cause is a corrupt registry key in Internet Explorer 6. The registry key found at
                   HKEY_Local_Machine\Software\Classes\htmlfile\shell\open\command
    is either damaged or corrupt.

    To fix it, try  resetting Web settings in Internet Explorer. If this does not resolve the issue, you'll need to import the registry key from another computer.

    Reset Web Settings

    To Reset Web settings

    1. Open  Internet Explorer.
    2. On the Tools menu, click Internet Options.
    3. Click the Programs tab, and then click the Reset Web Settings button.
    4. Under Internet programs, verify that the correct e-mail program is selected.
    5. Click to select the Internet Explorer should check to see whether it is the default browser check box.
    6. Click Apply, and then click OK.

    If you receive a message when Internet Explorer starts telling you that IE is not currently your default browser, click Yes to make it your default.

    Import the Registry Key

    When resetting the web settings doesn't help, you'll need to recreate the corrupt key. The easiest way to do this is by exporting the key from another computer.

    To save exporting it from another computer, right click here to download a registry key exported from my computer. Choose Save target as and change the file extension from txt to reg and double click on it to run it.

    If you prefer to use a key from a computer you have access to, follow the instructions in You receive an error message when you click a hyperlink in Outlook.

    Set Program Access in Control Panel

    Windows XP and Vista allow you to control program defaults through Control Panel, Add and Remove Programs, Set Program Access and Defaults. If the above methods fail, use this method to set the default browser.

    Other Causes

    There are several other causes of this error. In most cases, they do not affect hyperlinks in Outlook. If you found this page searching for the error message, check out the following pages. Note that if you receive this error on a computer at work, you should contact your administrator, they may want access to applications restricted for security reasons.

    You receive the message when:

    · Using Outlook 2002 SP3

    · Trying to run a program

    · Saving a document (Windows 2000)

    · Accessing file open dialog

    · Starting Windows Explorer

    More Information

    You receive an error message when you click a hyperlink in Outlook

    -Yuva

    'Updates in Vista SP2'

     

    Hardware support

    •SP2 contains Blue tooth 2.1 feature pack supporting the most recent specification for Blue tooth technology
    •Ability to record data on Blu-Ray media,
    •Adds Windows Connect Now (WCN) Wi-Fi Configuration to Windows Vista SP2,
    •exFAT file system now supports UTC timestamps, which enables correct file synchronization across time zones.
    •SP2 provides support for new form factors, such as ICCD/CCID.  new form factor support –example USB form factor as opposed to PCMCIA).
    •Support for the new VIA 64-bit CPU
    Security

    Security

    •SP2 includes all previously released security updates, and builds on the proven security benefits of Windows Vista
    •Secure Development Lifecycle process updates, where we identify the root cause of each security bulletin and improve our internal tools to eliminate code patterns that could lead to future vulnerabilities
    •Reliability
    •SP2 addresses previously released reliability updates, as well as addressing crashes, caused by Microsoft code,  discovered since the launch of SP1

    Performance

    •Resume performance when Wi-Fi connection is no longer available after resume from sleep
    •Inclusion of Windows Search 4 for improved indexing performance,  improved relevancy in search, broader indexing scenario inclusion, as well as new Group Policy integration for Windows Search,
    •Improvements to the RSS feeds sidebar gadget to improve update performance and responsiveness

    Application Compatibility

    •It is our goal that applications that run on the Windows Vista Operating System today and are written using public APIs will continue to work as designed on Windows Vista SP2.
    •Previously released Application Compatibility updates are included in Windows Vista SP2.
    •Spysweeper and ZoneAlarm now working with POP3 email accounts

    Administration and Support Improvements

    •Customers installing .net framework 3.5 service pack 1 will notice shorter download and installation times with Vista service pack 2 or Windows 2008 service pack 2 already installed,
    •Service Pack Clean up tool (Compcln.exe): This tool helps restore the hard disk space by permanently deleting the previous versions of the files (RTM & SP1) that are being serviced by Service Pack 2.
    •Single installer for both Vista & Server 2008
    •Ability to detect an incompatible driver and block service pack installation or warn users of any loss of functionality
    •Better error handling and providing more descriptive error messages where possible
    •Better manageability through logging in system event log
    •Componentization for Serviceability of the installer

    Some Specific Fixes/Additions Include:

    •Inclusion of Hyper-V
    •Event logging support in SPC
    •DNS Server now listens over ISATAP address
    •Fixes DRM issues from WMP upgrades
    •Windows Vista Feature Pack for Wireless
    •Reduction of resources required for sidebar gadgets
    •Improved power settings for WS08

    -Yuva

    'Fine experience with Nisha'

     

    Nisha the devastating flood in Chennai on Nov 28 - 30.

      

    The auto drowned, picture from balcony

    Opposite house drowned

     

    Our flats ground floor and an eagle taking rest in the sun shade

    Oh. My bike and my moms pep and the car in the parking arena.

    Me went for buying bread.

    The electricity supply has also been cut for 4 long days.

    Finally Nisha gave me a wonderful experience I have never met.

    'Application architecture with design patterns'

     

    A design pattern can solve many problems by providing a framework for building an application. Design patterns, which make the design process cleaner and more efficient, are especially well-suited for use in C# development because it is an object-oriented language. Existing design patterns make good templates for your objects, allowing you to build software faster. This article describes several popular design patterns you can use in your own applications, including the singleton, the decorator, the composite, and the state classes, which can improve the extensibility of your applications and the reuse of your objects.

    As any seasoned object-oriented software developer knows, it is unthinkable to discuss software design and architecture without at least a rudimentary understanding of design patterns. Most, if not all, software applications, tools, and systems incorporate one or more design patterns. A design pattern is a description of a set of interacting classes that provide a framework for a solution to a generalized problem in a specific context or environment. In other words, a pattern suggests a solution to a particular problem or issue in object-oriented software development. Additionally, patterns take into account design constraints and other factors that limit their applicability to the solution in general. Together, the classes, the communication and interconnections among those classes, and the contextual specifics define a pattern that provides a solution to any problem in object-oriented software design that presents characteristics and requirements matching those addressed by the pattern context.

    Few developers have the luxury of writing only small programs. Modern software applications and systems are complex, comprising hundreds of thousands of lines of code, and I know of code bases that are even larger. Programming demands a lot more than simple mastery of tools and languages—corporate software development typically requires a great deal of flexibility in design and architecture to accommodate the ever-changing needs of clients and users at various stages of product development, and often after the product has been released. Such dynamics dictate that software design not be brittle. It should be able to accept changes without any undesirable ripple effect that would necessitate the reworking of other, potentially unrelated, subsystems. It is frustrating and counterproductive to add features and components to modules that were never designed for extensibility. Sooner or later, closed, inflexible designs break under the weight of changes. Design patterns assist in laying the foundation for a flexible architecture, which is the hallmark of every good object-oriented design.

    Design patterns have been cataloged to address a variety of design problems, from small issues to large, architecture-level problems. In this article, I will describe some of the popular design patterns that I have found useful in my own projects. The article does not assume any prior knowledge of design patterns, although familiarity with concepts of object-oriented design will help. While any programming language that facilitates object-oriented development could be used to illustrate patterns.

    C# and Design Patterns

    C# is a modern programming language that promotes object-oriented software development by offering syntactic constructs and semantic support for concepts that map directly to notions in object-oriented design. This is in contrast to C++, which supports procedural as well as object-oriented (and generic) programming. Nonetheless, if you are a C++ programmer, getting up to speed with C# should be a snap—the learning curve for C++ programmers is flat. Even if you haven't seen any C# code before, you should have no problem comprehending the example code in this article. In fact, I wouldn't be surprised if you find the C# implementation of the design patterns cleaner, especially if you have used or coded the patterns before. Books and articles that discuss design patterns typically explain the problem and the context in great detail, followed by a formal description of the solution.

    Let's start with the simplest design pattern: Singleton.

    Singleton

    Anyone who has ever written an MFC application—no matter how small—knows what a singleton is. A singleton is the sole instance of some class. To use an MFC analogy, the global instance of the CWinApp-derived application class is the singleton. Of course, while it's imperative that no additional instances of the application class be created, there really is nothing preventing you from creating additional instances. In situations like these, when you need to enforce singleton behavior for a specific class, a better alternative is to make the class itself responsible for ensuring that one and only one instance of the class can be created. Back in the MFC analogy, you see that the responsibility for keeping track of the solitary instance of the application class rests with the developers of the application. They must not inadvertently instantiate another application object.

    It is most often the case that the singleton should also be globally accessible, and this is achieved by making the creation method public. However, unlike the scenario in which a global variable is instantiated as the singleton, this pattern prevents creation of any additional instances, while simultaneously allowing global access. Note that the class constructor is private—there is no way to circumvent the static method and directly create an instance of the class.

    There are additional benefits, too. Specifically, this pattern can be extended to accommodate a variable number of instances of an object. For instance, let's say you have an application with a dedicated worker thread that is dispatched whenever a particular task is required. In the interest of conserving system resources, you have implemented the thread as a singleton. At some point along the way, if you decide to scale up your application because the rate at which tasks arrive is too much for your singleton thread to handle, it will be fairly straightforward to increase the number of worker threads in the application because all the logic that creates the threads and grants access to them is confined to one class.

    One other advantage to this pattern is that creation of the singleton can be delayed until it is actually needed.

    A variable declared at global scope will be created on startup regardless of whether it is needed—it may very well be that the object isn't always needed. C# doesn't allow variables at global scope anyway, but it is possible to create an object on the heap at the outset of a method and not use it until much later, if at all. The Singleton pattern offers an elegant solution in such cases.
          Additionally, as an implementation vehicle, C# is superior to C++ for this design pattern in a subtle but important way. A C++-based implementation has to take into account some sticky issues related to lifetime management that are automatically taken care of by the C# runtime. This is a significant benefit, as all you need to do in the C# version is make sure you have a live reference to the singleton object for as long as it's needed.

    Strategy

    Applications are often written so that the way they perform a particular task varies, depending on user input, the platform it's running on, the environment it's been deployed in, and so on. An example is asynchronous I/O on disk files: Win32® APIs under Windows NT® and Windows® 2000 support asynchronous I/O natively. However, that's not the case with Windows 95 or Windows 98. An application that relies on asynchronous file I/O, therefore, has to execute two different algorithms, depending on the deployment platform—one that uses native Win32 APIs, and another that is built from scratch, perhaps using multiple threads. Clients of such a service will be oblivious to the fact that different algorithms are being executed; as far as they are concerned, the end result is the same and that's all they care about.
    Another example is downloading a file from some remote server on the Internet. An application that offers a file download service that accepts a URL as input needs to examine the URL, identify the protocol (FTP or HTTP, for example), and then create an object that can communicate with the remote server using that protocol. Note that depending on user input, a different algorithm (protocol) will be used. However, again, the end result is the same—a file is downloaded.

    An interface is like a contract. It is a specification that inheriting classes must follow. More specifically, it defines method signatures but no implementations—the latter must be provided by the concrete classes that implement the interface. C# is clearly superior to C++ in this regard because C++ lacks native language support for interfaces. C++ programmers typically create interfaces by defining abstract classes with pure virtual methods. In C#, all interface members are public, and classes adhering to an interface must implement all methods in the interface.

    Decorator

    A client application often needs to augment the services provided by methods of some class, perhaps by inserting some preprocessing and post-processing tasks before and after the method calls, respectively. One way to accomplish this is to bracket each method invocation with calls to functions that achieve the desired effect. However, this approach is not only cumbersome, it also limits the framework's extensibility. For instance, if distinct pre- and post-processing tasks were to be carried out for different clients, the application logic would be obscured by conditional statements, leading to a maintenance nightmare. The question, then, is how to enhance the functionality offered by a class in a manner that does not cause repercussions in client code. The Decorator pattern is just what's needed.

    The Decorator pattern thus allows dynamic and transparent addition and removal of responsibilities without affecting client code. It is particularly useful when a range of extensions or responsibilities can be applied to existing classes, and when defining subclasses to accommodate all those extensions is impractical.

    Composite

    The Composite pattern is useful when individual objects as well as aggregates of those objects are to be treated uniformly. An everyday example is enumerating the contents of a file folder. A folder may contain not only files, but subfolders as well. An application designed to recursively display the list of all files in some top-level folder can use a conditional statement to distinguish between files and directories, and traverse down the directory tree to display the names of files in the subfolders. A better approach is suggested by the Composite pattern. In this approach, every folder item, be it a file, a subfolder, a network printer, or a moniker for any directory element, is an instance of a class that conforms to an interface offering a method to display a user-friendly name of the element. In this case, the client application does not have to treat each element differently, thereby reducing the complexity of the application logic.

    The implementation of Drawing.Draw uses the collection classes available in the System.Collections library. For more information on these and other libraries, check out the documentation in the .NET Framework SDK.

    State

    Every developer has implemented a finite state machine at least once. You can't avoid them—they are everywhere, and not just limited to the world of software development. It's no wonder that literature on the design and implementation of deterministic finite automata is also readily available. A popular design for finite state machines is based on table lookup. A table maps all possible inputs for each state to transitions that would lead the machine to perhaps a different state. Needless to say, while this design is simpler, it is unable to accommodate changes without significant modifications to the existing implementation. A better alternative is the solution offered by the State design pattern.

    To summarize, the State design pattern helps localize state-specific behavior to classes that implement concrete states, which promotes reuse and extensibility. This removes the need for conditional statements that would otherwise be scattered throughout the code, making life difficult for maintenance programmers, who vastly outnumber implementers in the real world.

    - Pull - MSDN

    'Lorenzo the magnificent'

     

    A portrait of Lorenzo de' Medici by Girolamo Macchietti.

    Born : January 1, 1449(1449-01-01)

    Died : April 9, 1492 (aged 43)

    Spouse(s) : Clarice Orsini
                      Philippina of Savoy

    Children : Lucrezia de' Medici
                   Piero di Lorenzo de' Medici
                   Maddalena di Lorenzo de' Medici
                   Giovanni de' Medici
                   Luisa de' Medici
                   Contessina de' Medici
                   Giuliano di Lorenzo de' Medici

     

    Lorenzo de' Medici (January 1, 1449 – 9 April 1492) was an Italian statesman and de facto ruler of the Florentine Republic during the Italian Renaissance. Known as Lorenzo the Magnificent (Lorenzo il Magnifico) by contemporary Florentines, he was a diplomat, politician and patron of scholars, artists, and poets. His life coincided with the high point of the early Italian Renaissance; his death marked the end of the Golden Age of Florence. The fragile peace he helped maintain between the various Italian states collapsed with his death; two years later the French invasion of 1494 began and led to nearly 400 years of foreign occupation of the Italian peninsula.

    Childhood:

    His grandfather, Cosimo de Medici, became the first of the Medici to combine running the Medici bank with leading the Republic in both government and philanthropy, spending an enormous portion of his fortune (he was one of the wealthiest men in all of Europe) on art and public works. Lorenzo's father, Piero 'the Gouty' de' Medici, was also at the center of Florentine life, and extremely active as a patron and collector. His mother Lucrezia Tornabuoni was also a dilettante poet and friend to figures like Luigi Pulci and Agnolo Poliziano.

    He was considered the brightest of the five children. He was tutored by Gentile Becchi, a diplomat. He partook in jousting, hawking, hunting, and breeding horses for the palio, a horse race in Siena. His own horse was named Morello.

    Piero sent Lorenzo on many important diplomatic missions when he was still a youth. These included trips to Rome to meet with the pope and other important religious and political figures.

     

    Lorenzo and politics

    Bust of Lorenzo de' Medici by Verocchio.

    Lorenzo, groomed for power, assumed a leading role in the state upon the death of his father in 1469, when Lorenzo was twenty. Lorenzo had little success in running the bank, and its assets contracted seriously during the course of his lifetime.

    Lorenzo, like his father and grandfather, ruled Florence indirectly, through surrogates in the city councils, through threats, payoffs, strategic marriages - all the tools of despotism, Although Florence flourished under Lorenzo's rule, he effectively ruled as a despot and people had little freedom. It was inevitable that rival families should harbor resentments as to Medici dominance, and enemies of the Medici remained a factor in Florentine life long after Lorenzo's passing.

    On Easter Sunday, April 26, 1478, in an incident called the Pazzi Conspiracy, a group including members of the Pazzi family, backed by the Archbishop of Pisa and his patron Pope Sixtus IV, attacked Lorenzo and his co-ruler brother Giuliano in the cathedral of Florence. Lorenzo was stabbed but escaped; however the attackers managed to kill Giuliano. The conspiracy was brutally put down, with measures including the lynching of the archbishop.

    In the aftermath of the Pazzi conspiracy and the punishment of the Pope's supporters, the Medici and Florence suffered from the wrath of the Pope. He seized all the Medici assets he could find, excommunicated Lorenzo and the entire government of Florence, and ultimately put the city under interdict. When that had little effect, the Pope formed a military alliance with King Ferdinand I of Naples, whose son, Alfonso, Duke of Calabria launched an invasion.

    Lorenzo rallied the citizens. However, with little help being provided by traditional Medici allies in Bologna and Milan (the latter being convulsed by power struggles among the Sforza), the war dragged on, and only diplomacy by Lorenzo, who personally traveled to Naples, resolved the crisis. This enabled him to secure constitutional changes that enhanced his power.

    Thereafter, Lorenzo, like his grandfather Cosimo de' Medici, pursued a policy of maintaining both peace and a balance of power between the northern Italian states and of keeping other states out of Italy.

    Lorenzo kept good relations with Mehmed II of the Ottoman Empire, as the trade with Ottomans was a major source of wealth for the Medicis.

     

    Lorenzo and the Renaissance

    Lorenzo's court included artists such as Piero and Antonio del Pollaiuolo, Andrea del Verrocchio, Leonardo da Vinci, Sandro Botticelli, Domenico Ghirlandaio, and Michelangelo Buonarroti who were involved in the 15th century Renaissance. Although he did not commission many works himself, he helped them secure commissions from other patrons. Michelangelo lived with Lorenzo and his family for several years, dining at the family table and attending meetings of the Neo-Platonic Academy.

    Lorenzo was an artist himself, writing poetry in his native Tuscan. In his poetry he celebrates life even while—particularly in his later works—acknowledging with melancholy the fragility and instability of the human condition. Love, feasts and light dominate his verse.

    Cosimo had started the collection of books which became the Medici Library (also called the Laurentian Library) and Lorenzo expanded it. Lorenzo's agents retrieved from the East large numbers of classical works, and he employed a large workshop to copy his books and disseminate their content across Europe. He supported the development of humanism through his circle of scholarly friends who studied Greek philosophers, and attempted to merge the ideas of Plato with Christianity; among this group were the philosophers Marsilio Ficino and Giovanni Pico della Mirandola.

    Later years

    A posthumous portrait of Lorenzo by Giorgio Vasari

    During his tenure, several branches of the family bank collapsed because of bad loans, and, in later years, he got into financial difficulties and resorted to mis-appropriating trust and state funds.

    Toward the end of Lorenzo's life, Florence came under the spell of Savonarola, who believed Christians had strayed too far into Greco-Roman culture. Lorenzo played a role in bringing Savonarola to Florence.

    Lorenzo de' Medici died during the night of April 8th/9th, 1492, at the long-time family villa of Careggi (Florentine reckoning considers days to begin at sunset, so his death date is the 9th in that reckoning). Savonarola visited Lorenzo on his death bed. The rumor that Savonarola damned Lorenzo on his deathbed has been refuted by Roberto Ridolfi in his book, Vita di Girolamo Savonarola. Letters written by witnesses to Lorenzo's death report Lorenzo died a consoled man, on account of the blessing Savonarola gave him. As Lorenzo died, the tower of the church of Santa Reparata was allegedly struck by lightning. He and his brother Giuliano are buried in a chapel designed by Michelangelo, the New Sacristy; it is located adjacent to the north transept of the Church of San Lorenzo and is reached by passing through the main Capella di Medici; the chapel is ornamented with famous sculptures, and some of the original working drawings of Michelangelo can still be distinguished on two of the walls.

    He died at the dawn of "The Age of Exploration"; Christopher Columbus would reach the "New World" only six months later. With his death, the center of the Renaissance shifted from Florence to Rome, where it would remain for the next century and beyond.

    Marriage and children

    Lorenzo married twice.

    Lorenzo first married Clarice Orsini by proxy on February 7, 1469. She was a daughter of Giacomo Orsini, Lord of Monterotondo and Bracciano by his wife and cousin Maddalena Orsini. They had nine children:

    Lucrezia di Lorenzo de' Medici (August 4, 1470 - November, 1553). She married Giacomo Salviati. Their daughter Francesca Salviati was mother to Pope Leo XI.
    Piero di Lorenzo de' Medici (February 15, 1471 - December 28, 1503).
    Twins born in March, 1472. Died shortly after birth.
    Maddalena de' Medici (July 25, 1473 - December, 1528). Married Franceschetto Cybo, an illegitimate son of Pope Innocent VIII.
    Pope Leo X (born Giovanni de' Medici; December 11, 1475 - December 1, 1521).
    Luisa de' Medici (1477 - 1488). She was betrothed to her cousin Giovanni de' Medici il Popolano.
    Contessina de' Medici (1478 - 1515). Married Piero Ridolfi.
    Giuliano di Lorenzo de' Medici, Duke of Nemours (March 12, 1479 - March 17, 1516).
    After Clarice's death, he married Philippina (Philippa) of Savoy, daughter of Philip II, Duke of Savoy. The couple had no children.

    Two of his sons later became powerful popes. His second son, Giovanni, became Pope Leo X, and his adopted son Giulio (who was the illegitimate son of his slain brother Giuliano) became Pope Clement VII.

    His first son and his political heir, Piero 'the Unfortunate', squandered his father's patrimony and brought down his father's dynasty in Florence. Another Medici, his brother Giovanni, restored it, but it was only made wholly secure again on the accession of a distant relative from a branch line of the family, Cosimo I de' Medici.

    -Courtesy - wiki

    'Office Politics'

    Most IT failures are driven by hidden dynamics related to political, organizational, and cultural issues. IT failure rates remain high precisely because these factors are difficult to measure, quantify, understand, and manage.

    In a recent Gartner Symposium session, analyst Tina Nunno spoke about the role of office politics in contributing to failed IT projects. From the description of Nunno's session:

    While technologies can be installed, configured and retired, the level of complexity is minimal in comparison to the complex political situations each and every CIO must face.

    Ian Grant from Computer Weekly attended the session and blogged:

    CIOs are competing with their colleagues in other areas of the business for control, resources, status and power. Any and all of these are potential flashpoints for the unwary CIO because the shifts in these areas indicate winners and losers, Nunno said.

    Nunno recommended CIOs take a look at Machiavelli, whose The Prince, a handbook on how to acquire and hold power has been bedtime reading for leaders since Lorenzo the Magnificent, for whom it was written.

    “IT is frequently in a difficult position because we cross the entire organization,” she said. This breadth of vision means CIOs often know better what is going on than their colleagues, and this can lead to jealousy and negative behavior, she said.

    THE PROJECT FAILURES ANALYSIS

    Politics is the hidden killer of the IT world and Nunno correctly asserts that CIOs should become more sensitive to political nuance. However, The Prince is hardly a model for creating healthy political environments where successful IT can thrive. Here’s Wikipedia’s comment on Machiavelli (emphasis added):

    Whatever Machiavelli’s own intentions (and they remain a matter of heated debate), his name became synonymous with ruthless politics, deceit and the pursuit of power by any means.

    CIOs should remember The Prince is a guidebook to individual survival and ascendancy; it’s not a tool for creating collaborative organizations, which success in today’s world demands. Read Machiavelli as a background guide to understanding political dynamics, but don’t rely on it to achieve successful IT projects.

    To create successful projects, CIOs should:

    1. Decipher the political landscape. Yeah, read Machiavelli, but don’t take him too literally.
    2. Focus on collaboration rather than personal ascendancy. In other words, don’t back stab your peers, as Machiavelli might recommend.
    3. Teach the IT organization better execution skills. Folks in the IT organization already know how to manage servers; now help them learn to manage projects.
    4. Talk with internal customers. Ask the business folks what they need; don’t guess and make assumptions, which will probably be wrong.

    These four points are critical to achieving successful IT projects. Examine most failures and you’ll find problems in many of these areas.

    'Clean install windows 7, Don't upgrade...'

     

    I’ve just been having a flick through Microsoft’s Windows 7 Application Quality Cookbook and I’m already certain that those deciding to upgrade to the OS from XP or Vista are going to be in for a world of hurt unless everything that’s installed is bang up to date come release day - and even then there’s room for problems.

    The cookbook is basically a big list of things that are likely to cause people problems when they shift to Windows 7. Here’s the top 11 listed in order of most likely to cause problems:

    • Internet Explorer 8 — User Agent String
    • Internet Explorer 8 — Data Execution Protection/NX
    • Removal of Windows Mail
    • Microsoft Message Queuing (MSMQ) — Removal of Windows 2000 Client Support Service
    • Compatibility — Operating System Versioning
    • Server Core — WoW64 Is Now an Optional Feature
    • User Interface — Enhanced Taskbar
    • Microsoft Message Queuing (MSMQ) — Improved Queue Handling
    • Windows Server — Terminal Services
    • User Interface — High DPI Awareness
    • Removal of WPDUSB.SYS Driver for Windows Portable Devices

    I can see three of these issues being particularly painful to those who choose to upgrade from XP or Vista to Windows 7:

    • Internet Explorer 8 — Data Execution Protection/NX
      Basically, any add-on that’s not DEP/NX aware is likely to crash the browser. Any and every toolbar or add-on could cause problems, and there’s no guarantee that DEP/NX compatible versions will be available at Windows 7 launch. Anything obsolete or outdated that’s installed it likely to cause users problems.
      While for tech-heads that’s unlikely to be a total show-stopper, for your average Joe Sixpack user who relies on IE, this could cut them off from all sources of assistance and make them have to fall back on Microsoft support.
    • Compatibility — Operating System Versioning
      OS versioning is always a bug-bear. An app that’s otherwise 100% happy with the new OS can be crippled when it comes across an OS version that it’s not expecting.
      Again, not disastrous for a tech-savvy user, but could be a real show-stopper for Average Joe.
    • Removal of WPDUSB.SYS Driver for Windows Portable Devices
      This change to Windows 7 is another gotcha waiting for upgraders. Microsoft has replaced the Windows Vista USB driver stack (WPDUSB.SYS) for Windows Portable Devices with a generic WINUSB.SYS driver. This means that there could be issues surrounding hooking up to Windows Portable Devices using legacy drivers and applications.
      Depending on your device and vendor support, a shift to Windows 7 could mean having to replace the device.

    Bottom line, these issues mean that doing an in-place upgrade of an OS could be traumatic no matter whether you are starting with XP or Vista. This means that the old rules apply - for the best experience possible, you will need to nuke your existing install and start fresh. You’ll also need to take care installing legacy drivers to make sure that you won’t be introducing problems.

    'Windows 7 to scale to 256 processors'

     

    Microsoft has been hinting that even though it had no plans to make major changes to the Windows kernel, it did have a scheme up its sleeve to make Windows 7 and Windows & Server better suited to working on multicore / parallel systems. Now details are becoming clearer as to how Microsoft plans to do this.

    Mark Russinovich, Technical Fellow in Microsoft’s Core OS division, explained in more detail how Microsoft has managed to do this in a video interview published on Microsoft’s Channel 9 Web site.

    On more massively multiprocessor systems, Windows threads spin while waiting for the dispatcher lock. Once Cutler had been moved to work on Microsoft Red Dog (Windows Azure), another kernel developer, Arun Kishan, looked at this problem with a set of fresh eyes and found a solution, Russinovich said. By adding another state — so threads aren’t just running or waiting, but can be “pre-waiting,” as well — Windows will be better suited to running parallel, multithreaded applications running across manycore systems, Russinovich said.

    Russinovich noted with the dispatcher-lock roadblock removed, a second set of locks became the new focus for folks working on the Windows kernel. The PFN database inside Windows, which contains information on all of the physical memory in the system, was becoming another scalability bottleneck when trying to get Windows to handle multithreaded apps on massively multicore machines. With Windows 7 and Windows Server 2008 R2 (Windows 7 Server), Microsoft again broke this lock down into finer grain locks, Russinovich said.

    'Microsoft has started WINDOWS 7 Blog'

     

    http://blogs.msdn.com/yochay/default.aspx

    The Microsoft Developer Network (MSDN) “Windows 7 Blog for Developers” is just what it’s name indicates, according to the first post, dated October 23.

    “This blog will mainly focus on the development aspects of Windows 7 by providing valuable content for developers….By valuable content we mean that this blog will be a ‘one stop shop’ on the road to get yourself familiar with what Windows 7 has to offer for developers and how you can ‘Light-Up’ using Windows 7 features in your application.”

    “(T)his blog is part of an effort to highlight Windows 7 development story, a story that for some reason got lost with Windows Vista. As part of the Windows 7 Evangelism team and as developers, we hope, together with you and the rest of the community will be able to create an open and direct dialog about developing for Windows 7.”

    Microsoft also has started another Windows 7-related blog, known as the Springboard Series blog, which it is aiming at IT professionals.  According to the first post on that site by Windows Client IT Pro Director Celine Allee, the Windows client division will use this site to help business users make sense of “the speculation out there.”

    'PROACTIVE ISSUES'

    Proactive ISSUES

    I have wondered many times, why a tester doesn’t share their test scripts to developers. Yes, for the reason they read the possible cases of testing and can pass the issue for those cases.

    This envisaged an idea, how this can be done to help in a right direction and for delivering a high quality product. There arise a thought like revealing certain cases to the developers before they submit for testing.

    Like, when the issue has been first raised by the tester, the tester should also raise few more issues like linked temporary issues. Such that when the developer goes thought the issue would also have knowledge of the linked issues that might occur while fixing this issue. This proactive method though raises few more issues but if you look closer into the design, the closing up of issues will be fast and with very high quality than the previous.

    Now, digging onto the core concept of Proactive Issues. As the analyst suggest for any change request, the request document is sent to both development team and test team. The development team starts the design process and the test team starts writing test scripts. Now as an extra effort, the test team should also write scripts for proactive issues and should straight away raise proactive issues in the issue tracker tool. Now the developer will get the design doc as well the set of proactive issues. Any developer who fixes the code will have an understanding on what are the possible issues and the fixed code will not raise any error now. If so any error occurred and issue has been raised, now the tester should not raise a single issue, he should also raise the link and supportive issues along with it.

    This stringent process can avoid the delay of issue cycle rotation and will boost up the delivery date. This was Just a flash came to my mind when I was about to sleep.

    Hope the industry experts will reply comments about the same.

    'Dynamic Management Views (DMV)'

    Dynamic Management Views (DMV)

    The Dynamic Management Views (DMV’s) gives administrator information about the current state of the SQL server machine. This information helps the administrator to diagnose the problems and tune the server for optimal performance.

    The DMV’s exists in sys schema and starts with the name dm_.

    For e.g.: to see the total physical memory of the SQL Server machine; then execute the below TSQL command:-

    SELECT (Physical_memory_in_bytes/1024.0)/1024.0 AS Physical_memory_in_Mb

    FROM sys.dm_os_sys_info

    1. sys.dm_os_sys_info

    This view returns the information about the SQL Server machine, available resources and the resource consumption.

    select * from sys.dm_os_sys_info

    1. sys.dm_os_hosts

    This view returns all the hosts registered with SQL Server 2005.

    select * from sys.dm_os_hosts

    1. sys.dm_os_schedulers

    Sys.dm_os_schedulers view will help you identify if there is any CPU bottleneck in the SQL Server machine.

    SELECT * FROM sys.dm_os_schedulers

    1. sys.dm_io_pending_io_requests

    This dynamic view will return the I/O requests pending in SQL Server side.

    select * from sys.dm_io_pending_io_requests

    1. sys.dm_io_virtual_file_stats

    This view returns I/O statistics for data and log files [both MDF and LDF files]

    select * from sys.dm_io_virtual_file_stats(6,2)

    1. sys.dm_os_memory_clerks

    This DMV will help how much memory SQL Server has allocated through AWE.

    To get the memory consumption by internal components of SQL Server 2005.

    SELECT TOP 10 type,

    SUM(single_pages_kb) as [SPA Mem, Kb]

    FROM sys.dm_os_memory_clerks

    GROUP BY type

    ORDER BY SUM(single_pages_kb) DESC

    1. sys.dm_os_ring_buffers

    This DMV uses RING_BUFFER_RESOURCE_MONITOR and gives information from resource monitor notifications to identify memory state changes. Internally, SQL Server has a framework that monitors different memory pressures. When the memory state changes, the resource monitor task generates a notification. This notification is used internally by the components to adjust their memory usage according to the memory state.

    The record column will be in the XML format.

    SELECT * FROM sys.dm_os_ring_buffers

    WHERE ring_buffer_type = 'RING_BUFFER_RESOURCE_MONITOR'

    1. sys.dm_db_file_space_usage

    This DMV provides the space usage information of TEMPDB database.

    select * from sys.dm_db_file_space_usage

    1. sys.dm_db_session_space_usage

    This DMV provides the number of pages allocated and de-allocated by each session for the database.

    select * from sys.dm_db_session_space_usage

    1. sys.dm_db_partition_stats

    This DMV provides page and row-count information for every partition in the current database.

    SELECT * FROM sys.dm_db_partition_stats

    1. sys.dm_os_performance_counters

    Returns the SQL Server / Database related counters maintained by the server.

    SELECT * FROM sys.dm_os_performance_counters WHERE counter_name = 'Log File(s) Used Size (KB)'

    1. sys.dm_db_index_usage_stats

    This DMV is used to get useful information about the index usage for all objects in all databases. This also shows the amount of seeks and scan for each index.

    SELECT * FROM sys.dm_db_index_usage_stats ORDER BY object_id, index_id

    1. sys.dm_exec_sessions

    This DMV will show all the information about each session connected to SQL server.

    SELECT * FROM sys.dm_exec_sessions WHERE session_id >= 51

    1. sys.dm_exec_connections

    This DMV shows all the connections to SQL server.

    SELECT * FROM sys.dm_exec_connections

    1. sys.dm_exec_requests

    This will give details on what each connection is actually performing in SQL server.

    SELECT * FROM sys.dm_exec_requests WHERE session_id >= 51

    1. sys.dm_exec_sql_text

    This dynamic management function returns the text of a SQL statement given a sql handle.

    SELECT * FROM sys.dm_exec_requests r

    CROSS APPLY

    sys.dm_exec_sql_text(sql_handle) AS st

    WHERE r.session_id > 51

     

    Push forward your comments...

    'About'

    This is what is me. I live simple.




    IMITINEF MERCILET Medicine for blood cancer


    I am having a huge hits from google on IMITINEF MERCILET, and thus wanted to provide more details on this.

    IMITINEF MERCILET is a medicine which cures a type of blood cancer. It is available at free of cost in the following hospitals:
    1. Adyar Cancer Institutes in Chennai, Bangalore, Trivandrum
    2. Coimbatore Sri Ramakrishna Hospital.

    The Adyar Cancer Institute is a real health facility. "Imitinef Mercilet" is apparently an alternative spelling of the cancer drug, Imatinib mesylate. It is true that Imatinib (or "Imitinef") is available free of charge for patients who have been admitted to the Adyar Cancer Institute hospital for cancer treatment. However, the Institute is not handing out the drug freely to all as suggested in the message. Moreover, the drug does not actually cure all blood cancers.

    The Adyar Cancer Institute is indeed specializes in cancer treatment and research. The Adyar Cancer Institute has achieved great results in the treatment and research of cancer since its establishment in 1954.

    Contacted a spokesperson at the Adyar Cancer Institute to ask about the veracity of the message. He sent me the following reply:
    Only the Part of this message is true. The medicine Imitinef is available free for only qualified persons and not for all. It is free for those who have admitted in the hospital for treatment.

    'Imitinef Mercilet' is apparently an alternative spelling of the drug Imatinib mesylate which is used in the treatment of some forms of leukemia along with other types of cancer. Imatinib, often referred to a "Gleevec", has proved to be an effective treatment for some forms of cancers. However, "blood cancer" is a generalized term for cancers that affect the blood, lymphatic system or bone marrow. The three types of blood cancer are listed as leukemia, lymphoma, and multiple myeloma. These three malignancies require quite different kinds of treatments. While drugs (including Imatinib), along with other treatments such as radiation can help to slow or even stop the progress of these cancers, there is currently no single drug treatment that can be said to actually cure all such cancers.

    Moreover, it should be noted that Imatinib is available for cancer patients in many different health facilities around the world, not just the Adyar Cancer Institute.

    -Yuva