Accessibility Webinar for State Agencies

Below is the Accessibility Webinar for State Agencies

Posted in Uncategorized | Comments Off

Connecting to CRM Online

When working with the Dynamics CRM 2011 SDK and desktop utilities, it can be sometimes be frustrating to setup a connection within Outlook.

I posted this video to help those of you who aren’t certain why typing in your default URL and username/password into your CRM-wizard is failing. This is one possible solution to a particular problem. The problem I was having is that despite everything being setup properly, I wasn’t able to get the wizard to find and recognize my organization.



Posted in Uncategorized | Comments Off

Debugging Django Views with Aptana

Aptana is a free Eclipse-based IDE that is particularly useful for Python/Django programming and troubleshooting. However, while working on troubleshooting the Django content we were teaching in class, we ran into the frustrating scenario of not being able to debug our views/models and other Python modules.

This video shows you how to do it. It also shows how to take a Django project created with and set it up from scratch inside of Aptana so that you can debug it properly.
(You can check out the steps to setting up Django under IIS7 in my previous post, here :


Posted in Django / Python, Gotchas, Training | Comments Off

Making a simple HTML doc (for beginners)

I met a smart young guy at the Tacoma Community College the other day who asked me about making web-pages.

I gave him a quick run-down of how it works, but he wasn’t sure he understood. This post should help him out.
Here’s a link to a public you-tube video I made for you.

Oh, and here’s another link to a youTube video explaining how to style your text on the webpage and add a title to it.

This video explains how to create a Hyper-Link between 2 different HTML documents. 2 different HTML documents may actually constitute a “web-site”! So, all we need next are images to make the page look more interesting, and a place to host it all. (HyperLink video below…)

Here’s how you can create a simple graphic in Microsoft Paint, save it as a JPG file, and display it in your web-page. This video also explains how to create a 2-column page and vertically align the text to the top of the column.

Here’s how to setup your own “free” HTML web server on a Windows XP machine.

Here’s how to setup your own “free” HTML web server on a Windows Vista/7/8 machine.

** Note ** if you need any more help, just email me.


Chad W. Stoker

Posted in Training, Uncategorized | Comments Off

Running Django in IIS7/IIS8

So I’ve been working hard on Python and Django training materials lately. There’s a client that was in desperate need of somebody to provide this type of training, and I was fortunate enough to have an experienced Python/Ruby programmer on staff that fit the bill. He and I worked together to come up with plenty of examples and concepts to cover for a 5-day compressed course on Beginning Python and Django!

The most exciting part of the course was the final 2 days, where the students began to apply some of their newly acquired Python skills toward Django,,, and other files. During this course, I took it upon myself to think through the best way for a primarily Microsoft-centric server shop to be able to leverage the full capabilities of Python/Django in a way that didn’t feel limiting, wasn’t overly batch-script based, and didn’t have too many complex steps.

I found many articles on hosting Django within IIS… that were very difficult to follow. I eventually came across this article… which I spent quite a bit of time deciphering and understanding. The “batch script” nature of the article is what confused me the most. However, I distilled it down a bit into some IIS user-interface driven steps that my students had an easier time following along with. These are those steps on a Windows 7 machine, and should be nearly identical for Windows Server 2008 and above: (**note** assumes you’ve already installed Python version 2.7 and Django 1.4+ in C:\Python27 )

1. Make sure CGI is checked on box.

  • A. Control Panel
  • B. Programs and Features
  • C. Turn Windows features on or off
  • D. IIS
  • E. World Wide Web Services
  • F. CGI (Check)
  • G. Click OK

2. Go to IIS Manager
3. Select the web server
4. Double-Click Web Platform Installer a.k.a. WPI (you may not have it, so skip to step 7 if that’s the case)
5. If it asks to update, do so
6. If update fails, you need to download to install
8. When you can launch WPI, search for FastCGI
9. Select and install WFastCGI
10. If install fails, add a key under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
This key’s path is Python\PythonCore\2.7\InstallPath
It’s value is C:\Python27\
11. Confirm that is in C:\Python27\Scripts\

  • Copy the file from C:\Python27\Scripts\ to your Django root site folder possibly at – C:\inetpub\wwwroot\[project site]

12. Go to web server, and ensure that IIS has icons for both CGI and FastCGI
This is at the root server level
13. Move your django project to wwwroot (assumes you knew how to create a Django project with startproject
14. Create a site in IIS. Give it some name. Point it to the path of your project. Give it a

port that won’t have conflicts, such as 8003
15. Double click Handler Mappings
16. Upper right-hand side, click Add Module Mapping

  • Request path of *,
  • Module, select FastCgiModule,
  • Executable: “C:\Python27\python.exe|C:\inetpub\wwwroot\[project site]\”,
  • Name: “Django Handler”

18. Click Request Restrictions
19. On Mapping tab insure that Invoke handler only if request is mapped to, is NOT checked.
20. Click OK and Click OK
21. You will be asked if you want to add an entry to the FastCGI collection in IIS. Answer YES
22. Select the root server.
23. Double-Click FastCGI settings
24. You should have the Full Path to your Python.exe with an argument to your
25. Double-click it.
26. Click on Collection in Environment Variables property box and click the … button
27. Add 3 Environment variables:

  • DJANGO_SETTINGS_MODULE: [project name].settings,
  • PYTHONPATH:C:\inetpub\wwwroot\[project name] ,
  • WSGI_HANDLER: django.core.handlers.wsgi.WSGIHandler()

28. Click OK. then Click OK
29. navigate to http://localhost:8003


Unfortunately, there’s more. There are some challenges getting Django to cough up “static files” which come in the form of *.css, *.jpg, *.js, and many… many… many more. As a result, you may need to create an “Application” within your newly created “Website” (used to be known as “Virtual Directory”). The trick here, is that once your Application is created… you need to navigate to the “Handler Mappings” module for that Application and “Remove” the Python-specific Http Handler that was created automatically. This will not affect the parent Web-Sites Handler-Mapping settings.

Here’s the complete video! (Quality is pretty bad… if you really want this video, let me know. I will give you a better quality link to it.)

Happy configuration! Feel free to contact us if you’ve got questions!

Posted in Django / Python, Training | Tagged , , , , | 1 Comment

Semantic Data-Modeling Guidelines

For those of you that have heard me talk about “meta-data” modeling, or the concept of modeling data to support certain dynamic data-capture needs… this is for you. This white-paper, originally published by Microsoft, describes in a very methodical way, how a good data-modeler will potentially approach normal and static data-capture needs as opposed to dynamic data-capture scenarios.

It lays out the steps necessary to consider one design over the other, and several other common data-modeling best-practices. Check it out! This is a “must-read” for almost everyone at CodeSmart Inc. :-)


semantic db modeling by Microsoft

Posted in SQL, Technology Philosophy, Training | Tagged , , | Comments Off


        private FileContentResult DownloadPdfReport(string reportPath, 
                                                    string fileName, 
                                                    IEnumerable reportDataSources)
            var localReport = new LocalReport { ReportPath = reportPath };
            var permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
            foreach (var dataSource in reportDataSources)
            string reportType = "PDF";
            string mimeType;
            string encoding;
            string fileNameExtension;
            //The DeviceInfo settings should be changed based on the reportType
            var deviceInfo =
                "" +
                "  PDF" +
                "  8.5in" +
                "  11in" +
                "  0.5in" +
                "  0.5in" +
                "  0.5in" +
                "  0.5in" +
            Warning[] warnings;
            string[] streams;
            byte[] renderedBytes
                = localReport.Render(reportType,
                                     out mimeType,
                                     out encoding,
                                     out fileNameExtension,
                                     out streams,
                                     out warnings);
            Response.AddHeader("content-disposition", "attachment; filename=" + fileName + "." + fileNameExtension);
            return File(renderedBytes, mimeType);
Posted in Uncategorized | Tagged , , | Comments Off

Mono For Android: Getting Started

Getting started with any new technology that you are not familiar with can be a little daunting so I wanted to write a little tutorial to help people get a head start and to pass on the things that I have learned through trial and error.

A Little Background on Mono

The Mono Project was started by Miguel de Icaza as an open source project on July 19, 2001 while working at Novell. The intent was to support the .NET Framework on Linux systems to help increase developer productivity. After Icaza was laid off when Novell was acquired by Attachmate in April 2011, he started the company Xamarin. This company was given a perpetual license and stewardship of the Mono, MonoTouch, and Mono for Android projects.

Setting Up Your Environment

You can go to the Xamarin installation documentation for detailed information on how to set up your development environment. The process is fairly straightforward and really just requires that you download the installer which will install all the required components for you.

After you have run the installer you will have the Trial Version which will allow you to develop Mono for Android applications and deploy them to the emulator for testing. In order to deploy the application to a device you must buy a license and activate it.

Creating Your First Mono For Android Application

The first step will be to open Visual Studio and create a new Android Application project.

Lets go ahead and name this project “HelloMonoDroid” and click OK.

Now we have a basic project that we we can begin to work with. Let’s start out by examining the structure of the Project

  • Properties Folder : Contains the AssemblyInfo.cs file where information about assembly and its permissions on the phone are located.
  • Reference Folder: Lists dlls that the application needs for functionality.
  • Assets Folder: Contains assets that the application needs; Text Files, Fonts, etc…
  • Resources Folder: Contains sub folders and files for resources as well as an autogenerated file to access these resources.
    • Drawable Folder: Contains image files used in the application.
    • Layout Folder: Contains .axml files that are used as designers for the different Views in the application,
    • Values Folder: Contains the Strings.xml file which is used for localization of the strings used in the application.
  • Activity Files: The logic for each screen of the Android application

The two files that we need to work with for the HelloMonoDroid application are the Main.axml and the Activity1.cs file.

The Main.axml file is the default designer file that the application will use to render a View when a new Android Application is created. This file can be renamed to whatever you would like and additional view can be created to work with this or replace it. A view can be a single control on the screen, the entire screen, a dialog, a menu, a list, etc… Because of this, for every View that we want to see, we need to create a new .axml file that corresponds to that View. For now we will just be creating a single View that will correspond to a single screen.

The Activity1.cs file is the generic name that is given the default Activity when an Android Application project template is used. The Activity acts as the controller for the application. An Activity can be thought of as the logic for the screen that is being displayed. The Activity uses the .axml file to render the controls that will be displayed on the screen and it is here that you can programatically interact with the controls and add the functionality that make the application go.

So lets get started.

Running The Default Application

Application Description

The Application that we will be making is a simple adding application that allows the user to enter a number in a text box, click an add button, and display the sum. We will also have a reset button to set the summed value back to zero.

Setting Up a Clean Project

First we will clean out our project to remove the default application content. I want to demonstrate to you guys how to create an application from scratch without the default files for the View and the Activity so we will go ahead and delete the Main.axml and the Activity1.cs files first.

Now that we have a clean project to start from we want to begin by creating a new View Layout (.axml file).

  • Right click on the Layouts folder and select a Add New Item.

  • From the Add New Item Dialog, select Android Layout and name it StartScreen.axml.

Depending on the version of Mono for Android that you have downloaded, you will get either a graphical designer or a xml file. I prefer to use the xml file for my design, and it gives you a clearer understanding of how to create a view, so that is how I will proceed.

If you have the graphical designer showing in your main window, you need to…

  • right click on the StartScreen.axml file in the solution explorer
  • and select ‘open with’ from the context menu. Then select Automatic Editor Selector (XML) from the dialog and click OK.

You will see the markup for the view in the main window.

*In a future blog I will do an in depth look at the View and take a look at most of the controls that you can work with, but for now we will keep it simple and confined to this demo.

Building The Screen

Like we talked about a little earlier, the Screen is represented by the axml file that is loaded by the Activity. We need to add the controls that we want on our screen to display. For this demo, that is a EditText for to allow the user to enter a number, a TextView to display the sum total, and a Button to add the number in the EditText to the sum.

(I will complete this post in the near future… in the meantime, here are the code sample from IPMA 2012 forum.)

Mono Development (w/ Android) powerpoint slide-deck

Mono Source-Code examples

Posted in Mobile Development, Training | Tagged , , | Comments Off

IPMA 2012 Forum

CodeSmart Inc supported the IPMA forum for our 4th year in a row. We are a little bit delayed in pulling together the samples from the MONO for Android presentation. We expect to have the content posted later this evening. This afternoon, I expect to have the content for the Responsive/Adaptive Design presentation posted.

Thanks to all who attended!

(Here are the updated links to the IPMA content!)

Chad Stoker – Adaptive and Responsive Design (source files)

Chad Stoker – Adaptive/Responsive Design (slide show)

Bryan Paslay – MonoDroid slides (IPMA 2012)

Bryan Paslay – MonoDroid source code!(IPMA 2012)

Chad Stoker – ASP.NET MVC3 power-point slides

Chad Stoker – ASP.NET MVC3 source-code

Ben Feely – WebDeploy, Knockout.js, and slides

Posted in Uncategorized | Tagged , , | Comments Off

Responsive and Adaptive Web Design

When software engineers first jump into understanding how to adjust their development techniques for mobile devices, they are bombarded with new tools, design considerations, new terminology, and more. So I will state right up-front, where this article is headed. If you are a .NET developer, more specifically, an ASP.NET developer responsible for web-application or web-site creation, then this article is for you.

This article is not about how to setup an Eclipse Android-enabled IDE or how Views in the Android SDK can best be written to support tablets versus cell-phones. It’s also not about the XCode environment and the nuances of writing Objective-C programming for iPads, iPods, iPhones, and the like. This article is about using your existing skills in ASP.NET for targeting these platforms successfully.

To get started, I feel I should explain the difference between Adaptive Design programming and Responsive Design programming.

Responsive Design -

is the easiest to explain. It simply means that you design your web-sites or applications to adapt to the capabilities of the user’s browser settings. So if a user is working with a cell-phone and a rediculously small screen resolution, then your web-site/application should render itself accordingly to make navigating the content easy and intuitive. If the user is on a desktop, then they should be able to view more than just a single tiny column of content at once.

Adaptive Design -

is the most ambiguous term ever, and essentially refers to how web-developers or web-masters may go about re-using techniques or designs from previous projects, on a new project. Sometimes, I have heard this called “Progressive Enhancement”. The idea is to avoid building all of your images, HTML markup, and CSS from scratch each time you start a new venture.

Examples and Discussion -

To beging with, let’s consider a couple of images from an actual website…

The image above shows a normal website shown at full-screen on a desktop browser with 1280 x 900 pixel resolution. Now let’s consider what the same website might look like if rendered on a tablet instead.

And finally… what would this website likely look like on a mobile-phone with something like 465 x 800 pixel resolution?

So… these images give us a starting point to understand more about what Responsive design and Progressive Enhancement (a.k.a. Adaptive Design) is all about. Obviously, there are a couple of take-aways about each of these 3 screen shots… but let me see if I can summarize a couple of Frequently Asked Questions (FAQ’s) here.

1) Are those 3 separate websites? If not, how is the web developer able to achieve such dramatically different visual appearances from the same markup?

2) How does HTML 5 fit into all of that?

3) How would this type of thing affect my project’s budget… if it is determined to be a priority?

4) What technologies do I need to know about?

Answers to the Questions -

1) These images are not taken from 3 separate websites. They are all, in fact, the same website… and I simply resized my browser in order to capture the behavior of each one at different resolutions. The secret to the behavior is called “MEDIA QUERIES”.

Media Queries are the single most important aspect of “Responsive Design” because they allow a web programmer to query the capabilities and current state of the browser and apply styling accordingly. In the past, HTML4 and CSS2 supported media types at a basic level. A common technique was to apply a different set of styles for a PRINT media versus the SCREEN media. For instance, here is some HTML4 markup that does just that…

<link rel="stylesheet" type="text/css" media="screen" href="sans-serif.css">
<link rel="stylesheet" type="text/css" media="print" href="serif.css">

The idea of the “media” attribute in the LINK tags above, is that browsers will interpret this markup based on the output device. So the browser, if it supports the standard, will render “serif.css” to a ‘print’ output device, but will instead render “sans-serif.css” to a screen output device. (Like the one you’re looking at now!) The details concerning syntax and history of “media queries” can be found here:

There is one little “gotcha” involved with this approach however. The designer/developer will end up making redundant style sheets for some of the same elements. That being said, how much redundancy occurs depends on the individual needs of your project. Most designs require only a small amount of duplicated styles. Like all things on the web, there are differences that must be taken into account on various browsers. So keep that in mind.

2) The HTML4 specification committee, luckily, was able to foresee the need for a forward-compatible syntax that would support media types that were unknown at the time. So, using the attribute below, is perfectly valid even though 3d glasses are not currently a media type that exists on any computing devices  that I’m aware of.

media="screen, 3d-glasses, print and resolution > 90dpi"

So, in this way HTML5 isn’t all that important. However, when we’re designing websites today… we need to think about targeting the HTML5 syntax where possible, and that means we need to think ways to make it backward compatible with the HTML4 browsers available today. (As opposed to continuing to produce HTML4 markup with no thought of HTML5 compatibility.) In order to do this, Media Queries and other techniques are critical. Take the following example :

In HTML5, there are several additions to the number of valid HTML tags.

	<header id="top" role="banner">
	<h1><a href="/">
		<img src="i/c/spring/logo.png" alt="Retreats 4 Geeks" />
	<nav role="navigation">
		<ol id="event-nav">
			<li id="nav-details">
				<a href="#details" title="Find out">Details</a>
			<li id="nav-schedule">
				<a href="#schedule" title="Get over">Schedule</a>
			<li id="nav-instructors">
				<a href="#instructors" title="Get facilitators">Instructors</a>
			<li id="nav-lodging">
				<a href="#lodging" title="we  staying">Lodging</a>
			<li id="nav-location">
				<a href="#location" title="Get the TN">Location</a>
		<p id="nav-register">
			<b>Register Now</b>
			<span class="sold-out">Sold Out</span>
<div id="content" class="vevent" role="main">

	<article id="details">
			<h1>Join us for </h1>
			<p class="dates">
                            <time class="dtstart" datetime="2011-04-08" title="2011-04-08">8</time>&#8211;
                            <time class="dtend" datetime="2011-04-10" title="2011-04-10">10 April 2011</time></p>
			<p class="location">Gatlinburg, <abbr title="Tennessee">TN</abbr></p>

		<figure class="frame focal">
			<img class="inner" src="i/mountains.jpg" alt="" title="Smoky Mountains"/>

		<section class="main description">
			<p class="intro">This Spring, Retreats 4 Geeks is proud to present three d.</p>
			<p>If you&#8217;re the kind of person who finds conference  to build incredible websites.</p>
				<li><strong>Top notch training:</strong>
					Retreats are comprised of </li>
				<li><strong>Learn from the experts:</strong>
					With more than 32 years of others.</li>
				<li><strong>Includes everything but airfare:</strong>
					You&#8217;re here to learn, not to worry about each day.</li>
				<li><strong>A fantastic location:</strong>
					Clearing your mind is the first step to learning,  Mountains</a>?</li>
	</article><!-- / #details -->

Note the presence of HTML5 specific tags such as “header”, “article”, “section”, and “nav”. These are the markup tags you definitely want to become familiar with as you move forward with new web-based applications that may interface with mobile devices. Your new target should be HTML5, and HTML4 compatibility should be considered a secondary priority.

3) The overall budget impact of developing for HTML5 and supporting multiple browsers and hardware form-factors, depends on your teams training and experience in the area of supporting web standards, implementing media queries, and understanding tools that support these standards. ASP.NET MVC is in-place so that web developers may continue to implement compelling web applications and sites, utilizing their current expertise in .NET technologies, with the new HTML5 standard!

So if your team already uses ASP.NET MVC, the budgetary impact is negligible. If you decide that a desktop-type of website is all that is necessary for hardware of all shapes and sizes, then you are obviously able to eliminate any additional training or testing of the website at various screen-resolutions. In that case, your project budget will not be impacted at all.  However, if you feel that it’s important to support mobile phone and tablets as first-class citizens of the hardware/browser ecosystem that is the world-wide web, and your team is currently lacking training and/or experience in the field of “responsive design”, you will experience a slight increase in the first several projects that your organization undertake. The amount of increase will be roughly equivalent to the time it takes your team members to learn how to develop media queries, resize and float HTML elements properly depending on the media type, and implement HTML4 backward compatibility for all older browsers as necessary.

4) HTML5, CSS3, (specifically media queries and float/-webkit-transform-style/etc CSS tags), ASP.NET MVC, and JQuery/JSON/Javascript.

Posted in Mobile Development | Tagged , , | Comments Off

Our Capabilities Include:

Custom Software Development
Enterprise Architecture
Project Management
Systems Analysis
Performance Testing


These methods are vital to our work:

Agile Methodology
Test-Driven Development


About CodeSmart, Inc.

CodeSmart has been locally owned and operated in the Olympia, WA area since 2002. We direct, design, develop and deliver full end-to-end information systems using leading edge Microsoft .Net technologies and recommended best practices.