Linux is awsome

Uncategorized
At work we process many millions of emails a day, so we get a lot of bounces. The following code helps me make the system smarter. It translates to "for the most recent five users who's received a bounce message, find all of their bounces in the last 24 hours and show me the Subject lines, with user and date information." find `ls -1t | head -5` -type f -mtime -1 -print0 | xargs -0 egrep Subject /dev/null | less
Read More

tiny "Hello World" webserver

Uncategorized
I'm writing a Nginx configuration that will wrap password protection on top of a bunch of dependent web servers. For testing, I want a few "hello world" type web servers, each of one gives a different message, but is really tiny. The following is what I came up with -- great for testing. # USAGE: # python ./hello.py free beer  import SimpleHTTPServer import StringIO import SocketServer import sys PORT = 8000 class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):     MESSAGE = ' '.join(sys.argv[1:])          def send_head(self):         self.send_response(200)         self.send_header("Content-type", 'text/plain')         self.end_headers()         return StringIO.StringIO(self.MESSAGE)      httpd = SocketServer.TCPServer(("", PORT), MyHandler) print "serving at port", PORT httpd.serve_forever()
Read More

Norris Numbers: adding code is great, until…

Uncategorized
Programmers get stuck at a certain amount of complexity. Newbies can write brute-force programs up to 2,000 lines or so, but beyond that it's too hard to manage. You can't keep everything in your brain. Experienced programmers have other tools -- abstraction -- to get up to 20,000 lines in a single project. There are other complexity walls: at 200K, then 2M. There might be a hard limit of any project at 3M lines: "the growth rate seems to slow down significantly no matter how many people (hundreds) or years are involved (decades). " Norris Numbers The author also clearly highlights the problem of Every Line is a Potential Bug -- go read!
Read More

Using multiple worktrees with git

Uncategorized
Modern development with Git is great. It's really easy to work on a feature branch, make changes, undo changes (oops), and share work with colleagues. However, there are challenges. If I'm running tests on my local "beer" branch, I can't easily switch over to the "gin" branch to edit code. The local environment only has one feature branch checked out at a time. I can run tests, or add code, or switch branches, but I can't do two things on two different branches at once... But now I can! Thanks to Manoj Mahalingam S, I know understand the "git worktrees" feature which lets you easily use multiple branches at the same time. Thanks, Manoj! Using multiple worktrees with git
Read More

class: Django QuerySets and Functional Programming #2

Uncategorized
The class last night at TrueCar was a lot of fun!  Lots of friendly people. Here the the slides, in web and raw Markdown format: Django QuerySets and Functional Programming #2 slides -- source Thanks so much to Chris at TrueCar for asking me to talk. Thanks to Chuck for the review, Goz for the feedback, and An-lon for the support. Thanks to all of you for coming out!  I look forward to the next talk. Here's the view from the office just off the Pacific Ocean(!) in Santa Monica: There was a good attendance: Not pictured: cute pug dog who snored at my presentation.  I like to have my participants feel comfortable ;)
Read More

Kanban Development Oversimplified

Uncategorized
I loved this article It's clearly written, with a brief descriptions of the large numbers of tradeoffs within the Agile ecosystem. Specifically, choosing a different size length of time to develop each feature makes a huge difference. I've been using very small, one-day timeboxes. The article notes that larger boxes, four weeks, can often help the client make meaningful, business-oriented decisions vs going over each bit of minutia.
Read More