newtelligence poweredRSS 2.0
# Monday, January 26, 2009

Last week, I registered for my first Triathlon, the Capital View Triathlon, held here in Madison, WI. I will be competing at the Olympic distance, which is a 1500m swim, 24.85 mile bike, and 6.2 mile run. I’ve been spending about 6-7 hours per week getting ready to start my 2009 annual training plan (which I still have to finish creating). Following the guidance of “The Triathlete’s Training Bible” by Joe Friel, I’m looking at some weeks requiring 14 hours of training, or double what I’m used to. I don’t know if I’ll be able to fit in all that training, but we’ll see how it goes. I would like to start doing some workout before work, but waking up before 6am does not seem like fun, although I better get used to it, as I can’t just wake up at 5:45am on race day after months of waking up closer to 7.

I’ve been pretty happy with the stats in the various disciplines. I’ve had a couple of spinning sessions were I have had 255 watts over 40 minutes, and I’ve been averaging 8.6 mph (7:00 minute mile) over 30 minutes running. I’ve recently begun altering my running style/technique in an effort to increase my cadence (number of times my foot strikes the ground). So far that has been going pretty well, I’m able to keep a higher cadence without counting all the time, although on my last run I brought a metronome, and realized I have a lot more work to do in keeping that cadence where I want it (180-190 foot strikes/minute).

I’ve been getting to the pool once or twice a week for about an hour each time. I’m still a complete novice when it comes to swimming, so after doing 1500m in my first couple of workouts just to make sure I could go the distance (note: just swimming 1500m in a pool, grabing the wall each time and getting that extra breath does not equate to 1500m in the open water), I’ve been trying to work more on technique. I think I’m making some good progress on this front. Today after my drill set which consisted of 1350m, I swam another 250m in 4:51, which is a new personal best for me. It’s sad comparing my times to those of actual swimmers, who are almost twice as fast as I am. Oh well, gives me something to shoot for.

I’m creating my shopping list for the event in June:

  • New Bike Helmet (my current helmet was a fairly cheap one, and is almost 6 years old. Looking for something a littler lighter and comfortable)
  • Sun Glasses (My current el-cheapo pair won’t stay on while running unless I have a head band on, and all scratched up)
  • Wet Suit Rental
  • Power Meter (the stationary bike I use has one built in, and I’ve really gotten use to using it.)
  • New Heart Rate Monitor
  • Bike Fit (I switched cleats and pulled my seat off to use the stationary bike, so I need to get everything set back up once spring comes along).
  • New Bike Seat
  • Aero Bars (Maybe)
  • Areo Wheels Rental (Maybe)

I recently ordered some training gear for swimming, including some freestyle stroke/pull things (yeah, not sure how to describe them), freestyle snorkel, underwater metronome (help work on stroke count). The coolest thing in my order, a large, underwater stopwatch/lap counter. As a techie, my motivation for training usually involves gadgetry of some sort. Speaking of gadgets, my list above lists a power meter and new heart rate monitor. Not sure what I’ll get, as I don’t have an unlimited budget, and would like something that will work on the bike and run portions. I’ve been thinking about the iBike Pro wireless with a Garmin Edge 305 or 405, as it should all work together. However, people have been giving mixed reviews on the Garmin stuff. The other option are two completely different systems, one for the Bike and one for the run.

That’s all for now. I’ll try to post some reviews of the gear as I get it.

Monday, January 26, 2009 4:16:08 AM (GMT Standard Time, UTC+00:00)  #    Comments [4] -
Fitness
# Saturday, January 24, 2009

While looking for a fix to my TestDriven.Net problem (couldn’t get it to run all Xunit tests in a class or assembly), I came across an open question on Stack Overflow from a developer having the same problem. For some reason I felt compelled to answer this question once I found the answer. After a bit of searching and registry browsing, I found out that I needed to move a registry key from the Wow6432node to the “regular” section of the registry.

So back to Stack Overflow I went to answer. This being the first time I’ve answered anything on there, I figured I should sign up so I get “credit” for my one whole answer. While I have a couple of accounts from other places that support open ID, I felt that claiming my blog URL would be the techie thing to do.

I picked Claim Id from a list of open id providers because I thought Scott Hanselman recommended it, but couldn’t remember for sure, but it looked ok. Sign up was easy, and they even provided instructions for claiming my blog URL, including the HTML code, complete with my username. If you view the source of my blog page, you will see the following two lines in the <Head> section.

<link rel="openid.server" href="http://openid.claimid.com/server" />
<link rel="openid.delegate" href="http://openid.claimid.com/asalvo" />

In DasBlog, I added these to lines to the homeTemplate.blogtemplate file for my current theme. This is also where I placed the code to enable Google Analytics awhile back. Speaking of Google, I came across their Ajax API which I talked about briefly, and though as long as I’m in here editing for openId, might as well try adding the search functionality.

At this point it’s close to 2am, and I started this around 10:30pm. The whole ajax google search turned into a real chore to get working even close to the way I would like it. However, since I invested all this time into it, I felt like leaving it as is for now. There are some CSS entries needed to get the results to show up where they do on my page, so if you want, take a look at my CSS file as well (the relevant stuff is at the top under center column stuff).

I’d like to revisit this post when I update my theme, hopefully in the near future.

 

Final Script located in the head section (feel free to view source on this page as well)

<script src=”http://www.google.com/jsapi?key=YourKey” type="text/javascript"></script>  

google.load('search', '1.0');

    function OnLoad() {
      var controlRoot = document.getElementById("searchControl");

      // create the search control
      coreSearch = new GSearchControl();
      coreSearch.setLinkTarget(GSearch.LINK_TARGET_SELF);
      coreSearch.setResultSetSize(GSearch.LARGE_RESULTSET);

       // prep for decoupled search form
      var searchFormElement = document.getElementById("searchform");
      var drawOptions = new GdrawOptions();
      drawOptions.setSearchFormRoot(searchFormElement);
      drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);

      // populate - web, this blog, all blogs
      var searcher = new GwebSearch();
      searcher.setSiteRestriction("http://blog.salvoz.com/");
      searcher.setUserDefinedLabel("Salvoz Blog");
      coreSearch.addSearcher(searcher);
      searcher = new GwebSearch();
      searcher.setUserDefinedLabel("The Web");
      coreSearch.addSearcher(searcher);

      coreSearch.draw(controlRoot, drawOptions);
    }
    function doCoreSearch(q) {
      coreSearch.execute(q);
    }
    google.setOnLoadCallback(OnLoad, true);

    </script>

Saturday, January 24, 2009 7:52:43 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General | Technology

Like a lot of developers, I am an early adopter, and as such I downloaded and installed Windows 7 beta (blog post forthcoming) on a variety of my computers and created new VM’s. I decided to try to switch over to a Windows 7 beta dev machine at home, to see if there are any gotchas. So far there is nothing related to Windows 7, but getting VS to work fully with my projects stored on a network share took some additional time.

Apparently I completely forgot I had to set Code Access Security on my original development machine, and even after I remember vaguely doing it, I don’t remember what I did. Going back and looking at the settings via mscorcfg.msc, it looks like I just granted the local intranet full trust. This time around I wanted to just grant the full trust permission set to my projects folder on my network share. Not that I don’t trust my local intranet, it just seems like the correct thing to do.

First I tried messing around with the command like tool, caspol, but my command line skills just were not cutting it. I looked for mscorcfg, but it’s no longer installed with Visual Studio (2008), so I downloaded and installed the latest .net SDK. I figure there are some other good tools in it any way. With access to mscorcfg, I set out to grant my user share, U:\Projects full trust permissions.

I figured out that I needed to add a new code group, but I didn’t know under which zone. Reviewing the error in Visual Studio, it referenced both My Computer and Local Intranet. I decided to try My Computer first, and that didn’t work, so I created a second code group under Local Intranet and that did work. I didn’t want to leave extra stuff around, so I removed the code group from My Computer and everything still worked.

Here are the steps I took:

  1. Open mscorcfg (as an administrator if you want to modify the CAS at the machine level)
  2. Under Runtime Security Policy, expand the Enterprise, Machine, or User, and then under Code Groups drill down to the Local Intranet Zone
  3. Right click on Local Intranet Zone and choose new
    1. Ender a name and description for your code group and click next
    2. For the condition condition, change it to URL.
    3. This is the tricky part, entering a correct URL. The path I wanted to add, as shown in windows explorer is U:\Projects, but the error message in VS showed file:///U:/Projects/, so I used that as the URL and added a * at the end, so I ended up with file:///U:/Projects/*. Click Next.
  4. Select Full Trust, and click next
  5. Click finish

You need to restart Visual Studio after you make a change. While looking for some help on the Internet, I also saw that you can use mscorcfg to create a MSI installer package with your CAS settings, which you can run on other machines, or deploy via group policy. This option is available as “Create Deployment Package” when you left click and select Runtime Security Policy.

Saturday, January 24, 2009 4:12:53 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Programming
# Friday, January 23, 2009

Earlier this week, I had a request to write a query, which required comparing one row to the row that followed. While I had something like this before using sub queries with MIN/MAX, I just didn’t have the time to hack thru it. Today, I got an e-mail from SQL Server Central (.com) from their mailing list, and one of the featured articles was “Linking to the previous row”. This sounded like what I needed for my query, so I decided to check it out.

The opening of the article describes my situation exactly, and by using the method described, I was able to write my query in a couple of minutes using CTE’s and the Rownumber function. I highly recommend the article.

Friday, January 23, 2009 10:33:59 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Sql

This is the third and final part to my write up on MDC Chicago 2009.

VSTS 2010

The VSTS 2010 presentation was done by Angela Binkowski, the Midwest evangelist for platform tools. In terms of the quality of speakers, Angela was the best, and one of the better speakers I have seen overall. She is knowledgeable, enthusiastic, and seems to really like what she does, which helps break up the monotony of power point presentations.

The presentation of VSTS 2010 focused on two areas, Testing and Architecture. Based on what I saw, I am really glad I have VSTS Suite so I can get my hands on these new tools when they come out (the current CTP seemed a little buggy, so I’ll probably wait for a more stable release).

TFS - UI: Rich text box control for the history window in TFS. I know there are allot more new features in the 2010 version then just this, but this was pretty much the only one called out. I know Buck Hodges posts stuff regularly to his blog about TFS and new features.

TFS – Builds: Adding support so that you can use Windows Workflow in your builds.

Test Impact Tool: Uses code coverage to indicate which tests you should run in order to validate a change. Since it uses code coverage, it shouldn’t matter if you use MSTest or another testing framework.

While it sounds like a good feature, I don’t see the need for it if you properly write (and break up) your unit tests. One of the core principles behind unit tests, is that they should be written to execute fast so that developers will take the time to run them all. Even if you take a step back to widen the scope to include integration and regression testing, you are “supposed” to run all the tests before you do a check-in.

Gated Check-in: Allows you to run your continuous integration tests before the source code is committed to the source control repository. Since this is a resource intense task, it was suggested that you should only enable this when you are getting close to a release milestone to make sure a bug doesn’t get into your repository.

Functional UI testing: Full support for testing Web pages and Windows Forms applications. By full support, I mean that your test will invoke the controls in the web browser or windows forms app, and not just simulate it (i.e. creating a HTTP request like MS WebTest does today). On the web side, this can be compared to WatiN, Watir, etc. A GUI is provided that helps you record your tests. The example showed tests being created in MSTest (no surprise there), but hopefully there is extensibility built-in to allow for other testing frameworks to be used.

I’ve used the WebTest tool in MSTest, and it works pretty well for getting something setup quickly. I think it works better for load testing, then functional testing, although I haven’t played around with the generated code, which may provide better support for functional testing.

I just started using WatiN, and it will be the standard to which I compare the web test version of this new tool to. I don’t have a windows forms testing tool, and really haven’t seen any free ones out there, so the MSTest version will be a definite addition to my toolbox.

Test reproduction tool (Camano): This is a new tool targeted at testers who follow manual test plans. A set of controls, along with the test script is displayed on the left side of the screen, while the application being tested is displayed on the right. I couldn’t tell if this was all in one window, or if the application runs normally and the test tool attaches to it.

So what does the tool do? It records every action taken to a timeline, and records what the user sees to video. The tool also records the testers system settings, and in the event of an exception, a historical debug trace is captured and attached to the test run. All of this information is then seamlessly transferred to TFS and stored as a new bug work item. The tool is not part of Visual Studio, so testers don’t have to install VS, just the testing tool.

I have been told that the tool doesn’t required TFS, and that it should be possible to package up all of the information that would normally be attached to a work item in TFS, and send it manually to a developer (for those shops that don’t use TFS). I’m not sure on what the licensing for just the testing tool will be.

Architecture – Diagrams: Visualize dependencies by namespace, and reverse engineer sequence diagrams from code were the two diagrams shown. I’ve seem the visual dependencies in nDepened, but it’s nice to see it in VSTS. The reverse engineering of code to create a sequence diagram looked really slick, and I can’t wait to use it. Both additional should help address the problem of stale documentation, as well as helping to get developers new to a project up to speed.

Architecture – Validation: There was some type of validation in the architecture edition before, but it was at a very high level. I tried it out once, and it just didn’t click for me. The validation feature introduces in 2010, allows you to create a more traditional architecture diagram composed of your various layers (UI, Business Domain, DAL, Infrastructure etc), define allowed relationships, and then drag and drop your classes onto the different layers. VS will then make sure that classes do not make calls to other classes unless they are allowed to (for example, your UI can’t use the DAL directly).

As with the new visual dependency and sequence diagrams, this is something that I think will be useful, especially for when you bring new members onto a team. It too also addresses the issue of stale documentation, as it will need to be updated in order for your solution to build.

While you need Architecture edition or Team suite to edit the files, they are supposed to be available in a read-only mode to any other version of Visual Studio. The validation is also supposed to work across all versions.

Dotfuscator: At the end Angela turned the presentation over to someone from the company that creates Dotfuscator, which has been included with VS since it’s initial release in 2001 I believe. The guy walked, talked and acted like a salesman, but at least he knew his product.

The three features talked about was the ability to add instrumentation, anti-piracy, and centralized logging to your application. All of the work that dotfuscator does, happens after your application is compiled. The Dotfuscator tool inspects the IL and lets you select, down to the method level, where you want to add the instrumentation, logging etc.

The instrumentation feature includes items such as what features are your customers actually using (by injecting a call into a entry method that defines your feature), how many people are using trial versions of your software, etc.

The anti-piracy is a special type of instrumentation that is supposed to alert you if someone tampers with your software. My thought is, if someone hacks your software, wouldn’t they be able to hack the dotfucscator code as well?

So how do you get all this information? The third feature was the centralized logging feature, that allows you send all this data back to your company via the Internet. Of course this brings up huge privacy concerns. It was suggested that could add a opt-in screen for more general purpose metrics, but what about the anti-piracy functionality? Would you actually give someone the option to opt-in to the anti-piracy feature, and who would actually opt-in? Even as a software developer, I take issue with software that reports what I am doing without my consent, even if I was “pirating” the software. Software companies do no own my PC, nor do they pay for my Internet connection.

Asp.Net Futures

The final session of the day was on Asp.Net futures, and showed stuff for both Asp.Net web forms and Asp.Net MVC. Most of the material on Asp.Net MVC was stuff I was already familiar with given my recent deep dive into it.

Asp.Net 4.0 focuses on 4 themes:

  • Better support for standards (HTML, CSS, etc)
  • Easy to create LOB and extend data driven web sites
  • Support pattern based development (MVC, TDD)
  • Re-invest in the core, address top customer pain points (new caching interface)

The new features in web forms talked about were:

  • Generate client ids (should make scripting and testing easier)
  • Transparent support for CSS (default to CSS instead of tables)
  • URL Routing (Already available in Asp.Net 3.5 SP1)
  • View State
    • Ability to disable view state on the page, but enable it on a specific control
    • Ability to disable view state on a control, but enable it on a sub control
    • Better support for no view state on grid/list view

There was a pretty nice demo showing off Asp.Net MVC and Asp.Net Dynamic Data. Dynamic Data is a recent addition to asp.net that allows you to quickly generate CRUD functionality on your web site, and have it updated as your data (schema) is updated. The view is all controlled by templates so you can arrange the controls created however you want. I’m still missing the a-ha moment with the dynamic data stuff, and need to sit down and play around with it.

All in all, I really enjoyed the trip down to Chicago for MDC. I hope that Microsoft continues to offer these one day local events after each of the three major conferences. Ideally, I would like to see them happen a little sooner after the conferences, as they are really targeted towards those who didn’t go to major conferences. I would also like to suggest that the goody bag contain a DVD with all of the major conference presentations.

Friday, January 23, 2009 4:12:32 AM (GMT Standard Time, UTC+00:00)  #    Comments [2] -
Technology

This is my second, in a three part series on MDC Chicago 2009.

Azure Services Platform

I  ended up going to the first two Azure sessions. I had intended on only going to the overview and then skipping to Oslo, but after watching the overview, I wanted to see what was involved in deploying an application to Azure.

Azure is short for the Azure Services Platform, and consists of Windows Azure, .Net Services, SQL Services and Live Services (I have also seen slides that show SharePoint Services and Dynamics Services). Microsoft is attempting to build a flexible services platform allowing for the ability to easily scale out (assuming you don't code poorly), which is based on Internet standards such as Http, ReST, etc.

It is easy to get the platform (Azure Services) and Windows Azure confused, so I will try to stick to the convention of calling out Windows Azure, with just Azure referring to the entire platform.

You can use all of the same tools that you do now, like Visual Studio and Asp.Net, but they are also going to allow for interoperability with Java, Ruby, and PHP to name a few. The move to the cloud is viewed as an evolutionary step, not a revolutionary change. A simple analogy can be made between the desktop operating system and how it abstracts the hardware and low level operations, and Azure abstracting the data center and infrastructure.

Windows Azure

The Windows Azure portion of the platform is divided between applications and storage. The storage abstractions currently provided are:

  • Large pieces of data - Blobs (file streams in a future release)
  • Service State - Simple non relation tables, (caches in a future release)
  • Service Communication - Queues (locks in a future release)

It is important to note that the storage providers in Azure do not make up a relational database. Advanced data storage is provided by another part of the platform, SQL Server Data Services. The storage can be accessed from your Windows Azure applications, as well as from anywhere on the Internet using ReST.t

On the application side, there are two roles defined, web and worker, with each role configurable to run as 1 or more instances which allow for scaling. The easiest way to describe the roles is that the web role is your asp.net application, and the worker role is a background process or service.

The demo showed an Asp.net application being created and deployed, but I didn't see anything that would prevent a Asp.Net MVC, or WCF application from being deployed (although a wcf application might be better suited for .Net Services) but don't quote me on that. The demo also showed work being passed from the web role to the worker role by way of a queue. Again, the queue could also be accessed via the ReST interface from your on-premise applications.

Code that runs in the worker role is isolated from the outside world, in that you can not control it from the code running in the web role, or from a location outside Azure. However, given the description in the presentation, it should be able to initiative an outbound connection. The worker role code should be used for used long running processes, like a credit card authorization service.

.Net Services

.Net Services consists of three parts, a message bus, access control and workflow. This enables you to begin taking advantage of the Azure platform by moving some of your existing components to the cloud, while your other components remain in your current data center (on-premise).

The message bus allows for firewall friendly communication between you and your business partners. All communication starts out in relay mode, which routes traffic thru the message bus. In the background, your application with the help of the message bus is attempting to establish a direct connection, and if it is successful, the relay connection will be dropped in favor of the direct connection. Services are published to a service registry and exposed via an RSS feed for discovery and subscription.

The access control piece provides for centralized authentication and authorization. Currently, Card Space, Windows Live, and Username/Password are supported authentication providers. When a client logs in, they are authenticated and then provided with a saml token that identifies what access they have. This token is then provided by the client in the request to your services. There is a web interface for you to manage users and their permissions. 

Finally there is the workflow aspect, which sounded like Windows Workflow (WF), but in the cloud. There wasn’t too many details presented on this at MDC, so I’ll have to go watch some of the PDC videos and do some additional research.

Sql Data Services

Sql Data Services can  be thought of as the premium storage solution of the Azure platform (compared to the simple storage provided by Windows Azure). Like the Windows Azure storage, it is accessible from anywhere on the Internet, not just from within Azure. As of the current CTP, only the database part of Sql Data Services is available, but analytics and reporting pieces are under development. The presenter stated that Sql Data Services was the furthest along out of all of the Azure platform services and to expect some more functionality before it goes live.

The presentation did go into some detail about how you go about creating and using Sql Data Services, but my notes are not good enough to write up here without further research. I can say that it’s not the same as creating a traditional database with tables, rows and columns in SQL server. That is, this is not a hosted SQL server instance.

Live Services

There wasn’t a whole lot of technical details on how live services fit in. Most of the presentation was at a higher level and talked about how Live Services has been around for awhile (currently has 460 million unique users), and how it will enable developers to span the cloud, client and device.

An verbal example was given were a developer created a java script or SilverLight application that a user was able to install to their mesh, thus installing it on all of their computers and devices. From there, the user would be able to share that application with friends, and your application would spread like a virus.

There was a separate session on Live Services which I didn’t attend, so that’s one more thing on the “requires further research list”.

Building your first Windows Azure Application

Following the overview of the Azure Services Platform, was a session on writing, and deploying an application to Windows Azure. There are a couple of prerequisites for developing for Windows Azure:

  • Windows Azure SDK - Jan 2009 CTP. (Unsure what version the demo was done on)
  • Visual Studio Tools for Azure
  • Sql Server 2008 or Sql Express 2008
  • IIS 7
  • .Net 3.5 SP1
  • Vista SP1 (If installing on Vista)
  • Run VS as a Admin (required for local dev fabric)

A comment was made during the talk about getting things setup, that you must have a sql server instance name ./SqlExpress in order for Azure to work. However, I am not sure what version of the CTP the demo was using, as the January 2009 CTP was officially released after the conference. This is the one time were you need to run Visual Studio as a full administrator. This is because the local dev fabric is started by Visual Studio when debugging, and the dev fabric requires full admin rights.

Developing an application for Windows Azure is pretty straight forward. In the first part of the demo, a simple Asp.Net web forms application was developed and deployed without any special coding at all. In fact the application was first launched as a regular web application, and then launched on the local dev fabric for Azure.

So what is this local dev fabric anyway? The local dev fabric is a local version of the Windows Azure platform that allows you to debug and test your applications before deploying them to the cloud. You start up your Azure project from VS instead of your web project to launch the Dev Fabric. Once launched a simple windows form application shows up that allows you to view the number of roles you have running, and a debug window. The debug window shows Azure system events, as well as user defined logging, which can be called by RoleManager.WriteToLog.

Configuring your Azure application requires you to manually edit two configuration files. This reminds me of manually editing WCF config files when WCF was first released. We were assured that additional tooling will be made available in the future for managing these config files.

Deployment to the cloud is a manual process at this point in time, and it, and all management is done on a web page. There are two pre-defined “environments” that your application lives in, Staging and Production. The difference between the two was described as a configuration change, and not a separate instance of your application.  It took over five minutes for the application to start up the first time, so be aware of this.

My thoughts on the Azure Services Platform

When I first head about Azure during the week of PDC, I was less then impressed and not all that interested. I have/had a personal dislike of cloud based services (services which I don’t control, can’t see my whole database, etc). In the case of the Azure Services Platform, this dislike was based on not fully understanding the platform.

After attending the two sessions at MDC, I have warmed up towards Azure, and am trying to find some free time to try it out. However, I think that I, along with many others, are waiting to see what the pricing structure will be. While I think it’s understood that this is designed for the enterprise, I get the feeling that most of us early adopters are hoping that the pricing scales as well as the performance of the platform. While Windows Azure may seem to be overkill for say hosting a blog, it’s stuff like that, that allot of us early adopters are going to be looking to do, before we stick our necks out and recommend it for the companies that we work for.

Friday, January 23, 2009 3:37:58 AM (GMT Standard Time, UTC+00:00)  #    Comments [1] -
Technology

Last week, I attended MDC 2009 in Chicago with the Wife, and we both had a really good time. We drove down the night before and stayed at the Hyatt, where the conference was being held in order to avoid the 3-4am wake up call we would have had to endure to get to the conference on time.

We got a surprisingly (I thought) good rate on a room at only $145/night, and while the room was nothing special, the hotel overall was very impressive (guess I don't travel much). The Hyatt has two towers and a sprawling under ground maze of shops and conference rooms (and hidden parking areas). The fitness center was top notch, complete with a full line of life fitness weight equipment, free weights and numerous treadmills and ellipticals. The treadmills and ellipticals each had their own 8" touch LCD screen which controlled the machine and let you watch whatever TV show you wanted. The only thing missing was video inputs so you could hook up portable dvd player. Although if you had an RF convertor you could probably manage something.

Registration Tuesday morning was from 7:00 to 8:30, and we made it down stairs by 8. The woman checking us in had never seen a husband and wife at the same conference before. Breakfast was good, and there was plenty of good seating (round tables) for eating, although you had to turn your chair to watch the keynote.

The keynote started about 8:35 with the same video that was shown at PDC during one of the WPF sessions I believe. I did not attend PDC, but have watched quite a few of the videos. There were some interesting demos showing off what you can do in WPF, and that it is in fact suitable for line of business applications (and not just pretty rotating cubes). There was also some Windows 7 goodness shown, including the ability to mount and boot from VHDs. We were supposed to get Win7 on DVD, but it wasn't ready yet, so we’ll be getting it in the mail. I already have it downloaded from MSDN, but I’ll probably save the blank DVD and just install off USB.

I really wasn't sure what tracks I wanted to attend, although there were a few I knew I could probably pass on. Reading thru other peoples write-ups and such, I wish I could have attended a few more sessions, but I’m now refocused on watching as many of the PDC videos as possible.

This was originally going to be one long blog post, but in the end it was too long, so I’ve broken it up.

Friday, January 23, 2009 3:15:23 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Technology
# Thursday, January 22, 2009

By way of Scott on twitter, I discovered the Google Ajax APIs today (thanks to Douglas Purdy for the original tweet). The playground area allows you to see all of the APIs in action. Taking a step back, you can view all of the APIs that google provides by visiting this URL: http://code.google.com/more/.

 

All you need to get started, is to sign up for a free API key, which you can do here. Then just add a script src tag to your page referencing your API key (http://www.google.com/jsapi?key=ABCDEFG) and you are good to go. I would recommend reading at least the Getting Started guide under documentation. In addition to the stuff you would expect, like search and maps, they also have language translation and visualization (charts and graphs) to name a few. They also provide up to date versions of common APIs like JQuery, relieving you of the burden of managing these resources on your own.

 

While I would certainly use the Google APIs for accessing Google content, I am a little concerned over some of the other offerings. I would prefer to control when I update my JQuery library for example (how do I know if there are any breaking changes)?

Thursday, January 22, 2009 8:51:24 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Review For Future Projects
# Sunday, January 11, 2009

Microsoft announced this week a new product offering in beta, Microsoft Tag. Microsoft tag uses high capacity color barcodes allowing for more information then traditional 2D barcdoes in a smaller footprint (.625” vs 1.25”). Microsoft Tag includes a web site where you can create, manage and track your tags, and a mobile phone application that allows you to scan the tags using the camera built into your phone.

Seeing as I already have a box of several thousand business cards (and give away about 10 each year), asking my company to reprint a new batch of cards, with support for the 4 colors required by the barcode (there are reports that you can use grayscale and other monotone color schemes, but these are unsupported) is not an option. So instead, I am going to use a color printer and some mailing lables to retrofit my existing business cards.

  1. Sign up for a Microsoft Tag account. It’s free, and all you need is a windows live ID
  2. Create your tag. I created a tag of type URL
  3. Render your tag. I tried the WMF, but kept getting a black background. So instead I exported to PDF, and then took a screen shot using the built-in capture tool in Foxit PDF Reader
  4. Paste image into Paint.Net as a new image
  5. Create a new layer to add additional text and save
  6. With your new layer selected, press ctrl+M to merge the layers into a single image, then select all and copy
  7. Paste the full size image into MS Word
  8. Right click the image and resize to fit your label, in my case 2.6” x 1”
  9. Re-copy the smaller image, then go to labels under the Mailings ribbon option
  10. click the labels tab, then click options to select your label type
  11. Paste your image into the Address field. It won’t show up, but if you click and drag like you are selecting text, you should see it highlighted at least. I don’t know if it’s a bug, or if pasting an image isn’t 100% supported.
  12. Click Print. I printed to my black and white printer a couple of times to make sure everything looked OK and lined up on the labels before switching to the color printer and the label stock
  13. If you need to re-adjust the image, just re-paste into word, and re-copy. It should update the image in the label screen without having to re-paste.
Sunday, January 11, 2009 11:44:07 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

# Friday, January 02, 2009

This week I started working on my first Asp.Net MVC project. The requirements I am working with approximately 5 pages or views, and is read-only in nature, which I thought would be perfect for trying out the MVC stuff. I am also trying to take a incorporate some other methodologies, tools and techniques I have been reading up on, including:

  • Domain Driven Design (DDD)
    • Repository Pattern
    • Your not going to need it principle (YNGTNI)
    • Keep it simple stupid (KISS)
  • Test Driven Design (TDD)
  • Mocking (RhinoMocks)
  • Inversion of Control (Ninject)

So far the project is going really well. I’ve created all of my views, controllers, and basic page navigation, including some URL validation that redirects the user to a page when a parameter is missing from the URL (id part of the default route).  I’ve also added Inversion of Control using the Ninject framework, which I am using to specify my data store type (In memory for testing, or a Sql based store for actual data). I choose Ninject due to it’s small footprint, focused feature set, and Compact Framework and Silverlight compatibility (while not needed for this project, I have a use for that level of compatibility on another project and wanted to limit the number of frameworks I’m using).

CodeBetter: I should have thrown this out in the beginning, but I’m using the Foundations of Programming Ebook and learning application written by Karl Seguin as a starting point. I highly recommend it for people looking to get into the Alt.Net mindset (DDD, TDD, mocking, etc).

Solution Structure: At the start of this project, I was working up an elaborate solution (directory) structure, where I would separate out my Infrastructure, MVC, Domain, and Data Stores into separate projects. I quickly realized, that this wasn’t needed based on my requirements, nor did it follow KISS or YNGTNI. Instead, I separate out my concerns in the MVC project using namespaces. Since I am making heavy use of Unit Testing, if the need ever arose I could split stuff out into separate projects in less then a day, update my tests and be good to go. So in the end, I have one MVC project, a unit test project, and a Web Test project.

TDD: I have two testing projects, one for unit tests, using Xunit, RhinoMocks, and TestDriven.Net. This project tests all of the code for the model/domain, controllers, and infrastructure. My other project uses MSTest and is for my Web Tests, which are more of integration tests. There are some things you just can’t unit test that well, like did the menu get hidden when no account number was present in the URL.

Routes: I am using the default route Controller/Action/Id that comes with the sample project. This fits my requirements perfectly, as I need the Id part for an account number. My requirement was to have a URL in the form of http://Website/Home?Account=123456 which I was able to change to http://Website/Home/Account/123456

Code Behind: I’ve gone ahead and removed all of the code behind files on my views and user controls to make sure I don’t take any shortcuts with the code behind files. I’ve read several work around's for getting strongly typed views without a code behind file, so I’m covered there. By removing the code behind you eliminate 2 extra files per view/user control (ViewName.cs and ViewName.Designer.cs). Just remove the AutoEventWireup and Codebehind attributes in your view, and change the inherits attribute to System.Web.Mvc.ViewPage or ViewUserControl

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

Passing Id: One thing I found out I needed to do often, was construct a URL the conformed to my routing. Thankfully there is a helper method you can use in your view called Html.ActionLink, which has several overloads. I’m using the overloaded method that takes the name of the controller, action, an object for values, and an object for html attributes. Getting the object passed for values was not apparent right away, but you make use anonymous types.  The following code creates the following link, Home/Account/123456 (assuming ViewData[“Id”] is set to 123456), and gives it a text value of Home.

Html.ActionLink("Home", "Account", "Home", new { id = ViewData["Id"] }, null)

Filters: As I mentioned before, in using the default route, I’m “mapping” id to an account number. If there is no account number present, or the account number does not correspond to an actual account, I need to take some action. At first I had a helper method that I would call from each action that needed the account number, and redirect to a certain view if the account number was missing. Then I read about filters, and the OnActionExecuting override in the controller object, and thought that would be a better way to go. However, I’m going to go back to calling a method in each action for the following reasons:

  • Easier to unit test. With OnActionExecuting override, I havn’t been able to find a way to unit test the method or the overall behavior.
  • Code Smell. While one could argue writing the same line of code in each each action method smells, it is not as bad as having to check for certain action names in OnActionExecuting. For example, I didn’t want to redirect to the account entry page if I was already there. This way, I can call the method only on the action methods that need it.
  • Easier to understand. To the uninitiated MVC programmer, it’s simpler to follow then attributes or a base class override.

That’s all for now. I’ll try to write an update after I finish the project. I need to work with grids, and the new MS Charting controls, so that would be worthy of a follow up post.

Friday, January 02, 2009 2:23:06 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Programming
Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

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

Copyright 2010
Adam Salvo
Sign In
Statistics
Total Posts: 234
This Year: 13
This Month: 1
This Week: 1
Comments: 34
Themes
Pick a theme:
All Content 2010, Adam Salvo
DasBlog theme 'Business' created by Christoph De Baene (delarou)