Archive for the ‘programming’ Category

Paper todo system

March 11th, 2011

I really like pen and paper for my todo lists. Which is ironic because my handwriting is dreadful.

I was meeting  a friend for coffee and they asked why I needed a notebook, and I showed them my system. He thought it was good enough I should share it.

I’ve tried many systems, GTD, 7 habbits, AutoFocus. If it can be done with fancy stationary, I’ve probably given it a shot to see how it goes.

My system is the best of those previous 3 that I can see. I use a medium sized notebook, 5″ x 8 1/2″, I really like the feel of acid free paper but that really doesn’t matter.

I write out everything that I can think of that I need done in the middle of the page, as a running list. No priority, no filter, just stream. This becomes the master list. A good master list is made up of actionable statements. “Mortgage” is not a thing to get done. “Call mortgage officer at x bank about mortgage rates” is a good item.

So now we have a master list of things to work from. Flip the page and write the date on top. Scan over the master list and pick 3 things you can take action on in the next few hours.  Write them on this page. An action can be to delegate it, complete it, make some progress and then postpone the rest, or cancel it entirely.  To denote the action taken I use the Franklin planner style. For complete a check mark, fairly normal. For delegation, the initials of the person, and a circle around it. For started a dot, if completed check through the dot, if postponed and arrow pointing right. To cancel something I draw an x.

Now tomorrow rolls around. Now you need to track which page you are on, I use a paper clip, ordinary metal that I can get at anyone else’s desk if I need one. Flip the page, put the paper clip on that page, write the date on the top, pull over any deferred items first, then write in  the next 3 things you can do from the master list.

If anything new is added to your plate while running this course, just add it to today, not the master list. The master list is just a jumping point. If you find yourself procrastinating or you need to break things down, just flip to a blank page, start a master list, and get more granular and start over. As long as you move your paper clip, you won’t be confused by this exercise, and you can get back on track quickly.

Other hacks, that I’ve come up with to make this even better include, writing phone calls from the bottom up on the page. All others from the top. Usually phone calls need knocked out all at once, so its easy to whip out the smartphone and tick off 4 things quickly.

I would love feedback on how you do this kind of thing.

Posted in craftsmanship, programming | Comments (0)

Book Review: Javascript the good parts

March 10th, 2011

I’m working on a project which is javascript intensive. It’s probably 90% of this app. So I was looking for a way to sharpen my javascript.

So I heard that I should pick up “JavaScript: The Good Parts” to help learn how to structure javascript for use in the dom and elsewhere.

Now that I’ve gotten it and read through it, I wish I’d had it years ago. Crockford skillfully guides you through javascript, showing you the grammar and how it works. All the while carefully explaining the pitfalls and how to avoid them.

He shows you how, even though it looks like a C based language, it shares more with lisp. As well as how to create objects that look and act more to how you would create them in a C based language.

One thing that I’ve known for sometime is the scoping problems with javascript. There is no block scope. There is function scope. So and if(){  doesn’t begin a new scope, variables created there are scoped to the parent function. This is explained very well, and how its just good style to put your variables at the beginning of your function because of that.

The next major pitfall is that the new keyword has some tricky implications if not handled properly, so object names that begin with a capital letter such as Object are meant to be run with the new keyword even though they are able to be executed as var x = Object(); this is just bad news.

I’m now a firm believer that javascript is an amazing dynamic language, with a few blemishes and a bad reputation. This book is all of 130 pages and is deceptively small, given how pumped I am to write code. Also the railroad diagrams describing the grammar opened my eyes to how I can think of other programming languages and statements in general.

Posted in Book Review, programming | Comments (0)

Escaping tfs for git, without burning your history

March 9th, 2011

So we used TFS at work. It wasn’t the worst implementation of source control ever, but there was pain. You know contractors with locks on files from 7 months ago, who have moved on. Difficult to do continuous integration with, due to workspacing and having to have multiple copies of things just to do work on hotfixes.

So we are staring down the barrel of a big project, one that means an extended separation from the current code base. We need a sound branching strategy and we need it yesterday.

When I’ve needed this in the past, I’ve used Subversion, up until a few years ago when I discovered git. It was touted as fixing the many branches problem in open source development communities, a bigger problem than mine. So I’ve been using it on windows and linux for the past few years for every little piece of code I touch. Also I keep my home documents and our image library in git, because synchronization of backups is simpler.

So we have a problem, and a solution, but I couldn’t think of a very good strategy to bridge the gap short of writing a translator. It turns out after consulting stackoverflow, this was a solved problem.

There is a git plugin which connects to TFS and pulls down changesets applying them directly to the git snapshot store, with versions in the comments as to where and who did it in TFS.

There were a few small problems when doing the conversion. Git-TFS, depends on a c# based object model for the git CLI. This c# wrapper is not very good at managing memory on handles to shell calls. So I actually ended up forking the code and debugging it while it converted to make it work in batches and then dispose of its space and keep going. Secondly I had to run in a very minimal mode on my box so that enough memory was available. The final problem was a very large installer of a third party library stored in our binaries repository. The solution was to delete it and remove it from history in TFS, and then all was good.

Other things to look out for. Really really long paths. we had a file that was generated by a microsoft code generator whose path from the base of our solution is 230 characters deep. So if you put it more than a few directories deep, git cannot perform file operations on it, because its too much for the operating system, windows 7. The solution is to keep it close to the root of your drive, which is hacky, but the other option is to fix something that isn’t broken.

Now we have a nice git repo, with 7000 commits, that is ready to go.

On a side note, we used the Turnkey linux version control server. Which meant that we had a linux box, up and running a central server with backups, in vmware, in only the time it took to download the virtual image. If you have a server 2008 box handy this isn’t a necessity, as you can run the central server on iis 7.

Posted in craftsmanship, Deployment, programming | Comments (1)

First meeting of Software Craftsmanship group in Columbus

November 23rd, 2010

Last night we held the first meeting for a new software craftsmanship group, in Columbus Ohio. The turnout was tremendous, rivaling some of the more established groups in town. In total, we had conflicting counts between 26 and 28. That was not the point but just shows that the interest in the subject is greater than I anticipated. We met at a restaurant on the north end of Columbus, we over took the back half.

We all had dinner and discussed what about the craftsmanship movement brought us to the meeting, and then discussed some technology specific things at each table. Due to the rapid expansion in attendance we didn’t have the room to pair and really practice like I was hoping. So, that’s the priority for the next event. We had a good amount of diversity in the room: ruby, python, J (jpl), .net, java, android, iphone, collars, T’s, beers, and sodas.

All in attendance were in agreement, that it’s a breath of fresh air to have a group that is more relaxed about format. Having a “nerd dinner “, even though it wasn’t planned that way, turned out awesome. Typically user group meetings seem so “sit and listen” that its hard to get as much participation as I’m hoping for. Everyone seemed to pick up on the vibe and treat it as dinner with old friends, you know your 27 best ones, and look beyond all the usual religious battles that happen on the open internet.

For the next meeting of the group, Matt Yoho has stepped up and would like to host. It will be on more tech friendly turf for pairing.  The initial thought is to choose a kata ( maybe bowling kata), and everyone pair on it, and then do a quick retrospective on how it went. This is the group I’ve wanted to be a part of for a long time. I’m excited to do it again. We’re starting a google group and other communication tools, to keep a posted status without tweeting daily.

Posted in craftsmanship, programming | Comments (0)

Php downgrade after upgrading distro to Ubuntu 10.4 Lucid Lynx

May 18th, 2010

Many php applications have compatibility issues with php 5.3.1. Unfortunately in that is the only version currently available in the aptitude repositories for the latest version of Ubuntu.

Once you have either freshly installed Ubuntu and php, or after you update just your distro and do an apt-get update, you will be on 5.3. There are lots of people with this problem. Many of them have solutions. Most involve running lots of terse commands. Then I ran across this shell script that once you have everything installed for php 5.3 will downgrade your stack to 5.2.10 for you. Since I’ve had trouble finding the original source after a few days, here’s the source in case you need it.

#! /bin/sh
php_packages=dpkg -l | grep php | awk '{print $2}'

sudo apt-get remove $php_packages

sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list

sudo mkdir -p /etc/apt/preferences.d/

for package in $php_packages; do echo "Package: $package Pin: release a=karmic Pin-Priority: 991 " | sudo tee -a /etc/apt/preferences.d/php done

sudo apt-get update

sudo apt-get install $php_packages

Copy this script into a file in your home directory, make it executable and then run it. It set everything up for me really well.

Posted in programming | Comments (4)

Asp.net web deployment projects, just aren’t enough.

November 16th, 2009

I’ve recently started on a project that has been using web deployment projects. These things are an animal all their own.

There are so many problems that we ran into, I’m just going to list a few.

  1. You need to create deployment projects for each environment to get config section replacement to work properly
  2. It  locks the files in the source and target directories, if for some reason it fails, sometimes you must restart your box to get them back.
  3. There is no way to just exclude a directory in the setup of the project, you have to close your solution and backdoor edit some xml to accomplish this.
  4. You have to add projects to your solution, which basically slows down all your actions throughout the day.

These projects are awesome if  you are in a large enterprise where you need to just hand an installer to your web people and get it on the server. However, if you are a multi dev shop that needs automated deployment to a test server, save yourself the trouble.

I have a few posts on deck explaining how I use alternative tools to accomplish this. I’ll have examples in Nant and msbuild, and maybe even in ruby(rake) or python (straight up). Currently I use Cruise Control .net in order to trigger and run the scripts. I’ve been told that Hudson is a viable alternative. If enough people want to see it I’ll gladly try it out and see if its easier to setup and get running.

So if you are starting a project, just say no to web deploy projects, just write a build script in whatever language you know and don’t bother with the headaches of web deploy projects.

Alternatively, if you think that they are the bees knees, I’d love to hear how you get around my problems with it.

Tags: ,
Posted in Deployment, programming | Comments (0)