<?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/"
	>

<channel>
	<title>dandesousa.com &#187; Guides</title>
	<atom:link href="http://dandesousa.com/category/resources/feed/" rel="self" type="application/rss+xml" />
	<link>http://dandesousa.com</link>
	<description>// a resource on anything</description>
	<lastBuildDate>Tue, 31 Aug 2010 02:30:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Finding Memory Leaks in .NET Using SOS.dll and Visual Studio</title>
		<link>http://dandesousa.com/2010/08/28/finding-memory-leaks-in-net-using-sos-dll-and-visual-studio/</link>
		<comments>http://dandesousa.com/2010/08/28/finding-memory-leaks-in-net-using-sos-dll-and-visual-studio/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 04:31:21 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://dandesousa.com/?p=665</guid>
		<description><![CDATA[Often, after finishing a major feature or wrapping up an application. You are faced with the challenge of tracking down memory leaks. Memory leaks occur when you allocate memory for an object, then lose track of the reference or overwrite the reference to that memory without freeing the memory in your application (essentially losing or [...]]]></description>
			<content:encoded><![CDATA[<p>Often, after finishing a major feature or wrapping up an application. You are faced with the challenge of tracking down memory leaks. Memory leaks occur when you allocate memory for an object, then lose track of the reference or overwrite the reference to that memory without freeing the memory in your application (essentially losing or “leaking” memory). In the context of C#, a memory leak is different since you don’t typically explicitly free an object you allocate. In C# a memory leak occurs when you allocate an object and then hold onto it without actually intending to. Finding the leak can be extraordinarily difficult in a large application. Luckily, Microsoft provides us with an extension to the debugger which allows us to inspection the code. This is known as SOS.dll (Son of Strike). First, locate the SOS.dll file on your machine. You can do it by opening up a search window on your windows drive or wherever the .NET framework is installed, and searching for SOS.dll:</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/sossearch1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="sossearch" border="0" alt="sossearch" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/sossearch_thumb1.png" width="454" height="310" /></a> </p>
<p>You’ll want the dll which pertains to your version and binary type (in my case I want the path referring to v4.030319 and non-64bit). </p>
<p>Next we’ll open up our application in visual studio and start the debugger.First you need to enable unmanaged debugging. So right click on your project and go to properties. You should see a window similar to the one below. Select debugging and make sure the circled checkbox is enabled:</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/enabledebug1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="enabledebug" border="0" alt="enabledebug" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/enabledebug_thumb1.png" width="454" height="296" /></a> </p>
<p> Run your application and wait until the point you want to check your memory usage. You’ll want to look for the pause button or hit CTRL+BREAK to break the running of your application.</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/pause1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="pause" border="0" alt="pause" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/pause_thumb1.png" width="454" height="66" /></a> </p>
<p>Next, open the immediate window or go to <strong>Debug-&gt;Windows-&gt;Immediate Window</strong> to bring it up.</p>
<p>Now, you’ll want to load SOS.dll to access the extensions, we do this with the load command in below:</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/load1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="load" border="0" alt="load" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/load_thumb1.png" width="454" height="154" /></a> </p>
</p>
<p>Ok, now we can issue commands to find out information about our system. Type in “!dumpheap” to get a list of all the allocated objects on the heap. Be careful though, you can easily overwhelm your system with output. To summarize and get only the useful information type “!dumpheap –stat”. You see something like this:</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/dumpheapstat1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="dumpheapstat" border="0" alt="dumpheapstat" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/dumpheapstat_thumb1.png" width="454" height="326" /></a> </p>
<p>The columns in order are, method table, number of instances in memory, total size of instances, type.</p>
<p>!dumpheap has a ton of flags. If you use !dump –type System.String, you can get a summary of all heap objects matching the type (in this case, System.String). Not that the method table is not the same as the memory address. Say we wanted to find out what was holding one of the dictionary objects. We could use !dumpheap –mt &lt;methodtable&gt; to get a list of all the objects in that method table. Then used the address provided to use gcroot to give us all the paths to the object in our application.</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/mt1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="mt" border="0" alt="mt" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/mt_thumb1.png" width="454" height="70" /></a> </p>
<p>Notice in this case there is only one object and one memory address. If your method table or type has many addresses it could be difficult to identify or find your target object (in that case try to find the memory address through a parent object with less instances (or preferably, 1). If we use that address we can use the command “!gcroot 02369d30” to find all references the garbage collector knows is keeping the object down. Output will look something like this:</p>
<p><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/gcroot1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="gcroot" border="0" alt="gcroot" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/08/gcroot_thumb1.png" width="454" height="242" /></a> </p>
<p>Work backwards from the bottom of each trace. It starts with the object in question and moves up the reference tree to a root node for the application. This would tell us that the object directly above our object is another dictionary, then a schema context and eventually a template. You can do this for any object you’d like to trace and see if the garbage collector will cleanup the object. </p>
<p>So whatever is holding onto our object could be causing the leak, therefore we could try to remove the link at the appropriate time, then re-observe to verify its status.</p>
<p>There are many functions available for SOS.dll. For a complete list of functions please visit the <a href="http://msdn.microsoft.com/en-us/library/bb190764(VS.80).aspx">MSDN site.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/08/28/finding-memory-leaks-in-net-using-sos-dll-and-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Solver Foundation for Quadratic Programming</title>
		<link>http://dandesousa.com/2010/07/15/microsoft-solver-foundation-for-quadratic-programming/</link>
		<comments>http://dandesousa.com/2010/07/15/microsoft-solver-foundation-for-quadratic-programming/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 01:55:13 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://dandesousa.com/?p=582</guid>
		<description><![CDATA[The Microsoft Solver Foundation provides some excellent APIs for solving optimization problems in C# .NET. Getting to documentation about the Quadratic Programming facilities can be a bit tricky though. I&#8217;ve added below some sample code to help out with this. In the following example I&#8217;m solving an example of the lagrangian dual form used for [...]]]></description>
			<content:encoded><![CDATA[<p>The Microsoft Solver Foundation provides some excellent APIs for solving optimization problems in C# .NET. Getting to documentation about the Quadratic Programming facilities can be a bit tricky though. I&#8217;ve added below some sample code to help out with this.</p>
<p>In the following example I&#8217;m solving an example of the lagrangian dual form used for classification in an SVM.</p>
<pre class="brush: csharp;">// Classify using solver
InteriorPointSolver solver = new InteriorPointSolver();

// Langrangian Dual
int dual = 0;
solver.AddRow(&quot;L&quot;, out dual);

// Sum Constraint
int linearConstraint = 0;
solver.AddRow(&quot;SumConstraint&quot;, out linearConstraint);

// Add variables and Lagrangian linear terms
int[] vars = new int[n];
for (int i = 0; i &amp;lt; n; i++)
{
	// Add the variable
	solver.AddVariable(&quot;a&quot; + i, out vars[i]);

	// Factor in C upper bounds
	solver.SetBounds(vars[i], 0, C);
}

// Linear constraint must equal 0
solver.SetBounds(linearConstraint, 0, 0);

// Lagrangian Quadratic Terms
for (int i = 0; i &amp;lt; n; i++) { 	solver.SetCoefficient(linearConstraint, vars[i], trainingData[i].output()); 	solver.SetCoefficient(dual, vars[i], 1); 	Parallel.For(0, n, o, (int j) =&amp;gt;
	{
		double coef = trainingData[i].output() * trainingData[j].output() *
			kernel.evaluate(trainingData[i].point(), trainingData[j].point());

		solver.SetCoefficient(dual, -0.5 * coef, vars[i], vars[j]);
	});
}

solver.AddGoal(dual, 0, false);

InteriorPointSolverParams param = new InteriorPointSolverParams();</pre>
<p>Essentially all we are doing here is adding all the variables to our constraint optimization problem and asking the solver to minimize. The vars array simply expressing a list of identifier for variables in the constraint problem. You should fire up the Solver Foundation library and give it a shot yourself.</p>
<p>Here are some resources that should make understanding this a bit easier as well. Its the official blog of one of the key developers on the project, specifically the links to tutorial on the quadratic programming solver.</p>
<p style="text-align: center;"><a href="http://blogs.msdn.com/b/natbr/archive/2009/09/24/using-the-solver-foundation-interior-point-solver.aspx">Nathan Brixius&#8217; QP Solver Tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/07/15/microsoft-solver-foundation-for-quadratic-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiking Trip – Bake Oven Knob</title>
		<link>http://dandesousa.com/2010/06/29/hiking-trip-bake-oven-knob/</link>
		<comments>http://dandesousa.com/2010/06/29/hiking-trip-bake-oven-knob/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 14:29:30 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Outdoors]]></category>
		<category><![CDATA[camping]]></category>
		<category><![CDATA[hiking]]></category>

		<guid isPermaLink="false">http://dandesousa.com/?p=565</guid>
		<description><![CDATA[A bunch of my friends took a trip to Bake Oven Knob in Lehighton, Pa this past Sunday. It was the first chance I&#8217;ve had to go hiking in a long time. It also presented a great opportunity to test out the camera and video chat features on my new iPhone 4. I also found this [...]]]></description>
			<content:encoded><![CDATA[<p>A bunch of my friends took a trip to Bake Oven Knob in Lehighton, Pa this past Sunday. It was the first chance I&#8217;ve had to go hiking in a long time. It also presented a great opportunity to test out the camera and video chat features on my new iPhone 4. I also found this great free app for the iPhone called RunKeeper which let me track out progress, time, and pace via GPS. It even lets you automatically share it through Facebook or embed it in your blog.</p>
<p style="text-align: center;"><a href="http://runkeeper.com/user/71957104/activity/11911212">Interact With This</a></p>
<p style="text-align: center;"><a href="http://dandesousa.com/wordpress/wp-content/uploads/2010/06/hike1.png"><img class="aligncenter size-medium wp-image-570" title="hike" src="http://dandesousa.com/wordpress/wp-content/uploads/2010/06/hike1-297x300.png" alt="" width="297" height="300" /></a></p>
<p style="text-align: center;">
<p>Overall we did about 7 miles, which amounts to going a little less than half way of the entire Bake Oven Knob trail, then turning back. I got some great shots I thought I&#8217;d share to anyone interested. The Bake Oven Knob privates a great view at its peak which is only about half a mile from the trail entrance.</p>
<p><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&#038;user_id=14353147@N05&#038;set_id=72157624259814411&#038;text=" frameBorder="0" width="500" height="500" scrolling="no"></iframe><br/><small>Created with <a href="http://www.admarket.se" title="Admarket.se">Admarket&#8217;s</a> <a href="http://flickrslidr.com" title="flickrSLiDR">flickrSLiDR</a>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/06/29/hiking-trip-bake-oven-knob/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo Fix: Roomba Clicking Noise</title>
		<link>http://dandesousa.com/2010/05/28/howto-fix-roomba-clicking-noise/</link>
		<comments>http://dandesousa.com/2010/05/28/howto-fix-roomba-clicking-noise/#comments</comments>
		<pubDate>Fri, 28 May 2010 17:02:10 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cleaning]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[roomba]]></category>

		<guid isPermaLink="false">http://dandesousa.com/?p=546</guid>
		<description><![CDATA[A while back the vacuum in our apartment stopped working so I decided to do something I always wanted: Get a roomba. So far its been great and it keeps the carpet clean with minimum effort. However, we have encountered some problems where the Roomba occasionally makes a repeated clicking noise and then shuts off. [...]]]></description>
			<content:encoded><![CDATA[<p>A while back the vacuum in our apartment stopped working so I decided to do something I always wanted: Get a roomba. So far its been great and it keeps the carpet clean with minimum effort.</p>
<p>However, we have encountered some problems where the Roomba occasionally makes a repeated clicking noise and then shuts off. It then repeats &#8220;Please Clean Roomba&#8217;s Brushes&#8221;. It got to the point where it was making the clicking noise EVERY time it was run and would shut down after about 2 minutes. I tried reseting the battery, cleaning the brushes&#8230;everything. Finally I realized what was wrong. I wasn&#8217;t cleaning the brushes properly. If you have a lot of dirt in your carpet or pets (we have cats), it&#8217;s easy for fibers to get wrapped around some of the moving parts of the roomba brush.</p>
<p>So to fix the problem simply remove the brushes from the Roomba as your normally would to clean them. However, check under the yellow cap at the end of both brushes (by that I mean the brush and the rubber roller). Don&#8217;t worry, they are designed to come off, so you can pull on them. Afterwards you may see something like this:</p>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://farm5.static.flickr.com/4045/4647414023_625bc72f44_d.jpg"><img title="Roomba Brush Under-Cap" src="http://farm5.static.flickr.com/4045/4647414023_625bc72f44_d.jpg" alt="" width="500" height="333" /></a><p class="wp-caption-text">What you may see if your roomba is making a clicking noise</p></div>
<p>Just pull out all the hair and fibers with a pencil or paper clip and replace the yellow cap. Afterwards your roomba will be good as new! Be aware though, that this is likely to happen again so make sure you periodically clean under the cap of both brush attachments.</p>
<p><a href="http://farm5.static.flickr.com/4038/4647413667_40a50cb12a_d.jpg"><img class="aligncenter" title="Another Brush Angle" src="http://farm5.static.flickr.com/4038/4647413667_40a50cb12a_d.jpg" alt="" width="500" height="333" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/05/28/howto-fix-roomba-clicking-noise/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick Fix: iPhone Microphone and Headset Buttons don’t work</title>
		<link>http://dandesousa.com/2010/04/04/quick-fix-iphone-microphone-and-headset-buttons-dont-work/</link>
		<comments>http://dandesousa.com/2010/04/04/quick-fix-iphone-microphone-and-headset-buttons-dont-work/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 18:38:15 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://dandesousa.com/2010/04/04/quick-fix-iphone-microphone-and-headset-buttons-dont-work/</guid>
		<description><![CDATA[I recently had a problem with my iPhone headphones where neither the built in mic nor the headphone answer (or start/stop) button would work. I attributed the failure to a recent tumble which also crack my front glass along the bezel. Now, thanks to a helpful blog post I was able to correct the problem. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a problem with my iPhone headphones where neither the built in mic nor the headphone answer (or start/stop) button would work. I attributed the failure to a recent tumble which also crack my front glass along the bezel. </p>
<p>Now, thanks to a helpful blog post I was able to correct the problem. Seems like a rather large piece lint had made it&#8217;s way into the headphone jack and was blocking the plug. I would have never figured it out if it wasn&#8217;t for this helpful blog post. So I&#8217;ve linked it below and will leave the explanation to him:</p>
<p>http://www.iphoneincanada.ca/tips-tricks/how-to-fix-your-iphone-headphones-mic-if-its-not-working/</p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/04/04/quick-fix-iphone-microphone-and-headset-buttons-dont-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Dual Monitors in Ubuntu with Nvidia</title>
		<link>http://dandesousa.com/2010/01/24/how-to-dual-monitors-in-ubuntu-with-nvidia/</link>
		<comments>http://dandesousa.com/2010/01/24/how-to-dual-monitors-in-ubuntu-with-nvidia/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 20:13:32 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://dandesousa.com/?p=512</guid>
		<description><![CDATA[I noticed that a lot of people are getting &#8220;cannot parse xorg.conf&#8221; message when they try to set up dual monitors with Nvidia settings manager in ubuntu. Here is the solution. On the command line: sudo nvidia-xconfig You should see it tell you that it overrode your xorg.conf. If you get warnings don&#8217;t worry, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed that a lot of people are getting &#8220;cannot parse xorg.conf&#8221; message when they try to set up dual monitors with Nvidia settings manager in ubuntu. Here is the solution.</p>
<p>On the command line:</p>
<pre>sudo nvidia-xconfig</pre>
<p>You should see it tell you that it overrode your xorg.conf. If you get warnings don&#8217;t worry, it&#8217;s likely just indicating that there was a previous problem. Then on the command line again, type this:</p>
<pre>sudo nvidia-settings</pre>
<p>Now setup your dual monitor or triple monitor configuration as you want (with Twin View and the correct orientation). Then hit save configuration at the bottom and you should see that you get no error.</p>
<p>Reboot and enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/01/24/how-to-dual-monitors-in-ubuntu-with-nvidia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling OpenGL on Mac OS X or Linux</title>
		<link>http://dandesousa.com/2010/01/16/compiling-opengl-on-mac-os-x-or-linux/</link>
		<comments>http://dandesousa.com/2010/01/16/compiling-opengl-on-mac-os-x-or-linux/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 02:50:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://dandesousa.com/?p=499</guid>
		<description><![CDATA[Most linux distributions make it easy to compile programs using OpenGL. Other systems, however, aren&#8217;t so easy. Here are instructions on how to get it running in both platforms. Ubuntu / Linux Make sure you install the opengl-mesa packages for opengl development. On ubuntu you can get them all with the following invocation: sudo apt-get [...]]]></description>
			<content:encoded><![CDATA[<p>Most linux distributions make it easy to compile programs using OpenGL. Other systems, however, aren&#8217;t so easy. Here are instructions on how to get it running in both platforms.</p>
<p><strong>Ubuntu / Linux</strong></p>
<ol>
<li>Make sure you install the opengl-mesa packages for opengl development. On ubuntu you can get them all with the following invocation:
<pre>sudo apt-get install freeglut3-dev</pre>
</li>
<li>You should include the following #includes in your code referencing opengl:
<div id="_mcePaste">
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">#  include &lt;GL/gl.h&gt;
#  include &lt;GL/glu.h&gt;
#  include &lt;GL/glut.h&gt;</pre>
</div>
</li>
<li>You should also have the following gcc cmdline flags in your makefile:
<pre>gcc -o simple simple.c -lGL -lglut -lGLU</pre>
</li>
</ol>
<p><strong>Mac OS X (tested on Snow Leopard)</strong></p>
<ol>
<li>For this to work you will have to install gcc and Xcode, which should install all the required opengl/glut libraries. You can get it <a href="http://developer.apple.com/">here</a>.</li>
<li>Now, you&#8217;ll have to alter all the #includes in your files to conform to the proper location. Change all your opengl #includes to the following:<span style="font-family: monospace;"> </span>
<pre>#  include &lt;OpenGL/gl.h&gt;
#  include &lt;OpenGL/glu.h&gt;
#  include &lt;GLUT/glut.h&gt;</pre>
</li>
<li>Additionally your gcc command line will need to contain the following flags to link, along with any others you might have:
<pre>gcc -o simple simple.c -framework Carbon -framework OpenGL -framework GLUT</pre>
</li>
</ol>
<p><strong>Cross Platform Compatibility</strong></p>
<p><strong><span style="font-weight: normal;">If you want your code to run on both, you need to get the Makefile and code to load the proper libraries depending on your system. </span></strong></p>
<p><strong><span style="font-weight: normal;">In all your OpenGL .c files, add the following header instead of your linux/mac includes:</span></strong></p>
<pre>#ifdef __APPLE__
#  include &lt;OpenGL/gl.h&gt;
#  include &lt;OpenGL/glu.h&gt;
#  include &lt;GLUT/glut.h&gt;
#else
#  include &lt;GL/gl.h&gt;
#  include &lt;GL/glu.h&gt;
#  include &lt;GL/glut.h&gt;
#endif</pre>
<p>Then in your makefile, add the following before your build targets:</p>
<pre>#default cmdline flags</pre>
<pre>LDFLAGS	= -lGL -lglut -lGLU</pre>
<pre># Mac OS alternate cmdline link options
ifeq "$(OSTYPE)" "Darwin"
	LDFLAGS	= -framework Carbon -framework OpenGL -framework GLUT
endif</pre>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2010/01/16/compiling-opengl-on-mac-os-x-or-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HF100 + ImageMixer Fix For Startup Freeze</title>
		<link>http://dandesousa.com/2009/02/06/hf100-imagemixer-fix-for-startup-freeze/</link>
		<comments>http://dandesousa.com/2009/02/06/hf100-imagemixer-fix-for-startup-freeze/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 00:23:52 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.danielsousa.info/wordpress/2009/02/hf100-imagemixer-fix-for-startup-freeze/</guid>
		<description><![CDATA[So I just got a new camcorder thanks to now qualifying for the US stimulus package from back in April. I was looking around for something to help stimulate the economy and decided that I should get a camcorder while prices are low and money is high. Anyway, the HF100 is flash based and really [...]]]></description>
			<content:encoded><![CDATA[<p align="left">So I just got a new camcorder thanks to now qualifying for the US stimulus package from back in April. I was looking around for something to help stimulate the economy and decided that I should get a camcorder while prices are low and money is high. Anyway, the HF100 is flash based and really nice. It records in full HD 1080p with pretty decent picture quality, though I have yet to record in full light setting (outside). So far I only have sort of dim shots indoors of my roommate&#8217;s cats and my ferret.</p>
<p align="left">Anyway in my commitment to making a post with something useful every week, I&#8217;ve decided to share a tip with the world. Seems as though when I installed my ImageMixer 3 SE software, it would just freeze upon startup. Normally I wouldn&#8217;t mind the issue with crap proprietary software, but there is no easy way to edit .MTS/M2TS files without converting and losing quality. Since I prefer to keep the originals as well as edit them so that extra footage is chopped off, I needed to figure out what was wrong. After some digging I found the solution to my problem.</p>
<p align="left">If this occurs for you, you need to install all third party codec packs you installed. I had the CCCP (Community Codec Pak), which is useful for watching MKVs. Unfortunately, that was messing up something, so I had to uninstall it. I found numerous posts talking about uninstalling codec packs, so that&#8217;s probably the way to go. </p>
<p align="left">Unfortunately, that eliminates the ability to play back MKV&#8217;s in WMV. I don&#8217;t have a solution for this but I suggest installing <a href="http://www.videolan.org/vlc/" target="_blank">VLC</a>. It is wonderful and plays everything.</p>
<p align="left">My first video, the high definition is better if you go straight to youtube:</p>
<p align="center">&#160;</p>
<p align="center"><embed src="http://www.youtube.com/v/eBXqOGTKyaA&amp;hl=en&amp;fs=1" width="480" height="295" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2009/02/06/hf100-imagemixer-fix-for-startup-freeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finally! Sync iPhone with Google Calendar &#8212; Seemlessly!</title>
		<link>http://dandesousa.com/2008/11/13/finally-sync-iphone-with-google-calendar-seemlessly/</link>
		<comments>http://dandesousa.com/2008/11/13/finally-sync-iphone-with-google-calendar-seemlessly/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 01:31:14 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.danielsousa.info/wordpress/?p=255</guid>
		<description><![CDATA[Ok, so I&#8217;ve been looking for a way to do this for a long time. I won&#8217;t spend time talking about it but rather I&#8217;ll just give you details on how to do it. After doing this you will be able to: Update Google Calendar from the Calendar app on iPhone Have new events appear [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so I&#8217;ve been looking for a way to do this for a long time. I won&#8217;t spend time talking about it but rather I&#8217;ll just give you details on how to do it.</p>
<p>After doing this you will be able to:</p>
<ul>
<li>Update Google Calendar from the Calendar app on iPhone</li>
<li>Have new events appear in your main Calendar on gCal</li>
<li>See newly added events on gCal and your iPhone</li>
<li>Get your updated Calendar WITHOUT syncing, this is all over the air</li>
</ul>
<p><span id="more-255"></span></p>
<div>To do this we&#8217;ll be setting up an exchange server which links to you gCal account. This requires you to setup an account. So:</div>
<div></div>
<div><strong>STEP 1</strong></div>
<div>Create an account at <a href="https://www.nuevasync.com/">https://www.nuevasync.com/</a> and link it to your google calendar.</div>
<div></div>
<div><strong>STEP 2</strong></div>
<div>Set up your iPhone by following these steps:</div>
<div>
<ol>
<li>Go to your Calendar and Mail Settings</li>
<li>Select “Add Account”.</li>
<li>Choose “Microsoft Exchange”</li>
<li>For “Email” enter the e-mail you used for NuevaSync.</li>
<li>For “Username” enter your NuevaSync username.</li>
<li>For “Password” enter your NuevaSync password.</li>
<li>Choose “Next”.</li>
<li>When the next screen comes up, choose “Server”. Enter “www.nuevasync.com” for server.</li>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-263" title="photo-21" src="http://www.danielsousa.info/wordpress/wp-content/uploads/2008/11/photo-21-200x300.jpg" alt="" width="200" height="300" /></p>
<li>Choose “Next”.</li>
<li>On the next page, turn off everything except for Calendars. Make sure Calendars is turned on.</li>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-262" title="photo-3" src="http://www.danielsousa.info/wordpress/wp-content/uploads/2008/11/photo-3-200x300.jpg" alt="" width="200" height="300" /></p>
<li>Tap “Save”</li>
</ol>
<div>If you go back in your settings you should see something like this:</div>
<div style="text-align: center;"><a href="http://www.mvpeditor.com/dandesousa.com/wordpress/wp-content/uploads/2008/11/photo-11.jpg"><img class="alignnone size-medium wp-image-260" title="photo-11" src="http://www.danielsousa.info/wordpress/wp-content/uploads/2008/11/photo-11-200x300.jpg" alt="" width="200" height="300" /></a></div>
<div style="text-align: center;"></div>
<div><strong>STEP 3</strong></div>
</div>
<div>You&#8217;ll need to adjust your timezone settings on your iPhone. Just scroll down in the Mail settings. You should see a screen like this:</div>
<div style="text-align: center;"><a href="http://www.mvpeditor.com/dandesousa.com/wordpress/wp-content/uploads/2008/11/photo.jpg"><img class="alignnone size-medium wp-image-258" title="TimeZone Support" src="http://www.danielsousa.info/wordpress/wp-content/uploads/2008/11/photo-200x300.jpg" alt="" width="200" height="300" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2008/11/13/finally-sync-iphone-with-google-calendar-seemlessly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NES ROM Editing</title>
		<link>http://dandesousa.com/2008/11/12/nes-rom-editting/</link>
		<comments>http://dandesousa.com/2008/11/12/nes-rom-editting/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 19:39:37 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.danielsousa.info/wordpress/?p=233</guid>
		<description><![CDATA[So I did a presentation a couple years ago on NES Rom editting and I learned a lot about how to do some simple rom hacking and how old school cheat tools like game genie and game shark worked. Anyway I&#8217;ve decided to share the presentation I gave as well as all the resources I [...]]]></description>
			<content:encoded><![CDATA[<p>So I did a presentation a couple years ago on NES Rom editting and I learned a lot about how to do some simple rom hacking and how old school cheat tools like game genie and game shark worked. Anyway I&#8217;ve decided to share the presentation I gave as well as all the resources I used. Everything is totally open. Everything I used to make the presentation below is included in the zip file and I even wrote up a quick little tool in .NET to translate text to dragon warrior tile entries. Anyway feel free to edit it as much as you&#8217;d like, but if you do anything cool with it I&#8217;d like to know so just shoot me an e-mail or leave some info in the comments.</p>
<p><a href="http://www.cs.drexel.edu/~dsd33/demos/nes_rom_editting/Presentation.zip" target="_self">Click here to download resources</a></p>
<p> </p>
<p style="text-align: center;"> <iframe src='http://docs.google.com/EmbedSlideshow?docid=d9jph9x_54gg9bdtcr' frameborder='0' width='410' height='342'></iframe> </p>
]]></content:encoded>
			<wfw:commentRss>http://dandesousa.com/2008/11/12/nes-rom-editting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
