jest

by David LaVallee 19. November 2009 22:25

As in surely you jest.

As in JSON + REST (why should this be hard at all?)

As in: "I need web services, but I don't want to construct and deconstruct XML to get data out of my C# based IIS server to my Javascript based client".

So, yesterday I built an ASPX page class that takes a JSON object as its "arg" and returns JSON data with the mime type "text/javascript".

On the server side the JSON gets fully deserialized into a C# System.Collections.Hashtable object. Each JSON type, dictionaries, arrays, strings numbers and bools become their equivalent C# types.

To use Jest you create your ASPX page by subclassing JestPage (instead of Page). Very abbreviated aspx file:

and a pretty simple code behind.

You implement the override method Jest:

The Hashtable is serialized as a JSON response. Excitement should be building at this point, so let's look at a full circuit use example.

Let's keep it simple, Here's my index.html:

The output...

Here's JestPage.cs which is the whole thing:

JustPage.cs (11.16 kb)

Tags:

Patterns

by David LaVallee 19. November 2009 21:28

As a student and practitioner of design, programming, writing and music I've come to see that there are sequences of ideas and relationships between objects that repeat again and again across domains. The best way I can illustrate this point is to talk about design patterns. Pattern language was introduced in a series of books by Christopher Alexander in 1977, that catalogued repeating patterns in architecture, buildings and landscaped spaces.

I think it is a very human thing to look for patterns, and to play with patterns, take a look at Aza Raskin's Algorithm Ink an implementation of context free grammar in the spirit of processing. Each of these shows the playful side of patterns.

Computer programmers use patterns all the time, in the 90's it was recognized that whether they know it or not most programming is CRUD, so gain some REST, learn the patterns.

Story tellers use patterns too, though our mentor in this case came a few thousand years before Chris Alexander. Aristotle wrote Poetics in 335 BCE. Poetics stands the test of time so well that my most recent book purchase is Aristotle's Poetics for Screenwriters by Michael Tierno (a script reader for Disney).

Pattern discipline is also evident in these areas:

...

Tags:

Ubuntu 9.10, Sun Virtual Box

by David LaVallee 12. November 2009 23:19

I am liking my HP dv7 laptop very much.

I had one small regret in that the 2GHz Core2 Duo Intel processor that it has does not support hardware virtualization, that means no Hypervisor Virtual Machines, that means no Microsoft Virtual PC or XP mode under Windows 7.

Yesterday Google announced the Go language, and I wanted to give it a "go".

First I installed Ubuntu 9.10 desktop on a USB key, downloaded all the google stuff and got to writing Hello World in one tenth of the time that it takes to do that with Windows 7 and Visual Studio. Very cool to have a USB flash drive that has a personal bootable system on it, but I really need multiple OSes for testing.

I'd heard about Sun Virtual Box, but after the less than fantastic experiences with VMWare Fusion One (VPC for OSX), Hypervisor and Virtual PC, I wasn't sure that it would be worth it to take the time to look at another virtualization platform.

Sun Virtual Box works great. The time from downloading Virtual Box... Installing Ubuntu 9.10... Installing updates... Installing Google Go... to running the Hello World a.out was about 40 minutes total.

Using Virtual Box to "hibernate" saving Ubuntu's running state takes about five seconds, as does restoring Ubuntu. That seems much faster than opening a document in Word!

Tags: , ,

Film Noir References

by David LaVallee 21. October 2009 00:52

Tags:

Weakly World News, (sic)

by David LaVallee 21. October 2009 00:36

The original Photoshop Fail Blog.

Tags:

Life Magazine backissues via Google Books

by David LaVallee 21. October 2009 00:30

Life Magazine

The advertisements are fantastic reference material.

Tags:

W00tstock

by David LaVallee 17. October 2009 08:16

Poster by Len Peralta, awesome.

Tags:

Live Geometry in Silverlight

by David LaVallee 17. October 2009 04:19

This is a great use of Silverlight, a web page that lets you play with 2d geometry.

Tags:

MVVM Primer

by David LaVallee 15. October 2009 08:11

MVVM (model, view, view-model) is the new pattern for WPF/Silverlight, it's also the 20+ year old pattern called CMV (controller, model, view).

It is very cool, as the view-model is more specific than the controller of CMV.

Jeremiah Morrill has written a great simple tutorial in beginning with MVVM pattern.

 

Tags: , ,

7FTW (Seven for the Windows)

by David LaVallee 14. October 2009 05:44

 

The video chip died on my HP Pavillion DV2000, so I took the bus to Costco and got an HP Pavillion DV7 for $900.

With OSX it is simple for me to move to new hardware. Carbon Copy Cloner creates bootable drive images, and the personal preferences for programs are in files under each user's home directory, versus the windows registry.

Thus, to get moved to new Windows hardware it goes something like this:

Start 4:45 PM

 

  • Install W7 Ultimate 32 bit version 7100
  • Install Office 2007
  • Install Safari, Quicktime, Bonjour
  • Install Google Chrome
  • Install W7 OS + Office updates (~350 Mb)

 

6:20

 

  • More Office updates (~35 Mb)
  • Enable IIS 7 through turn windows features on/off in the add programs control panel
  • Visual Studio 2008 Install.
    • C# and web dev
    • VS SP1 (100s of Mb)
    • SQL 2005 SP3 (350 Mb)
    • (370 Mb VC++ runtime update)

 

9:20

 

  • blend studio 3

 

9:24

 

  • adobe after effects (+350 mb of updates)
  • adobe cs4

 

11:45

 

  • CS4 almost installed from disks
  • (+327 Mb updates).

 

Windows 7 has an awesome virtual pc, that runs a screaming Windows XP mode (to test IE7)

Rats! the Intel 7350 core 2 duo doesn't support hardware virtualization windows xp mode. Fortunately the dv7 has an upgradable CPU.

To make this laptop (possibly litterally) smoking I'd have to add:

CPU: $800
8Gb RAM: $400
128GB SATA Drive $360
Drive mounting kit $ 60
total $1620

Of that the 128Gb Solid State Disk and mounting kit at $420 would be the most significant performance boost if added as the system boot and swap devices.

The machine is fast enough, and a replacement motherboard for the old DV2000 is $130.

More software

  • axialis icon workshop
  • swift3d
  • filezilla
  • zune 3, music, can't kick the habbit
  • kaxaml http://www.kaxaml.com A great XAML playground tool.
  • notepad2, download it then rename it notepad.exe. Change the owner of \Windows\System32\notepad.exe to yourself, then replace with the notepad2.exe

Next Day 4:30

  • Microsoft Security Essentials, finally a free way to stop the security center from whining.
  • Quicktime Pro, still a great utility tool to transcode video.

Final tuning: Set the defaults for CMD to use the Consolas font, Quickedit mode, and 120 character wide column.

Back to the Mac... Adobe Media Encoder DOA, can't load a DLL that's in the right place with the right permissions and replicated in five other places.

Three days, versus three hours to do the same system migration on OSX. Granted the equivalent 17" half terabyte "Power Pro Mac Book" is $1500 more expensive (with a 30% faster processor).

Days Later

Download the HP MediaSmart DVD software for the BlueRay DVD in this thing. FTW, now I can watch Kung Fu Hustle anytime anywhere!

Two weeks later

Add Reaper to edit audio.

 

Tags:

Geek Speak Slide Show

by David LaVallee 16. September 2009 02:40

Are you insulting me? Essential geek-speak, FTW!

A slideshow that explains some of the basic memes TLAs and such, sute to have you ROFTL.

Tags:

The Improv of Autum

by David LaVallee 4. September 2009 21:16

Two projects underway for the Fall.

Both will run in November at the Market Theater in Seattle.

The first is the Tim Tracey Orchestra, I get the concert master seat, well, I'll be the only violinist.

 

The second will be film noir based improvised scenes and plays. A group of six of us will be studying the form and presenting something similar to Instaplay (how I spent my summer vacation improvising a long form play three nights a weekend).

 

Tags: , ,

Improv

© 2009 David LaVallée | 206.601.9322 | Resumé