Tuesday, April 29, 2014

From IIS 7.5 onwards IIS has the ability to use prewarming functions to get the stuffs done before anyURL hit to ther server. Say you want to fill your cache, so that you can avoid lot of processing time. But before IIS 7.5 this was done in the Application_Start of Global.asax. The disadvantage in doing this is, this code will be executed on the first URL hit. But thats not what we want. To speed up this what developers used to do is, they make fake request to the server inorder to invoke the prewarming method. To overcome all these things IIS 7.5 came up with a functionality called AutoStart.
The AutoStart option basically needs to be enabled for our site and we need to provided serviceAutoStartProviders which will provide the pre warming functionality. I will explain it step by step here.
1. Open IIS manager --> Features View --> Configuration Editor and open the section "system.applicationHost/applicationPools"
2. Change the AutoStart option as displayed in the picture below and click Apply.



3. Now in the same Configuration Editor open the section "system.applicationHost/serviceAutoStartProviders"
4. Add a new serviceAutoStartProvider. In the name field provide a name for your serviceAutoStartProviders and in type provide the type of the prewarmer assembly in the following format
(Namespace.ClassName, AssemblyName)  eg: (MyNamespace.MyClass, prewarmer) if your assembly is prewarmer.dll 
(Note: There's a catch here. You need to provide the namespace name along with class name.)
5. Most of the time if you follow these steps you’ll see a new “w3wp.exe” worker process immediately startup as soon as you save the configuration. But if you don't see it starting, nothing to worry. Just open the app pool config file for your app pool in the following location.  "C:\inetpub\temp\appPools\YourWebsite\YourAppPool.config" and make changes as below.


     

     <site name="MySite" id="1">

          <application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PreWarmMyCache" />

     </site>



Once you save the config file after theese changes you will see the new “w3wp.exe” worker process immediately starting up.

Okay now what's the deal with assembly. Nothing much guys, Just implement the IProcessHostPreloadClient as below and add your loading code in the preload fucntion. No need to worry about the string[] parameters.

public class MyClass : System.Web.Hosting.IProcessHostPreloadClient 
{
    public void Preload(string[] parameters) 
{
//Prewarming logic here
    }
}

Thats all folks. Your website is now ready to prewarm. Restart your AppPool and all set to go. Event log will provide you if your prewarm code contains any unhandled exception causing app pool to stop.

Happy Coding,
Dheena

Friday, December 10, 2010

How To restore home when stock launcher gets deleted

The most dangerous situation while using android phones is having no launcher in your phone. This situation arises when you delete your last existing launcher from your phone's system/app. It happened for me a lot of times. Because most of the stock launchers other than htc sense are junk. You probably want to delete your stock launcher or to mod your stock launcher. In either way what happens if you delete your stock launcher and you don't have an alternative. Your are stuck with a black screen which makes you impossible took open anything in your phone. In this situation you can attend calls but cannot make one, you can receive mails and message. I searched a lot of sites for the solution, but most of them told me to reflash the firmware. I was like what the hell.

After lot of thinking and I found a way to get your phone back normal without reflash. So here you go.
1. Mail the market link of an alternative launcher like launcher pro to your phone.
2. Open the mail and the link.
3. It opens the market app where you can download your launcher.
4. There it there you go. Now you can restore your stock launcher using root explorer or similar app.

Dheena

Saturday, September 18, 2010

I Look Back - Final Episode

G was really frustrated with the problems she was facing these days. But she didn't realise that I am the one behind all these. I was happily enjoying watching her crying. But something inside me insisted not to do these things. So I slowly averted myself from doing bad to her. What ever I do I will always share those things with my friends. I also told them how I frustrated G, just to show my potential and my manliness. I was becoming very close to G. Normally girls will appreciate your presence when they are in grief. So G really liked my presence when she was disturbed, without knowing that I was the disturbance. I gave her a note book and a pen as a gift to her birthday. What did you expect me to give as a gift at that age. I still remember that the note book had a dinosaur picture in the cover. We were friends after that. She became the class Representative that year. But I was not upset for that rather happy.

But that day came when I have to leave the town since my dad got transferred to Salem. My friends knew that I will be leaving the city but they didn't know when. I went to school till the day we left the town. One day I was absent for the school and the next day also. People might have realised that I left the town. After that I never had contact with any of my friends. I remembered only their names and the memories.

After ten years, I was in Coimbatore, doing my UG. Orkut was very famous those days. I saw a community has been created for my school in Sivagangai. I joined the community and in my Intro I enquired if any of my class mates are still there. A year after my post I got a reply from S. I enquired her about G and others. It was of no use. S also moved out of Sivagangai after 6th standard.

After 2 years, these days FaceBook is much popular than Orkut. I didn't use Orkut for about 2 months. I totally forgot about the post in that community. Surprisingly I got a friend request. Guess who? Its G. That night we almost chatted for 3 hours. She requested me to write a blog about Sivagangai and Our school. Now I complete the blog of my experience in Sivagangai.

Dheena.

Saturday, August 14, 2010

I look back - Episode 11

In our country, when the government wants to do some reforms, they won’t do it all by themselves. They appoint some representatives to execute in behalf of them. Also these representatives won’t execute the reforms properly and they use the power given by the government, to their own benefits and some of their relatives, which will give frustration to many people. You may wonder why I am telling this. You will get to know in this write up.

In my school, later there was a rule put forward by our head mistress. The rule states that every student in our school should wash their Tiffin boxes after the lunch. Since school did not have enough staffs to check the students Tiffin boxes also it wouldn’t be fair for the management to tell the staffs to check the Tiffin boxes. So they appointed representatives from students to check everyone’s boxes after the lunch. Only after getting the OK from the rep, any student is allowed to enter the class after the lunch.

That day, G was eating her lunch as usual with her gang. I looked at her as she just finished eating. She washed her box and wiped it. She looked her face in the reflection created by the shining clean silvery Tiffin box of her. She did wash her face before that and combed her hair in to round bundle. She looked very beautiful. She walked towards the entrance and showed her box to the rep. Though the box was clean, the rep told her that it was unclean and told her to wash the box again. She was confused and she was not able to resist him and just for his satisfaction she washed the box once again. This time the box was ultimately clean. Again the same rep, he refused to allow her again. She was totally frustrated. She started to argue with the rep. But he was very stubborn in not allowing her. So she again washed and this time she went to show to another rep. But he also refused to allow her. After the fifth time they allowed her to go.

I could see the anger and frustration in her. I was not able to just stand there anymore. So I just went to the place where these reps are standing and thanked them. “Do this to her frequently, I want her to cry before me”, I said.
To be continued…

Friday, August 13, 2010

I Look Back - Episode 10

I am confused. I really didn’t expect this from you, she continued. Expect what? I thought. You proved that you are no different from other guys, she added. You helped me a lot in continuing my studies; you had been a good friend amongst other boys. But this is what you have in return for me, She continued. So here after there is no relationship between you and me, and I am ashamed being friend with you, she grunted before leaving the place. But even after she left I was thinking how she came to know this matter, I dint tell her yet. After a while my best friend came that way. I enquired him whether he said anything to G. He said no but he assured he told S. Finally I came to know how this news got spread. If you tell a girl a news and tell her not to tell any one, then at the end of the day every one will know the news. They call it a girl thing.

He requested my apology for telling this news to S. I did not see any mistake on his part. I am not in anger with him. But with G. how could she believe blindly whatever she hears about me. If she is truly in friendship with me she should have asked me about that for confirming. The act of her clearly shows that she is just like any other girl. Nothing special in her. But I am not going to leave this alone. I am going to teach her a good lesson. The cunning part of me, which gone to hiding because of her, now came back to me, that too because of her.

Every love starts with fight and ends with love, but in my case it started with love and now going to end with war, I said to my friend.

to be continued...

Thursday, August 12, 2010

I Look Back - Episode 9

I nodded my head slowly as if I was accepting the offer with some hesitation, though my heart was jumping in joy. I looked at G and C, as they were standing together. I noticed a smile just leaked out of G’s face. She noticed that I am beholding her so I skipped my sight out of her. I got ready for rehearsal as teacher wanted me to stand in the centre. I was waiting for a big dance step, but she just told me to raise my hands and wave for some time. That was easy for me. And after that I was holding the girls’ hands and I came forward to the front of the stage as people before me standing or sitting in front of the stage clapped the hands. It was the annual I felt very happy getting applauds from the crowd.

After our show I just went to the changing room for shedding my costumes, where I saw G just standing before me and alone in the room. She was standing very near to me as I can smell her fragrance. As once my friend said usually it was not love at first sight, at first sniff it was. I was simply looking at her. My eyes forbade sending the signals to the brain but my nose did. She waved her hands before my face as if she’s saying bye to me, but wanted to get my attention. I got out of that hallucination after a while. What she asked. Nothing, I lied. She threw a smile at me and just left the room. At that I felt like holding her face in my hands. I think at some instant of this time she became a part of me. And at that instant I decided to tell her that how much I like her. I didn’t want to mention it as love, because I was not at an age to understand what love is. It was a feeling, which makes you think about one person most of the time.

One day I told all these things to one of my best friend. I believed in him. After telling this to him I felt very much relieved. That evening G came to me. I was little bit nervous. “I didn’t expect this from you”, she told.

To be continued…….

Monday, August 9, 2010

I Look back - Episode 8

Her name was C. I really wanted to be very close to her. But fortunately I didn’t get opportunities for that. Even I tried to make some, but didn’t work well. Every one in our class, attracted to her. She was very close to one of my big rival in my class and this made me hate her. There was a saying in Tamil “Nizhalil arumai veyilil theriyum” (you will realize the goodness of Shadow only when you are exposed to the sun). I really missed G those days. I wanted to continue the relationship with her.

Meanwhile annual day celebrations were announced in our school. Teacher asked for active participation in the cultural events from our class. Firstly she asked for skit, some people from my class opted for that. I didn’t opt for skit; actually I never wanted to participate in these events. There are two reasons for that. One is, if you are participating in the events, you need not to come to school that day. Secondly, I always wanted to sit back, relax and watch the performance.

Teacher asked for dance participation. For me dance is like eating bitter guard. But both G and C opted for dance participation and my rival P also opted for dance. The only thing went on my mind is what happen if they pair G or C with P. I can’t even imagine that. So with out even thinking again I raised my hand for Dance participation. On the next Saturday they arranged for dance practice in my headmistress house. I told my mom that I am going for dance practice. She looked at me strangely and asked dance? You? “Yes” I replied. When I went there I came to know that boys and girls are dancing separately. I scolded myself for my foolishness. They wanted us to dance for some song. After seeing my dance they removed from the group and made me wait. I was just watching others dancing, also sometimes peeping in to the room where girls danced. While I was peeping in to the girl’s room one teacher saw me and called me inside. I was frightened to the core. I thought she was going to beat me in front of all the girls that too G and C are there inside.

Teacher asked me why I am not dancing with the boys. I told her that no slot available for me, hiding the truth that I was expelled because of my poor dance. After thinking for a while she asked me, “Can you dance with these girls??”

To be continued……..