May 2011
1 post
8 tags
May 12th
February 2011
1 post
8 tags
Setting up the Java stencil buffer
In OpenGL, the stencil buffer is used to mask pixels on the screen. However, if you notice that your stencil test is always passing (i.e. your stencil bits are always returns as zero), then you probably haven’t initialized the stencil bits. This isn’t very well documented. It took a few days of searching to find it. In C, one would be using GLUT, so calling glutInitDisplayMode() would...
Feb 7th
January 2011
2 posts
3 tags
Java's forever loop
If you want to loop forever in Java, just type for(;;) { } Coincidentally, “for(;;)” and “forever” have the same number of characters…
Jan 31st
85 notes
8 tags
Enabling Apache and PHP on a Mac 10.6 (Snow...
The Apache web server and PHP come preinstalled on Macs. All you have to do is enable it. Unfortunately, there is no “Enable Apache and PHP” switch, but the process is relatively simple. To first enable PHP5, using a Terminal navigate to “/etc/apache2/” cd /etc/apache2 and sudo open up the httpd.conf file using your editor of choice. Next, find this line: ...
Jan 5th
2 notes
December 2010
6 posts
8 tags
Using scp on a directory/file with spaces
The protocol when copying/moving a file that has spaces in the filename in a terminal window is to use “\ “, or cp ~/some\ directory/some\ thing.zip ~/destination/ Oddly enough, scp doesn’t employ the same protocol.  Instead, I’ve found that this works: scp 'myname@location:"~/some directory/some thing.zip" ' ~/destination/ That is, wrap the entire call after scp in single quotes, and...
Dec 29th
5 tags
Editing your Vim parameters: .vimrc and .gvimrc
Vim is my editor of choice because it allows me to swiftly move through my code without lifting my fingers from the keyboard. That is, it is a mouse-less text editor. There’s a bit of a learning curve, so if you haven’t jumped into an editor like Vim or Emacs before just hang in there. If you’re running linux, you can grab it through apt-get, if you’re on a Mac, then check out...
Dec 28th
3 tags
A Year Of Scala « blog.joa-ebert.com – Blog of Joa... →
Dec 28th
1 note
3 tags
A script that updates all your subversion...
I have several subversion repositories that I continually need to update. Here is a convenient script I wrote that automatically updates all of them.  For bash (also sh,ksh) #! /bin/bash # Subversion repositories to be updated svnlist=( \ "cae" \ "jtk" \ "llm" \ "idh" \ ) svnbase="/Users/Chris/Home/box/" # Number of subversion repositories. listnum=${#svnlist[@]} for...
Dec 27th
3 tags
Vimtutor
Did you know there’s a really great built-in unix tutorial on how to use vim? Just type vimtutor in any terminal window and it will begin the tutorial. It’s written by Michael Pierce and Robert Ware from the Colorado School of Mines (which just so happens to by my alma mater).
Dec 27th
6 tags
Scala: I can overload operators again!
Overloading operators is a neat feature that languages like C++ have, where the programmer can redefine a limited set of algorithmic operators. Why would you want to do this? This could come in handy if you’re defining a new object (a complex number, say) and you want to be able to specify what happens when you add two complex numbers together.  I say it’s a neat feature because it...
Dec 27th