<?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"
	>

<channel>
	<title>ShortShip</title>
	<atom:link href="http://www.shortship.com/articles/feed" rel="self" type="application/rss+xml" />
	<link>http://www.shortship.com/articles</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sun, 29 May 2011 22:25:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>The reason Netflix for Android is only supported on a handful of devices</title>
		<link>http://www.shortship.com/articles/rants/95/the-reason-netflix-for-android-is-only-supported-on-a-handful-of-devices</link>
		<comments>http://www.shortship.com/articles/rants/95/the-reason-netflix-for-android-is-only-supported-on-a-handful-of-devices#comments</comments>
		<pubDate>Thu, 26 May 2011 00:43:58 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Rants]]></category>

		<category><![CDATA[android]]></category>

		<category><![CDATA[fragmentation]]></category>

		<category><![CDATA[media]]></category>

		<category><![CDATA[netflix]]></category>

		<category><![CDATA[opencore]]></category>

		<category><![CDATA[stagefright]]></category>

		<category><![CDATA[streaming]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=95</guid>
		<description><![CDATA[There is another aspect of Android fragmentation that I have not seen covered. As many Android users may have noticed, the Netflix Android app is only supported on a handful of devices. The reason for this is that Google shipped a new media framework in Android 2.2 called Stagefright. The main feature of Stagefright is [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>There is another aspect of Android fragmentation that I have not seen covered. As many Android users may have noticed, the Netflix Android app is only supported on a handful of devices. The reason for this is that Google shipped a new media framework in Android 2.2 called <a href="http://developer.android.com/sdk/android-2.2-highlights.html" target="_blank">Stagefright</a>. The main feature of Stagefright is support for HTTP progressive streaming. The problem is, several manufactures (Motorola, Samsung*) have either left out this new media framework or have disabled it in their 2.2 builds. Instead, they continue to use the old media framework (OpenCore). Also, as far as I can tell, there is no easy way to check if the device is using Stagefright or OpenCore. The only solutions I found involve horrendous <a href="http://stackoverflow.com/questions/4579885/determine-opencore-or-stagefright-framework-for-mediaplayer" target="_blank">hacks</a> that only work on some phones.</p>
<p>My belief is that Netflix waited this long to ship the Android app not necessarily because of any sort of DRM issue as originally reported but because they had to extensively test the app with every Android phone capable of running 2.2 or higher. In the end, they selected just five phones, which were most likely chosen on the basis of following criteria: the media framework used by the device (Stagefright being required) and minimum hardware specs.</p>
<p>From a developer&#8217;s perspective, this issue is worse than version fragmentation. It&#8217;s challenging enough to accommodate the plethora of screen sizes available but not being able to assume that the underlying API implementations are the same in each version of the OS is in my opinion, unacceptable.</p>
<p>UPDATE: Netflix has since released an update that adds support for additional devices; one of them being the original Motorola Droid. According to Wikipedia, the original Droid has received three updates since receiving Android 2.2. I have not been able to confirm this but I believe the original Droid may be one of the few Motorola phones that uses Stagefright and that it may have been enabled in one of the aforementioned updates.</p>
<p>* The Samsung Nexus S is an exception here because it&#8217;s an official Google phone and therefore runs stock 2.3 / Gingerbread.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/rants/95/the-reason-netflix-for-android-is-only-supported-on-a-handful-of-devices/feed</wfw:commentRss>
		</item>
		<item>
		<title>When JavaFX + Web Start might be a better choice than Flex + AIR</title>
		<link>http://www.shortship.com/articles/opinion/90/when-javafx-web-start-might-be-a-better-choice-than-flex-air</link>
		<comments>http://www.shortship.com/articles/opinion/90/when-javafx-web-start-might-be-a-better-choice-than-flex-air#comments</comments>
		<pubDate>Mon, 26 Jan 2009 01:42:42 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Opinion]]></category>

		<category><![CDATA[AIR]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[JavaFX]]></category>

		<category><![CDATA[Web Start]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=90</guid>
		<description><![CDATA[Over the next several months I will be working on an application currently written in Flex and deployed with AIR. I&#8217;m fairly impressed with what the application is able to do now but some of the planned features are currently impossible to implement in Flex given the limitations of the AIR 1.5 runtime. One thing [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Over the next several months I will be working on an application currently written in Flex and deployed with AIR. I&#8217;m fairly impressed with what the application is able to do now but some of the planned features are currently impossible to implement in Flex given the limitations of the AIR 1.5 runtime. One thing we&#8217;ll need specifically is the ability to launch a native application from our AIR application. The amount of extra work we&#8217;ll have to do to make this possible is immense. Because we don&#8217;t want users to require any additional runtimes (ie Java), we&#8217;re forced to write a &#8220;proxy&#8221; application in C/C++ that the AIR application can communicate with to perform these unsupported operations. So, instead of having to maintain one application, we&#8217;ll have to maintain at least two (the proxy application will vary with each OS we support). In addition, we&#8217;ll need to provide the ability to update this proxy application as well as allow users to remove it. </p>
<p>All of this had me wondering if JavaFX would have been a better choice. Combined with Web Start it has all of the same functionalities we currently have with Flex and AIR but there wouldn&#8217;t be any need for a proxy application since a signed Java application has full access to the system. In addition, JavaFX does have several free tools (Netbeans, plug-ins for Photoshop and Illustrator, ect). </p>
<p>Of course, there are issues with using JavaFX. For one, not many developers know Java FX Script but many developers have at least some experience with Flex. Secondly, Flex and AIR are more mature than JavaFX. Flash is also much more prominent than Java and the process of installing AIR from a website is pretty seamless. On the other hand, JavaFX on Windows requires Java 6 and the process of updating to Java 6 is less than ideal.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/opinion/90/when-javafx-web-start-might-be-a-better-choice-than-flex-air/feed</wfw:commentRss>
		</item>
		<item>
		<title>JExcelAPI and Garbage Collection</title>
		<link>http://www.shortship.com/articles/tools/82/jexcelapi-and-garbage-collection</link>
		<comments>http://www.shortship.com/articles/tools/82/jexcelapi-and-garbage-collection#comments</comments>
		<pubDate>Sat, 13 Dec 2008 23:31:41 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Tips &amp; Tricks]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[garbage collection]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=82</guid>
		<description><![CDATA[One of the Java based reporting applications I currently work on has an Excel export feature. For this application I chose the JExcelApi library because I had read that it performs slightly better than the other open source alternatives and that its API was less verbose and generally easier to use. In my dev environment [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>One of the Java based reporting applications I currently work on has an Excel export feature. For this application I chose the <a href="http://jexcelapi.sourceforge.net/">JExcelApi</a> library because I had read that it performs slightly better than the other open source alternatives and that its API was less verbose and generally easier to use. In my dev environment I had no issues with performance but in the staging and production environments, the Excel export was painfully slow. It would sometimes take up to 30 seconds to generate a single page Excel report. After running the code through a profiler I determined there were no bottlenecks in the code nor in the JExcelAPI library itself. The only significant difference between my dev environment and the staging and production environments was that the application in the later two environments would load the full dataset whereas my dev environment loaded a significantly smaller dataset. This meant a difference in heap sizes of 100 MB in dev vs ~12GB in staging/production (don&#8217;t ask). </p>
<p>I theorized that garbage collection was the culprit here. However, I was reluctant to believe this since the Excel reports being generated were fairly small and it didn&#8217;t seem to me that a single request would be enough to trigger a full garbage collection given the maximum amount of memory the application was allowed to use (16 GB).  </p>
<p>Using <a href="https://visualvm.dev.java.net/">VisualVM</a> I monitored my local dev tomcat instance in attempt to prove my theory.</p>
<p><a href="http://www.shortship.com/articles/wp-content/uploads/2008/12/jexcelapigc.png"><img class="aligncenter size-full wp-image-83" title="jexcelapigc" src="http://www.shortship.com/articles/wp-content/uploads/2008/12/jexcelapigc.png" alt="" width="500" height="299" /></a></p>
<p>As you can see above, the two green arrows show two peaks in CPU utilization and Garbage Collection Activity. These two peaks appeared when I used the Excel export option in the application. At this point it seemed my theory was correct but to be sure I used the JVM option “-verbose:gc” to log GC activity in the staging environment. Sure enough, each time I used Excel export, the JVM would perform a full garbage collection. </p>
<p>After much research I finally discovered what was going on. According to the JavaDoc for the WorkbookSettings class:</p>
<p style="padding-left: 30px;"><span style="font-family: 'Courier New'; line-height: 18px; white-space: pre;"><span style="font-family: 'Lucida Grande'; line-height: 19px; white-space: normal;">“</span><span style="font-family: 'Lucida Grande'; line-height: 19px; white-space: normal;">/**</span></span></p>
<p style="padding-left: 30px;">  * Flag to indicate whether the system hint garbage collection</p>
<p style="padding-left: 30px;">  * is enabled or not.</p>
<p style="padding-left: 30px;">  * As a rule of thumb, it is desirable to enable garbage collection</p>
<p style="padding-left: 30px;">  * when reading large spreadsheets from a batch process or from the</p>
<p style="padding-left: 30px;">  * command line, but better to deactivate the feature when reading</p>
<p style="padding-left: 30px;">  * large spreadsheets within a WAS, as the calls to System.gc() not</p>
<p style="padding-left: 30px;">  * only garbage collect the junk in JExcelApi, but also in the</p>
<p style="padding-left: 30px;">  * webservers JVM and can cause significant slowdown</p>
<p style="padding-left: 30px;">  * GC deactivated using -Djxl.nogc=true on the JVM command line</p>
<p style="padding-left: 30px;">  * Activated by default or by using -Djxl.nogc=false on the JVM command line</p>
<p style="padding-left: 30px;">  */</p>
<p style="padding-left: 30px;">private boolean gcDisabled;”</p>
<p>So, JExcelApi by default will ask the JVM to perform a full garbage collection after certain operations. As the JavaDoc recommends, I added “-Djxl.nogc=true” to my JVM options and the delays went away. I have not seen this mentioned anywhere on JExcelApi&#8217;s website so If you face a similar problem with performance, try enabling this flag.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/tools/82/jexcelapi-and-garbage-collection/feed</wfw:commentRss>
		</item>
		<item>
		<title>Avoiding potential pitfalls when using JarJar</title>
		<link>http://www.shortship.com/articles/tips-tricks/18/avoiding-potential-pitfalls-when-using-jarjar</link>
		<comments>http://www.shortship.com/articles/tips-tricks/18/avoiding-potential-pitfalls-when-using-jarjar#comments</comments>
		<pubDate>Tue, 09 Dec 2008 02:17:00 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Tips &amp; Tricks]]></category>

		<category><![CDATA[jarjar]]></category>

		<category><![CDATA[log4j]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=18</guid>
		<description><![CDATA[When it comes to distributing Java applications to end users there are a few different routes one can take.
One common approach for me is to use JarJar to create a single jar file from the application&#8217;s jar(s) and its dependencies.
I recently ran into a familiar log4j warning message when trying to run an application from [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0in;">When it comes to distributing Java applications to end users there are a few different routes one can take.</p>
<p style="margin-bottom: 0in;">One common approach for me is to use <a title="JarJar" href="http://code.google.com/p/jarjar/" target="_blank">JarJar</a> to create a single jar file from the application&#8217;s jar(s) and its dependencies.</p>
<p style="margin-bottom: 0in;">I recently ran into a familiar log4j warning message when trying to run an application from a single combined jar.</p>
<blockquote>
<p style="margin-bottom: 0in;">log4j:WARN No appenders could be found for logger (org.apache.commons.configuration.ConfigurationUtils). log4j:WARN Please initialize the log4j system properly.</p>
</blockquote>
<p style="margin-bottom: 0in;">I was confused by this because I was certain that a log4j.properties file was bundled in the application jar. After opening the jar file as a zip file, I quickly realized what the problem was.</p>
<p><a href="http://www.shortship.com/articles/wp-content/uploads/2008/12/jarjar.png"><img class="aligncenter size-full wp-image-19" title="jarjar" src="http://www.shortship.com/articles/wp-content/uploads/2008/12/jarjar.png" alt="" width="500" height="263" /></a></p>
<p style="margin-bottom: 0in;">As you can see above, the problem is that two other jars also bundle a log4j.properties at the same base path. As we all know, only one file with the same name can exist at the same path. So, when the JRE loads the combined jar, only one log4j.properties file is recognized.</p>
<p style="margin-bottom: 0in;">This sort of issue can come up in many different situations and something you should keep in mind when using JarJar. Another example from the same jar is shown below.</p>
<p><a href="http://www.shortship.com/articles/wp-content/uploads/2008/12/jajar2.png"><img class="aligncenter size-full wp-image-20" title="jajar2" src="http://www.shortship.com/articles/wp-content/uploads/2008/12/jajar2.png" alt="" width="500" height="304" /></a></p>
<p style="margin-bottom: 0in;">The quick and dirty solution was to manually combine the three log4j.properties files into one and replace the three log4j.properties files in the archive with the single combined properties file. This is hardly an ideal solution and something I will eventually need to revisit.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/tips-tricks/18/avoiding-potential-pitfalls-when-using-jarjar/feed</wfw:commentRss>
		</item>
		<item>
		<title>Post Onload Download for better user loadtime</title>
		<link>http://www.shortship.com/articles/web-development/13/post-onload-download-for-better-user-loadtime</link>
		<comments>http://www.shortship.com/articles/web-development/13/post-onload-download-for-better-user-loadtime#comments</comments>
		<pubDate>Tue, 02 Dec 2008 02:26:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=13</guid>
		<description><![CDATA[Weee, well this is a fun one. It's a method for ensuring that your users get the best response time possible, particularly on their first time to your page (Which in most cases, is most of your traffic). It will increase your bandwith usage, but overall, should lead to a better first impression to users.
The [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Weee, well this is a fun one. It's a method for ensuring that your users get the best response time possible, particularly on their first time to your page (Which in most cases, is most of your traffic). It will increase your bandwith usage, but overall, should lead to a better first impression to users.</p>
<p>The user will be given an embedded copy of JS/CSS files in the html page when they first come to your page. After the page loads, in the background, the cachable JS/CSS files will be loaded, and on subsequent pageloads (and in the future) cached versions will be used.</p>
<p>Follow along as we walk through a full example...<br />
<img class="mce_plugin_wordpress_more" title="More..." src="http://www.artofscaling.com/article/wp-includes/js/tinymce/themes/advanced/images/spacer.gif" alt="More..." width="100%" height="10" /></p>
<p>Yahoo notes that :</p>
<blockquote><p>"For front pages that are typically the first of many page views, there are techniques that leverage the reduction of HTTP requests that inlining provides, as well as the caching benefits achieved through using external files. One such technique is to inline JavaScript and CSS in the front page, but dynamically download the external files after the page has finished loading. Subsequent pages would reference the external files that should already be in the browser's cache."</p></blockquote>
<p>This brings up an interesting idea, that if a user has arrived without a cached version of the file in their cache, that we can inline the stylesheets and JS into one HTML document to reduce HTTP GETs. Additionally, after the page is loaded, instruct the browser to then get the inlined files and cache them at that point. The GETs get delayed until after the page is loaded, so it does not remove the need for them (it also increases bandwidth on your part as the user gets them embedded in the page, and then gets them again to cache them for further page loads). However, this can increase the page load time.<br />
Yahoo's mentioned strategy works well for them, as I would bet most of their traffic arrives via a main landing page, but what about all other pages? Most of my traffic arrives via search results referrals. Can we still make this work?<br />
<strong>So, how would you go about doing this?</strong><br />
How do we know if the user has the object in their cache? Well, the easiest way would be to set a cookie when the user has downloaded the information, and setting a lifetime equal to that of the expiration of the data. True, if a user clears his cache or his cookies, then there will be a mismatch, but in both cases, the user will not be left in the dark.<br />
If the user clears his cookies, but has files in cache, then he will get the inlined files, and the post onload download will just result in not redownloading them as they will be cached already. If the user clears his browser cache, but not cookies, then the page will just reference the CSS/JS externally and the user will download them fresh without the benefit of caching.<br />
Let's run through it in PHP, and note that it can be adapted to other languages.<br />
We will create a method to check for a cookie and either embed the CSS/JS or put the external files.</p>
<div class="syntax_hilite">
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> embedStyle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cookie</span>,<span style="color:#0000FF;">$jsFiles</span>,<span style="color:#0000FF;">$cssFiles</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cookie</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$jsFiles</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$jsFile</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;script src=&quot;http://www.artofscaling.com/article/wp-admin/%5C%27;%0A%20%20%20%20%20%20echo%20;%0A%20%20%20%20%20%20echo%20%5C%27&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cssFiles</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$cssFile</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#FF9933; font-style:italic;">//embed the actual files into the document</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&amp;lt;! <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp;foreach( as ) {&nbsp; &nbsp; &nbsp; &nbsp;require();&nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>//&amp;gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">// --&gt;&lt;/script&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;"><span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp;foreach( as ) {&nbsp; &nbsp; &nbsp; &nbsp;require();&nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//and add post onload download script</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&amp;lt;! &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; window.onload=function(){ &nbsp;var req;<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&amp;lt;/p&amp;gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&amp;lt;p&amp;gt;foreach( as ) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>if (window.XMLHttpRequest) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req = new XMLHttpRequest();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>req.open(&quot;GET&quot;, &quot;<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>..<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>&quot;, true);<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>req.send(null);<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; foreach( as ) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>if (window.XMLHttpRequest) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req = new XMLHttpRequest();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>req.open(&quot;GET&quot;, &quot;<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>..<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>&quot;, true);<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>req.send(null);<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&amp;lt;/p&amp;gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&amp;lt;p&amp;gt;echo <span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\'</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;document.cookie = &quot;userCached=true&quot;;&nbsp; &nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp; &nbsp;//&amp;gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">// --&gt;&lt;/script&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>To call it, just add</p>
<div class="syntax_hilite">
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">embedStyle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_COOKIE</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"userCached"</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"script.js"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"style.css"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
to your header.</p>
<p>As you can see, this can do most of the heavy lifting for you. There are some downsides to this of course. If you cache static versions of your pages (like WP-super-cache for example), then this method will not work without modification.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/web-development/13/post-onload-download-for-better-user-loadtime/feed</wfw:commentRss>
		</item>
		<item>
		<title>Welcome to the new ShortShip.com</title>
		<link>http://www.shortship.com/articles/featured/10/welcome-to-the-new-shortshipcom</link>
		<comments>http://www.shortship.com/articles/featured/10/welcome-to-the-new-shortshipcom#comments</comments>
		<pubDate>Tue, 02 Dec 2008 02:16:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=10</guid>
		<description><![CDATA[After not making much use of this site except as a home for my firefox extension, I've decided to move in a different direction.  Coming soon, you can expect tutorials, open source projects and bunches of other goodies. Anyway, forgive the mess as we clean up the site, and migrate to our new design (current [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>After not making much use of this site except as a home for my firefox extension, I've decided to move in a different direction.  Coming soon, you can expect tutorials, open source projects and bunches of other goodies. Anyway, forgive the mess as we clean up the site, and migrate to our new design (current design is temporary while we work out the kinks)</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/featured/10/welcome-to-the-new-shortshipcom/feed</wfw:commentRss>
		</item>
		<item>
		<title>Laptop Power Consumption</title>
		<link>http://www.shortship.com/articles/featured/16/laptop-power-consumption</link>
		<comments>http://www.shortship.com/articles/featured/16/laptop-power-consumption#comments</comments>
		<pubDate>Sun, 02 Nov 2008 02:28:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Featured]]></category>

		<category><![CDATA[Green Power]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=16</guid>
		<description><![CDATA[In this article we compare the power consumption of various laptops as well as look at the notion of undervolting and its affect on power consumption.  Learn which features take up the most power and how to maximize your battery life on the go!

Laptops have come a long way in the last several years [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>In this article we compare the power consumption of various laptops as well as look at the notion of undervolting and its affect on power consumption.  Learn which features take up the most power and how to maximize your battery life on the go!</p>
<p><span id="more-16"></span><br />
Laptops have come a long way in the last several years in terms of being a full fledged desktop replacement.  However, battery life is one place that they have not made much progress in.  New laptops on the market still get anywhere from 2-5 hours of battery life, which is not much better than they did 5 years ago.  I recently talked to an IBM employee that stated that they were still pushing for longer battery life through lower power CPUs, battery technology and more, but I've heard this before.  Check out this rather dated quote from a few years back.<br />
<quote><br />
Chipmaker Intel, in fact, is so bullish on the matter that it recently moved up a deadline for notebook makers by two years. It's now asking them to produce by 2008 thin and light notebooks that can run for eight hours without the use of additional external batteries, said Mooly Eden, vice president of the company's mobility group.<br />
</quote> - from <a href="http://www.news.com/Get-ready-for-the-9-to-5-notebook/2100-1044_3-5731373.html">news.com</a>, 6/5/05</p>
<p>Sadly, we are really no closer to such stats, but the deadline is upon us.  So, what exactly is eating up all that battery life on laptops?  To figure this out, I bought myself a <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FP3-International-Kill-Electricity-Monitor%2Fdp%2FB00009MDBU%3Fie%3DUTF8%26s%3Delectronics%26qid%3D1201306725%26sr%3D8-1&amp;tag=shortship01-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Kill-a-Watt</a> from Amazon which measures power consumption of powered devices.  I also went online and grabbed some similiar comparisons from other laptops (some missing information from what I measured, but overall mostly complete).</p>
<h3>The Subjects</h3>
<p>I decided to test my aging Acer against my new fancy Sony Vaio UX series UMPC with a solid state drive and ULV Core 2 Solo processor.  While not exactly a fair comparison (15" full laptop versus ultra portable handheld device), it should at least show the full spectrum of power consumption, old to new, big to small.  I was able to find information on the web about some older Powerbooks and an ultraportible dell laptop (with a similiar processor as my Acer).</p>
<h3>Undervolting</h3>
<p>Another matter I wanted to test was undervolting (and underclocking).  This is where you lower the voltage and/or clock speed to lower power consumption.  Just like overclocking, this can result in an unstable system, so there's a bit of trial and error.  I was really curious as to what kind of power gains could be derived (in practice) from undervolting a mobile processor.  Processors for laptops support running at a much lower clockspeed, which allows them, from the factory, to run at a lower voltage.  The processors I tried this with supported 2 running speeds.  The laptop throttles down to the lower clockspeed for normal use, and ramps up when it is needed.<br />
Thankfully, there are programs out there that ease this process, more notably <a href="http://cpu.rightmark.org/products/rmclock.shtml">RMClock</a> and <a href="http://www.diefer.de/speedswitchxp/">Speedswitch XP</a>.  I decided to try RMClock.</p>
<h3>Notes</h3>
<p>The Kill-A-Watt is accurate only within 1W with an error margin of 0.2%.  It isn't perfect, but should be good enough.  All values listed in tables are in Watts.</p>
<h3>Results</h3>
<p>Let's look at some of the measurements.  Note that all measurements in this table are relative to the default state (idle, full brightness, no wifi).</p>
<table>
<tr>
<th>Model</th>
<th>TravelMate 290</th>
<th>VGN-US90PS</th>
<th><a href="http://www.codinghorror.com/blog/archives/000562.html">Inspiron 300M</a></th>
<th><a href="http://www.girr.org/mac_stuff/laptop_power.html">Powerbook G4</a></th>
<th><a href="http://www.girr.org/mac_stuff/laptop_power.html">Powerbook G3</a></th>
</tr>
<tr>
<th>Manufacturer</th>
<td>Acer</td>
<td>Sony</td>
<td>Dell</td>
<td>Apple</td>
<td>Apple</td>
</tr>
<tr>
<th>Screen Size</th>
<td>15</td>
<td>4.5</td>
<td>12</td>
<td>15</td>
<td>12</td>
</tr>
<tr>
<th>CPU</th>
<td>Centrino 1500</td>
<td>Core Solo 1200 ULV</td>
<td>Pentium M 1200</td>
<td>1250 G4</td>
<td>500 G3</td>
</tr>
<tr>
<th>Hard Drive</th>
<td>IDE</td>
<td>Solid State</td>
<td>IDE</td>
<td>IDE</td>
<td>IDE</td>
</tr>
<tr>
<th>idle - full brightness (default)</th>
<td>17</td>
<td>10</td>
<td>15</td>
<td>23.5</td>
<td>15</td>
</tr>
<tr>
<th>min brightness</th>
<td>12.5</td>
<td>8</td>
<td>11</td>
<td>20</td>
<td>11</td>
</tr>
<tr>
<th>screen off</th>
<td>9</td>
<td>7.5</td>
<td>10</td>
<td>18</td>
<td>11</td>
</tr>
<tr>
<th>wifi connected</th>
<td>18</td>
<td>10</td>
<td>16</td>
<td>24.5</td>
<td>15.5</td>
</tr>
<tr>
<th>wifi high usage</th>
<td>21</td>
<td>13</td>
<td>19</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>hard drive off</th>
<td>17</td>
<td>10</td>
<td>14</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>high hard drive use</th>
<td>20</td>
<td>11</td>
<td>18</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>cpu max</th>
<td>34</td>
<td>15</td>
<td>26</td>
<td>40</td>
<td>21</td>
</tr>
<tr>
<th>cpu max (undervolted)</th>
<td>28.5</td>
<td>14</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>cpu throttled</th>
<td>21</td>
<td>12.5</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>cpu throttled (undervolted)</th>
<td>20</td>
<td>12.5</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
</table>
<p>There are several rather interesting things we can draw from the above table, the most notable being just how much the CPU draws at full tilt.   I think it's also important to note that the difference from normal hard drive to solid state, while a noticable difference, pales in comparison to the large values for CPU usage.  Let's compile all these values into per component values, for ease of comparison.</p>
<table>
<tr>
<th>Model</th>
<th>TravelMate 290</th>
<th>VGN-US90PS</th>
<th>Inspiron 300M</th>
<th>Powerbook G4</th>
<th>Powerbook G3</th>
</tr>
<tr>
<th>Sleeping</th>
<td>2</td>
<td>1</td>
<td>1</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<th>Charging</th>
<td>45</td>
<td>10</td>
<td>63</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>full brightness</th>
<td>8</td>
<td>2.5</td>
<td>5</td>
<td>5.5</td>
<td>4</td>
</tr>
<tr>
<th>min brightness</th>
<td>3.5</td>
<td>0.5</td>
<td>1</td>
<td>2</td>
<td>0</td>
</tr>
<tr>
<th>Internal wifi (low)</th>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0.5</td>
</tr>
<tr>
<th>Internal wifi (high)</th>
<td>4</td>
<td>3</td>
<td>4</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>max usage seen</th>
<td>40</td>
<td>16</td>
<td>29</td>
<td>41</td>
<td>24</td>
</tr>
<tr>
<th>CPU (max)</th>
<td>17</td>
<td>5</td>
<td>11</td>
<td>16.5</td>
<td>6</td>
</tr>
<tr>
<th>CPU (throttled)</th>
<td>4</td>
<td>2.5</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>CPU (undervolted)</th>
<td>3</td>
<td>2.5</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>Hard drive usage</th>
<td>3</td>
<td>1</td>
<td>3</td>
<td>-</td>
<td>-</td>
</tr>
</table>
<p>We can see that (at an idle state), reducing the brightness of the screen can save 20%, which is actually quite significant.  Converting from normal hard drive to solid state only ends up saving an extra 5-10% over conventional drives under heavy usage.  I can't see the rationalization for the extra $1000 dollars (for a sizable solid state) for an extra 5% gain. Money would be better invested in a second battery (though the solid state arguably has some performance benefit in some cases).</p>
<p>It is also apparent that there is a large drop in power consumption if we throttle the CPU so that it never goes into the higher (rated) speed.  At high usage, the power savings are between 15-40% (with the ULV showing that it lives up to its name, as it does not appear to be as wasteful at high usage as the centrino).</p>
<p>However, this processor gain is only that high when the computer is at 100% cpu usage, whereas the brightness gain is all the time.  Also, with running at a throttled CPU, the computer will take longer to perform high cpu calculations, so you will lose some productivity.</p>
<p>The following table shows the results of running SuperPI for 1 million places on both computers at both supported speeds on several supported voltages.  600mhz/1500mhz are for the centrino processor and 798/1200mhz are for the core 2 solo.</p>
<table>
<tr>
<th>speed</th>
<th>time</th>
<th>watts</th>
<th>CPU usage</th>
</tr>
<tr>
<th>600 - .956 (default)</th>
<td>2:12</td>
<td>21</td>
<td>4</td>
</tr>
<tr>
<th>600 - .812v</th>
<td>2:12</td>
<td>20.5</td>
<td>3.5</td>
</tr>
<tr>
<th>600 - .780v</th>
<td>2:11</td>
<td>20</td>
<td>3</td>
</tr>
<tr>
<th>1500 - 1.484v (default)</th>
<td>1:09</td>
<td>34</td>
<td>17</td>
</tr>
<tr>
<th>1500 - 1.308</th>
<td>1:10</td>
<td>30</td>
<td>13</td>
</tr>
<tr>
<th>1500 - 1.276v</th>
<td>1:09</td>
<td>28.5</td>
<td>12</td>
</tr>
<tr>
<th>798 - 0.938v (default)</th>
<td>1:14</td>
<td>12.5</td>
<td>2.5</td>
</tr>
<tr>
<th>1200 - 1.000v (default)</th>
<td>0:51</td>
<td>15</td>
<td>5</td>
</tr>
<tr>
<th>1200 - 0.962v</th>
<td>0:51</td>
<td>14</td>
<td>4</td>
</tr>
</table>
<p>As you can see, lowering the voltage did not have any sort of effect on the speed of running the test, however lowering the voltage did affect power consumption by a fair amount.  In the case of the centrino, if you were to run a processor intensive application that utilized 100% of the CPU, it would take roughly twice as long to run, but would take 30% less power, so always throttling your cpu would not make much sense if you are undervolting.  If you are not undervolting, the difference is 40% less power, but 48% more processing time required, which is pretty much a wash.</p>
<p>What I am getting at is if the CPU needs to throttle up to a higher clockspeed, it may make your battery run longer if you prevent it, but the amount of work you will get done will be less over that time.  However, most mobile use does not involve CPU heavy processes, so running at the throttled speed is probably more beneficial for more people if all they do is watch videos and browse the web.</p>
<p>I guess that's about it.  Feel free to post your own results or ask for any clarifications on data or results (or conclusions drawn).</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/featured/16/laptop-power-consumption/feed</wfw:commentRss>
		</item>
		<item>
		<title>Use Any Font On Your Site With sIFR</title>
		<link>http://www.shortship.com/articles/web-development/37/use-any-font-on-your-site-with-sifr</link>
		<comments>http://www.shortship.com/articles/web-development/37/use-any-font-on-your-site-with-sifr#comments</comments>
		<pubDate>Mon, 28 Jan 2008 03:33:18 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[fonts]]></category>

		<category><![CDATA[sIFR]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=37</guid>
		<description><![CDATA[Most blogs/websites whenever they want to have some fancy text for headlines/nav usually resort to using an image. This becomes a burden whenever you want to change things, and isn’t as good for SEO as plain old text. Enter sIFR, a javascript method for using *any* font on a webpage with little to no work. [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Most blogs/websites whenever they want to have some fancy text for headlines/nav usually resort to using an image. This becomes a burden whenever you want to change things, and isn’t as good for SEO as plain old text. Enter sIFR, a javascript method for using *any* font on a webpage with little to no work. And it degrades well! Follow along on a full example.</p>
<p>I’m sure many of you are familiar already with sIFR, but this is for those of you that have not heard of it, or were skeptical about how hard it would be to implement.</p>
<p>Let’s look at what you can do with it. An example page is set up here that shows fonts being used. Theres no images on the page. Turn off JS and see that it still works fine.</p>
<p>First, head down and grab the latest release. Unzip it and make sure the demo html works ok. 2.0.5 is most current, fixing a problem with the latest version of flash.</p>
<p>We need to generate sIFR SWFs which are flash versions of a TTF font. So, choose which fonts you want, open sifr.fla in flash, double click on the big invisible box, select your font, and export it. That’s it.</p>
<p>What, you don’t have a copy of flash? That seems to be what gets most people. Luckily, theres an alternative to using flash. Check out sIFR Maker that converts TTF to sIFR SWF on a windows command line without needing flash.</p>
<p>Now, import the CSS and JS files into the header of your blog/webpage.</p>
<p>Next, in the header, add a JS code block and insert the following lines</p>
<p> </p>
<p style="padding-left: 30px;">sIFR.setup();</p>
<p style="padding-left: 30px;">sIFR.replaceElement(named({sSelector:"{CSS SELECTOR TO SIFR}",</p>
<p style="padding-left: 30px;">sFlashSrc:"{PATH TO sIFR SWF}", sColor:"#333333", sLinkColor:"#333333",</p>
<p style="padding-left: 30px;">sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#333333", nPaddingTop:2,</p>
<p style="padding-left: 30px;">nPaddingBottom:2, sFlashVars:"textalign=left&amp;offsetTop=0"}));</p>
<blockquote><p> </p></blockquote>
<p>You can add as many of the second line as you want to cover all your CSS selectors or different fonts you may wish to use. Also feel free to edit any of the above parameters to suit your design (color, etc).  Most of them are optional </p>
<p>You can read a more in depth tutorial on setting it up here.</p>
<p>sIFR fonts can help your site be SEO friendly, easy to maintain (no more making new graphics when you need a new nav icon), all while keeping whatever typography you choose.</p>
<p>Remember to use it sparingly (only on headlines, etc), and to choose an HTML font that complements your new headers.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/web-development/37/use-any-font-on-your-site-with-sifr/feed</wfw:commentRss>
		</item>
		<item>
		<title>The Neverending Saga of Bad Webpage Decisions&#8230; Ad Placement and Impressions</title>
		<link>http://www.shortship.com/articles/web-development/59/the-neverending-saga-of-bad-webpage-decisions-ad-placement-and-impressions</link>
		<comments>http://www.shortship.com/articles/web-development/59/the-neverending-saga-of-bad-webpage-decisions-ad-placement-and-impressions#comments</comments>
		<pubDate>Wed, 24 Oct 2007 22:53:20 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=59</guid>
		<description><![CDATA[Whenever I browse the internet, I am always on the lookout for good design, good UI, and other factors that make me say 'wow, someone was really thinking'.
Lately, however, I've been on the lookout for site behaviour that really gets on people's nerves. The kind of pages that can be a lesson to those of [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Whenever I browse the internet, I am always on the lookout for good design, good UI, and other factors that make me say 'wow, someone was really thinking'.</p>
<p>Lately, however, I've been on the lookout for site behaviour that really gets on people's nerves. The kind of pages that can be a lesson to those of us doing UI design. Read on to see some of this week's picks of Bad Webpage Decisions, and submit your own for inclusion in future entries.</p>
<p>This inaugural issue of Bad Webpage Decisions stresses the importance of putting your users first over advertising. It's a mistake small sites and large sites make in droves. Yes, you need to make money, but at what cost to user base? I have 2 examples here from this past weekend that really drive the point home.</p>
<p><a href="http://www.shortship.com/articles/wp-content/uploads/2008/12/forbes.png"><img class="aligncenter size-medium wp-image-60" title="forbes" src="http://www.shortship.com/articles/wp-content/uploads/2008/12/forbes-265x300.png" alt="" width="265" height="300" /></a></p>
<p>The first is forbes. I went to their site off a yahoo link, as the article sounded interesting to me in my house search. Cheap suburbs, or best suburbs to live in. Great. But, to see the results, I had to wait for a Javascript auto-redirect through each result. Their page was very slow today, so this took about 10 seconds of loading per result where I was just staring at a white page waiting to see the next result. I really only wanted to see the ones near me. So, I tried to post a comment.. you can see the comment below, and the error message that came up. Each time I tried to submit a comment again, I shortened my comment (length limit I thought), and each got angrier. The first comment was quite polite how it was detracting from my desire to keep reading. So lesson learned from forbes? Yes, the more pageviews you get, the more ad impressions, etc, but please don't force your users to go through 20 page views in order to find what they are looking for. And, if you do, at least have the decency to use AJAX so we aren't looking at a blank white page in frustration.</p>
<p><a href="http://www.shortship.com/articles/wp-content/uploads/2008/12/ad.png"><img class="aligncenter size-medium wp-image-61" title="ad" src="http://www.shortship.com/articles/wp-content/uploads/2008/12/ad-300x141.png" alt="" width="300" height="141" /></a></p>
<p>The second shame of the week is movietickets. I understand the desire to have your advertiser be satisfied, but there is appeasing them, and there is taking something too far. I counted no less than 7 advertisements on one page, all running the same exact flash ad. And, given the subject matter of the ad, I almost wanted to run screaming from the webpage. Imagine a parent trying to buy tickets for a children s movie and being greeting with 7 (there was one below the fold as well) horrifying bloody zombie movie animations. Now, I like a good zombie movie, but this seemed a bit excessive. Even if it was 7 advertisements for Shrek 18, it still would have been *too* much advertising. 80% of the page is taken up by ads. Even the default movie to search for was the ad spot.</p>
<p>So, please learn from these 2 sites. They certainly aren't the only sites out there, and I hate to single them out, maybe in the future I will blur any recognition to a site by name, and just post examples. The lesson today is: be mindful of your ad placements and desire to monetize. A well placed ad is golden, but too much of a bad thing can cause your users to never come back.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/web-development/59/the-neverending-saga-of-bad-webpage-decisions-ad-placement-and-impressions/feed</wfw:commentRss>
		</item>
		<item>
		<title>10 Simple Ways To Speed Up Windows Vista</title>
		<link>http://www.shortship.com/articles/tips-tricks/46/10-simple-ways-to-speed-up-windows-vista</link>
		<comments>http://www.shortship.com/articles/tips-tricks/46/10-simple-ways-to-speed-up-windows-vista#comments</comments>
		<pubDate>Sat, 20 Oct 2007 06:33:03 +0000</pubDate>
		<dc:creator>kmk</dc:creator>
		
		<category><![CDATA[Tips &amp; Tricks]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[tweak]]></category>

		<category><![CDATA[vista]]></category>

		<guid isPermaLink="false">http://www.shortship.com/articles/?p=46</guid>
		<description><![CDATA[Windows Vista is a rather heavy operating system with many neat features, but unfortunately they all come at a price. Right out of the box it requires a pretty hefty system to run (arguably).
Before you run out and buy a new computer just so you can run your base operating system, check out these 10 [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Windows Vista is a rather heavy operating system with many neat features, but unfortunately they all come at a price. Right out of the box it requires a pretty hefty system to run (arguably).</p>
<p>Before you run out and buy a new computer just so you can run your base operating system, check out these 10 Simple Ways To Speedup Windows Vista tips to lighten the load. This is just the first in the series, so many of them may be very apparent to those experienced in tweaking.</p>
<p>If you're still using Windows XP, then check out 10 Simple Ways To Speedup Windows XP.</p>
<p><strong>1. Turn off UAC, or at least make it less annoying</strong></p>
<p>Now, there's a lot of talk about the new user account control policy in Vista, and all I can say is: as it is, it annoys the hell out of me and slows down my normal computer usage. Just why, oh why, does it have to flash my video card to a black screen, take 5 seconds and really just make itself a royal pain in the arse?</p>
<p>To turn it off, the easiest way is to go into the Control Panel and type in 'UAC' into the search bar. It'll bring up a search result of "Turn User Account Control (UAC) on or off". Just follow the prompts from there.</p>
<p>To keep some of the security of the UAC, let's just turn off the crazy annoying blacking out screen bit. To do this:</p>
<p style="padding-left: 30px;">* open group policy (start | run | gpedit.msc)<br />
* then navigate to Computer Configuration | Windows Settings | Security Settings | Local Policies | Security Options<br />
* Find the policy named "User Account Control: Switch to the secure desktop when prompting for elevation". Set this to disabled.</p>
<p>Much better, eh? You might say "but what's that got to do with speed?" Well, as I mentioned, it prompts me a couple times an hour at least and then takes several seconds to figure itself out. My productivity goes up, so it's a speed enhancer <img src='http://www.shortship.com/articles/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>2. Disable Aero</strong></p>
<p>I personally do not do this, as I am a fan of the graphical styles, but I realize it comes at a cost. It does tend to eat up both RAM and CPU usage (as well as video card usage). While it is turned off during gaming, you can still notice its effects during normal computer usage. When it is really cranking, it can use 15% of your CPU. Ouch. Vanity comes at a cost.</p>
<p>If you do like it, at least turn it down a couple notches. Some performance increases have nothing to do with strain on hardware, or amount of processing. Sometimes, things are designed to take longer than they should, though only maybe a fraction of a second, but the end result to the user is a faster machine. Minimizing and maximizing does an animation. Watch closely. Pretty quick eh? Still, it does slow you down, and, really, what does it add to your experience? I am all about vanity and aesthetics, but this feature has got to go.</p>
<p>Relish in the fact you will be increasing your productivity by 0.2 seconds per minimize/maximize. <img src='http://www.shortship.com/articles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="padding-left: 30px;">* Open your start menu, go to run, and type in 'systempropertiesperformance'<br />
* From the Visual Effects tab, uncheck 'Animate windows when minimizing and maximizing'<br />
* While you are here, might as well check out the other goodies you can disable.</p>
<p><strong>3. ReadyBoost</strong></p>
<p>ReadyBoost is one of the more innovative features of Vista. The idea behind it is to use solid state memory as a secondary memory cache (before hard drive caching). It does require a certain level of speed from your USB (or other) flash drive. Do a quick search on google for just the fastest USB flash drive you can get your hands on (don't worry they are cheap) and buy one.</p>
<p>To enable ReadyBoost, just plug in a fast flash drive, and AutoPlay should come up with a dialog stating that you can use it for readyboost. If you have disabled it, you can just go to the properties for the drive and select it under the readyboost tab. Easy as cake. It is no substitution for RAM, but one can get a several GB flash drive for very little. Some sites have stated that the improvements are not as much as MS says they are, but even a minor improvement for such a low investment makes this worth your while. Do find the best drive you can for random reads/writes (the drive speed is usually rated for sequential reads which won't help you much).</p>
<p style="padding-left: 30px;">* What speed drive do I need? 2.5MB/sec throughput for 4K random reads and 1.75MB/sec throughput for 512K random writes.</p>
<p style="padding-left: 30px;">* What size drive do I need? 256MB to 4GB, where as best performance is gotten at around a 1:1 to a 2:1 flash to ram ratio. So really, you should never try this with a flash drive smaller than 1GB-2GB.</p>
<p>Continue on, and see the rest. I'll get more complex as I go.</p>
<p><strong>4. Tweak Indexing Service</strong></p>
<p>I personally don't mind the new search too much. It still hogs a lot of resources though. To turn it off completely:</p>
<p style="padding-left: 30px;">* Go to my computer, right click on C: drive, go to the General tab, and uncheck Index this drive for faster searching, select Include subfolders and files.<br />
* If you want, you can just remove any extra areas of search, so you can keep your fast searching for some areas.</p>
<p>I personally find the indexing of control panel options and start menu items to be a blessing, so I would leave those alone. Just find items in the tree that you really don't wish to be indexed (like your documents).</p>
<p><strong>5. While you are at it, fix the rest of your search options</strong></p>
<p>It is often that I do searches for text in files, like a method use in a PHP file, or maybe something in a java file. Regardless of the situation, Windows Vista has a very limited number of file extensions flagged for full text searching, which causes you to get 'no results' when you know there are some.</p>
<p style="padding-left: 30px;">* Open Control panel and type in 'indexing' into the search box (or you can do this from your start menu, but many people turn it off).<br />
* Select 'Indexing Options'<br />
* Select Advanced Button<br />
* Select 'File Types' Tab<br />
* In this list you will see a list of extensions. When you click on most of them, the bottom radio button will change from 'index properties only' or 'index properties and file contents'<br />
* Honestly, index properties only is pretty useless for what most people will use search for (i.e. really only search by date).<br />
* Uncheck a box to have it removed from search. This can be done for a variety of extensions that honestly, you don't want in search anyway. It will actually help your results.<br />
* Change the radio button to 'index properties and file contents' to have these file types included in your searches (should be set for word docs, etc and any other text-based files you search for)</p>
<p><strong>6. Get rid of the sidebar</strong></p>
<p>Pretty self explanatory. It's a heavy and ugly. If you use it, great, if you don't reclaim some desktop space. Install google's version. Or yahoo's.</p>
<p><strong>7. Defender has a use?</strong></p>
<p>Yes, windows defender actually has a purpose!</p>
<p style="padding-left: 30px;">* Open it up<br />
* Click on tools<br />
* Click on Software Explorer<br />
* This will let you select groups of items, the default is Startup Programs. Now you can see that oh, Open Office quickstart is there, and I can just disable it there.</p>
<p>Items in this list are very likely to be programs that are running 100% of the time your computer is on, so if you can live without them, kill em.</p>
<p>Almost to the end of part 1. The final page is filled with some more advanced things you can do, but they can take a bit of time…</p>
<p><strong>8. Tweak your services</strong></p>
<p>Well, this one is arguable. Many sites preach service tweaking as the end all of tweaks, and Vista does have a lot of services (like 130). However, a good portion of them are set to manual or disabled by default. Manual will only start the service when the operating system thinks it needs to use that program. However, Vista does have a lot of services set to Automatic by default that are not needed for many people. Granted, they are usually sleeping, not using any CPU, and if they use memory, they usually get paged out to disk pretty fast. But, regardless, it is fairly quick to do, and will gain you some improvement.</p>
<p>First off, how to tell what you should really be worried about. One new feature in Vista is the "Go to Service" feature in Task Manager (or at least I never noticed it before). Open Task Manager, Processes tab, right click on a particularly heavy process, and select "Go to Service (s)". This will jump you over to the services tab, and select all the services that are running under that process (multiple ones are usually running under svchost.exe, many of the others only map to one service).</p>
<p>It also works in reverse (select service, right click and go to process) I have something like 75 services running at this very moment. Many of them I have exactly zero use for. I do not have a printer, but print spooler is running and using a whole whopping 1MB of my ram at the moment. There are heavier examples, but even if you can remove 20 of these, is it worth your time? Well, yes and no. Like I said, many of them are already paged out, so they really aren't affecting your system's memory. There is added overhead because the scheduler still needs to manage them, but I cannot for the life of me remember how it is done in Windows.</p>
<p>Overall maybe minimal, but if you are going for every ounce of tweak-ness, give it a shot. I'd recommend Speedyvista look for their cheatsheet or registry files pages so you can keep a copy of the default services around for when/if you mess it up and need to get back to default.</p>
<p><strong>9. How to find out the next area for improvement - Tweak your programs</strong></p>
<p>Well, you've gotten the operating system down to a certain point, what's next? Well, figure out where your bottlenecks still are! There's probably some software on your computer that just kills performance (or 6-7 of them). Don't blame MS quite yet. Anyway, luckily for you Windows Vista has a simple tool included that can help you identify the problem and remedy it quickly.</p>
<p style="padding-left: 30px;">* Open the task manager (many ways to get to it, easiest is ctrl+alt+delete then select Start Task Manager)<br />
* Navigate to the Performance tab<br />
* Click on Resource Monitor<br />
* Expand the disk section and sort by either reads or writes column.</p>
<p>Additionally, you can check out cpu, memory usage and network usage in the same way. Now you will probably notice that your virus scanner is using 20x the resources of Aero, as it insists on scanning your RAM all the time, and scanning every damn file you read from, write to, or execute. But, what can you do? Try to find a couple programs that are too greedy, or running when they have no reason to be running (Example: iTunes has a couple services installed that run constantly. Why? I've no idea why it takes 2-3 services running and several threads to just be looking out for when you just might plug in your iPod, because that functionality is already built into windows). Office also has a preloader "quick start" service (as does open office) to make sure that things run "better" for you. Even though you do have super fetch which should do it automatically without the need for any extra memory usage.</p>
<p><strong>10. Not really a tweak but…</strong></p>
<p>Ok, #10 isn't really a speed tweak, but it's something I've always found annoying on many operating systems. Many of us have 2 LCDs, and oh wouldn't it be nice to be able to set different backgrounds for both? There are programs out there that do it, but here's a way to just do it inside windows.</p>
<p style="padding-left: 30px;">* Right click on the background and select Personalization.<br />
* Click on Desktop Background<br />
* Select a background image that is at least as wide as the combined resolution of both of your monitors (or scale the image up so it is big enough, else you will get tiling.. it takes some tweaking, so get out your photo editor of choice for this one.<br />
* Select the Tile picture positioning option as shown below. This is the only option that will display your background image across multiple monitors</p>
<p>Alright, tune in next time for more advanced Windows Vista tweaks. If you have any questions doing any of the above, let me know, or if you wish to debate their usefulness, etc. If you wish to give your own, even better!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.shortship.com/articles/tips-tricks/46/10-simple-ways-to-speed-up-windows-vista/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
