Archive for the ‘Programming’ Category

1DevDay Detroit is happening this year on November 17th, 2012. Learn more about this awesome developers’ conference, and how you can save 20% off the ticket price (which you can also save by registering bat the Early Bird rate before October 1st.) Details below.

1DevDay is the longest running and largest conference dedicated to Michigan’s Software Developers.   Each Autumn, Programmers, App Developers, Software Developers and Software Architects from across the state meet to network, learn and share knowledge.  This year, the event will be at Cobo Center in the reawakening Downtown Detroit.  It is held on a Saturday to prevent interfering with attendee work schedules, and kept to one day to reduce travel expenses.

Visiting us will be LivingSocial’s Senior VP of Technology, Chad Fowler who will present his Keynote, Self Engineering  as well as the sometimes controversial but always enlightening, software development luminary Ted Neward, who will be presenting his Keynote, Iconoclasm.

Some of Michigan’s brightest and most popular speakers will be presenting sessions.  Some new faces from the community will be here as well as some of our favorite speakers from across the US. Learn more…
Mobile technologies, JVM based technologies, C# and .net technologies, Web technologies, Big Data, even the Mainframe will be represented.  If we could add more, we would.  Learn more ….
I hope you will consider joining us for 1DevDay.  If you are interested, just let me know and I’ll get a ticket out to your right away.

We want to get every Software Developer, Software Architect and technologist in the area to attend this year.

Head to http://1devdaydetroit.com to learn more about the conference. When you’re ready to register, use the promo code DECAFBAD to save an additional 20% off the ticket price.

Hope to see you there!

Today marks the day that I shipped off my office equipment to my former employer. Next week, I’ll be starting a new job; one where I’ll be working web development in my favorite new language, Python. Looking forward to the new challenges, as it’s been a while since I’ve done web development (last time was mumble mumble Perl mumble mumble CGI). I’m hopeful this will break some of the funk I’ve had over the past few years for doing any sort of development.

So, here’s looking forward to 2012, and the challenges (and changes) it brings.

Rick and I spent last weekend at the 1DevDay Detroit conference, held at the beautiful Compuware building in Downtown Detroit. Unlike conferences like PyOhio, Pycon, or Ohio Linuxfest, the conference wasn’t centered around one particular piece of technology, but was instead focused on the craft of developing software.

On Friday, after a quick bite provided by Pillar (thank you, Pillar) at the Hard Rock Cafe in Detroit, Rick and I went to the keynote presentations. The first was by SRT Solutions‘ co-founder Diane Marsh, who gave an excellent talk on how you as a developer are indeed your own company. The talk was inspiring, and outlined her own path from working as a consultant to becoming a “reluctant entrepreneur”.  Awesome talk, as always.

Next, Bruce Tate presented one of the highlights of the conference. His talk was a follow-up to his book “Seven Languages in Seven Weeks”, and really set the stage for the whole conference for me. The languages included Prolog, Clojure, Scala, IO, Ruby, Erlang, and Haskell (not in that order), and what followed for each language was a comparison between the language and a movie character, and some of the reasons why that language was worth reviewing. Highly informative, and definitely a kick in the pants for anyone out there content to find the one-true-language. It was also interesting to see what concepts could be borrowed from other languages.

Saturday was the workshops and presentations day, and there were no shortages of interesting topics to cover. The first for me was the Functional Languages talk, which was a continuation of the “foreign languages” theme for the weekend. Afterwards was the excellent talk by Justin Searls about Javascript, Jasmine, and Coffeescript. Lots of good brainfodder in that talk. Afterwards Rick and I had a spirited discussion with Justin and Karl Swedeberg about Javascript and the place of JQuery. Very good points all around on the place of JQuery and Javascript, and one of those conversations that happens at developer conferences that you don’t expect going in there.

Lunch was at the Compuware building cafeteria, and was awesome. Thanks to the 1DevDay Detroit folks for making it possible.

The next talk that I went to was a sort of intermission talk about lessons learned from improvisational comedy applied to development. Definitely food for thought about how we approach the development process.

Next up was Kevin Dangoor’s “New Tools for the Web” discussion. Kevin has an amazingly unflappable demeanor, and the discussion proved extremely informative. This might sound cliche, but it’s a great time to be a web developer.

Last, but certainly not least, Rick gave a talk about the importance of code readability. His example case was PEP8, which outlines the best practices for code under Python. It is also the name of a handy tool (pep8) which will review your Python code and let you know where you have sinned where you can improve your code to make it conform to the standards. There were several folks in the room looking for similar tools for other languages (C# in particular), but the main message of the talk was to adopt readable coding standards with your team, and stick with them. Even if you don’t adopt all of the rules for PEP8 (80 column lines is a tough one for me), at least know which ones you’re ignoring and have good reasons for why you’re ignoring them.

I’d like to thank the 1DevDay Detroit folks for putting together an amazing conference. This was the first conference I’ve been to that emphasized that it’s not the tools that make the developer, but the developer mindset that is important. I think that’s key for all developers who want to improve their craft. (You’d laugh at a carpenter that says they only specialize in screws and screwdrivers, but yet developers that specialize in Java are somehow OK.)

“The  DetroitDevDays mission is to build a software developer community in the Detroit area that is regarded as the best in the world.” It’s a lofty goal, but after participating in the conference, I think it’s definitely achievable.

Looking forward to next year already.

JoDee and I rode down with Rick to PyOhio 2011 (which was near the end of July this year). I always have a great time during PyOhio, and look forward to meeting up with everyone down there in Columbus. Yes, we vacation in Ohio.

PyOhio has been growing by leaps and bounds since it’s inception, thanks in no small part to the volunteers like Catherine Devlin, Eric Floehr, and the rest of the tireless folks that help make PyOhio run as smoothly as it does. Thanks to the efforts of the PyOhio crew, there were T-Shirts and bags for those who registered early (and a smart looking T-Shirt and bag combo they are; perfect for accessorizing any geek). The list of sponsors was also quite amazing, and I’m thrilled that my former employer Geeknet had a presence there.

On Friday, Rick, JoDee and I walked over to a very fancy restaurant for dinner. Unfortunately, when we left, it began to rain. And rain. And rain hard. When we got back, we were completely soaked. We all looked like participants in some wet T-shirt contest, and my shoes were soaked beyond belief. After getting back to the hotel and drying off, I paddled down to the lobby to meet with Rick for an impromptu Bookie sprint.

The next morning we headed over to the conference. JoDee tried to sit in on the Python 101 talk, but the room was pretty claustrophobic with all of the people in there, so she came back out. She was crestfallen that she couldn’t stay in there (and I don’t blame her, as later I sat in on the Panda3D talk in there, and felt rather claustrophobic in there). She still wants to learn Python, though, since the astronomy community has picked it up as a replacement for FORTRAN, but it wasn’t meant to be.

We met up with Ben Rousch in the round room, as he was prepping his talk “Django and Google App Engine: Why I’m using Flask and Amazon EC2“. Also caught up with my former work-mate Dave Brondsema, which was cool. He was there talking about the new open-sourced hotness at Geeknet called Allura (aka: Sourceforge Beta). Having seen this project grow up, I’m thrilled with how far it’s come.

Rick and I sat in on Chad Whitacre’s Aspen Framework talk. It’s pretty interesting, though I’m not sure if I’d use it. Seems to combine some of the problems of PHP into Python, since the templates are combined with the model / controller code. I’ll have to check it out more to see if my opinion still holds.

After lunch, I sat in on Peter Carswell’s Panda3D talk. Panda3D is a very cool framework for quickly creating 3D games. During the talk, I exported a blender model of Sally (the monkey head) and had a ring of monkey heads displayed. Definitely checking this framework out more when I have a chance.

Next JoDee and I went to hear Rick Harding preach the goodness of SQLAlchemy. Definitely watch the video when it becomes available, because SQLAlchemy is awesome for typing objects and databases together, and Rick is awesome at explaining the nuances of how to make this all work together. Unfortunately, his talk was in the same claustrophobic room as the Panda3D and Python 101 talks, and around that time the air conditioning for the building turned off. So what should have been an engaging second-half with people working through Rick’s tutorial code turned into a diaspora as folks looked for other places to hang out.

I walked JoDee back to the hotel where she had her own adventures (ask her about them. ;) ) and arrived back in time for the lightning talks. After which, we headed over to Emma’s happy hour (free beer!), where I got to meet up with Chris Everest, one of my former Geeknet co-workers, and super-awesome guy. From there it was on to Subway (free subs!) and proceeded to have an amazing Bookie sprint with no less than a dozen folks working on Bookie. Truly awesome. As Rick and I walked back to the hotel, we were both giddy with excitement. The only way we could have been happier is if fireworks were going off in the distance. Fortunately, the nearby fair provided said fireworks.

Sunday rolled around, and we slowly rolled with it. After checking out of the hotel, we went back to PyOhio (which started after noon). Taavi Burns had a great presentation on evolving an internal web service, which I’ll have to watch again to fully appreciate (lots of great content). From thee I went to watch Morgan Goose talk about Fabric from a sysadmin perspective. Definitely some awesome concepts there (especially the comment about using it to help customize virtual machine instances. Hmmmm). I took a small break and then finished off the day with Isaac Kelly’s Creating Web APIs that are a joy to use. Definitely going to need to see the video again. Lots of good information.

Unfortunately, we had to get on the road, so after saying our goodbyes, we hit the road again.

I can’t say enough good things about PyOhio. If you have even the inkling of wanting to learn Python, or want to see what the fuss is about, definitely plan on heading there next year. Also, check out the videos of the talks (I know there were several talks that I wanted to attend that I’ll be checking out, including the one where Python is ported to the Atari ST. (Hopefully the video for that will be up soon).

Thanks again to everyone at PyOhio. Hoping to see you again next year!

I recently had an epiphany, which may seem painfully obvious to most programmers, but it took me a little while longer to realize.

Under Python there is a module called doctest, which allows you to script an interactive session and look at the results. A sample would be:


>>> print 2+2
4

If I put this snippet into a text file, test.txt, and ran it with python -m doctest test.txt, I’d get no output, because the test passed (printing 2+2 under python gives us 4). However, if I put the following into the test.txt file:


>>> print 2+2
3.14159

and run it with the same command, I get the following:


craig@lister:~$ python -m doctest test.txt
**********************************************************************
File "test.txt", line 1, in test.txt
Failed example:
print 2+2
Expected:
3.14159
Got:
4
**********************************************************************
1 items had failures:
1 of 1 in test.txt
***Test Failed*** 1 failures.

Which is expected. (There’s no way that 2+2 is going to equal 3.14159).

So, you may be asking yourself, how does adding this to my normal code make me lazy? Isn’t this more work?

Well, considering when I’m writing new code, I’m constantly running the code in an interactive environment, and essentially doing the same scripted commands over and over again (albeit, a lot slower than the computer can), this is a huge time-saver. Essentially, I can script the session, and test the new code in seconds, and be alerted if something changes.

Anyone who says they don’t have time for testing their code is deluding themselves. If you think you don’t have time for testing, ask yourself if you couldn’t save a few keystrokes testing the code manually? Why not have the computer do it for you instead? After all, isn’t that what computers are for? (Handing tasks that would otherwise be drudgery).

EDIT: And yes, I know that doctest doesn’t scale well the same way that the unittest framework does. Right now with the code I have, it’s not that big of a deal. I know that eventually I will need to switch. :)

I reinstalled the blog after unsuccessfully dealing with the latest Pharma Hack. Basically, this piece of shitcode  detects if your site is being browsed by a search engine, and replaces all of your links with pharma spam. Splendid, no? More info is available at Chris Pearson’s blog.

Here’s a little bit of Python that I’ve put together to check the status of my sites. This has been great for figuring out if I’ve been hit or not. Released under the public domain.

UPDATED: Moved it to a separate file for my own sanity: check_url.py