Damon Payne: Hand waving software architect

103db signal to noise ratio at < .03% total harmonic distortion
Solution Architect, software developer, geek
Damon Payne at Blogged
2009 Microsoft MVP - Client App Dev
2007 Microsoft MVP - Solution Architecture
 Monday, June 23, 2008

Dan has an article showing some nice syntactical sugar for spawning threads.  Dan has been studying the model of CCR, currently part of Robotics Studio.  The article specifically mentions the Compact Framework, but if you are doing full-framework development I would encourage you to check out the Parallel Extensions library as well.  It was mentioned at TechEd that the CCR might be refactored to use the TPL, so it'd be worth taking a peak at.  Using System.Threading.Tasks you could write code that starts to look less like the traditional ThreadStart code and more like what Dan is doing.  Without spending more than 30 seconds on this idea:

TaskCreationOptions tco = TaskCreationOptions.Detached;

TaskManagerPolicy tmp =

new TaskManagerPolicy(1, Environment.ProcessorCount,1,0, System.Threading.ThreadPriority.AboveNormal);

TaskManager tm = new TaskManager(tmp);

Task t = Task.Create(

(a) => { Console.WriteLine("doing some work"); },

tm, tco);

If we start to see some multi-core mobile processors, it might be an interesting excercise to port a subset of PFX to the Compact Framework.



Monday, June 23, 2008 12:05:23 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, June 18, 2008

It looks like blogged.com has labled me "great".  I'll take it!

Damon Payne at Blogged



Wednesday, June 18, 2008 10:45:26 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 12, 2008

While looking on Reggie's blog for news on MySQL support for the Entity Framework, I enjoyed reading this article.  I continue to be amazed at the performance of the CLR.  Some people are absolutely baffled that managed code could be faster than native code, and the low-level reasons why have been blogged by people far smarter than I in the past.  Since someone just asked, A couple of the better-known reasons:

1) The managed heap rules:  If I say "object* foo = new object();" in C++, the OS looks around to find some memory it can give me.  CLR programs use a managed heap, however.  Despite the fact that calling "new()" is always expensive, the managed heap gives a huge advantage.  Instead of searching for free memory, the next chunk on the managed heap is returned immediately.  C developers writing games have used similar tricks for years, using malloc to get a big chunk of memory and managing bits of it themselves as needed.

2) JIT rules: C# is always JITified before execution.  JIT compiling turns your C# into machine code.  So what, you say, my C/C++ code is pre-compiled for the platform and doesn't pay the JIT penalty on application startup.  The advantage of the JIT is that it can be compiled each time the program is ran, and potentially take advantage of different situations and things specific not just to a processor architecture, but on each individual machine.  (I need to find a link to cite this appropriately) 

Anyway, read the article on Reggie's site, and thank him for the work he's doing.  Hey Reggie, when is that preview of Connector 5.3 come out?

.NET | C++ | O/R Mapping


Thursday, June 12, 2008 12:20:58 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, June 10, 2008

In an article on Ars Technica, a lobbyist for the cable industry is quoted as saying that deregulation allows vendors to innovate faster and is a pro-consumer move.  The article’s author, however, cries that past evidence shows that deregulation has always brought higher prices to customers.  In addition, the absolutely abysmal customer service record of every major cable provider is pointed to as a need for government interference. 

I can personally provide a number of anecdotes to speak to the utterly shameful service and support I get from my own cable provider, but as is almost always the case when deregulation (free markets) is blamed for a supposedly undesirable effect, the ostensible deregulation is incomplete or tainted and therefore does not accomplish its aim. 

In the case of cable, consider the history.  Buried wire cable TV and Internet providers have had to deal with censorship and invasive oversight from the FCC and have been granted exclusive contracts by local and state governments.  These contracts usually take the form of the provider promising to build out the service to a high percentage of homes even if running wire there is not profitable and kick backs to the municipality in question in exchange for a guarantee that no competitors will be allowed to offer a comparable service in the same geographic area.  When Kyle McSlarrow says he wants deregulation, it would seem he wants to be free from any oversight, but of course keep the government’s barrier to any competition.

Removing any threat of competition, as well as allowing the cable provider to set their own prices, provides no incentive to offer good services at good rates and no incentive to help customers who are having trouble.  Right now, if I want better cable service, my only option is to move to someplace where a better provider is operating with their government-blessed monopoly.  Despite intense marketing spin to the contrary, Satellite is not an equivalent option in terms of bitrates, latency, and weather resiliency. Services such as Verizon’s FIOS and AT&T UVerse face an uphill regulatory battle at the State, Local, and Federal level as they seek permission to run fiber-optic wires into cities to compete with cable.

As usual the proponents of a Paternalistic State are quick to decry free markets as the cause of the issues that were in fact created with regulations.  If any company who wished to provide content was free to go out and negotiate with landowners to bury a transmission medium all the way up to individual homes, then we would see real deregulation.  Companies like Time Warner, Charter, AT&T, and Verizon would have to compete for the business of discerning consumers instead of competing for the favor of a small number of bureaucrats. Complete deregulation is the only sure way to drive innovation, bring down prices, and improve customer service.

Only complete and unconditional deregulation will set consumers free from high cable prices and bad service.



Tuesday, June 10, 2008 12:55:43 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Larry Clarkin called me out in a question on software development going around the blogosphere.  Here are my answers.

How old were you when you started programming?

I was 11, we were living in a town of 600 people in southern Missouri.  I was very into arcade games and the few games we had for the PC which was an 8086.  My father, a very technical man but very cheap at the time, was loathe to shell out for a new video game.  At some point in a stroke of intuition, I realized those guys must create these games somehow. 

Damon: “Dad, if I can’t have a new game, I’ll make one.  How do those guys do that?”

Dad: “Oh, that’s with programming languages son”

Damon: “Do we have any of that?”

Dad: “Here’s the GW-Basic book that came with the PC”

I did the basic infinite loop printing my name, then learned the power of GOSUB and created a subroutine that would draw a spaceship and a subroutine that would shoot lightning bolts out of said spaceship.   I didn’t understand anything about how game worlds were animated though, the “tick” concept, and though that every on-screen object must be a Thread or something.  I left it alone until years later, living in Waukesha, my Dad brought home a Turbo Pascal compiler for our massively powerful 386. 

What was your first language?

GW-Basic, later Pascal

What was the first real program you wrote?

Well, the spaceship game was vaporware so I can’t say that one, but I did briefly experiment with audio on the 8086.  There was some kind of PlaySound(frequency, duration) function in GW-Basic, and I thought I’d need to write music for my eventual spaceship game.  I painstakingly assigned every letter of the alphabet a frequency inside a subroutine and checked the key stroke to see what letter was pressed.  I would type out various things that are not fit to print here in an attempt to see what words and phrases might make cool game music.  This program worked and met the intended scope.

What languages have you used since you started programming?

GW-Basic, Pascal, C, C++, Dephi, Q-Basic, Java, Javascript, VB.NET, C#

What was your first professional programming gig?

My internship of my Junior year in college ended up lasting through my Senior year, so nearly a year.  I was a C++ developer at Great Lakes Higher Education Corporation.  We were doing code on DB2 and Solaris of the kind JSP developers would soon become familiar with.

If you knew then what you know now, would have started programming?

Absoultely.  There’s few other things I could picture myself doing.  That sounds like a good blog post “What would you do if you couldn’t create software?”

If there is one thing you learned along the way that you would tell new developers, what would it be?

I would tell them to take an interpersonal communication class, or to spend some time as a real professional consultant.  Many early times in my career I got in trouble, or nearly got in trouble, by being cocky or not recognizing when situations were politically charged.  Even if you just want to write code, you must be aware of these things.

What’s the most fun you’ve ever had programming?

There are lots of small things along the way where things were fun for 6 months or so, but when I think about times I was most looking forward to going to work, it was actually (and I can’t believe I’m saying this) a project I did at Assurant health.  They forced me to use VB.Net which I hate, they gave us slow computers with mandatory virus scanning, and the schedule required heroics and a lot of cleaning up bad offshore code.  However, I had some excellent people to work with that I still stay in contact with years later.  I am now a client of The Clarkinator.  DeMilde, Terski, VanDyke, and others: it was a good time.

Who am I calling out?

Aaron Staves

David Snopek

Dan Vanderboom

Matt Terski



Tuesday, June 10, 2008 10:21:17 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, June 08, 2008

I had done the attendee party at TechEd 2005, and was completely blown away by it then.  I had no idea they’d actually bought out all of universal studios for 3-4 hours, with complimentary food and booze every 100 feet or so.  This led me to have the same expectations for this year’s party, which unfortunately was still cool, but not nearly as cool as 2005.  It seems half the park was rented out to another event, and that half happened to include the Mummy ride and some other cool stuff.  I think 2005’s party was longer than 8-11pm.  Still, complaining aside, it’s a very fun event: free drinks all over place tons of food including giant BBQ turkey legs this year (you’d have to see it…) and lots of stuff to do including Terminator, Jaws, Men in Black, etc. 

I got several bits of merchandise for my daughter and some Microsoft crawlers for my son. 



Sunday, June 08, 2008 5:11:38 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, June 07, 2008

I did two very hard-core sessions on WPF today.  The first was with Tim Huckaby on WPF data visualization applications.  Some of the coolest WPF 3d that I’ve seen.  Oddly enough, he mentioned that the Scrips Research Institute had entered a patent last year that effective cures cancer.  The problem is that the host is killed 100% of the time too, but still very promising.

For the sub-genius line of business developer, WPF is the closest thing you can get to being paid to write video games without actually going back to C++ and slaving away in the video game industry.

Besides the formal sessions, one great aspect of TechEd is your ability to walk around the exhibition floor to talk with people from various teams at Microsoft.  I made it my mission to talk to as many people as possible.

·         ADO.Net Entity Framework:  Very cool.  The objects are not dumb CLR objects, but this MAY BE what I’ve been looking for.  I’ve always been a fan of the ORM and only once, in Java, did I have one (OJB) that I felt was the right mix of features and intrusiveness. I’m eagerly awaiting a production-ready MySQL EDM plugin.  In the mean while, to play with this, I think I’ll convert KlipschCorner.com to use this.  The programming model and LINQ queries felt very natural.

·         Visual Studio extensibility: there’s a World of Warcraft script plug-in for Visual Studio! 

·         ClickOnce: things are a lot better in SP1, but you still have issues with self-signed SSL certs and Internet+non NTLM authentication and of course keeping people from getting your bits if they shouldn’t have access.  It was good to see that people like Quicken and GoTo Meeting are using ClickOnce to deploy software over the Internet.

·         WPF: I met the principal architect behind XAML.  We looked at some amazing spatial data applications including:

o   Zurich airport: http://blogs.msdn.com/tims/archive/2007/03/27/great-wpf-applications-13-z-rich-airport.aspx  

o   iZooFari: http://www.interknowlogy.com/Pages/iZooFari.aspx

·         ArcCast : Let’s just say there was some friendly arguments and teasing.  You know who you are.

·        Live Earth: The bird’s eye view 3d maps are freaking insane.



Saturday, June 07, 2008 1:13:15 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 05, 2008

Ok, so, I found some great Silverlight tips on the afternoon of Day two courtesy of Jeff Prosise (http://www.wintellect.com/TechnicalBioDetail.aspx?Tech=5) .   I am definitely going to be taking his advice on some points and blogging about it as I convert my Beta 1 examples to Beta 2 examples.  Jeff had an implementation of The Game of Life in Silverlight that got me thinking about getting some Concurrency peanut butter into the Silverlight chocolate.  Would the LINQ based ray tracer work without too much modification in Silverlight?  Surely the Task Parallel Library will not work in Silverlight without serious modification and many things will likely not be available at all.  Still, I smell a side project: to what degree could we at least get Parallel.ForEach<> , Parallel.For, and perhaps some of the basic System.Threading.Tasks.Task things working in Silverlight 2.  Possible uses for this include a Silverlight based Folding @home style app and I’m sure there are others.

2008 TechEd MVP Party

I’m writing this on the morning after the 2008 MVP party, hosted in the Voodoo Room at the House of Blues in Orlando.  What a blast!  I showed up and realized that while I knew no one most other folks seemed to already know other MVPs.  Shortly thereafter Carl Franklin walked in the door.  Since I don’t get to meet Internet Famous people often, I said hi and thanked him for introducing me to Steely Dan with his rendition of Home at Last .  He seemed amused and gave me the big High Five when I said I actually bought Aja because of him. 

There were two guys there doing the whole Blues Brother s schtick.  It would seem not as many people came as RSVP’d, so I was able to call The Vanderboom and get him in to the party.  The lower attendance also meant that the free drink tickets flowed in a steady stream for all of us.  There are some pictures circulating of me swing-dancing with a woman who runs a user group in Seattle.  Hopefully no other incriminating evidence exists, everyone remaining when they kicked us out was getting wacky by that time. 

Thanks to Microsoft for putting this event on, and all the MVPs who came for a great time.



Thursday, June 05, 2008 10:01:14 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, June 04, 2008

This morning’s session with Stephen Toub on the parallel extensions to the .net framework was excellent.  Stephen had a  quad-core laptop that was enormous and hotter than the surface of the sun.  Intel’s quad-core mobile chips for laptops should be out this summer.  Anyone want to buy a used Vostro with a Core2 Duo?  He also had an early prototype of a system based on the Intel Dunnington architecture that appeared to have 20 cores.  I suddenly felt that my Quad Core setup at home was hardly adequate to do real concurrency research.

I owe him several comments and I hope my notes are adequate to remember all of them.  I brought some more questions I didn’t ask yesterday.

Q: Stephen has stated that the goal is for developers to extend System.Threading.Tasks.Task in order to do concurrency at a lower level than Parallel.ForEach<>, yet Task has an internal constructor keeping you from extending it.

A: The PFX team realized this during their internal code reviews and this will be fixed in a future CTP.

Q: In the ray-tracing example, you can see one of the pitfalls of static partitioning of workload.  Compare the top of the image vs. the bottom.  In ray-tracing the objects and reflective surfaces make for much more intensive computations, and so the top of the screen draws very quickly while the bottom of the screen fills in rather slowly.  Is thought going into hinting semantics that would allow users of PFX to indicate that certain units of execution have a greater “weight” relative to others?  Would you handle this by changing priority of some Task threads so Windows gives it extra cycles, or changing the static partitioning algorithms?

A: With the current Task API, you can set the priority of a Task, which ultimately means thread priority.  There is design discussion going on related to how we might be able to give hints to the TPL.

I just got out of a “deep dive” on the Silverlight 2 rendering pipelines.  There were some good debugging hints I didn’t know about, but other than that the dive was not as technical as I’d hoped.  Right now I’m in a social networking session led by Rob Howard, and then on to more Silverlight.



Wednesday, June 04, 2008 2:20:01 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Saw some more sessions last night, including one on data access layer encapsulation with the entity framework.  I need to dig into this more, maybe a hands on lab if I can find one.  It’s not clear from the examples how parent-child relationships are loaded by the entity framework and if both eager load and lazy load situations are supported.  I have such high hopes for the entity framework that there’s almost no way I won’t be disappointed on some front.  The only reason why I haven’t spent a day looking seriously at the bits in SP1 is because I’m mostly working on MySQL right now and the MySQL/.NET team has yet to produce EDM support.

I got an email from The Clarkin on Friday asking if I’d like a “Nice dinner on Microsoft”.  He wasn’t kidding and he is in fact my bestest friend forever for thinking of me.  Dan and I met a lot of Central region nerds at Charley’s Steak House and it was excellent.  I’m no Richard Campbell but I do tend to tend to get loud in a group, and I ended up giving an impromptu rundown of the French red wines from the menu, and we did a fair bit of sampling too, all courtesy of our excellent Evangelists from the Midwest. 

As I write this Stephen Toub’s Parallel Extensions talk is about to start.  I’m 100% full up on sessions until late tonight, and after that is the MVP party at the House of Blues, but I’ll try to sneak some more comments in today.



Wednesday, June 04, 2008 8:06:47 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback