Archives
-
Which File Extension Are You?
Here we go again with the geeky quizes :) Looks like I'm every ones favorite movie file:
-
Bloom Filters
A friend of mine saw an article on slashdot about the LOAF system. LOAF uses an algorithm called a "Bloom Filter", named for it's inventor Burton H. Bloom, that allows you to share your contact list in a social network kind of way. It's pretty dang cool by itself. But uppon further investigation of the algorithm, the bloom filter is just as interesting.
There are several examples of this algorithm in varuous languages such as perl and python but I couldn't find any in a .NET language so I created the following implementation as a starting point
public class BloomFilter
{
private BitArray _bits;
private SHA1 sha1 = new SHA1Managed();
private ushort[] GetIndexes(string key)
{
// TODO: make this call multiple hash functions or salt SHA1
byte[] hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(key));
// SHA1 generates a 20byte hash (160 bits) so treat those
// 20 bytes as 10 16 bit integers.
ushort[] idxs = new ushort[10];
for (int i=0,j=0; i<20; i+=2,j++)
{
idxs[j] = (ushort)(hash[i]<<8);
idxs[j] |= hash[i+1];
idxs[j] = (ushort)(idxs[j] % _bits.Count);
}
return idxs;
}
public BloomFilter(int size)
{
_bits = new BitArray(size);
}
public void Add(string key)
{
foreach (int idx in GetIndexes(key))
_bits.Set(idx, true);
}
public bool Contains(string key)
{
// check that each bit of the hashes
// are set in the filter
foreach (int idx in GetIndexes(key))
if (!_bits.Get(idx))
return false;
return true;
}
}
I know I'm kind of cheating by using only one SHA1 hash but hey, this is just the first shot at it.
Right off hand there seem to be hundreds of places that this could be used to speed up performance. Email opt out lists, spell checkers, mmorpg games with lots of inventory items.
"My mind is aglow with whirling, transient nodes of thought careening thru a cosmic vapor of invention." - Hedley Lamarr in Blazing Saddles. :-)
Check out these links for more info on the algorithm:
http://www.flipcode.com/tutorials/tut_bloomfilter.shtml
http://www.perl.com/lpt/a/2004/04/08/bloom_filters.html
-
Cw continues to impress.
Now this is just downright coolness:
-
Cw Confusion.
I've been playing around with Cw alot since the preview was released. I'm pretty sure that I'm starting to understand the concepts now. However the following problem still has me puzzled:
-
A little memorial for some dead Microsoft products
I ran across the tombstone generator this morning so I made up a little memorial for some dead Microsoft products:
-
LearnVisualStudio.net updated.
Not sure how I missed this, but it looks like LearnVisualStudio.net has been updated with a new site design. Looks to be a bit easier to navigate and forums have been added for members. If you are new to Visual Studio, .NET and/or programming, check out some of the videos. A picture is worth a thousand words and with video there are several pictures per second! :)
-
COmega preview release!!
http://weblogs.asp.net/mdavey/archive/2004/07/14/183442.aspx
-
What kind of pie are you?
I took the test and aparently I'm apple pie. Woo hoo! How american is that! :)
-
What causes bugs.
A coworker sent around this survey today. I thought I'd share my response and also see what the ASP.NET community thought. This is bound to be a hot sports topic so feel free to go nuts. :)
-
MS Team System. WOW!
-
Testing out Sauce Reader
I'm trying out sauce reader's posting capabilities. So far its pretty impressive.
-
Note to self. Read more about this.
Looks like some interesting things in COM+ 1.5
-
Chiming in on the C# coding standards.
Lance has posted a nice little tidbit on C# coding standards here.
-
Interesting Links
Java vs .NET
-
Sim IT Manager game from Intel
This is total greatness:
-
Nemerle: a new hybrid (functional, object-oriented and imperative) programming language for the .NET platform.
I found this site while surfing the web this evening. After a quick glance through some of the tutorials it looks pretty intriguing. The macro system looks really neat. Here are the key features listed on their site:
-
Windows 95 and Windows XP Shell Clone for Windows 3.11
I file this one under “people who have too much time on their hands”:
-
Here's a quote that sums up my feelings on the C# vs. VB.NET wars.
There are two types of programming languages; the ones that people bitch about and the ones that no one uses.
-Bjarne Stroustrup -
Looks like a new DNUG is opening up in Plano.
http://weblogs.asp.net/SHenderson/archive/2004/02/26/80863.aspx
-
X Omega (a.k.a X# or XEN) will be made available this year!
Looks like MS is moving forward with the new .NET language XEN err... X Omega as they are now going to call it. The details I've read about X Omega thus far look very promising. I can't wait to get my hands on it to play with it for real. Here's some links to more info:
-
Top ten web application security holes for 2004
I heard about this site on TechTV of all places. Not surprisingly, #1 is Unvalidated input.
-
Some details about XEN
There may be other places on the net that have some of the XEN details but the folowing article is the first place I've ran into thus far that gives some examples of what the syntax may look like.
-
A peek into the future of data binding...
I found this article on data binding in Longhorn while surfing around the MSDN site today.
-
Automating builds.
There is a really good article up on MSDN about automating your build process:
-
Designer vs. Code Window a.k.a. VB.NET vs. C#
With Whidbey looming on the horizon, Microsoft keeps telling us about how VB.NET is advancing from the RAD/designer enhancements and C# is enhancing the code window. As more time goes by the more I’m convinced that this is not a good direction for MS tools.
-
Cool graffiti robot
I saw this posted over on Slashdot today. Apparently these guys have way to much time on their hands.