got net?

Kevin Hazzard's Brain Spigot

About the author

Welcome to Kevin Hazzard's blog.
E-mail me Send mail

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

How I Learned to Love Metaprogramming

UPDATED on 30 June 2009

I spoke at the CodeStock 2009 conference and I thought it would be helpful for the attendees and others to be able to download my code and slides. The title of my presentation was "How I Learned to Love Metaprogramming" and it concerns Dynamic Language Runtime architecture, performance of dynamic typing and Python to C# integration. The slides and source code are linked below. I will be giving this talk again in September at the Charlottesville .NET User Group meeting. Both of the demos require C# 4.0 which is available in Visual Studio 2010.

  • Demo One - shows how to do XML parsing using a fluent interface based on a DynamicObject derivation in C# 4.0
  • Demo Two - shows how the Level 0, 1 and 2 CallSite and ActionBinder caches perform. UPDATED: I added a demo on 30 June 2009 that shows how the DLR 0.9 compares by invoking dynamic code through the DLR hosting APIs, thereby bypassing the CallSite caching mechanisms. The results are very instructive, showing that the DLR's polymorphic inline caching can yield a 250000% increase in performance. You read that correctly: a two hundrend fifty thousand percent increase in performance.

Slides in PDF (Acrobat) format (688.49 kb) 
Slides in PPTX (PowerPoint 2007) format (639.23 kb) 
Demo One Source Code - MetaObjectPlay200905.zip (5.17 kb) 
Demo Two Source Code - PythonIntegration200906.zip (5.33 kb)


Posted by kevin on Saturday, June 27, 2009 8:40 AM
Permalink | Comments (2) | Post RSSRSS comment feed

Mixing Static and Dynamic .NET Languages for Philly Code Camp 2008.3

I presented at the Philly Code Camp on 11 October 2008 for a group of about 20 developers. Thanks to all who came out to listen to my presentation. And thanks especially to Don Demsak (donxml) for attending and really helping me to shape the talk. Don added a lot of anecdotal information that I would not have included on my own. It was a very fluid discussion with lots of give and take. When I give this talk again at the Raleigh Code Camp in November 2008, the folks who attend will benefit from what happened in Philly.

The gist of this presentation is that it's possible to mix the Dynamic Language Runtime (DLR) into statically-typed, early-bound languages like C# to make them much more flexible. In this talk, I demonstrated how a ShoppingCart being filled with Products can adjust discount rates based on marketing rules written in an external Domain Specific Language (DSL). In this case, my DSL was really just Python. I chose to use Python because the syntax is so simple and clean. It's so light, it doesn't get in the way. It's not a real DSL, of course, but by injecting .NET objects into a ScriptScope on a ScriptRuntime (all DLR hosting terms), the Python syntax acting on those injected types looks an awful lot like a language for managing product discounts.

The few slides I had and the source code are linked below. For this code, I used IronPython 2.0 Beta 5. You will need to download and install IronPython to compile the code.

MixingStaticAndDynamicDotNETLanguages20081011.pptx (91.66 kb)

MixingStaticAndDynamicDotNetLanguages20081011.zip (16.65 kb)


Posted by kevin on Saturday, October 11, 2008 3:58 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Richmond Code Camp 2008.2 Program Handout

I've been so busy planning for Richmond Code Camp 2008.2 on October 4, 2008 that I've been unable to blog over the past couple of weeks. But, because of what I've been working on, the program handout for the Code Camp is ready now. You can download the Adobe Acrobat file from here:

http://richmondcodecamp.org/RCCDocuments/Richmond+Code+Camp+2008.2+Program+Handout.pdf

If you are coming to Richmond Code Camp, you can download this document and plan out your day by looking at the speaker bios, abstracts and schedule. Keep in mind that we may have to make last minute changes to the schedule but, it's looking pretty solid right now. If you still need to register, you can do so here:

http://www.clicktoattend.com/?id=131306


Posted by kevin on Monday, September 29, 2008 8:44 PM
Permalink | Comments (5) | Post RSSRSS comment feed

Richmond Code Camp 2008.2 Speakers List

Richmond Code Camp 2008.2 Speakers List
October 4, 2008 - Please visit http://www.clicktoattend.com/?id=131306 to register.
Application Development Track



Understanding MVC for ASP.NET Developers 100 Brian Hitney 1AD1

Practical Entity Framework 100 Chris Love 1AD2

Design Patterns: Getting to the Aha! Moment 100 Sixto Saez 1AD3

Graphic Design for Developers 100 Frank LaVigne 1AD4

DotNetNuke: A .NET Open Source Web Application Framework 100 Chris Busse 1AD5

Creating Custom Templatable Controls in Silverlight 200 Page Brooks 2AD1

Building Rich Web Interfaces with ASP.NET MVC and JavaScript 200 Jess Chadwick 2AD2

Developing Peer-to-Peer Applications with WCF 200 Darrell Norton 2AD3

May the Source Stay With You 200 Steve Andrews 2AD4

Going Proxy-less: The Runtime WCF Proxy Factory 300 Daniel Bullington 3AD1
Career and Profession Track



Turn On. Tune In. Quit Your Job 100 James Avery 1CP1

Mentoring; Getting Things Done for Programmers 200 Jonathan Cogley 2CP1
Database and Business Intelligence Track



Bring Me Your Toughest SSIS Questions 100 Andy Leonard 1DB1

SQLCLR: What DBAs and Developers Should Know About .NET in SQL Server 200 Hal Hayes 2DB1

SSIS Frameworks 200 Steve Fibich 2DB2

Make Reporting Services Work For You 300 Jessica Moss 3DB1
Development Methodology Track



Better Source Control with Subversion 1.5 100 Kevin Jones 1DM1

Design Principles 100 Chris Eargle 1DM2

Test Smarter - Patterns and Tools to Make Your Life Easier 200 Al Tenhundfeld 2DM1

Advanced Techniques for Everyday Development 200 Edwin Ames 2DM2
  Test Driven Development with C# and Mocks 200 Jonathan Cogley 2DM3

Of Lists and Lambdas / An Introduction to Functional C# Programming with System.Linq and Mono.Rocks 300 Jonathan Pryor 3DM1
Emerging Languages Track



Fringe Languages and The Benefits to 9-5'ers 100 Amanda Laucher 1EL1

New Features in C# 3.0 100 Chris Eargle 1EL2

Microsoft 'N Ruby Sittin' in a Tree… 200 Justin Etheredge 2EL1

Stupid Python Tricks 200 Kevin Hazzard 2EL2

Approaching Functional Programming with C# 300 Matt Podwysocki 3EL1

Functional Programming, the Hard Stuff 300 Amanda Laucher 3EL2

Unknown Topic 300 Ted Neward 3EL3
Mobile Application Development Track



Extending the Mobile Experience for Your Existing Website 100 Steve Presley 1MA1

Welcome to the World of Windows Mobile Programming 100 Chris Craft 1MA2

Beginning Compact Framework Development 100 John Baird 1MA3

A Closer Look at Windows Mobile - Using SMS and State and Notifications Broker 200 Lou Vega 2MA1

How to Target Smartphone and PocketPC from a Single Application 200 Craig Dahlinger 2MA2
SharePoint Development Track



Create and Deploy an ASP.NET 2.0/3.5 WebPart for WSS 3.0 100 Robin Edwards 1SP1

Creating your own SharePoint Usage Reports 100 Susan Lennon 1SP2

Integrate ASP.NET Forms-Based Authentication with SharePoint 2007 200 Nas Ali 2SP1

Getting Down and Dirty with SharePoint Branding 200 Michael Lotter 2SP2

Categories: Code Camp | Richmond
Posted by kevin on Saturday, September 20, 2008 12:00 PM
Permalink | Comments (2) | Post RSSRSS comment feed

Richmond Code Camp 2008.2 Open for Business

If you follow my blog, you can see that I haven't been blogging much over the past two weeks. OK, I haven't been blogging at all. I switched jobs and I've been spending every spare moment besides getting ready for Richmond Code Camp 2008.2 on October 4th, 2008. The registration page for the code camp is up and running as well as a 15-minute survey of the presentation tracks. The survey is important to us because it will help to determine the probable popularity of each of the 43 presentations that our speakers have prepared. At the new Learning Technology Center at J. Sargeant Reynolds Community College, we have rooms that will hold as few as 15 attendees, some that will hold 50 and an auditorium for the really popular presentations that will hold hundreds of Code Camp attendees.

Please take 15 minutes to fill out the survey if you plan on attending the Code Camp, OK? And make sure you register early. We have a beautiful new venue with a lot more space that we had before but we also have 35 top notch local and regional speakers coming from 9 states to present to us. Invitations are going out soon to the Greater Richmond Technology Council members and to all of the faculty and staff of the local Virginia Community College System. So, if you plan to attend, don't wait to register.

For those of you who've been encouraging me to restart my posts on Exploring the F# Language, I promise that the next installment is on the way. Thanks for your encouragement.


Posted by kevin on Saturday, September 06, 2008 8:00 PM
Permalink | Comments (2) | Post RSSRSS comment feed

On Quitting Your Job by James Avery

James Avery and I spent some time together at CodeStock this past weekend. He told me that he was tired of doing technology presentations. I entirely understand what he means. Education in the developer community is very important but at some point, you just want to switch gears and talk to your peers about other stuff that's important in our space. We're all geeks, that's for sure, but we need to be savvy business people, too. And that requires just as much peer training and influence.

James floated an idea past me for a presentation he would like to do and I liked it a lot. It's not your average Code Camp faire but I asked James if he would travel up from Raleigh on October 4th to present this session to our Richmond attendees. He agreed to come do it. The session is called "Tune In, Turn On and Quit Your Job" and it goes something like this:

Tune In, Turn On and Quit Your Job by James Avery

"We don't have a lot of time on this earth. We weren't meant to spend it this way. Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about mission statements." - From the Movie Office Space (1999)

Stop working for the man and learn about writing a software product, building a successful web application or becoming an independent consultant.

I can hardly wait to attend this talk. I predict a packed house. I hope James keeps going on this vein and writes his next book on this topic.

James is one of many great regional and local speakers who will be presenting in Richmond at the upcoming Code Camp. Want to learn more about the Richmond Code Camp on October 4, 2008? As of August 11, 2008, we still need a few more speakers. Don't miss your chance to show the central Virginia developer community that you want to contribute your ideas, too. Submit your presentation abstract and bio here.


Posted by kevin on Monday, August 11, 2008 5:45 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Josh Carlisle and His Best Friend Fred

Josh Carlisle spoke to the Richmond .NET User Group this evening on Sharepoint Development for ASP.NET Developers. He was carrying what looked like a flask of vodka with him which made me think, "This is a guy I've got to hang out with." It turned out to be Fred Bottled Water. Unfortunately, I didn't get a picture of Josh with Fred, but here are pics of both of them. Doesn't Josh look unusually happy? He swears it was water of "exceptional purity with a high degree of virginality." Yeah, right.

Josh Carlisle speaks to the Richmond .NET User Group on 7 August 2008

Josh's presentation was very good. He was a bit perplexed near the end because of SharePoint's pesky insistence on treating the term MasterPage differently from MasterPages (plural). Pfft! SharePoint is so picky like that. Anyway, we had a good time and Josh was just great. He really knows his stuff. He's welcome back to Richmond at any time. Maybe I could get him up here for Code Camp on October 4, 2008. We got to see Nas Ali, too, who travelled to Richmond with Josh, I think. Always good to see Nas. He confirmed with me that he will be speaking for us at the upcoming Code Camp. Nas is a good speaker and his talks are not to be missed.

Thanks again Josh for coming to Richmond!


Posted by kevin on Thursday, August 07, 2008 9:45 PM
Permalink | Comments (1) | Post RSSRSS comment feed

News Page for the Richmond Code Camp

I've added a permanent news page for the Richmond .NET Code Camp to my site. It has news and information you'll want if you're a .NET developer in the mid-Atlantic region.

http://www.gotnet.biz/Blog/page/Richmond-NET-Code-Camp-News.aspx

Check it out!


Posted by kevin on Tuesday, July 22, 2008 3:25 PM
Permalink | Comments (3) | Post RSSRSS comment feed