Archives For blog

… or how to stand on the shoulders of giants.

i’m sure that most of you who are interested in this post will be somewhat familiar with this John Resig post of 2008, where he outlines a simple process for creating object (class?) hierarchies in JavaScript.

as a relative newcomer to JavaScript after 20 years of C/C++/C# development, the last few months have provided a fun challenge. I cut my JavaScript teeth developing the HTML5 ebook From Blue To Red, and that experience provided an excellent opportunity to match my preconceptions of strongly-typed classical inheritance to the strange new world of JavaScript prototypes.

i’m now working on another project which is modeled well with a couple of shallow class hierarchies, and the JavaScript components cannot depend on any other libraries during a bootstrap phase. Resig’s pattern provided an excellent starting point for me, but I ran into trouble when I started using ECMAScript 5 getter and setter properties, which were actually being invoked on reference when copying properties from the object literal to the class prototype.

here then is a version of Resig’s Simple JavaScript Inheritance, revisited and revised for ECMAScript 5 and compliance with “use strict”.

Continue Reading…

aqua blue

aka the eyeball margarita.

in rough proportions:

  • 2 parts silver tequila
  • 1 part blue curaҫao
  • 1 part lime juice
  • 1 big ice cube

mix in a glass at least big enough for the ice cube and liquids together.

seriously, don’t bother measuring;  just eyeball it until you get one of the colours in the image!

ciao!

cold night in Montreal

the wind is blowing bitterly cold in Montreal.

i watch my youngest daughter walk down the street to meet a young man in the music library.

i head back to the hotel, turning up my coat collar.

it doesn’t help much.

ciao!

happy Bullroarer Took day!

who is Bullroarer Took?

http://en.wikipedia.org/wiki/Bullroarer_Took#Bandobras

hobbit genealogy (Bullroarer is an ancestor of Pippin):

http://www.glyphweb.com/arda/b/bandobrastook.html

lotro screenshot contest:

http://www.lotro.com/news/latestnews/1843-bullroarer-took-screenshot-contest-2012

ciao!

there are lots of posts about using caspol to solve problems when running .net apps from a network drive or share.  e.g. http://blogs.msdn.com/b/shawnfa/archive/2004/12/30/344554.aspx.

the documentation at msdn is rather impenetrable: http://msdn.microsoft.com/en-us/library/ee191568(VS.100).aspx.  Apparently .Net 4.0 has totally changed the way all this works.

my situation is this:

  • fresh install of Windows 7 SP1, all patched up and running in a VirtualBox VM (64-bit);
  • Visual Studio 2010;
  • .Net 4.0;
  • all compilation happening through a VirtualBox shared  folder, which makes it looks like a network location; and
  • i’m compiling a large enterprise app which has to stay targeted at .net 3.5 for the time being.

since my apps are targeted at pre-.Net 4.0 frameworks, I’ll need to use caspol.exe to run anything on the shared folder, which is mapped to the network letter f:.

trying to apply advice from the sites linked above does not result in any immediate gratification.  After flailing about for a good 32 minutes, the 64-bit penny drops: security policy for 64-bit and 32-bit version of the framework are maintained separately!  If I had just read shawnfa’s blog post a little more carefully, I would have noticed that.

so make sure the version of caspol you are running comes from the right version of the framework. Doh!

32-bit: %windir%\Microsoft.Net\Framework\v2.0.50727\caspol.exe
62-bit: %windir%\Microsoft.Net\Framework64\v2.0.50727\caspol.exe

since everything is being developed on a mapped network drive f:, here are the final commands I used to ensure that  I can develop both 32- and 64-bit apps from that drive targeted at older .Net versions:

C:\Windows\Microsoft.NET\Framework>v2.0.50727\CasPol.exe -m -ag 1 -url file://F:\* FullTrust -n "F Drive"
C:\Windows\Microsoft.NET\Framework64>v2.0.50727\CasPol.exe -m -ag 1 -url file://F:\* FullTrust -n "F Drive"

 

ciao!