October 30, 2006
@ 09:35 AM

This weekend, at Code Camp Seattle 2.0, Peter Provost and Brad Wilson presented on Worlds of Warcraft, and how you could use a scripting language, LUA, built into it to change the UI. I don't play WoW, but though it would be an interesting change (it was!)

LUA seemed like an interesting language. I can think opf a number of times over the years, where I had thought that it would be nice to expose scripting extensibility points in my applications. I made a mental note to explore this further.

This morning, while trouble shooting an unrelated problem, I downloaded the latest Wireshark (used to be called Ethereal) and noticed the installer had an option to install LUA (experimental.)

Intersting how seeing something in one place makes you more prone to notice it in others. 


 
Categories: scripting | tool

October 29, 2006
@ 03:53 AM

A few months ago I started listening to BBC news podcasts. They had a few other programs I downloaded as well, talk shows and such. I was quite surprised to learn that BBC's, "All Things Considered," is very different from NPR's! I ended up not listening to their talk shows much, but I also discovered their great music radio programs. In particular I like Radio 3, especially the experimental music like the program "Mixing It." I get a very wide variety of music. If I'm in the mood for something else, I find the other genre's well represented too. Too bad I can't download it and take it with me.


 
Categories: music

October 29, 2006
@ 03:43 AM

The surprise theme for me was XNA. I was thinking pragmatic programmer - wanting to try something different. I attended a morning session "Making an XNA Game for the Xbox 360" and started getting crazy ideas. Being able to write C# code for the XBox just opens all kinds of doors. I started imaging a world where lots of rich-rich-client apps could be build for mega-markets of people that have consistent, stable, XBoxes in their homes.

As some friends know, I used to do graphics programming, from around 1996 to 1998, for a company in Taiwan that made educational and real games. I never worked on real games, but I learned a lot about graphics working there. It was fun to get a review - normals, phong shading (which you can implement in hardware now, using pixel shaders! Wow!), and all the geometry parts. Funny quote, "10,000 triangles was considered a lot back in DX5!" (everybody but me laughed - I remember at an Intel Programmer's Seminar in 1998 seeing them show a demo with 5,000 polygons, and getting lots of oohs and ahhs. I am old.)

I attended Jeffery Richter's presentation on scalable applications. One word: guilty. Yeah, I've built lots of applications that create a thread for an I/O operation. I don't see the problem as being as serious as Jeffery mentioned - if my application isn't doing lots of I/O operations, what's the big difference? The specter of 1MB of memory wasted? That's virtual memory, not physical! I understand it's not free, and _now_ there is a better way to do it (letting the thread pool manage threads), and in fact that's what I do now, but only since .NET came out. Even that has flaws - one thread per CPU? I'm never going to have the only active threads on the system.

Another problem I see is that with modern frameworks, it's all but impossible to take advantage of things like asynchronous SQL Client methods (BeginExecuteReader() and friends.) Getting something like NHibernate to use asynchronous SQL Client APIs would require a major shift in the way things work. 

If I was implementing a different kind of application (Outlook, SQL Server, IIS?), I would be a requirement that I closely follow this advice. For my work, it's well advised, but I am not going to lose sleep over creating an extra thread once a day to gather data without hanging a UI thread. It was a really cool talk and gave lots of information (from what Michael told me after attending the DevScovery version of this, this was just the tip of the iceberg.) I hope I get to go to devscovery or something next year to hear the rest of the story.

The afternoon was all XNA. I was disappointed to learn, before the start of the afternoon session, that XNA has no networking support. That crushed most of the cool ideas I had (the one I had fixated on: data visualization and equity trading on the xbox.) I can imagine that XNA enables lots of bundle-ware-ish scenarios for the xbox - how about a product brochure as an xbox DVD? It looks like it would be easy to throw this kind of stuff together with very little programming. Too bad they are so sensitive about security with the xbox. I think they are maybe missing the huge potential the XBox has with respect to things other than games, or for non-traditional games that need more than just a fixed dataset to run.

Looking forward to today. My plan: Dependency Injection, (Card Spaces | WoW - not a player, but sounds interesting ), (WPF | reporting servicesmore reporting services | or micro-pairing), then (calling reporting services | virtualization.)

I've already missed several presentations I wanted to see, and will miss more today!


 
Categories: CodeCamp

October 23, 2006
@ 12:57 PM

Today I needed to svn mv a bunch of generated code files. I quickly popped open a Power Shell window and built this up incrementally (in about 2 minutes).

We switched from generating derived classes to generating base classes, then deriving from them (I call this "the sandwich model.") I wanted the history to show the flow from what was our derived classes into what are now base classes.

Anyway, fuzzy mass renaming seems like a major strength of power shell for me lately:

ls *.cs
| where {$_.Name -cnotlike '*WorkItem*' -and $_.Name -cnotlike '*Base*'}
|% {$baseName = [System.IO.Path]::GetFileNameWithoutExtension($_);
$oldName = $baseName + '.cs';
$newName = $baseName + 'Base.cs';
svn mv $oldName $newName;}

 
Categories: scripting | tool

October 17, 2006
@ 08:39 AM

This is dumb, but I find myself using this a lot recently, and want to remember it. Some things I installed a long time ago put some assemblies in the GAC and I kept getting these gac'd references in my assemblies.

gacutil.exe /l 
| where {$_ -like '*nunit*'} 
|% {gacutil /u $_}

I really love the "|%" syntax. I wish C# had that: someCollection |% $_.SomeMethod.


 
Categories: admin | scripting

This isn't mentioned in the Windows Live Writer Plugins over on the side of my weblog (look --->), but I used it for the last post and it worked without fuss. Worth checking out. Thanks, Mike Ormond! 

Link to Mike Ormond's WebLog : Live Writer Source Code Format Plug-in


 
Categories: links | tool

October 4, 2006
@ 02:33 AM

Inspired by Roy and Andrew, I have been itching to try using MbUnit on a new project. This evening I got a chance to do that. I have a tool I use for several projects, and I wanted to add a bunch of features to it, so I seized the day.

It's been at least a year since I used MbUnit for a real project. In that time, my unit testing style has changed a lot.

I'd say the biggest change for me came after watching Brad Wilson write unit tests in front of an audience at Seattle Code Camp last year (link broken at time of writing). The speed and rhythm he had going really left an impression, and changed my style. It caused a bunch of things to gel for me. Watching a pro do Unit Testing is a great thing. (Also check out John-Paul Boodhoo in the DNR TV Videos he and Carl made.)

Since then, I often write a method, and maybe the first thing I want to do is write a guard clause. I write a test to feed in the base value, then write the guard clause. I might have a series of bad scenarios, then finally, the normal flow, which is often my last unit test before deciding I am done (for now.)

So I end up with unit tests that look like this (maybe with ExpectedExceptions, but usually just verifying a return value or something):

 

[Test,ExpectedException] public void EdgeCase() {}

[Test,ExpectedException] public void EdgeCase() {}

[Test,ExpectedException] public void EdgeCase() {}

[Test] public void MainFlow() {}

Everything is very explicit, with a "statement" for every part of the contract the method implements...kind of like a verbose legal contract.

So the first thing I notice writing tests like this in mbunit is that these collapse down to:

 

[RowTest, ExpectedException, Row, Row, Row, ...] public void EdgeCase() {}

[RowTest, Row, Row, Row, ...] public void MainFlow() {}

It's about 30% faster for me to write the RowTest version, even though I have a CodeRush template for simple unit tests and expected exception tests. RowTests are just plain more concise. More like notesy instructions to your coding buddy than formal legal contract.

The only thing I don't like about this is the way the code looks formatted. Readability is very big for me, and I like collapsing my tests up so they look this this:

 

[Test] public void SomeMethod_ShouldDoSomething() ...

[Test] public void SomeMethod_ShouldDoSomethingElse()...

[Test] public void SomeMethod_ShouldntDoSomethingBad()...

All the Rows end up pushing the method name out of the right margin, or force me to put in line breaks.

But that's just being nitpicky. I'm sure I'll figure something out.

 

Currently listening to Party For Your Right To Fight by Public Enemy from the album It Takes A Nation Of Millions To Hold Us Back


 
Categories: tdd | tool

October 2, 2006
@ 09:47 AM

This sounds like a lot of fun. I wish I could go. It looks like there are a lot of really good sessions (Taking Mash-Ups beyond the Browser, Programming Windows Communications Foundation, The CAB Pragmatist, and Practical Domain Driven Design in .NET, all look really interesting, just to name a few.)

I would actually consider flying down there, but Julie and Allie are leaving for Taiwan Saturday. I checked and didn't see too many people from Sacramento (that I know anyway) attending. Code Camps rock.

If you are from Sacramento, go to Silicon Valley Code Camp! It's free and looks like it has all the makings of a really good code camp!

Link to SiliconValley CodeCamp 2006

Currently listening to Humming Chorus by William Orbit from the album Hello Waveforms


 
Categories: CodeCamp