<?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>Doings</title>
	<atom:link href="http://do-boy.com/doings/feed/" rel="self" type="application/rss+xml" />
	<link>http://do-boy.com/doings</link>
	<description>what a do-boy does</description>
	<pubDate>Tue, 12 Aug 2008 03:47:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Form Field Backgrounds</title>
		<link>http://do-boy.com/doings/2008/08/form-field-backgrounds/</link>
		<comments>http://do-boy.com/doings/2008/08/form-field-backgrounds/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 03:47:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[hack]]></category>

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

		<guid isPermaLink="false">http://do-boy.com/doings/?p=8</guid>
		<description><![CDATA[At the Day Job I was called upon to make form fields with rounded corners. There&#8217;s a lot of approaches out there, but most of them are a bit too complex for my liking. Generally, it&#8217;s some variation on the old-tymey technique of putting something in the center of a 3&#215;3 table, but with DIVs [...]]]></description>
			<content:encoded><![CDATA[<p>At the Day Job I was called upon to make form fields with rounded corners. There&#8217;s a lot of approaches out there, but most of them are a bit too complex for my liking. Generally, it&#8217;s some variation on the old-tymey technique of putting something in the center of a 3&#215;3 table, but with DIVs or what-have-you.</p>
<p>Forget that, I want something simple, just a bit of CSS I can tack onto text input objects. The simple approach seemed to work:</p>
<pre>input{</pre>
<pre>   width: 90px;</pre>
<pre>   height: 26px;</pre>
<pre>   background: url(/images/text-field.png)</pre>
<pre>     no-repeat;</pre>
<pre>}</pre>
<p>…at first. It turns out Internet Explorer anchors the background image to the text field, and if you type beyond the border, the image scrolls off to the left as you type.</p>
<p>Well, that&#8217;s okay, you can just anchor the background with &#8220;background-attachment: fixed;&#8221; like so:</p>
<pre>input{</pre>
<pre>   width: 90px;</pre>
<pre>   height: 26px;</pre>
<pre>   background: url(/images/text-field.png)</pre>
<pre>     fixed no-repeat;</pre>
<pre>}</pre>
<p>Ah, but there&#8217;s a slight problem now: Firefox and Safari respond to this new attribute by not showing the background image at all. I have to say, and this could be a first for me, my opinion is that IE gets this one right. Scrolling makes sense, and a &#8220;fixed&#8221; background is the right solution.</p>
<p>But such is the life of a web developer, making things work the way they are, not the way they ought to be. So, alas, I left the &#8220;fixed&#8221; attribute out of the CSS&#8211;works for Safari and Firefox&#8211;and used jQuery&#8217;s &#8220;document ready&#8221; function for IE:</p>
<pre>$(document).ready(function(){</pre>
<pre>if ( $.browser.msie )</pre>
<pre>    $('input').css('background-attachment','fixed');</pre>
<pre>});</pre>
<p>It&#8217;s a little weak, I know, but sometimes quick and dirty is the best solution. Besides, without JavaScript, the rest of the site will fail much worse than this form field.</p>
]]></content:encoded>
			<wfw:commentRss>http://do-boy.com/doings/2008/08/form-field-backgrounds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Not Spam</title>
		<link>http://do-boy.com/doings/2008/05/not-spam/</link>
		<comments>http://do-boy.com/doings/2008/05/not-spam/#comments</comments>
		<pubDate>Wed, 28 May 2008 20:31:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[experiment]]></category>

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

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

		<category><![CDATA[multi-part]]></category>

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

		<guid isPermaLink="false">http://do-boy.com/doings/?p=7</guid>
		<description><![CDATA[My friend is embarking on a tour to promote his new book. He&#8217;ll be on the road so email is going to be the best way to announce what&#8217;s going on to interested parties. However, sending email from his Yahoo! account to multiple recipients proved problematic: emails addressed To: a complete list of recipients raised [...]]]></description>
			<content:encoded><![CDATA[<p>My friend is embarking on a tour to promote <a title="On the Lower Frequencies" href="http://softskull.com/detailedbook.php?isbn=237" target="_self">his new book</a>. He&#8217;ll be on the road so email is going to be the best way to announce what&#8217;s going on to interested parties. However, sending email from his <a title="Yahoo! Mail" href="http://mail.yahoo.com/" target="_self">Yahoo!</a> account to multiple recipients proved problematic: emails addressed To: a complete list of recipients raised some ire from people not wanting their emails revealed to other recipients.</p>
<p>The next attempt went a little better: he addressed it to himself and BCC&#8217;ed actual recipients. But so do spammers, and a lot of people never even saw this one. The alternative is to send the email over and over to each individual, which is even more work than the tedium of adding all email addresses to a BCC field with Yahoo!&#8217;s address book.</p>
<p>Obviously, this is something where a computer should be doing the heavy lifting, but the options out there are either not free, or contain intrusive ads. (Which, come to think of it, Yahoo! Mail also does.) Given the nature of the book, this is undesirable.</p>
<p>I wanted to help, so I threw together a little three-page web app to store email addresses and names, and loop over each item to send an individual email to every person. We also want to do the right thing by sending a MIME multi-part style email, so email clients do the right thing based on each user&#8217;s preferences. PHP&#8217;s mail() function, with some custom headers, to the rescue.</p>
<p>These lines set up the headers:<br />
<code><br />
$to = "\"$rname\" &lt;$remail&gt;"; # recipient<br />
$from = "\"$sname\" &lt;$semail&gt;"; # sender<br />
$headers  = 'From: ' . $from . "\n";<br />
$headers .= 'To: ' . $to . "\n";<br />
$headers .= 'Return-Path: ' . $from . "\n";<br />
$headers .= 'MIME-Version: 1.0' ."\n";<br />
$headers .= 'Content-Type: multipart/alternative; boundary="'<br />
. $boundary . '"' . "\n\n";<br />
$headers .= $body_simple . "\n";<br />
$headers .= '--' . $boundary . "\n";<br />
$headers .= 'Content-Type: text/plain; charset=ISO-8859-1' ."\n";<br />
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n";<br />
$headers .= $body_plain . "\n";<br />
$headers .= '--' . $boundary . "\n";<br />
$headers .= 'Content-Type: text/HTML; charset=ISO-8859-1' ."\n";<br />
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n";<br />
$headers .= $body_html . "\n";<br />
$headers .= '--' . $boundary . "--\n";</code></p>
<div><span><br />
</span></div>
<p>Each section of a multi-part email is set off by a unique boundary string, defined in this case as follows:</p>
<pre>$boundary = md5(uniqid(time()));</pre>
<p> </p>
<p>Now &#8220;abuse&#8221; mail() as follows:</p>
<pre>mail('', $subject,'', $headers);</pre>
<div><span>Even though &#8216;to&#8217; and &#8216;content&#8217; params are empty, the headers contain everything needed to properly deliver each message. So far, it works.</span></div>
<div>Lots of the code above is based on some sample code from <a title="PHP.net mail() page" href="http://us.php.net/manual/en/function.mail.php#57725" target="_blank">php.net</a></div>
]]></content:encoded>
			<wfw:commentRss>http://do-boy.com/doings/2008/05/not-spam/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wikipedia + iPhone</title>
		<link>http://do-boy.com/doings/2008/05/wikipedia-iphone/</link>
		<comments>http://do-boy.com/doings/2008/05/wikipedia-iphone/#comments</comments>
		<pubDate>Mon, 05 May 2008 07:46:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[experiment]]></category>

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

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

		<guid isPermaLink="false">http://do-boy.com/doings/?p=4</guid>
		<description><![CDATA[Does anyone NOT want to write a toy iPhone web application? It was pretty much the first thing I wanted to do with my new phone. I messed around with some cool JavaScript gizmos, played with the resize-on-rotate thing, and&#8230;time passed.
Today I was looking at Wikipedia and came across some information on alternate ways of [...]]]></description>
			<content:encoded><![CDATA[<p>Does anyone NOT want to write a toy iPhone web application? It was pretty much the first thing I wanted to do with my new phone. I messed around with some cool JavaScript gizmos, played with the resize-on-rotate thing, and&#8230;time passed.</p>
<p>Today I was looking at Wikipedia and came across some information on alternate ways of getting information from their database (<a title="XML formatted page about REST" href="http://en.wikipedia.org/w/query.php?titles=Representational_State_Transfer&amp;what=links&amp;format=xml" target="_blank">q.v.</a>). In particular, I was intrigued by the feature whereby you can get a list of a given Wikipedia page&#8217;s outbound links. A couple of hours later, I&#8217;ve got a crude little demo that lists a topic&#8217;s related links in pairs: the first links to a similar page with a list of links for <em>that</em> topic; the second links to the actual Wikipedia page. If you have an iPhone, <a title="iPhone link: Wikipedia Threads application" href="http://do-boy.com/ithread/">try it out</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://do-boy.com/doings/2008/05/wikipedia-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hod-Carrier</title>
		<link>http://do-boy.com/doings/2008/04/hello-world/</link>
		<comments>http://do-boy.com/doings/2008/04/hello-world/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 04:20:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[about]]></category>

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

		<guid isPermaLink="false">http://do-boy.com/doings/?p=1</guid>
		<description><![CDATA[It doesn&#8217;t seem to mean anything to anyone I talk to, but I&#8217;ve always thought of the hod-carrier as the very emblem of hard work. The construction site would grind to a halt without his quiet, dedicated labor. He toils at this thankless job, willing to let others grab the glory, content that he played a [...]]]></description>
			<content:encoded><![CDATA[<p>It doesn&#8217;t seem to mean anything to <em>anyone</em> I talk to, but I&#8217;ve always thought of the hod-carrier as the very emblem of hard work. The construction site would grind to a halt without his quiet, dedicated labor. He toils at this thankless job, willing to let others grab the glory, content that he played a small part in the overall accomplishment.</p>
<p>I&#8217;m like that hod-carrier, happy to pitch in when others have some pressing need, when there&#8217;s something needing doing that they don&#8217;t understand. They take the high-level view, they take the credit at the end, and I don&#8217;t care. I did what I did, and I&#8217;m just glad to make it all happen more smoothly.</p>
<p>That&#8217;s him there in the upper right-hand corner. Hooray for the hod-carrier!</p>
]]></content:encoded>
			<wfw:commentRss>http://do-boy.com/doings/2008/04/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

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