Forget about all the debates about the efficacy and suitability of the various programming paradigms supported by Win 8. The real winner here is the new Windows 8 App Store. Finally here is a delivery mechanism an ordinary Windows developer never had before.
Create brilliant tools, small or big, price them low, put them on App Store and wait for the millions of users to switch to Windows 8. Remember, most of the PC users have IPhones or iPads and they have the taste for apps. They would welcome the concept of having a choice of cheap and cheerful apps to spice up their PCs.
Happy times ahead!
DotNetYOGI
[MeditatingIn.Net(true)]
Thursday, August 23, 2012
Sunday, January 29, 2006
Bindows� Home
Want to get started with AJAX based programming? Here is something to give you a headstart:
Bindows� Home
Bindows� Home
Tuesday, October 11, 2005
Wednesday, February 16, 2005
What is under the hood of .Net String.GetHashCode()?
Ever wonder what is the hashing algorithm used inside the .Net String class's GetHashCode() override? Well, here is the fruit of a couple of hours of my labour.
C++ (Unmanaged):
ULONG HashString(LPCWSTR szStr)
{
ULONG hash = 5381;
int c;
while ((c = *szStr) != 0)
{
hash = ((hash << 5) + hash) ^ c;
++szStr;
}
return hash;
}
C++ Managed:
int Class1::HashString(String *szStr)
{
int hash = 5381;
int c;
int len = szStr->Length;
for (int i = 0; i < len; i++)
{
char f = szStr->get_Chars(i);
int c = f;
if (c < 0) c += 256; // Some characters like '£', '¬' are returned with a negative values!
hash = ((hash << 5) + hash) ^ c;
}
return hash;
}
C#:
int HashString(string szStr)
{
int hash = 5381;
int c;
int i = 0;
while(i < szStr.Length)
{
c = (int)szStr[i];
hash = ((hash << 5) + hash) ^ c;
i++;
}
return hash;
}
Enjoy!
C++ (Unmanaged):
ULONG HashString(LPCWSTR szStr)
{
ULONG hash = 5381;
int c;
while ((c = *szStr) != 0)
{
hash = ((hash << 5) + hash) ^ c;
++szStr;
}
return hash;
}
C++ Managed:
int Class1::HashString(String *szStr)
{
int hash = 5381;
int c;
int len = szStr->Length;
for (int i = 0; i < len; i++)
{
char f = szStr->get_Chars(i);
int c = f;
if (c < 0) c += 256; // Some characters like '£', '¬' are returned with a negative values!
hash = ((hash << 5) + hash) ^ c;
}
return hash;
}
C#:
int HashString(string szStr)
{
int hash = 5381;
int c;
int i = 0;
while(i < szStr.Length)
{
c = (int)szStr[i];
hash = ((hash << 5) + hash) ^ c;
i++;
}
return hash;
}
Enjoy!
Tuesday, January 18, 2005
Friday, November 26, 2004
Strong Names Explained
A neat article explaining the Strong Names using easy to understand examples and pictures:
The Code Project - Strong Names Explained - .NET:
The Code Project - Strong Names Explained - .NET:
Wednesday, November 24, 2004
No, Strong Names are NOT for code security :-(
Well, finally it seems to have dawned upon me that the .Net strong names are not really meant to secure your code. The last nail in the coffin was the revelation that one can easily tamper an assembly header to disable the strong name verification - without even removing the strong name! This effectively defeats the case of using strong names for cross referencing of assemblies based on strong names.
Read this thread:
Signed assemblies easily cracked?
Спасибо Valery and Danke Frank!
Read this thread:
Signed assemblies easily cracked?
Спасибо Valery and Danke Frank!
Subscribe to:
Posts (Atom)