<?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>Intellectual Pirates &#187; Web Development</title>
	<atom:link href="http://intellectualpirates.net/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://intellectualpirates.net</link>
	<description>Web Development Courses, Rants, Tutorials and Hacks</description>
	<lastBuildDate>Tue, 15 Jun 2010 10:01:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Ad Blockers: Making the Internet Better</title>
		<link>http://intellectualpirates.net/ad-blockers-making-the-internet-better/</link>
		<comments>http://intellectualpirates.net/ad-blockers-making-the-internet-better/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 08:02:39 +0000</pubDate>
		<dc:creator>antic</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[adblocking]]></category>

		<guid isPermaLink="false">http://intellectualpirates.net/?p=1692</guid>
		<description><![CDATA[I just stumbled upon this opinion column in Smashing Magazine, which claims that Web Designers should not use ad blockers. Along with a bunch of lousy arguments, the author fails to account for my two biggest reasons for using ad blocking: Resource Consumption (time and bandwidth) &#8211; it&#8217;s makes the web faster Ads Mostly Suck [...]]]></description>
			<content:encoded><![CDATA[<p>I just stumbled upon <a rel="nofollow" href="http://www.smashingmagazine.com/2010/06/14/why-web-designers-should-not-use-ad-blockers-opinion-column/">this opinion column</a> in Smashing Magazine, which claims that Web Designers should not use ad blockers. Along with a bunch of lousy arguments, the author fails to account for my two biggest reasons for using ad blocking:</p>
<ul>
<li>Resource Consumption (time and bandwidth) &#8211; it&#8217;s makes the web faster</li>
<li>Ads Mostly Suck (and are equally ineffective)</li>
</ul>
<p>First, let me say that rather than adding adblocker software or plugins, I use Dan Pollock&#8217;s host file: <a href="http://someonewhocares.org/hosts/">http://someonewhocares.org/hosts/</a>. Instead of blocking ads directly, it redirects ad server domain resolution to localhost. It&#8217;s fast, it&#8217;s free and it doesn&#8217;t take up resources running any extra processes. </p>
<p>A note from his file explains a bit of why it&#8217;s useful:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Use this file to prevent your computer from connecting to selected</span>
<span style="color: #666666; font-style: italic;"># internet hosts. This is an easy and effective way to protect you from </span>
<span style="color: #666666; font-style: italic;"># many types of spyware, reduces bandwidth use, blocks certain pop-up </span>
<span style="color: #666666; font-style: italic;"># traps, prevents user tracking by way of &quot;web bugs&quot; embedded in spam,</span>
<span style="color: #666666; font-style: italic;"># provides partial protection to IE from certain web-based exploits and</span>
<span style="color: #666666; font-style: italic;"># blocks most advertising you would otherwise be subjected to on the internet.</span></pre></div></div>

<p>I started using this when I moved to Germany and ended up with a mobile internet connection for my main line, which is dirt slow. I couldn&#8217;t afford to waste my 5GB/month capped usage on ads&#8211;or slow down my general use with waiting for all the analytics and ad servers to resolve and load (yes, I block analytics too but that&#8217;s another post with a whole new topic).</p>
<p>But now that I&#8217;ve been using the hosts file for a while I&#8217;ve started to think that this is like when I abandoned television in favor of the internet for viewing videos. I got sick of the commercials. So much that I joined a revolution in a new medium that allowed me more fine-grained control over what I consume and how I consume it. I can&#8217;t watch TV anymore&#8211;the commercials are insufferable.</p>
<p>Yes, I&#8217;m a Web Developer, and yes, I use ad services on my sites&#8211;and I feel genuinely icky about it (but it pays for my hosting and gives me pet-project freedom). So, please, block my ads. If you don&#8217;t want them, I don&#8217;t want you to have to suffer them. You probably aren&#8217;t the person who makes me money on my ads anyway.</p>
<p>But here&#8217;s the kicker: When I find that there&#8217;s an ad company I like, who does things right, I allow them through my hosts file filter. Sadly, I haven&#8217;t found a decent service for sporting ads that don&#8217;t suck on my websites.</p>
<p>Commercials need to be better. Ads need to be better. Ad services need to be a hell of a lot better. A few ad agencies have caught onto this, creating viral advertising that people actually WANT to consume. I&#8217;m sure you remember the Sonia Bravia superball video. People didn&#8217;t block it. Instead it got passed around.</p>
<p>Here&#8217;s another one that gives me goose bumps that I found at the end of a <a href="http://TED.com">TED.com</a> talk by Nokia:</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/97a4nO-Vzfk&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/97a4nO-Vzfk&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p>In closing, if you don&#8217;t want people to block your ads, make them not only worth consuming but sharing, make the ad servers fast and don&#8217;t put them in the way of what users actually want to consume.</p>
<p><a href='http://www.twitter.com/antic' class='twitlink'>follow on Twitter</a></p>]]></content:encoded>
			<wfw:commentRss>http://intellectualpirates.net/ad-blockers-making-the-internet-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Remaining Calculations: Problem &amp; Solution</title>
		<link>http://intellectualpirates.net/time-remaining-calculations-problem-solution/</link>
		<comments>http://intellectualpirates.net/time-remaining-calculations-problem-solution/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 10:38:06 +0000</pubDate>
		<dc:creator>antic</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[estimates]]></category>

		<guid isPermaLink="false">http://intellectualpirates.net/?p=1652</guid>
		<description><![CDATA[Situation A user initiates an action that will take some time to complete. This happens all the time, in all sorts of applications. The most common places you will find this are downloading and installing. Downloading is the easiest target for improvement so this is what I will focus on here. The system wants to [...]]]></description>
			<content:encoded><![CDATA[<h2>Situation</h2>
<p>A user initiates an action that will take some time to complete. This happens all the time, in all sorts of applications. The most common places you will find this are downloading and installing. Downloading is the easiest target for improvement so this is what I will focus on here.</p>
<p>The system wants to report to the user how long they will have to wait before the task is complete. This is usually presented with a progress indicator, a speed report and some form of time remaining.</p>
<h2>Problem</h2>
<div align="center">
<img src="http://intellectualpirates.net/wp-content/uploads/2010/06/Picture-8.png" alt="" title="Picture 8" width="444" height="118" class="aligncenter size-full wp-image-1658" /><br />
<img src="http://intellectualpirates.net/wp-content/uploads/2010/06/Picture-9.gif" alt="" title="Picture-9" width="446" height="124" class="aligncenter size-full wp-image-1663" />
</div>
<p></p>
<p>If you&#8217;ve seen progress indicators like this before, you&#8217;ve no doubt suffered watching the time remaining report shift from 10 minutes to 1 hour, back to 10 minutes, up to 2 hours in what looks like an endless loop of uncertainty. </p>
<h3>What the System Knows</h3>
<ol>
<li>The total amount of data to be processed</li>
<li>The current processing speed</li>
<li>The total remaining amount of data to be processed</li>
<li><b>The total time spent processing so far</b></li>
</ol>
<p>The problem is that programmers tend to only pay attention to the first 3 pieces of information available. The fourth is outright ignored, which is sad because it allows us to write much, much better progress indicators.</p>
<h2>Solution</h2>
<p>What we tend to show is Time Remaining = Data Remaining / Data Speed<br />
<b>Example:</b> 200MB / (1.2MB/s) results in 166.67 seconds remaining (or 2.8 minutes).</p>
<p>While this is valuable for the user to know the current speed and the time remaining at the current speed, and presents a fairly accurate report for users with constant download speeds, it&#8217;s often an unrealistic estimation of the real time to completion for anyone with variable rate downloads. In the case above where I was downloading a trial of the Adobe CS5 Suite, I was on a broadband connection (at a cafe) with a variable availability in transfer speed. My download shifted constantly between 50KB/s and 3.2MB/s, causing the weak progress indicator to jump back and forth between almost a day and less than an hour. But if the download manager calculated my <strong>AVERAGE</strong> speed, it could give me a much better indication of how long I can expect the action to take. And the great thing is that as the download progresses, it has the option of capturing and calculating a much more realistic number. In the end, the download took about 2 hours and 40 minutes, which ended at a time that the progress indicator never seemed to even come close to reporting.</p>
<p>Although, it could factor in some quite complex numbers, calculating variations in rates, all of that complexity is unnecessary&#8211;and probably not that useful. Really you just need this:</p>
<p>Rate = Time Spent / Amount Complete<br />
Average Time Remaining = (Rate * Total Data) &#8211; Time Spent</p>
<p><b>Example: </b><br />
We&#8217;ve downloaded 100MB / 200MB and, so far, it&#8217;s taken 12 minutes:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> totalData <span style="color: #339933;">=</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// constant</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// vars to be updated at intervals</span>
<span style="color: #003366; font-weight: bold;">var</span> timeSpent <span style="color: #339933;">=</span> <span style="color: #CC0000;">12</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> dataComplete <span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// calculate an estimate for the average time remaining</span>
<span style="color: #003366; font-weight: bold;">var</span> dataRemaining <span style="color: #339933;">=</span> totalData <span style="color: #339933;">-</span> dataComplete<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> rate <span style="color: #339933;">=</span> timeSpent <span style="color: #339933;">/</span> dataComplete<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> avgTimeRemaining <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>rate <span style="color: #339933;">*</span> totalData<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> timeSpent<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// show it</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>avgTimeRemaining<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So the avgTimeRemaining would be 12 minutes. The current speed might be different (probably is) so it would really be nice to see both the current rate and estimate at the current speed and the overall rate with an estimate that considers the shifting variation in speed. The closer you get to completion, the more accurate this second calculation becomes.</p>
<h2>In Closing</h2>
<p>It&#8217;s great to know how long I can expect something to take at my current speed, but it&#8217;s much better if I can also see my average speed along with an estimate based on that information. Often, for people with variable rates of processing and downloading, the second calculation is much more helpful.</p>
<p><a href='http://www.twitter.com/antic' class='twitlink'>follow on Twitter</a></p>]]></content:encoded>
			<wfw:commentRss>http://intellectualpirates.net/time-remaining-calculations-problem-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
