<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://jrfom.com/wp-atom.php">
	<title type="text">Room Full of Mirrors</title>
	<subtitle type="text">... and all I could see was me</subtitle>

	<updated>2010-06-28T20:55:40Z</updated>

	<link rel="alternate" type="text/html" href="http://jrfom.com" />
	<id>http://jrfom.com/feed/</id>
	

	<generator uri="http://wordpress.org/" version="3.0">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/jrfom/cCSs" /><feedburner:info uri="jrfom/ccss" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>James Sumners</name>
					</author>
		<title type="html"><![CDATA[Announcing PWPTemplate]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/jrfom/cCSs/~3/lnu6aatSGhU/" />
		<id>http://jrfom.com/?p=189</id>
		<updated>2010-06-28T20:53:40Z</updated>
		<published>2010-06-28T20:53:40Z</published>
		<category scheme="http://jrfom.com" term="Code" /><category scheme="http://jrfom.com" term="PHP" /><category scheme="http://jrfom.com" term="Technology" />		<summary type="html"><![CDATA[As you may, or may not, be aware, just before I started my position at CSU I started a web design and development company with a friend &#8212; Platypus Web Productions. Being the lead, and only, developer I  set to work on creating a basis for the majority of work I would be doing for [...]]]></summary>
		<content type="html" xml:base="http://jrfom.com/2010/06/28/announcing-pwptemplate/">&lt;p&gt;As you may, or may not, be aware, just before I started my position at &lt;a href="http://www.clayton.edu/"&gt;CSU&lt;/a&gt; I started a web design and development company with a friend &amp;#8212; &lt;a href="http://platypuswp.com/"&gt;Platypus Web Productions&lt;/a&gt;. Being the lead, and only, developer I  set to work on creating a basis for the majority of work I would be doing for the company. To that end, I created a simple templating class for &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt;. I had recently read an &lt;a href="http://www.massassi.com/php/articles/template_engines/"&gt;article&lt;/a&gt; discussing template engines and how they made templating overly complex. I based my class on the code in that article, changing it where necessary to fit my style and goals. I named the my template class PWPTemplate.&lt;/p&gt;
&lt;p&gt;In the past year I have found myself wanting to use PWPTemplate in various projects outside of my Platypus Web Productions work. I felt like I couldn&amp;#8217;t really do so because I wrote it for the company, but after discussing it with my partner I have decided to open source the code. So, today, I am presenting to you &lt;a href="http://bitbucket.org/jsumners/pwptemplate"&gt;PWPTemplate&lt;/a&gt; for general use. It is licensed under the &lt;a href="http://www.opensource.org/licenses/mit-license.php"&gt;MIT License&lt;/a&gt; so that you are free to use it in any way you see fit. The class is decently documented with &lt;a href="http://www.phpdoc.org/"&gt;PHP Doc&lt;/a&gt; comments and generally not hard to figure out. I have included two example usage scenarios: an uncached and a cached template.&lt;/p&gt;
&lt;p&gt;Be aware, this is not &lt;a href="http://www.smarty.net/"&gt;Smarty&lt;/a&gt;. PWPTemplate does not do much for you other than make it easy to separate business logic from presentation logic. It also does not slap your hand when you fail in that endeavor.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/jrfom/cCSs/~4/lnu6aatSGhU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://jrfom.com/2010/06/28/announcing-pwptemplate/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://jrfom.com/2010/06/28/announcing-pwptemplate/feed/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://jrfom.com/2010/06/28/announcing-pwptemplate/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James Sumners</name>
					</author>
		<title type="html"><![CDATA[Objective-C Dot Notation]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/jrfom/cCSs/~3/PHXrI5JsDBI/" />
		<id>http://jrfom.com/?p=183</id>
		<updated>2010-06-16T19:20:58Z</updated>
		<published>2010-06-16T19:13:35Z</published>
		<category scheme="http://jrfom.com" term="Code" /><category scheme="http://jrfom.com" term="Objective-C" /><category scheme="http://jrfom.com" term="Technology" />		<summary type="html"><![CDATA[A few weeks ago O&#8217;Reilly was having an eBook sale where you could buy any of their eBooks for $10. Seeing as I had just ordered an iPad, I decided to buy their Learning iPhone Programming book. The little bit I know about developing for the iPhone has come from reading (most of) Cocoa Programming [...]]]></summary>
		<content type="html" xml:base="http://jrfom.com/2010/06/16/objective-c-dot-notation/">&lt;p&gt;A few weeks ago &lt;a href="http://oreilly.com/"&gt;O&amp;#8217;Reilly&lt;/a&gt; was having an eBook sale where you could buy any of their eBooks for $10. Seeing as I had just ordered an iPad, I decided to buy their &lt;a href="http://oreilly.com/catalog/9780596806446/"&gt;Learning iPhone Programming&lt;/a&gt; book. The little bit I know about developing for the iPhone has come from reading (most of) &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321503619"&gt;Cocoa Programming for OS X&lt;/a&gt; and applying that knowledge with searching through the API documentation. So I figured it wouldn&amp;#8217;t hurt to read a book specifically dealing with iPhone programming. I&amp;#8217;m four and a half chapters into the book, and, thus far, it is pretty good. I am learning some stuff I did not know about before. But there is something about the book that bothers me.&lt;/p&gt;
&lt;p&gt;The author of &lt;em&gt;Learning iPhone Programming&lt;/em&gt; uses a feature Apple introduced into their &lt;a href="http://en.wikipedia.org/wiki/Objective-C#Objective-C_2.0"&gt;Objective-C 2.0&lt;/a&gt; &amp;#8212; dot notation. I really wish Apple hadn&amp;#8217;t created this feature because it is just plain confusing. Joe Conway &lt;a href="http://weblog.bignerdranch.com/?p=83"&gt;describes problems&lt;/a&gt; with the notation that I had not thought of, but I think it is confusing for a reason he didn&amp;#8217;t explicitly mention. Dot notation in Objective-C obscures objects. For example, chapter 5 covers building a table view application. There is a point in the code where a table cell&amp;#8217;s text label is set to a new string. The author uses this code:&lt;/p&gt;
&lt;pre class="brush:c++"&gt;cell.textLabel.text = @"Testing";&lt;/pre&gt;
&lt;p&gt;The pre-Objective-C 2.0 way of writing this is:&lt;/p&gt;
&lt;pre class="brush:c++"&gt;[ [cell textLabel] setText: @"Testing"];&lt;/pre&gt;
&lt;p&gt;Can you see the subtle difference? The &lt;a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html"&gt;UITableViewCell&lt;/a&gt; is composed of several objects, one of which is a &lt;a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UILabel_Class/Reference/UILabel.html#//apple_ref/doc/c_ref/UILabel"&gt;UILabel&lt;/a&gt;. In order to change the text displayed in the table cell you have to change the text on the contained UILabel. So, you ask the &lt;strong&gt;cell&lt;/strong&gt; object to give you a reference to it&amp;#8217;s &lt;strong&gt;textLabel&lt;/strong&gt; object and then set the &lt;em&gt;text&lt;/em&gt; property of that object. The dot notation doesn&amp;#8217;t really make that clear. Instead, it looks like you are accessing properties of a &lt;a href="http://en.wikipedia.org/wiki/Struct_(C_programming_language)"&gt;struct&lt;/a&gt;. With the bracket notation I think it is much clearer that multiple objects are being referenced, and which methods of those objects are being used.&lt;/p&gt;
&lt;p&gt;For  final example, let&amp;#8217;s look at some code that I found in a &lt;a href="http://stackoverflow.com/questions/3053139/app-shuts-down-when-pushing-uibutton"&gt;StackOverflow question&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="brush:c++"&gt;LoginViewController *myLoginViewController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil];
[[UIApplication sharedApplication].keyWindow addSubView:myLoginViewController.view];
[[UIApplication sharedApplication].keyWindow makeKeyAndVisible];&lt;/pre&gt;
&lt;p&gt;This guy is using both syntaxes at the same time! Written without dot notation, that code is:&lt;/p&gt;
&lt;pre class="brush:c++"&gt;LoginViewControler *myLoginViewController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle: nil];
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
[keyWindow addSubView: [myLoginViewController view]];
[keyWindow makeKeyAndVisible];&lt;/pre&gt;
&lt;p&gt;One extra line and the code is much clearer. We can easily see that we are adding a new view, from the &lt;strong&gt;myLoginViewController&lt;/strong&gt; object, to a UIWindow object, &lt;strong&gt;keyWindow&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can decide for yourself which notation you like better, but I think you&amp;#8217;ll be better served with the traditional bracket notation. Especially if you want to contribute to any open source projects (e.g. &lt;a href="http://adium.im/"&gt;Adium&lt;/a&gt;). Chances are pretty good that most people will be using bracket notation. And they&amp;#8217;re not going to like it if you start submitting patches with dot notation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Right after posting this article I came across a new &lt;a href="http://stackoverflow.com/questions/3056423/iphone-why-does-dot-notation-work-and-not-brackets"&gt;StackOverflow question&lt;/a&gt; that further illuminates the problem with dot notation. Getter and setter methods have completely different names with dot notation (which can be seen in my first example).&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/jrfom/cCSs/~4/PHXrI5JsDBI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://jrfom.com/2010/06/16/objective-c-dot-notation/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://jrfom.com/2010/06/16/objective-c-dot-notation/feed/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://jrfom.com/2010/06/16/objective-c-dot-notation/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James Sumners</name>
					</author>
		<title type="html"><![CDATA[Posting To Notifo With Python]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/jrfom/cCSs/~3/Mw2LUiWy1lc/" />
		<id>http://jrfom.com/?p=177</id>
		<updated>2010-06-28T20:55:40Z</updated>
		<published>2010-06-09T01:58:06Z</published>
		<category scheme="http://jrfom.com" term="Code" /><category scheme="http://jrfom.com" term="Python" /><category scheme="http://jrfom.com" term="Software" /><category scheme="http://jrfom.com" term="Technology" />		<summary type="html"><![CDATA[Just after getting to work this morning I discovered an iPhone app and web service named Prowl. It provides a means for sending arbitrary push notifications to your iPhone. This is something I had on my todo list to design and write very soon, so I was very excited to find it. The only downside, [...]]]></summary>
		<content type="html" xml:base="http://jrfom.com/2010/06/08/posting-to-notifo-with-python/">&lt;p&gt;Just after getting to work this morning I discovered an iPhone app and web service named &lt;a href="http://prowl.weks.net/"&gt;Prowl&lt;/a&gt;. It provides a means for sending arbitrary push notifications to your iPhone. This is something I had on my todo list to design and write very soon, so I was very excited to find it. The only downside, and I was totally willing to overlook it, is that the app is not free. The web service is free, but you have to purchase the phone app for it to be any use. However, after doing a little more research I found &lt;a href="http://www.notifo.com/"&gt;Notifo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Notifo is the exact same thing as Prowl, except Notifo is completely free. It looks like Notifo hopes to make money by selling easy push notifications to companies (sort of like the SMS deals you can get some &lt;a href="http://www.boomtext.com/"&gt;places&lt;/a&gt;). Notifo promises to keep the service totally free for users, and users have the ability to send themselves notifications. This is perfect for my purposes.&lt;/p&gt;
&lt;p&gt;I had been wanting to write something like Prowl, Notifo, etcetera so that I could send myself notifications when servers I maintain are having difficulties. Typically, these servers maintain an internet connection but the service they provide just stops working. The stop-gap solution was to have the servers email me when they are misbehaving. There are two problems with that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I had to put my work email on my personal phone.&lt;/li&gt;
&lt;li&gt;I couldn&amp;#8217;t differentiate between important notifications and the junk email that streams into my work inbox.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By removing the notifications from my email, I can get a different notification sound and immediately know I need to fix something. I also get to remove my work email from my phone and save some of my sanity (so much spam).&lt;/p&gt;
&lt;p&gt;So I was quite excited to find Notifo and learn that its &lt;a href="https://api.notifo.com/"&gt;API&lt;/a&gt; is &lt;em&gt;very&lt;/em&gt; simple. The only problem was the lack of an implementation in a portable scripting language. Implementations were available for &lt;a href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET&lt;/a&gt;, &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt;, and &lt;a href="http://www.ruby-lang.org/"&gt;Ruby&lt;/a&gt;. Some will read this and say either &amp;#8220;What? You didn&amp;#8217;t go for PHP?!&amp;#8221; or &amp;#8220;But Ruby is portable!&amp;#8221; In response to the first statement, PHP can be used as an command line scripting language, but you usually have to explicitly install it so I don&amp;#8217;t consider that portable. To the second statement, that might be so, but the Notifo interface is implemented as a &amp;#8220;gem&amp;#8221; and I don&amp;#8217;t consider that portable either. Therefore, I decided to write a &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; interface.&lt;/p&gt;
&lt;p&gt;Python is usually installed, and typically has a robust set of modules installed by default. Indeed, I opted to develop my interface on the most broken OS I have access to &amp;#8212; Red Hat Enterprise Linux 4. It has Python 2.3.4 installed, and it certainly doesn&amp;#8217;t contain any extras. I was able to write my Python interface using nothing but the installed base modules.&lt;/p&gt;
&lt;p&gt;While writing my interface I discovered one other &lt;a href="http://www.nerdkits.com/files/notifo/"&gt;Python script&lt;/a&gt; that communicates with Notifo. I could have stopped writing mine, but that script requires extra modules (for parsing the &lt;a href="http://json.org/"&gt;JSON&lt;/a&gt; returned by the Notifo service). It also isn&amp;#8217;t generic. So I kept working and can now present to you &lt;a href="http://bitbucket.org/jsumners/pynotifo/"&gt;PyNotifo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;PyNotifo is nothing more than a simple class that communicates with the Notifo web service. It implements both methods of the service. PyNotifo does not parse the response sent back by the Notifo web service. Instead, it simply returns the full JSON string to whatever script is using the class. I suppose a proper implementation would abstract the JSON into class methods or properties, but I think this way works just fine for a first go. Besides, if I went down that route I would have the same problem as the other Python script &amp;#8212; requiring a JSON module to be installed.&lt;/p&gt;
&lt;p&gt;Included with PyNotifo is a simple script that uses the class. This script, named &lt;code&gt;sendNotifoNotification.py&lt;/code&gt;, makes it really easy to send Notifo notifications from any other shell script (e.g. a &lt;a href="http://tldp.org/LDP/abs/html/"&gt;Bash script&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve put both of these, the class and the script, up on &lt;a href="http://bitbucket.org/"&gt;BitBucket&lt;/a&gt; with essentially a public domain license. Feel free to use them as you please. Don&amp;#8217;t hesitate to send me any patches you might develop.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/jrfom/cCSs/~4/Mw2LUiWy1lc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://jrfom.com/2010/06/08/posting-to-notifo-with-python/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://jrfom.com/2010/06/08/posting-to-notifo-with-python/feed/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://jrfom.com/2010/06/08/posting-to-notifo-with-python/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James Sumners</name>
					</author>
		<title type="html"><![CDATA[Day 3 iPad Review]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/jrfom/cCSs/~3/HBKZ3pzVbmU/" />
		<id>http://jrfom.com/?p=171</id>
		<updated>2010-06-14T12:50:13Z</updated>
		<published>2010-06-07T00:35:07Z</published>
		<category scheme="http://jrfom.com" term="Review" /><category scheme="http://jrfom.com" term="Technology" /><category scheme="http://jrfom.com" term="iPad" />		<summary type="html"><![CDATA[As the title indicates, I&#8217;ve had an iPad for three days now. I had intended to wait for the next iteration (likely in a year), but a friend sent me a message a couple weeks ago suggesting that we should make an iPad game. I decided that sounded like an excellent idea and proceeded to [...]]]></summary>
		<content type="html" xml:base="http://jrfom.com/2010/06/06/day-3-ipad-review/">&lt;p&gt;As the title indicates, I&amp;#8217;ve had an iPad for three days now. I had intended to wait for the next iteration (likely in a year), but &lt;a href="http://www.monster-clip.com/"&gt;a friend&lt;/a&gt; sent me a message a couple weeks ago suggesting that we should make an iPad game. I decided that sounded like an excellent idea and proceeded to order an iPad. Well, it took a couple weeks to come in and I&amp;#8217;ve been using it almost non-stop since it arrived. So let&amp;#8217;s get into this shall we?&lt;/p&gt;
&lt;p&gt;First, I have to say that when I first heard about the device I was not very excited. It has a horrible name and is basically an oversized iPhone without the phone part. Later, it was revealed that both &lt;a href="http://amazon.com/"&gt;Amazon&lt;/a&gt; and &lt;a href="http://bn.com/"&gt;Barnes and Noble&lt;/a&gt; would be releasing apps for the iPad that support their eBook formats. In addition to Apple&amp;#8217;s &lt;a href="http://www.apple.com/ipad/features/ibooks.html"&gt;iBooks&lt;/a&gt;, that means all major (digital) book stores would be, and are, supported on the iPad. I had been looking at the eReaders available, but found them abysmal (very slow). I&amp;#8217;m happy to report that the iPad is an awesome eReader.&lt;/p&gt;
&lt;p&gt;I have four eBook apps on my iPad: iBooks, &lt;a href="http://www.amazon.com/gp/feature.html/ref=amb_link_352814142_3?docId=1000490441"&gt;Amazon Kindle&lt;/a&gt;, &lt;a href="http://www.barnesandnoble.com/u/BN-eReader-for-iPad/379002216/"&gt;BN eReader&lt;/a&gt;, and &lt;a href="http://www.lexcycle.com/"&gt;Stanza&lt;/a&gt;. Of the four, I have only used iBooks and Stanza so far. It has been &lt;a href="http://www.zeldman.com/2010/06/06/battle-of-the-e-book-readers-stanza-vs-ibooks/"&gt;suggested&lt;/a&gt; that iBooks is the lesser of the two, but I disagree. When I read a book I like to know how many pages are in each chapter. And as I&amp;#8217;m reading a chapter I like to know how many pages are left. Stanza, does this in an excellent manner on the iPhone, but the direct port to the iPad is disappointing. iBooks makes use of the available screen real estate by adding this information to the bottom margin of the &amp;#8220;page.&amp;#8221; Stanza only displays this information by using a layer on top of the page, interfering with reading. For this reason alone I think iBooks is the better app right now.&lt;/p&gt;
&lt;p&gt;Second, web browsing. I am astonished at how awesome browsing the web is on the iPad. If you have ever used an iPhone you know how good it is at web browsing, and how miserable. The iPhone is worlds better than any phone before it at browsing the web, but, at least on the 3G model, it is painfully slow on the majority of pages. When you manage to come across a site that targets the iPhone things get a &lt;em&gt;lot&lt;/em&gt; better, but those are rare. On the iPad there is no (explicit) need for a mobile version of sites. The iPad has a resolution of 1024&amp;#215;768 (or 768&amp;#215;1024), and its version of Safari does all of the same stuff to make pages &amp;#8220;fit&amp;#8221; as the iPhone version. The difference is that the iPad version has to do less since most sites are already designed for 1024&amp;#215;768. Touching links is very natural, some how, and so is zooming in and out on desired content. The only thing Safari for the iPad is missing is back and forward gestures. Reading books gets you used to doing swipes for back and forward, and when you start browsing the web that gets broken.&lt;/p&gt;
&lt;p&gt;Third, games. I really had no intention of playing games on my iPad, other than the one I intend to write, but I&amp;#8217;ve played a couple of them and I am impressed. The large screen and fast processor make games very enjoyable. I haven&amp;#8217;t yet found one that I think I will play non-stop, but I am quite pleased by the potential.&lt;/p&gt;
&lt;p&gt;Fourth, videos. This thing takes watching &lt;a href="http://youtube.com/"&gt;YouTube&lt;/a&gt; videos to a whole new level. Instead of trying to squint at a phone, or sit at a computer, you get to watch videos in whatever position is most comfortable without sacrificing any quality. If I had a connection that could actually stream 720p content, it would be really enjoyable.&lt;/p&gt;
&lt;p&gt;Finally, I have to mention something that has me really excited. While browsing the app store I came across an app from Korg &amp;#8212; &lt;a href="http://www.korg.com/ielectribe"&gt;iElectribe&lt;/a&gt;. It was on sale (and still is until the end of the month) and I just couldn&amp;#8217;t resist. This app really shows what the iPad is capable of, in my opinion. The large, responsive, touch interface is &lt;em&gt;perfect&lt;/em&gt; for this type of application. I can envision, when multi-tasking is made available, a full production studio totally contained on the iPad. I am quite sure someone will develop a standard for syncing timings between multiple apps. Then, it would easily be possible to have something like iElectribe talking to an external mixer app which is also connected to a synth app and a who knows what else. Behold! some of the racket iElectribe (in my hands) can produce: &lt;a href="http://jrfom.com/wp-content/uploads/2010/06/Crazy_House_BPM135.mp3"&gt;Crazy House BPM135&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In short, I think the iPad is an awesome device. If you mostly just browse the web and read emails, this is the device for you. If you want to play around with some audio equipment emulators this thing will really make you smile. And it makes reading digital books finally bearable.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/jrfom/cCSs/~4/HBKZ3pzVbmU" height="1" width="1"/&gt;</content>
<link href="http://jrfom.com/wp-content/uploads/2010/06/Crazy_House_BPM135.mp3" rel="enclosure" length="93153" type="audio/mpeg" />
		<link rel="replies" type="text/html" href="http://jrfom.com/2010/06/06/day-3-ipad-review/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://jrfom.com/2010/06/06/day-3-ipad-review/feed/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://jrfom.com/2010/06/06/day-3-ipad-review/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>James Sumners</name>
					</author>
		<title type="html"><![CDATA[4KB Sectors]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/jrfom/cCSs/~3/gztuE5DChHY/" />
		<id>http://jrfom.com/?p=169</id>
		<updated>2010-05-03T18:55:37Z</updated>
		<published>2010-05-03T18:55:37Z</published>
		<category scheme="http://jrfom.com" term="Linux" /><category scheme="http://jrfom.com" term="Technology" />		<summary type="html"><![CDATA[I just want to give a quick note here about 4KB sectors in newer hard drives. If you follow technology at all, you are probably aware that new hard drives from Western Digital are using their &#8220;advanced format technology.&#8221; All this really means is that each physical sector of the drive is 4096 bytes (4KB) [...]]]></summary>
		<content type="html" xml:base="http://jrfom.com/2010/05/03/4kb-sectors/">&lt;p&gt;I just want to give a quick note here about 4KB sectors in newer hard drives. If you follow technology at all, you are probably aware that new hard drives from Western Digital are using their &amp;#8220;&lt;a href="http://www.wdc.com/wdproducts/library/?id=216&amp;amp;type=87"&gt;advanced format technology&lt;/a&gt;.&amp;#8221; All this really means is that each physical &lt;a href="http://en.wikipedia.org/wiki/Disk_sector"&gt;sector&lt;/a&gt; of the drive is 4096 bytes (4KB) is size instead of 512 bytes. That causes problems for operating systems that assume each sector is 512 bytes (e.g. Windows XP).&lt;/p&gt;
&lt;p&gt;A couple weeks ago I ran out of space on the 1TB drive in my DVR. So I ordered a new 2TB drive to resolve the problem. This 2TB drive is one of Western Digital&amp;#8217;s advanced format drives. To install the new drive I booted with &lt;a href="http://www.sysresccd.org/"&gt;SystemRescueCd&lt;/a&gt; and used &lt;a href="http://gparted.sourceforge.net/"&gt;GParted&lt;/a&gt; to create the partition table (&lt;a href="http://en.wikipedia.org/wiki/GUID_Partition_Table"&gt;GPT&lt;/a&gt; instead of &lt;a href="http://en.wikipedia.org/wiki/Master_Boot_Record"&gt;MBR&lt;/a&gt;) and file system (&lt;a href="http://en.wikipedia.org/wiki/JFS_(file_system)"&gt;JFS&lt;/a&gt;). After rebooting my DVR I started copying about 14GB of data from my Windows computer over to the new drive in my DVR. Both machines are connected to each other through a 1Gb ethernet switch. Typically, this transfer happens at about 40MB/second, but this time it was doing around 9MB/second. Clearly something was wrong.&lt;/p&gt;
&lt;p&gt;To investigate, I installed &lt;a href="http://www.rodsbooks.com/gdisk/"&gt;gdisk&lt;/a&gt; (GPT fdisk) and took a look at my new drive. Issuing the verify command in gdisk showed the following message:&lt;/p&gt;
&lt;pre class="brush:bash"&gt;Caution: Partition 1 doesn't begin on a 8-sector boundary. This may result in degraded performance on some modern (2009 and later) hard disks.&lt;/pre&gt;
&lt;p&gt;Well, that sucks. I specifically created a GPT because I thought it would take care of the sector alignment issue.  Investigating further I found this:&lt;/p&gt;
&lt;pre class="brush:bash"&gt;Command (? for help): p1
Number  Start (sector)    End (sector)  Size       Code  Name
   1              34      3907029134   1.8 TiB     0700  Linux/Windows data&lt;/pre&gt;
&lt;p&gt;There&amp;#8217;s the problem: 34 / 8 = 4.25.&lt;/p&gt;
&lt;p&gt;So I deleted the partition and re-created it with gdisk. Doing so, I was able to specify that I wanted the partition to start on sector 64. I then re-mounted the partition and started my data copy again. This time I was getting my full 40MB/second. That&amp;#8217;s a 78% improvement over what it was doing.&lt;/p&gt;
&lt;p&gt;So, if you get one of these new disks, make sure you use the right tools to partition it. The problem is that the drive could, and does in my case, report that it uses 512 byte logical sectors when in reality it uses 4096 byte sectors. So you have to know to do the alignment manually.&lt;/p&gt;
&lt;p&gt;For more in-depth information about these new drives see the following articles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://lwn.net/Articles/322777/"&gt;lwn.net/Articles/322777/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lwn.net/Articles/377895/"&gt;lwn.net/Articles/377895/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tinyurl.com/3934q8b"&gt;http://tinyurl.com/3934q8b&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, be aware that &lt;a href="http://en.wikipedia.org/wiki/Solid-state_drive"&gt;SSDs&lt;/a&gt; also use sectors that do not align with 512 bytes.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/jrfom/cCSs/~4/gztuE5DChHY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://jrfom.com/2010/05/03/4kb-sectors/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://jrfom.com/2010/05/03/4kb-sectors/feed/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://jrfom.com/2010/05/03/4kb-sectors/</feedburner:origLink></entry>
	</feed>
