.NET and I !!!
This is page 2 of the discussion. Read the opening post
After Hours
This is page 2 of the discussion. Read the opening post
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Microsoft has created an Architecture Resource Center to provide information on architectural issues. While MSDN is very good for providing coding & debugging related information, it has very little to offer for Architect minds. Realizing this, Microsoft launched its new Architecture Center as primary software architecture resource for all those geeks in us, who look far beyond mere code syntaxes. The center is organized into four distinct sections, "Think Ahead" for information on upcoming technologies, "Learn More" for content that provides detailed information, and "Solve Now" for solutions and resources for today's problems, and "Share Ideas".
To add more to fun, there is also a link to Microsoft's Architecture Journal, which you can download/order print copy. Visit and share your ideas here.
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
Aright, you are developing a web application, huge amount of data is fetched for being displayed, heavy loaded database fetch calls are involved, you knew queries to database are same everytime (like front page of any portal) but you don?t know how to exploit this fact OR even if you knew caching can make your application flashing fast but who in the world will develop cache for you...??? Well, the single solution for this fiasco is Microsoft?s Caching Block and yes, Microsoft did this for you and that too, free of cost so blaming & bashing Microsoft for every bad thing is not a good thing to do. Okay, now let get into bit detail about caching block....
Microsoft Application Block is a suite of open source, free applications of which Caching block is a part. Other constituents of block are Data block, Exception Management block etc. Caching block gives you power to add a cache to your application and later store/retrieve from it. Its based on LRU policy and it can store any thing in the world in it (as it basically implemented for object). Sooooo enough of intro, lets jump into it.
For any application to use cache block, you need to give some configuration information to block. You can provide this in App.config (for desktop application) or web.config (in case of web application). What this configuration info. will be...? just copy-paste this code...
type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler ,Microsoft.ApplicationBlocks.Cache" />
AssemblyName="Microsoft.ApplicationBlocks.Cache"
ClassName="Microsoft.ApplicationBlocks.Cache.DataProtection.Defau ltDataProtection"
ValidationKey="Oci44OQ9C3xAdQ3/BMHpksPfzeTezLkXen/ahQ8T7nVk/KMgAF nssQJr00KUNhRso+MpLVwAinGep6i14X9M+A=="
Validation="SHA1"/>
ClassName="Microsoft.ApplicationBlocks.Cache.Storages.SingletonCa cheStorage" Mode="InProc" Validated="true" Encrypted="true" RemotingUrl="tcp://localhost:8282/CacheService" />
ClassName="Microsoft.ApplicationBlocks.Cache.Scavenging.LruScaven ging" MemoryPollingPeriod="60" UtilizationForScavenging="80" MaximumSize="5"/>
Now, how to use cache.
Add the following line at top of your class.
using Microsoft.ApplicationBlocks.Cache;
Next, add any object in cache...
CacheManager.GetCacheManager().Add(rstrKey, roData);
where rstrKey is key to the stored data, which you will later use to fetch data back from cache and roData is the data, it can be of any type, ranging from string, int, bool... other primitive types to your custom class objects, as in actuality, everything is derived from object class and above function expects any object?s object to arrive as parameter.
Now what about retrieval of data, well, its also as simple as;
String strMyData = (string) CacheManager.GetCacheManager().GetData(rstrKey);
where rstrKey is again key to data, and supposing our stored data was actually of string type we got data from cache, casted it in string and wow!! here we have our data back.
If for some reason, you need to remove data from cache (data being invalid due to update in database) use this code.
CacheManager.GetCacheManager().Remove(rstrKey);
So how is it...? wonderful.... yeah I knew and that?s why I shared this with you.... now do try it.....
Happy coding...... :)
by ali.ikhan
A very hot question you usually encounter in job interviews and university viva is ?Are there pointers in C#? if so, then how to use them?? and its very disgusting to see 90% people failing to answer.... so here I?ll show you today how easy it is to use pointers in C#. The key of usage is.... the unsafe keyword. Whenever and wherever you?ll use it, compiler will know unsafe code is going to follow and obviously pointers are such piece of code....
See this sample below....
using System;
class Dummy
{
static void Main()
{
PlayWithPointers();
}
unsafe static void PlayWithPointers()
{
int *p;
int i;
i = 70;
p = &i;
string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String
Console.WriteLine(addr);
Console.WriteLine(*p);
*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer
i = *(&i) + 10;
Console.WriteLine(i);
}
}
I think anyone having prior experience of playing with pointers in C/C++ will take above code as piece of cake..... really easy and strikingly similar to pointers in C/C++. The only difference is, as I notified earlier, is unsafe keyword.
So, now have fun with pointers in C# as well..... and oh yes, I knew you have got a point in favor of C# in ?C# vs. java? debate here.......
Have a nice day......
by ali.ikhan
I knew we are all are addicted to Google. We were, even before GMail, Google Desktop Search, Google Groups, Picasa (see complete list of Google products here ) etc. So now idea of an alternative to Google seems unthinkable if not impossible. But then this is
change thats most consistent in world. Remember!
Sabaat aik taghaiyur ko hai zamaney mey
(Only change is consistent in world)
- Dr. Iqbal
So, just for change have a look at beta version of A9.com. Its not like Google, its not like Yahoo, AltaVista, MSN either, but there is something in it, that made me write this for you. :)
by ali.ikhan
Eyes of Developers, Software Engineers, Architects, CIOs, CTOs all over the globe are on on Whidbey(Visual Studio 2005). Waiting eagerly, impatiently and some even madly..... But ever thought what will happen in techie scene after Whidbey?
Well, Microsoft ppl are thinking.... So, whats next...? Orcas and Hawaii... Here are few words of intro.....
Orcas is planned to ship next year a few months after Longhorn to support new Longhorn features. Microsoft officials thinks while Whidbey will help developers target the upcoming Longhorn operating system, Orcas will be the version of the tool set that will enable developers to ride what the company calls the Longhorn wave and tap the new features of the operating system. Hawaii will come shortly after Orcas to provide even more Longhorn-specific functionality and more.
Excited!! Read more
by ali.ikhan
My colleague today introduced me with this huge Collection of computer books... and surprisingly, all of them are Free!!. This is really enticing, as at least I am not aware of any other site with so many free books. So, all those friends of mine who are IT professional, student or enthusisast.... this is must visit recommedation from me...
by ali.ikhan
IT profs are notorious for having dull, mundane life.. spending their days (& nites) in small tiny cabins... hammering their fingers on keyboard and playing with mouse... smiling strangely when red spots on screen (bookmarks) start flashing... talking in alien jargon about mysterious un-fathomable things.... wearing jeans and shirt of good 'ol 60s... and in the end of month taking away huge hefty bucks from company... only to spend them back in those electronic/computing gadgets and stuff...
Well, frankly this is what impression of IT professionals is... at least in some quarters of western part of world... thanks to Almighty... people here (in Pakistan) dont think of IT profs like this... and IT profs too are not that careless and geek sort of..... they are mostly well-dressed & smart... they do discuss strange things in their peculiar jargon... but are also very much 'in' in all other things, non-IT ppl are .... ranging from music, movies to politics etc.... What I mean to say is 'geeky' element is not very much visible in Pakistan's IT arena....
Neways, thats not what I supposed to talk about today.... rather I just want to take you to office in Redmond, where Microsoft ppl (geeks) are working on upcoming Whidbey..... A very interesting read, indeed.....
by ali.ikhan
I wanna write... I wanna write big long posts... but :( .... I am really busy at office...
Still, I could'nt stop myself to take 5 minutes out and direct you to this excellent post '
I want to be a good programmer... How?' I found on Daniel Turini's blog.
Happy Programming!!!
by ali.ikhan
I dont know its true or not and Bill Gates really said this all or some fan of him narrated this on his behalf. And I am not even interested in knowing this. What I knew is; I read the following somewhere and I just felt I should post this on my blog.
So now since you have landed here for any reason in world, do read following as well.... its just a reminder of some very basic & tacit facts about practical life.
"Bill Gates recently gave a speech at a High School about 11 things they
did not and will not learn in school. He talks about how feel-good,
politically correct teachings created a generation of kids with no concept
of reality and how this concept set them up for failure in the real
world.
Rule 1: Life is not fair - get used to it!
Rule 2: The world won't care about your self-esteem. The world will
expect you to accomplish something BEFORE you feel good about yourself.
Rule 3: You will NOT make $60,000 a year right out of high school. You
won't be a vice-president with a car phone until you earn both.
Rule 4: If you think your teacher is tough, wait till you get a boss.
Rule 5: Flipping burgers is not beneath your dignity. Your Grandparents
had a different word for burger flipping - they called it opportunity.
Rule 6: If you mess up, it's not your parents' fault, so don't whine
about your mistakes, learn from them.
Rule 7: Before you were born, your parents weren't as boring as they
are now. They got that way from paying your bills, cleaning your clothes
and listening to you talk about how cool you thought you were. So
before you save the rain forest from the parasites of your parent's
generation, try delousing the closet in your own room.
Rule 8: Your school may have done away with winners and losers, but
life HAS NOT. In some schools they have abolished failing grades and
they'll give you as MANY TIMES as you want to get the right answer. This
doesn't bear the slightest resemblance to ANYTHING in real
life.
Rule 9: Life is not divided into semesters. You don't get summers off
and very few employers are interested in helping you FIND YOURSELF. Do
that on your own time.
Rule 10: Television is NOT real life. In real life people actually have
to leave the coffee shop and go to jobs.
Rule 11: Be nice to nerds. Chances are you'll end up working for one."
by ali.ikhan
I dont know its true or not and Bill Gates really said this all
or some fan of him narrated this on his behalf. And I am not even
interested in knowing this. What I knew is; I read the
following somewhere and I just felt I should post this on my blog.
So now since you have landed here for any reason in world,
do read following as well.... its just a reminder of some very basic
& tacit facts about practical life.
"Bill Gates recently gave a speech at a High School about 11 things they
did not and will not learn in school. He talks about how feel-good,
politically correct teachings created a generation of kids with no concept
of reality and how this concept set them up for failure in the real
world.
Rule 1: Life is not fair - get used to it!
Rule 2: The world won't care about your self-esteem. The world will
expect you to accomplish something BEFORE you feel good about yourself.
Rule 3: You will NOT make $60,000 a year right out of high school. You
won't be a vice-president with a car phone until you earn both.
Rule 4: If you think your teacher is tough, wait till you get a boss.
Rule 5: Flipping burgers is not beneath your dignity. Your Grandparents
had a different word for burger flipping - they called it opportunity.
Rule 6: If you mess up, it's not your parents' fault, so don't whine
about your mistakes, learn from them.
Rule 7: Before you were born, your parents weren't as boring as they
are now. They got that way from paying your bills, cleaning your clothes
and listening to you talk about how cool you thought you were. So
before you save the rain forest from the parasites of your parent's
generation, try delousing the closet in your own room.
Rule 8: Your school may have done away with winners and losers, but
life HAS NOT. In some schools they have abolished failing grades and
they'll give you as MANY TIMES as you want to get the right answer. This
doesn't bear the slightest resemblance to ANYTHING in real
life.
Rule 9: Life is not divided into semesters. You don't get summers off
and very few employers are interested in helping you FIND YOURSELF. Do
that on your own time.
Rule 10: Television is NOT real life. In real life people actually have
to leave the coffee shop and go to jobs.
Rule 11: Be nice to nerds. Chances are you'll end up working for one."
by ali.ikhan
Day Begins
Day Midst
Day Ends
Well I am the responsible member of my team, you know I do follow the required steps when:
In order to fulfill my responsibilities, you know my guiding principles are:
On top of that, I realize the need of what all above I mentioned, so I keep myself:
by ali.ikhan
You dont know, but I have very peculiar taste, specially about Intellectual things (books, poetry, writings). Sometimes I start loving a thing that many people adore, like some best seller book etc. but at other times, I put something that not many people even not heard of, at top of my favourites list. Anyhow, what today I'll write here is something that no sane person with even slightest interest in urdu poetry dare not admiring. This is by Ibn-e-Insha and trust me, though language is bit difficult, its lovely. Read and Enjoy!!!
Ferz karo hum ahl-e-wafa hoan, Ferz karo deewaney hoan
Ferz karo ye donoan batain jhooti hoan, afsane hoan
Ferz karo ye jee ki biptaa, jee se jordh sunai ho
Ferz karo abhi aur ho baqi, aadhi hum ne chupai ho
Ferz karo tumhain khush karne ke dhoonde hum ne bahane hoan
Ferz karo yeh nain tumharey sach much ke mai-khaney hoan
Ferz karo yeh roag ho jhuta, jhuti peet hamari ho
Ferz karo is peet ke roag main sans bhi hum pe bhari ho
Ferz karo ye joag bajog ka hum ne dhong rachaya ho
Ferz karo bas yehi haqeqat, baqi sab kuch maya ho
dekh meree jaan keh gaye Baahoo: "kaun diloan ki janey 'hoo' ?
bastee bastee sehra sehra, lakhoan karein diwaney 'hoo'
jogee bhi jo nager nager mein marey marey phirtey hain
kaasa liye bhabhot' ramaye sab k duarey phirtey hain
shair bhee jo meethee bani boal k mann ko hertey hain
banjarey jo oonchey damoan gee k saudey kertey hain
in mein sachey motee bhi hain, in mein kanker pather bhi
in mein uthley paani bhi hain, in mein gehrey saager bhi
goree dekh k aagey berhna, sabb ka jhoota sacha, 'hoo'
doobney walee doob gayee, woh ghara tha jis ka kacha, 'hoo' "
by ali.ikhan
I got a forwarded email from one of my colleague lately. I was about to delete it (usual response forwarded emails get from me) when I saw Oscar Wilde's name. And then what I got was handful of wonderful quotes from this wonderful author. Read and try to see & feel the depth beneath each of his words.
by okejhej
by ali.ikhan
Ali, two things never to forget if you really want to excel in your career!
1. Keep life's steering in your hand! Things do come and they will definitely, to spoil your planning/ideas, but still try your best to keep hold of things and leave rest to God Almighty, trust on Him first and then on yourself.
2. Life is always a trade-off game. So never hesitate to take decisions, no matter how they are. Dont look at things at things you gonna loose in this course, rather look what are you collecting! I bet this will keep you happy!
by ali.ikhan
Worst calamity in the history of Pakistan has struck. Cities and towns vanished, thousands of people perished and thousands remain to mourn and recollect lost pieces of life.
Our duty? - To help our brethren and sisters in this hour of difficulty. But what can we do. Quran teaches us spending in Allah Almighty's way everything that we hold dear (Aaya 1. Part 4) and that includes money, blankets, clothes, food items.... and your time! Yes, the earth quake victim need your time, your attention as well. But how can you contribute this way. Well, if you live any close to the affected area, put a bag of relief items on your back, tell your mom you'll be back in a day or two, say good bye to siblings and rush to the quake victims. If not far, then visit CMH, PIMS hospital Islamabad, perhaps that one chocolate you present to child being admitted there, one joke that you narrate, one smile that blossom on your face could bring laughter and sign of hope in the gloomy atmosphere of the hospital.
If you are Karachite (like me) then going all the way to these places in not easy, specially, if you are in professional life (again like me) when getting leave from work should be planned at least a month back. But being distant from the affected area puts more responsibility on our shoulders, I believe. Since we aren?t going there physically, we should go all out to help them in whatever way we can. One thing is to contribute in relief goods and other is to help the authorities to dispatch them. Yes, this second thing is also very important. Pakistan Air Force is responsible for dispatching goods from Karachi to Mansehra, Rawalpindi and Kashmir. Relief goods that are collected from all over the Karachi are being dumped at PAF Museum. Goods are then sorted, packed and loaded in trucks, containers, C-130s and train. There is an acute need of volunteers at PAF museum for carrying out these tasks. While already hundreds of boys, girls, youngsters, man, women from all walks of life throng museum for volunteer work, there is need for more. If you are male, then you could possibly help PAF personnels in loading the goods in vehicles while if you belong to the fairer sex, then you can help in sorting/packing goods. This is call of duty, so don?t lag behind in responding positively!
See you at PAF Museam, Karachi!
by ali.ikhan
The Pope decided that all the Pakistanis had to leave Italy. Naturally there was a big uproar from the Pakistani community. So the Pope made a deal. He would have a debate with a member of the Pakistani community. If the Pakistani won, the Pakistanis could stay. If the Pope won, the Pakistanis would leave.
The Pakistanis realized that they had no choice. So they picked a man to represent them. He asked for one addition to the debate. To make it more interesting, neither side would be allowed to talk.
The Pope agreed. The day of the great debate came. Pakistani and the Pope sat opposite each other for a full minute before the Pope raised his hand and showed three fingers. Pakistani looked back at him and raised one finger. The Pope waved his fingers in a circle around his head. Pakistani pointed to the round where he sat. The Pope pulled out a wafer and a glass of wine. Pakistani pulled out an apple.
The Pope stood up and said, "I give up. This man is too good. The Pakistanis can stay."
An hour later, the cardinals were all around the Pope asking him what had happened. The Pope said, "First I held up three fingers to represent the trinity. He responded by holding up one finger to remind me that there was still one God common to all religions. Then I waved my finger around me to show him that God was all around us. He responded by pointing to the ground and showing that God was also right here with us. I pulled out the wine and wafer to show that God absolves us from our sins. He pulled out an apple to remind me of original sin. He had an answer for everything. What could I do?"
Meanwhile, the Pakistani community had crowded around their Pakistani brother. "What happened?" they asked. "Well" said he, "First he said to me that the Pakistanis had three days to get out of here. I told him that not one of us was leaving. Then he told me that this whole city would be cleared of Pakistanis. I let him know that we were staying right here." "Yes, yes,..and then???" asked the crowd. "I don't know", said Pakistani, "He took out his lunch, and I took out mine!"
by ali.ikhan
Much has been said/written about God! From Karen Armstrong in recent times to era which we now call as dark age, man tried his best to describe/define/comment on God. But none has said it more beautifully, in more elaborate manner and with such authority than God Almighty Himself.
Quran is all gems and jewels for us but some parts of it are certainly more mesmerizing, stunning and mind blowing. Following is certainly one of it.
21- Had We sent down this Qur'an on a mountain, verily, thou wouldst have seen it humble itself and cleave asunder for fear of Allah. Such are the similitudes which We propound to men, that they may reflect.
22- He is Allah besides Whom there is no god; the Knower of the unseen and the seen; He is the Beneficent, the Merciful
23- He is Allah, besides Whom there is no god; the Sovereign King, the Holy One, the Source of Peace, the Granter of security, Guardian over all, the Exalted in Might, the Supreme, the Possessor of every greatness : Glory to Allah! (High is He) above the partners they attribute to Him.
24- He is Allah, the Creator, the Shaper out of naught, the Fashioner; To Him belong the Most Beautiful Names: All that is in the heavens and the earth glorifieth Him, and He is the Exalted in Might, the Wise.
[Translations of Yusuf Ali, Pickthal and Shakir]
by ali.ikhan
Much has been said/written about God! From Karen Armstrong in recent times to era which we now call as dark age, man tried his best to describe/define/comment on God. But none has said it more beautifully, in more elaborate manner and with such authority and truth than God Almighty Himself.
Quran is all gems and jewels for us but some parts of it are certainly more mesmerizing, stunning and mind blowing. Following is certainly one of it.
21- Had We sent down this Qur'an on a mountain, verily, thou wouldst have seen it humble itself and cleave asunder for fear of Allah. Such are the similitudes which We propound to men, that they may reflect.
22- He is Allah besides Whom there is no god; the Knower of the unseen and the seen; He is the Beneficent, the Merciful
23- He is Allah, besides Whom there is no god; the Sovereign King, the Holy One, the Source of Peace, the Granter of security, Guardian over all, the Exalted in Might, the Supreme, the Possessor of every greatness : Glory to Allah! (High is He) above the partners they attribute to Him.
24- He is Allah, the Creator, the Shaper out of naught, the Fashioner; To Him belong the Most Beautiful Names: All that is in the heavens and the earth glorifieth Him, and He is the Exalted in Might, the Wise.
[Translations of Yusuf Ali, Pickthal and Shakir]
by ali.ikhan
When our company acquired a competitor?s company, we were given less than a week to decide what to do with its largest project. Two colleagues and I had spent all day with the new team, and, after a late dinner with the team leads and managers, the three of us went back to our hotel... Read on
by ali.ikhan
If you need inviation, shot me an email!
by ali.ikhan
Professor began his class by holding up a glass with some water in it.
He held it up for all to see & asked the students,
' How much do you think this glass weighs?'
'50gms!' .... '100gms!' .....'125gms' .....the students answered.
'I really don't know unless I weigh it,' said the professor,
'but, my question is: What would happen if I held it up like
this for a few minutes?'
'Nothing' the students said.
'Ok what would happen if I held it up like this for an hour?'
the professor asked.
'Your arm would begin to ache' said one of the students.
'You're right, now what would happen if I held it for a day?'
'Your arm could go numb, you might have severe muscle stress &
paralysis & have to go to hospital for sure!' ventured another student
& all the students laughed.
'Very good. But during all this, did the weight of the glass change?'
asked the professor.
'No'
Then what caused the arm ache & the muscle stress?'
The students were puzzled.
'Put the glass down!' said one of the students.
'Exactly!' said the professor. 'Life's problems are something like this.
Hold it for a few minutes in your head & they seem OK.
Think of them for a long time & they begin to ache.
Hold it even longer & they begin to paralyze you.
You will not be able to do anything.
It's important to think of the challenges (problems) in your life,
but it's EVEN MORE IMPORTANT to 'put them down'
at the end of every day before You go to sleep.
That way, you are not stressed, you wake up
every day fresh & strong & can handle any issue,
any challenge that comes your way!'
So, as it becomes time for you to leave office today,
Remember friend to
'PUT THE GLASS DOWN TODAY!'
by ali.ikhan
If you need invitation, shot me an email!
by ali.ikhan
How swiftly focus is moving from desktop applications to web-based, and how strong the impact of google ventures on overall IT scene; get hint by this news...
Gates Warns of 'Sea Change' in Memo
SEATTLE - The technology industry shift's to Internet-based software and services represents a massive and disruptive "sea change," Microsoft Chairman
Bill Gates wrote to top-level executives in a memo aimed at rallying his troops against the new competitive threats the company faces.
In an e-mail to top executives, Gates urged company leaders to "act quickly and decisively" to move further into the field of offering such services, in order to best formidable competitors. But he also warned that the company must be thoughtful in building the right technology to serve the right audience.
"This coming 'services wave' will be very disruptive," Gates wrote. "We have competitors who will seize on these approaches and challenge us ? still, the opportunity to lead is very clear."
More
What it holds for us? Well, in my eyes drop the honor of being the 'Windows developer', stop hating web based applications; being slow, hard to debug and ugly to maintain. Also, shun ideas about web development being the (easy) job of designers / artists only, yours (and mine) future lies in web development now!
by ali.ikhan
Story of Iqra, now one of our muslim sister, as how she travelled from darkness of hinduism to the nu'ur and light of Islam....
by ali.ikhan
Pakistan beat England by 22 runs in amazing show of cricket skills, temperament and courage on final day of first test.
| www.flickr.com
|
by ali.ikhan
Found this excellent article...
Display Emoticons on an ASP.NET Webpage
by ali.ikhan
Official curtain raiser of Visual Studio 2005 and SQL Server 2005 in Pakistan! This is the thing that has occupied most part of my mind right now. You bet I am really excited about it. And this is the very thing that compelled me to right this article or rather series of articles on ?Whats New in C# 2.0 For Me!?. I?ll be preaching new features of C#, commenting on how and when to use them and also talking about my experiences with this new ?beauty? from Microsoft.
Well before going any further let me put this link here to get free SQL Server 2005 and VS 2005, for all those folks around who haven?t still downloaded/got copy of SQL Server 2005 and VS 2005.
As I said earlier, I will be introducing each new feature, its syntax, links for further resources and my comments on its usefulness. This last thing (i.e. my comments) is important so even if you skip features intro, don?t dare skipping my valuable comments. Okay! Here we go with our very first feature intro called ?Partial Classes?.
Partial Classes
Intro & Syntax
?Partial? means ?only a part of? so what does ?Partial Class? mean?
?Only a part of class!?
Correct! ?Only a part of class in a file? to be exact. This is what meant by Partial class. That is, a class which is spread over multiple files with each part defined in one. Previously, C# force you to define a class completely in one file (just like in Java) but now having this ?Partial? keyword in your backpack your class definition can span more than one file. Just like this;
// File1.cs
partial class BigClass
{
//partial definition of BigClass
?.
?
}
//File2.cs
partial class BigClass
{
//more partial definition of BigClass
?.
?
}
Together two files (File1.cs and File2.cs) completely define BigClass class.
Things to Remember
Remember these points as highlighted by Microsoftees.
1. All partial type definitions must be modified with the partial keyword and must belong to the same namespace and the same module and assembly.
2. The partial modifier can appear only before the class, interface and struct keywords.
3. Access modifiers {private, protected etc.} must match all the partial types of the same class.
My (valuable) comments
Though this feature amuses developer while exploring for the first time, questions do hang in mind about its use in real life. While Microsoft says, it will come to help when more than one developer are working on same project class (a very likely and common scenario in software houses) then each developer will have flexibility of continuing work on his/her separate file while working on same class using partial keyword. But this scenario raises questions about design of application as why class is so big and specific that several developers are working on it; such big class should better be divided into two or more small specific classes so that parent class can be more generic in nature.
However one better example of using Partial Classes concept is adopted by VS 2005 itself. Have ever had experience of ASP.NET web development? Well you must have noticed code-behind file is bit cluttered up with both Visual studio generated design code and your own code. I promise you?ll never see this in ASP.NET 2.0 and the reason behind is this same concept i.e. ?partial?. That is, same ASP.NET page class is defined at two places using partial keyword; so at one place it has all design code and at other place (i.e. your code-behind file) you only see your own code. This helps better file management and protection from accidentally altering page design.
Uh.. got any interest in C# 2.0, well then wait for my next post on more features.
Till then, its signing off from this end?.
Allah hafiz?.
by ali.ikhan
Did I wrote before I gonna attend VS2005 launch by DotNetWizards user group? If not, then I am sorry I didnt tell you before.. nehow, I did went there and here is detailed account of same.
Venue : NU FAST City Campus.
Time : Decided - 15:30 ~ Actual - 16:30
Date : 17 Dec 2005
Key Speakers :
Hammad Rajjoub
Whats DotNetWizards? well its a .NET user group working under the umbrella of
INETA
(Int'l .NET Association). Its basically community of developers and IT Pros working/or wishing to work on .NET. Hammad Rajjoub, one of very few, proud MVP from Pakistan, is the Moderator/Owner of DotNetWizards.
Enough of info, lets jump to event details. Hammad emailed he is planning to have VS2005, SQL Server 2005 and BizTalk 2006 offline launch so those are interested should email him. Since 17 was a saturday (weekly off from office) I reckoned it was better to get some know-how about new masterpieces from MS than just relaxing at home. So, to cut short, I reach NU Fast City campus at about 3:30. Not surprisingly small room was full of .NET enthusiasts talking about .NET, recent MS Road Show and cursing their managers for not moving from VS6 to .NET :), while Hammad and other volunteers were playing with thier laptops. Why were they playing? this we found out an hour later when event finally started with Hammad bhai telling us how his laptop being uncompatible with projector played havoc with the schedule and then how he transferred all presentations through USBs to the other laptop, and still we won't be able to see demos/code snippets and will be later emailed to us.
Bit disappointed on getting news about demos! we starting with Hammad's presentation on SQL Server 2005, and take my words, well-done presentation on what's new in SQL Server 2005, how to jump-start, what to look for and where to find more -- that is all he covered in such less time. This was followed by presentations on Smart Clients and BizTalk 2006 by Anees Bajwa and ???. Time shortage came down badly on usefulness of the event, but stil it gave good start to new code junkies. What I learned in these presentations? well.. I plan to write about each of new attractions in detail (in future posts, ofcourse) rather than just giving you a pararomic way here....
In the end, there was a small draw for PDC bags, ASP.NET book and most precious; 3 sets of original licenced VS 2005, SQL Server 2005, MSDN and a free exam voucher. And guess what? yes see title of this post again! yahoooo! I won one of them... now you tell me should'nt I claim I M RICH........ :)
by ali.ikhan
by ali.ikhan
There are several men sitting around in the locker room of a golf club. After a round, showering and getting changed for the 19th hole. Suddenly a mobile phone on one of the benches rings. One of the men picks it up, and the following conversation ensues:
(H - Husband, W - Wife)
H - "Hello?"
W - "Honey, it's me. Are you at the club?"
H - "Yes."
W -"Great! I am at the mall two blocks from where you are. I just saw a beautiful leather coat. It's absolutely gorgeous!! Can I buy it?"
H -"What's the price?"
W - "Only 1,000."
H - "Well, OK, go ahead and get it, if you like it that much..."
W - "Ahhh, and I also stopped by the Mercedes dealership and saw the 2003 models. I saw one I really liked. Its a SLK model. I spoke with the salesman, and he gave me a really good price . and since we need to exchange the BMW that we bought last year..
H - "What price did he quote you?"
W - "Only $65,000..."
H - "OK, but for that price I want it with all the options."
W - "Great! But before we hang up, something else...
H -"What?"
W - "It might look like a lot, but I was reconciling your bank account and I stopped by the real estate agent this morning and saw the house we had looked at last year. It's for sale!! Remember? The one with a pool English garden, acre of park area, beach front property."
H - "How much are they asking?"
W - "Only $450,000 -- a magnificent price...and I see that we have that much in the bank to cover..."
H - "Well, then go ahead and buy it, but just bid up to $420,000. OK?"
W - "OK,sweetie...Thanks! I'll see you later!! I love you!!!"
H - "Bye...I love you too..."
The man hangs up & closes the phone's flap. The other men are looking
at him in astonishment and derision. The husband raises his hand while
holding the phone and asks "Does anyone know who this Cellphone belongs
to???"
So Guys! keep ur mobile safe :)
This discussion is closed to new replies.
Sort by Trending