Reminder! first birthday celebration is this Saturday. View Invitation | |||||||||||||||
|
Thursday, May 7, 2015
Event Reminder: first birthday celebration
Wednesday, April 29, 2015
Event Update: first birthday celebration
Event Update: first birthday celebration View Invitation | ||||||||||||||
|
first birthday celebration
You've received an invitation from Rashmi and Prashant! View Invitation | |||||||||||||||
|
Saturday, November 14, 2009
Spiritually reborn beauty
readonly vs const
in .net there are two types of constant. runtime and compile time. readonly are runtime constant and const are compile time.
1. which one is faster? const are faster than readonly. reason is straight forward const are get assign at compile time and when you see the IL code you can see direct value assign there. while in case of readonly, reference get attached there.
2. which one to use ?
const you can assign to string, number data types. so limitation is here.
consider following example.
const Myclass1 cls = new Myclass1();
will this code complile ? NO
you will get following error
Error 1 'cls' is of type 'ConsoleApplication1.Myclass1'. A const field of a reference type other than string can only be initialized with null.
So you can not use const here.
try above using readonly...
great !!!
3. in 1st scenario... const are faster that readonly ....
suppose in your application you dont have 2nd scenario. and in your application you care about the speed. so you will use const.
consider following scenario.
have one class library.
public class Helper
{
public static readonly int StartValue = 5;
public const int EndValue = 10;
}
My another assembly say MyApp i uses above class library with taking reference in the application.
for(int i = Helper.StartValue; i < Helper.EndValue; i++)\
{
Console.WriteLine("Value is {0}",i);
}
output:
Value is 5
Value is 6
.
.
Value is 9
now i will change the code in my Helper class as follows.
public class Helper
{
public static readonly int StartValue = 105;
public const int EndValue = 120;
}
and recompile the Helper class library. and copy past the reference copy in my assembly MyApp without recompiling the MyApp assembly.
(use two different project here. one for Helper class library and another for assembly MyApp )
what will be the final output ?
You will get no output....
to know the result check il code for MyApp.
in IL direct value get assign to const variable where are for readonly reference is there.
so your for loop will take StartValue= 105 and EndValue = 10.
So you need to consider scenario 3 while declaring variable with readonly that const.
My suggestion
It is better to use slower but secure program than faster, broken program.
Thanks,
Prashant M
Monday, July 16, 2007
endless and countless emotions- Sufi music
In this show there are lots more singing tallent but my favourate is Amanat Ali.
He sang a song this time is so killing
i want to share with you guys....
This song take more effect on long drive or long .....
Enjoy this song
-------------------------------
Saawan bhi tho jaaye pe harwa,
man mera ghabaraaaye,
aiso gaye pardes piya tum,
chain hamein nahi aaaye.
Mora sayya mose bolena,
main laakh jatan kar haari,
laakh jatan kar haar rahi,
mora sayya mose bolena.
Tu jo nahi tho aise piya hum,
jaise sunaah aaagara,
jaise sunaah aaagara,
naina pe haari raah han haare.
nai non ko tarasaaana
mora ....
pyar tumhe kitna karte hain,
tum ye samaj nahi paayoge,
jab humra honge tho pe harwa,
bolo kya kab aaayoge.
mora ..
tata take care
Tuesday, June 26, 2007
23 June Weekend
Ok then looking forward... reached Nagpur and attend Sandeep Tai's merriage. Merriage is good one everyone is happy and food is good I enjoyed that (though it was veg). So Me, Jaya and Kirti planed to go to saw the plot in nagapur for investment and for living. Finally we searched 2 of them and have to decide for one.
then i came back to my home town Yavatmal (City of Garden before 50 yrs now City of Blood.coz of crime rate is increasing day by day).
I really enjoyed everything at home from cooking to gardening, helping my Aai really really good.
Mansoon is just came. so i just desided why not we take initiative to make our Yavatmal to garden city from blood city such a big step(this is just form me and reader i dont need publicity coz i m not a polititian. I hate that).
So I planted 5 trees. 2 of Ashoka 1 of Dashahari mango and 1 of lemon and 1 of ChandraKamal. Best thing that me and my mother,father,Sis, Lit. Bro and one last but not least Ruby(my dog) work for that together. From digging soil to planting tree. My father was in forest so he knew very well how to do plantetion and all.
So i wish my plant best of luck for there good future.
Today i came in the morning at 10 and reached office at 11 little bit late.
My Wish:- After chandrakam plant gives birth to his flower then i want to donate this flower to Sai mandir yavatmal.
Chala kam pan asatat office madhe...