<?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>Libby Hemphill &#187; adSense</title>
	<atom:link href="http://www.libbyh.com/category/the-rest/adsense/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.libbyh.com</link>
	<description>research and posts on social media, collaboration, and related technologies</description>
	<lastBuildDate>Wed, 23 Jun 2010 16:38:02 +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>JavaScript date checking</title>
		<link>http://www.libbyh.com/2009/03/14/javascript-date-checking/</link>
		<comments>http://www.libbyh.com/2009/03/14/javascript-date-checking/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 20:27:52 +0000</pubDate>
		<dc:creator>libbyh</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[adSense]]></category>

		<guid isPermaLink="false">http://www.libbyh.com/blog/?p=371</guid>
		<description><![CDATA[Sometimes we ask users to enter a date range. I wrote some code today to check whether the date a user entered was (1) after today and (2) before some other date she entered. In my situation, I was building a flight search form and wanted to check that the user-entered departure date was before [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we ask users to enter a date range. I wrote some code today to check whether the date a user entered was (1) after today and (2) before some other date she entered. In my situation, I was building a flight search form and wanted to check that the user-entered departure date was before the user-entered return date and that the user wasn't trying to depart in the past. To do this, I needed to turn the user's input into a JavaScript Date and then compare that Date to Today's date. I found a lot of similar code online, but none of it work quite right.</p>
<p>I have a form with text box inputs for dateDepart and dateReturn. This code takes those inputs, turns them in JavaScript dates, compares them to each other and to today, and returns alerts or submits the form, depending on how the comparisons shake out.</p>
<p>Here's my code:</p>
<pre class="code">// check to make sure Return date is after Departure date, and both are after today
if ( (the_form.dateDepart.value !="") &amp;&amp; (the_form.dateReturn.value !="") )
{
	var strFromDate = the_form.dateDepart.value;
	var dayPartFromDate = parseInt(strFromDate.substring(3,5),10);
	var monPartFromDate = parseInt(strFromDate.substring(0,2),10);
	var yearPartFromDate = parseInt(strFromDate.substring(6,10),10);
	var dtDepart = new Date(yearPartFromDate, monPartFromDate-1, dayPartFromDate);

	var strToDate = the_form.dateReturn.value;
	var dayPartToDate = parseInt(strToDate.substring(3,5),10);
	var monPartToDate = parseInt(strToDate.substring(0,2),10);
	var yearPartToDate = parseInt(strToDate.substring(6,10),10);
	var dtReturn = new Date(yearPartToDate, monPartToDate-1, dayPartToDate);
	var now = new Date();
	var today = new Date(now.getFullYear(),now.getMonth(),now.getDate());	

	if(dtDepart &gt; dtReturn)
	{
		alert('Departure date must be before return date. Please fix and resubmit.');
		return false;
	}
	else if (dtDepart &lt; today)
	{
		alert('Departure date must be after today. Please fix and resubmit.');
		return false;
	}
	else
	{
		the_form.submit();
	}
}</pre>
<p><strong>Turn User Input into a JavaScript Date</strong><br />
To turn the user's input into a Date, I needed to parse the input and then pass the pieces to the <code>Date()</code> function.</p>
<p>The JavaScript <code>substr</code> function syntax I used corresponds to <code>dateToChange.substring(start,finish)</code>. My users are mostly in the U.S., and they enter dates in the form MM/DD/YYYY, e.g., 03/14/2009. JavaScript starts counting at 0, so the <code>substr</code> functions above grab "14" for the day, "03" for the month, and "2009" for the year and then pass those substrings to the <code>Date()</code>function to be converted in a Date JavaScript understands.</p>
<p><code>getFullYear();</code> returns a four-digit year such as "2009" that makes it easy to compare to the default version of today's date that<br />
<code>var now = new Date();<br />
var today = new Date(now.getFullYear(),now.getMonth(),now.getDate());</code><br />
gives.</p>
<p>Why <code>monPartToDate-1</code>? Remember, JavaScript starts counting at 0, so January is month 0, and December is month 11. That means I need to subtract 1 from what my user entered to get the right month for JavaScript.</p>
<p><strong>Compare Dates</strong><br />
I needed to compare the two dates the user entered to make sure she had departure first, then return. Once I have converted both her inputs to JavaScript dates, the comparison uses a simple "greater than" operator:  <code>dtDepart &amp;gt; dtReturn</code></p>
<p><strong>Calling the Date-checking Function</strong><br />
You'll notice my code doesn't include a function declaration; that's because this date-checking procedure is part of a larger function to validate my form. You could wrap this code in a function declaration such as<br />
<code>function checkDates(the_form){}</code></p>
<p>In order to call the code when the user submits the form, I like to use something like</p>
<p><code>&lt;input id="search" onclick="checkDates(this.form);" type="button" value="Submit Form" /&gt;</code></p>
<p>in the HTML.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.libbyh.com/2009/03/14/javascript-date-checking/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>iPhone&#8217;s glass is broken. What to do?</title>
		<link>http://www.libbyh.com/2009/02/17/iphones-glass-is-broken-what-to-do/</link>
		<comments>http://www.libbyh.com/2009/02/17/iphones-glass-is-broken-what-to-do/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 05:09:11 +0000</pubDate>
		<dc:creator>libbyh</dc:creator>
				<category><![CDATA[MacBook]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[adSense]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.libbyh.com/blog/?p=302</guid>
		<description><![CDATA[UPDATE: I got my iPhone fixed by Mission: Repair and am very happy. See my review post. Yes, I dropped my iPhone today. Yes, that drop, from less than 3 feet, cracked the glass. Yes, I wanted to cry. Now what do I do? I went to the Genuis Bar at the Briarwood Apple Store [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: I got my iPhone fixed by <a title="Mission Repair" href="http://www.missionrepair.com/?Click=18277" target="_blank">Mission: Repair</a> and am very happy. <a title="Review blog post" href="http://www.libbyh.com/blog/2009/03/03/review-iphone-glass-replacement-from-mission-repair/" target="_self">See my review post</a>.</p>
<p>Yes, I dropped my iPhone today. Yes, that drop, from less than 3 feet, cracked the glass. Yes, I wanted to cry.</p>
<p>Now what do I do? I went to the Genuis Bar at the Briarwood Apple Store right away, and they told me, as I expected, that they could get me a replacement iPhone for $299. You read that right. They didn't offer to repair my phone; they offered to replace it, maybe with a refurbished one, for the same price I originally paid. I asked if there were repair options, and they said not with them. Paying $299 would also get me a new warranty that lasts until August. As is, my warranty is void since the break was accidental. So,</p>
<p><code>Option 1: Pay Apple $299 and hope they give me a new one instead of a refurb.</code></p>
<p>I looked around online for other options. Since my warranty's void anyway, I'm not that concerned about a warranty-saving repair. This guy's site - <a href="http://3gcrackedglass.com/">http://3gcrackedglass.com</a> - is pretty much right on about repair options and prices. The two sites I see mentioned most often when I search for repair info are iResQ and Mission:Repair. iResQ is supposedly an Apple Authorized repair provider, but they have some <a href="http://www.boingboing.net/2009/02/10/iphone-repair-compan.html">service and PR issues</a>. Apparently that particular <a href="http://brownielinzi.blogspot.com/2009/02/success-apology-from-iresq-and-full.html">problem was resolved</a>. So,</p>
<p><code>Option 2: Pay iResQ $129 or Mission:Repair $137 to fix it and ship it back overnight</code></p>
<p>Of course, I could always just live with the cracked screen, making</p>
<p><code>Option 3: Put the iPhone back in its case, and live with a cracked screen.</code></p>
<p>I had an InCase skin on my iPhone for awhile. I took it off because it made it really hard to get the phone in and out of my pocket. It also made it bulky. Oh, and, I was a little irked at having to pay $30 for an accessory to make the iPhone marginally more durable. The other $300 cell phones I've owned didn't need cases to be durable. If I'd had my case on today, my screen may not have cracked. I take responsibility for dropping my phone. I still think it's ludicrous to offer only replacement and not repair. I get that Apple makes a load more money doing it that way, but the process is infuriating and wasteful.</p>
<p><strong>Mini rant about Apple</strong></p>
<p>In the last 2.5 years, I've spent about $4100 on Apple hardware - 2 laptops and an iPhone. My MacBook required two new logic boards, three new keyboards, and a new hard drive. My MacBook Pro requires new fans and probably a new logic board. None of those 8 repairs were my fault. My laptops have spent about 2 weeks at Apple service facilities and require another 5-7 day stay to fix the fans. My iPhone has worked fine since I bought it in August, but the fact that it cannot withstand a rather routine and expected fall made me furious today. I've been patient with my other Apple hardware. I've sent my computer in for repair and tried to work on my dissertation using backup data and backup computers. I've been through the ringer with their hardware, and I'm exasperated. I don't want to be a whiner, and I don't want to minimize my role in breaking my iPhone. But, I don't think I can recommend Apple products anymore. They either come broken like my MacBook, break almost immediately like my MacBook Pro, or require unreasonable gentleness like my iPhone. At twice the price of comparable laptops and cell phones from competitors, I expected more. Sigh. I'm no longer convinced that the software advantages Apple platforms provide make them worth the hassle or cost. I'm left thinking maybe I should have stuck with my Dell and my BlackBerry.</p>
<p>Oh, and the total cost of ownership for Apple products are even higher. Every laptop needs $30 adapters to work with external monitors, and apparently every iPhone needs a $30 case to protect it. Yes, needs. So add 1.4% to your laptop bill for each adapter you need, and add 15-20% for a case for each iPhone. And those are just the beginning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.libbyh.com/2009/02/17/iphones-glass-is-broken-what-to-do/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Why not Time Machine?</title>
		<link>http://www.libbyh.com/2009/01/04/why-not-time-machine/</link>
		<comments>http://www.libbyh.com/2009/01/04/why-not-time-machine/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 17:11:09 +0000</pubDate>
		<dc:creator>libbyh</dc:creator>
				<category><![CDATA[MacBook]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[adSense]]></category>

		<guid isPermaLink="false">http://www.libbyh.com/blog/?p=276</guid>
		<description><![CDATA[A couple of commenters asked why I use the ChronoSync + SuperDuper! combination instead of just Time Machine. The main reason? Time Machine uses too many resources. It's also slow. For awhile I avoided it because I wasn't sure how to make a bootable backup, but Mac OS X hints has instructions. I don't always [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of <a href="http://www.libbyh.com/blog/2009/01/02/backing-up-my-mac/#comments">commenters asked why</a> I use the ChronoSync + SuperDuper! combination instead of just Time Machine.  The main reason? Time Machine uses too many resources.  It's also slow. For awhile I avoided it because I wasn't sure how to make a bootable backup, but <a href="http://www.macosxhints.com/article.php?story=2008011623365026">Mac OS X hints has instructions</a>. </p>
<p>I don't always have my external hard drives plugged in since I'm rocking a laptop and am pretty mobile. Time Machine complained every hour, on the hour, that it couldn't find the drive it wanted for long enough to annoy me. Eventually it stops complaining about not being able to find the drive it wants.</p>
<p>Even if you leave the drive plugged in while working at your base location, for me it's my home office, Time Machine sucks up resources to do those intermittent backups. Even when I'm working on my dissertation, my data is not so mission-critical that it needs to be backed up every hour. <a href="http://www.macosxhints.com/article.php?story=200710291721156">Mac OS X Hints has a solution</a> for changing the backup interval too.</p>
<p>ChronoSync can do in 39 minutes what it takes Time Machine over an hour to do. SuperDuper! beats the initial setup by about 20 minutes. So, the ChronoSync + SuperDuper! setup saves me resources, time, and headache.</p>
<p>One more thing - I have an Airport Extreme router, and I hang a hard drive off it via USB also. That drive is open to anyone on our home network. Apple's not kidding when they say Time Machine does not support network backups except to Time Capsule. When I tried using Time Machine to backup to that USB drive off the Airport Extreme, it would run my CPU up to about 80% and break many of my network connections. You may have better luck there. I didn't troubleshoot or try to fix it; I just gave up.</p>
<p>I ordered a <a href="http://www.mwave.com/mwave/viewspec.hmx?scriteria=4724310">rocstor ROCRAID from mwave</a> last week, and that should be here on Tuesday. I'll try out RAID storage for my stuff and see how that goes. It has FireWire connections too, and I'm interested to see how much faster that can really be. I really don't want to have to give my laptop to Apple for a week. They won't let me keep the hard drive and send it in with a different one, and they won't give me a loaner. So I paid $2500 to have a laptop 98% of the time. Would I get it 100% of the time if I'd spent $3000? Sorry for the minirant, but having to get my MacBook Pro's fan fixed is what prompted this latest round of backup chatter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.libbyh.com/2009/01/04/why-not-time-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweeteorology.com</title>
		<link>http://www.libbyh.com/2009/01/03/tweeteorologycom/</link>
		<comments>http://www.libbyh.com/2009/01/03/tweeteorologycom/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 01:12:44 +0000</pubDate>
		<dc:creator>libbyh</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[adSense]]></category>
		<category><![CDATA[Magical Pork]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.libbyh.com/blog/?p=274</guid>
		<description><![CDATA[tweeteorology.com just launched. It's the first project from my new company - Magical Pork. Tweeteorology shows tweets (posts to Twitter) about the weather. You can limit the search by location. I am actively developing Tweeteorology and welcome your suggestions. Thanks, Molly, for the tweeteorology idea!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tweeteorology.com">tweeteorology.com</a> just launched.  It's the first project from my new company - Magical Pork. Tweeteorology shows tweets (posts to <a href="http://www.twitter.com">Twitter</a>) about the weather. You can limit the search by location. I am actively developing Tweeteorology and welcome your suggestions.</p>
<p>Thanks, Molly, for the tweeteorology idea!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.libbyh.com/2009/01/03/tweeteorologycom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up My Mac</title>
		<link>http://www.libbyh.com/2009/01/02/backing-up-my-mac/</link>
		<comments>http://www.libbyh.com/2009/01/02/backing-up-my-mac/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 14:16:10 +0000</pubDate>
		<dc:creator>libbyh</dc:creator>
				<category><![CDATA[MacBook]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[adSense]]></category>

		<guid isPermaLink="false">http://www.libbyh.com/blog/?p=264</guid>
		<description><![CDATA[My posts about cloning at Boot Camp drive and swapping hard drives in a MacBook are the most popular, according to Google Analytics. Today's special treat, therefore, is a quick overview of an easy, successful, inexpensive backup routine for all your Mac owners. Our goals: Create a bootable backup of a Mac, Update that backup [...]]]></description>
			<content:encoded><![CDATA[<p>My posts about <a href="http://www.libbyh.com/blog/2008/01/17/cloning-my-boot-camp-partition-to-a-new-hard-drive/">cloning at Boot Camp drive</a> and <a href="http://www.libbyh.com/blog/2008/01/28/swapping-macbook-hard-drives-including-boot-camp-partition/">swapping hard drives in a MacBook</a> are the most popular, according to Google Analytics.  Today's special treat, therefore, is a quick overview of an easy, successful, inexpensive backup routine for all your Mac owners.</p>
<p>Our goals:</p>
<ol>
<li>Create a bootable backup of a Mac,</li>
<li>Update that backup occasionally, updating only the stuff that's changed rather than copying the whole drive again, and</li>
<li>Not spending much money.</li>
</ol>
<p>What you'll need (besides a working Mac):</p>
<ul>
<li><a href="http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html" target="new">SuperDuper!</a> - the free version</li>
<li><a href="http://www.econtechnologies.com/site/Pages/ChronoSync/chrono_overview.html" target="new">ChronoSync</a> - latest version; $30 until v4.0 comes out, then price goes up to $40.  v4.0 is already late, so the price could change any day.</li>
<li>An <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FExternal-Hard-Drives-Storage-Add-Ons%2Fb%3Fie%3DUTF8%26node%3D595048%26ref%255F%3Dsr%255Ftc%255Fimg%255F2%255F0%26qid%3D1233267260&#038;tag=libbyhcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957">external hard drive</a><img src="https://www.assoc-amazon.com/e/ir?t=libbyhcom-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />* - something bigger than your internal drive.  I use a 3:1 ratio of external:internal storage</li>
</ul>
<p>Steps to make bootable and differential backups:</p>
<ol>
<li>Make a bootable backup using the free version of SuperDuper! (see the SuperDuper! user's guide for compete instructions; it comes with your download)
<p><img src="http://www.shirt-pocket.com/SuperDuper/graphics/SuperDuper-Main.gif" alt="SuperDuper main screen" /></li>
<li>Schedule syncing with ChronoSync; tell ChronoSync you're syncing two Macs (see the ChronoSync help menu for complete instructions)
<p><img src="http://www.libbyh.com/docs/chronosync.gif" alt="ChronoSync main page"  width="520" height="326" /><br />
You'll see that "cannot locate target" message in the ChronoSynce window if you forget to plug in the external drive.
        </li>
<li>Remember to leave your computer running when your backups are scheduled. I set a reminder in Google Calendar. It reminds me every week to leave my laptop running overnight so it'll backup.</li>
</ol>
<p>Making the bootable backup with SuperDuper! took just over 3 hours on my MacBook Pro with 192GB of files. ChronoSync usually takes about 2 hours to sync - only about 45 minutes if I exclude my VMWare virtual machine from the backup. My virtual machine is over 40GB now, and since it always appears as "changed" in ChronoSync's analysis, it gets backed up every time my sync task runs.</p>
<p>I'm experimenting with backing up over a network using <code>rsync</code> and <code>scp</code>. When I get that worked out, I'll post the instructions here. I'm obsessed with backup now that my dissertation is coming along. I don't want anything to happen to those files (or my pictures), so I have them (both) in quadruplicate and on 2 continents. I suggest you set up something similar for the files that are really important to you.</p>
<p><strong>*Notes on shopping for hard drives</strong><br />
Prices on external hard drives are dropping pretty fast, and you should be able to get a good deal. You can build your own external drive by buying an enclosure and an internal drive, or you can buy a ready-made external drive. Sometimes internal drives go on such a huge sale that building your own is cheaper, but ready-made externals are now competitively priced. Building your own has advantages like making the drive swappable and maybe helping you get a FireWire port for less money, and it's not hard. If you find a great deal on an enclosure and internal drive, go for it!</p>
<p>Where are these deals? I recommend checking the forums at <a href="http://www.fatwallet.com">Fat Wallet</a> first to see if any site is having a big sale. I often buy drives from <a href="http://www.newegg.com" target="new">NewEgg</a> because they have great prices, really fast shipping, and reasonable return policies. I use only Western Digital and Seagate drives.  <a href="http://www.pcmag.com/category2/0,2806,4642,00.asp">PC Mag</a> has a good review site for hard drives.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.libbyh.com/2009/01/02/backing-up-my-mac/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.303 seconds -->
