Sign of the Dollar

September 13, 2007 9:02 pm

I was perusing some JavaScript the other day and saw a strange notation that I had never seen before:

$("report")

"What is this?", I thought. It looks like Perl or PHP -- have I missed some big piece of JavaScript or is this some new feature? In a word: No.

It turns out that this is actually a function contained in the Prototype JavaScript Framework. The definition of the function is along the lines of:

JavaScript:
  1. function $() {
  2.     var elements = new Array();
  3.     for (var i = 0; i <arguments.length; i++) {
  4.         var element = arguments[i];
  5.         if (typeof element == 'string')
  6.             element = document.getElementById(element);
  7.         if (arguments.length == 1)
  8.             return element;
  9.         elements.push(element);
  10.     }
  11.     return elements;
  12. }

Functionally, this is nothing special: pass in a name and get back the object. Or pass in an array and get back an array of objects. The really cool thing is the simple elegance of this method and how it cleans up your code.

JavaScript:
  1. // 'Classic' way
  2.  document.getElementById('userName').value = 'admin';
  3.  
  4. // Dollar way
  5. $('userName').value = 'admin';

This is so simple, that it seems obvious! This saves on programmer typing, saves on page size and makes the code more readable.

In a word: beautiful.

Missed Concerts? Sinead O’Connor.

September 11, 2007 11:05 pm

Anyone have any regrets about concerts or shows or bands they wish they had seen?

I'm talking about shows you could have gone to but for some reason didn't make it. I don't have many but one that sticks out is Sinead O'Connor in Toronto at RPM in 1988. That was before she killed her career, announced she was a lesbian, retracted her lesbianism, became a priest, retired, and then became a reggae loving Rastafarian. Roughly in that order.

Sure, she's touring again, but at the time Sinead had just released her first album, The Lion and The Cobra, and was far from well known -- it was the perfect time to see a future superstar (at least until SNL) before she exploded into the mainstream with I Do Not Want What I Haven't Got.

"Howling like a banshee that makes Siouxie seem tame in comparison" - Now Magazine

I vividly remember seeing an interview with her on Much Music in early December 1987 (maybe the 7th) where she premiered her first video, Troy. The first thing you noticed was the hair -- or lack thereof. This was 1987 so we are still firmly in the big hair period, poodle epoch so the image was quite striking (even shocking?). They cued the video and it was also like nothing I had ever seen or heard before: I was immediately hooked. After the video, the entire studio (of off camera Much Music employees) burst into spontaneous applause which is something I have never seen after playing a video.

ExpressVu PVR Gets New 9 day Guide

6:59 pm

Stop the presses! Bell actually did something right. It seems that ExpressVu PVRs now have a 9 day guide! This replaces the measly 2 day guide we had to live. This really enhances the usability of the PVR -- good job, Bell.

Now maybe they should look at the billing system.

Anchorwoman

August 28, 2007 8:18 pm

Well, Wednesday last week I watched a new show called Anchorwoman. The next day it was canceled by Fox.

I thought the show itself was ok to good. The reason I watched was I remembered seeing a Fox promo and thought it was worth a look and there is virtually nothing on TV this week.

That said, I came into the show with no knowledge or expectations about the show. I think the premise of the show (in the mode of Legally Blonde) was good but I think the turn off is the "reality/comedy hybrid" of it. As a reality show, it is so obviously semi-scripted and edited in order to make an entertaining story and characters that it is overly manipulative.

I think if you take the idea as an actual scripted comedy series then there is much more potential there. Keep the reality aspect to it -- ala The Office or Arrested Development or even a Christopher Guest mockumentary -- but pushed further and there are a variety of topics to mine. There are the obvious ones: fish out water, "bimbo makes good/screws up", office politics that are fairly common. Then you there are a bunch of other topics that could be funny and provide some satire or insight: the nature of local news, hypocrisy in the news room (and TV in general), show business behind the scenes, nature of reality TV itself.

A satire of network TV on Fox; who am I kidding?

Favorite Movies

July 16, 2007 5:12 pm

AFI. What do they know?

Well, probably more than me. But I was inspired by their omni-present lists to start thinking about my own list of great films. Like everyone, I disagree with those lists but I recognize that it's more of a marketing thing so I don't get my knickers in a knot (I always wanted to say that!).

The biggest decision is what criteria to use to construct the list. Since it's my list I will use my own criteria. The criteria is simple, I would consider these to be my favorite movies. And the simple test I used to determine if the film should be on the list is: if I see the movie on TV, would I watch it. Every time. If it was on the next day would I watch it again?

Here are the first 34 in no particular order:

Almost Famous
Apollo 13
Die Hard
Gladiator
High Noon
My Cousin Vinny
Once Upon a Time in the West
Speed
Star Wars
The Good, the Bad, and the Ugly
The Hunt For Red October
The Matrix
The Natural
The Princess Bride
The Shawshank Redemption
The Usual Suspects
Titanic
For A Few Dollars More
Tin Cup
Bull Durham
The Fugitive
The Bridge on the River Kwai
The Naked Gun
La Femme Nikita
Run Lola Run
Rocky
To Sir With Love
12 Angry Men
Aliens
Rob Roy
Conan The Barbarian
This is Spinal Tap
Airplane!
The African Queen

And number one with a bullet: Casablanca.

Stocks

July 12, 2007 10:41 pm

I've taken up trying to develop a stock system. The main tool I've been using is AmiBroker, a technical analysis tool. It also lets you run back tests etc.

The results can be seen at StockPickr:

http://www.stockpickr.com/members/port/tuzopickr

So, far the performance has been very good -- although the US markets have been doing very nicely during the same time.

Not to be a shill, but AmiBroker is a really nice product and very programmer friendly. It has it's own scripting language, let's you call out to code from the scripting language, has a COM interface so you're programs can manipulate the program and has an SDK for developing c++ plugins.

“Project not found” problem loading a Solution with a Web Project in Visual Studio 2003 and VSS 6.0

March 7, 2007 9:20 pm

I was trying to integrate my solution which contains a web project with Visual Source Safe and was getting the message: "Unable to read the project file. The system can not find the file specified."

I found a good article on how to fix this at: http://www.inventua.com/blogs.content?EntryID=3

Unfortunately, this didn't fix my problem.

I had a variety of issues with VSS asp.net integration. What I specifically wanted to do was:

1) Have my web project be under the same directory structure as my solution (not in c:\inetpub\wwwroot)
2) Have the web location be different from the actual web project name. e.g. the web project name is Com.TestApp.UI.Web but I actually want the location to be http://localhost/TestApp and not http://localhost/Com.TestApp.UI.Web . It is possible to deploy the project to any URL but I wanted everything to be consistent in every environment.

I've read a lot of articles which helped but no one article could solve my exact issues. This is the procedure that I had to work through to get the Visual Studio/VSS integration working.

Assumptions

1) Assume solution is [my solution]
2) Assume web project is [my web project]
3) Assume virtual root name is [my virtual root] -- this may be the same as [my web project]
4) Assume user logged on is [user]

If the project has been already attempted to be loaded, we should clean up first:

Clean Up

1) Delete the VSWebCache directory C:\documents and settings\[user]\VSWebCache\[my virtual root] if it exists
2) Delete the virtual root [my virtual root] from IIS
3) delete the solution directory where [my solution] is currently located. If any files are locked perform an IISRESET and also close VSS Explorer if applicable

Configuration

1) Open up VSS Explorer. Get latest version (recursive, build tree)
2) Set permissions on the [my solution] directory. Add IIS_WPG with the following permissions: Read, Read & Execute, and List Folder Contents
3) Open [my solution]
4) The set project location dialog will open. Hit cancel.
5) Accept any other dialogs that may come up.
6) Delete the project file from the [my web project] directory.
7) Open IIS Admin and create a new virtual directory [my virtual root] that points to the directory that contains [my web project]. Accept all the defaults. Open the [my virtual root] properties page and set the Execute Permissions to Scripts Only. I did not add an application name.
8 ) Now, back in Visual Studio, open the solution from source control. (File->Source Control->Open From Source Control). Browse to the solution folder in VSS. Click overwrite when prompted.
9) The set project location dialog will open again (as in step 4). This time point to [my virtual root] and click OK.
10) As a bonus delete the directory that was created by visual studio
during step 4. This will probably be in c:\inetpub\wwwroot\[my virtual root]. It's ok to delete this because the virtual root
actually points some where else now.

Implicit Association Test

February 24, 2007 11:07 pm

I recently stumbled upon a site that uses visual images to test peoples implicit assumptions. Or in the words of the project, "The IAT measures implicit attitudes and beliefs that people are either unwilling or unable to report".

Check out the site and take one (or more) of the tests.
https://implicit.harvard.edu/implicit/demo/

I've taken the tests and the results seemed to be accurate although I'm not sure if they actually are. It seemed to me that when answering a multi-category section that was in conflict with my opinions that I could actually feel the mental effort required. If that doesn't make sense, then take the test!

Boxing Day Sale Knocks Out Future Shop

December 25, 2006 1:10 am

Future Shop (and Best Buy Canada) started Boxing Day early at 8pm EST on December 24th. http://marketnews.ca/news_detail.asp?nid=2424

It seems that they were totally overwhelmed by the response. The servers were getting hammered resulting in many errors. Service Unavailable was a frequent message along with HTTP Server Too Busy as well as random vbscript errors (a common message was dictContext.Value is null or not an object). I also saw some HTTP 403 errors saying that there was a permission problem running a CGI script. After limping along for a couple of hours where it was almost impossible to pull a page up they tried to free up some processing by turning off some images and turning off the inventory information on the product pages. Also, they put a limit in so that you would be blocked from using the site; a page with no images would appear instead of the page you want with an invitation to browse the flyer with a message they no new users were allowed on the site at the current time (or words to that effect). As of 12:45am the site seems to be functioning much better.

BestBuy.ca was also affected but not to the same extent. I was able to place an order on BestBuy.ca within half and hour whereas futureshop.ca took me almost 3 hours to place an order. I think they share the same infrastructure and code base so I don't attribute it to any technical differences between the sites. I think it just shows how much more popular Future Shop is than Best Buy (Future Shop also had better deals :) ).

It will be interesting to see if they do this same promotion this year. Customers may be put off by the technology problems but the real people that I feel sorry for are the technical staff who must have been fighting fires like crazy trying to get (and keep) the site up and running. Not how I would want to spend my Christmas Eve.

I'm surprised that Futureshop/Best Buy haven't moved to a .NET implementation yet -- it's been at least 4 years of being in the mainstream.

Microsoft “Office”

November 23, 2006 4:04 pm

Ricky Gervais and Stephen Merchant have done two amazingly funny videos for Microsoft where he plays his character from the BBC version of "The Office". These are internal Microsoft training videos about values where he insults virtually everyone. Totally Hilarious!

Part 1: http://video.google.ca/videoplay?docid=9076288729387457440

Part 2: http://video.google.ca/videoplay?docid=959125392868390030

Here is more information on the videos.

http://www.timesonline.co.uk/article/0,,2-2326336,00.html