Is Giles Bowkett full of shit or an utter genius?
Posted by Nick on 3/11/2010 filed in Blogging, ProgrammingSo Giles Bowkett put up a pretty interesting post the other day. He put up the a post on what to do if you get fired, offering a story about how he has increased his charge rate over the years to despite getting fired. Its a little bit rambling at times, but it does bring up a lot of good points. His main jist is that in order to advance in your career (getting more money, working with better technology, etc.) you need to increase your reputation. And peppered throughout the posting, he has an obscenely long blurb describing how he is going to help you do this. At the end, the punchline is that he’s offering a movie and a few other options for only a few dollars… he can show you how to do this.
At first glance this sounds pretty crazy. Or like a scam. But… Giles is a pretty sharp guy. I’ve been following his blog for a few weeks, and its been interesting. I also watched his preview video, and decided I’d take the bait.
In the video he discusses a lot ways to improve one’s standing in the community. Its kinda funny, a lot of the things he suggests are things I have been trying to incorporate into my usual routine. Some are really obvious, others are new (at least to me).
A lot of “self help” products tend to follow this pattern: Make an outrageous claim to get people’s attention, then offer “common sense” steps to achieving the original claim. A lot of times the price one pays to learn these “secrets” seems to be far out of proportion to the actual value. At $39, would Giles’ video be the same thing?
Giles is bit of a troll with some of his postings. Would buying this video be the ultimate act of “feeding the troll”? If you read his post, there’s a definete pattern to his writing. He’s clearly got a message that he’s trying to deliver (or whet one’s appetite to get them to purchase the video), but he also likes to ruffle some feathers along the way. For a blog post that hints at the importance of boosting one’s position in a community (this is geared towards programmers), its important to make sure that the message doesn’t get lost in the drama of the presentation.
Does the signal rise above the noise? 37signals are masters of this type of message delivery. They talk the talk, and they walk the walk. They are masters of telling you what they are going to do, and then doing it.
Giles’ presentation covers a lot of ground, and like I said earlier, some of it was familiar. Other topics were new (or shown in a new light) at least for me. But I have to admit, how he stitched these ideas together was pretty interesting. The combining of these common sense ideas and focusing them in one direction can really pay off.
The main ideas are being a better blogger (marketing), contributing to open source code (relationships/skills/karma), and making presentations (communicating). Improving any of these skills would probably benefit most people. Giles’ assertion is that improving all three leads to powerful results, as they did in his case. Can this be replicated by other people? There’s only one way to find out.
So what is Giles? I’m leaning more towards genius. His approach is a little odd because of the troll-vibe, but I think his fundamentals are pretty sound. Good ideas + solid implementation = success. It is a formula that’s been proven correct over and over.
If nothing else, he’s a genius for making the video. There’s enough people out there that are curious enough to pony up the cash. So while we are trying to figure out how to get a leg up, he’s already 5 steps ahead.
Being subversive with Subversion: Mercurial in the middle
Posted by Nick on 2/25/2010 filed in OS X, Programming, Python, Software DevelopmentDVCS is a popular topic these days on the internets, but for those of us who code for our day job find that more often than not we have to use the tried-and-true standard of something like CVS. Or if you are lucky, SVN. Personally I think SVN is pretty good (especially compared to CVS), but the other day a feature of DVCS’s caught my eye.
The ability to branch quickly and in a lightweight manner is one of the major selling points of systems like Mercurial and Git. Recently I’ve been thinking about trying out some refactorings and that can be difficult to do when you need to make sure that you can have a build-able version of your code at all times. Some things just take time, and the whole point of refactoring is to improve your code so rushing through it to meet an unrelated code deadline just doesn’t make a lot of sense.
Enter Mercurial.
There’s a project for Mercurial called hgsubversion that will allow you to pull from a subversion repository and make a mercurial repository locally. (Yes, git has something similar) Then you can hack away to your heart’s content using hg to branch and keep track of changes without pushing the changes out globally to the other SVN users.
This is exactly what all of the cool kids using hg, git, and bzr have been doing for years. Now those of us who talk to SVN can leverage this technique to bring a little more awesomeness to our day-to-day work, and no one is the wiser. At least that’s my theory.
Installing hgsubversion on a Mac or in Cygwin is like pulling teeth. I take that back, pulling teeth is not as painful. Plus you can leave your teeth under your pillow for some cash… but I digress. The best way to install it (for me at least) is to do the following:
- Have the following installed: mercurial, easy_install, the XCode tools (command line tools like gcc)
- Get a copy of the python swig bindings for Subversion. Collab has prebuilt binaries that seem to work best. I just copied the bindings from /opt/subversion/lib/svn-python/ to my python site-packages directory. I installed Python 2.6, so for me that path is: /Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages
- Get hgsubversion by typing at the command line:
hg clone http://bitbucket.org/durin42/hgsubversion/ ~/hgsubversion - cd into ~/hgsubversion/ and type in python setup.py install
- For me, the system had to download a few things and build them, so make sure you have XCode and the 10.4 SDK installed. (I’m running XCode 3.2.1 for this exercise)
- Hopefully everything completes normally. If it does, do a victory shot. If it fails, do 2 shots and then try to figure out what went wrong.
- Next make a file in your home directory called .hgrc
- Inside the file put the following:
[extensions]
rebase=
svn=/Users/<YOUR USERNAME>/hgsubversion/hgsubversion
- This should tell hg that you’ve got something extra for it. I went blind sometime during my attempts to get this working and had a typo in that line that kept me from getting it working for an embarrassingly long time.
- If you have done everything right, the moon is in the proper phase, and the wind is blowing from the NW at 7 mph, then this command should let you pull down a project from Google code:
hg clone svn+http://<A PROJECT OF YOUR CHOICE>.googlecode.com/svn <WHATEVER DIR>
- The end result should be a mercurial repository on your local machine. Refer to the link for hgsubversion for more details about commands and links to other installation instructions. (Some are older than others, and the commands have changed a little bit over time.)
So, that’s what I’m up to. Hopefully this will let me do some interesting experiments locally without sacrificing the safety blanket of using version control.
Test with big data sets
Posted by Nick on 11/21/2009 filed in Programming, Python, Software DevelopmentEvery so often I re-learn this lesson: Make sure you test your code with the same amount of data that your users will use.
Developing with small data sets is fine, and most of the time that is what you want to do as you work out the kinks of the code. But when it is time to ship the code, you must test with a large data set.
For rent my resume.com I’ve been testing one portion of it with 4 different size documents. This is a fluke however, I chose the documents based on the contents not the size. Today I made a simple change that turned out to have some unforeseen ripple effects.
When I write unit tests, they seem to fall into two categories: Tests where I just do a simple check on the size of a return (i.e. did I get 21 items in the list?), and tests where I check the contents of the resulting data.
As a side note, you should really do both kinds of tests, not one or the other. Simply checking to see that the right number of things was returned is no substitute for making sure that the correct data was actually returned!
Today I was re-running my pyunit tests and one of the four failed because the size of the returned list wasn’t what was expected. By coincidence this happened to be the biggest data set I was testing with. If I had not had this test, I would have thought everything was ok, but it truth my modified function is returning questionable data!
There are of course other benefits of using larger data sets, mainly seeing how your code works under stress. What works fine for 10 items might not be so great with 1000 items. Testing with a large data set at the end will help catch these problems and will also help you adhere to Knuths’ advice to not optimize code prematurely.
So, now I’m off to learn how to trace through python code to find out how such a seemingly simple “fix” to my code could so subtly break it…
More on breaking functional fixedness
Posted by Nick on 11/2/2009 filed in ThinkingHere’s a fun little video that poses an interesting question. If you had $5 and 2 hours, what could you do to raise the most money?
Aside from various illegal schemes, the people in the story came up with some fairly inventive ideas. I hate to use the phrase “out-of-the-box” but that really sums up the thinking approach the participants used.
Having said that, I thought the restaurant idea was better than the “winning” idea. Why? It provided a service of tangible value to a larger group of people, and is something that is probably reproducible (i.e. you could probably do that over and over).
And as the presenter pointed out, sometimes we put constraints on a problem that are totally of our own making. Breaking free from those can lead to some really interesting (or profitable in this case) solutions!
See also: Overcoming functional fixedness
Rate-my-resume.com is now live
Posted by Nick on 10/11/2009 filed in Productivity, Programming, Python, Software Development, WebIn my last post, I put up a link to a little project I’ve been working on. I finally got around to giving it a proper name. (re)Introducing:
Now if you are wondering if your resume is a good match for a particular job posting, you can use my site to find out! At the moment I’m giving the score in terms of 0 (being a total non-match) to 100 (being the absolute perfect match). In this economy, the more your resume reflects the skills listed in a particular job, the more likely your resume will be looked at seriously.
If you run your resume through and it gives you a low score, look at your resume and the job posting and try and figure out what keywords are in the job posting that are not in your resume. Then, assuming you have the necessary experience, put those keywords into your resume! Be sure to add them in a way that makes sense to a person, after all humans (especially HR people) don’t like to read fragments and words peppered into someone’s resume.
Try out the site with your resume and see how you rank!
p.s. Python rocks!
Matching resumes to jobs
Posted by Nick on 10/3/2009 filed in AI, Google, Python, analytics, djangoHave you ever looked at a job posting and tried to figure out if you are a good match for that job?
I’ve written a Google App Engine application to try and help people figure that out. Paste in a copy of your resume and a copy of the job description, and it will try and figure out how well of a match you would be for that job.
Check it out: http://app.ironboundsoftware.com
I’m really impressed with the Google App Engine environment (go Python!) and had fun writing this. Hopefully this will help people out in their job hunt. Times are tough, and hopefully this little application will help someone get into the perfect job for them.
Try it out and let me know what you think!
Java Set
Posted by Nick on 8/16/2009 filed in Java, ProgrammingHaving a list of items is pretty useful. Sometimes its really useful to have no duplicates in that list. Java helps you to do this via the Set interface and its various implementations.
The Set interface basically defines a class that will hold a set of objects, and in the process not allow duplicates. (If you are ok with having duplicate items look into using something like ArrayList.) Like other things in the Collection family, Sets have an iterator() method that will provide you with an iterator so you can access the items being held by the set.
One example of a Set implementation (and probably one of the most common implementations of Set) is the HashSet. HashSet simply stores objects passed to it via the add() method according to its own internal heuristic.
If you need to control the order that items are read from the Set (i.e. the objects should come out in alphabetical order) then the TreeSet class is the weapon of choice. TreeSet uses a Comparator that you can set (optionally) that will allow the set to order the objects as they are added. This is enormously useful when your code receives some data from some source (a database, a web source, etc.) and you want to make sure that the data is sorted and is unique.
Sets pop up in several places in Java, one of the most notable is in Maps. Since a map is a key-value data structure, the keys should be unique. As a result, if you call keySet() on a Map you will get a collection of the keys for that map, and it will be a Set object.
Hero of the week: Stewart Butterfield
Posted by Nick on 6/12/2009 filed in EntertainmentNot only did he help create a kick-ass useful website (flickr), but he knows how to respond to mis-directed emails:
http://valleywag.gawker.com/5288759/flickr-founder-calls-nuked-user-a-dick
Lightweight TDD
Posted by Nick on 5/25/2009 filed in Programming, Software Development, ThinkingThe more I used Unit Testing (particularly JUnit) the more I like it. It is a great way of tracking progress in your code, and more importantly making sure you haven’t broken something in the process.
I’m not a huge fan of traditional Test Driven Design (TDD) though. My biggest complaint is writing a battery of tests before writing the actual code feels like putting the cart before the horse. I’ve been experimenting with it, and most of the time I’ve found that if my code is structured “correctly” (i.e. a well defined API/interfaces, dependency injection, etc.) TDD will work pretty well.
However I have found that I like to use TDD one test case at a time. Basically I will get the basic framework of my class(es) together, and then as I refine the capabilities of the class, add in a few tests to catch one or two conditions. Then I work on my code to make sure that it is performing as expected. Once everything is going well the tests pass and it is time to move on to the next part of the class.
The big advantage for me in this is that I only have to worry about getting a small number of tests to pass instead of all (or a large number) of them. By breaking the tasks down into smaller pieces I find that I spend less time “dreaming” about how my code would work (and writing tests that don’t accomplish much or have to be re-written as reality sinks in). Instead I’m able to focus on a single problem and solving it.
This is a similar approach as to what is advocated in the unit testing community: When a bug is found, create a test that exposes it. Then fix the code and the test should prove that the underlying problem is gone. I really like that approach and I have begun doing that as often as I can. So far it has really paid off in terms of making sure my code doesn’t have bad case of “but-I-already-fixed-that!” type of bugs.
Comma Separated Values
Posted by Nick on 4/11/2009 filed in Productivity, Programming, PythonQuestion: How much does python rock?
Answer: More and more every day.
Today I was writing (for what seems like the millionth time) a little script to read CSV (Comma Separated Values) file. After running into the same issues over and over (picking a delimiter, escaping delimiters, etc.) I decided my sanity is worth the 30 seconds it would take to see if someone else has already written a CSV library. It turns out python has one built in. Since 2.3. D’oh.
import csv
lines = csv.reader(‘myfile.csv’)
That’s all that’s needed to read in a csv file and have it properly handle the delimiters, even when they are inside of escaped text (i.e. something like “$3,000″ will be read as $3000 instead of $3 and 000).
Python rocks again.