April 2007 Entries
Calgary Code Camp 2007
I went to Calgary Code Camp this weekend and thought I would write up a quick review. Justice has a series of live blogs for the sessions he attended. I figure with that much content I don't need to write that much on code camp fashion so I will skip to the technical stuff. Session #1: Building Reliable and Transacted Distributed Applications with WCF - Daniel CarbajalThis was a good session on showing how to take WCF past the basics of a contract & service. He showed how to do reliable messaging, queuing, transactions, and more. I think the talk...
Code Camp Presentation Source Code & Resources
Thank to everyone who came out to see my presentation at Calgary Code Camp. No heads exploded so I think it was a success. Here is the source code and a few references.Source CodeJoyOfReflection.zip (47.6 KB)ResourcesReflectorMSDN OpCodes ListMSDN Reflection.Emit ReferenceHappy Reflecting!
Social Distortion Review
On Tuesday night Social Distortion rocked one of the crappiest venues in Edmonton. Yes Edmonton Event Center, I am talking about you. Seriously how weak is it that instead of changing your name you just take the 'R' off of Reds and call yourself Eds? I don't like the venue for acoustics, layout, and the "too good to be here" attitude of the staff. Social Distortion is one of my favorite bands so it was great to see them for the first time. Formed in 1978 (seriously) they have gone through the death of bandmates, heroin addiction, law troubles (leading to...
Impersonating An Identity Temporarily
I have always had problems with my current app as it has to impersonate a user to consume various different components and databases. Testing components in isolation is tricky with this setup. I did find a handy way to have a test impersonate a user for a test run:
Imports System.Runtime.InteropServices
Imports System.Security.Principal
Public Class
Impersonation
Implements
IDisposable
Dim
impersonationContext As
WindowsImpersonationContext
<DllImport("advapi32.dll",
SetLastError:=True)> _ Shared Function LogonUser(ByVal
principal As String,
ByVal authority As
String, ByVal
password As String,
ByVal logonType As
LogonTypes, ByVal logonProvider As LogonProviders, ByRef
token As IntPtr) As
Boolean End Function
<DllImport("kernel32.dll",
SetLastError:=True)> _ Shared Function CloseHandle(ByVal
handle As IntPtr) As
Boolean End Function
Public Enum LogonTypes Interactive = 2 Network Batch Service NetworkCleartext =...
My biggest COM+ issue solved
I have a com+ component that I have been involved with for years. It lacks tests but I wrote functional tests at the interface level which surprisingly has fairly good coverage of the code. The issue with this is that the component HAS to impersonate an identity for the tests to work properly. So I have a pre/post build condition that installs / uninstall's it from the gac/com+ catalog. My only manual intervention was to set the identity (every freaking time I wanted to run my tests). To help with this issue I installed autohotkey which is a great...
The Testing Vs. Isolation Debate
At the eamug meeting last night it was briefly mentioned about having all methods public for testing (which I totally agree with) but can make consuming a class/api harder to use as everything is public. This is not usually the desired case, especially when building an API. A lot of my applications are re-useable libraries. The way I keep it simple for my consumer is to have all the methods they will need in one namespace or assembly and then all the supporting classes and methods in other namespaces. This keeps things easy to consume and easy to test.
Dear PHP
Dear PHP, We have known each other for about seven years now. We had a lot of good times together. You were my introduction into web based programming and rescued me from that c++ monster I was seeing before. You taught me the ways of the web and your great website documentation and comment system helped me through some tricky times. It is sad that we have grown apart recently, but unfortunately; you just aren't right for me. Lets face it, you lack direction in your life. Your naming conventions are a strange mix of underscores and non-underscores which...
Presenting At Calgary Code Camp
I have the great honor of presenting at Calgary Code Camp this April 28, 2007. Here is the old synopsis: Making Reflection Do Bad Things (So You Don’t Have To). 12:45 PM - 02:00 PM Reflection is an immensely powerful tool that most developers shy away from. This talk will show how to get started using reflection in your applications. From reading and writing private/protected data in an object to creating a dynamic type at runtime this talk shows some of the great uses for reflection. I see that the organizers placed Don and I in the same time spot...
Pulitzer Winning Interview
I recently had the <sarcasm>pleasure</sarcasm> of being interviewed by Mr. Justice Gray. It actually was a lot of fun with some very.... unique questions. The interview can be found here.
Silly Rogers, Traffic Shaping Is For Suckers
Michael Geist posted a great article today on what Rogers is doing to "fight" peer-to-peer sharing. To sum it all up Rogers is analyzing traffic and throttling the bandwidth of what it suspects is p2p traffic. P2P clients have turned around and started encrypting packets to fight this tactic. So Rogers turns around and now throttles all encrypted traffic. The obvious side effect of this is that encrypted email, SSL, vpn, and all sorts of other encrypted traffic is now going to run slower on their network. I am just amazed at this tactic. I don't see why...
Congrats
Congrats to Don on getting an MVP for C#. Its nice to have a good MVP in the city who knows something (or at least how to attend meetings about something).
Developer Essentials
I was thinking of a few things that are essential to be a good programmer. These are not in any order as I think they are all equally valid. 1. Source Control. I don't care if it is vss, svn, or burning a disk everyday (ok well I would fight the disk one but at least it is something. Source control is the only real way to maintain code and if you screw something up it is easy to go back in time. Since I have implemented source control at home for my small projects it has saved...