<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bobobobo's Weblog</title>
	<atom:link href="http://bobobobo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobobobo.wordpress.com</link>
	<description>technology and the internets</description>
	<lastBuildDate>Sun, 01 Nov 2009 18:24:48 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='bobobobo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0e8d17c68f90a18a1e89a776717e00e2?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Bobobobo's Weblog</title>
		<link>http://bobobobo.wordpress.com</link>
	</image>
			<item>
		<title>NSString to char* and back again</title>
		<link>http://bobobobo.wordpress.com/2009/11/01/nsstring-to-char-and-back-again/</link>
		<comments>http://bobobobo.wordpress.com/2009/11/01/nsstring-to-char-and-back-again/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 17:09:21 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[c-strings]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[nsstring]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1372</guid>
		<description><![CDATA[Here&#8217;s how you do it.
NSString to char*


NSString* nsstr = @"My NSString" ;
const char * cstr = [ nsstr cStringUsingEncoding:ASCIIEncoding ] ;

// There's also
const char * cstr2 = [ nsstr UTF8String ] ;


These are covered in the docs page for NSString, basically.
char * to NSString


// Here you simply want to use one of the static method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1372&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s how you do it.</p>
<h1>NSString to char*</h1>
<blockquote>
<pre>
NSString* nsstr = @"My NSString" ;
const char * cstr = [ nsstr <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/cStringUsingEncoding:">cStringUsingEncoding</a>:ASCIIEncoding ] ;

// There's also
const char * cstr2 = [ nsstr <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/UTF8String">UTF8String</a> ] ;
</pre>
</blockquote>
<p>These are covered in <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Classes/NSString_Class/Reference/NSString.html">the docs page for NSString</a>, basically.</p>
<h1>char * to NSString</h1>
<blockquote>
<pre>
// Here you simply want to use one of the static method constructors
const char * cstyleString = "HELLO!!" ;
NSString * nsstr = [ NSString <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/clm/NSString/stringWithUTF8String:">stringWithUTF8String</a>:cstyleString ] ;

Or an instance method
NSString * nsstr2 = [[ NSString alloc ] <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/initWithUTF8String:">initWithUTF8String</a>:cstyleString ]

(( just a note that <a href="http://stackoverflow.com/questions/1657544/what-does-the-mean-on-mac-dev-center/1657550">any methods labelled with + method are static methods and methods labelled with - are instance methods</a> ))
</pre>
</blockquote>
<h1>sprintf() for NSString</h1>
<p><a href="http://blog.objectgraph.com/index.php/2008/03/16/sprintf-with-nsstring/">Use initWithFormat</a></p>
<blockquote>
<pre>
[ [ NSString alloc ] initWithFormat:@"%s is %d years old", "Bobby", 45 ]
</pre>
</blockquote>
Posted in misc Tagged: c-strings, iphone, nsstring, objective-c <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1372/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1372&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/11/01/nsstring-to-char-and-back-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>Do you write char* var, char * var, or char *var ?</title>
		<link>http://bobobobo.wordpress.com/2009/10/31/do-you-write-char-var-char-var-or-char-var/</link>
		<comments>http://bobobobo.wordpress.com/2009/10/31/do-you-write-char-var-char-var-or-char-var/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:45:49 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[C C++]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1370</guid>
		<description><![CDATA[This seems to be a trivial and is an inherently subjective question but I want to know what the best practice is __with reasons__.
I used to write


    char * var ;


But I started writing


    char* var ;


Because I thought that the type of var is simply char* so the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1370&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This seems to be a trivial and is an inherently subjective question but I want to know what the best practice is __with reasons__.</p>
<p>I used to write</p>
<blockquote>
<pre>
    char * var ;
</pre>
</blockquote>
<p>But I started writing</p>
<blockquote>
<pre>
    char* var ;
</pre>
</blockquote>
<p>Because I thought that the type of var is simply <code>char*</code> so the * pointer should be stuck to the type so its read in &#8220;one eyeful.&#8221;</p>
<p>THEN I ran into a bug recently where I didn&#8217;t notice that I had declarations</p>
<blockquote>
<pre>
    char* var1, var2 ;
</pre>
</blockquote>
<p>And I actually didn&#8217;t realize that var2 was type char, not char*.  Hmm.  Then I thought, well, this way makes the most sense then:</p>
<blockquote>
<pre>
    char *var1, *var2 ;
</pre>
</blockquote>
<p>Currently I&#8217;m thinking the last way is the correct way now.</p>
Posted in C C++, C++ Tagged: C++ <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1370&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/10/31/do-you-write-char-var-char-var-or-char-var/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>End of the football.</title>
		<link>http://bobobobo.wordpress.com/2009/10/17/end-of-the-football/</link>
		<comments>http://bobobobo.wordpress.com/2009/10/17/end-of-the-football/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 15:00:38 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1367</guid>
		<description><![CDATA[&#8220;End of the football.&#8221;
http://www.youtube.com/watch?v=aVhYN7NTIKU
this isn&#8217;t just funny to watch, its _real_!
this isn&#8217;t funny in an &#8220;aha look at him sort&#8221; of way,
look at her expression at 1:00, and his answers to some of the questions is quite hilarious.
Posted in misc       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1367&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h1>&#8220;End of the football.&#8221;</h1>
<p><a href="http://www.youtube.com/watch?v=aVhYN7NTIKU">http://www.youtube.com/watch?v=aVhYN7NTIKU</a></p>
<p>this isn&#8217;t just funny to watch, its _real_!</p>
<p>this isn&#8217;t funny in an &#8220;aha look at him sort&#8221; of way,</p>
<p>look at her expression at 1:00, and his answers to some of the questions is quite hilarious.</p>
Posted in misc  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1367/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1367&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/10/17/end-of-the-football/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>Saving rstp streams</title>
		<link>http://bobobobo.wordpress.com/2009/10/11/saving-rstp-streams/</link>
		<comments>http://bobobobo.wordpress.com/2009/10/11/saving-rstp-streams/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 16:38:34 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1364</guid>
		<description><![CDATA[You can use mplayer as follows:


Download mplayer from here if you&#8217;re on a windows machine.  If that stops working, pick another installer package from this list.  If you&#8217;re not on windows start here, you may choose to build from source if you&#8217;re a masochist.




mplayer -dumpstream -dumpfile stream.wmv mms://lang.stanford.edu/courses/ee380/050216-ee380-100.wmv


from here
Right now i&#8217;m not able [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1364&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You can use mplayer as follows:</p>
<ol>
<li>
<a href="http://mulder.dummwiedeutsch.de/home/?page=projects#mplayer">Download mplayer from here</a> if you&#8217;re on a windows machine.  If that stops working, pick another installer package <a href="http://www.mplayerhq.hu/design7/projects.html#windows">from this list</a>.  If you&#8217;re not on windows start <a href="http://www.mplayerhq.hu/design7/dload.html">here</a>, you may choose to build from source if you&#8217;re a masochist.
</li>
</ol>
<blockquote>
<pre>
mplayer -dumpstream -dumpfile stream.wmv mms://lang.stanford.edu/courses/ee380/050216-ee380-100.wmv
</pre>
</blockquote>
<p><a href="http://ubuntuforums.org/showthread.php?t=173436">from here</a></p>
<p>Right now i&#8217;m not able to rip the stream the connection keeps timing out thouhg</p>
Posted in misc  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1364&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/10/11/saving-rstp-streams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>necessary and sufficient conditions</title>
		<link>http://bobobobo.wordpress.com/2009/10/10/necessary-and-sufficient-conditions/</link>
		<comments>http://bobobobo.wordpress.com/2009/10/10/necessary-and-sufficient-conditions/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 17:07:56 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[conditions]]></category>
		<category><![CDATA[discrete]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[necessary]]></category>
		<category><![CDATA[sufficient]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1362</guid>
		<description><![CDATA[Sufficient condition

An event A is said to be a sufficient condition for an event B iff

The truth/occurrence of event A guarantees the truth/occurrence of event B

Necessary condition

An event A is said to be necessary for an event B
iff the falsity/nonoccurrence of event A GUARANTEES
the falsity/nonoccurrence of event B.
Posted in misc Tagged: conditions, discrete, math, mathematics, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1362&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h1>Sufficient condition</h1>
<p>
An event A is said to be a sufficient condition for an event B iff</p>
<blockquote><p>
The truth/occurrence of event A guarantees the truth/occurrence of event B</li>
</blockquote>
<h1>Necessary condition</h1>
<p>
An event A is said to be necessary for an event B<br />
iff the falsity/nonoccurrence of event A GUARANTEES<br />
the falsity/nonoccurrence of event B.</p>
Posted in misc Tagged: conditions, discrete, math, mathematics, necessary, sufficient <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1362&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/10/10/necessary-and-sufficient-conditions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>Barycentric coordinates</title>
		<link>http://bobobobo.wordpress.com/2009/10/01/barycentric-coordinates/</link>
		<comments>http://bobobobo.wordpress.com/2009/10/01/barycentric-coordinates/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 19:47:42 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1358</guid>
		<description><![CDATA[Barycentric coordinates


Plane plane = new Plane( a, b, c ) ;

float areaABC = Vector3.Dot( plane.Normal, Vector3.Cross( b - a, c - a ) ) ;
float areaPBC = Vector3.Dot( plane.Normal, Vector3.Cross( b - P, c - P ) ) ;
float areaPCA = Vector3.Dot( plane.Normal, Vector3.Cross( c - P, a - P ) ) ;

float alpha = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1358&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h1>Barycentric coordinates</h1>
<blockquote>
<pre>
Plane plane = new Plane( a, b, c ) ;

float areaABC = Vector3.Dot( plane.Normal, Vector3.Cross( b - a, c - a ) ) ;
float areaPBC = Vector3.Dot( plane.Normal, Vector3.Cross( b - P, c - P ) ) ;
float areaPCA = Vector3.Dot( plane.Normal, Vector3.Cross( c - P, a - P ) ) ;

float alpha = areaPBC / areaABC ;
float beta = areaPCA / areaABC ;
float gamma = 1.0f - alpha - beta ;
</pre>
</blockquote>
Posted in misc  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1358/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1358&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/10/01/barycentric-coordinates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>more joel on software &#8211;</title>
		<link>http://bobobobo.wordpress.com/2009/09/25/more-joel-on-software/</link>
		<comments>http://bobobobo.wordpress.com/2009/09/25/more-joel-on-software/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 00:06:03 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1353</guid>
		<description><![CDATA[&#8220;watching nonprogrammers trying to run software companies is like watching someone who doesn&#8217;t know how to surf trying to surf&#8221;
I read that, and i&#8217;m like THANK YOU
LOL!!  joel refers to the 1984 mac commercial on page 32.  He starts to point at how the whole MAC thing.. macusers have a distinct groovy personality [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1353&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&#8220;watching nonprogrammers trying to run software companies is like watching someone who doesn&#8217;t know how to surf trying to surf&#8221;</p>
<p>I read that, and i&#8217;m like THANK YOU</p>
<p>LOL!!  joel refers to <a href="http://www.youtube.com/watch?v=OYecfV3ubP8">the 1984 mac commercial</a> on page 32.  He starts to point at how the whole MAC thing.. macusers have a distinct groovy personality from pc users.  or something.</p>
Posted in misc  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1353&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/09/25/more-joel-on-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>Using WinInet as an alternative to libcurl</title>
		<link>http://bobobobo.wordpress.com/2009/09/15/using-wininet-as-an-alternative-to-libcurl/</link>
		<comments>http://bobobobo.wordpress.com/2009/09/15/using-wininet-as-an-alternative-to-libcurl/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 23:14:26 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1348</guid>
		<description><![CDATA[Instead of fighting with libcurl you could just use WinInet for your http needs if you are married to the Windows platform.
A quick example follows, great article, and as usual pretty difficult to navigate msdn docs

#include &#60;windows.h&#62;
#include &#60;wininet.h&#62;

#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;

#pragma comment ( lib, "Wininet.lib" )

int main()
{
  HINTERNET hInternet = InternetOpenA("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1348&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Instead of <a href="http://bobobobo.wordpress.com/2008/11/08/working-with-curl-getting-started-the-easy-way-on-win32/">fighting with libcurl</a> you could just use WinInet for your http needs if you are married to the Windows platform.</p>
<p>A quick example follows, <a href="http://www.dotnetheaven.com/UploadFile/mahesh/WinInetIntroduction05242005061945AM/WinInetIntroduction.aspx">great article</a>, and as usual <a href="http://msdn.microsoft.com/en-us/library/aa385483(VS.85).aspx">pretty difficult to navigate msdn docs</a></p>
<pre>
#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#pragma comment ( lib, "Wininet.lib" )

int main()
{
  HINTERNET hInternet = InternetOpenA("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );

  HINTERNET hConnection = InternetConnectA( hInternet, "mohammad.appspot.com", 80, " "," ", INTERNET_SERVICE_HTTP, 0, 0 );

  HINTERNET hData = HttpOpenRequestA( hConnection, "GET", "/", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0 );

  char buf[ 2048 ] ;

  HttpSendRequestA( hData, NULL, 0, NULL, 0 ) ;

  DWORD bytesRead = 0 ;
  DWORD totalBytesRead = 0 ;
  // http://msdn.microsoft.com/en-us/library/aa385103(VS.85).aspx
  // To ensure all data is retrieved, an application must continue to call the
  // InternetReadFile function <b>until the function returns TRUE and the</b>
  // <b>lpdwNumberOfBytesRead parameter equals zero</b>.
  while( InternetReadFile( hData, buf, 2000, &amp;bytesRead ) &amp;&amp; bytesRead != 0 )
  {
    buf[ bytesRead ] = 0 ; // insert the null terminator.

    puts( buf ) ;          // print it to the screen.

    printf( "%d bytes read\n", bytesRead ) ;

    totalBytesRead += bytesRead ;
  }

  printf( "\n\n END -- %d bytes read\n", bytesRead ) ;
  printf( "\n\n END -- %d TOTAL bytes read\n", totalBytesRead ) ;

  InternetCloseHandle( hData ) ;
  InternetCloseHandle( hConnection ) ;
  InternetCloseHandle( hInternet ) ;

}
</pre>
Posted in misc  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1348&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/09/15/using-wininet-as-an-alternative-to-libcurl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>adding .fetch( 100 ) makes the addition of dynamic fields work!</title>
		<link>http://bobobobo.wordpress.com/2009/09/13/adding-fetch-100-makes-the-addition-of-dynamic-fields-work/</link>
		<comments>http://bobobobo.wordpress.com/2009/09/13/adding-fetch-100-makes-the-addition-of-dynamic-fields-work/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 06:42:46 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[google appengine]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1346</guid>
		<description><![CDATA[google app engine
index.py

class Person( db.Model ) :
  name = db.StringProperty()

class TPerson( webapp.RequestHandler ) :
  def get( self ) :

    # run once
    '''
    people = [ 'John Hopkins', 'Bob Jordan', 'Mike Bobs' ]

    for person in people :
    [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1346&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h1>google app engine</h1>
<h2>index.py</h2>
<pre>
class Person( db.Model ) :
  name = db.StringProperty()

class TPerson( webapp.RequestHandler ) :
  def get( self ) :

    # run once
    '''
    people = [ 'John Hopkins', 'Bob Jordan', 'Mike Bobs' ]

    for person in people :
      p = Person()
      p.name = person
      p.put()
    '''

    people = db.GqlQuery( 'select * from Person' ).fetch( 1000 ) 

    # if you don't .fetch(), then the addition of dynamic
    # properties won't work here.
    for person in people :
      person.shortname = person.name[ 0:2 ]

    self.response.out.write( template.render( 'TPerson.html', { 'people' : people } ) )

application = webapp.WSGIApplication([

  ( '/TPerson', TPerson ),

  ], debug=True )

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()
</pre>
<h2>TPerson.html</h2>
<pre>
{% for p in people %}
&lt;p&gt;{{ p.name }}&lt;/p&gt;
&lt;p&gt;{{ p.shortname }}&lt;/p&gt;
{% endfor %}
</pre>
Posted in misc Tagged: google appengine, python <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1346&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/09/13/adding-fetch-100-makes-the-addition-of-dynamic-fields-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>ooh, that&#8217;s a colorful error..</title>
		<link>http://bobobobo.wordpress.com/2009/09/09/ooh-thats-a-colorful-error/</link>
		<comments>http://bobobobo.wordpress.com/2009/09/09/ooh-thats-a-colorful-error/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 12:31:53 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[google appengine]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1343</guid>
		<description><![CDATA[I got this error in my google app engine application
it says something to the effect of

&#60;type &#8216;exceptions.ImportError&#8217;&#62;  Python 2.5.4: c:\python25\python.exe
Wed Sep 09 12:29:14 2009
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 c:\program files (x86)\google\google_appengine\google\appengine\tools\dev_appserver.py in _HandleRequest(self=)
 2921  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1343&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I got this error in my google app engine application</p>
<p>it says something to the effect of</p>
<blockquote><p>
&lt;type &#8216;exceptions.ImportError&#8217;&gt;  Python 2.5.4: c:\python25\python.exe<br />
Wed Sep 09 12:29:14 2009<br />
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.</p>
<p> c:\program files (x86)\google\google_appengine\google\appengine\tools\dev_appserver.py in _HandleRequest(self=)<br />
 2921                               infile,<br />
 2922                               outfile,<br />
 2923                               base_env_dict=env_dict)<br />
 2924         finally:<br />
 2925           self.module_manager.UpdateModuleFileModificationTimes()<br />
base_env_dict undefined, env_dict = {&#8216;APPLICATION_ID&#8217;: &#8216;mohammad&#8217;, &#8216;CURRENT_VERSION_ID&#8217;: &#8216;1.1&#8242;, &#8216;REMOTE_ADDR&#8217;: &#8216;127.0.0.1&#8242;, &#8216;REQUEST_METHOD&#8217;: &#8216;GET&#8217;, &#8216;SERVER_NAME&#8217;: &#8216;localhost&#8217;, &#8216;SERVER_PORT&#8217;: &#8216;8080&#8242;, &#8216;SERVER_PROTOCOL&#8217;: &#8216;HTTP/1.0&#8242;, &#8216;SERVER_SOFTWARE&#8217;: &#8216;Development/1.0&#8242;}</p>
</blockquote>
<p>Really the problem was I has put a leading slash in my app.yaml where one should not be</p>
<pre>
- url: /home
  script: /home/index.py
</pre>
<p>Really this should be</p>
<pre>
- url: /home
  script: home/index.py
</pre>
<p>So there was no leading slash on script: EVER.</p>
Posted in misc Tagged: google appengine, python <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1343&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/09/09/ooh-thats-a-colorful-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
	</channel>
</rss>