Cover Letter Fail

I noticed that the resume on my site – this site – is completely out of date. I try to keep it up to date as I work on new projects. It’s so easy to forget the amazing stuff I – and we – do after it’s released to customers or pushed to prod.

That process sent me down quite a rabbit hole and I ended up working on all my “professional” documents. However; I don’t think I got the Cover Letter right. What do you think?

—————————-

I have an extremely diverse background including Linux/BSD administration and Dynamic Languages; before they were in vogue. The past 5+ years I’ve been focused on .NET but recently dove back into Ruby with a small side project privateflock.com. I am waiting on a pending twitter whitelist to see if I can build out the functionality for the public. Right now it serves my needs just fine.

I am looking for a position very similar to my current high profile, high pressure, weight on my back position. However; I am not yet interested to becoming an Architect – I love coding too much.

I have a rather long background for my age; 32. I feel it helps me see the big picture on a daily basis. I have a large amount of tattoos and work daily to provide business value in whatever I am asked to do.

If not for the power going out in our building today I would just be leaving work now, about 7pm EST, with close to 40 hours so far this week….did I mention I love what I do?

I try to play and enjoy life as much as I work; I have two wonderful daughters and – excuse me – the best wife around. I spend almost all non-work free time with them.

——————————

I am not sure this conveys anything except: I can’t spell, I <3 run on sentences and I have no writing prose.

It’s a good thing I get paid to code….maybe.

Wednesday, September 1st, 2010 default No Comments

MongoDB and Timestamp

Here is the syntax for querying a timestamp data type column using MonogoDB.
 
   1:  db.collection.find( 
   2:       { $where : "this.timestamp_column > new Date('2010/08/30')"}
   3:  ).count();

and here is how you can query a timestamp column in MongoDB using a full date (hours, minutes, seconds)

   1:  db.collection.find({ 
   2:         $where : "this.timestamp > new Date('2010/08/30 17:00:00')" }
   3:  ).count();

Tags: ,

Monday, August 30th, 2010 mongo, mongodb No Comments

Checkers – Fluent “Checking” Framework

What:

A “validation” “framework” that, by default convention, does not throw exceptions but instead sets a failed property and builds a list of fail messages.

“Validation”

I took inspiration from the many other server-side validation frameworks.

“Framework”

It’ is just one (fugly) class, < 300 LOC and 70+ tests.

Samples

Take a look at the tests!

http://github.com/detroitpro/Checkers/blob/master/CheckersTests/FluentAPIDesignTests.cs

 check.That(2).IsA(typeof(string)).Or("2 is not a string fail");
Features
  • That – the item to be checked
  • IsNotNull – null check
  • IsGreaterThan, IsGreatherThanOrEqualTo, IsLessThan, IsLessThanOrEqualTo
  • Is – equality checking for int and string
  • IsA – type checking
  • Or – Override default fail message
  • Fail – No more checks if current check fails
  • EpicFail – throw exception
Source

http://github.com/detroitpro/Checkers

Why?

There are so many ways I could answer this question. I’ll just tell you how I thought it would be used.

In a SOA environment where we:

  • Don’t want to use exceptions to control business logic flow.
  • Don’t want to send exceptions over the wire to our UI/Web servers.
  • Don’t want to send exceptions up to our partner API.
  • Need to squeeze performance out of our underpowered servers.

Tags: , , ,

Monday, August 9th, 2010 checkers, fluent 3 Comments

Dirty Sex: SOA Gone Wong?

[Disclaimer: This post had a point. ChannelFactory vs. Proxy vs. Hand Rolled Proxy. That point got lost along the way.]

The “application” that I am working on is more of a platform then a single application. Our solution contains over 150 projects and is organized into what we call, sub-systems. A sub-system is basically a stand-alone application. sub-systems contain web, shared, service, configuration and testing projects. They can be deployed independently and are designed to be one piece in a larger SOA. These sub-systems are broken down into 5 categories of work. Web (MVC/Silverlight/API), Services, Data (Entities/NHibernate), Queuing, and Support.

For the last years worth of development, with the exception of the silverlight clients talking back to the web server via service reference generated proxy classes, we’ve been using a Service Factory/Locator pattern. Currently the development team is considering the merits of this implementation and possible alternatives.

Personally; I really like our current design, it follows the basic tenants of SOA and provides many benefits. The benefits out-weight the drawbacks and the drawbacks SHOULD be easy to overcome.

Cross Sub-System Communication

Every sub-system has a “shared” library project that houses it’s interfaces. This library is designed to hold only items that need to be shared between sub-systems. Service contracts, request and response messages and data contracts are typical items that should be in the “shared” library project in the sub-system.

When SS-A wants to call a service on SS-B, SS-A adds a project reference to the SS-B’s shared project. Next, SS-A uses our ServiceFactory class to locate and/or create the channel and service client. Now SS-A can work with SS-B’s methods as if they were local and without the need for a service reference or generated proxy class.

Screen-shot here.

We use this pattern because we have control of both the client and server code.

  1. Separating the web and app tier.
  2. No need to update ref/proxy when service changed.
  3. Compile time checks.
  4. Testable – Not that we are doing it.
  5. Less code to maintain.

Problems With Current Implementation:

  1. Can’t mock ServiceFactory – I shouldn’t say “can’t”, I just don’t think we’ve tried. Are tests are shit right now anyway.
  2. The Shared project in every sub-system has become a dumping ground for implementations that don’t fit into our current project structure. For example, validators, extensions, repositories, and on and on are in these shared projects.

Shared Sub-System Bloat

At first this does not sound like a very big deal until you start to work with it. Every class added to the shared projects could potentially have a dependency on another sub-system. When this happens the entire platform starts to break down into a spider-web of dependency hell.

No really! This is the fucking problem! When I add a reference to a shared project I, by-proxy, add a reference to up to 40 other projects! The shared project in each sub-system should not have ANY references. It should only contain interfaces and/or contracts.

“The shared project in each sub-system should not have ANY references”

Serving & Consuming SOA

There are 2 main sub-systems that act as the services in our SOA. They reside on our application servers, have access to the database, don’t (shouldn’t) communicate with each other and provide a bulk of the business logic.

The consumers of these sub-systems include a web application, console applications, windows services, silverlight web hosts. These systems use the ServiceFactory class to communicate with the application servers.

F’ing up the program

The silverlight systems have another hop as they have to send the data down to the client. Our original design was to use RIA Services to emulate being on the server and hopefully write less code. However; since we moved to visual studio 2010 and couldn’t get .NET 4.0 on the servers our team decided to remove RIA.

Now we have a situation where the Silverlight clients need communicate back to their web servers. We used “Right Click-> Add Service Reference” to generate the proxy and a service locator to create the client.

Knee-Jerk Reactions

Our dev team, for some crazy reason, is suggesting that having a hand generated service proxy will be easier to mock then one generated via “Add Service Reference”. Also, they are adding “ServiceFactory” like code to the silverlight clients. I don’t know why we can’t use our current implementation by using linked classes in a silverlight class library and more importantly: How this is better in any way?

Proxy Class Fail

I feel that the champions for hand rolled proxies are looking at the problem idiosyncratically. The extra work required to keep the client and server code in sync (for both Silverlight and inside the platform) would FAR out weight the benefit of hand rolling proxies.

I just don’t think they realize the amount of use the ServiceFactory gets throughout the platform.

Testing WCF

I am far from a testing expert but I am pretty damn good at the googles.

  1. http://mokosh.co.uk/post/2009/04/19/prism-2-wpf-and-silverlight-services/ – (we use prism)
  2. http://houseofbilz.com/archives/2008/11/18/testing-wcf-service-apps-part-0-of-4/ – (we use RhinoMock)
  3. http://stackoverflow.com/questions/2509316/best-way-to-mock-wcf-client-proxy – (client proxy)

Governance

SOA is a complex technology theory that can’t be bought. It requires buy-in from a team, developers and someone to watch over the implementation. Every developer thinks they understand SOA, when asked to implement it they create services and then complain that they don’t need SOA.

When I spent Christmas even developing across 4 layers just to get a fucking coupon onto a page. I bitched but I didn’t break the existing convention. I spent endless hours trying to understand how to fit MVC and SOA into the same project. During my development vietnam, SOA was a pain-in-the-ass, but now that we have a “stable” codebase and have 20/20 I can see how SOA will save our ass when the time comes. 

Coup d’état

A bunch of words go here. They aren’t important. Just know that when implementing SOA the development staff will constantly say things like “this would be so much easer if I could call the database”. SOA is not for developers; it’s for the project and the organization (much like TFS).

SOA is not for the developers; it’s for the project and the organization.

Concluding

I think that Silverlight clients should use “Add Service Reference” to generate proxies for a few reasons:

  1. Right click “Update Service Reference” is much easier then keeping client and server code in sync.
  2. We are in pretty rapid development.
  3. We can mock the service.

Silverlight clients could, not for us, not now, use nant to keep the proxies up-to-date.

All service communication from the web to app tier should use the ServiceFactory pattern.

Console applications, windows services don’t use a consistent pattern. We need to resolve that.

Explicitly Covering My Ass

If any of my co-workers happen to read this: I wrote most of the code I’m suggesting needs to be fixed. It’s how I (we) spent my (our) holidays.

I’m just putting some thoughts down so I can understand the situation. I’ve rewrote this a few times when I grasped certain concepts/implementations/reactions/reasons/etc.

I think this sums it up. Now I need to get that one last question answered.

Why check in proxies for sub-systems that we have control over the client and server?

Tags: , ,

Monday, June 14th, 2010 SOA, WCF, silverlight No Comments

Bleeding Edge .NET Notes

Azure WCF development

There is a patch you must install that creates a local “load balancer” that fixes an issue with requests to and from AppFabric services. You’ll also have to update the behavior.

http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues

Azure Initialization

After publishing your services might hang, if they don’t start in around an hour, try stopping and restarting them.

http://blog.toddysm.com/2010/01/windows-azure-deployment-stuck-in-initializing-busy-stopping-why.html

Azure Instances

  • You can’t set the number of running instances for any service to 0. If you do you get a Dr. Watson exception thrown in the Azure UI….Really; Dr. Watson!
  • You can’t have more then 5 web roles, again cryptic Dr. Watson error message

Azure Upgrade

Upgrade means upload new code, when you do this you can’t change the configuration. If you need to add/remove/rename roles you will have to delete and redeploy.

WP7 Service References

You can only have one service reference in the current CTP.

Upgrading WP7 CTP to April

I tried it; following all the correct instructions the application was running but would bomb randomly. Recreating the project from scratch (copy/paste the code) fixed the issue.

WP7 Panorama

By far the best and most stable panorama: http://phone.codeplex.com/

Tags: ,

Tuesday, May 18th, 2010 default No Comments

Silverlight Custom Control Theming

Quick tip:

If you want to put your custom controls in a separate assembly you need to include the layout (generic.xml) in that assembly.

image

Tags:

Wednesday, April 28th, 2010 silverlight No Comments

Spark CodeTemplates

While my solution compiles, 80 projects, I started working on ASP.NET MVC CodeTemplates for Spark View Engine. They are available in my GitHub repo. Feel free to fork and extend!

http://github.com/detroitpro/spark/tree/master/src/CodeTemplates/

Tags:

Thursday, March 18th, 2010 Spark 1 Comment

Developer Questionnaire

Finding talented developers is always a challenge and in the current economic climate many developers are holding off moving to a new position. As such, contract houses are submitting any available candidates for every position. This practice is not only another reason to avoid contracting shops but is rather taxing on the company looking to fill a position.

The man hours spent screening a single applicant can quickly balloon over 8 man hours. My current client recently felt this pain and decided to require the consulting houses to have their candidates fill out a questionnaire. In an environment with many different technologies and developer background experiences coming up with a questionnaire that covers technical, theoretical as well as passion is a daunting task.

Below is one of the recent questionnaires I filled out that I thought balanced technical and theoretical questions well. Some of the details have been redacted. And oh’ Be warned, I have no idea if these answers are correct

What is reflection?
reflection is a way you can interrogate (inspect and/or invoke) objects in a running application.

How do you inherit from a class in C#? (give a code sample)
public class GreatClass:Baseclass {}

When you inherit a protected class-level variable, who is it available to?
The derived class and of course the base class.

Describe each accessibility modifier (public, private, etc).
Public: can be accessed by anyone
Private: can only be accessed from inside the base class
Protected: can be accessed by derived and base class
Internal: like public by also must be in the same assembly
Protected Internal: like private by also must be in the same assembly

How is method overriding different from overloading?
overriding changes the functionality of a base method, overloading creates another method with different inputs/attributes (post in MVC)

What does the keyword virtual mean in the method definition?
virtual methods are methods that the derived class must override.

How can you overload a method?
By changing the type or number of parameters.

What’s the difference between an interface and abstract class?
An abstract class is something that I don’t often use. Really; C# does not support multiple inheritance so we often use interfaces to define our entities and hierarchies. In c# we can inherit from one abstract class and implement multiple interfaces.

What is the default accessibility for a class?
Private

Can you implement multiple interfaces?
Yes

What is a delegate?
The C# version of AddressOf

Code a short and simple delegate example. Code the same sample with a lambda expression.

   1:  public delegate int myCalc(int x, int y);
   2:   
   3:  public class doMath {
   4:      public string Add(int x, int y){ Console.Wr...etc }
   5:      public string Sub(int x, int y){ Console.Wr...etc }
   6:  } 
   7:   
   8:  public static void Main(){
   9:      myCalc adder = new myCalc(doMath.Add);
  10:      adder(1,1);
  11:  } 
  12:   
  13:  public static void Main(){
  14:      myCalc adder = (doMath.Add);
  15:      adder(1,1);
  16:  } 
  17:   
  18:   

Strings are immutable, what does this mean?

The contents will not change once created, methods like toLower will not effect the string, only the output.

Code an enumeration for a status where options are: Queued, In Process, Finished

enum Status { Queued, In Process, Finished };

Can C# have multiple catch blocks?

Sure

What are design patterns?

Examples of how people smarter then me make my job easier.

Describe two design patterns you have used in a project.

Singleton! – Really; it’s was a good use…for a WCF Service to cache database results and serve those results to all web clients.

I’m not sure if MVC counts but It what I miss right now…MVVM is fine for large SL projects and the Flex stuff I am doing…well…as some of the Headspring guys on twitter might now, I’m not happy with it.

What are the most important aspects of an effective software development team?

Communication, planning, direction, understanding the problem domain (++DDD)

What is your experience with test-driven development? What are its limitations? What are its strengths?

I’m a fan and I use it where I’ve been able to convince a project manager that it fits into a project plan. When I have to take over a project without unit tests I feel lost. TDD, like design patterns, are something I love that makes my job easier.

What is your experience with Extreme Programming? What are its limitations? What are its strengths?

Not enough; the last 3 years I’ve been stuck in a big-design-up-front, not even waterfall, we spent a year on documents. 5 people, 1 year. sick. I was in a XP environment in 2001-2003.

Will this code compile? What will be its output?

Sample code was provided.

Write the PRECISE output of this code as it would appear in the console.

Sample code was provided

Tags: , ,

Thursday, March 18th, 2010 career, personal, technology No Comments

ASP.NET MVC Spark Support

ASP.NET MVC 2 supports Spark!

What? hear me out. The release of ASP.NET MVC 2 includes an amazing hidden gem. You see the “Add View/Controller” dialog now takes into account a T4 directive “output extension”.

Getting started with Custom CodeTemplates

To get started with Custom CodeTemplates check out this excellent article by K. Scott Allen

Getting started with Custom CodeTemplates and Spark

  1. At the top of your templates add the output extension as shown below.
  2. Modify the template to use spark.

image

Tags: ,

Thursday, March 11th, 2010 ASP.NET MVC, Spark No Comments

Spark View Engine 1.1

ASP.NET MVC 2 was RTM’ed today and with the help of Jay Harris@jayharris we upgraded our rather large codebase to not only ASP.NET MVC 2 RTM but also a new drop of the Spark View Engine built against the RTM.

Since the release of Spark View Engine 1.1 RC a few weeks ago there have been some minor bugs/enhancements identified but no blockers. The update to RTM was nothing more then changing the assembly reference, build number and running the build script.

These changes are not yet reflected in on the GitHub source. I’m sure there will be a pull request or Lou@loudej will update master pretty quickly.

Head over to CodePlex to download the new release and of course thanks to Lou for building an amazing tool.

Tags: ,

Thursday, March 11th, 2010 ASP.NET MVC, Spark No Comments

Search