Archives
-
And SRT Grows by One!
Great news! MVVM-Guru Brian Genisio is joining SRT in February! I first met Brian in-person at CodeMash last year. In fact, he was the one that convinced me to get on Twitter. Since then, I've been reading his blog and trying to catch his presentations at local user groups. He'll be giving his great MVVM talk at CodeMash in January.
-
CodeMash REST Endpoints Updated
You spoke, we listened. We've got updates to the CodeMash REST endpoints!
-
Use Dependency Injection To Simplify Application Settings
We've all seen and written code that accesses data from our app.config or web.config file. We'll throw some simple settings in there:
-
CodeMash 2.0.1.0 REST Interfaces
This year's CodeMash website has two URI's that expose CodeMash Information:
-
Using Windsor to inject dependencies into ASP.NET MVC ActionFilters
I'm using Windsor as my IoC container for an ASP.NET MVC application. To get dependency injection in my controllers, I'm using a slightly modified WindsorControllerFactory from Andre Loker's post earlier this year. It works great and allows me to easily test my controllers.
-
Extension Properties
A couple of weeks ago, a post I made about Strongly Typed Session Variables in ASP.NET led to some interesting comments and discussion. One of the comments asked "Why can't we just have extension properties…?". Now, Eric Lippert has provided the answer. See his "Why No Extension Properties?" post to read about the decisions that go into adding (or not adding) a language feature.
-
This isn't an error?
I just saw something odd in a diff before a check-in. Basically, I had a trailing comma in an object initializer:
-
Unit Tests and Debug.Assert()
I recently found some code that had a couple of issues:
-
LINQ and Homework
My daughter asked me to check her homework today. One of the math problems was:
-
SRT's Bill Wagner wins "Emerging Leader of the Year" Award from Automation Alley
Last night, SRT vice president and co-founder Bill Wagner received the "Emerging Leader of the Year Award" from Automation Alley. This annual event is Southeast Michigan’s most prestigious, competitive honors for technology organizations and their leaders. As an employee of SRT solutions, this comes as no surprise to me. Bill's continuous emphasis on new technologies is an everyday occurrence. Whether he's speaking at User Groups (or running them!), updating Effective C# for .NET 4.0 or working on tough technology problems with clients, Bill is always the go-to guy with the answers.
-
Strongly Typed Session Variables in ASP.NET MVC
This post was originally going to be a comment on Jarret@Work's blog post about "Using Extension Methods for Session Values", but I decided to make a full blog post out of it. Jarret employed extension methods such Bar()/SetBar() and Foo()/SetFoo() to have strongly-typed session data. While his method certainly works, I've taken a different approach that I think is a bit more flexible and reads better.
-
Handy Extension Methods for ASP.NET MVC's UrlHelper
Mickael Chambaud posted three extension methods he created for UrlHelper: Image(), Stylesheet() and Script(). They make it pretty easy to keep your images, stylesheets and scripts organized in a single location – without the need for you to remember where they are placed. And if you need to move things around for some reason, you only have to change the extension methods.
-
Enabling Windsor Integration in MonoRail
I recently wanted to take on old MonoRail application and update it to use Windsor for dependency injection (DI). The application stated as a sort of prototype and slowing grew into a decent sized application. There's a couple of places that I want to add some unit tests and I could really benefit from DI. So I sat down to hook Windsor into the application.
-
ASP.NET MVC + MVC Contrib + Unit Testing
One of the key benefits of the MVC (Model View Controller) pattern is a separation of concerns that leads to better testability. Microsoft recognizes this and will automatically create a separate MS Test project when creating a new ASP.NET MVC solution. While this gives you a nice head start, there's room for improvement. While actions in the MVC pattern are simply methods on a class that can easily be called by MSTest (or any unit testing framework), most web applications have interactions with supporting objects such a Request (query string, form parameters, etc…), Response (cookies, content type, headers, etc…), Session, and more. In a live environment, these objects come as a result of the HTTP request being processed by IIS. In a test environment, you're isolating just your controllers and actions and you don't have IIS and an entire HTTP pipeline.
-
Know Your Environment!
This is probably one of the most embarrassing things I've admitted to in public (well, maybe not – but close). I really had to think about whether I wanted to post this. The mentor in me said "You need to post this. Others may run into this situation and this will help them." But the rest of me was saying "You can't admit to that!" The mentor in me won out and I'm posting this in the hopes it may save someone else a few hours of headaches.
-
Lansing Day of .NET 2009
Last Saturday (August 1st) was Lansing's Day of .NET. The guys organizing this did a great job and I had a really fun time. I gave my "Intro to ASP.NET MVC" presentation. I got some great questions during the presentations as well as good feedback. I did have a few questions that I wanted to follow up on:
-
LINQ2SQL: SubmitChanges() doesn't do anything?
Dear Linq2SQL,
-
Ann Arbor Give Camp 2009
I've almost recuperated from last weekend's Ann Arbor Give Camp. Almost…
-
One More Week Until Give Camp 2009
To-do lists are being checked off and the final bits of organizing are almost complete for this year's Ann Arbor Give Camp. For those attending (you did register, didn't you?), we've got our schedule posted along with a nice Q&A section that should answer most of your questions on the logistics of the event. If something isn't answered, let me know and I'll get you an answer.
-
Comparing Two Arrays
I was looking at some old code today that was checking if two byte arrays had the same data in them. It was a simple loop that compared each element. I recalled my blog post from November of last year about comparing collections/arrays in MSTest and thought, "I wonder if LINQ has something similar"?
-
LINQ: Quickly Create Dictionaries with ToDictionary
Donn Felker recently blogged about a neat little extension method in LINQ called Any(). If you simply want to know if a sequence contains any elements, many people use ".Count() > 0" which will walk the entire sequence to compute the count whereas .Any() will stop walking as soon as it finds a single element. Easy and much more efficient.
-
SRT Presents Software Stimulus Lab to Support Economic, Business Growth
I've been so busy recently I totally forgot to blog about this. We (SRT) are going to be hosting a Software Stimulus Lab at Automation Alley next Monday, June 15th. We've got a press release that covers the details better than I can but the important things are:
-
ActiveRecord: Loading Records by Primary Key
I was reviewing some code today for a project that uses ActiveRecord. One of the things that stood out for me was the use of a query to find objects by their primary key. There's two reasons this raised a red flag for me:
-
NHibernate Queries: HQL vs. Criteria API
As someone who did a lot of SQL a few years ago, I was immediately more comfortable using HQL for my ActiveRecord queries than the Criteria API. But from a documentation/samples standpoint, I see a much higher percentage of the Criteria API being used vs. HQL. I still use HQL most of the time.
-
Ajax Survey
From BradA: Simone Chiaretta is doing another Ajax survey to see how things have changed since his last survey a couple of years ago. I just filled it out (you should too!). The survey can be found here.
-
Fabulous Adventures In Coding
If you don't read Eric Lippert's Fabulous Adventures In Coding, you're really missing out on some great stuff.
-
XmlSerializer ignores Culture
I'm working with an automotive client that has a couple of data formats for some of their files. One is a simple CSV format and the other is XML using .NET's XML Serializer (nothing fancy). The CSV format is handy as it's easy for the engineers to quickly load it into Excel and view in a columnar format. The XML format was implemented as a much more "full featured" version of the data and contains additional metadata to describe the data. All of the maintenance of these files is very easy as we have a library for dealing with them.
-
OutputDebugStringAppender in a web app?
I spent a couple of hours yesterday trying to get log4net to log to an OutputDebugStringAppender with no success. At first, I thought I had a configuration error in log4net so I added a file appender and that works fine. It's a Monorail application that uses ActiveRecord for database access. There's a couple of spots where I wanted to check out the SQL being generated by ActiveRecord (NHibernate). I did all my set up for log4net and even got it logging to a FileAppender. But I wanted to log the SQL to an OutputDebugStringAppender.
-
New CodeMash Website
As you've probably heard (via Twitter), there's a new look to the CodeMash website. SRT Solutions and inner circle media have been working on the website for a while now getting things organized. Much of the praise for the new look goes to inner circle media – Catherine Hayes and Alaine Karoleff have put a lot of thought and design into the new site and it shows!
-
Be careful where you place your images on your website
Just found something interesting while researching a problem Dianne was having with a website SRT was working on. In checking various browsers throughout the office (FireFox, IE, Opera), a page looked ok on most of the browsers, but not all. In fact, there were just a couple of machines running Firefox that had problems (others, running the same version of Firefox had no problem viewing the page correctly).
-
Lansing GiveCamp a great success!
Congratulations to Jay Harris, Jeff McWherter and all those involved in making Lansing GiveCamp a great success! GiveCamps are a lot of work to organize but they are so fun and rewarding. The press is picking up on their hard work too:
-
Customizing Send To in Vista
Ok, I admit it, I'm coming late to the game in terms of Vista. I never played with any of the betas when they first came out. And when it was finally released to some rather unflattering press, I smiled in content as I continued to move forward with Windows XP. I finally moved to Vista back in November of last year when I got a new laptop. With a core 2 duo CPU and 4gb of RAM, Vista has been running pretty good for me. There's still the occasional hiccup that frustrates me and I'm really looking forward to Windows 7 – but for now, Vista works fine.
-
ASP.NET MVC and Resolving Controllers with Windsor
Last week, while working on an ASP.NET MVC app, I wanted to plug in Windsor and use IoC to resolve my controllers. A couple of Google searches and I came across Andre Loker's blog where he describes step-by-step how to achieve this – and it was just about a week ago! What timing!
-
ReSharper: Access to modified closure
On the advice of Jay Wren, I decided to try our ReSharper 4.1. I had previously installed DevExpress' CodeRush and Refactor Pro. CodeRush was uninstalled in less than a week. There was nothing technically wrong with the product – it's a great product. It just didn't "jive" with the way I typed. There was too much "un-learning" that would need to be done on my part to really show CodeRush's power. The Refactorings rocked and I loved the graphical indicators it used while refactoring.
-
Free Microsoft Events
Microsoft is planning a full-day of free presentations at it's Southfield, Michigan office on March 31st.
-
The Essence of Open Source
While doing catch-up reading on the Rhino.Mocks group on Google, I came across this thread about a problem someone was having with Rhino.Mocks. What I thought was cool was the responsiveness of Ayende (the creator of Rhino.Mocks). And I'm not singling him out (I hear he hates being put on a pedestal), but I'm highlighting the generic responsiveness that you are more likely to get with an open source project. Here's a breakdown of the timeline:
-
Getting Func-y with Lambdas
Let's say we've got some information stored somewhere (database, XML, file – it doesn't matter) about individuals. For simplicity, let's look at a class that represents this data:
-
SRT: "Best of Best of Michigan Award"
Right now, SRT co-founders Bill Wagner and Dianne Marsh are in Troy at an awards breakfast. SRT (along with a bunch of other companies) has received Corp! Magazine's "Best of the Best Michigan Business" award.
-
ASP.NET MVC Goodness!
Last week at AADND, I gave a presentation on MonoRail, the Castle Project's MVC implementation on ASP.NET. The MVC pattern is so popular (and productive!) among web developers, I'm sure you're aware that Microsoft is working on ASP.NET MVC – which is now up to RC1.
-
Silverlight: Checking Checkboxes
I was playing around with Silverlight a little bit today and noticed something with the Checkbox UI element. It has both a "Checked" and "Unchecked" event. These obviously correspond to when the checkbox becomes checked or unchecked. This is in contrast to the WinForms checkbox which simply has a CheckChanged event. Interesting…
-
LINQ: Grabbing a single element
Since I've seen code like this before and am also guilty of writing code like this, I thought I'd blog about an easier way to grab a single element from a LINQ query that Bill Wagner told me about at last night's AADND meeting.
-
Jay Harris: Macro Sleuth
Jay Harris came to speak at GANG last month (great CI talk, by the way!). After plugging in his laptop to the projector he glanced at the screen – he was checking if the font size was okay. Seemingly not pleased, I saw him tap a few keys on the keyboard and the font just grew! It was like zoom-in/zoom-out in Firefox. He didn't mess around deep inside menus – just a couple of keystrokes and the font was bigger!
-
Properties vs. Attributes
One of my favorite bloggers, Eric Lippert, has a great post on the "properties vs. attributes" question.
-
Extension Method Guidelines
I'm spending some time this morning getting caught up on RSS reading. A great post from last week from Brad Abrams on when you should use extension methods – i.e. when they are a good choice. As Brad Abrams points out: "While this a very powerful new feature, it does come with some new responsibility."
-
CodeMash 2009
I know it's been over a week since it ended, but I'm finally taking time to get my review up.
-
MonoRail Integrations
Andy Pike has recently done some really cool MonoRail integrations:
-
CodeMash: Ruby 101
At today's CodeMash Precompiler I decided to check out "Ruby 101" with Jim Weirich and Joe O'Brien. I've caught a few glimpses of Ruby code over the years but have never sat down to actually do anything with it. Since CodeMash is all about stepping out of your comfort zone and learning new things, I thought this would be a good session to attend.
-
Come see "Paint Wars" at CodeMash!
Fellow SRT employee Chris Marinos will be showing off his wii-mote controlled "Paint Wars" game built on the XNA framework at our booth at CodeMash this week.
-
Thank You Microsoft (2009)!
One year ago today I thanked Microsoft for recognizing my contributions to the community by awarding me the MVP award.