Johan Ekenberg

Computer Programmer and Double Bass Player

Lose Weight: Go to the Equator!

A person weighing 75 kg will weigh 250 grams less standing on the equator compared to the north or south pole.

This is caused by the centrifugal force from Earth’s rotation. Earth’s circumference is 40000 km, having a radius of 6370 km. One revolution per 24 hours means a tangential speed of 1670 km/h, or 465 m/s, at the equator.

centrifugal force is given by the formula:

where F is force in Newton (N), m is mass, v is tangential velocity and r is radius. Substituting 75 kg for mass, 465 m/s for velocity, and 6,370,000 m for radius, we get a centrifugal force of 2.54 N. Now, the average gravitational acceleration on Earth is 9.8 m/s2, so 2.54 N equals roughly 250 grams. Go figure!

Now you probably wonder, like I did: How fast would Earth need to rotate for us to weigh nothing, and start drifting off into space? Well, looking at the above equation for centrifugal force, we note that F is proportional to v squared. (If v is doubled, F is quadrupled). The centrifugal force F would need to be 300 times higher (250g * 300 = 75kg). Consequently, v needs to increase by a factor of about 17. ($\sqrt{300}\approx 17$) So: to send us drifting into space, the earth must rotate 17 times faster than now, which is one revolution in about 1 hour 25 minutes.

Of course, this would only be true at the equator. The rotation needs to be quicker the further from the equator you are. Standing at one of the poles, you would run no risk of being spun off the earth no matter how fast the rotation. You might get dizzy but you will stay safe!

Change Gimp Interface Language on Mac

By default, Gimp uses the same interface language as your Mac, and there is no way to configure this in the application settings. My Mac is set to Swedish, but I want Gimp in English. Here is how:

  • Locate the folder /Applications/Gimp.app/Contents/MacOS, either in a Terminal or Finder.
  • You should see two files, Gimp and gimp-x.y where x.y is the version number. Gimp is a shell script (a textfile containing commands), which prepares the environment before starting the real binary, gimp-x.y.
  • Open the file Gimp in any texteditor. The end of the file should look something like:
end of Gimp (shell script)
1
2
3
4
5
6
7
8
# setup help, for more information see bin/help-locale
rm -f /tmp/skl/Gimphelp
ln -s "$bundle_data/gimp/2.0/nohelp" /tmp/skl/Gimphelp
help-locale
# set the working directory to users home
cd ~/ > /dev/null

exec "$bundle_contents/MacOS/gimp-2.8"
  • The last line beginning in exec is the one that actually starts Gimp. To make it use English, insert the following line just before the exec line:
Add LANG environment variable
1
export LANG=en_US.UTF-8

This is how it should look when finished:

end of Gimp with custom LANG variable
1
2
3
4
5
6
7
8
9
# setup help, for more information see bin/help-locale
rm -f /tmp/skl/Gimphelp
ln -s "$bundle_data/gimp/2.0/nohelp" /tmp/skl/Gimphelp
help-locale
# set the working directory to users home
cd ~/ > /dev/null

export LANG=en_US.UTF-8
exec "$bundle_contents/MacOS/gimp-2.8"
  • You have just changed the environment for Gimp, tricking it into believing it is running in an English/United-States environment. Feel free to substitute any valid locale string for en_US.UTF-8 to get a different language. You can find the supported locales on your Mac by typing the command locale -a in a Terminal.
  • Exit your editor, saving the file. Now start Gimp as you normally would, and enjoy the interface in your language of choice!

Octopress Cheat Sheet

Various ways to format source code in Octopress

Create new post

1
2
3
4
$ rake new_post["New Post Title"]
# edit the generated 'source/_posts/YY-MM-DD-new-post-title.markdown'
$ rake generate
$ rake deploy

Formatting examples

Text

> This is a simple block quote

This is a simple block quote

Better control:

{ % blockquote [author[, source]] [link] [source_link_title] %}
Quote string
{ % endblockquote %}

Backups are for wimps. Real men just upload their important stuff on ftp, and let the rest of the world mirror it

{ % pullquote %}
This is a paragraph where {"the important stuff is pulled out"} for emphasis.
{ % endpullquote %}

This is a paragraph where the important stuff is pulled out for emphasis. It works in most browsers, also modern IE (>= 8).

Source code

This is a normal line indented by tab - generic black code box
{:lang='text'}
  Foobar
{:endlang} <== optional
1Foobar

Same thing with lang="ruby"

1def mymethod(i)
2  i * 2
3end

Use { % codeblock title lang:ruby http://ruby-lang.org Ruby Homepage %} for a black box with line numbers. Every argument optional except lang:… :

titleRuby Homepage
1
2
3
def mymethod(i)
  i * 2
end

Some important differences with kramdown

This is neat, white code block without the need to indent:

~~~
def what():
  return 42
~~~
{:lang='python'}
1def what():
2  return 42