February 2005 Blog Posts
Via Dare's blog, I found this interesting post on Random Number Generation on Michael Brundage's website. My undergrad thesis was on the topic of pseudorandom number generation so I thought I'd take the two classes he provided for a quick spin.
Unfortunately, the C# samples did not compile as is. In his post he discusses how the C++ samples are optimized. I figured I might be able to use them to guide changes to the C# port and could post the results here. Please note that I have not tested them yet and need to verify that my changes were correct. Enjoy and let me know if I got anything wrong.
public class MersenneTwister
private ulong _index;
private ulong _buffer = new ulong;
/// Creates a new <see cref="MersenneTwister"/> instance.
Random r = new Random();
for (int i = 0; i < 624; i++)
_buffer[i] = (ulong)r.Next();
_index = 0;
/// Returns a random long integer.
public ulong Random()
if (_index == 624)
_index = 0;
long i = 0;
for (; i < 624 - 397; i++)
s = (_buffer[i] & 0x80000000) | (_buffer[i+1] & 0x7FFFFFFF);
_buffer[i] = _buffer[i + 397] ^ (s >> 1) ^ ((s & 1) * 0x9908B0DF);
for (; i < 623; i++)
s = (_buffer[i] & 0x80000000) | (_buffer[i+1] & 0x7FFFFFFF);
_buffer[i] = _buffer[i - (624 - 397)] ^ (s >> 1) ^ ((s & 1) * 0x9908B0DF);
s = (_buffer & 0x80000000) | (_buffer & 0x7FFFFFFF);
_buffer = _buffer ^ (s >> 1) ^ ((s & 1) * 0x9908B0DF);
public sealed class R250Combined521
private ulong r250_index;
private ulong r521_index;
private ulong r250_buffer = new ulong;
private ulong r521_buffer = new ulong;
/// Creates a new <see cref="R250Combined521"/> instance.
Random r = new Random();
ulong i = 521;
ulong mask1 = 1;
ulong mask2 = 0xFFFFFFFF;
while (i-- > 250)
r521_buffer[i] = (ulong)r.Next();
while (i-- > 31)
r250_buffer[i] = (ulong)r.Next();
r521_buffer[i] = (ulong)r.Next();
Establish linear independence of the bit columns
by setting the diagonal bits and clearing all bits above
while (i-- > 0)
r250_buffer[i] = (((uint)r.Next()) | mask1) & mask2;
r521_buffer[i] = (((uint)r.Next()) | mask1) & mask2;
mask2 = mask2 ^ mask1;
//mask2 ^= mask1;
mask1 >>= 1;
r250_buffer = mask1;
r521_buffer = mask2;
r250_index = 0;
r521_index = 0;
/// Returns a random long integer.
public ulong random()
ulong i1 = r250_index;
ulong i2 = r521_index;
ulong j1 = i1 - (250-103);
if (j1 < 0)
j1 = i1 + 103;
ulong j2 = i2 - (521-168);
if (j2 < 0)
j2 = i2 + 168;
ulong r = (r250_buffer[j1] ^ r250_buffer[i1]);
r250_buffer[i1] = r;
ulong s = (r521_buffer[j2] ^ r521_buffer[i2]);
r521_buffer[i2] = s;
i1 = (i1 != 249) ? (i1 + 1) : 0;
r250_index = i1;
i2 = (i2 != 521) ? (i2 + 1) : 0;
r521_index = i2;
return r ^ s;
Jet Brains released a free upgrade to their ReSharper product. Let me tell you, using this product feels like walking on land after a long stint trying to walk under water.
Recently, I was trying to write some code on a coworker's computer and kept hitting funky key combinations that had no meaning on his machine since he didn't have this installed. I had to actually type out a bunch of code that just spills out when using this add-in. It felt so stone age.
Just to be complete, I know many are fans of CodeRush for Visual Studio. I liked it enough, but the lack of Refactoring support was a problem for me, which is why I chose ReSharper.
My coworker sent me this link and it just cracks me up. A bitter blog.
Yes folks, it's true. After working a while in VS.NET, it suddenly stops and asks if I'd like to send an error report to Microsoft. Then it shuts down. Almost like clockwork. This creates a very good time for me to take a break, stretch, and meditate on how much work I just lost as I was just about to hit the save icon.
For my personal coding projects at home, I've been using the free one-user version of SourceGear vault for my personal source control needs. As you know, having proper source control is #1 on The Joel Test.
But since I'm embarking on a project with Micah who lives in San Francisco, we need something better than to host on my little Shuttle system at home. We need hosting!
After some preliminary research, I'm leaning towards a semi-dedicated server from WebHost4Life. The Basic plan includes 150 GB of bandwidth, 2000 MB of Space, 2GB of SQL Server 2000, ASP.NET 1.1, Sharepoint Team/Windows Services, and on and on. Plus, no setup fees, and it's $79.35 a month. This is a LOT cheaper than an equivalent option at DataPipe. DataPipe offers 5 nine uptime, but I think the 3 nines will be adequate.
This server will host our source control (which requires SQL Server and .NET) as well as a staging site for our client. If you know of a better option, please leave a comment. I'll let you know what we end up deciding.
Don Park outlines an interesting potential solution to Google's proposed Auto Link feature of its Toolbar. Essentially his solution is to allow content author's to opt-in via tagging content for auto-linking.
The question I have about this is if you're going to go to all the trouble to mark up your content in this way, why not just provide the link yourself? One benefit I do see is in the case of an ISBN number. As a content producer, I might link to Amazon. However, if my user has an account at BookPool, she might configure the auto-link toolbar to link ISBNs to that site instead.
Of course, in general, I might not want that since I'd prefer to get credit for links to Amazon. But that's beside the point. If I opt in, it's the potential to give users more control. This assumes that Google gives user that level of control.
Another question I have is if content authors start using this tag, what stops browsers from adding AutoLink to pages that opt-in? In effect, Don's suggestion creates an extension to HTML and by being opt-in, anybody should be able to hook into that, not just Google.
I'm not sure Google would want to go that route. Microsoft had its hand slapped by attempting an auto-link. Google perhaps thinks it can squeeze by since it's not a monopoly power on the desktop and it promises to "do no evil". But by making AutoLink opt-in, that should in theory make it palatable for browsers such as IE and FireFox add that feature.
Ultimately, I think AutoLink would be a great feature if it was controlled by the users. A user could control links to addresses so that they go to his or her favorite mapping site and an ISBN would link to the user's favorite bookseller.
Today, my boss, the CTO, announced that I'm leaving the company to join the adult movie industry. Don't worry, I'm actually not out to challenge the supremacy of John Holmes. That just happens to be the typical way he likes to announce the departure of employees. I'm just joining the seeming legion of developers who are going independent.
I actually gave notice two weeks ago, but I had promised not to say anything until my company had a chance to figure out how to deliver the news. Hence I didn't mention it on my blog. Not that any of my coworkers read my blog (I think). But just in case, I wanted to be true to my word.
It's funny how keeping a secret from your blog can affect how much you write on your blog. It's as if I was worried that I'd start writing about how Test Driven Development will save your soul and suddenly blurt out, "oh by the way, I'm leaving my company. oops!".
The first big contract I'm working on is with my friend Micah, one of the smartest software architects you'll meet (and you'd find that out if he kept a damn blog. hint hint!). He's fluent in both .NET and Java (where I'm lacking). We're hoping to also work with my friend Kyle, one of the smartest people I know across the board. We're positioning ourselves as Solution Architects, or as my former CEO put it, we're "portable CTOs". I'll write up more about what that means later, but essentially it means we'll help our clients implement the right solution, not just sell them a solution based on a religious preference for a particular platform or custom development when a product would do.
If you're in need of a portable CTO, software architect, grunt developer on a project, send me an email. I'm also looking to get into process improvement consulting etc... That's something I have a lot of experience with that I'd like to capitalize on. This includes helping teams get started with TDD, NUnit, Cruise Control, etc... I'm also available for code reviews etc... Sometimes you just need an extra pair of eyes.
In any case, I'm very excited and anxious about this big transition. Now I'm head deep in studying tax law and health insurance policies. Wish me luck and advice is appreciated.
My friends are always looking out for me. Apparently Tre (aka Macktastic Tre Flava) realized that as an elevated player, I was in dire need of a pimp name. So he helpfully sent me a link to the Pimp Name Generator one of the many useful utilities on PlayerAppreciate.com.
So from now an, all you suckas can call me Big Playah P Rock. My lovely wife will heretofore be known as Golden Brown Akumi Slim. Respect!
I want an add-in to my instant messaging apps whereby if someone responds to a message by me with just the word "ok", it doesn't pop an instant message window if I've closed the window. Perhaps it can filter any messages with just the word "ok" and flash the system tray or something. Anything. Just don't get in my way.
It's really coming down out there. On the freeway today I started hydroplaning a bit. Be careful out there. I've been pretty quiet on this blog due to being very busy. I have some big personal news (no, we're not pregnant) to announce, but I promised not to announce it till others announce it.
My friend Thomas Wagner has a small epiphany of sorts. At first, I thought he was writing the biography of my first year at my current job. But apparently this is quite common among businesses.
Very frequently the profit center of a company drives the development schedule and also drives the pressure being excerted on a developer or team. Can you guess who the people are that drive most of the profit? Those crazy lunatics in the Sales Dept.! Yes, the flunkies who like to bend reality in order to make a deal. Those are the folks that set your schedule and drive your work.
Just the other day, I was working on a task that requires certain deliverables from the marketing team be in my hand before I can even begin. Of course those items were delivered late, but naturally I get several emails in the span of the day asking for the status with wording like
This is something a client is waiting to see and technically it’s already late. Yadda yadda please get it done ASAP.
My reply was [edited slightly to protect the guilty] (note the weird pronoun use as time travel is involved).
I’ll tell you what, I will personally bend space, time and reality so that the deliverables will have been delivered to me a week prior to the day they actually were. And then I will personally spike everyone’s water with SPEED so they will have been working faster this entire time, and I will swap out our networks with a 1 TB connection so data will have been transferred faster. Also, I’ll swap out our systems with quantum computers so that they too aren’t limited by the silly constraints of a linear time continuum.
Of course, we have to remember that Sales and Marketing guys have their own pressures and are human too. Sometimes they aren’t all flunkies and can even be intelligent and witty as his reply indicates:
I think I saw a quantum computer at the local pawn shop... crazy shit.
Afterwards I reminded myself not to be such a jackass to this guy. But then again, the more of a jackass I am, the funnier he gets.
There's a house on fire a couple of blocks away. It's a veritable light show down there with nearly 10 or so fire trucks arriving on the scene.
In his latest entry about life as a infrastructure reconstruction project manager in Baghdad, Mr. Serjak describes the security detail that drives him to an onsite location. One detail in particular struck me as funny.
Our lead Humvee's job is to clear a path for us which he does by waving an assault rifle at anyone that gets too close. If that doesn't get their attention, his favorite weapon seems to be half-liter water bottles. He tosses these like a Nolan Ryan fastball at the windshield of cars that don't pull to the side of the road quickly enough in his estimation. He actually has a little rack of water bottles mounted inside the turret.
I seriously need to get a rack mount of water bottles for my car. That would come in quite handy for the L.A. free way. Can you see me chucking an Evian at grandma ahead of me for driving too slowly in the fast lane?
I love Ian's response to James Gosling's opinion on .NET's C++ support and it's supposed inherent insecurity. It's basically a "Booyah! In your face" piece as he bit by bit dissects Goslings arguments and presents a Java example that directly contradicts Gosling claim that type unsafety is incapable in Java.
Ian, you're the man! If you're in L.A., I need to buy you a pint.
It just goes to show that it's not just Ballmer who spreads the FUD thick. It's time to bridge the Java/.NET divide and be reasonable here. The "religious" wars aren't worth the time and energy. Quit spreading FUD in both directions and realize that both technologies have their weaknesses and strengths. It's really disappointing to see this type of FUD from someone as respected as Gosling. I guess I expect that sort of thing from Ballmer.
Dare announced the beta version for the Wolverine edition of RSS Bandit (version 1.3.x) today. You can read his announcement to see some of the nice features it includes.
I've been feverishly updating the documentation to take into account the new features and the updated look and feel. Documentation is hard work when you're trying to keep up with developers as productive as Dare and Torsten.
One feature that wasn't announced, but quietly added by yours truly, is the ability to configure keyboard shortcuts via an XML settings file. The reason this is not an "announced" feature is that we have yet to provide any GUI support for configuring these settings. Nor have I documented the format for these settings or the proper way to change them.
Assuredly, I will be working to post both documentation as well as a separate shortcut editing tool soon. For the adventursome, there is a beta of the editing tool in the Child Projects folder in CVS. You can edit the settings and save the result in the RSS Bandit Application Data folder to override the default settings.
In the long term, we'll have to decide if this remains a separate tool for power users who demand this level of control and are willing to take the risk, or if it should be added to the main GUI.
I've kept a couple of other blogs before, but this is my first with staying power. My blog new year resolutions include being even more irreverent, geeky, rash, and misguided (if even possible). It's been one year, and I recently passed the 500 post mark without even noticing (I hate missing an opportunity to party).
If you're a regular reader (hi Mom, Dad, Wife), do you realize that there's much better drivel out there? But you probably read this blog for the same reason I read yours, you're trying to expunge some latent guilt by self flagellation (Ignore the fact that the phrase "self flagellation" is redundant.). I hope that works out for you.
Seriously though, I've been surprised by the quality of comments I receive on my postings. I may have a few readers, but they're smart readers *cough* *suckup* *cough*. Except for those who find this site by Google and are not searching for a technical topic. Them are the dumbest f***s I've ever seen.
Well stick around, I have an exciting line-up of topics coming up. They actually involve a bit of work *damn!*, so they'll be out less frequently. But they will be above poor. I'll probably try to blatantly start a controversy or two to drum up traffic so that people will click on my ads (oops, I'm not supposed to promote the ads, there's controversy #1) and this blog can pay for itself. And you can be sure I'll continue to be one vain motherblogger.
You must watch this video.
My buddy Kyle and I both purchased tickets to Burning Man today. Still waiting to hear from a few other friends and other burners who might be in attendance. I went with several years ago and am looking forward to my triumphant return. ;)
It’s a long wait as it doesn't happen till the end of August.
Props to any,one who can tell me the song and artist that my subject line refers to.
Sunday afternoon I flew to NYC, stayed at the W on Lexington (nice), had a Long Island Ice Tea (to commemorate), woke up the next morning, caught a train to Long Island for a meeting, found out our approach to a big project was all wrong (the product guys on their side love it, but the keeper of the tech gates changed his mind), caught a plane back to L.A. (business class upgrade. Loved it), and am now back to work.
One night business trips across the country suck. I didn't have time to hang with my buddy Dave out there. I called him when I got in. It was only midnight, you would think he'd still be working. Slacker.