Wishful Coding

Didn't you ever wish your
computer understood you?

Twisted on Dotcloud

A while back, I wrote a Twisted email server that would sit between you and Twitter and let you reed and send tweets via email.

With the advent of free cloud hosting, I thought it’d be fun to put it online. I’ll share with you how it’s done, for those of you who are looking for a place to put your Twisted app.

The major problem with these easy hosts is that they assume a simple WSGI app or a background worker, but then the background worker is not accessible from the outside.

First I tried Heroku, then Dotcloud, and finally a couple of others, and just when I had given up, @solomonstre came in:

@pepijndevos dotcloud has beta support for arbitrary tcp/udp ports. Want to try? :)

After some fruitless tries, he shared this repo, which contains scaffolding for a web-accessible Python worker.

The core parts of this thing are dotcloud.yml, where you define a setup script, the ports you want, and the command to run your app.

worker:
  type: custom
  buildscript: builder
  ports:
    smpt: tcp
    pop3: tcp
  process: ~/run
  approot: twemail
  environment:
    PYTHON_VERSION: 2.7

builder contains a whole lot of pip/virtualenv code, while run contains something like twistd -ny yourapp.tac.

Study Group

I’m starting a study group in Loenen (Gelderland), and you are invited. The primary focus of the group will be on programming and computer science.

After having been to several learning institutions, I found out it’s not something that works for me. I like to study at my own pace, whatever it is that I want to study.

However, I found that collaborating and peer learning make things a lot more fun. Therefore I want to organize a study group, to learn and create together.

Do you want to join? To work out the details, and to facilitate further discussion, I have created a wiki and a mailing list.

I sketched out a few things that’d work for me, but if you feel like “I want to join, but…”, speak up, nothing is set in stone.

Vacuum Balloon

You know these helium balloons? They float because helium is lighter, less dense then air. You know what is even lighter than air? No air at all!

I came across the idea on this website, where he notes

I haven’t done any math, but I assume this isn’t feasible at the present time.

I have done some math, or rather, asked Wolfram Alpha.

So, first of all, how heavy is a cubic meter of air anyaway?

weight of 1 cubic meter air

Ok, so our balloon can weigh just over a kilo and still float. But what is the surface area of a balloon of that size?

surface area of a sphere of 1 cubic meter volume

Almost five square meter. So with one kilo of matter, we need to make a balloon of nearly 5 square meter surface area.

volume of 1280 g Al / 4.836 square meter

Aww, not looking good. If we use aluminum1, we can make a shell of a tenth of a millimeter thick. This shell will have to resist 1 bar, which equals 10 newton per square centimeter.

pressure vessel formula

I just picked this up from Wikipedia, but presumably this means the stress on the shell will be 3162 newton per square millimeter.

Now, remember that this is a vacuum, so while a pressurized balloon retains it shape because of the pressure, the biggest problem with our vacuum balloon is the buckling force.

The smallest dent, a gust of wind, or even gravity itself, will cause the balloon to implode. I asked my dad2, and he asked his engineer, how to calculate this force. Third order magic.

  1. We should be using carbon or some composite probably, but it doesn’t really get much beyond 1mm anyway. 

  2. He’s an architect.