My Blog

Advice to College Graduates

A couple of weekends ago, I watched my little brother Luke graduate from JMU. Dr. Rose, the outgoing President of JMU gave the commencement address. I've attended enough graduation ceremonies to know that most of them sound the same and this speech by Dr. Rose was no different. There is usually a whole lot of "be different" and "work hard" with a lot of rah-rah and the occasional funny story thrown in.

Tradition runs through all aspects of our higher education system and maybe that's why most graduation speeches sound the same. But I believe that is a disservice to undergraduates who are about to get a major shock when they jump into the real world. So here are the key points I'd use in a speech.

  1. No one "owes" you anything

Sure, you have a college degree from a "prestigious" university. So does everyone else you're competing with. If you're from a privileged upper middle class existence like me, you've been told how wonderful you are all your life. Let's get it straight right now, you don't matter for shit. Once you accept that fact, you can begin to figure out how you actually can build yourself into something that does matter to other people. You can figure out how to make real a difference in the world. But before you figure out how to make a difference...

  1. Work like you have a chip on your shoulder

Your first job out of college will have a lot of meaningless tasks thrown at you. Work on them fervently and with passion. Learn everything you can as quickly as possible and deliver great results, even if the tasks seem "meaningless." People will take note. They will give you more responsibility. You will continue to learn and expand your horizon.

Don't listen to people who tell you to slow down. Remember that there is no speed limit. Ignore anyone that tells you that you are going to burn out or can't do it. Do you truly want to work full-time and go to graduate school at the same time while still enjoying yourself and meeting new people? Do it. Do everything with a ferocity and determination. Once you can throw yourself into anything and succeed...

  1. Figure out how you will truly add value

Once you realize no one owes you anything and you decide to work with a passionate intensity regardless of the tasks, figure out where you want to add value. What's value? I highly recommend reading The Personal MBA by Josh Kauffman. Whether you want to start your own business, work in an existing corporation, or freelance with consulting work, that book will help you put a framework around what you want to do with your professional life.

Those are the three main professional points of advice I give to any college grad who wants to succeed and be happy in the real world. That isn't everything you need to know, but it will ultimately lead you in the right professional direction.

Posted on 05.17.2012

Stanford's CS183 Class Notes

Stanford's CS183 class with Peter Thiel is simply amazing. A huge thank you to Blake Masters for writing up summaries of each class. Every class notes post I have read has been amazingly insightful. I highly recommend checking it out if you are interested in how technology is shaping the world and learning about entrepreneurship from some of the major Silicon Valley investors.

Posted on 05.09.2012

Big Data Presentation

Over the weekend I finished up the big data presentation that I am presenting to Excella's Business Intelligence Center of Excellence this evening at 530pm.

I prefer my presentations minimal to keep them as an aid to my talk (instead of reading from the slides). Therefore it may be hard to follow unless you actually hear the talk. Nevertheless, the slides are there and present one view of this whole "big data" concept that seems to be hyped up everywhere now.

Posted on 05.07.2012

Screencasting on Mac OS X

I recently took a look at the range of screencasting software available on Mac OS X for a couple of reasons. First, I want to have an easy way of demoing software and uploading videos to Vimeo. Second, short screencasts like the ones provided by Treehouse (highly recommended site for learning programming and web design by the way), are a great way to help others learn new technologies. For example, yesterday I helped a coworker set up static file serving from the Django built-in server used for development. He was really close and just needed a few lines of code to get it working. Blog posts are good for when you're searching for a quick fix, but a short screencast that walks you through the whole process is great too. So those scenarios are my basic use cases for screencasting. Also, I don't mind paying for great software since I plan to use it almost every day.

I downloaded and tried the following options:
  1. Quicktime Pro (built into Mac OS X) - free
  2. iShowU HD - $60 (for Pro)
  3. Screenium - $40
  4. ScreenFlow - $99

Here's what I thought of each product.

I couldn't figure out how to get Quicktime Pro to both record the screen and my microphone at the same time. I'm sure it's possible and I read you can just record separately and put both of them together in iMovie but I found that onerous. Scratch this one for serious screencasting.

I really liked iShowU HD's feature for showing what you're typing on the screen. I found it very slick and helpful to people watching the video. My only hang up with it was that if I mistyped and was too slow in catching myself, iShowU HD thought I was typing a separate block of text instead of continuing with the existing line. Basically I needed to not make as many mistakes - probably a good thing. I also liked that I could record only a piece of the screen instead of recording the whole screen and editing it later. The major downside to iShowU HD was that it did not have any editing capabilities after the video was finished. I know I could use iMovie or something like that but I prefer just staying in the program and doing my work from there.

Speaking of editing within the program, both Screenium and ScreenFlow provide both recording and editing parts to the programs. This was very appealing to me. I played around with Screenium and subjectively I liked parts of it but did not like others. I created a couple of short screencasts with Screenium and then did the same with ScreenFlow. I felt like ScreenFlow just jived better with what I was trying to do and was easier to use. The difference in price did not matter to me. I have not gone ahead and purchased ScreenFlow but I plan to within the next few days. My recommendation is if you want screencasting software with editing capabilities, try both Screenflow and Screenium and see which one fits you better.

One last note: some of these products are now on the Mac App Store. I read some pretty scathing reviews that the software did not work as well when purchased from there. This may be becasue the software is new to the App Store and it will get better. But do your due diligence to make sure you do not end up with a neutered product due to the API limitations placed on apps in the Mac OS X App Store.

Posted on 05.04.2012

Can't "Find" Developers? Increase Your Offer

This little rant about paying developers what the market demands instead of complaining you can't find them climbed its way up to the top of the Hacker News charts this morning and for good reason. While the blog post was written specifically for the Austrian market, great software developers are in high demand everywhere.

There is a limited supply of people with development skills. When software developers' skills are used properly, there is great potential for creating value in organizations ranging from startups to large government and commercial organizations. I've seen many organization make the mistake of paying as little as possible for their developers. That is a losing strategy (one I often come into to try to fix - although usually by then the organization is dug in too deep and is too far behind the competition for it to matter).

Great developers know their worth. They will seek out environments where either the salary is high enough that they feel they are adequately paid or compensated with a mix of salary, equity, and benefits. If you're not able to "find" developers, increase your offer in salary, vacation days, or some other compensation, such as 20% time for side projects.

Posted on 05.03.2012

MongoDB, node.js, and Backbone.js

The concept of an all-JavaScript stack on both the client and server is hardly new, but I'm finding the idea more appealing now that the projects have matured. I see notifications like this press release by 10gen that they are making a commitment to better integration with node.js. Granted it is a press release, but I do see the effort 10gen is putting in through the new tutorials and code releases for MongoDB.

Python and Django continue to be my day job technologies of choice. They are great for quickly building web applications. Python and Django are still fun and productive. But it feels like there's an industry shift going on that will continue to provide fuel to the all- or mostly-JavaScript stack.

So I am starting a new side project with MongoDB, node.js, and Backbone.js. I know what the project will be but I am not yet sure if I will just open source it or make it a pay-for access web application.

What do I currently find appealing about learning the MongoDB/node.js/Backbone.js stack (there must be a better name for this similar to the LAMP stack)?

1. Mastering JavaScript fundamentals

Although I've written plenty of JQuery and standard JavaScript code, I still don't feel like I "get it" when it comes to JavaScript fundamentals. Part of learning this stack is figuring out how to do JavaScript the right way.

2. Comparing a traditional LAMP stack with the node.js stack

Non-blocking I/O on node.js sounds like it makes sense. But what does it really mean when you get into the details? What are the real implications for coding fast web applications? I'm curious to learn more about how this works.

3. Is it fun?

As I wrote above, programming in Python/Django is fun. Way more fun than the Java code I used to write. I still cringe when thinking about how damn difficult it was to write a web application in Struts. So will writing a web application in node.js with a NoSQL MongoDB backend and a client-side MVC framework be fun? I just don't know until I write a project with these technologies.

Posted on 05.02.2012

Django Officially On Github

Django, the web application framework for perfectionists with deadlines, is now officially on Github. Welcome Django, it's about time you migrated over!

The code and documentation can now be found in the official repository.

Posted on 04.28.2012

Database Backups

Backing up your databases on a daily, or more preferrably, hourly basis is IMPORTANT. Do not skimp on preserving your data.

You never know when an errant "drop database ..." will screw up your afternoon. Even the fantastic developers at Github are not immune to making costly mistakes.

Don't tempt fate. Back up your database frequently.

Posted on 04.27.2012

Python & MongoDB News

Yesterday had a couple of interesting Python & MongoDB related posts on Hacker News.

The first post was on scrapping websites with scrapy and storing the data in MongoDB. The post walks through establishing the URL patterns to crawl then shows an example of how to set up the MongoDB mapping in a .py file.

The second post showed the results of a project to recreate the Django admin interface with Twitter Bootstrap for MongoDB backends. I've worked on several projects where using MongoDB with Django would have been advantageous but recreating the admin interface was a significant hurdle. It's great to see community projects that break down these barriers.

Hopefully future Django releases can incorporate some of this work to make it easier to work with non-relational databases when necessary.

Posted on 04.24.2012

Consolidation in the Python Hosting Industry

The announcement yesterday about Epio closing down got me thinking about the Python PaaS industry. I did not have any personal experience with Epio, but from the discussion on Hacker News it sounded like these guys were top notch developers and just nice guys in general. While it's difficult to see Epio's platform close down after all the effort invested in it, I'm sure those guys will end up in a great place. If they didn't already have multiple great job offers I'd be shocked.

I've only personally used Google App Engine, Heroku, and Gondor PaaS, Amazon Web Services IaaS, and Slicehost and Linode for virtual private servers. I currently use Linode (for my side business) and Amazon Web Services (for this blog plus side projects).

Linode is great, especially when combined with Ubuntu images along with Fabric and cuisine for server set up. Amazon Web Services is also a fantastic platform when boto is used to automate EC2, S3, etc. Right now I'm very happy with the combination of those two services.

A few years ago I worked with Google App Engine both on side projects and some client projects. I still have a certain gut reaction when I think about using GAE. I liked the ease of deployment and the tie in to the Google APIs. However, I was really concerned about the lock in since the Python code I wrote had to be written in a certain way. The Python 2.5 restriction, which is now lifted to 2.7, didn't bother me too much. The big thing for me on GAE was the uncertainty over the eventual production costs (I used the beta version). Those pricing fears proved to be an issue for developers that went full-on in the platform. I'm glad I got out when I did before production GAE went live.

Gondor seemed interesting, but I really only played with the beta. I was concerned that they were too small to really be a player in the field and I didn't want to get locked to their platform. On the plus side, there really wasn't much code modification necessary to deploy a Django project.

Heroku is a great platform - assuming you work within the boundaries. I found the shared database performance very limited. The performance was often an order of magnitude worse than on a very small private VPS with PostgreSQL. However the ease of deployment was fantastic. "git push heroku master" felt just as natural as interacting with Github all day. I could easily see getting into the workflow where the only platform a developer uses is Heroku. The dedicated database cost did scare me though. If there were a lower cost, $50/month instance, that might help. I'd have to do more research at that point to do a cost/benefit analysis over AWS or a VPS.

There's no silver bullet for Python developers looking to deploy on a PaaS. Still, it's great to have options. For prototyping apps, Gondor and Heroku make great choices (as long as you don't immediately need a lot of database storage and performance). For production apps though, I still lean towards a mix of AWS and virtual private servers.

Posted on 04.19.2012

Repository Structure and Python

Kenneth Reitz has another great post on how to structure repositories for Python projects. Repository structure is one of those topics that everyone seems to come up with a slightly different way of doing so it's great to see some direction from a leader in the Python field.

Posted on 04.18.2012

Django Nudge (django-nudge)

Django Nudge (nudge) is an open source Django application written by developers at the Consumer Financial Protection Bureau. Nudge is designed to be the Django equivalent to Ramp for WordPress.

In a nutshell, Nudge allows content creators to develop their content on a staging server. When the content is ready to go to production, Nudge provides an admin interface for selecting only the pieces of content that should be pushed to production. Nudge allows fine-grained control of which content to push because not all content needs to go live at the same time.

Considering how often Django is used in media companies, I was surprised that I could not find another project that was equivalent to Nudge. It's completely possible that this type of app has already been written but never open sourced.

Which brings me to another point: it's great to see the government open source useful projects. When developers are thinking "hey this code will actually see the light of day" there is a lot of motivation to get it done right. Too often when I've consulted for other government agencies so many corners are cut partially because developers know that their project will never go to production or be open sourced.

It's also great to see the positive press and recognition that CFPB received for being a forward-thinking government agency.

We need more of this great work coming from the government. Let's hope other agencies take note.

Posted on 04.17.2012

Django in Production

Django is easy to get started with, especially if you already have a programming background in a "heavier" language like Java. When I first started creating websites with Django 0.96, I was programming Java systems during the day and relaxed in the evenings by using Python/Django. I found the speed at which I could create sites allowed me to feel like I was accomplishing something even though I did not have full days to focus on side project development.

One of the hurdles I found with Django was just figuring out how to deploy the projects to a production server. "python manage.py runserver" wasn't going to cut it. In addition, once I got the sites live, I was not sure of how to properly monitor them. The following links helped me a lot to learn what the "big boys" in the Django space were using in production:

  1. Setting up a Production Django Environment
  2. Instagram Production Engineering
  3. Yipit Monitoring Key Metrics
  4. Django in Production - Part 1
  5. Django Settings for Production and Development
  6. Automatic Set Up of Django With nginx & gunicorn

Those are the best articles I've come across recently that I wish I had when I first started deploying Django projects (to be fair, those links didn't yet exist nor did many of the technologies that are now commonplace).

Posted on 04.16.2012

Site Relaunch

I recreated mattmakai.com earlier this year with a new theme on top of a custom Python/Django stack I wrote. Although I liked some of the work I did, I just was not satisfied with the overall result. So I'm relaunching the blog with the core written in Markdown and jinja2 with Pelican used to generate the static HTML pages.

I'm also open sourcing the code and content for anyone else interested in creating their own Pelican-driven blog.

Posted on 03.10.2012

"DevOps is Ruining My Craft"

This DevOps blog post is a great satirical take on the automation and DevOps movement. The post is written as an "interview" with a current sysadmin and it's definitely worth the quick read.

Posted on 02.23.2012

Python Context Managers

During my talk to django-district last night, I explained that Django 1.4 drops support for Python 2.4 because the core committers wanted to use Python's context managers. Python 2.4 would not suffice because context managers are a Python 2.5+ feature.

Someone in the audience asked what a context manager is, and I was annoyed with myself for not having a clear, concise answer. So to paraphrase the old saying, now "there's a blog post for that."

Python Context Managers

A context manager is created syntactically using the 'with' statement. Here is an example:

with open("example.txt") as f:
    data = f.read()
    print len(data)

The code above opens a file, reads its contents, and prints the length of the string read from the file. Since we are using the with statement, the file will always be closed after it is read. This behavior is because the 'with' statement performs actions on entry (the __enter__ method) and on exit (the __exit__ method), regardless of how the block of code exits. See this blog post with a detailed explanation of the process a context manager runs through.

The context manager essentially can be thought of as an alternative to a try-finally block (before context managers these blocks were more common). So the concise way of explaining a context manager is that it is a statement that defines the runtime context for how a block of code should be executed. Context managers are particularly useful for locking/unlocking as well as setting or reseting state before a code block is executed.

Posted on 02.22.2012

Django 1.4 Beta Released

The Django 1.4 beta release is now available for testing.

Although the 1.4 beta can be downloaded as a package, it's probably best to get it from the SVN development branch (also mirrored on github) so you can update and take advantage of bug fixes as they are incorporated into the code base.

For more information on the new features coming in 1.4, come see my talk on Tuesday night's Django District meetup in DC.

Posted on 02.16.2012

Django District February Meetup Lightning Talk

I'll be giving a 10 minute lightning talk on updates and incompatibilities in the upcoming Django 1.4 release. If you're interested in Python/Django and want to hear more, RSVP on meetup.com. There will be some other great talks as well on EC2 + github integration, monitoring your apps with Graphite and Sentry, and Django chartit.

My impress.js slides for the talk will be posted on this site over the weekend.

Posted on 02.15.2012

Django 1.4 Requires Python 2.5+

Django 1.4 is the first Django release to remove support for Python 2.4. This change is an expected for two reasons. First, beginning with Django 1.2, Python 2.3 support was dropped and the community was notified that Django 1.4 would again increment the required Python version. Second, the Django core developers need support for context managers, which were added in Python 2.5.

Note that although Django 1.4 supports Python 2.5+, it does not yet support Python 3.x. Although progress has been made porting Django to Python 3.x, it is not fully tested or ready for release as specified in Django's release process.

Posted on 01.25.2012

What the Django's ORM Author Hates About It

Alex Gaynor, a Django core committer and author of much of the object-relational mapping (ORM) code, gave a presentation on what he hates about the mapping layer. Every ORM layer in existence has issues, especially for edge cases, but Django's has been criticized lately for various reasons. Alex's presentation addresses concerns are in three areas of the ORM layer:

1. Inconsistencies in querying syntax are confusing and were built up without an overall strategy over time

2. Complex queries are virtually impossible with the existing syntax, especially compared to SQLAlchemy

3. Aggregation queries take strings instead of objects, which is inconsistent with other query types and limits the aggregation queries' usefulness

Alex's point during the presentation is to bring up the most glaring issues, show why they need to be fixed in future Django releases, and move the Django ORM from an "80/20" solution closer to a "90/10" solution that is easier to apply across a broader set of use cases.

Slides: Why I hate the Django ORM (Speaker Deck)

Posted on 01.20.2012

The Seven Steps

There are at least seven distinct steps towards Internet entrepreneurship. I'll begin with the caveat that these seven steps only apply in the Internet space and not other avenues such as starting a bakery. From my (limited) experience, everyone goes through these steps in order. Some steps take hours, while others can take years.

The seven steps are:

  1. Putting something online through a platform such as Tumblr, spreading the word, receiving critical feedback, and improving your work
  2. Building and putting out any type of website of your own creation
  3. Building a site conceived from your own idea with potential for monetization
  4. Launching your first web application with a sign up process and methods for payments
  5. Getting your first paying customer, obtaining feedback, and improving your product
  6. Having a steady stream of customers
  7. Becoming profitable, growing your customer base, and increasing your product's value to your customers

By understanding these seven steps, you can assess your own position and determine how you can take the next step. The goal is not to rush through each step to get to the next one, but instead to learn at each milestone. Become comfortable with yourself, your own skills, and determine what aspects you need to improve.

For example, I created many sites with Python and Django in 2009. I designed, developed, and deployed them, learning a lot about Django's best practices and Linux system administration in the process. However, I realized I had (and still have to some extent) a deficiency in design. I knew that before I could take the next step towards building a site that could be monetized and feel good about it, I needed to learn better design and get to know more people who could give me honest, critical feedback on my website designs.

Once I spent several months reading, drawing, building, and discussing designs, I felt more comfortable that I could take the next step. About six months and a lot of late nights later, I launched ProofDriven with a reasonable design I was okay starting with that I knew I could improve as I grow more comfortable in this step. Eventually I can look ahead to the next step in the path towards Internet entrepreneurship.

Posted on 01.18.2012

Specify the HTML File for PhoneGap and iOS

When working with iOS applications and using PhoneGap, you'll often want to use a different file name than "index.html" for your first page. This can be tricky for first time PhoneGap/iOS developers because there is no stub function or properties file for specifying the file like there is in Android and BlackBerry projects.

In your AppDelegate.m file, add the following method and change the return value to the HTML file you want to use.

+ (NSString*) startPage
{
  return @"different.html";
}

Bonus: you can also use this to specify a different path than www. For example, if you have a combined Android and iOS project where Android requires the assets directory, specify "../assets/www/yourfile.html" as the return value.

Posted on 01.05.2012

Heroku on Ubuntu 10.04

A couple of guys from Heroku gave a talk tonight at DC Python and it looked like a good solution for running small sites. However, I was disappointed that set up was more difficult on Ubuntu 10.04 than turn key installers on Windows and Mac OS X. The set up instructions required a few modifications to work properly.

sudo apt-add-repository 'deb http://toolbelt.herokuapp.com/ubuntu ./'
curl http://toolbelt.herokuapp.com/apt/release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install heroku-toolbelt
sudo apt-get install ruby libopenssl-ruby ruby1.8-dev
sudo apt-get install libreadline-ruby

Type "heroku" at the command line to check that the installation is working properly.

Sources:

[1] http://wmilesn.com/2011/10/code/avoiding-pitfalls-when-setting-up-heroku-for-node-js-on-ubuntu/

[2] http://rukuro-blog.heroku.com/2011/05/11/ruby-readline-loaderror

Posted on 01.03.2012

Impress.js: Now Works With Presentation Pointers

I saw impress.js, a really cool CSS3 transformation-based presentation Javascript library on Hacker News yesterday. The demo is flashy - similar to Prezi but without Flash, plus new 3D effects. The only downside compared to an established browser slideshow library such as S6 was that my Logitech presentation pointer didn't work for advancing and reversing the slides.

After a little digging, I found out that presentation pointers emulate page up/down key strokes. So I forked the impress.js library, updated the code, and issued a pull request to add the presentation pointer capability. Thanks to Bartek's quick response, the pull request was merged and closed just a few hours later. So now presentation pointers work great with impress.js.

Posted on 01.02.2012

Older Blog Posts

My blog posts from the last couple of years can still be access at http://mmakai.com/.

Eventually I'll transfer the posts' content to this site and redirect the URLs to their new locations, but for now I'm leaving the old posts on Tumblr. There is also a nice way to browse the posts in the archive.

Posted on 01.01.2012

New Blog

Note: This post is outdated because I am already on a new blog platform.

To kick off 2012, I'm shifting my technical blog from Tumblr to my own platform.

I created this site with Python, Django, MySQL, and Twitter Bootstrap.

The site is hosted on a Linux Linode instance and runs on nginx and Green Unicorn.

Once 2012 kicks off, I will add my presentations and (potentially) screencasts on technical content.

Posted on 01.01.2012