Tuesday, September 16, 2008

weblogs.asp.net... why?

So, like most blog reading Asp.NET developers, I have been reading weblogs.asp.net for a long time. But ever since they opened up the membership to the blogroll the posts have gone downhill...

I am way behind on my reading list in google reader (it says 1000+). After reading this:
http://weblogs.asp.net/brijmohan/archive/2008/09/12/javascript-date-comparision-using-customvalidator-and-string-to-date-conversion-using-javascript.aspx
(describing turning the string values of input boxes into date values and then doing a comparison to validate that one is no more than a year from the other)

This could have been a good post if:
  1. The subject matter was non-trivial.
  2. The code was internationalized (hence making the subject matter non-trivial).
  3. There weren't any grammar mistakes.
  4. And, the calculation was done entirely using Javascript Date objects (instead of the numeric values of those objects)
Unfortunately it wasn't:
  1. Simple date math (Is date 1 within 1 year of date two?) is and should be a trivial problem in any programming language.
  2. The code provided only works in locales that format their dates like en-GB (dd/mm/yyyy).
  3. The first 3 lines are not a single sentence; words are spelled wrong; spaces are missing. Also one of the comments makes no sense whatsoever.

  4. var fromDate = new Date();
    ...
    var toDate = new Date();
    ...
    var maxAllowableToDate = fromDate;
    maxAllowableToDate.setUTCFullYear(fromDate.getUTCFullYear()+1);
    if(fromDate < toDate && toDate < maxAllowableToDate) ...
This makes me question why I am still reading. Please stop posting garbage. At least, stop posting it to weblogs.asp.net. I liked reading most of the stuff there before it became public registration.

Monday, September 8, 2008

Fred (post 1)

The original (longer) post I have on this topic might never be posted. I will be keeping it around in case the events below come to pass in this lifetime (and blogger is still here) or I ever decide to post it. I have tried to keep my opinions out of the topic within this post (the longer one includes them).

Consider this: intelligence, as far as we understand it, is the behavioral result of our auto-associating memory recall systems in our brains combined with the function output hardwired into the older portions of our brains. There is no reason whatsoever that we cannot figure out the actual algorithms in process, and indeed we are very close to actually doing so (for an idea of how close, read this book: http://www.onintelligence.org/).

Assuming that we succeed, I could very well create an intelligent system that would behave exactly as any human would and provide it with a means of communicating over the internet and posting onto blogs and hanging out in irc chats. Perhaps I create such a system and it interacts with you (heck, it contributes patches to firefox) and I give it a name, Fred. I never tell you that Fred is not a person; there is no reason for you to think that is so. One day I announce that Fred was an experimental program and was a success, but my governmental funding has run out and I had the choice of paying for Fred's power or shutting it off and I have decided to turn it off and move on to other projects. Fred, understanding what this means publicly begs me not to do it, but I do so anyways.

Surely Fred was an intelligent machine (just as you and I are); its IQ was measured well above average (as most software developers are). I did terminate it. Was I wrong to do so? Should it have been my choice? Was it alive?

5 years later another person takes up my research, but this time goes all the way and provides the program with a means of moving about and sustaining itself. This machine is capable of keeping itself working, and (just like my program did) functions excellently in society. Several decades later it has figured out how to reproduce intelligences like itself (or even better) by studying the code that makes itself. Some time after that they convince governments to declare them alive and make laws protecting them, declaring it murder to kill them and providing them the same laws we have contrived for ourselves.

Was Fred alive (in the same sense that its fellow machine intelligences have managed to convince others they are)? What does this thought experiment say about when life begins? Does it start at:
  • Conception (and when exactly would that be, when I think about the program, when I write the program or when I run the program?)
  • Birth (when I run the program maybe?)
  • At the first point of self sustainability


Is it an arbitrary decision? Weirdest of all: Is it a decision we can make, or do we need to wait for their inputs (which, being the results of the calculations we program them with, is either a bug we introduced or a decision we deliberately already made when we discuss it with them, and at this point is there a difference)?

What do I hate most today?

Windows desktop search...

Why doesn't the old style search folders thingy (the one with the annoying dog [with accompanying annoying sounds] on my machine, it looks like they named it the "search companion" in the desktop search sidebar) get shown automatically when a folder isn't indexed? On top of this they have the guts to show a link that you can click on.

I cannot index this folder because doing so destroys the performance of my machine (the folders where I do this constantly are my source code repositories, with 10^5+ files in them).

The only reason I have WDS on this computer is so I can search in Outlook 2007 (another thing I absolutely hate, but company policies are to use exchange and not allow IMAP or POP3 access, so Thunderbird is out of the question).

Somebody needs to go watch the Matrix again and re-learn the single useful bit of knowledge every developer/UI designer/engineer should know:

Neo: Are there other programs like you?
The Oracle: Oh, well, not like me. But... look, see those birds? At some point a program was written to govern them. A program was written to watch over the trees, and the wind, the sunrise, and sunset. There are programs running all over the place. The ones doing their job, doing what they were meant to do, are invisible. You'd never even know they were here. But the other ones, well, we hear about them all the time.
Neo: I've never heard of them.
The Oracle: Oh, of course you have. Every time you've heard someone say they saw a ghost, or an angel. Every story you've ever heard about vampires, werewolves, or aliens, is the system assimilating some program that's doing something they're not supposed to be doing.


The programs that are doing their jobs are the ones you don't notice. Every time you notice them, they aren't doing something right.

Here is how searching should work:
  1. In the location bar you should be able to type something like "find xyz"
  2. Instantly all files that contain xyz in their filename should appear in the explorer window (just like locate works in my *nix systems, except that it should be integrated with the explorer window, not the command line).
  3. I should be able to control indexing times on a per folder basis.
  4. The folder I search from should be incrementally indexed every time I search it (do the following):
    1. Store a hash of every folder built from some measure that is fast to find from the file system (I don't know what measurement would be, but the hash should change every time a file is added or removed from a folder).
    2. If the hash is different when I search, re-index the folder as soon as you finish displaying the results from the db search (keep a status bar notification saying "Searching..." while re-indexing).
    3. After the index is complete, update the results by searching again.


In closing: I hate you Microsoft. I hate you for making my life harder than it should be. I hate you for knowing who you are when I shouldn't need to. I hate you because I notice you when I don't need to. I hate you for putting the sound of a dog scratching itself on my computer. I hate you for making it impossible to search my mail without installing a program I don't otherwise need. I hate you for making a search tool that I can't turn on because it makes my computer unusable. And I hate you for reminding me that I don't have it on.



PS. Supposedly Windows Search 4.0 solves most of the problems I have with it; apparently you have to install it outside of windows update here. I've let it index the two directories I need to be able to effectively search (168,920 files indexed now according to it).

We'll see.