<?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>Mirkules.com</title>
	<atom:link href="http://mirkules.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://mirkules.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 10 May 2010 23:44:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Constants in Objective-C</title>
		<link>http://mirkules.com/blog/?p=197</link>
		<comments>http://mirkules.com/blog/?p=197#comments</comments>
		<pubDate>Sat, 08 May 2010 20:36:32 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Apple/OS X]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[Constants]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=197</guid>
		<description><![CDATA[If you&#8217;re a Java programmer developing on the iPhone platform, you&#8217;ve probably wondered about how to set constants in your programs. Undoubtedly, you have have come across the #define preprocessor macro, and maybe a few other methods, but I&#8217;m going to show you my approach to this problem using the singleton design pattern.
 Java programmers, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a Java programmer developing on the iPhone platform, you&#8217;ve probably wondered about how to set constants in your programs. Undoubtedly, you have have come across the #define preprocessor macro, and maybe a few other methods, but I&#8217;m going to show you my approach to this problem using the singleton design pattern.<span id="more-197"></span></p>
<p> Java programmers, like all mere mortals, are used to defining their constants as static constant variable accessing it throughout the application, like so:</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Constants <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> RED <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> BLUE <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>Constants.<span style="color: #006633;">RED</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</p>
<p>Objective-C doesn&#8217;t have an equivalent.  There is the #define preprocessor macro, but those need to be defined in each file (and cannot be imported), so are very impractical. For integer constants, you can use typedef enums in your header file, as described by the first commented in <a href="http://iphonedevelopertips.com/objective-c/java-developers-guide-to-static-variables-in-objective-c.html">this thread</a>. But if you need NSString constants, we need a different method.</p>
<h2>Singleton Pattern</h2>
<p>A <a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singleton Design Pattern</a> is a way to define a class so that it can only have one instance, and no more.  Why is this useful? Because we can define our variables in a singleton class and just import the file.  I created my own Constants class much like Wikipedia&#8217;s <a href="http://en.wikipedia.org/wiki/Singleton_pattern#Objective_C">Singleton class</a> &#8211; in retrospect, I should have done it this way, and will do it in the future.</p>
<p>Once you have your singleton class, you define your variables in the overridden init method, synthesize the get methods, set the @property to (readonly) to only generate the get accessor.  Here is my example:</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//===== Constants.h ================</span>
<span style="color: #a61390;">@interface</span> Constants <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span>
<span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// Place any &quot;global&quot; variables here</span>
    <span style="color: #a61390;">int</span> RED;
    <span style="color: #a61390;">int</span> BLUE;
<span style="color: #002200;">&#125;</span>
<span style="color: #11740a; font-style: italic;">// message from which our instance is obtained</span>
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>Constants <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>sharedInstance;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setConstants;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>readonly, nonatomic<span style="color: #002200;">&#41;</span> <span style="color: #a61390;">int</span> RED;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>readonly, nonatomic<span style="color: #002200;">&#41;</span> <span style="color: #a61390;">int</span> BLUE;
<span style="color: #a61390;">@end</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">//===== Constants.m ================</span>
<span style="color: #a61390;">@implementation</span> Constants
&nbsp;
<span style="color: #a61390;">@synthesize</span> RED, BLUE;
&nbsp;
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>Constants <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>sharedInstance
<span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// the instance of this class is stored here</span>
    <span style="color: #a61390;">static</span> Constants <span style="color: #002200;">*</span>myInstance <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// check to see if an instance already exists</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">nil</span> <span style="color: #002200;">==</span> myInstance<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        myInstance  <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self class<span style="color: #002200;">&#93;</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>myInstance setConstants<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #11740a; font-style: italic;">// return the instance of this class</span>
    <span style="color: #a61390;">return</span> myInstance;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">/*Set constants here, instead of +sharedInstance method
because non-static variables are not accessible from static
methods.  You can also overload the init constructor
(I prefer it this way because it's more readable)*/</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setConstants <span style="color: #002200;">&#123;</span>
    RED <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
    BLUE <span style="color: #002200;">=</span> <span style="color: #2400d9;">1</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

</p>
<p>The +sharedInstance method is a static method that checks to see if the Constants class has been instantiated.  If it hasn&#8217;t, it makes an instance, and sets all the variables to what you want them to be, and returns the singleton instance.  If it IS instantiated, then it just returns the previously instantiated instance.</p>
<p>Also, the readonly property only takes effect if you try to access it via a setter method.  However, you&#8217;ll notice we can still directly access variables in the setConstants method because these variables are part of the class (effectively, they are private variables now).  In Java terms, this would be like creating private variables and setting them within the object, but not creating the setter methods. </p>
<p>To use the constants, you would simply import Constants.h, and do this:<br />
<code>int red = [Constants sharedInstance].RED</code></p>
<p>I&#8217;m not 100% happy with this method because there are a few nasty things that can happen if you misuse this class, but in general it should be ok.  Some things that can go wrong:</p>
<ul>
<li>Instantiating a Constants class yourself: [[Constants alloc] init].  The variable initialization code would never get called, and then you would wonder why your Constants are not defined somewhere in your code. Don&#8217;t do this! Alternatively, you could set all your variables in the init method, and not really have to worry about this, but why? Just used the sharedInstance method, and you&#8217;re ok.</li>
<li>You could re-set your constant variables (either by accident, or on purpose).  For example, the code if ([Constants sharedInstance].RED = 3) is a common mistake.  This sets RED to 3&#8230; forever.  Make sure that the property is set to readonly.</li>
</ul>
<p>There you have it.  I am definitely interested to see how other people solved this problem, and if this method worked for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=197</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BootCamp Success!</title>
		<link>http://mirkules.com/blog/?p=177</link>
		<comments>http://mirkules.com/blog/?p=177#comments</comments>
		<pubDate>Thu, 31 Dec 2009 22:10:35 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=177</guid>
		<description><![CDATA[I finally got around to installing Windows XP through Boot Camp and will document my experience here.  I am running a 2007 Mac Book Pro 2.4GHz with 4GB of RAM and an NVIDIA GeForce 8600M GT on OS X Leopard.  The point is to have a computer on which my wife can play [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to installing Windows XP through Boot Camp and will document my experience here.  I am running a 2007 Mac Book Pro 2.4GHz with 4GB of RAM and an NVIDIA GeForce 8600M GT on OS X Leopard.  The point is to have a computer on which my wife can play Team Fortress 2 with me. Her idea. Honest. <img src='http://mirkules.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As I indicated in an earlier post, my first hurdle was to get my MacBook&#8217;s hard drive defragmented enough for Boot Camp to be able to partition it.  In theory, the HFS+ filesystem used by Mac OS X does not get fragmented due to how it was designed and how OS X uses the filesystem (read all about it on Apple&#8217;s website: <a href="http://support.apple.com/kb/HT1634">http://support.apple.com/kb/HT1634</a>).</p>
<p>As one of my favorite professors once said: &#8220;The difference between practice and theory is small in theory but large in practice.&#8221;</p>
<p>As it turns out, in order to partition a hard drive, and make a new 32GB partition, you need to have 32GB of free, continuous space.  My understanding is that Boot Camp attempts to clean up smaller files and try to defragment. But if you have ever used larger files on your system such as in a virtual machine or gigantic movie files when you&#8217;re doing movie editing, you are basically left with a partition which Boot Camp refuses/is unable to partition.</p>
<p>I was left with one of two options:</p>
<ol>
<li>Buy iDefrag &#8211; a $30 defrag software</li>
<li>Reformat the hard drive and reinstall OS X</li>
</ol>
<p>I don&#8217;t like to pay for software.  I&#8217;m one of <strong><em>those</em></strong> free software advocates. I <em>especially</em> don&#8217;t like to pay for software to fix something which should not have been broken in the first place, or, which other operating systems (ahem, Windows) include with the operating system.</p>
<p>So, I was left with option 2.  Reformat and reinstall.</p>
<p>The plan was simple:</p>
<ul>
<li>Back up all my data using Time Machine</li>
<li>Double-back up all my data using Carbon Copy Cloner (http://www.bombich.com/), JUST IN CASE, on a different drive</li>
<li>Put in Leopard CD, reinstall</li>
<li>Retrieve data using Time Machine Migration Assistant</li>
<li>Partition the drive using Boot Camp</li>
<li>Install Windows</li>
<li>play Team Fortress 2 with my wife and best friend</li>
</ul>
<p>Let&#8217;s start with backing up.  I needed to do this right because my Master&#8217;s thesis is on that drive, so I wanted to be extra careful and diligent in making two copies of everything.</p>
<p>It&#8217;s important to remember that in order to use Time Machine OR CCC, you NEED to have a HFS+ formatted external drive.  I had only one 750GB HFS+ drive. So redundant backup was out of the question already. Well, I manually backed up all my files smaller than 2GB, which is the filesize limit on a FAT32 filesystem.</p>
<p>So with everything backed up to the HFS+ drive using Time Machine, I held my breath and did a Carbon Copy Clone onto the same drive (stupid I know, but phew, no problems!).  All my other files were safely and redundantly manually copied to my FAT32 drives.</p>
<p>Next came the reinstall.  But wait, I lost my Leopard CD! Luckily, I made a copy using Disk Utility from which I made a dmg file and another copy.  This worked well. I reinstalled Leopard OS X and got to the &#8220;Would you like to migrate your data?&#8221; screen.  I selected &#8220;Restore from a Time Machine backup,&#8221; selected my USB drive, and let it copy files while I did some things around the house.</p>
<p>4 hours later, the progress bar is still at 0%, and the drive is flickering. This is not good.  I had no choice but to turn off the system manually (there was no cancel button on the only window on the screen), restart, and hope my data is ok.  Luckily, it was.</p>
<p>I decided to use a different approach and fired up Migration Assistant from the Utilities folder once Leopard was installed, selecting the same option (restore from TM).  This time, the progress bar moved, the hard drive churned, but received an error message at the end that there was a problem with my main user account (where all the data was located).  Turns out that the restore only partially restored &#8212; none of my preferences or applications were restored.  I manually dragged over applications like Firefox from the Applications directory on the drive, which seems to work (except for Adobe Photoshop and VMWare Fusion).</p>
<p>Demoralized, but not defeated, I cut my losses and partitioned the drive. It worked this time! The Windows XP installer presented me with the familiar blue installation screen.  After going through all the license agreements and such, I had to choose how to handle the new partition.  My choices were:</p>
<ul>
<li>Format the partition using FAT32</li>
<li>Format the partition using NTFS</li>
<li>Quick Format the partition using FAT32</li>
<li>Quick Format the partition using NTFS</li>
<li><strong>Convert the partition to NTFS</strong> (I chose this)</li>
<li>Leave the partition as is</li>
</ul>
<p>That was the wrong choice. The machine rebooted, and showed a message like &#8220;Invalid startup disk.&#8221;</p>
<p>Apparently, the right choice was Format using FAT32 (or NTFS).  So, back to OS X, use Boot Camp to restore and repartition the drive, and select the right option this time in the Windows installer.</p>
<p>Note: if you need to eject the Windows XP CD because you may have something of value written on it (maybe some kind of a serial number?), you need to eject it after Windows installer restarts and BEFORE it actually boots.  Remember, there is no physical eject button on Mac&#8217;s computers, and the keyboard button WILL NOT WORK.</p>
<p>I finally installed Windows XP SP2. Great. But, it didn&#8217;t recognize the ethernet card, the wireless card, video card&#8230; in fact, if there was anything to be recognized, Windows failed at it.</p>
<p>AH! But the drivers! According to Apple&#8217;s instructions, put the Leopard CD in while in Windows, and an installer will automatically start up the driver installation process.</p>
<p>But this wasn&#8217;t working. In fact, when I inserted the Leopard installation CD, there was nothing on it &#8212; it was blank. I finally realized that the original CD is a dual-format CD, HFS+ and iso9660.  Since this is a <em>copy</em> of the Leopard CD, and Disk Utility didn&#8217;t make an <em>exact</em> copy, I had no way of getting the drivers unless I found them online or got the original CD again.</p>
<p>Don&#8217;t even bother looking online, Apple doesn&#8217;t provide them (why?!), and as a rule of thumb I never download executable torrents (unless they are Linux ISOs).</p>
<p>I ended up borrowing a friend&#8217;s Snow Leopard CD, which worked. The video driver, ethernet driver, sound, microphone, isight, everything is fine.</p>
<p>Except wireless.  Wireless wouldn&#8217;t connect to my Airport Extreme router saying that the network is out of reach (even though it&#8217;s sitting RIGHT NEXT TO my machine). I found <a href="http://forums.macrumors.com/showthread.php?t=362972">a forum</a> that basically said that in order to get it working with XP, I have to change my encryption on the router from &#8220;WPA2 Personal&#8221; to &#8220;WPA/WPA2.&#8221;  Lo-and-behold, it worked.</p>
<p>The final hurdle was installing Service Pack 3. Starting the install, I get the following message &#8220;an error occurred while copying file osloader.ntd.&#8221;  This <a href="http://forums.macrumors.com/showthread.php?t=776621">forum</a> helped explain that. To summarize, you have to remove the Mac partition from the Windows partition table, install SP3, and re-add it.</p>
<p>So there you have it. It&#8217;s a painful process which for once, in my opinion, isn&#8217;t Microsoft&#8217;s fault. But it&#8217;s worth it to see spies burned, heavies backstabbed, and pyros ubered.</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=177</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux and OS X miscellaneous stuff</title>
		<link>http://mirkules.com/blog/?p=175</link>
		<comments>http://mirkules.com/blog/?p=175#comments</comments>
		<pubDate>Mon, 20 Jul 2009 05:54:26 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=175</guid>
		<description><![CDATA[To &#8220;burn&#8221; a .iso or .img file to a USB device, type:
sudo dd if=bt4-pre-final.iso of=/dev/disk1 bs=1m
where /dev/disk1 is your particular disk.  In OS X you can find out by going to the Disk Utility and selecting information on your target drive.  In linux, type `dmesg` and that should give you the drive name.
I [...]]]></description>
			<content:encoded><![CDATA[<p>To &#8220;burn&#8221; a .iso or .img file to a USB device, type:</p>
<p>sudo dd if=bt4-pre-final.iso of=/dev/disk1 bs=1m</p>
<p>where /dev/disk1 is your particular disk.  In OS X you can find out by going to the Disk Utility and selecting information on your target drive.  In linux, type `dmesg` and that should give you the drive name.</p>
<p>I will be editing this to add more stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=175</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X Inconsistencies</title>
		<link>http://mirkules.com/blog/?p=147</link>
		<comments>http://mirkules.com/blog/?p=147#comments</comments>
		<pubDate>Sun, 10 May 2009 10:31:01 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Apple/OS X]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=147</guid>
		<description><![CDATA[Many people are surprised to hear me say that I don&#8217;t think OS X has a well-designed GUI.  As one of my professors puts it (I paraphrase):
Criticism is good. Criticism leads to change. Criticism makes things better.
In this post, I will try to do my part in making OS X better.  The following [...]]]></description>
			<content:encoded><![CDATA[<p>Many people are surprised to hear me say that I don&#8217;t think OS X has a well-designed GUI.  As one of my professors puts it (I paraphrase):</p>
<p>Criticism is good. Criticism leads to change. Criticism makes things better.</p>
<p>In this post, I will try to do my part in making OS X better.  The following is a list of GUI inconsistencies that bother me on a regular basis with OS X Leopard.<br />
<span id="more-147"></span></p>
<p><strong>1. Maximize button</strong>. Why does the green maximize button (+) have so many different behaviors?  Window buttons should be unified, have a consistent feel across different applications.  How window buttons behave should not be up to developers.  Instead, developers should adhere to a set of standards and a standardized windowing API.</p>
<p>To demonstrate, I have compiled a few before-and-after <a href="#screens">screenshots</a>.</p>
<p>It is very frustrating when the user is unsure of how a standard window button is going to behave.</p>
<p>To put this into perspective, imagine getting into a car and being unsure of whether the button for rolling down the windows is actually going to roll down the windows, turn on the windshield wipers, or maybe even turn on the headlights.  You simply expect a button that is in every car (especially a line from one manufacturer) to behave in exactly the same way (I know car analogies are very fickle especially because different manufacturers use different way of  turning on the headlights for example &#8212; and I don&#8217;t agree with this either, ahem, VW &#8212; but every time I do get into a VW, the headlight switch always turns on the headlights!).</p>
<p>Anyway, I don&#8217;t care exactly WHAT behavior they assign to the little green button, but it needs to be consistent across the entire UI. Period.</p>
<p><strong>2.  Key Bindings.</strong> Along the lines of consistency, OS X should have a set of standard key bindings for moving to the end of a line, beginning of a line, page up, page down, etc.  Ever tried to move the end of a line in TextWrangler? Word? Terminal? Adium? That&#8217;s right, all four applications have different key bindings: Cmd-RightArrow for TextWrangler, END for Word, and Ctrl-E for Terminal. I have no idea how to do it in Adium.</p>
<p>To this day, I still don&#8217;t know how to jump between words on a line (Ctrl-Arrow on Windows/Linux) because not only does every application use a different combination of modifier keys &#8211; between Command, Control, Alt, Option, Shift and Fn, I don&#8217;t even know where to begin!  It feels like I&#8217;m performing finger gymnastics every time I try to jump between words.</p>
<p>Again, this goes back to a basic design principle: consistency.  Unify and standardize behavior for all applications, and discourage developers from being cute (here&#8217;s looking at you Microsoft).  Also, the Terminal app may be a special case, but again users like having options.</p>
<p>While I&#8217;m talking about Terminal, I would also like to see it unified with *nix terminals, where a mouse selection copies the selection to the buffer and the middle button pastes it.</p>
<p><strong>3. Alt-Tabbing/Minimized Windows.</strong>  This has been a sticking point since I first got OS X.  I work with lots of open applications at the same time, as most developers do.  Try this: minimize all windows of an application, switch to another app, and then try Command-Tabbing back to one of the other windows.  I Cmd-Tab to my app, but it seems like nothing happens. That&#8217;s because the windows are still minimized and you have switched to the <em>application</em>, but not to a particular window.  I am stuck moving my hand to the mouse.</p>
<p>This is not intuitive, and is a direct result of Apple&#8217;s insistence of distinguishing applications from application windows. It&#8217;s bad design, in my opinion.  Maybe Apple can take a page from the world of Linux development and make things configurable, for example allowing users to either have a One-App-One-Window paradigm, or a One-App-Many-Windows paradigm.  But I won&#8217;t hold my breath &#8212; sometimes, it seems configurability goes against the very grain of Apple&#8217;s existence.  Also, I&#8217;ve tried Witch. While it does switch to separate windows, it&#8217;s cumbersome to use and has some quirky UI bugs.</p>
<p>As a result, I simply resort to not minimizing or maximizing my windows.  That means I never, ever use the green or yellow buttons, basically making them pointless.  This is a shame because I think the Traffic Light scheme can really work well for OS X if it exhibited correct behavior.</p>
<p><strong>4. Crashes.</strong>  Sure, OS X doesn&#8217;t crash as often, but it does crash.</p>
<p>What was I doing in Safari to make it crash? Nothing. It quite conveniently crashed as I was making screenshots for the maximize button-point.  It had one page open. I don&#8217;t even use Safari, so that was the ONLY page I ever opened since the machine was rebooted.  It simply stopped responding (Beach Ball of Death), kicked up my fan to 6000 rpm, and upped the temperature to 80 degrees Celcius.</p>
<p>To be fair, crashes are inevitable on any computer and os, and OS X really does have fewer of them. But it&#8217;s not immune. I guess you can write this off as an annoyance at Apple fanboys and their superiority complex. =P</p>
<p><a name="screens">Screenshots</a><br />

<a href='http://mirkules.com/blog/?attachment_id=152' title='iTunes Standard'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/itunes_small-150x150.png" class="attachment-thumbnail" alt="Standard view of iTunes" title="iTunes Standard" /></a>
<a href='http://mirkules.com/blog/?attachment_id=153' title='iTunes Maximized'><img width="150" height="145" src="http://mirkules.com/blog/wp-content/uploads/2009/05/itunes_big-150x145.png" class="attachment-thumbnail" alt="iTunes after Maximize" title="iTunes Maximized" /></a>
<a href='http://mirkules.com/blog/?attachment_id=150' title='CLIPS Standard'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/clips_small-150x150.png" class="attachment-thumbnail" alt="Clips in standard view" title="CLIPS Standard" /></a>
<a href='http://mirkules.com/blog/?attachment_id=151' title='CLIPS Maximized'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/clips_big-150x150.png" class="attachment-thumbnail" alt="CLIPS with a maximized window" title="CLIPS Maximized" /></a>
<a href='http://mirkules.com/blog/?attachment_id=149' title='Safari Standard'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/safari_small-150x150.png" class="attachment-thumbnail" alt="Standard Safari Window" title="Safari Standard" /></a>
<a href='http://mirkules.com/blog/?attachment_id=148' title='Safari Maximized'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/safari_big-150x150.png" class="attachment-thumbnail" alt="Safari with a Maximized Window" title="Safari Maximized" /></a>
<a href='http://mirkules.com/blog/?attachment_id=165' title='Kernel Panic'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/img010-150x150.jpg" class="attachment-thumbnail" alt="Kernel Panic OS X" title="Kernel Panic" /></a>
<a href='http://mirkules.com/blog/?attachment_id=162' title='safari_memusage1'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/safari_memusage1-150x150.png" class="attachment-thumbnail" alt="" title="safari_memusage1" /></a>
<a href='http://mirkules.com/blog/?attachment_id=160' title='iTunes Crash'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/itunes_error-150x150.png" class="attachment-thumbnail" alt="iTunes crash window" title="iTunes Crash" /></a>
<a href='http://mirkules.com/blog/?attachment_id=158' title='Safari Crash Window'><img width="150" height="150" src="http://mirkules.com/blog/wp-content/uploads/2009/05/safari_crash-150x150.png" class="attachment-thumbnail" alt="Kaboom!" title="Safari Crash Window" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=147</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BootCamp still in Beta?</title>
		<link>http://mirkules.com/blog/?p=114</link>
		<comments>http://mirkules.com/blog/?p=114#comments</comments>
		<pubDate>Mon, 23 Mar 2009 02:42:36 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Apple/OS X]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=114</guid>
		<description><![CDATA[BootCamp makes users reinstall OS X or buy software that shouldn't be needed, in order to load another operating system on Apple hardware.  My frustration with Apple products -- particularly with OS X -- is slowly but surely raising my blood pressure to levels I have never seen during my marriage to Windows.]]></description>
			<content:encoded><![CDATA[<p>BootCamp makes users reinstall OS X or buy software that shouldn&#8217;t be needed, in order to load another operating system on Apple hardware.  My frustration with Apple products &#8212; particularly with OS X &#8212; is slowly but surely raising my blood pressure to levels I have never seen during my marriage to Windows.</p>
<p>When Apple announced the switch to the Intel architecture in 2006, nerds everywhere rejoiced.  A Unix operating system with an Apple GUI along with the x86 architecture must have been a fantasy until then.  It <em>should</em> be trivial to run any operating system on the machine, making &#8220;the switch&#8221; from Windows or Linux to OS X painless and comforting.  BootCamp Beta was released in OS X Tiger 10.4 that allowed users to re-partition an existing hard drive to FAT32 and run Windows on it.  After the beta, BootCamp was released into the wild in OS X Leopard 10.5. Life was good.</p>
<p>Except when it isn&#8217;t.  Turns out, when you start to repartition the hard drive, BootCamp expects you to not have used to your hard drive at all.  It expects your disk to contain almost no fragmentation.  But the  friendly error message really gives no useful hints: </p>
<blockquote><p>The disk cannot be partitioned because some files cannot be moved. Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again.</p></blockquote>
<p>After lots of searching, I found that <a href="http://support.apple.com/kb/HT1375">my drive must be heavily fragmented</a>, despite Apple&#8217;s claims that <a href="http://discussions.apple.com/thread.jspa?messageID=6498153">this can almost never happen</a>.  Even if it did, they claim, there will probably be no performance gains.  Notice that they completely fail to make any mention of BootCamp in the support article.</p>
<p>So, Apple&#8217;s solution is to <em>back up my hard drive, reinstall Leopard, and restore it</em>? That seems like a major PITA, and might alienate some Windows power users.  But, to be fair, they also show a link to <a href="http://www.coriolis-systems.com/iDefrag.php">iDefrag</a> &#8212; software that can defrag your hard drive &#8212; for $35.</p>
<p>IMHO, the whole thing is ridiculous.  In order to use <em><strong>an advertised feature</strong></em> of their operating system, one that makes &#8220;The Switch&#8221; so much easier, I either have to shell out $35 to defrag the hard drive, or $100 to back up my hard drive to an external device (Time Machine stealthily fills up and chews up external drives), and lose about 2 days of backup, installation and restoration &#8212; all while not being able to unplug my laptop or take my work with me.</p>
<p>I guess I must be the only person in the Universe to actually want to use an Apple product to its intended and advertised capacity, not just surf the web, write documents, or play with Photoshop.</p>
</p>
<p>/rant</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=114</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resetting MySQL Passwords</title>
		<link>http://mirkules.com/blog/?p=86</link>
		<comments>http://mirkules.com/blog/?p=86#comments</comments>
		<pubDate>Sat, 14 Mar 2009 20:51:34 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=86</guid>
		<description><![CDATA[I downloaded a Ubuntu 8.10 VMPlanet.net image with MySQL server, but the root password was set to something other than the standard vmplanet.net password.  Logging in without a password or username didn&#8217;t give me enough permissions to set my own users and change passwords.  Here is the solution for this problem (thanks Keystone [...]]]></description>
			<content:encoded><![CDATA[<p>I downloaded a Ubuntu 8.10 VMPlanet.net <a href="http://www.vmplanet.net/node/74">image</a> with MySQL server, but the root password was set to something other than the standard vmplanet.net password.  Logging in without a password or username didn&#8217;t give me enough permissions to set my own users and change passwords.  Here is the <a href="http://keystoneit.wordpress.com/2006/10/28/resetting-mysql-root-password-in-ubuntu-dapper/">solution</a> for this problem (thanks Keystone IT Tech!).<span id="more-86"></span></p>
<p>Basically, it comes down to killing mysql server, re-running it without the grant tables, setting the password and then restarting it in normal mode. To quote the linked website (Keystone IT Tech):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span>
<span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysqld<span style="color: #000000; font-weight: bold;">/</span>mysqld.pid<span style="color: #000000; font-weight: bold;">`</span>
mysqld <span style="color: #660033;">--skip-grant-tables</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
mysql <span style="color: #660033;">-u</span> root
UPDATE mysql.user SET <span style="color: #007800;">Password</span>=PASSWORD <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> WHERE User = <span style="color: #ff0000;">'root'</span>;
<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysqld<span style="color: #000000; font-weight: bold;">/</span>mysqld.pid<span style="color: #000000; font-weight: bold;">`</span>
mysqld <span style="color: #000000; font-weight: bold;">&amp;</span>
mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>

<p>Very cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=86</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grown-up Kids</title>
		<link>http://mirkules.com/blog/?p=79</link>
		<comments>http://mirkules.com/blog/?p=79#comments</comments>
		<pubDate>Wed, 24 Dec 2008 06:43:50 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=79</guid>
		<description><![CDATA[We&#8217;re all kids at heart.  It&#8217;s no secret that my wife and I enjoy waving our Wiimotes at the TV, driving the Warthog through alien-infested marshlands, or jumping around in giant, inflatable castles.  A while ago, we were playing various ticket-rewarding games at our local arcade &#8212; basketball, whack-a-mole, skee-ball, etc.  But [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re all kids at heart.  It&#8217;s no secret that my wife and I enjoy waving our Wiimotes at the TV, driving the Warthog through alien-infested marshlands, or jumping around in giant, inflatable castles.  A while ago, we were playing various ticket-rewarding games at our local arcade &#8212; basketball, whack-a-mole, skee-ball, etc.  But the payout is very small in comparison with what you can get at the reward counter, something like 100 tickets just for a pen.</p>
<p>As we were deciding what to get with our hard day&#8217;s play, we decided it&#8217;s probably better to just give the tix away than to add another piece of plastic to our collection of junk. It felt good. The expression on the kid&#8217;s face, followed by his parents forcing a thank you (&#8220;now Jimmy, what do we say?&#8221; followed by a thin &#8220;Thank you&#8221;) brings a smile to our faces.  Usually, the kids are shy and their parents thankful.</p>
<p>So we now do this every time we go to the arcades. We play till we&#8217;re sore or out of money, and then give the tickets to kids (tip: always make sure that the parent is with the child before approaching lest someone gets the wrong impression).</p>
<p>So go out there and put a smile on a kid&#8217;s face!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=79</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X .htaccess</title>
		<link>http://mirkules.com/blog/?p=76</link>
		<comments>http://mirkules.com/blog/?p=76#comments</comments>
		<pubDate>Thu, 03 Jul 2008 09:02:05 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Apple/OS X]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=76</guid>
		<description><![CDATA[For some reason, I could not get .htaccess files to work on my system for the longest time.  I&#8217;ve since upgraded to Leopard, and I eventually just gave up on it (I could do that, since I&#8217;m only running a development environment).
Anyway, the solution depends on which version you&#8217;re running:
For Tiger, edit /private/etc/httpd.conf AND [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, I could not get .htaccess files to work on my system for the longest time.  I&#8217;ve since upgraded to Leopard, and I eventually just gave up on it (I could do that, since I&#8217;m only running a development environment).</p>
<p>Anyway, <a href="http://clagnut.com/blog/350/">the solution</a> depends on which version you&#8217;re running:</p>
<p>For Tiger, edit /private/etc/httpd.conf <strong>AND</strong> /private/etc/users/username.conf for the correct directives</p>
<p>For Leopard, edit just /private/etc/apache2/httpd.conf</p>
<p>Days of pulling hair solved because I was looking in the wrong places.</p>
<p><em>Update: </em>because of the upgrade from Tiger to Leopard, ALL of the above directories were present on my system, but only /private/etc/apache2 was being used.  This is because Leopard uses apache2 and Tiger uses apache 1.3.  Obviously, apache2 uses /private/etc/apache2 instead of /private/etc/httpd.  If you had installed Leopard from scratch, this would not be a problem.<em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=76</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Final Blow</title>
		<link>http://mirkules.com/blog/?p=72</link>
		<comments>http://mirkules.com/blog/?p=72#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:48:24 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=72</guid>
		<description><![CDATA[Here is the video that killed my camera A85:

RIP my little Canon A85. You went out like a true champion.
Taken at the Prescott Rally, Prescott, AZ, October 6th, 2007.
]]></description>
			<content:encoded><![CDATA[<p>Here is the <a href="http://www.youtube.com/v/Pj4VTTMJXfI">video</a> that killed my camera A85:<br />
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/Pj4VTTMJXfI&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Pj4VTTMJXfI&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object><br />
RIP my little Canon A85. You went out like a true champion.</p>
<p>Taken at the Prescott Rally, Prescott, AZ, October 6th, 2007.</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX, Octave, Gnuplot</title>
		<link>http://mirkules.com/blog/?p=71</link>
		<comments>http://mirkules.com/blog/?p=71#comments</comments>
		<pubDate>Fri, 21 Mar 2008 20:21:34 +0000</pubDate>
		<dc:creator>Mirkules</dc:creator>
				<category><![CDATA[Apple/OS X]]></category>

		<guid isPermaLink="false">http://mirkules.com/blog/?p=71</guid>
		<description><![CDATA[To lessen the pain, here&#8217;s a tutorial on how to install gnuplot with Octave on OS X:
http://island94.org/setting-octave-and-gnuplot-osx
[EDIT: This method may be obsolete now]
]]></description>
			<content:encoded><![CDATA[<p>To lessen the pain, here&#8217;s a tutorial on how to install gnuplot with Octave on OS X:</p>
<p><a href="http://island94.org/setting-octave-and-gnuplot-osx">http://island94.org/setting-octave-and-gnuplot-osx</a></p>
<p>[EDIT: This method may be obsolete now]</p>
]]></content:encoded>
			<wfw:commentRss>http://mirkules.com/blog/?feed=rss2&amp;p=71</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
