<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chris in grad school</title>
	<atom:link href="http://chrisingradschool.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisingradschool.wordpress.com</link>
	<description>Nonsensical, really</description>
	<lastBuildDate>Mon, 22 Nov 2010 17:47:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='chrisingradschool.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/87c2010b94a8e7fce8ee37c4f2a707f5?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Chris in grad school</title>
		<link>http://chrisingradschool.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chrisingradschool.wordpress.com/osd.xml" title="Chris in grad school" />
	<atom:link rel='hub' href='http://chrisingradschool.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Using scp on a directory/file with spaces</title>
		<link>http://chrisingradschool.wordpress.com/2010/11/22/using-scp-on-a-directoryfile-with-spaces/</link>
		<comments>http://chrisingradschool.wordpress.com/2010/11/22/using-scp-on-a-directoryfile-with-spaces/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 17:46:22 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=146</guid>
		<description><![CDATA[The protocol when copying/moving a file that has spaces in the filename in a terminal window is to use &#8220;\ &#8220;, or Oddly enough, scp doesn&#8217;t employ the same protocol.  Instead, I&#8217;ve found that this works: That is, wrap the entire call after scp in single quotes, and the path in double quotes Or an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=146&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The protocol when copying/moving a file that has spaces in the filename in a terminal window is to use &#8220;\ &#8220;, or</p>
<p><pre class="brush: bash;">
cp ~/some\ directory/some\ thing.zip ~/destination/
</pre></p>
<p>Oddly enough, scp doesn&#8217;t employ the same protocol.  Instead, I&#8217;ve found that this works:</p>
<p><pre class="brush: bash;">
scp 'myname@location:&quot;~/some directory/some thing.zip&quot; ' ~/destination/
</pre></p>
<p>That is, wrap the entire call after scp in single quotes, and the path in double quotes</p>
<p>Or an easy solution: <strong>don&#8217;t put spaces in filenames or directories</strong></p>
<br />Filed under: <a href='http://chrisingradschool.wordpress.com/category/apple/'>Apple</a>, <a href='http://chrisingradschool.wordpress.com/category/bash/'>Bash</a>, <a href='http://chrisingradschool.wordpress.com/category/linux/'>Linux</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=146&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2010/11/22/using-scp-on-a-directoryfile-with-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>
	</item>
		<item>
		<title>Adapting Your Makefile To Work On Any Operating System</title>
		<link>http://chrisingradschool.wordpress.com/2010/10/11/determining-an-operating-system-with-a-makefile/</link>
		<comments>http://chrisingradschool.wordpress.com/2010/10/11/determining-an-operating-system-with-a-makefile/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 18:09:53 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=138</guid>
		<description><![CDATA[Like most developers, I test my code on multiple different types of operating systems. While this is a good practice, it can become very annoying reassigning libraries and paths that are operating system-dependent. It would be nice if there was a way to tell a Makefile to use a certain set of paths if you&#8217;re [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=138&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Like most developers, I test my code on multiple different types of operating systems. While this is a good practice, it can become very annoying reassigning libraries and paths that are operating system-dependent. It would be nice if there was a way to tell a Makefile to use a certain set of paths if you&#8217;re using linux, and another set if you&#8217;re using a Mac.</p>
<p>But there is a way! Here&#8217;s how:</p>
<p>One example where this comes up is when you&#8217;re compiling code that requires OpenGL. To compile in linux, you type:</p>
<p>-lGL -lGLU -lglut</p>
<p>whereas in Mac OS X you would type:</p>
<p>- framework GLUT -framework OpenGL -framework Carbon -L&#8221;/System/Library/Frameworks/OpenGL.framework/Libraries&#8221;</p>
<p>and in Windows you would type:</p>
<p>-lopengl32 -lglu32 -lglut32</p>
<p>So to tell the makefile to use either version depending on your operating system by employing the &#8220;shell uname&#8221; command:</p>
<p><pre class="brush: bash;">
LIBPATH = -lGL -lGLU -lglut

ifeq &quot;$(shell uname)&quot; &quot;Darwin&quot;
LIBPATH = -L&quot;/System/Library/Frameworks/OpenGL.framework/Libraries&quot;
LIBPATH = -framework GLUT -framework OpenGL -framework -Carbon
endif

if  &quot;$(shell uname)&quot; &quot;Windows_NT&quot;
LIBPATH = -lopengl32 -lglu32 -lglut32
endif

</pre></p>
<p>We set the linux variables as default by initializing those first. Then by comparing what&#8217;s returned by &#8220;shell uname&#8221; we can alter the variables accordingly. Using this as a template should adjust your makefile accordingly.</p>
<br />Filed under: <a href='http://chrisingradschool.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=138&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2010/10/11/determining-an-operating-system-with-a-makefile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>
	</item>
		<item>
		<title>Shaders in Java</title>
		<link>http://chrisingradschool.wordpress.com/2010/03/08/shaders-in-java/</link>
		<comments>http://chrisingradschool.wordpress.com/2010/03/08/shaders-in-java/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:49:54 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Shaders]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=124</guid>
		<description><![CDATA[I&#8217;ve recently started developing shaders in Java. Shaders are a set of software instructions used to calculate rendering effects on graphics hardware.  More specifically, they usually come coupled as two types of shaders: vertex and fragment (or pixel) shaders. There are also geometry shaders but these are less implemented. Shaders are used to program the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=124&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started developing shaders in Java. Shaders are a set of software instructions used to calculate rendering effects on graphics hardware.  More specifically, they usually come coupled as two types of shaders: vertex and fragment (or pixel) shaders. There are also geometry shaders but these are less implemented. Shaders are used to program the graphics processing unit (GPU) rendering pipeline to allow for customizable geometry transformations and shading functions. To be more specific, we consider this image:</p>
<p style="text-align:left;"><a href="http://chrisingradschool.files.wordpress.com/2010/03/screen-shot-2010-03-09-at-2-13-26-pm.png"><img class="aligncenter size-full wp-image-129" title="Screen shot 2010-03-09 at 2.13.26 PM" src="http://chrisingradschool.files.wordpress.com/2010/03/screen-shot-2010-03-09-at-2-13-26-pm.png?w=600&#038;h=279" alt="" width="600" height="279" /></a></p>
<p style="text-align:left;">where the business-as-usual diagram of the graphics pipeline is shown on the top. What shaders do is redirect the pipeline so it processes the vertex processing and fragment processing how you want.  Note that setup and rasterization is left undisturbed, so interpolation (for example) is still being implemented by the hardware. Yay!</p>
<p>The language that is typically used (not always) it called GLSlang, or simply GLSL. Basically by making a few extra calls to OpenGL one can implement their own vertex and fragment shader algorithms. The shaders are written as a basic text file (extension is arbitrary &#8211; I&#8217;ve seen .glsl, .vertex, .fragment, .fp, .vp, .shd, etc. I use .glsl to avoid confusion). There is an <a href="http://www.vim.org/scripts/script.php?script_id=1002">extension to VIM</a> to allow syntax highlighting, so for VIM users who use shaders this is useful.  Then by reading in the text file the user can compile and apply their shader algorithm. Let me emphasize that GLSL is its <strong>own language</strong>. It&#8217;s roughly based off C, and follows much of the guidelines that C and Java do, in that clauses are concluded with semicolons, and functions are wrapped in brackets, etc. For more information I recommend that you consult the OpenGL <a href="http://www.amazon.com/OpenGL-R-Shading-Language-2nd/dp/0321334892">Orange Book</a>. While there are quite robust methods of programming GPUs, it is not quite standardized as of yet (note <a href="http://www.nvidia.com/object/cuda_home_new.html">CUDA</a>, <a href="http://en.wikipedia.org/wiki/High_Level_Shader_Language">HLSL</a>, <a href="http://developer.nvidia.com/page/cg_main.html">Cg</a>, and the list continues).</p>
<p>So, why do we want to use shaders? Put succinctly, shaders are written to apply transformations to a large set of pixels at a time. Meaning, shaders are well suited to parallel processing, and most modern GPUs have multiple shader pipelines to facilitate just that, thus dramatically reducing the computation time of rendering processes.</p>
<p>Using shaders in Java requires almost less effort than in C (I know &#8212; tell me what&#8217;s new). For example, forget using the OpenGL Extension Wrangler, or GLEW. This is unnecessary. What you need to look out for is how to load the files. Since shaders are essentially just text files, you want to load in the shader file as a String object. I find that this helps tremendously:</p>
<p><pre class="brush: java;">
FileInputStream f = new FileInputStream(fileName);
int size = (int)(f.getChannel().size());
byte[] source = new byte[size];
f.read(source,0,size);
f.close();
return new String(source,0,size);
</pre></p>
<p>where, assuming this is embedded in a function that returns a String, this will read in the file to allow the function glCompileShader (or glCompileShaderARB) to compile your shader function.</p>
<p>Below is a very simple Java class I&#8217;ve created which reads in a shader file that can be called later for compilation. It&#8217;s very straightforward, and if you&#8217;re programming the GPU using shaders in Java this may be very useful. I might add more later if I see fit.</p>
<p style="text-align:center;"><a href="http://inside.mines.edu/~cengelsm/files/Shader.java"><img class="aligncenter" src="http://i647.photobucket.com/albums/uu193/chrisengelsma/Screenshot2010-03-08at124804AM.png" alt="" width="115" height="172" /></a></p>
<br />Filed under: <a href='http://chrisingradschool.wordpress.com/category/java/'>Java</a>, <a href='http://chrisingradschool.wordpress.com/category/opengl/'>OpenGL</a>, <a href='http://chrisingradschool.wordpress.com/category/shaders/'>Shaders</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=124&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2010/03/08/shaders-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>

		<media:content url="http://chrisingradschool.files.wordpress.com/2010/03/screen-shot-2010-03-09-at-2-13-26-pm.png" medium="image">
			<media:title type="html">Screen shot 2010-03-09 at 2.13.26 PM</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/Screenshot2010-03-08at124804AM.png" medium="image" />
	</item>
		<item>
		<title>Using Python&#8217;s Core Graphics bindings in Snow Leopard</title>
		<link>http://chrisingradschool.wordpress.com/2010/02/28/using-pythons-core-graphics-bindings-in-snow-leopard/</link>
		<comments>http://chrisingradschool.wordpress.com/2010/02/28/using-pythons-core-graphics-bindings-in-snow-leopard/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 05:37:45 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=114</guid>
		<description><![CDATA[If you&#8217;ve recently upgraded to Snow Leopard, you may have noticed that you can&#8217;t import Core Graphics in Python. Each Mac is built off its Core Graphics framework, which includes the pair of Mac OS X technologies Quartz 2D and the Quartz Compositor. Following the transition from Leopard to Snow Leopard, Apple updated the Python [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=114&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve recently upgraded to Snow Leopard, you may have noticed that you can&#8217;t import Core Graphics in Python. Each Mac is built off its Core Graphics framework, which includes the pair of Mac OS X technologies Quartz 2D and the Quartz Compositor. Following the transition from Leopard to Snow Leopard, Apple updated the Python binaries to be (by default) 64-bit. The CGBindings did not survive this transition (mistake? oversight?). When you try to import CoreGraphics into Python you may receive the following error:</p>
<p><pre class="brush: bash;">
ImportError:
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/
CoreGraphics/_CoreGraphics.so: no appropriate 64-bit architecture
(see &quot;man python&quot; for running in 32-bit mode)
</pre></p>
<p>The bindings are still available to 32-bit Python, however. One workaround (as suggested by <a href="http://www.jaharmi.com/2009/09/01/core_graphics_bindings_on_64_bit_python_in_snow_leopard">Jaharmi</a>) is to specifically set your preferred python version to 32-bit:</p>
<p><pre class="brush: bash;">
$ export VERSIONER_PYTHON_PREFER_32_BIT=yes
</pre></p>
<p>This will set your Python to run in 32-bit mode. Is this what you <em>want</em>? Not necessarily&#8230; we are given the 64-bit binaries hence we want to use them for development. After all, Snow Leopard operates off a 64-bit hybrid kernel. This is simply a workaround.</p>
<p>While you can use CGBindings for 32-bit Python, you must use PyObjC to replace their functionality in the default 64-bit system. It seems Apple wants to completely switch over to this completely and in the meantime has offered a grace period for transition. Therefore making the switch is inevitable, albeit inconvenient.</p>
<br />Filed under: <a href='http://chrisingradschool.wordpress.com/category/apple/'>Apple</a>, <a href='http://chrisingradschool.wordpress.com/category/python/'>Python</a>, <a href='http://chrisingradschool.wordpress.com/category/snow-leopard/'>Snow Leopard</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=114&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2010/02/28/using-pythons-core-graphics-bindings-in-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>
	</item>
		<item>
		<title>Enabling the stencil buffer in JOGL (OpenGL &amp; Java)</title>
		<link>http://chrisingradschool.wordpress.com/2010/02/19/enabling-the-stencil-buffer-in-jogl-opengl-java/</link>
		<comments>http://chrisingradschool.wordpress.com/2010/02/19/enabling-the-stencil-buffer-in-jogl-opengl-java/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 01:35:25 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=110</guid>
		<description><![CDATA[In OpenGL the stencil buffer is used to mask pixels on the screen. This can be used for shadow volume rendering, as well as a myriad of other applications. Constructing stencil tests is the same as in C, for example glStencilFunc(GL_KEEP,GL_KEEP, GL_INCR); is just as valid in Java.  However, if you&#8217;re noticing that your stencil [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=110&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In OpenGL the stencil buffer is used to mask pixels on the screen. This can be used for shadow volume rendering, as well as a myriad of other applications. Constructing stencil tests is the same as in C, for example glStencilFunc(GL_KEEP,GL_KEEP, GL_INCR); is just as valid in Java.  However, if you&#8217;re noticing that your stencil test is always passing, i.e. your stencil bits are always returned as 0, then you probably haven&#8217;t initialized the stencil bits.</p>
<p>In order to use stencil tests, you MUST (emphasize MUST) request stencil bits to the canvas.  Otherwise, the test will always pass. This isn&#8217;t incredibly well documented for JOGL&#8230; It took a few days of internet searching until I found a breadcrumb of help on this.  In C, one would be using GLUT, so calling glutInitDisplayMode() would be the function to call to request stencil bits.  In Java, this is in the GLCapabilities object.</p>
<p>So, to request stencil bits, in your init() function, put:</p>
<p><pre class="brush: java;">
GLCapabilities cap = new GLCapabilities();
cap.setStencilBits(8);
GLCanvas canvas = new GLCanvas(cap);
</pre></p>
<p>or incorporate this into your code wherever deems fit.  Basically this says, initialize new GLCapabilities, and assign 8 bits in the stencil buffer. Then when you create your GLCanvas, set it as a parameter.  Now you&#8217;re good to go, and your stencil tests should work!</p>
<br />Filed under: <a href='http://chrisingradschool.wordpress.com/category/java/'>Java</a>, <a href='http://chrisingradschool.wordpress.com/category/opengl/'>OpenGL</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=110&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2010/02/19/enabling-the-stencil-buffer-in-jogl-opengl-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Matlab 2009 and Snow Leopard To Play Together</title>
		<link>http://chrisingradschool.wordpress.com/2010/01/13/getting-matlab-2009-and-snow-leopard-to-play-together/</link>
		<comments>http://chrisingradschool.wordpress.com/2010/01/13/getting-matlab-2009-and-snow-leopard-to-play-together/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 04:31:50 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=107</guid>
		<description><![CDATA[If you&#8217;re one of the thousands of Mac OS 10.6 users, and you want to run the new version of Matlab (2009a or 2009b), you may run into the error where it&#8217;s trying to find &#8220;libactivation.jnilib&#8221;.  More specifically, you may read a error that says: Can&#8217;t load library: /Applications/MATLAB_R2009aSV.app//bin/maci64/libactivation.jnilib If you go to the directory [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=107&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re one of the thousands of Mac OS 10.6 users, and you want to run the new version of Matlab (2009a or 2009b), you may run into the error where it&#8217;s trying to find &#8220;libactivation.jnilib&#8221;.  More specifically, you may read a error that says:</p>
<p>Can&#8217;t load library: /Applications/MATLAB_R2009aSV.app//bin/maci64/libactivation.jnilib</p>
<p>If you go to the directory <em>/Applications/MATLAB_R2009aSV.app/bin/</em> most likely you don&#8217;t actually have a directory maci64.  The reason it&#8217;s looking for that directory is because your Java Preferences are set to 64-bit.  This is the default Java Preference for 10.6.  10.5 it was 32-bit, and now it&#8217;s 64.  What Matlab does is it detects what your JRE is set to and then looks accordingly.  Problem is, the Matlab available for MAC is 32-bit only.</p>
<p>To fix this, open up /Applications/Utilities/Java Preferences.app.  When it loads, click and drag to put the 32-bit Java Application setting to come first (see image).</p>
<p style="text-align:center;">
<div class="wp-caption aligncenter" style="width: 437px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/javaprefs.png"><img src="http://i647.photobucket.com/albums/uu193/chrisengelsma/javaprefs.png" alt="" width="427" height="329" /></a><p class="wp-caption-text">Make sure your Java Application is set to 32-bit</p></div>
<p>Now it should work just fine.</p>
<br />Posted in Java, Matlab  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=107&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2010/01/13/getting-matlab-2009-and-snow-leopard-to-play-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/javaprefs.png" medium="image" />
	</item>
		<item>
		<title>Drawing an Ellipse in OpenGL</title>
		<link>http://chrisingradschool.wordpress.com/2009/10/22/drawing-an-ellipse-in-opengl/</link>
		<comments>http://chrisingradschool.wordpress.com/2009/10/22/drawing-an-ellipse-in-opengl/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 00:40:30 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=81</guid>
		<description><![CDATA[So earlier I alluded to how you can go about drawing an ellipsoid in OpenGL.  I&#8217;ve also noticed a lot of people have been coming to this site expecting to find a tutorial on drawing ellipses (2D).  This is a quick how-to on building these.  It&#8217;s short, and to the point, but this works. We [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=81&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So earlier I alluded to how you can go about drawing an ellipsoid in OpenGL.  I&#8217;ve also noticed a lot of people have been coming to this site expecting to find a tutorial on drawing ellipses (2D).  This is a quick how-to on building these.  It&#8217;s short, and to the point, but this works.</p>
<p>We first parametrize the equation of an ellipse (in the X-Y plane) centered at (x,y,0):</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=x%28%5Ctheta%29+%3D+x+%2B+r_x+cos%28%5Ctheta%29%2C+0+%5Cle+%5Ctheta+%5Cle+2%5Cpi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x(&#92;theta) = x + r_x cos(&#92;theta), 0 &#92;le &#92;theta &#92;le 2&#92;pi' title='x(&#92;theta) = x + r_x cos(&#92;theta), 0 &#92;le &#92;theta &#92;le 2&#92;pi' class='latex' /></p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=y%28%5Ctheta%29+%3D+y+%2B+r_y+sin%28%5Ctheta%29%2C+0+%5Cle+%5Ctheta+%5Cle+2%5Cpi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='y(&#92;theta) = y + r_y sin(&#92;theta), 0 &#92;le &#92;theta &#92;le 2&#92;pi' title='y(&#92;theta) = y + r_y sin(&#92;theta), 0 &#92;le &#92;theta &#92;le 2&#92;pi' class='latex' /></p>
<p>In this case, we&#8217;re parametrizing over <img src='http://s0.wp.com/latex.php?latex=%5Ctheta&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;theta' title='&#92;theta' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=r_x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='r_x' title='r_x' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=r_y&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='r_y' title='r_y' class='latex' /> are the major axes lengths.  To implement this in programming, we can build the &#8220;vertices&#8221; of in a loop:</p>
<p><pre class="brush: java;">
float[] a = new float[3*361]; // 3-coordinates and 361 angles
for (int i=0; i&lt;=360; i+=3) {
    a[i+0] = x+(float)cos(i*PI/180)*rx; // X
    a[i+1] = y+(float)sin(i*PI/180)*ry; // Y
    a[i+2] = z;                         // Z
}
</pre></p>
<p>Drawing it using GL_LINE_LOOP will then render a completed ellipse:</p>
<div class="wp-caption aligncenter" style="width: 439px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/opengl/circle.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/opengl/circle.png" alt="When both axes are equal, you create a circle" width="429" height="369" /></a><p class="wp-caption-text">When both axes are equal, you create a circle</p></div>
<div class="wp-caption aligncenter" style="width: 426px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/opengl/ellipse.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/opengl/ellipse.png" alt="Differing radii will render an ellipse" width="416" height="340" /></a><p class="wp-caption-text">Differing radii will render an ellipse</p></div>
<br />Posted in Java, OpenGL  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=81&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2009/10/22/drawing-an-ellipse-in-opengl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/opengl/circle.png" medium="image">
			<media:title type="html">When both axes are equal, you create a circle</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/opengl/ellipse.png" medium="image">
			<media:title type="html">Differing radii will render an ellipse</media:title>
		</media:content>
	</item>
		<item>
		<title>Organizing Your Research PDFs on a Mac: Papers</title>
		<link>http://chrisingradschool.wordpress.com/2009/10/19/organizing-your-research-pdfs-on-a-mac-papers/</link>
		<comments>http://chrisingradschool.wordpress.com/2009/10/19/organizing-your-research-pdfs-on-a-mac-papers/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 21:46:17 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Papers]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=78</guid>
		<description><![CDATA[If you&#8217;re like me, say you&#8217;re in research or academia, you are constantly reading research papers.  In the old days, you would print off these papers and then organize them in folders or in stacks on your desk.  Well, my desk isn&#8217;t that big.  And paper and ink is expensive so the nowadays most people [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=78&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, say you&#8217;re in research or academia, you are constantly reading research papers.  In the old days, you would print off these papers and then organize them in folders or in stacks on your desk.  Well, my desk isn&#8217;t that big.  And paper and ink is expensive so the nowadays most people keep their research papers on their computers in the form of PDFs.  There are pros and cons of doing this, and I will talk about how to fix the biggest con which is organizing these beasts.  If you have and use Firefox, then you&#8217;ve probably heard of <a href="http://www.zotero.org/">Zotero</a>, which is a Firefox plugin that manages all your research documents.  There are two requirements to use this however: you must be a user of Firefox (I am not anymore), and you must be online (What if you took your laptop to a café with no WiFi?)  There are also two very big Pros to this program: it&#8217;s free, and it can export to BibTeX.</p>
<p>I don&#8217;t use Firefox anymore, the newest version of Safari works perfectly for me without the fluff.  So, Zotero is out.  Plus I wanted a standalone program to use.  In comes <a href="http://mekentosj.com/papers/">Papers</a>.  Papers was designed specifically for research and technical papers to organize.  It allows you to specify all the properties to be able to export to BibTeX, and even organize in different categories and subjects.  It even has a myriad of built-in search engines designed to find technical papers, such as <a href="http://scholar.google.com/">Google Scholar</a>, <a href="http://citeseer.ist.psu.edu/">Citeseer</a>, <a href="http://www.acm.org/">ACM</a>, <a href="http://www.ncbi.nlm.nih.gov/pubmed/">PubMed</a>, etc.  These search engines can also help you complete the meta information for these papers.</p>
<p>Papers organizes your PDFs much like iTunes organizes your music.  It copies the PDF (and optionally deletes the original) to a directory where it organizes it based on a scheme of your choosing.  This is handy because before, and with Zotero, it just points to where the paper is.  So if you do any future organization, the links are broken and have to be reestablished.  This is annoying.</p>
<p>The downside?  It ain&#8217;t free.  It costs $42.  But in my experience, a lot of these types of programs really fall short on what they offer in simplicity, reliability and usability.  I did the free 30 day trial and I was satisfied <em>enough </em>to pay the money for it.</p>
<p>What they need to create is a program that parses the PDFs to grab the information, but that has yet to be done properly.</p>
<p>Screenshots.</p>
<div class="wp-caption aligncenter" style="width: 575px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/papersdock.png"><img src="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/papersdock.png" alt="Papers fits in very well with iWork" width="565" height="151" /></a><p class="wp-caption-text">Papers fits in very well with iWork</p></div>
<div class="wp-caption aligncenter" style="width: 624px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/papersindex.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/papersindex.png" alt="You can browse all your papers in the library" width="614" height="416" /></a><p class="wp-caption-text">You can browse all your papers in the library (click for large)</p></div>
<div class="wp-caption aligncenter" style="width: 624px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/paperspreview.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/paperspreview.png" alt="You can also preview/read your PDFs directly in the program (click for large)" width="614" height="416" /></a><p class="wp-caption-text">You can also preview/read your PDFs directly in the program (click for large)</p></div>
<br />Posted in Apple, Papers  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=78&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2009/10/19/organizing-your-research-pdfs-on-a-mac-papers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/papersdock.png" medium="image">
			<media:title type="html">Papers fits in very well with iWork</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/papersindex.png" medium="image">
			<media:title type="html">You can browse all your papers in the library</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/papers/paperspreview.png" medium="image">
			<media:title type="html">You can also preview/read your PDFs directly in the program (click for large)</media:title>
		</media:content>
	</item>
		<item>
		<title>Editing Your Vim Parameters: .vimrc and .gvimrc</title>
		<link>http://chrisingradschool.wordpress.com/2009/09/18/editing-your-vim-parameters-vimrc-and-gvimrc/</link>
		<comments>http://chrisingradschool.wordpress.com/2009/09/18/editing-your-vim-parameters-vimrc-and-gvimrc/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 07:15:38 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=69</guid>
		<description><![CDATA[If you&#8217;re a programmer then you probably have heard of Vim.  Vim is a great text editor but the beauty lies in the syntax highlighting.  The idea is to be able to move swiftly through your code without lifting your fingers from the keyboard.  A mouse-less text editor.  It takes a little bit of practice, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=69&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">
<p style="text-align:justify;">If you&#8217;re a programmer then you probably have heard of Vim.  Vim is a great text editor but the beauty lies in the syntax highlighting.  The idea is to be able to move swiftly through your code without lifting your fingers from the keyboard.  A mouse-less text editor.  It takes a little bit of practice, but won&#8217;t take long to learn.  If you&#8217;re running linux, you can grab it through apt-get, if you&#8217;re on a Mac, the check out <a href="http://code.google.com/p/macvim/">MacVim</a>, and Windows users should go through the <a href="http://www.vim.org/download.php">Vim website</a>.  To learn, after you&#8217;ve installed Vim type &#8220;vimtutor&#8221; in a terminal and start practicing, I won&#8217;t go into how to operate this here.</p>
<p style="text-align:justify;">Vim currently supports a load of programming languages for syntax highlighting.  Although, I&#8217;m upset that there isn&#8217;t built-in support for <a href="http://www.scala-lang.org/">Scala</a> yet, you&#8217;ll have to find that file elsewhere.</p>
<p style="text-align:justify;">Now that you have your GVim editor (<strong>G</strong>raphical Vim), you can edit some of its properties.  In comes the two files: .vimrc and .gvimrc.  The first file should already exist within your home directory, and the latter you may need to create (within your home directoy as well).</p>
<p style="text-align:justify;">There are a number of settings you can manually set.  For my .gvimrc, for example, I have this:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><pre class="brush: xml;">&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;set lines=40&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;set columns=78&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;set guioptions-=m&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;set guioptions-=T&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;set guifont=Monaco:h13&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;</pre></p>
</div>
<p><pre class="brush: bash;">

set lines=40
set columns=78
set guioptions-=m
set guioptions-=T
set guifont=Monaco:h13

</pre></p>
<p>This sets the lines, columns, font type and size, as well as disables that ugly toolbar.  Basically what you&#8217;re left with is a clean window for editing:</p>
<p style="text-align:center;">
<div class="wp-caption aligncenter" style="width: 402px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/misc/Screenshot2009-09-18at10728AM.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/misc/Screenshot2009-09-18at10728AM.png" alt="Programming simplicity" width="392" height="430" /></a><p class="wp-caption-text">Programming simplicity</p></div>
<p>The .vimrc file has many options for you to throw in, and instead of listing everything, here are useful links to get you on your way:</p>
<ul>
<li><a href="http://jmcpherson.org/vimrc.html">Jonathon McPherson: .vimrc and customization</a></li>
<li><a href="http://vim.wikia.com/wiki/Open_vimrc_file">Vim Tips Wiki</a></li>
<li><a href="http://vimdoc.sourceforge.net/htmldoc/starting.html">Vimdoc Sourceforge</a></li>
</ul>
<br />Posted in Apple, Java, Vim  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=69&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2009/09/18/editing-your-vim-parameters-vimrc-and-gvimrc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/misc/Screenshot2009-09-18at10728AM.png" medium="image">
			<media:title type="html">Programming simplicity</media:title>
		</media:content>
	</item>
		<item>
		<title>Approximating an Ellipsoid In OpenGL Part Two: Recursively Subdivide</title>
		<link>http://chrisingradschool.wordpress.com/2009/08/20/approximating-an-ellipsoid-in-opengl-part-two-recursively-subdivide/</link>
		<comments>http://chrisingradschool.wordpress.com/2009/08/20/approximating-an-ellipsoid-in-opengl-part-two-recursively-subdivide/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 20:21:15 +0000</pubDate>
		<dc:creator>Chris Engelsma</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://chrisingradschool.wordpress.com/?p=66</guid>
		<description><![CDATA[While an icosahedron hardly looks like a sphere (unless you are looking at it from far away), we can easily approximate a sphere.  This is taken directly out of The Redbook, and adapted for Java: (For more information I recommend checking out this great book) To break this down, we divide each segment in half. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=66&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While an icosahedron hardly looks like a sphere (unless you are looking at it from far away), we can easily approximate a sphere.  This is taken directly out of <a href="http://www.opengl.org/documentation/red_book/">The Redbook</a>, and adapted for Java: (For more information I recommend checking out this great book)</p>
<p><pre class="brush: java;">
float[] v1, float[] v2, float[] v3, float depth)
{
float[] v12 = new float[3];
float[] v23 = new float[3];
float[] v31 = new float[3];

// If done, add the final vertices and return.
if (depth==0) {
      // Do what you will with the vertices here
      return;
    }
// Find the midpoint.
for (int i=0; i&lt;3; i++) {
v12[i] = (v1[i]+v2[i])/2.0f;
v23[i] = (v2[i]+v3[i])/2.0f;
v31[i] = (v3[i]+v1[i])/2.0f;
}

// Normalize the coordinates.
v12 = normalize(v12);
v23 = normalize(v23);
v31 = normalize(v31);

// Recursively subdivide
subdivide(v2,v23,v12,depth-1);
subdivide(v1,v12,v31,depth-1);
subdivide(v3,v31,v23,depth-1);
subdivide(v12,v23,v31,depth-1);
}
</pre></p>
<p>To break this down, we divide each segment in half.  To do this we must calculate the midpoint as shown above.  Next, we normalize each of those coordinates by using a function (which I called normalize) that can do whatever process you want to acquire the appropriate distance from the center.  (Purposefully being vague, but it&#8217;s not hard to figure out.)  We then take those new vertices and pop them into the recursion once again.  This will repeat until we&#8217;ve reached our target approximation.</p>
<p>Proper recursive subdivision will turn out icosahedron into a believable sphere.</p>
<div class="wp-caption aligncenter" style="width: 291px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture1.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture1.png" alt="0 recursion" width="281" height="268" /></a></dt>
<dt><p class="wp-caption-text">0 recursion</p></div>
<div class="wp-caption aligncenter" style="width: 300px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture1-1.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture1-1.png" alt="Single recursion" width="290" height="257" /></a><p class="wp-caption-text">Single recursion</p></div>
<div class="wp-caption aligncenter" style="width: 285px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture2.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture2.png" alt="Two recursions" width="275" height="241" /></a><p class="wp-caption-text">Two recursions</p></div>
<div class="wp-caption aligncenter" style="width: 393px"><a href="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture3.png"><img class=" " src="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture3.png" alt="Enough recursions will yield a nice sphere" width="383" height="346" /></a><p class="wp-caption-text">Enough recursions will yield a nice sphere</p></div>
<br />Posted in Java, OpenGL  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisingradschool.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisingradschool.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisingradschool.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisingradschool.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisingradschool.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisingradschool.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisingradschool.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisingradschool.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisingradschool.wordpress.com&amp;blog=7897147&amp;post=66&amp;subd=chrisingradschool&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisingradschool.wordpress.com/2009/08/20/approximating-an-ellipsoid-in-opengl-part-two-recursively-subdivide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39413f12f71b0a07aac3e359c252a3e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chris</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture1.png" medium="image">
			<media:title type="html">0 recursion</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture1-1.png" medium="image">
			<media:title type="html">Single recursion</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture2.png" medium="image">
			<media:title type="html">Two recursions</media:title>
		</media:content>

		<media:content url="http://i647.photobucket.com/albums/uu193/chrisengelsma/icosahedron/Picture3.png" medium="image">
			<media:title type="html">Enough recursions will yield a nice sphere</media:title>
		</media:content>
	</item>
	</channel>
</rss>
