Wednesday, December 05, 2012

Who Owns the National Debt?

Source: www.treasury.gov
Occasionally, I like to check on which foreign countries own our massive national debt. The today US federal debt is 16.3 trillion dollars. Foreign debt holders have a total of 5.5 trillion giving them the privilege to hold 33% of our IOUs.
If you listen to Jay Leno, you would think China owns the whole amount, but they clock in at only 7% of the total. And China's holding have been steadily falling, shedding 115 billion of treasuries this last year. While China is cooling to our bonds, Japan has taken up the slack and bought an additional 147 billion since last September.
My previous post in 2009 is here.

Saturday, November 17, 2012

Pictures from Keep Austin Agile 2012 Conference

Agile Austin hosted a conference on November 16th in Austin on applying "agile" (with a little "a") to the workplace.  Here's a few pictures:
 
 Before the sessions started, I ran into an old friend of mine, Kelly, who mentioned that Agile has reached a "tipping point" with the big companies.  They used to just ignore Agile, but now after hearing so many success stories, the big boys are telling their IT departments to do this Agile thing - now.

The food was amazing - great breakfast food and lunch.



Matt Roberts, president of Agile Austin started the day.
 
A sellout crowd of 400 people attended.
 David Hussman, aka, "The Dude" gave the keynote.  My take of his message:  Agile is like musicianship - it takes lots of practice, jamming, listening, learning, repeating.
(He also said humans have played 200,000 years of Angry Birds).
He reiterated the cost of context switching - if you're shoveling three piles of dirt around context switching is not hard; if you're juggling 3 different projects, it's very costly.
"Slack" by DeMarco was a recommended book. 

Chris Weldon spoke on How to Enable Your Team to Continuously Deliver Softer.
What make Agile work?
Teams must be highly motivated and stay together.  If the teams are constantly being reformed around projects, they don't have time to develop trust and learn their velocity.
Business partners must be fully engaged.
Attention to getting things done, before starting something new.
Technical excellence and quality.
What makes Agile fail?
local optimization.
 Mike Cottmeyer spoke on Patters for Agile Adoption

 Walter Bodwell talked about Deploying Often.  I liked his talk since he was speaking from his own experience of deploying software everyday.  One of the advantages of Continuous Delivery is that if you have problems one day, it's probably last night's software changes - you don't have to sort through six months of changes.

 George Miranda spoke about IT Infrastructure Automation
Automation + Culture = Agility.
The natural tension between IT and Dev:
Dev's job is to add new features.  IT's job is the keep the machines fast and stable.
Really both department's job is to enable the business.




My take on conferences like this: 85% of my time in sessions will be wasted.  15% will be well spent.  Some of the most interesting things happen in the hallway.  The boring sessions are even good because my mind wanders to my current work project and what needs to be done in the broader scope.

Tuesday, November 13, 2012

The Danger of the Digital Pierian Springs

A little learning is a dangerous thing;
   drink deep, or taste not the Pierian spring:
there shallow draughts intoxicate the brain,
   and drinking largely sobers us again.
Alexander Pope (1688 - 1744) An Essay on Criticism, 1709

[The ancient Greeks believed the Pierian Springs, sacred to the nine Muses, imparted knowledge of the literature, the arts, and sciences to all who drank.]

As software developers we have to always be on guard against the latest crazes promising multiple  times the efficiency of current "stone age" software development.  For a while it was ObjectOriented Programming/Design, then GUI builders, then Patterns, then Functional Programming, then Service Oriented Architecture, then Software As A Service, then the Cloud, then REST and MVC.  (Ruby, Interpreted languages, and Kanban are in there somewhere).
I have seen quite a few systems (and built some of my own) that were slavishly and unnaturally following a paradigm far beyond what would make sense.  Do not be afraid of the new technology, some are really useful, but remember to drink deeply and see the flaws and limits of fresh intoxicating technology.


From Linus Torvalds:
Any time you have "one overriding idea", and push your idea as a superior ideology, you're going to be wrong. Microkernels had one such ideology, there have been others. It's all BS. The fact is, reality is complicated, and not amenable to the "one large idea" model of problem solving. The only way that problems get solved in real life is with a lot of hard work on getting the details right. Not by some over-arching ideology that somehow magically makes things work.
Linus quoted on SlashDot.com

Disappearing Menus in Firefox on Windows 7

A few weeks ago the menus in Firefox 16.0.2 on Windows 7 started to disappear.  Like a ghost the menus would fade in and out all the while being clickable.  Very annoying.  The solution was simple - turn off hardware acceleration. Select "Tools/Options/Advanced/Browsing" and toggle off "Use hardware acceleration when available".
Life is much better now that Casper is gone.

Monday, November 12, 2012

Apple "Jumping the Shark" with the iPhone5

I along with millions of others were disappointed with the iPhone5.   Last year in the US, 93% of iPhone users said they would buy another iPhone, this year it was down to 88%.
Lightening to 30-pin adapter
To me it came down to two factors:
1.  The new maps were not ready, but Apple assumed they could foist bad software on people because they are Apple and their fans would adore them for it ("Thank you sir, may I have another?").
2.  The non-standard connector.  This one really gets me.  The whole world is moving to the micro-USB connector for cell phones for data transfer and charging.  In Europe it's the law to charge with micro-USB.  With the same cord that charges my wireless Logitech mouse I could connect to my phone - what a great idea!  No more tangled masses of incompatible chargers and cords.  But no, Apple has to Think Different(tm).

If I upgrade from my iPhone4S to an iPhone5, I'd have to get all new connectors for work and home and car, while still having the older 30pin connectors for all my other older i-devices.
It would be one thing if the new connector offered something worthwhile, but it doesn't.  It's slightly smaller and it can plug-in upside down, but that's it - not nearly enough benefit to me for the hassle.

The shine is off Apple, with it's brazen move to maximize revenue while inconveniencing their customers.
I'll be looking at the Samsung Galaxy Note II for my next phone.

Friday, November 09, 2012

vs2012 "no symbols have been loaded for this document"

I upgraded an older project from vs2010 to vs2012 this morning and debugging broke.  When attaching to the web server process this error appeared:
"no symbols have been loaded for this document".
The solution was easy, I switched the default code type from "Managed (v4.5,v4.0)" to "Managed (v3.5, v3.0, v2.0)". 
(I'm not sure why vs2012 can't look and see that my project is running as .Net v3.5 and just automagically set it.)

Saturday, November 03, 2012

Differences between isql, osql, sqlcmd and Invoke-Sqlcmd

What's the difference between isql, osql, sqlcmd, and Invoke-SqlCmd?
My GreatGreatGrandFather, Elijah Fincher, playing the part of "isql"
All four of these tools let you interact with SqlServer via the command line.
I'm not a big database guy, so I thought I was cool a few years ago moving to osql from isql. Wrong. The cool kids are on Invoke-SqlCmd
What's the difference:
isql - the grandfather, last used in SQLServer 2000. You should only be using this if you are working for some government agency.
osql - the father, introduced in SqlServer 2000, will probably be phased out soon. Use this if you work for a large corporation like GM.
sqlcmd - new kid, introduced in SqlServer 2005, used in current SqlServer insta
lls. This is what everybody else should be using.
Invoke-SqlCmd - the new cool kid, used inside PowerShell. Use this if you are really cool and have installed linux on your old computers at home.


Example using sqlcmd:
sqlcmd -S MyServerName\SqlExpress -E -Q "CREATE DATABASE Movies"
sqlcmd -S MyServerName\SqlExpress -d Movies -E -i "C:\workfiles\Movies_CreateTables.sql"

The "-E" option says to use trusted identity;
"-Q" the query to execute
"-d" the database to access
"-i" the command input file

Friday, November 02, 2012

Austin Java Users Group - RESTful Web Services

On October 30, 2012 Ryan Stewart of Rackspace gave a wonderful presentation to fifty people on creating RESTful web service using Gradle for building, JAX-RS(Jersey) for the web services and Spock for testing. It was very impressive. In 100 minutes Ryan wrote the tests for a small web service in Groovy using the Spock framework, created the code to implement those tests, and deployed to Red Hat's cloud. He reiterated the mantra of HTTP verbs:
POST is to create
PUT is for updates
DELETE is for well, deleting
Ryan used the sublime editor for small things and IntelliJ for coding (he really liked IntelliJ more than Eclipse, even the community edition).
jacoco used for a code coverage tool.
"Test your source code with a more powerful language." So we used Groovy for testing.
I learned that the 201 status code is for "OK, I created an object" and by convention the objects location (identity) is passed back in a header.
Ryan liked, what .Net people call "Fluent" style, where methods can be chained together if we return the object, e.g., user.withRole("admin").expires("never")...
public User withRole(String role) {
  this.roles.add(role);
  return this;
}
Ryan demonstrated "JerseyTest" which was amazing.
For REST systems, instead of wsdl like SOAP used, we have a simpler format called "wadl", which is not standard at the moment.
When retrieving info from a REST server we can imply the format by appending an extension, /usr/345.xml or /usr/345.json
JerseyTest impressed me with the excellent separation of code possible. Ryan went out of his way to write all the code to be testable, and only use the meta info on the methods to describe their web behavior, so we could test their POJO behavior easily with NUnit.
He used projectlombok.org to autogenerate accessors.
"gradle distZip" created the distribution package
The most impressive part of the demo was to take our shiny new web service and seemlessly deploy to RedHat's OpenShift cloud service. His slides are here and the web service is here.

Saturday, October 13, 2012

Pictures from the Overview of Kanban - Austin SPIN Oct 11, 2012

David Hawkes CEO of Agile Velocity gave an overview of some Kanban concepts to the Austin Software Process Improvement Network

Here's the notes I jotted down during his talk:
Multitasking is bad
Why do we work on too many projects at one time?
- Not focused on deliverying value
- Maximizine utilization
- stakeholders need to have their project "In progress"

getKanban.com

Little's Law

Work In Progress
----------------   = Aggregate cycle Time
Throughput           

Stop Starting and start finishing

If we focus on fewer items at a time we can:
1. Increase productivitiy and deliver more
2. Get our customers more engaged
3. Have agility to adjust when changes occur
4. Lower our cycles times, less time to finish after getting a project
5. Limit the costs of delay

David Anderson wrote a Kanban Book for software development 2010

How to limit WIP
Throttling the input (demand) into the system

Lowering the WIP highlights the bottlenecks

Prioritization is no longer about ordering all the work, 
  but picking the next one

We need to optimize the whole system not just one part.

Kanban
Start with what you do now
Agree to continuous improvement
Respect the current process, roles, responsibilities
Encourage acts of leadership at all levels 

5 Core Properties of Kanban
1. Visualize Workflow
2. Limit WIP
3. Measure Meausre and Manage Flow
4. Make Process Policies Explicit - document what done means
5. Improve Collaboratively (Using Models/ Scientific Method)


Throttle demand to meet throughput in order to gain leveled flow

Shortening cycles and increasing the rate of delivery will build trust

Identify the constraint in your system and focus on optimizing the whole

Kanban companies here in Austin:  BankVue, HomeAway, BaazarVoice
Dan Pink RSA Drive video

Sprint time is how long you can resist change

64% of features are never or rarely used

Do we ever measure the usage of the features we delivery?

Monday, September 24, 2012

Awesome FireFox AddIn, Blank Your Monitor

I tried switching completely over to Chrome recently to get the better threading of tabs, but one thing stopped me - the lack of a good darkening addin or feature. I tried a few chrome addins, but always got a bright flash between sites. My eyes are photophobic, so staring at a white page with black letters gives me a headache after a while. Blank Your Monitor works great in Firefox. You can toggle between normal and dark mode with just hitting Ctl-Alt-B, which is much easier than "Tools/Options/Content/Colors...". I still need to toggle because some sites (I'm looking at you Facebook) are not made for sensitive eyes - all the buttons are black with no hint or title. I love Blank Your Monitor. Thanks dlento for creating it!

Thursday, September 06, 2012

"Don't Just Do Something, Sit There!"


 
During a recent upgrade I panicked. We were upgrading our system to be on a Universal Time so all the countries could schedule and see events in their local time (don't get me started on daylight savings time).
Our team in India ran my upgrade script to convert all the historical records to Universal Time from the local server time, but my web application was still showing the old time, just as if the script had not run. I spoke with the person doing the SQL script execution and he assumed me he already ran it.
 
But our system wasn't showing the new times. This is when I panicked. Instead of carefully thinking the situation through and talking with some other knowledgeable people, I had the India team rerun the script. Then it hit me. The servers where caching the times. The database had really been updated, but the app was clever enough to cache the time to save load on the database.
 
I restart the web app and sure enough the historic times were now changed by twice the intended amount. After rerunning the upgrade script with a negative time to set the clock back everything was fine. The upgrade proceeded and I learned a valuable lesson,
 
"Don't just do something, sit there! (and think)."
 

Saturday, September 01, 2012

Keeping up with Tech

Besides the bizzion tech blogs and twitter feeds which litter the internet, I find book publishers' email newsletters to be a good source of what is new and upcoming in the tech field.
The advantage of dead-tree publishers is that they take the time to see what is really viable and take a little longer term view than web-only sources.
A print publisher has more at stake if a book bombs - a warehouse full of unsold books.
A few that I subscribe to:
The Pragmatic Programmer newsletters and magazines.
Mannings subscribe to Newsletter.

The Myth of the Better Alternative

For some reason, we believe the Myth of a Better Alternative. We believe that, if someone or something is bad, there must be a Better Alternative. We see an evil despot overseas and believe that if he were overthrown, the Better Alternative - democracy and freedom - would flower.
 
The problem is, of course, we don't know who will rise to power after a bad dictator is disposed. Will the new government be better? Hopefully, but it could easily be worse. We just don't know. We can't know. Removing a dictator could result in a long, bloody civil war that kills thousands of people and literally destroys the country, only to be followed by a more evil dictator.
 
Czar Nicholas was not the best ruler, but I think many Russians - the 20 million killed by Stalin come to mind - would have preferred the Czar to the communists.
 
The United States does not need to intervene everywhere in the world that has what we consider a less than optimal government. We just can't afford it. Besides, we don't know what's best for other countries. Why don't we just save thousands of our soldier's lives, trillions of dollars and let the rest of the world work out their own problems?

Friday, August 10, 2012

Investing Tip: Be Careful of Target Funds Fees

You've probably heard the old saying, "You can learn for other people's mistakes, but sometimes you have to be the other people." I was the "other people" in my investments in target funds.
I was excited to hear about Target funds - funds that target a specific retirement year, like 2025, and automatically move assets into more conservative investments. I thought this would be great; I wouldn't have to worry about rebalancing my retirement fund - and my financial advisor recommended it.
But what I didn't research carefully enough is the management fees. My 2025 Target fund had a fee of .74% per year and was composed of index funds in US stocks, World bonds, International stocks. If you take the weighted average of my Target fund's components, management fees were only .26%. So I was paying .48% interest, hundreds of dollars, a year for the Target fund to slowly move to a more conservative balance. For half a percent interest, I could make a few trades at the end of the year.
Some target funds are a good deal. At Vanguard my target fund is cheaper than its weighted parts.
Moral of the story: Research your target funds and make sure the management fees are not excessive. Learn from my mistake so you don't have to be the "other people".

Saturday, August 04, 2012

In Mountain Lion "invert colors" shortcut not working

I upgraded my shiny new macbookpro to Mountain Lion and the keyboard shortcut for "Invert Colors" (ctl-alt-command-8) stopped working. To re-enable this, go to "Preferences/Keyboard/Keyboard Shortcuts/Accessibility" and check "Invert Colors". (Apparently too many Windows users were visiting Apple stores and turning on the "Invert Colors" for all the machines)

Monday, July 09, 2012

Pictures from at Austin .Net Users Group, July 9, 2012

Gabriel Schenker spoke to 45 people at the Austin .Net User's Group tonight about Command-Query Responsibility Segregation (CQRS) and Event Sourcing (ES). Here's a few photos, in case you wonder what an ADNUG meeting looks like:
A few of my notes:
  1. polyglotprogrammers.org are meeting the 2nd and 4th Thursdays of the month, 6:00 - 9:00 pm to code and learn new languages here in Austin. Meeting at Headspring's new headquarters now.
  2. www.aspconf.net will be live screencast with big names.
  3. Gabriel Schenker wrote a book on NHibernate, but is using no database on his current project.
  4. Using CQRS with ES can be taken to the max and yield not an Object Oriented system but a Functional design.
  5. Look Ma, no database. In his example, data was stored as JSON objects in plain system files using Google Protocol Buffer serialization. A GUID was embedded in the filename with an object name prefix, recipe-7c9e6679-7425-40de-944b-e07fc1f90ae7.txt
  6. Since some files systems (cough, cough, Windows ...) get slow with over 10,000 files, the files are distributed over many directories with a hash of the filename indicating the directory.
  7. Gabriel's point of view is that it's simpler to write your own document store database, and Inversion of Control container than to incur the cost and overhead of using something like RavenDB if you don't need all the features.

Tuesday, July 03, 2012

Importing Cableone email into a new Gmail account

When a friend was physically moving and needed to retire their Cableone.com account and move to a GMail account, I thought it would be quite easy. After an hour I realized, not so much. Here's the tricky part, Cableone.com mail accounts are already hosted by Google, so the pop account questions asked during GMail import are not what you would expect. In Gmail select "Accounts and Import", then "Import mail and contacts"
Email address is really "myemail@cableone.net", the ".net" threw me.
Pop server is "pop.gmail.com"
Port is "995", select "edit" and select "SSL".

Thursday, June 21, 2012

Pictures from Paul Hammant at Austin IEEE, June 20, 2012 "Client Side MVC"

Paul Hammant, co-developer of Selenium, from ThoughtWorks, spoke to Austin's IEEE chapter June 20th, 2012 on the topic of "Client Side MVC". Here is a summary of my jumbled notes:
  • Lots of job openings are available in Austin.
  • Developers using ClientSide Model-View-Controller frameworks are more productive.
  • The original framework, backbone.js, has lots of competitors.
  • Paul liked AngularJS (made by Google employees in their 20% time) for open source projects and Knockout (made by Microsofties in their off-time) for Microsoft environments.
  • DoubleClick uses AngularJS for their commercial site.
  • http://addyosmani.github.com/todomvc/ has demos of the ClientSide MVC frameworks.
  • CSMVC allow for rapid prototyping.
  • CSMVC offers massive code reduction.
  • Paul thinks Knockout will be an official component in the Microsoft toolbox in the future.
  • "Java and .Net developers need to get involved with JavaScript or get left behind like COBOL programmers."
  • JSON is the Browser Lingua Franca now.
  • JSFiddle.com offers a good tool.
The drumbeat of JavaScript is starting to be deafening. Update: Slides are here.

Tuesday, May 29, 2012

Canoscan 8800F Scanner and Vertical Streaks

I've spent hours trying to remove vertical streaks and stripes from scanned images from my Canoscan 8800F Scanner. In an effort to save others my time, here's the problem and solution.
The problem image:

The solution image:

Canon email help was somewhat helpful, although they never solved the problem. To fix the vertical artifacts I had to lie to the scanner and tell it these were "Color Photos" instead of "Black and White Photos". Then everything worked fine. Must be some bug in the Black and White image processing algorithm.

Monday, May 28, 2012

Move over 1080p, 4K is on the way

Just when you were getting smug with your 3D 1080p video display, the International Telecommunications Union (ITU) just adopted specs for the next generation of video called "Ultra High Definition Television", UHDT.

The new spec comes in two flavors, 4K and 8K. 4K means the pixel count is 3,840 x 2,160 giving 8 megapixels per screen, instead of today's 1,080 x 1920 pixels which has 2 Megapixels. The 8K version packs 32 megapixels. This will be wonderful.

Already Peter Jackson and others are shooting in this new format. Get ready to re-buy all your favorite movies - again and start saving up for that new 4K screen.

But where will the madness end? I'll tell you. 576 megapixels. That's the estimated resolution of what the eye can really detect. Doing a little math for a 16x9 ration screen, [(16x)(9x) = 576Megapixels, solving for x gives us 2Megapixels] yields a screen 32Meg by 18Meg.

But, ultimately we will use individual glasses where an image is directly written to each retina by a tiny laser giving us crisp perfect 3D pictures. Yeah, lasers writing to our eye balls, creepy, but get over it - it's the future.

Wednesday, May 23, 2012

Google - u so awesome

I was trying to bring up the Chrome browser using "Launchy" (which is a must for Windows systems), but my right hand was over one letter to the right, so although I tried to type "chrome", it came out "cjrp,e" instead. Launchy didn't understand "cjrp,e" so it forwarded me to Google, which much to my delight, actually understood and showed results for "chrome". Amazing. Thank you Google - u so awesome. (Curious, I asked bing and it showed me a page for CJRP, a French-language Canadian radio station.)

Saturday, May 19, 2012

Google AdSense Report Thinks I'm Using an Unsupported Browser

When I visit the AdSense reporting site in FireFox, AdSense thinks I'm using an unsupported browser (the source html even recommends downloading a version of FireFox newer than 3 (but I'm using 12.0)). AdSense shows me a really scaled down report version designed for mobile. The problem turns out to be "Ad Block Plus". It is interfering with the Google's browser detection. To turn off "Ad Block Plus" in FireFox, select "Tools/Ad Block Plus/Disable on Google", then you will get the full richness of the amazing reporting from AdSense.

Tuesday, May 01, 2012

HTML5 excanvas "Object doesn't support this property or method"

I'm building a little HTML5 practice page at www.MyDoodleDot.com and was having problems getting "excanvas", the shim for using the HTML5 canvas element in older IE browsers. In my HTML I included the conditional running of the excanvas shim with this:
<!--[if lt IE 9]><script type="text/javascript" src="excanvas.compiled.js"></script><![endif]-->
But when IE got to the second line below, it would die with "Object doesn't support this property or method".
    var canvas = document.getElementById("mycanvas");
    var context = canvas.getContext("2d");
The problem was that excanvas.js had not been fully loaded, so when IE hit that line, the canvas object didn't have a "getContext()" method. This happened because I was using this to start my javascript,
$(document).ready(letsStart);
The "ready()" method kicks off when all the DOM has (pretty much) loaded, but excanvas.js still wasn't loaded. The solution was to replace "$(document).ready(letsStart);" with
window.onload = letsStart;
Then my canvas app started working fine with an old version of IE.
BTW, my five year old daughter made this with www.MyDoodleDot.com

Monday, April 30, 2012

Making Contact Sheets with "montage"


Being very cheap, er,..., I mean frugal, and wanting to get a bunch of small pictures printed on real photo paper that I could slice into tiny 1 inch by 1.5 inch smaller-than-wallet photos, I used the open source, free "montage" program in the ImageMagick suite of tools on windows XP to create a contact sheet with this command:
montage pencil.jpg pencil.jpg pencil.jpg pencil.jpg pencil.jpg ^
pencil.jpg pencil.jpg pencil.jpg pencil.jpg pencil.jpg pencil.jpg ^
pencil.jpg  pencil.jpg pencil.jpg pencil.jpg pencil.jpg ^
-tile 4x4 -geometry +0+0  -border 0 -rotate -90 pencils.jpg
(Surely there's a way to not repeat "pencil.jpg", but I was in a hurry.) The source photo, in this case "pencil.jpg", needs to be 1 inch by 1.5 inches which will reproduce 16 times on a standard 4x6 inch photo. This is great if children want to give others a small picture of themselves.

Friday, April 20, 2012

Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option

While running a test from a project I've taken over, I get this error:
Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option
My first thought is , "I thought the .NET Framework kinda *had* to run CLR code." Turns out the project is using .Net CLR inside the database. The error message wanted to be
Execution of user code in the .NET Framework inside the database is disabled. 
Execute this TSQL:  "sp_configure 'clr enabled',1" and "RECONFIGURE"
So to fix this run this TSQL inside the database.
sp_configure 'clr enabled',1
GO
RECONFIGURE
GO
sp_configure 'clr enabled'  -- make sure it took
GO

Thursday, April 19, 2012

Pictures from Enterprise Mobile Applications with ASP.NET MVC 4 Workshop

Jimmy Bogard and Jeffrey Palermo from headspring.com gave an insightful presentation at Enterprise Mobile Applications with ASP.NET MVC 4 Workshop to 45 people last Tuesday. Here's a few pics:




My jumbled musings and take-aways:
  • Microsoft is starting to realize we are in the 21st century and thankfully putting their MVC4 in an open format that ... gulp ... real users can see the source code and submit fixes at aspnetwebstack.codeplex.com. This is such a welcome change from the "We-are-the-smartest-people-in-the-world-and-no-one-else-could-possibly-contribute-anything-of-value-to-us." attitude.
  • "Web Api" is the new term for http access to data. REST is a little too vague.
  • alt-mouse.select will allow block editing in Visual Studio.
  • Chrome has a handy extension, "Advanced Web Client", for playing with web services, ur, I mean "Web Apis". It allows you to enter headers like "accept: application/xml" to tell MVC4 what for to download.
  • Skeleton is a good css framework for creating Responsive Web application so layout changes intelligently with changing screen size. Skeleton uses a 960 pixel area divided into 16 strips.
  • Headspring has example code checked in at bitbucket.org/headspringlabs.
  • Much of the Responsive Web is done with the @media query in css:
    @media screen and (max-width: 524px) {
    #container, footer, #sidebar, #content { width: 292px; }
    #content article h2 {font-size: 24px;}
    }
    
  • MVC4 has automatic bundling of css files, so you can declare a directory of css files and it will bundle and minimize all the css files into one file to speed delivery.

Wednesday, April 18, 2012

The URL-encoded form data is not valid

As a developer, it's the call you always dread.
"Hey, you know that web site that's been working great for years - it's broken."
We had that experience this last week with this error:
SOURCE: System.Web
LOCALPATH: ...
TARGETSITE: Void FillInFormCollection()exception: System.Web.HttpException: 
  The URL-encoded form data is not valid. ---> 
System.InvalidOperationException: 
Operation is not valid due to the current state of the object.
at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()
at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)
at System.Web.HttpRequest.FillInFormCollection()
--- End of inner exception stack trace ---
at System.Web.HttpRequest.FillInFormCollection()
at System.Web.HttpRequest.get_Form()
at System.Web.HttpRequest.get_HasForm()
at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
at System.Web.UI.Page.DeterminePostBackMode()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
To prevent malicious attacks against asp.net sites, Microsoft in the patches for Bulletin MS11-100 limits the number of name-value pairs to 1000.
To increase this number you need to add this key to the website's web.config or to the machine.config(s) on your servers:
<add key="aspnet:MaxHttpCollectionKeys" value="3000" />

Monday, April 16, 2012

Reducing the size of Sql Server log files

How do I trim down the size of log files in MSSQL 2008?
A quarter of my precious SSD disk space on my dev laptop was in database log files, the *.ldf files in C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA.
Since I'm not a Sql Server expert, I googled and stackoverflowed and patched together the minimum statement I needed to rid me of these tenacious ldf files.
Do not use these on production machines. Use only on development boxes where you are testing and really don't care about the database. This statement took the log size of my typical database from 15Gig to 30K.
DBCC SHRINKDATABASE ([MyDatabaseName], 10, TRUNCATEONLY)

Friday, March 09, 2012

Photos from Agile Austin March 6, 2012

Bob Wilson,the owner of Industrial Andons and Jidoka Consulting (www.industrialandons.com) presented a overview of the Lean process and conducted an interesting demonstration with Legos.
pic
pic
pic
pic
In the demonstration we had two teams with processing plants scattered throughout the world, or the room in our case. A runner had to move Lego pieces in batches between plants where the Legos were processed for 4, 7, or 10 seconds.
pic
pic
pic
pic
pic
pic
pic
pic
pic
The game emphasized the lean principles of no overproduction and continuous flow. Bob showed a surprisingly simple solution at the end.
pic
Afterwards I had a chance to talk with Bob and asked him what mistakes he sees most often with software companies. He said most software companies spend too much time upfront in requirements gathering and design, and not enough in simple prototypes and discussions with the users.