<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Dave Orchard&apos;s Blog</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/" />
    <link rel="self" type="application/atom+xml" href="http://www.pacificspirit.com/blog/atom.xml" />
    <id>tag:www.pacificspirit.com,2008-02-06:/blog//3</id>
    <updated>2010-08-21T15:40:16Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Personal 4.1</generator>

<entry>
    <title>I&apos;m looking for mobile and/or Web application work</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2010/08/17/im_looking_for_mobile_andor_web_application_work" />
    <id>tag:www.pacificspirit.com,2010:/blog//3.1462</id>

    <published>2010-08-17T18:40:12Z</published>
    <updated>2010-08-21T15:40:16Z</updated>

    <summary><![CDATA[I'm looking for engineering, advocacy and/or standards work in the mobile and/or web applications areas. &nbsp;I bring great experience in native and web based iPhone apps, PhoneGap, Ruby, Java, the LAMP stack, Javascript, HTML5, CSS, casual social games on Facebook,...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="mobilewebapplicationrubyiphonestandardsperformancescalabilityhtml5cssjavascript" label="mobile web application ruby iphone standards performance scalability html5 css javascript" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I'm looking for engineering, advocacy and/or standards work in the mobile and/or web applications areas. &nbsp;I bring great experience in native and web based iPhone apps, PhoneGap, Ruby, Java, the LAMP stack, Javascript, HTML5, CSS, casual social games on Facebook, scalability, performance, git, xml, json, web standards and enterprise computing.<div><br /></div><div>I decided to leave Ayogo Games after 1 1/2 years primarily because the work that we are doing has changed and our technology framework is mature. &nbsp;I joined Paul Prescod and Michael Fergusson in this journey to build our own great games. &nbsp; As part of this, we built a comprehensive iPhone, web and server technology framework for rapidly deploying new casual social games. &nbsp;<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial, sans-serif; border-collapse: collapse; "><span style="border-collapse: separate; font-family: arial; font-size: small; ">With our technology framework largely complete, the company's next stage of growth&nbsp;</span>involves</span>&nbsp;very graphically rich immersive web based games. &nbsp;The company has a great team that can very quickly build web and iphone based games with the frameworks. &nbsp;To a certain extent, this is declaring victory. &nbsp;I've been a big part of building these frameworks, and now the company is turning the crank on using them. &nbsp;Given all that, it's time to move on to find other challenges that&nbsp;<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial, sans-serif; border-collapse: collapse; ">match my seniority, skills and talent as a strategic technology executive.</span></div><meta charset="utf-8"><div><br /></div><div>I'm following Tim Bray's 2 pieces of advice: 1) leave when things change and what you are good at and want to do isn't core to the company, and 2) leave before you've found another job. &nbsp;</div><div><br /></div><div>For more information, I'm at <a href="http://twitter.com/DaveO">@DaveO</a>, <a href="http://www.linkedin.com/in/dorchard">Linkedin</a> and I have a <a href="http://www.pacificspirit.com/resume.html">resume</a></div>]]>
        
    </content>
</entry>

<entry>
    <title>Remembering Something Bigger</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2010/08/04/remembering_something_bigger" />
    <id>tag:www.pacificspirit.com,2010:/blog//3.1461</id>

    <published>2010-08-04T02:58:59Z</published>
    <updated>2010-08-04T04:03:04Z</updated>

    <summary><![CDATA[A take on "expecting someone taller".August long weekend was time for the LV Rogers High School class of 1985's 25 year reunion. &nbsp;It was a lot of fun seeing many of my classmates. &nbsp;Thanks heaps to Tonnie Stewart for organizing!...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="lvrogershighschoolreunionclassof85" label="lvrogers high school reunion class of 85" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[A take on "expecting someone taller".<div><br /></div><div>August long weekend was time for the LV Rogers High School class of 1985's 25 year reunion. &nbsp;It was a lot of fun seeing many of my classmates. &nbsp;Thanks heaps to Tonnie Stewart for organizing! &nbsp;We had about 65 out of 235 graduates attending and I think that's a pretty good turnout. &nbsp;</div><div><br /></div><div>I've put a few pictures up on&nbsp;<a href="http://www.facebook.com/#!/album.php?id=670578792&amp;aid=238674" style="text-decoration: underline; ">facebook</a>&nbsp;and&nbsp;<a href="http://www.flickr.com/photos/dorchard/sets/72157624513173301/" style="text-decoration: underline; ">flickr</a>.&nbsp;</div><div><br /></div><div>Friday was a social. &nbsp;Saturday was a bit of recovery, exploration, a school tour, and then the dinner dance. &nbsp; Classic line is the facebook status message of one guy urgently asking if anybody had seen his car, which was parked in the hotel parking lot! &nbsp;I'm definitely glad I left at 2 am before the tequila really started going fast. &nbsp;Sunday morning was a bit of a write-off for most of us, and then people gradually showed up for the family picnic. &nbsp;Both nights I had a chance for a huge sleep but I woke up after less than 6 hrs, argh!</div><meta charset="utf-8"><div><br /></div><div>One surprising takeaway: most things are smaller than I remember. &nbsp;I rented a bike in one of the many bike shops at about 3pm. &nbsp;I went to the bridge end of town with the lakeside beach, up to the high school, over to Uphill - where we used to live - then pretty much back to town. &nbsp;I stopped at all my old schools, homes, and many interesting sites. &nbsp;I returned the bike and the owner says, "you only wanted it for an hour?" &nbsp;The hills were definitely as big as I remember. &nbsp;</div><div><br /></div><div>Or perhaps I grew? &nbsp;At least a half dozen people said they thought I had grown taller, to which I said maybe I just wasn't slouching as much :-) &nbsp;The people did seem a bit smaller to me too though. &nbsp;There was one who, like teenage boys are wont to do to each other, terrorized me a fair bit. &nbsp;I was surprised that he was smaller than I remember. &nbsp;I even found myself liking him as he's a nice guy too.</div><div><br /></div><div><div><div>A poignent memory for me was standing outside of Trafalgar Junior Seconday. &nbsp;It was 30 years ago that I started lining up at 7 am to get on one of the 2 apple // computers. &nbsp;30 years of computing, wow.&nbsp;</div></div></div><div><br /></div><div>Many people had changed and for the better, others have died. &nbsp;&nbsp;Some have done amazing things. &nbsp;One person has studied gorillas with Jane Goodall, and another didn't even mention her amazing triathlon performances in her bio. &nbsp;One&nbsp;has been moved on to doing amazing art since becoming a&nbsp;quadriplegic.&nbsp;</div><meta charset="utf-8"><div><br /></div><div>The internet and Conrad Black did in the Nelson Daily News. &nbsp;I was never a fan, even though I delivered the paper for many years. &nbsp;It's not often an institution can thank customers for a century of patronage. &nbsp;</div><div><br /></div><div>Some things and people haven't changed too. &nbsp;The radio was playing Twisted Sister when I arrived. &nbsp;I haven't seen mullets or women's thongs for some time. &nbsp;I didn't hear about the impromptu soccer game. &nbsp;There's irony because I was at the gym next door at the time. &nbsp;A few of the girls are still, well, perhaps I won't say anything other than they haven't changed. &nbsp;</div><div><br /></div><div>There were a few sad cases but most people seem pretty happy with their lives and their families. &nbsp;The family picnic at the beach was a nice touch so we could see many of the kids and how the families interacted. &nbsp;</div><div><br /></div><div>It was definitely worth the time and expense and opportunity cost of a family weekend to go. &nbsp;There's already talk of a 30 year reunion, and I think that is a fine idea. &nbsp;&nbsp;</div>]]>
        
    </content>
</entry>

<entry>
    <title>Day-trading with @stockguy22 made me 25% in 2 weeks</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/08/29/daytrading_with_stockguy22_made_me_25_in_2_weeks" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1460</id>

    <published>2009-08-29T06:05:50Z</published>
    <updated>2009-08-29T06:31:22Z</updated>

    <summary><![CDATA[Through Dec to March of this year, I did a fair amount of day trading with decent results.&nbsp; Thanks to twitter, I found @stockguy22 and his online chat forum.&nbsp; I decided to actually learn from a professional day trader what...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[Through Dec to March of this year, I did a fair amount of day trading with decent results.&nbsp; Thanks to twitter, I found @stockguy22 and his online chat forum.&nbsp; I decided to actually learn from a professional day trader what to look for when making trades, and see how I could do.&nbsp; This is all taking into account that I'm working full time at a startup, so this is the job before the job.<br /><br />The results are impressive.&nbsp; Over the past 2 weeks I''ve made $10K US with an average investment of $20K and a maximum total investment of $40K.&nbsp; Think about that.&nbsp; 25% returns in 2 weeks on a flat stock market.&nbsp; He really knows his stuff.<br /><br />And what's more amazing, is that was leaving at least the same amount of money on the table because I wasn't as fast as him, I held a position too long, or I was working or sleeping.&nbsp; There was the morning that I checked $HGSI and was up $3K, went back to sleep for an hour after not selling when he did, and it went back to zero.&nbsp; Talk about you snooze you lose.<br /><br />The techniques are very straightforward.&nbsp; The fundamental strategy is don't guess what the market will do, react to what the market is doing. <br /><br />1. Protect your money.&nbsp; It's far better to miss a big run up than to lose a bunch if a stock keeps going down.&nbsp; That means put tight stop loss orders on. <br /><br />2. Look for "tweezers" to indicate a market change and either bottom or top.&nbsp; That means the thin line on the one minute candle chart.<br /><br />3. Buy runups on the pull back.&nbsp; The pull back from a run up (or run down for shorting) will be at one of the 3 fibonnacci numbers, roughly are 38, 50 and 62% of the run from bottom to top.<br /><br />4. Buy when the stock has found support above the 20 period moving average.&nbsp; If a stock drops and drops, then bounces back you have to wait until it crosses that 20 period MA, and even better if it drops down but not below that line.&nbsp; <br /><br />5. Look for heavy options volume. I don't know the details, but there's a number of cues there as to whether institutional investors think a runup is overdone.<br /><br />6. A small play is the 3:30 to 3:45 EST trade on shorts.&nbsp; The idea is that shorts will be covered in this window which may lead to a pop in a stock that is moving.&nbsp; I've only made marginal $ on this though.<br /><br />7. Only do overnight holds on a stock of the price is rising and the volume is high.<br /><br />8. Get out even when you are convinced the market is wrong.&nbsp; He still has a blind spot for natural gas and has followed $HNU.TO a long ways down ( I didn't buy because I think it's got further to go), but he covered his losses on $EXM/$DRYS (the dry shippers) and others.<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Creating an archive of an iphone app from unix: ditto</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/08/10/creating_an_archive_of_an_iphone_app_from_unix_ditto" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1459</id>

    <published>2009-08-10T04:34:08Z</published>
    <updated>2009-08-10T05:09:13Z</updated>

    <summary><![CDATA[I've automated the build for our latest couple of iphone games, and I wanted to automate the finder's compress function.&nbsp;&nbsp; Nothing from the terminal on OS X exactly reproduced the finder's compress size.The closest was ditto -c -k --sequesterRsrc --keepParent.&nbsp;...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="iphoneappfindercompressditto" label="iphone app finder compress ditto" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I've automated the build for our latest couple of iphone games, and I wanted to automate the finder's compress function.&nbsp;&nbsp; Nothing from the terminal on OS X exactly reproduced the finder's compress size.<br /><br />The closest was ditto -c -k --sequesterRsrc --keepParent.&nbsp; That was off by 48 bytes over 6 megabytes.&nbsp; Probably not a big deal, but I wonder why I can't reproduce exactly what finder is doing. &nbsp; <br /><br />All the variants that I tried, each producing different compressed sizes:<br />ditto -c -k --sequesterRsrc --keepParent foo.app foo.zip<br />ditto -c -k foo.app foo.zip<br />zip -r foo.zip foo.app<br />tar cvf - foo.app | gzip -c &gt;foo.zip<br />tar cvfz - foo.app &gt;foo.zip<br />tar cvf - foo.app &gt;foo.zip; compress foo.zip<br /><br />I didn't try the /System/Library/CoreServices/ArchiveUtility.app which calls ditto in OS X 10.5, or 10.4's BOMArchiveHelper.app<br /><br />And thankfully I didn't run into any of the file ownership issues after decompress that are talked about in an <a href="http://discussions.apple.com/thread.jspa?threadID=1799630&amp;start=0&amp;tstart=0">apple.com thread<br /></a><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iPhone tip: Installing directory containing symlink requires run script phase in XCode</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/04/24/iphone_tip_installing_directory_containing_symlink_requires_run_script_phase_in_xcode" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1458</id>

    <published>2009-04-24T21:42:56Z</published>
    <updated>2009-04-24T21:50:03Z</updated>

    <summary><![CDATA[XCode does not allow a fairly simple directory structure that contains a symbolic link to be copied to an iphone without using a shell script, such as running a dashcode project on the iphone.&nbsp; Xcode's target copy bundle resources or...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="iphonexcodesymlinksymbolicdashcode" label="iphone xcode symlink symbolic dashcode" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[XCode does not allow a fairly simple directory structure that contains a symbolic link to be copied to an iphone without using a shell script, such as running a dashcode project on the iphone.&nbsp; Xcode's target copy bundle resources or copy file build phases don't do the trick.&nbsp; In my case, I wanted an xcode project that consists of an html page that links to a dashcode project with it's own html file.&nbsp; The directory structure looks like<br /><br />www/index.html (contains an href="linktodashcodedir/index.html")<br />www/dashcodedir ( a link to a dashcode project's project directory<br />dashcodedir (contains an index.html file)<br /><br />What you end up needing to do is a run script phase that looks like: <br /><br />rsync -pvtrlL --cvs-exclude "$PROJECT_DIR/../www/" "$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/www"<br /><br />The problem is that the copy file build phase will not follow a symlink, and if you add the dashcodedir to Xcode to do a second copy file build phase, it won't work with a path of the copy files to $CONTENTS_FOLDER_PATH/www<br /><br />If you add the www directory as "Convert to Groups", and then take the www group for copy files, the directory structure is flattened. &nbsp;<br /><br />If you add the www directory as create folder references, then the copy files phase won't follow the symlink.<br /><br />You can add the www directory as folder references and add the symlinked directory as another folder reference so you have 2 copy files phases.&nbsp; But that forces all the relative links to be up the hierarchy, as in www/index.html contains a link to ../www2/index.html.&nbsp; And it requires every symlink to have it's own root directory, which could quickly scale out of control.<br /><br />Also, if you want a symbolic link, you have to use unix's ln -s command, not the finders make alias command. &nbsp; &nbsp; ]]>
        
    </content>
</entry>

<entry>
    <title>Yet another obscene CEO buyout at Chesapeake ($CHK) and the margin call</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/04/03/yet_another_obscene_ceo_buyout_at_chesapeake_chk_and_the_margin_call" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1457</id>

    <published>2009-04-03T20:21:26Z</published>
    <updated>2009-04-03T20:33:27Z</updated>

    <summary><![CDATA[Mindnumbing that McClendon margins himself out of his equity then the shareholders have to redo his contract and give him more.&nbsp; Via fundmymutualfund: Chesapeake Energy (CHK) CEO Aubrey McClendon With New Shady Compensation Deal; I was Right in My PredictionWhat...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[Mindnumbing that McClendon margins himself out of his equity then the shareholders have to redo his contract and give him more.&nbsp; <br /><br />Via fundmymutualfund: <a href="http://www.fundmymutualfund.com/2009/04/chesapeake-energy-chk-ceo-aubrey.html">Chesapeake Energy (CHK) CEO Aubrey McClendon With New Shady Compensation Deal; I was Right in My Prediction</a><br /><br />What I find even more galling about this is what he didn't say much about.&nbsp; Why did McLendon have to sell 94% of his holdings for $600Mil to meet margin loan calls?&nbsp; <br /><br />BECAUSE HE BORROWED AGAINST HIS OBSCENE EQUITY TO MAKE MORE $$!!!!!<br /><br />He gambled big, and lost.&nbsp; So because he gambled big time, the shareholders "awarded the $75 million to Mr. McClendon as a result of a new, five-year employment agreement struck on New Year's Eve by directors and the executive. Mr. McClendon's new agreement replaced a relatively new, five-year contract struck in 2007 that, obviously, had yet to run its course."<br /><br />His 6% left that was worth $40Mil wasn't nearly enough to keep him working.&nbsp; After throwing away his $2 Billion + margined stock ($4Bil?) at peak, he can't possibly do with less than $100 Mil.&nbsp; And the shareholders that have lost huge amounts in Chesapeake stock have to give him the money.<br /><br />What obviously happened is that he gambled his $2Bill at the peak to make even more money.&nbsp; Apparently $2Bill wasn't enough, he needed something like $4Bill.&nbsp; <br /><br />Unbelievable.&nbsp; It's time for Trotsky, Marx and Lenin.&nbsp; <br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Vancouver real estate picks up</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/04/03/vancouver_real_estate_picks_up" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1456</id>

    <published>2009-04-03T20:12:38Z</published>
    <updated>2009-04-03T20:18:42Z</updated>

    <summary><![CDATA[I have been noticing a number of sold signs showing up in our neighbourhood, so I thought that the real estate market was picking up.&nbsp; Turns out I was right according to MLS numbers for March.&nbsp; I do have a...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="vancouverhousing" label="vancouver housing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I have been noticing a number of sold signs showing up in our neighbourhood, so I thought that the real estate market was picking up.&nbsp; Turns out I was right according to <a href="http://www.vancouversun.com/Business/Metro+Vancouver+real+estate+sales+bounce+back/1457235/story.html">MLS numbers</a> for March.&nbsp; I do have a bunch of price comparisons because there's 4 houses that have regularly sold.&nbsp; I think I'll find out what they sold for and see what's been happening to prices in our neck of the woods.&nbsp; There's one that we always do a comparison, a reno'd place on 800 block W 22nd with a suite that we think is worth about 5-10% more than ours.&nbsp; It's up for sale now, though not yet sold.&nbsp; I vividly remember the conversation I had with the owner back in 2004 when prices were 60% of what they are now, and he said we should buy the yellow house across the street from us.&nbsp; That house went up 100% from then to 2008.&nbsp; oof.<br /><br />Now the question is whether we've hit bottom, or whether this is just a dead-cat bounce.&nbsp; Could be that a lot of inventory will come on the market where owners that really do need to sell finally can, and the buyers scoop them up on the assumption that "there's never been a better time to buy".<br /><br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iPhone memory leak detection using clang</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/03/05/iphone_memory_leak_detection_using_clang" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1455</id>

    <published>2009-03-05T18:05:44Z</published>
    <updated>2009-03-05T18:20:21Z</updated>

    <summary><![CDATA[One of the most common problems in iPhone development is memory leaks.&nbsp; I found the Performance tool offered by Apple to be pretty useless at finding memory leaks.&nbsp; A much better tool is clang.&nbsp; It found 23 valid memory leaks...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="clangiphonememoryleaks" label="clang iphone memory leaks" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[One of the most common problems in iPhone development is memory leaks.&nbsp; I found the Performance tool offered by Apple to be pretty useless at finding memory leaks.&nbsp; A much better tool is clang.&nbsp; It found 23 valid memory leaks in my first iphone app.&nbsp; <br /><br />It does static analysis of the objective-c and produces a great report of any memory leaks.&nbsp; It's on the <a href="http://clang.llvm.org/StaticAnalysisUsage.html#Obtaining">about page</a> of the clang.livm.org site.&nbsp; After downloading and installing in the /Developer directory, add the path to the /etc/paths file, ie <br />&gt;sudo vi /etc/paths<br /><br />To use it, from the command-line, always do a clean by<br />&gt;xcodebuild clean<br /><br />Then do the build<br />&gt;scan-build -k -v xcodebuild<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iPhone threading and screen refreshes success</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/02/25/iphone_threading_and_screen_refreshes_success" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1454</id>

    <published>2009-02-25T18:26:31Z</published>
    <updated>2009-02-25T18:39:34Z</updated>

    <summary><![CDATA[I realized a while ago what I had done wrong in my previous attempt at displaying a progress bar and the screen wasn't refreshing.&nbsp; The problem was that I was not invoking the method to update the progress bar on...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I realized a while ago what I had done wrong in my previous attempt at <a href="http://www.pacificspirit.com/blog/2008/12/15/iphone_threading_and_screen_refreshes">displaying a progress bar and the screen wasn't refreshing</a>.&nbsp; The problem was that I was not invoking the method to update the progress bar on the main thread.&nbsp; The key line is:<br />[self performSelectorOnMainThread:@selector(setProgressValue:) withObject:[NSNumber numberWithFloat:1.0] waitUntilDone:NO];<br /><br />The
following fragment illustrates what works:<br /><br />- (void)doSomethingSlow:(id)sender<br />{<br />&nbsp;&nbsp;&nbsp; [self outputString:@"doSomethingSlower:\n"];<br />&nbsp;&nbsp;&nbsp; [NSThread detachNewThreadSelector:@selector(slowTransfer) toTarget:self withObject:nil];<br />}<br /><br />- (void) doneTransfer<br />{<br />&nbsp;&nbsp;&nbsp; NSLog(@"DoneTransfer");<br />}<br /><br />- (void)slowTransfer<br />{<br />&nbsp;&nbsp;&nbsp; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];<br /><br />&nbsp;&nbsp;&nbsp; // do processing here.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp; [self performSelectorOnMainThread:@selector(setProgressValue:) withObject:[NSNumber numberWithFloat:i/10.0] waitUntilDone:NO];<br />&nbsp; <br />&nbsp;&nbsp;&nbsp; // When done...<br />[self performSelectorOnMainThread:@selector(setProgressValue:) withObject:[NSNumber numberWithFloat:1.0] waitUntilDone:NO];<br />&nbsp;&nbsp;&nbsp; [self performSelectorOnMainThread:@selector(doneTransfer) withObject:nil waitUntilDone:YES];<br />&nbsp;&nbsp;&nbsp; [pool release];&nbsp;&nbsp;&nbsp; <br />}<br /><br />- (void)setProgressValue:(NSNumber *)progressValue<br />{&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; self.progressView.progress = [ progressValue floatValue];<br />}<br /><br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iPhone SDK 2.2.1 and Exchange Sync has broken AddressBook API calls</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/02/25/iphone_sdk_221_and_exchange_sync_has_broken_addressbook_api_calls" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1453</id>

    <published>2009-02-25T06:26:46Z</published>
    <updated>2009-02-25T06:50:07Z</updated>

    <summary><![CDATA[The iPhone SDK 2.2.1, which added Exchange Sync with Google, has broken the ABRecordSet function!&nbsp; I think the use of the Exchange means that the API can't be used to update records, perhaps because of a conflict?&nbsp; Or because the...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="sdk221iphoneaddressbookabrecordset" label="sdk 2.2.1 iphone addressbook ABRecordSet" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[The iPhone SDK 2.2.1, which added Exchange Sync with Google, has broken the ABRecordSet function!&nbsp; I think the use of the Exchange means that the API can't be used to update records, perhaps because of a conflict?&nbsp; Or because the Preferences Bundles can't be found?<br /><br />The call "didAdd = ABRecordSetValue(person, kABPersonPhoneProperty, multi, &amp;anError);"<br /><br />Now generates a didAdd=false and these lovely console messages:<br />warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2.1/Symbols/System/Library/PreferenceBundles/AccountSettings/DataAccessSettings.bundle/DataAccessSettings" (file not found).<br />warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2.1/Symbols/System/Library/PreferenceBundles/AccountSettings/MobileWirelessSyncSettings.bundle/MobileWirelessSyncSettings" (file not found).<br />warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2.1/Symbols/System/Library/PreferenceBundles/AccountSettings/MobileMailSettings.bundle/MobileMailSettings" (file not found).<br />2009-02-24 22:07:25.058 AppName[171:20b] Could not open the lock file at /tmp/DAAccountsLoading.lock. We'll load the accounts anyway, but bad things may happen<br /><br />If I turn off Exchange (which deletes all contacts but of course I've backed them up) then API calls still work.&nbsp; <br /><br />Poking about in the iPhone SDK docs and devforums hasn't turned up anything.&nbsp; If you know anything about this, let me know and I'll post updates.<br /><br />I've created an Apple Bug ID# <a href="https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/100/wo/227zIObW7hptlRNlioxwVM/9.34"><b><u><font color="blue">6620425</font></u></b></a><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Interesting stock chart comparisons of industrials/techs and oil stocks and contango</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/02/12/interesting_stock_chart_comparisons_of_industrialstechs_and_oil_stocks_and_contango" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1452</id>

    <published>2009-02-12T18:31:32Z</published>
    <updated>2009-02-12T19:05:04Z</updated>

    <summary><![CDATA[I compared some of my tech stock are doing compared to indices and I wanted to see a contango $USO play.&nbsp; Every trader has to ask the question about stock picks and whether they are beating the market or not.&nbsp;...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="contangooilsea" label="contango OIL SEA" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I compared some of my tech stock are doing compared to indices and I wanted to see a contango $USO play.&nbsp; Every trader has to ask the question about stock picks and whether they are beating the market or not.&nbsp; <br /><br />It's amazing how close the DJI, Nasdaq, MSFT, AAPL, and GOOG are tracking each other.&nbsp; A 200 day perf chart from stockcharts.com is really interesting.<br /><br /><a href="http://stockcharts.com/charts/performance/perf.html?GOOG,MSFT,AAPL,COMP,DJIA">http://stockcharts.com/charts/performance/perf.html?GOOG,MSFT,AAPL,COMP,DJIA</a><br /><br />Net, MSFT has outperformed and AAPL has underperformed, but there's only about a 12% difference (MSFT - 33%, AAPL - 45%) since April 29th 2008.&nbsp; I'm not sure if I'm actually getting value for my time on buy and hold techs.<br /><br />Next I looked at some oil and Contango related equities, notably OIL, USO, DXO (2x oil long), SEA, USL, DIG.&nbsp; I picked SEA because it is an ETF on tankers.&nbsp; I think there's a way play oil that assumes the further out futures price is higher than the current future price and will continue to drop.<br /><br /><a href="http://stockcharts.com/charts/performance/perf.html?USO,DXO,SEA,OIL,USL,DIG">http://stockcharts.com/charts/performance/perf.html?USO,DXO,SEA,OIL,USL,DIG<br /></a><br />What an astounding chart.&nbsp; DXO got as low as -90% since Aug 22nd.&nbsp; USO and OIL are extremely tightly correlated and look to still be dropping.&nbsp; It also shows USL has done better than USO/OIL.&nbsp;  These prove @toddsullivans point that USO is getting hurt badly by contango and USL is a better bet. SEA has risen 15% off it's november low.&nbsp; DXO has actually risen a bit compared to OIL and USO off the late december lows despite OIL and USO continuing to drop a bit.&nbsp; Who would have thought a double long would go up when OIL and USO are dropping?&nbsp; It also looks like DIG has been flat since the huge drop climaxing in mid Oct 2008 and has tracked USO since early Dec.&nbsp; Finally, it looks like SEA has outperformed USL by 15% since SEA's bottom in mid-Nov.&nbsp; <br /><br />As I chatted with @toddsullivan, it looks like the contango play I want is SEA, USL, DXO, or shorting OIL or USO.&nbsp; I think I'll probably go with $SEA. <br /> ]]>
        
    </content>
</entry>

<entry>
    <title>High performance WordPress</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/02/04/high_performance_wordpress" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1451</id>

    <published>2009-02-04T23:15:47Z</published>
    <updated>2009-02-05T00:06:33Z</updated>

    <summary><![CDATA[We examined a wordpress site as part of the Building High Performance Web sites workshop at Web Directions North 09.&nbsp;&nbsp; The site we examined was the vancouvertwins.com site that I'm the online guy for.&nbsp; We ran YSlow and the IBM...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="yslowwordpresshighperformance" label="YSlow Wordpress high performance" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[We examined a wordpress site as part of the <a href="http://www.pacificspirit.com/blog/2009/02/04/building_high_performance_web_sites">Building High Performance Web sites</a> workshop at Web Directions North 09.&nbsp;&nbsp; The site we examined was the <a href="http://www.vancouvertwins.com/">vancouvertwins.com</a> site that I'm the online guy for.&nbsp; <br /><br />We ran YSlow and the IBM tool.&nbsp; I also found a few WordPress specific optimization sites:<br /><a href="http://maketecheasier.com/8-ways-to-improve-your-wordpresss-loading-time/2009/01/21">http://maketecheasier.com/8-ways-to-improve-your-wordpresss-loading-time/2009/01/21</a><br /><br /><a href="http://buzzdroid.com/wordpress/yslow-and-wordpress-plugins-kill-your-score/">http://buzzdroid.com/wordpress/yslow-and-wordpress-plugins-kill-your-score/</a><br /><br /><a href="http://www.breakitdownblog.com/speeding-up-your-wordpress-site-php-speedy-and-yslow/">http://www.breakitdownblog.com/speeding-up-your-wordpress-site-php-speedy-and-yslow/</a><br /><br />We tried 3 different things:<br /><br /><b>CSS In separate files</b><br />The comments page introduced some CSS in the header.&nbsp; It would be good to remove that to just the pages that needed it, or into a separate file.&nbsp; Because the wp_comments plugin uses only a single file for the css, I can't split it out.&nbsp; I could fork the plug-in, or update the plugin myself.&nbsp; I decided to live with the system as it is.<br /><br /><b>Expires Headers<br /><br /></b>I added expires headers to every gif, jpeg, jpg, png, etc. file by modifying the .htaccess file.<br /><b><br />Gzip, minify, Caching<br /><br /></b>I first added WP-cache, but then I added php-speedy.&nbsp; This allowed specifying minify of various files, gzipping files, and even does caching.&nbsp; A really great utility.<br /><br /><b>Results</b> <br /><b><br /></b>The results were interesting.&nbsp; The difference between php-speedy and WP-Cache turned out to be very minimal. The browser cache turns out to be the biggest contributor to the performance by decreasing load time from from roughly 2.5 seconds to 1 second.&nbsp; We couldn't really get it faster than that. &nbsp;&nbsp; <br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Building High Performance web sites</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/02/04/building_high_performance_web_sites" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1450</id>

    <published>2009-02-04T18:50:56Z</published>
    <updated>2009-02-04T19:14:47Z</updated>

    <summary><![CDATA[I attended Nicole Sullivan's awesome high performance web site workshop.&nbsp; Some really interesting things I learned:Yahoo's workPerformance: http://developer.yahoo.com/performance/ Performance Rules: http://developer.yahoo.com/performance/rules.htmliPhone cacheability: http://yuiblog.com/blog/2008/02/06/iphone-cacheability/ToolsYSlow is a firefox plugin that evaluates a web page against the performance rulesIBM Page detailer does an...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="highperformancewebsitenicolesullivanstubornella" label="high performance web site nicole sullivan stubornella" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I attended <a href="http://www.stubbornella.org/content/">Nicole Sullivan's</a> awesome high performance web site workshop.&nbsp; Some really interesting things I learned:<br /><b><br />Yahoo's work</b><br />Performance: <a href="http://developer.yahoo.com/performance/">http://developer.yahoo.com/performance/</a><br />
Performance Rules: <a href="http://developer.yahoo.com/performance/rules.html">http://developer.yahoo.com/performance/rules.html</a><br />iPhone cacheability: <a href="http://yuiblog.com/blog/2008/02/06/iphone-cacheability/">http://yuiblog.com/blog/2008/02/06/iphone-cacheability/</a><br /><br /><b>Tools</b><br /><br /><a href="http://developer.yahoo.com/yslow/">YSlow</a> is a firefox plugin that evaluates a web page against the performance rules<br /><br /><a href="http://www.alphaworks.ibm.com/tech/pagedetailer">IBM Page detailer</a> does an awesome job of looking at the exact times of requests. <br /><br /><a href="http://www.smushit.com/">Smush.it</a> will reduce image sizes, but you have to be careful about copyright information removal.<br /><br /><b>Rules</b><br />The Yahoo performance rules I'll list below:<br />1. Decrease HTTP requests<br />Sprites are collections of images together, example is shine.yahoo.com.&nbsp;&nbsp; Use extra markup to increase perf, like expanding images, reducing tabs. Make a module transparent on the inside, then you can swap out the inside.&nbsp; Example is a red rounded box.&nbsp; <br /><br />Combined scripts, combined stylesheets<br /><br />2. Use a Content Delivery Network<br />3. Add an expires Header<br />Not just for images.&nbsp; median age for *.coms, 1, 1, 2, 34, 114, 220,140, 450 days.<br /><br />4. Gzip<br />5. Put stylesheets at the top.&nbsp; Stylesheets freeze rending in IE6<br />Actually renders page slower, but renders progressively<br /><br />6. Put scripts at the bottom<br />An example is secondary tabs<br /><br />7. Avoid CSS Expressions<br />8. Make CSS and Javascript external<br />9. reduce dns lookups<br />10. Minify Javascript and CSS<br />11. Avoid Redirects<br />12. remove duplicate scripts<br />13. Configure ETags<br /><br />There are many more but those are the ones that YSlow will check.<br /><br /><b>Graceful image degradation</b><br />Avoid filters AlphaImageLoader which is a filter that forces alpha transparencies.&nbsp; It blocks rendering, and is evaluated per element not per image.<br />Use PNG8 which degrades gracefully in IE&lt;7.&nbsp; This removed 100ms from yahoo changing for sprite.&nbsp;&nbsp; <br />As a Fallback use underscore hack<br />#elem {<br />_filter:progid:...<br />}<br />PNG8 authoring tools aren't common, fireworks is one.<br /><br />(I'm not sure I quite follow all that but seemed very worthwhile to note)<br />&nbsp;<br /><br />&nbsp;<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Active trading results: +1% in 50 days</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/01/28/active_trading_results_1_in_50_days" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1449</id>

    <published>2009-01-28T21:56:09Z</published>
    <updated>2009-01-28T22:28:01Z</updated>

    <summary><![CDATA[I've been active/day trading since Dec 5th, often twittering about my buys, sells, and frustrations.&nbsp; I've had some great wins, big losses, lots of average results, and lots of time spent.&nbsp; So how have I been doing?&nbsp; After this time,...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I've been active/day trading since Dec 5th, often twittering about my buys, sells, and frustrations.&nbsp; I've had some great wins, big losses, lots of average results, and lots of time spent.&nbsp; So how have I been doing?&nbsp; <br /><br />After this time, we are up 1%.&nbsp; Compare that with:<br />SPX: 876 to 874, even<br />DJI: 8635 to 8375, - ~3.5%<br />Nasdaq: 1509 to 1558, + ~3%<br />Berkshire-B: 3360 to 2994, -11%<br />TSX ishares: 12.5 to 13.57, +9%<br />ABB bond fund: 99.3 to 102.5, +3%<br /><br />Warren Buffet was a big drag on us as it was close to 18% of our portfolio&nbsp; <br /><br />I'd have to say the verdict is so so.&nbsp; Even with S&amp;P500 and trailing nasdaq, tsx and bonds, though beating dow and buffet. &nbsp;&nbsp; <br /><br />OTOH, the strategy of capital preservation in a big down turn never got tested.&nbsp; I have been holding large amounts of bonds and cash.&nbsp; If the market had tanked, I'm very confident we would have done much better than the market.&nbsp; <br /><br />What to do going forward?&nbsp; I'm not sure. &nbsp; I don't think I've proven that my time is effectively spent doing active trading.&nbsp; I've certainly proven that I can play effectively.&nbsp; And I've learned a lot.&nbsp; <br /><br />But am I happier learning about doji stars, DTO, etc. compared to more iPhone dev or ruby on rails?&nbsp; I'll have to continue to ponder that. &nbsp; <br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Building for multiple iPhone targets in XCode</title>
    <link rel="alternate" type="text/html" href="http://www.pacificspirit.com/blog/2009/01/27/building_for_multiple_iphone_targets_in_xcode" />
    <id>tag:www.pacificspirit.com,2009:/blog//3.1448</id>

    <published>2009-01-27T19:34:37Z</published>
    <updated>2009-01-27T22:20:22Z</updated>

    <summary><![CDATA[I've been exploring building for multiple iPhone targets using XCode. The goal is to keep the common code across targets in one place, rather than cutting and pasting. It's pretty straightforward and also very customizable.&nbsp; A very interesting technique is...]]></summary>
    <author>
        <name>Dave Orchard</name>
        
    </author>
    
    <category term="xcodepreprocessormacrotarget" label="xcode preprocessor macro target" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.pacificspirit.com/blog/">
        <![CDATA[I've been exploring building for multiple iPhone targets using XCode. The goal is to keep the common code across targets in one place, rather than cutting and pasting. It's pretty straightforward and also very customizable.&nbsp; A very interesting technique is using #if TARGET macros to control execution...<br /><br /><b>Interationalization<br /></b>A very common reason for multiple targets is multiple locales.&nbsp; The easiest is to make sure that all the strings are in local-specific files.&nbsp; The documentation is very clear for this.&nbsp; A big advantage is you can still keep the same target name.&nbsp; <br /><br /><b>Different Target names</b><br />Another common need is for different target names.&nbsp; For example, you might offer a lite version of your super whizbang application.&nbsp; XCode supports different targets very well.&nbsp; If you want to keep the same names of files, like nib files or icons, across targets, you'll have to put them in separate directories.&nbsp; Then you use the correct directory.&nbsp; You will probabably need to have different mainview nib files.&nbsp; Changing the target is done by setting the Active Target in the target pulldown, the same place as the active sdk and debug or release.<br /><br /><b>Same files for different targets</b><br />I really wanted to have some files remain the same because most of the functionality was common.&nbsp; There are generally 3 places you can control the functionality: compile-time, link-time, and run-time.<br /><br /><b>Compile-time</b><br />It turns out to be really easy to set objective-c macros for compile time.&nbsp; In the build settings for all targets, you add a user-defined setting called OTHER_CFLAGS.&nbsp; This contains any extra C flags, but we are interested in just defining something for the target.&nbsp; XCode sets the target name in a ${TARGET_NAME} variable (note the squiggle brackets are for build variables.&nbsp; &nbsp; We set the OTHER_CFLAGS to contain "-DTARGET_NAME=${TARGET_NAME}".&nbsp; <br /><br />Then in your code you can do <br />#if TARGET_NAME == myApp<br />#elif TARGET_NAME == myAppLite<br />#endif<br /><br />This has the nice advantage that your runtime code will be smaller and faster than a runtime check.<br /><br />Tip: if you want to see all the #defines for your files, set the OTHER_CFLAGS to "-g3 -save-temps -dD"<br /><br /><b>Linktime<br /></b>You can choose which files to link depending upon which target by setting the files under the target in xcode.&nbsp; Simple as that. <br /><br /><b>Runtime</b><br />At run time you get the name of the application from a variety of sources.&nbsp; There's a good apple technical article on <a href="http://developer.apple.com/qa/qa2007/qa1544.html">obtaining the localized application name.</a><br />The gist is<br /><pre class="sourcecodebox">    NSString *bundlePath = [[NSBundle mainBundle] bundlePath];<br />    NSString *appName = [[NSFileManager defaultManager] displayNameAtPath: bundlePath];<br /></pre>Then you can do the expected if/else comparison.<br /><br /><b>Strings<br /></b>An
interesting technique for using different strings depending up the
application name is to combine the target name comparison with the
NSLocalizedString function.&nbsp; The preprocessor variant might be<br />#if TARGET_NAME == foo<br />&nbsp;&nbsp;&nbsp; doSomething NSLocalizedString(@"FOOSomethingKey", @"");<br />#elif TARGET_NAME == bar<br />
&nbsp;&nbsp;&nbsp; doSomething NSLocalizedString(@"BARSomethingKey", @"");<br />#endif<br /><br />This is perhaps a little less readable than we'd like.&nbsp; The runtime version could do <br />&nbsp;&nbsp; doSomething NSLocalizedString( /* appName compare */ ? @"FOOSomethingKey" : @"BARSomethingKey", @""); <br />]]>
        
    </content>
</entry>

</feed>

