Writing a Technical Book in Emacs and Org Mode

I spent the past year writing a book called Make Art with Python. It teaches Python programming through drawing and art, instead of print statements. If that sounds interesting to you, sign up to hear when it’s released here.

Why Write a Book in Emacs?

I needed a distraction free way to write my code and prose in one place. I also needed to track my progress during the writing itself, and settled on using a paper journal and org-pomodoro.

If you’ve ever wanted to write a technical book, the past few months have taught me it’s possible for mortals with day jobs. I’ve just sent my fourth draft off to my editor, and tens of thousands of lines of code and prose have already been written. It’s the first time in my life writing a book has felt achievable.

But there have been painful false starts and mistakes along the way.

In this article I’ll share some basic rules I stole to keep myself focused, motivated, and productive while writing. I’m sharing in the hopes that they will help you too, and you’ll begin writing your book much sooner than it took me.

Most of these ideas and habits are generally applicable, and although they may seem insignificant, improved my writing tremendously. In fact, all the writing and code for my first draft was written while I was the sole backend developer at a startup which grew to millions of users.

I’m a big believer in concrete examples as the only way to learn anything, so I’ll also walk you through the mechanics of the tools I use. We’ll cover the process of writing, file and time management, visualizing the work in progress, exporting, and maintaining a positive attitude to keep the work flowing. Of all these parts, the biggest challenge is mental.

When things get difficult, it’s mostly because you don’t know what to do next. It’s during these times that you need have a routine that happens, no matter what, to get you focused back on writing and making progress.

If you’ve been thinking about writing a book, this guide will hopefully convince you it’s possible.

And best case, soon I’ll be reading your book.

Let’s get started!

Continue reading

Using Neural Networks to Generate Paintings

Output Image
Input Images

Last week an incredible paper got released showing how neural networks could be used to separate a “style” from an image, and apply that style to another image. It’s a great read, even if some of the math goes over your head, and I encourage you to take a look.

Their basic breakthrough is that these neural networks, which have gained heavy use from companies like Google, Amazon, and Facebook, are learning to see what actual content looks like in images. By separating the neural layers which are used to distinguish textures in the images, the algorithm can see a “style” or texture, independent of the greater shape of the content image.

Today, Kai Sheng Tai released a Torch implementation of that paper. It’s different in a few aspects, the largest of which is it uses Google’s Inception network, rather than the paper’s (newer) VGG-19. Kai’s code also seems to get the best results when starting from your input image, rather than noise as in the paper. Kai’s code is also beautifully written, well commented, and easy to read. Please check it out.

(Thanks for the work Kai!)

The rest of these images were generated on my GTX 980 Ti, under Ubuntu 15.04, with cunn. Each image takes about 60 seconds to generate. You can change the image resolution in images.lua



Output Image
Input Images

Another Picasso

Output Image
Input Images

And a Kandisnky

Output Image
Input Images