<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Ken Snyder - Web Development</title>
    <link>http://kendsnyder.com/</link>
    <description>PHP, JavaScript, CSS</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Mon, 11 Aug 2008 16:17:45 GMT</pubDate>

    <image>
        <url>http://kendsnyder.com/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Ken Snyder - Web Development - PHP, JavaScript, CSS</title>
        <link>http://kendsnyder.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>HTTP Status Codes: 302, 303, and 307</title>
    <link>http://kendsnyder.com/archives/15-HTTP-Status-Codes-302,-303,-and-307.html</link>
            <category>Web Development</category>
    
    <comments>http://kendsnyder.com/archives/15-HTTP-Status-Codes-302,-303,-and-307.html#comments</comments>
    <wfw:comment>http://kendsnyder.com/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://kendsnyder.com/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>nospam@example.com (Ken Snyder)</author>
    <content:encoded>
    
&lt;p&gt;Each browser has quirks for redirecting. Wikipedia has &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Http_status_codes&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Http_status_codes&quot;&gt;a quick reference of HTTP status codes.&lt;/a&gt; Today I was looking for a code that would instruct browsers to repost data to the new URL. It was much trickier than I thought.&lt;/p&gt;

&lt;p&gt;Browsers implement both 302 and 303 to mean to go to the new URL including the get query string. 307 instructs the browser to repost any post data to the new URL including the get query string. Here is what I found on Windows.&lt;/p&gt;

&lt;h3&gt;IE6 and IE7&lt;/h3&gt;
&lt;p&gt;IE properly and silently reposts as you would expect.&lt;/p&gt;

&lt;h3&gt;Firefox 2/3&lt;/h3&gt;
&lt;p&gt;Firefox asks the user to click OK to execute the repost or CANCEL to do nothing. Doing nothing might mean that the page loads up blank, which is kind of silly.&lt;/p&gt;

&lt;h3&gt;Opera 9.25&lt;/h3&gt;
&lt;p&gt;Opera is similar to Firefox but provides a third option. Opera prompts with YES to repost, NO to use get only, and CANCEL to do nothing.&lt;/p&gt;

&lt;h3&gt;Safari 3&lt;/h3&gt;
&lt;p&gt;Safari treats a 307 the same as a 303 and gives no option to repost. Technical tests from the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phaq.phunsites.net/2008/01/23/apples-safari-violates-rfc2616/&#039;);&quot;  href=&quot;http://phaq.phunsites.net/2008/01/23/apples-safari-violates-rfc2616/&quot;&gt;phaq blog.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;My solution&lt;/h3&gt;
&lt;p&gt;My solution was to use 307 for IE and use HTML and JavaScript for the other browsers. I made a form full of hidden fields for each posted value and then submitted the form through JavaScript. To users, the redirect looks as you would expect.&lt;/p&gt;&lt;p&gt;The trick was that I could not use document.forms[0].submit() because sometimes one of the hidden elements is named submit. So I had to use an additional button that was positioned with top: -100px; in the style attribute. &lt;/p&gt;&lt;p&gt;For those with JavaScript disabled, I used noscript tags to enclose a notice that the page was moved and a button to go to the new location.&lt;/p&gt;

&lt;h3&gt;Demos + Source&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://kendsnyder.com/sandbox/307/fallback/&quot;&gt;Partial solution which always does a 307 but falls back to JavaScript when user cancels&lt;/a&gt; (Does not work in Safari 3, does not work when user chooses NO in Opera 9.25.)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://kendsnyder.com/sandbox/307/javascript/&quot;&gt;Final solution which does a 307 for IE but uses JavaScript for other browsers&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Thoughts&lt;/h3&gt;
&lt;p&gt;I was surprised to see different behavior in every browser. I don&#039;t see the advantage of the prompt other than a possible security exploit. This is an instance where IE got it exactly to spec!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 07 Aug 2008 20:13:41 -0600</pubDate>
    <guid isPermaLink="false">http://kendsnyder.com/archives/15-guid.html</guid>
    
</item>
<item>
    <title>A One-Question Job Interview</title>
    <link>http://kendsnyder.com/archives/14-A-One-Question-Job-Interview.html</link>
            <category>Tech</category>
            <category>Web Development</category>
    
    <comments>http://kendsnyder.com/archives/14-A-One-Question-Job-Interview.html#comments</comments>
    <wfw:comment>http://kendsnyder.com/wfwcomment.php?cid=14</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://kendsnyder.com/rss.php?version=2.0&amp;type=comments&amp;cid=14</wfw:commentRss>
    

    <author>nospam@example.com (Ken Snyder)</author>
    <content:encoded>
    
&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.noop.nl/2008/04/the-perfect-job.html&#039;);&quot;  target=&quot;_blank&quot; href=&quot;http://www.noop.nl/2008/04/the-perfect-job.html&quot;&gt;Interesting&lt;/a&gt; article on the perfect interview question.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is the conclusion:&lt;/strong&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;em&gt;When reviewing somebody else&#039;s code, what is it that you usually find most disturbing?&lt;/em&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;An answer about syntax is a bad sign, and an answer about design principles is a good sign.&lt;/p&gt;&lt;p&gt;Definitely worth a try!&lt;/p&gt;&lt;p&gt;Here are some other questions I&#039;ve heard in interviews that are useful to discern personality, experience and intelligence:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;What are you looking for in this job that you don&#039;t have in your current job?&lt;/li&gt;&lt;li&gt;What interests you about this field and language of programming more than other fields and languages?&lt;/li&gt;&lt;li&gt;Tell me about the something that was very difficult for you to learn and why.&lt;/li&gt;&lt;li&gt;Do you consider yourself more of a fast programmer or more of a meticulous programmer?&lt;/li&gt;&lt;li&gt;On a scale of 1-10, how would you rate your interest in this position? One being &amp;quot;no thanks&amp;quot; and ten being &amp;quot;this is my dream job!&amp;quot;&lt;/li&gt;&lt;li&gt;What kind of work do you see yourself doing 5-7 years from now?&lt;/li&gt;&lt;li&gt;Which is better: client-side validation or server-side validation?&lt;/li&gt;&lt;li&gt;If you were to start an application from scratch, what code frameworks or approaches would you use and why?&lt;/li&gt;&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Wed, 25 Jun 2008 12:06:21 -0600</pubDate>
    <guid isPermaLink="false">http://kendsnyder.com/archives/14-guid.html</guid>
    
</item>
<item>
    <title>Compiled JavaScript Templating</title>
    <link>http://kendsnyder.com/archives/13-Compiled-JavaScript-Templating.html</link>
            <category>JavaScript</category>
            <category>Prototype</category>
            <category>Web Development</category>
    
    <comments>http://kendsnyder.com/archives/13-Compiled-JavaScript-Templating.html#comments</comments>
    <wfw:comment>http://kendsnyder.com/wfwcomment.php?cid=13</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://kendsnyder.com/rss.php?version=2.0&amp;type=comments&amp;cid=13</wfw:commentRss>
    

    <author>nospam@example.com (Ken Snyder)</author>
    <content:encoded>
    &lt;p&gt;I&#039;ve got my old version of CompiledTemplate online in a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pastie.org/221410&#039;);&quot;  href=&quot;http://pastie.org/221410&quot; target=&quot;_blank&quot;&gt;Pastie&lt;/a&gt;. It&#039;s got the source and a simple example. I need to finish my new version and do some benchmarking.&lt;/p&gt;&lt;p&gt;It actually isn&#039;t often useful since it is usually better to generate content on the server side.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 25 Jun 2008 08:20:05 -0600</pubDate>
    <guid isPermaLink="false">http://kendsnyder.com/archives/13-guid.html</guid>
    
</item>
<item>
    <title>Flexible, Grid-Like Layouts in CSS</title>
    <link>http://kendsnyder.com/archives/12-Flexible,-Grid-Like-Layouts-in-CSS.html</link>
            <category>CSS</category>
            <category>Web Development</category>
    
    <comments>http://kendsnyder.com/archives/12-Flexible,-Grid-Like-Layouts-in-CSS.html#comments</comments>
    <wfw:comment>http://kendsnyder.com/wfwcomment.php?cid=12</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://kendsnyder.com/rss.php?version=2.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    

    <author>nospam@example.com (Ken Snyder)</author>
    <content:encoded>
    
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I&#039;ve made some comments on &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.cssnewbie.com/argument-against-faux-absolute-positioning/#comment-3440&#039;);&quot;  href=&quot;http://www.cssnewbie.com/argument-against-faux-absolute-positioning/#comment-3440&quot;&gt;cssnewbie.com&lt;/a&gt; talking about how this technique is useful for magazine-type layouts and is actually more semantic in that case.&lt;/p&gt;

&lt;p&gt;I haven&#039;t yet wrapped my head around it, but Eric Sol has posted a wonderful &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/alistapart.com/articles/fauxabsolutepositioning&#039;);&quot;  href=&quot;http://alistapart.com/articles/fauxabsolutepositioning&quot; target=&quot;_blank&quot;&gt;A List Apart article&lt;/a&gt; about achieving flexible, grid-like layouts in CSS.&lt;/p&gt;

&lt;p&gt;Just when you assumed that everything that could be done in CSS has already been done, the geniuses at &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/alistapart.com&#039;);&quot;  href=&quot;http://alistapart.com&quot; target=&quot;_blank&quot;&gt;A List Apart&lt;/a&gt; have really come up with a potentially revolutionary technique.&lt;/p&gt;

&lt;p&gt;&lt;img height=&quot;80&quot; width=&quot;540&quot; src=&quot;http://kendsnyder.com/uploads/fap-layout-1.png&quot; /&gt;&lt;br /&gt;&lt;em&gt;Example of Faux Absolute Positioning in action. (by Eric Sol, A List Apart)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The basic idea is to use &lt;span class=&quot;code&quot;&gt;position: relative; left: 100%; margin-left: -##%&lt;/span&gt; (non-percent units such as px also work). Eric calls the technique &amp;quot;Faux Absolute Positioning&amp;quot;. The items generally have the same behavior as inline elements and avoid some of the fragility of floats. Eric explains the inspiration for the technique:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Our use case was even more complex: my team was developing a web-based WYSIWYG form generator that allows the user to drag items to arbitrary locations on a canvas. We needed to let our users create beautiful forms that didn’t use overly static layouts and to let them align columns as needed.
&lt;/p&gt;&lt;p&gt;
For example, let’s assume we want a form that puts the postal code and city fields on the same line because they are semantically connected. To accomplish this, we tried using floated positioning inspired by the Holy Grail technique. Using this method, we needed to adjust the width, borders, margins, and/or padding of the postal code field to pin the city field to a fixed horizontal position. That was a problem because if the width of the postal code field needed adjusting, or if we wanted to adjust the amount of whitespace between fields, the city field would need to move as well. The more elements on a page—the more cells in your grid—the more tedious this kind of adjustment becomes. Additionally, the positioning is sensitive to the slightest change in a number of parameters, which makes it nigh impossible to control in case of dynamic form items.
&lt;/p&gt;&lt;p&gt;
Next, we tried using absolute positioning. This gave us much more control over the positioning of the items and is robust. But absolutely positioned elements have no height, and that caused the containing element (the canvas) to collapse. This made it hard to position content without making everything absolutely positioned—which is impossible to achieve with dynamic content.&lt;/p&gt;
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Tue, 17 Jun 2008 11:12:11 -0600</pubDate>
    <guid isPermaLink="false">http://kendsnyder.com/archives/12-guid.html</guid>
    
</item>
<item>
    <title>Easing Equations</title>
    <link>http://kendsnyder.com/archives/11-Easing-Equations.html</link>
            <category>JavaScript</category>
            <category>Prototype</category>
            <category>Web Development</category>
    
    <comments>http://kendsnyder.com/archives/11-Easing-Equations.html#comments</comments>
    <wfw:comment>http://kendsnyder.com/wfwcomment.php?cid=11</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://kendsnyder.com/rss.php?version=2.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    

    <author>nospam@example.com (Ken Snyder)</author>
    <content:encoded>
    
&lt;p&gt;Robert Penner created a suite of mathematically genius actionscript functions to simulate real-life movements in Flash.  The results are compelling.&lt;/p&gt;

&lt;p&gt;A few years back, I ported Robert Penner&#039;s equations to JavaScript for use with Scriptaculous transitions. Here is &lt;a href=&quot;http://kendsnyder.com/sandbox/easing/&quot;&gt;a little playground&lt;/a&gt; I set up to test them out. They are available for download there as well. Here is &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/robertpenner.com/easing/easing_demo.html&#039;);&quot;  target=&quot;_blank&quot; href=&quot;http://robertpenner.com/easing/easing_demo.html&quot;&gt;Rober Penner&#039;s original demo&lt;/a&gt; and &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/robertpenner.com/index2.html&#039;);&quot;  target=&quot;_blank&quot; href=&quot;http://robertpenner.com/index2.html&quot;&gt;Easing Equations page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We see swinging, bouncing, and elastic movements in real life, and even a lot on Flash and even TV due to the work of Rober Penner.&lt;/p&gt;&lt;p&gt;Thomas Fuchs uses my custom bouncePast transition on &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/script.aculo.us/thomas/&#039;);&quot;  href=&quot;http://script.aculo.us/thomas/&quot; target=&quot;_blank&quot;&gt;his site&lt;/a&gt;!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 12 Jun 2008 21:41:01 -0600</pubDate>
    <guid isPermaLink="false">http://kendsnyder.com/archives/11-guid.html</guid>
    
</item>

</channel>
</rss>