Cheap Automatic Backups With Dropbox

Dropbox* is great for sharing files among multiple machines, and it's
also pretty good for automatic backups. The only problem is that, if
you're cheap like me and want valuable services for free, you can only
get 2 GB of space. My home directory has more than 2 GB worth of
files. Some of them aren't important enough to back up, though, and,
fortunately, it seems the really big files usually fall into that
category.

So, my solution: cron + rsync.

I have a ~/.backup/backup.sh script:

size=`rsync --delete --delete-excluded -pthrv --exclude-from \
/Users/paul/.backup/exclude /Users/paul/Documents/ \
/Users/paul/Dropbox | egrep -o "total size is (.*)G" | egrep -o "[0-9\.]+"`

if [ "$size" = "" ]; then
size=0
fi

if [ `echo "$size < 1.8" | bc` = 0 ]; then
echo "`date`: WARNING: Size is running out for Dropbox backups.\
(Currently using ${size} GB.)" 1>&2
elif [ "$1" != "" ]; then
echo "size: $size GB"
fi

and a ~/.backup/exclude:

ita/*
SesSys08/*
*.mat
HIUS*
EYH/*
*.pack
*.dat
dev/old/*
WebKit/*
build/*

Basically a list of patterns matching either old cruft or files that
really don't need to be backed up, like Xcode build directories.

Then, in my crontab (access yours by running crontab -e):

*/10 * * * * sh .backup/backup.sh

That means that every 10 minutes the backup script runs. This is
pretty frequent, but rsync only copies the parts of files that
actually changed, so it's pretty fast.

Thanks to the backup.sh's output when the size exceeds 90% of my
space, I automatically get an email when my Dropbox account is about
to fill up. (You can also check this through the Dropbox utility, but
not as easily remotely.)

So far, the only maintenance has been adding new patterns to my
~/.backup/exclude file; otherwise, it's nice and automatic. And it's
saved me a trip back home a few times already, when I forgot to
transfer important files to my laptop.

* referral link... they'll give both you and me 250 MB extra space if you sign up through it.

Loading mentions Retweet

Comments [0]

Sneak Preview: One-Hot Gaming's First Title

Everything's finally OpenGL ES 1.1 compatible, and all GLUT calls are
converted to Cocoa Touch.

It's really nice that Xcode can handle Objective-C and C++ in the same
file. Such a huge time-saver.

Still needs some performance tweaks ("mip-mapping" the canyon vertices
is an option we're considering), but, hey, it runs!

Loading mentions Retweet

Comments [0]

This is more like it

Those JS articles I linked last week were fairly disappointing, it
turns out. But this seems really promising:
http://eloquentjavascript.net/contents.html
Loading mentions Retweet

Comments [0]

Chromium Icon for Mac OS X

I find the default Chrome icon a bit too colorful and distracting sitting there on my dock... so, to replace it with the nicely subdued, blue Chromium icon, run the following command in Terminal.app:

sudo bash -c "curl -o /Applications/Google\ \
Chrome.app/Contents/Resources/document.icns \
http://src.chromium.org/viewvc/chrome/trunk/src/\
chrome/app/theme/chromium/document.icns \
&& curl -o /Applications/Google\ Chrome.app/\
Contents/Resources/app.icns \
http://src.chromium.org/viewvc/chrome/trunk/src/\
chrome/app/theme/chromium/app.icns"

This will download the two icon files Chrome uses, and replace the old ones. I haven't been able to figure out a way to keep updates from over-writing the icon, so you'll have to re-run this command the next time Chrome updates itself.

Loading mentions Retweet

Comments [1]

Learning JavaScript Properly

I'm going to finally learn JavaScript properly. I've a decent amount
of time writing mediocre JavaScript code, from simple browser games to
a half-assed HTTP server that ran on top of XULRunner. But I have
nowhere near the depth of understanding of what's actually going on
"under the hood" as I have with C or Python or even Objective-C.

So I'm documenting my adventures here- both for my own reference and
in the hope that it makes it easier for someone else to do the same.

First stop, a refresher on the object system:

http://www.devarticles.com/c/a/JavaScript/ObjectOriented-JavaScript-An-Introduction-to-Core-Concepts/
http://www.devarticles.com/c/a/JavaScript/Object-Oriented-JavaScript-Using-the-Prototype-Property/

Douglas Crockford's presentation "JavaScript - The Good Parts" sounds
promising: http://video.yahoo.com/watch/630959/2974197 ... maybe in
conjunction with finishing up the chapter on him in Coders at Work.

Loading mentions Retweet

Comments [0]

CSE 167 Wrap-Up

Just figured I'd post this screen shot of what Eric and my CSE 167
project eventually became.

Eric's also planning on making an iPhone game out of this; I'm looking
forward to that... accelerometer controls are probably a lot more fun
than keyboard arrows.

It's still in the same GitHub repository:
http://github.com/paulbaumgart/CanyonPilot

Loading mentions Retweet

Comments [0]

Introduction to Computer Graphics (CSE 167) Final Project

So, for the Intro to Computer Graphics final project, our assignment is basically "make something cool with 3d graphics". (I really wish more classes did that. Maybe then I'd stay for a Master's.) Points are  awarded based on the difficulty of various "technical features".

This is what Eric and I have set out to do:

Final Project Proposal

by Paul Baumgart and Eric Levine

We intend to build a simple 3d flight simulator game.

The player will control an airplane that flies through an infinite canyon. The objective of the game will be to pilot the plane through the canyon as long as possible without crashing. The player's score will be based on the distance between the start point and the crash site.

The plane will be a textured 3d model, with moving ailerons. It will be controlled with the keyboard arrow keys. The plane will cast a shadow on the ground as it flies, based on a directional light high above the landscape that simulates sunlight during midday. A bounding volume for the plane will be used to determine if it crashes into the canyon walls. The camera will follow the plane. Time permitting, we will include a "Pilot's view" mode in addition to the default 3rd-person view mode.

The canyon will be built on-the-fly from a piecewise cubic Bezier curve. The curve will determine the path of the canyon. In order to ensure a smooth path, the piecewise curve will be C1 continuous. A height map will be generated based on path defined by the curve. The height map will be perturbed using fractal terrain generation techniques in order to create a realistic appearance for the canyon.

Below is a summary of the technical features to be included in this project:

- Shadow mapping
- Bounding volumes for collision detection
- Piecewise Bezier curves as paths
- C1 continuity
- Fractal terrain generation
- Height maps

You can follow our progress on GitHub.

After working on it for about 4 days, we have the canyon generation working nicely (though not optimally- we create more quads than we actually need still), and collision detection works 99% of the time (and will soon be 100%, assuming our math is right).

Screenshot:

Yeah, the terrain needs some work. But isn't the airplane pretty?

Loading mentions Retweet

Comments [0]

Eclim

My new favorite thing for Java coding: http://eclim.org
All the fanciness of Eclipse with all the text editing awesomeness of Vim.

Ah, Vim. Maybe I'll have actually learned it in a decade or so. For
now, this is keeping me from using the arrow keys too often:
http://tnerual.eriogerg.free.fr/vimqrc.html

Loading mentions Retweet

Comments [0]

About

Studying Computer Engineering (B.S.) at UC San Diego. Graduating in June 2010.

You can contact me at paul@baumgart.us

I'm on LinkedIn here: http://www.linkedin.com/in/paulbaumgart