<?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>PatCavit.com &#187; Tivac.com Projects</title>
	<atom:link href="http://patcavit.com/category/tivaccom-projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://patcavit.com</link>
	<description>I &#60;3 Programming</description>
	<lastBuildDate>Mon, 16 May 2011 16:11:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>YUI 2.8 Uploader</title>
		<link>http://patcavit.com/2010/01/06/yui-2-8-uploader/</link>
		<comments>http://patcavit.com/2010/01/06/yui-2-8-uploader/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:47:46 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[No Category]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://patcavit.com/?p=253</guid>
		<description><![CDATA[I know this is old but I finally tried upgrading my uploader implementation at http://tivac.com/upload/ to YUI 2.8. Ran into some nasty problems where the SWF would never fire its contentReady event. Turns out, it&#8217;s a known issue with the Uploader component in YUI 2.8 and it&#8217;ll be fixed in the next patch release. Important [...]]]></description>
			<content:encoded><![CDATA[<p>I know this is old but I finally tried upgrading my uploader implementation at <a href="http://tivac.com/upload/">http://tivac.com/upload/</a> to YUI 2.8. Ran into some nasty problems where the SWF would never fire its contentReady event.</p>
<p>Turns out, it&#8217;s a known issue with the Uploader component in YUI 2.8 and it&#8217;ll be fixed in the next patch release.</p>
<blockquote><p><strong>Important Issue:</strong> Due to a current bug, the current version of uploader.swf hosted on yui.yahooapis.com in the YUI 2.8 branch is NOT compatible with the uploader.js hosted on yui.yahooapis.com. Until the next bugfix release, you can work around this issue by either locally hosting the older version of uploader.swf (available here), or locally hosting the uploader.js and making the following changes to it:</p>
<ul>
<li>On line 509, in swfObj.addVariable(&#8220;elementID&#8221;, swfID);, replace &#8220;elementID&#8221; with &#8220;YUISwfId&#8221;.</li>
<li>On line 512, in swfObj.addVariable(&#8220;eventHandler&#8221;, &#8220;YAHOO.widget.FlashAdapter.eventHandler&#8221;);, replace &#8220;eventHandler&#8221; with &#8220;YUIBridgeCallback&#8221;.</li>
</ul>
</blockquote>
<p>That only had me frustrated for 5 minutes, thank god I read <a href="http://developer.yahoo.com/yui/uploader/">the documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2010/01/06/yui-2-8-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Uploader Updated</title>
		<link>http://patcavit.com/2008/11/30/yui-uploader-updated/</link>
		<comments>http://patcavit.com/2008/11/30/yui-uploader-updated/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 19:54:08 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://patcavit.com/?p=212</guid>
		<description><![CDATA[The uploader I wrote and talked about in YUI Upload Implementation has been updated to work with YUI 2.6.0 and also with the new Flash security rules for browsing files. The changes were relatively minor, but here&#8217;s a quick explanation. A new element had to be added that could overlay the button that lets you [...]]]></description>
			<content:encoded><![CDATA[<p>The uploader I wrote and talked about in <a title="YUI Upload Implementation" href="http://patcavit.com/2008/03/01/yui-uploader-implementation/">YUI Upload Implementation</a> has been updated to work with YUI 2.6.0 and also with the new Flash security rules for browsing files. The changes were relatively minor, but here&#8217;s a quick explanation.</p>
<p>A new element had to be added that could overlay the button that lets you select files. Once the JS fires it makes that element the exact same size/position of the button you can see and then the YUI Upload fills that overlay with a flash object. While the button still exists when you click the event is actually captured by the flash object. This gets around the tighter flash security rules while not changing the upload experience at all. It&#8217;s not a perfect solution but at least the uploader works again.</p>
<p>Changed code looks like this in upload.js<br />
<code><br />
var button = YUD.getRegion('browse');<br />
var overlay = YUD.get('btn_overlay');<br />
YUD.setStyle(overlay, 'width', button.right - button.left + "px");<br />
YUD.setStyle(overlay, 'height', button.bottom - button.top + "px");<br />
YUD.setStyle(overlay, 'top', button.top + "px");<br />
YUD.setStyle(overlay, 'left', button.left + "px");<br />
this.uploader = new YAHOO.widget.Uploader('btn_overlay');</code></p>
<p>Updated uploader still lives at <a href="http://tivac.com/upload/">http://tivac.com/upload/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2008/11/30/yui-uploader-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xbox Friends server component updated</title>
		<link>http://patcavit.com/2008/10/24/xbox-friends-server-component-updated/</link>
		<comments>http://patcavit.com/2008/10/24/xbox-friends-server-component-updated/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 17:45:03 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[xbox]]></category>

		<guid isPermaLink="false">http://patcavit.com/?p=209</guid>
		<description><![CDATA[I did an in-place upgrade of the server component for the Xbox Friends Gadget that should make counts of online users more accurate. I meant to do this in 1.3 and just forgot about it. Phantom friends have been driving me crazy lately, so hopefully this quiets that down. Seems to be working well so [...]]]></description>
			<content:encoded><![CDATA[<p>I did an in-place upgrade of the server component for the Xbox Friends Gadget that should make counts of online users more accurate. I meant to do this in 1.3 and just forgot about it. Phantom friends have been driving me crazy lately, so hopefully this quiets that down. Seems to be working well so far.</p>
<p>You don&#8217;t need to download a new version of the gadget to get this update, it will just start getting more accurate.</p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2008/10/24/xbox-friends-server-component-updated/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tweaking the Image Uploader</title>
		<link>http://patcavit.com/2008/07/23/tweaking-the-image-uploader/</link>
		<comments>http://patcavit.com/2008/07/23/tweaking-the-image-uploader/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 03:04:57 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://patcavit.com/?p=192</guid>
		<description><![CDATA[For fun I went trolling through the images people have uploaded via the YUI Uploader implementation I wrote a while ago. When it took my browser a solid 30 seconds to even be remotely responsive and start rendering images it struck me that perhaps it was time to paginate the images instead of just dumping [...]]]></description>
			<content:encoded><![CDATA[<p>For fun I went trolling through the images people have uploaded via the <a title="YUI Upload Implementation" href="http://patcavit.com/2008/03/01/yui-uploader-implementation/">YUI Uploader implementation</a> I wrote a while ago. When it took my browser a solid 30 seconds to even be remotely responsive and start rendering images it struck me that perhaps it was time to paginate the images instead of just dumping them all out onto one page.</p>
<p>So I added pagination. It&#8217;s currently super simple which makes for easy explanation. The PHP still collects and sorts every single image in the directory by date. I don&#8217;t think there&#8217;s any other way to do that. Afterwards it checks to see if the &#8220;o&#8221; query param was set and is an integer (thanks for adding <a title="Filter Input PHP Man Page" href="http://www.php.net/manual/en/function.filter-input.php">filter_input</a> to PHP5, PHP devs!). Once there&#8217;s an offset to start from, it slices the array at that point and takes the next 50 images.</p>
<p>After that there&#8217;s just some simple logic around drawing the pagination numbers and figuring out which one is the current page. The numbers are centered and boxed using a variation on Hedger&#8217;s inline-block work (<a href="http://www.hedgerwow.com/360/dhtml/css-inline-block-layout.php">Item List Grid : Practice with display:inline block across browsers</a>) that I worked on for the next VYC release. It solves the problem with a minimum amount of code in a really semantic way that just makes my web developer brain as happy as can be. Granted the CSS is not what I would call &#8220;pretty&#8221; but it works everywhere and is not impossible to understand, so I&#8217;m not too bothered by it.</p>
<p>So here&#8217;s how it turned out. Be forewarned that I don&#8217;t control what is uploaded here, and as such there might be <strong>NSFW</strong> content on this page!</p>
<p><a title="Uploaded Images" href="http://tivac.com/upload/images/">http://tivac.com/upload/images/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2008/07/23/tweaking-the-image-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zune Backgrounds</title>
		<link>http://patcavit.com/2008/03/01/zune-backgrounds/</link>
		<comments>http://patcavit.com/2008/03/01/zune-backgrounds/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 21:03:56 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[Pretty]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>

		<guid isPermaLink="false">http://patcavit.com/2008/03/01/zune-backgrounds/</guid>
		<description><![CDATA[Uploading lots of images with my new image uploader is fun, so I&#8217;m throwing up all of the backgrounds I&#8217;ve collected for my Zune. They&#8217;re mostly cropped versions of my wallpaper collection, with a few I&#8217;ve found around the Internet scattered here and there.]]></description>
			<content:encoded><![CDATA[<p>Uploading lots of images with my new image uploader is fun, so I&#8217;m throwing up all of the backgrounds I&#8217;ve collected for my Zune.  They&#8217;re mostly cropped versions of my wallpaper collection, with a few I&#8217;ve found around the Internet scattered here and there.</p>
<ul class="image_grid">
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pwwZIsw_whiteringszune.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pwwZIsw_whiteringszune.jpg" alt="whiteringszune.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pPCwuqP_ultimate-strands.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pPCwuqP_ultimate-strands.jpg" alt="Ultimate Strands.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pqQ0gnW_lego-r2-d2.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pqQ0gnW_lego-r2-d2.jpg" alt="LEGO R2-D2.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pZZHO3e_lego-boba-fett.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pZZHO3e_lego-boba-fett.jpg" alt="LEGO Boba Fett.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pG4fXWa_moon-to-earth.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pG4fXWa_moon-to-earth.jpg" alt="moon to earth.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pTUCqvl_organica-grey.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pTUCqvl_organica-grey.jpg" alt="Organica Grey.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/psJVgGC_gow-logo.jpg"><img src="http://tivac.com/upload/images/thumbs/th_psJVgGC_gow-logo.jpg" alt="GOW Logo.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pR349ky_organica-green.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pR349ky_organica-green.jpg" alt="Organica Green.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/p2ZcJ16_atmosphere.jpg"><img src="http://tivac.com/upload/images/thumbs/th_p2ZcJ16_atmosphere.jpg" alt="Atmosphere.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pd4gJbk_earth-space.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pd4gJbk_earth-space.jpg" alt="Earth-Space.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/ptfhOqg_flow-red.jpg"><img src="http://tivac.com/upload/images/thumbs/th_ptfhOqg_flow-red.jpg" alt="Flow Red.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pYm5laR_domo.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pYm5laR_domo.jpg" alt="domo.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/prh4NAr_3805_small.jpg"><img src="http://tivac.com/upload/images/thumbs/th_prh4NAr_3805_small.jpg" alt="3805_small.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/p6qWm4d_logogreyzune.jpg"><img src="http://tivac.com/upload/images/thumbs/th_p6qWm4d_logogreyzune.jpg" alt="logogreyzune.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pgZcqQW_lego-rebel-pilot.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pgZcqQW_lego-rebel-pilot.jpg" alt="LEGO Rebel Pilot.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/ptuHYQ5_blackringszune.jpg"><img src="http://tivac.com/upload/images/thumbs/th_ptuHYQ5_blackringszune.jpg" alt="blackringszune.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pChxxyi_i-love-summer.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pChxxyi_i-love-summer.jpg" alt="I Love Summer.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/p9TB9mU_altered-bliss.jpg"><img src="http://tivac.com/upload/images/thumbs/th_p9TB9mU_altered-bliss.jpg" alt="Altered Bliss.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pMuA38X_brigade-damaged.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pMuA38X_brigade-damaged.jpg" alt="Brigade Damaged.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pygj4ri_qqwl.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pygj4ri_qqwl.jpg" alt="qqwl.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pVl2bWq_lego-darth-vader.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pVl2bWq_lego-darth-vader.jpg" alt="LEGO Darth Vader.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/polstSW_gow-lancer.jpg"><img src="http://tivac.com/upload/images/thumbs/th_polstSW_gow-lancer.jpg" alt="GOW Lancer.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/ptOpAum_lego-stormtrooper.jpg"><img src="http://tivac.com/upload/images/thumbs/th_ptOpAum_lego-stormtrooper.jpg" alt="LEGO Stormtrooper.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pwuBtZd_lego-batman.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pwuBtZd_lego-batman.jpg" alt="LEGO Batman.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pdFpdvn_sound-crushing.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pdFpdvn_sound-crushing.jpg" alt="Sound Crushing.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pstnx9T_halo-3-cg-trailer.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pstnx9T_halo-3-cg-trailer.jpg" alt="Halo 3 CG Trailer.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pwqgMdK_flow-green.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pwqgMdK_flow-green.jpg" alt="Flow Green.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pkV9YUm_nemo-gull.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pkV9YUm_nemo-gull.jpg" alt="Nemo Gull.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pUxm0xN_yarr.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pUxm0xN_yarr.jpg" alt="Yarr.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/plEMk6l_gathering-storm.jpg"><img src="http://tivac.com/upload/images/thumbs/th_plEMk6l_gathering-storm.jpg" alt="Gathering Storm.jpg" /></a></p>
</li>
<li>
<p class="bd"><a href="http://tivac.com/upload/images/pczMjuf_blurry-fireworks.jpg"><img src="http://tivac.com/upload/images/thumbs/th_pczMjuf_blurry-fireworks.jpg" alt="Blurry Fireworks.jpg" /></a></p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2008/03/01/zune-backgrounds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Uploader Implementation</title>
		<link>http://patcavit.com/2008/03/01/yui-uploader-implementation/</link>
		<comments>http://patcavit.com/2008/03/01/yui-uploader-implementation/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 20:26:24 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://patcavit.com/2008/03/01/yui-uploader-implementation/</guid>
		<description><![CDATA[Image Uploading using YUI Uploader Widget A few days ago the YUI team released the latest and greatest version of the YUI Library, YUI 2.5.0. Along with the usual round of bugfixes and speed improvements this release came with several new components. I personally was the most excited about the Uploader component, as the technology [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tivac.com/upload/"><strong>Image Uploading using YUI Uploader Widget</strong></a></p>
<p>A few days ago the YUI team released the latest and greatest version of the YUI Library, <a href="http://yuiblog.com/blog/2008/02/20/yui-250-released/">YUI 2.5.0</a>. Along with the usual round of bugfixes and speed improvements this release came with several new components. I personally was the most excited about the <a href="http://developer.yahoo.com/yui/uploader/" title="YUI Uploader Docs" target="_blank">Uploader</a> component, as the technology that powers it also underpins the upload process on <a href="http://video.yahoo.com" title="Yahoo! Video" target="_blank">Yahoo! Video</a>. I didn&#8217;t write the upload pages but I&#8217;m expected to be able to provide bugfixes and enhancements to those pages, so what better way to learn how they work than from the ground up with the Uploader?</p>
<p>Yes, I know there&#8217;s quite a few better ways. This was the most fun sounding way. What can I say, I like 4 day projects in my spare time instead of just reading the existing code. Besides, I wanted a better understanding of it from a lower level than just how the upload code on VYC works.</p>
<p>As mentioned in the YUI Blog posting about 2.5.0, the Uploader is what not only powers <abbr title="video.yahoo.com">VYC</abbr> uploads but Flickr uploads as well. Flickr exposes more of it due to their allowing of multiple files uploaded at once. That&#8217;s not really very easy to do on VYC due to the <strong>much</strong> larger file sizes being used. Still, it&#8217;s there.  I promise.</p>
<p>I&#8217;ve had a free-for-all, open to anyone image uploader chilling out for quite some time at <a href="http://tivac.com/upload/">http://tivac.com/upload/</a>. I wrote it to solve a problem, namely <a href="http://imageshack.us">the</a> other image uploading services available at the time sucked. It was just a quick little thing, with some basic JS that would hide the form element and create a new one so you could upload more than one file at a time.  When you were done it would barf out thumbs of the images along with some common types of link code for forums and the like.  Nothing fancy at all. Well, the new YUI Uploader seemed pretty much tailor-made to work instead of creating new form elements.</p>
<p>Here&#8217;s a good representation of my thought process while I contemplated redoing the image uploader.</p>
<table border="1" cellpadding="2" cellspacing="0" width="700">
<tr>
<th valign="top" width="155">Method</th>
<th valign="top" width="125">Select multiple files from one dialog?</th>
<th valign="top" width="139">Progress feedback available for updating the UI?</th>
<th valign="top" width="139">Smart enough to not totally hose the browser while uploading?</th>
<th valign="top" width="140">Able to dynamically update UI on completion?</th>
</tr>
<tr>
<td valign="top" width="155">Form + JS</td>
<td valign="top" width="125">No</td>
<td valign="top" width="138">No</td>
<td valign="top" width="139">No</td>
<td valign="top" width="141">Sorta</td>
</tr>
<tr>
<td valign="top" width="154">Uploader + JS</td>
<td valign="top" width="125"><strong>Yes</strong></td>
<td valign="top" width="139"><strong>Yes</strong></td>
<td valign="top" width="139"><strong>Yes</strong></td>
<td valign="top" width="142"><strong>Yes</strong></td>
</tr>
</table>
<p>I think that paints a pretty compelling picture of why I&#8217;d go with the YUI lib over the original solution. Aside from requiring Flash 9 and not working on the latest OSX because Adobe and Apple are feuding, there&#8217;s really no downside.  It&#8217;s provably better in every way. Since this is just a junky little personal project and not something important, I don&#8217;t even provide a fallback HTML form any more.  That&#8217;s just how I roll.</p>
<p>Actual implementation was pretty basic. The YUI documentation is excellent as always.  It more or less started life out as a copy of their <a href="http://developer.yahoo.com/yui/examples/uploader/uploader-simple.html">Simple Upload Example</a> and then I hacked the crap out of it. The flow ended up being something along the lines of the following.</p>
<ol>
<li>Browse for image files.<br />
<a href="http://patcavit.com/wp-content/uploads/2008/03/upload-step-1.png"><img src="http://patcavit.com/wp-content/uploads/2008/03/upload-step-1-thumb.png" style="border-width: 0px" alt="upload step 1" border="0" height="71" width="244" /></a></li>
<li>If you selected one you don&#8217;t actually want to upload, clicking it&#8217;s filename will remove it.<br />
<a href="http://patcavit.com/wp-content/uploads/2008/03/upload-step-2.png"><img src="http://patcavit.com/wp-content/uploads/2008/03/upload-step-2-thumb.png" style="border-width: 0px" alt="upload step 2" border="0" height="112" width="244" /></a></li>
<li>Upload the files, watch all the fun progress bars whiz around.<br />
<a href="http://patcavit.com/wp-content/uploads/2008/03/upload-step-3.png"><img src="http://patcavit.com/wp-content/uploads/2008/03/upload-step-3-thumb.png" style="border-width: 0px" alt="upload step 3" border="0" height="100" width="244" /></a></li>
<li>As each file completes, its filename is replaced with a thumbnail and various different pre-filled link codes for HTML and forums.<br />
<a href="http://patcavit.com/wp-content/uploads/2008/03/upload-step-4.png"><img src="http://patcavit.com/wp-content/uploads/2008/03/upload-step-4-thumb.png" style="border-width: 0px" alt="upload step 4" border="0" height="244" width="218" /></a></li>
<li>You can also hit the Export button to just get a list of the URLs of the uploaded images.<br />
<a href="http://patcavit.com/wp-content/uploads/2008/03/upload-step-5.png"><img src="http://patcavit.com/wp-content/uploads/2008/03/upload-step-5-thumb.png" style="border-width: 0px" alt="upload step 5" border="0" height="70" width="244" /></a></li>
</ol>
<p>It sounds complicated because I&#8217;m an engineer and don&#8217;t explain things well.  The cool nerdy thing about this is how very event-driven it is.  For example, take a look at this code chunk.</p>
<p class="csharpcode">&nbsp;</p>
<pre class="alt"><span class="rem">//certain things can only happen once the SWF is ready to rock</span></pre>
<pre><span class="kwrd">this</span>.uploader.addListener(<span class="str">'contentReady'</span>,   <span class="kwrd">this</span>.swfReady);</pre>
<pre class="alt"><span class="rem">//event handlers</span></pre>
<pre><span class="kwrd">this</span>.uploader.addListener(<span class="str">'fileSelect'</span>,         <span class="kwrd">this</span>.onFileSelect);</pre>
<pre class="alt"><span class="kwrd">this</span>.uploader.addListener(<span class="str">'uploadStart'</span>,        <span class="kwrd">this</span>.onUploadStart);</pre>
<pre><span class="kwrd">this</span>.uploader.addListener(<span class="str">'uploadError'</span>,        <span class="kwrd">this</span>.onUploadError);</pre>
<pre class="alt"><span class="kwrd">this</span>.uploader.addListener(<span class="str">'uploadProgress'</span>,     <span class="kwrd">this</span>.onUploadProgress);</pre>
<pre><span class="kwrd">this</span>.uploader.addListener(<span class="str">'uploadCancel'</span>,       <span class="kwrd">this</span>.onUploadCancel);</pre>
<pre class="alt"><span class="kwrd">this</span>.uploader.addListener(<span class="str">'uploadComplete'</span>,     <span class="kwrd">this</span>.onUploadComplete);</pre>
<pre><span class="kwrd">this</span>.uploader.addListener(<span class="str">'uploadCompleteData'</span>, <span class="kwrd">this</span>.onUploadCompleteData);</pre>
<style type="text/css">.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } </style>
<p>There&#8217;s an event fired by the flash object for pretty much everything you could want.  The only event I found myself wishing it supported was a &#8220;allUploadsComplete&#8221; method.  As it was I had to create a cache of all the file ids being uploaded, and in my handler for uploadComplete I would remove each id from the cache.  If there&#8217;s no more files left to upload, hey presto we&#8217;re done! A little roundabout, especially when having to watch out for files that were selected and then removed.</p>
<p>The other fun thing I decided upon was that instead of using innerHTML and getting back big chunks of HTML from the server (wrapped in JSON, of course) I&#8217;d instead use skeleton structures hidden in the DOM.  A quick</p>
<pre class="csharpcode">YUD.get(<span class="str">'upload_skeleton'</span>).cloneNode(<span class="kwrd">true</span>);</pre>
<style type="text/css">.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } </style>
<p>and you&#8217;ve got yourself a nice chunk of HTML just waiting for some delicious data to be inserted.  The actual insertion is pretty boring DOM traversals, but by using a skeleton as the base it avoids heavy node creation/appending or a massive innerHTML dump.  The page&#8217;s DOM is a little heavier because it contains these stubs, but there&#8217;s only two of them and page weight isn&#8217;t a big concern for this project.</p>
<p>The progress meters are basically a total ripoff of Flickr, I feel a little bad about it but I really liked their approach of using a background image and just changing the x offset each time uploadProgress was called. It&#8217;s so simple and to the point that I didn&#8217;t see any reason to make it more complicated.</p>
<p>So that all works fine, but I was worried that if I didn&#8217;t copy the URLs correctly right away the images would be lost forever. That meant that I had to write a little PHP script that would output linked thumbs of all the images that had been uploaded.  Since this is a totally unrestricted image uploader there&#8217;s been a few instances of people uploading porn and the like. I&#8217;d rather not deal with that, so there&#8217;s a little delete script as well. It&#8217;s protected by a .htaccess/.htpasswd basic auth setup.  Nothing fancy, but it keeps other people from being able to delete my images.</p>
<p><a href="http://patcavit.com/wp-content/uploads/2008/03/image-browser.png"><img src="http://patcavit.com/wp-content/uploads/2008/03/image-browser-thumb.png" style="border-width: 0px" alt="image browser" border="0" height="266" width="314" /></a></p>
<p>The images are laid out in a big floating grid using <a href="http://hedgerwow.com">Hedger&#8217;s</a> very awesome work on getting display: inline-block to work across browsers. <a href="http://www.hedgerwow.com/360/dhtml/css-inline-block-layout.php">Item List Grid : Practice with display:inline block across browsers</a>. It&#8217;s a technique we also used extensively on <abbr title="video.yahoo.com">VYC</abbr> so it was the first thing that came to mind when just floating a bunch of images that weren&#8217;t the same height went all crazy.</p>
<p>Oh, right.  All the icons are the insanely awesome work of <a href="http://famfamfam.com/">Mark James</a>, specifically his <a href="http://famfamfam.com/lab/icons/silk/">Silk</a> set of icons. I&#8217;m sure you&#8217;ve seen them used pretty much everywhere.  There&#8217;s a good reason for that, they rock.</p>
<p>I&#8217;ve zipped up the source for anyone who wants it, it&#8217;s all pretty well-commented.  You will have to handle the file permissions yourself though. <strong>UPDATE: </strong><a href="http://sitzmar.com">Sitzmar</a> wanted me to point out that all the paths are hard-coded for my uploader.  He says I should be ashamed, I say he should shut up.  Also I don&#8217;t think I included the .htpasswd (obviously) or the .htaccess.  Those are easily set up, a quick search on the internet will answer all questions.</p>
<p><a href="http://tivac.com/upload/upload.zip">upload.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2008/03/01/yui-uploader-implementation/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Implementation Showdown: Y! BBAuth vs OpenID</title>
		<link>http://patcavit.com/2007/03/01/implementation-showdown-y-bbauth-vs-openid/</link>
		<comments>http://patcavit.com/2007/03/01/implementation-showdown-y-bbauth-vs-openid/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 01:45:17 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Yahoo!]]></category>

		<guid isPermaLink="false">http://patcavit.com/2007/03/01/implementation-showdown-y-bbauth-vs-openid/</guid>
		<description><![CDATA[As some of you may have noticed I was really excited when Yahoo! released their BBAuth tool right before their Open HackDay (My post about BBAuth). It seemed like a great idea, as tons of people already have Y! accounts. Little did I know that BBAuth wasn&#8217;t really a good solution as a single sign-on [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you may have noticed I was really excited when Yahoo! released their <a href="http://developer.yahoo.com/auth/">BBAuth</a> tool right before their <a href="http://hackday.org/">Open HackDay</a> (<a href="http://patcavit.com/2007/01/10/yahoo-bbauth-tinkering/">My post about BBAuth</a>).  It seemed like a great idea, as tons of people already have Y! accounts.  Little did I know that BBAuth wasn&#8217;t really a good solution as a single sign-on utility.  It sounds silly for me to say that especially when the <a href="http://developer.yahoo.com/auth/">Official BBAuth Site</a> says &#8220;BBAuth also offers a Single Sign-On (SSO) facility so that existing Yahoo! users can use your services without having to complete yet another registration process.&#8221;  In the real world when I implemented Y! BBAuth as a SSO provider I ran into some issues.</p>
<p>First though, a quick overview of how BBAuth works.  You set up an entry in the BBAuth DB for whatever site/webapp you&#8217;re going to use it with, providing some general info like contact details and the endpoint for when a user has successfully logged-in.  Once that&#8217;s done you get a shared secret and an application ID.  These are used in all future calls to hash info so that it&#8217;s reasonably secure and can&#8217;t be easily snooped along the wire.  A special login URL is crafted that points the user to Y!&#8217;s login page, and once they enter their Y! credentials they are asked to give permission to whatever site for the info that has been requested.  Once they agree they are redirected back to the site along with some encrypted info depending on what the site had asked for.</p>
<p>BBAuth works just fine, but even if you don&#8217;t ask for any Y! info your users still have to go through and agree to allow the site to use their info.  My problem is then that <strong>I don&#8217;t want the user&#8217;s info</strong>.  When I set up my site to use BBAuth I even told Y! that I didn&#8217;t want to use any info.  All I want is Yahoo!&#8217;s promise that the user is a real Y! user and some sort of unique hash that my system can use.  I&#8217;ll get the info I need for whatever app I&#8217;m running at the time, but none of what I do would be asking for Y! Photos info.  I&#8217;m not saving any login credentials via cookies or anything, I just want a simple login mechanism that I don&#8217;t have to maintain.  Clicking through one page doesn&#8217;t sound so bad until you realize that every time the user logs in they have to go through it.  That&#8217;s pretty annoying and makes the jump to a Y! login page even more jarring.</p>
<p>There&#8217;s a post on the ydn-auth group by Jeremy Zawodny (<a href="http://tech.groups.yahoo.com/group/ydn-auth/message/43">Jeremy&#8217;s Post</a>) that addresses this issue and says that this functionality is apparently a special case for BBAuth.  Seems a little odd but I suppose that they were more concentrated on the usage cases for sharing a user&#8217;s Y! info with a 3rd party site.  So they know about it and are looking into it, but until then I can&#8217;t really say I&#8217;m pleased with the actual implementation of BBAuth as a SSO provider.</p>
<p>After implementing BBAuth and being disappointed with the SSO performance, I began looking into other solutions.  I really didn&#8217;t want to require users to sign up for yet another account because everyone hates that.  It seems like there&#8217;s been a lot of buzz lately around <a href="http://openid.net/">OpenID</a> (<a href="http://technorati.com/search/openid">Technorati stats for &#8220;OpenID&#8221;</a>).  I figured I should at least give it a shot considering the large surge of interest behind it.  First I had to figure out how OpenID actually worked.</p>
<p>Short Version: instead of a login that is some clever play on your name (Tivac lol) or something you identify yourself using a URI that links back to an identity provider.  The identity provider stores your details and provides password authentication, so that when you visit an OpenID-enabled site you enter in your identifying URI and get bumped to your identity provider.  You log in there, specify what details the site should be able to see from your profile, and then say &#8220;Ok&#8221; and get sent back. Note that this is what it&#8217;s like using <a href="https://www.myopenid.com/">MyOpenID.com</a> because I was too lazy to set up my own half-assed identity provider.</p>
<p>So, how does OpenID work as a SSO provider?  From a user&#8217;s point of view it&#8217;s pretty dead-simple.  Looking at it as a developer adding it to an existing property proved to be considerably more work than I expected.  I used the <a href="http://www.openidenabled.com/openid/libraries/php">JanRain OpenID Library</a> for PHP when working to get OpenID logins enabled on my testing site.  Now I know the title of the article doesn&#8217;t say I&#8217;m comparing the libraries I used for each, but it&#8217;s still interesting to look at the differing amounts of code required for BBAuth and OpenID implementation in a fairly typical hosting environment.</p>
<p>The first thing that struck me as kind of odd was that I needed to move two folders totaling 33 files onto my shared path.  I had forgotten that OpenID uses <a href="http://en.wikipedia.org/wiki/Yadis">Yadis</a> (Wikipedia page linked because the homepage at <a href="http://yadis.org">yadis.org</a> has been vandalized) as part of the protocol.  I didn&#8217;t realize that I&#8217;d need to be installing classes to support Yadis as well as OpenID.  Once I had gotten all those files copied into the proper places and confirmed they were on my shared path it was time to look at the examples provided.</p>
<p>OpenID provides a decent example setup for both consumer and server roles, where consumer is providing the SSO login and server is actually running your own identity server.  I only want to run a consumer right now, so I used just those files.  After getting the form setup and trying it out I discovered that my PHP install has no big integer math library installed.  This necessitates running in &#8220;Dumb Mode&#8221; which according to the documentation means my login form is more susceptible to relay attacks.  Great.</p>
<p>After defining a new constant telling OpenID to run in dumb mode I was able to be successfully bounced out to my Identity Provider, sign in, and be bounced back to my site.</p>
<p>Avoiding any in-depth analysis of the security between the two as I&#8217;m not qualified to comment, which did I prefer implementing and using? That&#8217;s not actually an easy question to answer.  BBAuth was certainly much smaller in terms of code required.  It also has the advantage of using Yahoo!&#8217;s login system, it&#8217;s not exactly scientific but I don&#8217;t know anyone who doesn&#8217;t have a Y! account.  So BBAuth has a huge built-in userbase right there.  Both services require bumping the user out to a 3rd party login page so that&#8217;s a draw.  I knew it was part of how both worked going in and it isn&#8217;t an issue for me in this case.  Implementing OpenID had some bumps but thanks to the distributed nature of the project I don&#8217;t need to go sign my web application up anywhere.  If I want to shift around page names I don&#8217;t have to remember to go update any entries in a Y! database anywhere.  Any OpenID Identity Provider worth their salt will also provide a mechanism to say &#8220;Always Allow this site&#8221; which is something that BBAuth currently lacks.</p>
<p>In the end I wasn&#8217;t able to come up with a conclusive win on either one.  BBAuth has that annoying extra page every visit but tons of people have Y! accounts.  Implementation was also pretty quick and easy.  OpenID took more work but with a decent Identity Provider will only require one page not on my site.  It&#8217;s also got the whole distributed thing going for it.  As it stands now I&#8217;ve implemented both and users can just choose their favorite.  I&#8217;d prefer to just offer one but I don&#8217;t think there is one that offers a compelling enough featureset over the other to go with a single one yet. Going with both gives me flexibility and an excuse to keep playing with both of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2007/03/01/implementation-showdown-y-bbauth-vs-openid/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Yahoo! BBAuth Tinkering</title>
		<link>http://patcavit.com/2007/01/10/yahoo-bbauth-tinkering/</link>
		<comments>http://patcavit.com/2007/01/10/yahoo-bbauth-tinkering/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 21:04:41 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://patcavit.com/2007/01/10/yahoo-bbauth-tinkering/</guid>
		<description><![CDATA[I&#8217;ve been putting in a bit of time with the Yahoo! BBAuth stuff lately and while I don&#8217;t have it working quite like I want yet it&#8217;s pretty handy. I was previously using a homebrew user authentication setup for some of my tivac.com projects and while it wasn&#8217;t bad there was definitely some polish lacking. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been putting in a bit of time with the <a href="http://developer.yahoo.com/auth/">Yahoo! BBAuth</a> stuff lately and while I don&#8217;t have it working quite like I want yet it&#8217;s pretty handy.  I was previously using a homebrew user authentication setup for some of my tivac.com projects and while it wasn&#8217;t bad there was definitely some polish lacking.  We&#8217;ll see if BBAuth solves my problem the way I want or if I&#8217;ll just have to put in some more work on my own system.</p>
<p>ResTek work is picking up some again finally, hooray for that!</p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2007/01/10/yahoo-bbauth-tinkering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uploadprogress_get_info() in PHP 5.2</title>
		<link>http://patcavit.com/2006/10/25/uploadprogress_get_info-in-php-52/</link>
		<comments>http://patcavit.com/2006/10/25/uploadprogress_get_info-in-php-52/#comments</comments>
		<pubDate>Wed, 25 Oct 2006 10:36:59 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://patcavit.com/2006/10/25/uploadprogress_get_info-in-php-52/</guid>
		<description><![CDATA[Bitflux Blog :: Upload Progress Meter extension for PHP 5.2 This is pretty awesome, I&#8217;m all for not having to use the hacks that are out there currently to get a upload bar for users. Not sure where I&#8217;d ever use it at Restek but it&#8217;ll be just perfect at my Image Hosting. I am [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.bitflux.ch/archive/2006/09/28/upload-progress-meter-extension-for-php-5-2.html">Bitflux Blog :: Upload Progress Meter extension for PHP 5.2</a></p>
<p>This is pretty awesome, I&#8217;m all for not having to use the hacks that are out there currently to get a upload bar for users.  Not sure where I&#8217;d ever use it at Restek but it&#8217;ll be just perfect at my <a href="http://tivac.com/upload/">Image Hosting</a>.</p>
<p>I am still up because I just finished a homework assignment.  Ugh.</p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2006/10/25/uploadprogress_get_info-in-php-52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fall Plotting</title>
		<link>http://patcavit.com/2006/08/30/fall-plotting/</link>
		<comments>http://patcavit.com/2006/08/30/fall-plotting/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 16:49:28 +0000</pubDate>
		<dc:creator>Pat Cavit</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[Tivac.com Projects]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://patcavit.com/2006/08/30/fall-plotting/</guid>
		<description><![CDATA[I&#8217;ve been spending a lot of my time lately working with the CS department to try and hurry the hell up and graduate. I&#8217;ve been too lax in the past about not persuing the classes I needed and it has really started to bite me in the ass. I&#8217;m already taking one independent study this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending a lot of my time lately working with the CS department to try and hurry the hell up and graduate.  I&#8217;ve been too lax in the past about not persuing the classes I needed and it has really started to bite me in the ass.  I&#8217;m already taking one independent study this fall since the class is only offered next spring otherwise.  This fall is going to be pretty busy, as I&#8217;ll be taking a full credit load while trying to get caught up on all the mayhem the other ResTek <abbr title="Web Application Developer">WAD</abbr>s have been causing in my absence.  Judging by the CVS checkins I&#8217;ll be totally lost, should be a good time.</p>
<p>I haven&#8217;t had any brainstorms yet as to what I&#8217;m going to do this fall, I&#8217;ll probably substantially reduce my time spent on ResTek stuff to allow my replacement more work.  Maybe I&#8217;ll take what I&#8217;ve learned at Y! and try and give Surveys an extra polishing.  It could certainly use it based on what I remember of the code.  Getting the YUI libraries integrated into all of our JS is also going to be a good challenge.  While most of what we had was cross-browser, it was more by happenstance than design.  Using YUI really helps with that since the libraries take care of all the nasy gotchas without needing any extra code.</p>
<p>Also holy crap there&#8217;s two more users now than I had before.  Too bad one doesn&#8217;t even have any filters set up, oh well.</p>
]]></content:encoded>
			<wfw:commentRss>http://patcavit.com/2006/08/30/fall-plotting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

