Random Thoughts of a Scatterbrain.
 Thursday, May 29, 2008

Awesome News For Web UI Developers

5/29/2008 8:58:04 AM (Eastern Daylight Time, UTC-04:00)

Google's new AJAX Libraries API should help quite a bit with developing web UIs.  From Dion Almer:

I just got to announce the Google AJAX Libraries API which exists to make Ajax applications that use popular frameworks such as Prototype, Script.aculo.us, jQuery, Dojo, and MooTools faster and easier for developers.

Whenever I wrote an application that uses one of these frameworks, I would picture a user accessing my application, having 33 copies of prototype.js, and yet downloading yet another one from my site. It would make me squirm. What a waste!

When I joined Google I realised that we could help out here. What if we hosted these files?

Read more about it here.

By the way, I caught this little tagline from ajaxian:

Because after 10 years, we're still hand-coding.

There's a lot to be said for the productivity gained from drag-&-drop RAD tools, but ultimately, software engineering is still at a stage where craftsmanship matters (a lot) and there is no substitute for a skilled craftsman.

 Wednesday, May 28, 2008

When Will The Stupid End?

5/28/2008 10:46:23 AM (Eastern Daylight Time, UTC-04:00)

Seriously, what is this country coming to?

Does Dunkin’ Donuts really think its customers could mistake Rachael Ray for a terrorist sympathizer? The Canton-based company has abruptly canceled an ad in which the domestic diva wears a scarf that looks like a keffiyeh, a traditional headdress worn by Arab men.

Some observers, including ultra-conservative Fox News commentator Michelle Malkin, were so incensed by the ad that there was even talk of a Dunkin’ Donuts boycott.

‘‘The keffiyeh, for the clueless, is the traditional scarf of Arab men that has come to symbolize murderous Palestinian jihad,’’ Malkin yowls in her syndicated column.

‘‘Popularized by Yasser Arafat and a regular adornment of Muslim terrorists appearing in beheading and hostage-taking videos, the apparel has been mainstreamed by both ignorant and not-so-ignorant fashion designers, celebrities, and left-wing icons.’’

First of all, Michelle Malkin is a fucking idiot; everyone uses "Arabic" numerals every day...guess we need to start a ban of Arabic numerals lest the enemy think that we are sympathizers!  What's next?  A boycott of ottomans?  Gum arabic?  When will the stipid end?  Second of alll, Dunkin' Donuts must be run by a bunch of idiots, too.  Have some balls, especially after you've already paid Rachel Ray for the spot.  And gosh, just use some common sense, people.

Hit the link to see a pic of the supposed keffiyeh (not even close).

The stupidity...it hurts my head.

 Friday, May 16, 2008

Digging Into REST

5/16/2008 11:26:01 PM (Eastern Daylight Time, UTC-04:00)

I've been on a REST kick for a while now.  It's been brewing in the back of my head since an interview I did a few months back.

Pete Lacey gives an in depth interview on the topics of REST and WS-* over at InfoQ.  And he points to Dave Megginson's one line pitch for REST:

 With REST, every piece of information has its own URL.

It's an incredibly powerful concept and it's empowering for the end user, IMO.

One thing that's bugged me about REST is that -- without having written an explicitly RESTful application -- is that using REST over SOAP means much more "plumbing" for web services development.  It was kind of interesting to hear Lacey address this:

There's scalability, there's performance, which is primarily influenced by caching, which is built deep into the bones of REST and HTTP, there is simplicity of architecture, not necessarily of development, and this is especially true if you are a client side developer, the point is that we don't want to hide the network from you and so you actually have to do more work as a RESTful developer of clients that you would simply by spitting out code from a WSDL.

Indeed.  I think this is where I'm a bit torn on REST since the ideal of a resource based view of a system is empowering for end users but today's tools for working with WSDL allow for much greater producitivity for developers.

 Tuesday, May 13, 2008

Impulse Buy...Almost

5/13/2008 7:11:57 PM (Eastern Daylight Time, UTC-04:00)

I usually have problems spending more than a few dollars on anything non-functional.  For example, art or posters (which to my wife's chagrin, leaves most of the walls in our house bare).  However -- for a moment -- I actually considered if I would be willing to go all out and buy a hand written letter from Einstein:

A letter being auctioned in London this week adds more fuel to the long-simmering debate about the Nobel Prize-winning physicist's religious views. In the note, written the year before his death, Einstein dismissed the idea of God as the product of human weakness and the Bible as "pretty childish."

The letter, handwritten in German, is being sold by Bloomsbury Auctions on Thursday and is expected to fetch between $12,000 and $16,000.

I dunno...$16,000 seems like a bargain for a piece of history that seems almost priceless. A hand written letter by one of the greatest scientific minds in human history on one of the most oft debated aspects of his personal life?  $16,000 is a downright steal.

Which reminds me, I should pick up a print of the cover of Newton's Principia Mathematica one of these days.

log4net With SharePoint Layout Page Applications

5/13/2008 12:36:55 PM (Eastern Daylight Time, UTC-04:00)

Using log4net with SharePoint layout page applications is really no different from using it with other types of web applications with the exception that there really isn't a convenient way to initialize the logging configuration from your custom binaries.

The answer lies in the oft overlooked AssemblyInfo.cs file.

Add the following line to the file:

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

You may also want to add log4net binary to the /App_Bin directory of the WSS virtual directory (as well as the configuration into the web.config file of the application, of course).

 Tuesday, May 06, 2008

Buy This Book!

5/6/2008 7:15:31 PM (Eastern Daylight Time, UTC-04:00)

This is quite exciting: my wife is now a published author (with her own ISBN and everything :-D)!

Check out her book The Parent Connection for Singapore Math.

:-D She's also got a media set, you know, if you've got $459 and nothing better to spend it on :-P

SharePoint "Unknown Error" Quirk

5/6/2008 3:16:53 PM (Eastern Daylight Time, UTC-04:00)

Anyone who's done any bit of SharePoint development is probably familiar with the completely useless "Unknown Error" view.  Well, in fact, SharePoint actually knows what the error is, it just doesn't want to tell you (okay, it's really just disabled for users).

In ASP.NET, you can usually get error messages to show up by setting <customErrors="Off"/>

However, this is not sufficient with SharePoint. As Stefan Keir Gordan points out, to get the nitty gritty details, you also need to set <SafeMode CallStack="True""/>

 Monday, May 05, 2008

MbUnit And TestDriven.NET On x64

5/5/2008 12:23:45 PM (Eastern Daylight Time, UTC-04:00)

I came across an interesting issue while trying to run some MbUnit RowTests this morning.

Namely, it seemed that the rows being passed in contained all null values.  It left me scratching my head.  I ran the tests using MbUnit console and it worked fine but didn't work as expected from TestDriven.NET in VS2005.

Well, it turns out that (I think) the install for MbUnit does not create the requisite registry keys in an x64 environment.  It properly creates the keys under the Wow6432Node, but it does not create the keys under the path:

HKEY_LOCAL_MACHINE\SOFTWARE\MutantDesign\TestDriven.NET\TestRunners

So to make it work, all you have to do is to copy the string values from the Wow6432Node to the key above and restart VS.

Hope this saves some headaches for other developers working in an x64 environment!

Update: Jeff Brown notes in the comments that this should be fixed with future releases so that x64 environment registry keys are properly generated.

 Saturday, April 26, 2008

The Sad State of Secularism

4/26/2008 4:26:01 PM (Eastern Daylight Time, UTC-04:00)

This story is kind of upsetting.

Like hundreds of young men joining the Army in recent years, Jeremy Hall professes a desire to serve his country while it fights terrorism.

Known as "the atheist guy," Hall has been called immoral, a devil worshipper and -- just as severe to some soldiers -- gay, none of which, he says, is true. Hall even drove fellow soldiers to church in Iraq and paused while they prayed before meals.

 "I was ashamed to say that I was an atheist," Hall said.

"Religion brings comfort to a lot of people," he said. "Personally, I don't want it or need it. But I'm not going to get down on anybody else for it."

I dunno...it's just kind of unnerving that in this day and age, a person should feel ashamed to be known as an atheist (especially one that is respectful of others' right to believe).  In fact, recent polls have shown that atheists are the most distrusted group in America, even below Muslims:

From a telephone sampling of more than 2,000 households, university researchers found that Americans rate atheists below Muslims, recent immigrants, gays and lesbians and other minority groups in “sharing their vision of American society.” Atheists are also the minority group most Americans are least willing to allow their children to marry.

It just doesn't make sense.

 Thursday, April 24, 2008

Automating Remote GAC Installs On Build

4/24/2008 4:42:15 PM (Eastern Daylight Time, UTC-04:00)

When working with SharePoint, you'll find yourself working with the GAC quite often during development.

If you've seen the light and you're working with SharePoint on a VM, one tricky problem is how to update the GAC using a post-build event.  The following is a little script that I use:

::----------------------- GAC binaries code ------------------------
:: Check if the share is available on the server
IF EXIST "\\server-name\temp" GOTO COPYFILES
GOTO SHOWNOTICE

:: Copy file to the server
:COPYFILES
ECHO Found \\server-name\temp; proceeding to copy files...

SET SN=\\server-name\temp

:: Copy the binary
XCOPY "$(TargetPath)" "%SN%" /Y /I

:: Use PsExec to execute gacutil
PATH=$(SolutionDir)Tools;%windir%\Microsoft.Net\Framework\v2.0.50727;%programfiles%\Microsoft SDKs\Windows\v6.0\Bin;%path%

psexec \\server-name -u Administrator -p password -w "c:\temp" gacutil.exe /i "$(TargetFileName)" /f

GOTO END

:SHOWNOTICE
ECHO Your VM image is not sharing the directory "c:\temp"
GOTO END

:END
ECHO Completed

The batch script makes use of Sysinternal's PsExec.  I've included the binary executable in my solution tree under the directory "Tools".

The script only has one assumption: the VM (or remote machine, really) is sharing the c:\temp directory (okay, and that the path to gacutil.exe has been added to the remote machine's PATH environment variable).  Here's a breakdown of the logic:

  1. The first step is to check if the directory exists and can be reached.  If not, we go to the end and show a notice about sharing the directory.
  2. If the directory is shared, the output dll from the build is copied to the shared directory using plain old XCOPY.
  3. Once it's copied over, we use PsExec to execute gacutil on the VM (or remote machine).  The -w argument specifies the working directory on the remote machine.

Enjoy!

RSS 2.0 Atom 1.0 CDF