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

This is h2

Describing h2 with some custom text.

This is h3

Describing h3 with some custom text.

This is h4

Describing h4 with some custom text.

This is h5

Describing h5 with some custom text.

This is h6

Describing h6 with some custom text.

Create, edit, test and publish:

Octopress create new post
1
2
3
4
5
6
7
8
9
$ rake new_post["New Post Title"]
# edit the generated 'source/_posts/YY-MM-DD-new-post-title.org'
# export to markdown/octopress from Emacs: C-c C-e o o
$ rake preview  # <-- optional, on linux, check http://localhost:4000/
$ rake watch    # <-- optional, on mac, using pow, visit ekenberg.dev for preview
$ rake generate # <-- straight site build if not previewing as above
$ rake deploy   # <-- sync generated site to webhost

# Magit to commit/push changes

Syntax highlighted source code block with title:

python
1
2
3
# some python
def some_function(foo):
    handle(foo)

Verbatim =word= or code ~word~ markup can be used for short highlights but they can break from equal-signs, quotes and who knows what else.

my $foo = 'bar';

White box with plain text:

1This is plain text
2     It will be displayed verbatim with indentation

I made this change to not have org-files messing up jekyll generate

~/.rvm/gems/ruby-1.9.3-p385/gems/jekyll-0.12.0/lib/jekyll/site.rb
1
2
3
4
5
6
7
8
9
10
11
def filter_entries(entries)
  entries = entries.reject do |e|
    unless self.include.include?(e)
      ['.', '_', '#'].include?(e[0..0]) ||
        e[-1..-1] == '~' ||
        e.end_with?(".org") ||
      self.exclude.include?(e) ||
      File.symlink?(e)
    end
  end
end

Generic black code box: It feels buggy, be careful

    Generic black code box, create by indenting line(s) by tab
    End with a single ^ at start of line

Blockquote:

Everything should be made as simple as possible,
but not any simpler

Math display

Centrifugal force is given by the formula:

where F is force in Newton

CSS

Edit /sass/custom/_styles.scss for minor style changes, ie font sizes, colors etc