<?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>PayTay Peter's Diary</title>
	<atom:link href="http://ptony82.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ptony82.wordpress.com</link>
	<description>My thoughts for all to see</description>
	<lastBuildDate>Fri, 06 Nov 2009 18:03:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ptony82.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0413c2334e89d804b02cc7d193ff92d5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>PayTay Peter's Diary</title>
		<link>http://ptony82.wordpress.com</link>
	</image>
			<item>
		<title>C# Marshalling is no fun</title>
		<link>http://ptony82.wordpress.com/2009/11/06/c-marshalling-is-no-fun/</link>
		<comments>http://ptony82.wordpress.com/2009/11/06/c-marshalling-is-no-fun/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 18:03:03 +0000</pubDate>
		<dc:creator>ptony82</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ptony82.wordpress.com/?p=107</guid>
		<description><![CDATA[I&#8217;ve been spending the past week working on Mac which is very close to FreeBSD, and I have been working on the simple goal of getting a MAC address for a network interface. I was able to find plenty of sample code on the net on how to do it, but they were all written [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=107&subd=ptony82&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been spending the past week working on Mac which is very close to FreeBSD, and I have been working on the simple goal of getting a MAC address for a network interface. I was able to find plenty of sample code on the net on how to do it, but they were all written in C. My gaol then became to do the same thing in C# using P/Invoke and Marshalling. I&#8217;ve been working on this for three days and I have learned two things. One, P/Invoke and Marshalling is extremely hard and confusing because you lose code reuse, meaning that every structure has to be redefined, along with macros and function signatures. System level code uses tons of nested structures, and defined variables and so on. So implementating just one P/Invoke function which takes a structure can get messy really quickly. I guess back then developers assumed everyone would be using header files which would automatically resolve all of these special structures macros and so on.</p>
<p>The second thing that I learned is that trying to work with pointers in C# is (dangerous) and extremely annoying. C allows developers to do many hackish things with pointers in order to cast, or just to different places in memory and so on. C# has various limitations on how to use pointers; so there is no direct mapping from C pointer handling to C# pointer handling. With that said, once again, converting system level C code to C# requires good understanding and experience with C pointers, and C# marshalling in order to get things done. Overall, I&#8217;m learning a lot, and spending a lot of time learning about different marshalling options but I did not expect it to be this hard. Also, marshalling tends to get confusing because they are so many different ways to represent data, you have IntPtr, char arrays, byte arrays, keywords such as in, out, ref, and functions such as Marshal.PtrToStructure, Marshal.Copy, Marshal.ReadByte, and so much stuff.</p>
<p>In the end, my advice is, do not underestimate marshalling (or anything else in programming), and pointers are extremely annoying to deal with. So try to avoid marshalling and pointers as much as possible</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ptony82.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ptony82.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ptony82.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ptony82.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ptony82.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ptony82.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ptony82.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ptony82.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ptony82.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ptony82.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=107&subd=ptony82&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ptony82.wordpress.com/2009/11/06/c-marshalling-is-no-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/916abb4acaef9373989acd6c2b64cc82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Pierre St Juste</media:title>
		</media:content>
	</item>
		<item>
		<title>Mac is not so bad</title>
		<link>http://ptony82.wordpress.com/2009/11/03/mac-is-not-so-bad/</link>
		<comments>http://ptony82.wordpress.com/2009/11/03/mac-is-not-so-bad/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:48:45 +0000</pubDate>
		<dc:creator>ptony82</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ptony82.wordpress.com/?p=105</guid>
		<description><![CDATA[So today I spent the whole day programming on a Mac-Mini (by Apple) and it turns out that it was not so bad. It was mainly because it was not such a big change from Linux to a Mac. Mac OS X is BSD/Mach based and it comes with many common free (open-source) software tools [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=105&subd=ptony82&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So today I spent the whole day programming on a Mac-Mini (by Apple) and it turns out that it was not so bad. It was mainly because it was not such a big change from Linux to a Mac. Mac OS X is BSD/Mach based and it comes with many common free (open-source) software tools by default. Here is a short list: bash, grep, curl, vim, x11, and so on. Basically all of my favorite shell tools were readily available. I also found out that the Mac kernel (Darwin) is open-source (well under Apple&#8217;s open source license). I also got a chance to browse through some header files and most of the kernel seems to be a close match with the FreeBSD kernel which Apple proudly advertises on their developer website. All in all, Mac showed me what Linux can become and also what FreeBSD can also become. Mac OS X is a combination of many open-source/closed source software and you definitely get the Unix feel when you use it. Now I see why Macs are more stable than windows, because it is built on top of well-tested BSD software. I still love Linux, but I have found a new appreciation for Macs (and BSD systems as well).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ptony82.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ptony82.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ptony82.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ptony82.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ptony82.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ptony82.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ptony82.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ptony82.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ptony82.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ptony82.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=105&subd=ptony82&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ptony82.wordpress.com/2009/11/03/mac-is-not-so-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/916abb4acaef9373989acd6c2b64cc82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Pierre St Juste</media:title>
		</media:content>
	</item>
		<item>
		<title>The perils of using Managed Languages for young programmers</title>
		<link>http://ptony82.wordpress.com/2009/10/25/the-perils-of-using-managed-languages-for-young-programmers/</link>
		<comments>http://ptony82.wordpress.com/2009/10/25/the-perils-of-using-managed-languages-for-young-programmers/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:28:10 +0000</pubDate>
		<dc:creator>ptony82</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://ptony82.wordpress.com/?p=102</guid>
		<description><![CDATA[Although I&#8217;m not really a young programmer per say (since I&#8217;ve been programming since 2002), I still feel young due to my inexperience with programming. The majority of my programming has been with managed languages such as Java and C#. Now I love using managed languages because they make programming so much easier since you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=102&subd=ptony82&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Although I&#8217;m not really a young programmer per say (since I&#8217;ve been programming since 2002), I still feel young due to my inexperience with programming. The majority of my programming has been with managed languages such as Java and C#. Now I love using managed languages because they make programming so much easier since you don&#8217;t have to deal with memory; that&#8217;s the whole point of managed languages is to manage memory. I have always been curious about unmanaged languages such as C/C++, but I never got the opportunity to work with them until now. I&#8217;m currently looking into using a network modeler written in C++ and I am starting to understand how complicated memory management could be. The main thing that I learned is that local objects to a function are allocated on the stack instead of the heap. Since both Java and C# uses the &#8220;new&#8221; keyword for declaring objects, I was always under the impression that the heap was always used for all objects, and only generic types such as int, char, and so on were stored on the stack. It turns out that in C++, objects can also be declared on the stack and that using the stack is much faster than the heap. C++ provides two ways of declaring an object, with the new keyword that requires using the &#8220;delete&#8221; keyword to reclaim the memory, or without it and it gets auto-managed. Nobody ever told me there was auto-management in C++. I also learned about auto_ptr and so on. Anyways, my point is that just using managed languages is great and I would use them for my application development projects, but being oblivious to C/C++ can be a great disservice. It&#8217;s sad that noone emphasizes learning C/C++ and everyone is depending on Java/C# to do the dirty work.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ptony82.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ptony82.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ptony82.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ptony82.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ptony82.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ptony82.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ptony82.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ptony82.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ptony82.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ptony82.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=102&subd=ptony82&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ptony82.wordpress.com/2009/10/25/the-perils-of-using-managed-languages-for-young-programmers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/916abb4acaef9373989acd6c2b64cc82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Pierre St Juste</media:title>
		</media:content>
	</item>
		<item>
		<title>Debian vs Ubuntu vs Fedora</title>
		<link>http://ptony82.wordpress.com/2009/10/21/debian-vs-ubuntu-vs-fedora/</link>
		<comments>http://ptony82.wordpress.com/2009/10/21/debian-vs-ubuntu-vs-fedora/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:10:16 +0000</pubDate>
		<dc:creator>ptony82</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian ubuntu fedora comparison linux]]></category>

		<guid isPermaLink="false">http://ptony82.wordpress.com/2009/10/21/debian-vs-ubuntu-vs-fedora/</guid>
		<description><![CDATA[Debian = stable, just works, no commercial support, takes years for releases (I use that for my work machine because I don&#8217;t want to update every 6 months)
Ubuntu = Less stable than debian, 6 months of testing vs 2-3 years for debian, commercial support (I use that on my laptop because I don&#8217;t use it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=100&subd=ptony82&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Debian = stable, just works, no commercial support, takes years for releases (I use that for my work machine because I don&#8217;t want to update every 6 months)</p>
<p>Ubuntu = Less stable than debian, 6 months of testing vs 2-3 years for debian, commercial support (I use that on my laptop because I don&#8217;t use it often and I need new drivers)</p>
<p>Fedora = bleeding-edge, newest stuff, not for production, no commercial support ( I use that on my dual-boot home pc, since I don&#8217;t really care)</p>
<p>Each have their own purposes, Debian for serious work, Ubuntu for more update yet stable stuff, Fedora for living on the edge. Hope this helps.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ptony82.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ptony82.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ptony82.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ptony82.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ptony82.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ptony82.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ptony82.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ptony82.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ptony82.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ptony82.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=100&subd=ptony82&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ptony82.wordpress.com/2009/10/21/debian-vs-ubuntu-vs-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/916abb4acaef9373989acd6c2b64cc82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Pierre St Juste</media:title>
		</media:content>
	</item>
		<item>
		<title>My thoughts on P2P/NATs/IPv6</title>
		<link>http://ptony82.wordpress.com/2009/10/09/my-thoughts-on-p2pnatsipv6/</link>
		<comments>http://ptony82.wordpress.com/2009/10/09/my-thoughts-on-p2pnatsipv6/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 19:16:50 +0000</pubDate>
		<dc:creator>ptony82</dc:creator>
				<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://ptony82.wordpress.com/?p=96</guid>
		<description><![CDATA[I&#8217;ve been thinking a bit lately about how designing P2P would be so much nicer if IPv6 was widely deployed. The main thing that would cure would be the NAT problem. As we all know, NATs (network address translators, or as most people call them these days, wireless routers) are everywhere now because the average [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=96&subd=ptony82&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been thinking a bit lately about how designing P2P would be so much nicer if IPv6 was widely deployed. The main thing that would cure would be the NAT problem. As we all know, NATs (network address translators, or as most people call them these days, wireless routers) are everywhere now because the average household hold has more than one PC and usually a wireless laptop. As a result, the Internet has become a hierarchy where big companies such as Facebook, Google, Amazon provide services because they can afford public IPs; while everyone else is forced to communicate through these companies servers which sucks because they control and monitor what you do. Although the web is becoming more social (or as i like to call it, power to the people), the people really do not have any power because they are monitored, your blog can be taken down, and your pictures can be used without your consent. P2P is the solution to all of that, it is trying to make things the way that they should be by giving the power back to the people (I&#8217;ve been watching a lot of politics lately). ISPs hate P2P because it creates more traffic than they are willing to sustain or ask people to pay for. One of the biggest hindrance in P2P is NATs and ISPs adopting IPv6 would somewhat eradicate NATs and bring in a whole new wave of P2P possibilities. Ok, this post is getting too long, so here is the point. IPv6 is good for P2P, ISPs hate P2P and therefore hate IPv6. It&#8217;s going to be exciting to see what happens over the next 10 years. I love P2P because it gives the control back to the user and users can come together to create a free service that we can all benefit from so see you on the other side.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ptony82.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ptony82.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ptony82.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ptony82.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ptony82.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ptony82.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ptony82.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ptony82.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ptony82.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ptony82.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ptony82.wordpress.com&blog=901007&post=96&subd=ptony82&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ptony82.wordpress.com/2009/10/09/my-thoughts-on-p2pnatsipv6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/916abb4acaef9373989acd6c2b64cc82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Pierre St Juste</media:title>
		</media:content>
	</item>
	</channel>
</rss>