<?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>nathandemick.com &#187; web development</title>
	<atom:link href="http://nathandemick.com/archive/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://nathandemick.com</link>
	<description></description>
	<lastBuildDate>Fri, 06 Apr 2012 19:58:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get Sassy!</title>
		<link>http://nathandemick.com/2012/04/get-sassy/</link>
		<comments>http://nathandemick.com/2012/04/get-sassy/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 19:58:51 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[scss]]></category>
		<category><![CDATA[werk]]></category>

		<guid isPermaLink="false">http://nathandemick.com/?p=1541</guid>
		<description><![CDATA[Wow, has it really been five months since I last posted here? Somehow, it&#8217;s not hard for me to believe. I&#8217;m breaking the blog silence proseletize the newest tech frippery I&#8217;ve become enamored with: Sass. Sass is compiled CSS. It fits in with the current (kind of stupid, in my opinion) trend of taking a [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, has it really been five months since I last posted here? Somehow, it&#8217;s not hard for me to believe. I&#8217;m breaking the blog silence proseletize the newest tech frippery I&#8217;ve become enamored with: <a href="http://sass-lang.com/">Sass</a>. </p>
<p>Sass is compiled CSS. It fits in with the current (kind of stupid, in my opinion) trend of taking a language or syntax that doesn&#8217;t need compilation, then adding a compilation step in order to get some syntactic sugar. <a href="http://coffeescript.org/">Coffeescript</a> is another example. Sass is a Ruby program that will sit in your CSS directory, scan your .scss or .sass files, then spit out .css results. With these sorts of things, you have to decide if learning new syntax will save you time later on. </p>
<p>I&#8217;m doing some CSS work for the first time in about a year, so figured I&#8217;d give Sass a shot, because I&#8217;m bored out of my mind, and need to do something to keep myself entertained. After working with it for about an hour, I was pretty much converted.</p>
<p>The main benefits I see to Sass are the nested syntax, mixins, and variables. With it, you can write CSS in a &#8220;nested&#8221; fashion, similar to how your HTML document is arranged. It makes it much easier to scan a block of Sass to see what style corresponds to what HTML element. An additional benefit is that copy/pasting large blocks of CSS is now possible, without having to remove or change the top level selectors for a rule. I&#8217;ve been able to create whole new page layouts extremely quickly using this technique. </p>
<p>Mixins and variables are just extra bonuses. Instead of having to write a bunch of vendor prefixes for box shadows or gradients, I can create a <code>box-shadow</code> mixin that can then be included in every rule that requires that style. Variables are great, too: you can just define a <code>$text-color</code> variable, then refer to it easily later without having to memorize an arcane hex value.</p>
<p>If you work in web development, I&#8217;d recommend giving Sass a try. Check out this <a href="http://37signals.com/svn/posts/3003-css-taking-control-of-the-cascade">article at 37signals.com</a> for more info, then read the <a href="http://sass-lang.com/tutorial.html">Sass tutorial</a>. Next stop: productivity!</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2012/04/get-sassy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tab wrangling in Safari</title>
		<link>http://nathandemick.com/2011/01/tab-wrangling-in-safari/</link>
		<comments>http://nathandemick.com/2011/01/tab-wrangling-in-safari/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 17:10:44 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://nathandemick.com/?p=408</guid>
		<description><![CDATA[Most people know that you can drag tabs out into their own separate window in Safari. But did you also know you can combine them again? Yep, just make sure that the tab bar is set to always be displayed (Shift + Command + T) and then you can drag tabs from one window to [...]]]></description>
			<content:encoded><![CDATA[<p>Most people know that you can drag tabs out into their own separate window in Safari. But did you also know you can combine them again? Yep, just make sure that the tab bar is set to always be displayed (Shift + Command + T) and then you can drag tabs from one window to another easily. If a window only has one tab, it&#8217;ll disappear when you move the tab to the second window. Jawesome!</p>
<p>(Also, Command + Click opens links in a new tab. When I had a scroll wheel mouse, I used the wheel click to open/close new tabs, but since I&#8217;m Magic Mousing it up, I&#8217;ve had to drop that habit.)</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2011/01/tab-wrangling-in-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE8 &#8220;Browser Mode&#8221; option</title>
		<link>http://nathandemick.com/2011/01/ie8-browser-mode-option/</link>
		<comments>http://nathandemick.com/2011/01/ie8-browser-mode-option/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 16:45:11 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://nathandemick.com/?p=404</guid>
		<description><![CDATA[Hey web developers, check this out. I&#8217;ve been using IE8 recently to do cross-browser testing, and have been using the &#8220;compatibility mode&#8221; to simulate IE7. Well apparently you can lock IE8 into running a specific mode by using the developer tools (Tools &#62; Developer Tools). Kinda nice if you want to focus on a particular [...]]]></description>
			<content:encoded><![CDATA[<p>Hey web developers, check this out. I&#8217;ve been using IE8 recently to do cross-browser testing, and have been using the &#8220;compatibility mode&#8221; to simulate IE7. Well apparently you can lock IE8 into running a specific mode by using the developer tools (Tools &gt; Developer Tools). Kinda nice if you want to focus on a particular browser, but then again you have to remember which one you&#8217;re using.<br />
<a href="http://nathandemick.com/wp-content/uploads/2011/01/ie-browser-mode.png"><img src="http://nathandemick.com/wp-content/uploads/2011/01/ie-browser-mode.png" alt="" width="642" height="196" class="aligncenter size-full wp-image-405" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2011/01/ie8-browser-mode-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro to Load Testing with JMeter (part deux!)</title>
		<link>http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter-part-deux/</link>
		<comments>http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter-part-deux/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 13:00:45 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jmeter]]></category>
		<category><![CDATA[load testing]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nathandemick.com/?p=378</guid>
		<description><![CDATA[If you&#8217;ve been following along, you&#8217;ll know that JMeter is most commonly used to do automated testing; you can create a bunch of virtual users to perform a set of pre-determined actions on your website. In my previous post, I detailed how to manually create a list of actions for your test users to perform. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been <a href="http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/">following along</a>, you&#8217;ll know that JMeter is most commonly used to do automated testing; you can create a bunch of virtual users to perform a set of pre-determined actions on your website. In my previous post, I detailed how to manually create a list of actions for your test users to perform. However, manually creating long lists of test actions is kind of a pain! Fortunately, JMeter includes a proxy utility that can intercept your browser requests and store them as user actions.</p>
<p>Fire up JMeter, and you&#8217;ll be presented with a new plan. Create a new thread group (your users) in the Test Plan (as detailed in the previous tutorial). Now, instead of manually adding HTTP Requests for these users to perform, we&#8217;ll hook up a proxy server to create the HTTP Requests for us.</p>
<p><a href="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-proxy-server-config.png"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-proxy-server-config-150x76.png" alt="" title="jmeter-proxy-server-config" width="150" height="76" class="alignleft size-thumbnail wp-image-383" /></a>Right-click on the WorkBench item in the sidebar, and select Add &gt; Non-Test Elements &gt; HTTP Proxy Server. You don&#8217;t have to configure anything here, just click the Start button at the bottom of the config window to start the proxy server on port 8080. Now you&#8217;ll have to configure your browser to pass its&#8217; requests through the proxy server. In Mac OS X, you do this system-wide by accessing your System Preferences. <a href="http://nathandemick.com/wp-content/uploads/2010/12/system-preferences-network-advanced-proxies.png"><img src="http://nathandemick.com/wp-content/uploads/2010/12/system-preferences-network-advanced-proxies-150x129.png" alt="" title="system-preferences-network-advanced-proxies" width="150" height="129" class="alignright size-thumbnail wp-image-384" /></a>Go to System Preferences &gt; Network &gt; Advanced (the &#8220;Advanced&#8221; button is in the lower-right corner of the window). When the advanced options window pops up, click the Proxies tab, then check the Web Proxy (HTTP) option, and change the Web Proxy Server port to 8080. Click OK to save your changes, then Apply to make them take effect.</p>
<p><a href="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-proxy-results.png"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-proxy-results-150x140.png" alt="" title="jmeter-proxy-results" width="150" height="140" class="alignleft size-thumbnail wp-image-382" /></a>Next, open your browser and go to the JMeter homepage (http://jakarta.apache.org/jmeter/). Click a few links, and then go back to your JMeter window. There should now be an arrow next to your thread group, meaning that the group contains some actions. Click the arrow to expand the list, and you should see requests for all the resources that you requested in your browser. You&#8217;ll see that requests have been made for <em>every</em> resource your browser asked for, such as images and CSS files. You can remove those requests if you want, or leave them in for a more realistic simulation. </p>
<p>Don&#8217;t forget to go back into your Network settings and disable the proxy server, otherwise you won&#8217;t be able to make HTTP requests when you close JMeter. However, this method of creating JMeter test cases is way easier than its&#8217; manual counterpart.</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter-part-deux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro to load testing with JMeter</title>
		<link>http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/</link>
		<comments>http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 13:00:59 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jmeter]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nathandemick.com/?p=357</guid>
		<description><![CDATA[Recently for a project at work, I was tasked with doing research into load testing software. Now, there are tons of options for load testing; in my search I found some nice-looking hosted solutions, such as browsermob.com. But of course, if you can get away with doing something for free, that&#8217;s usually the option that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently for a project at work, I was tasked with doing research into load testing software. Now, there are tons of options for load testing; in my search I found some nice-looking hosted solutions, such as <a href="http://www.browsermob.com">browsermob.com</a>. But of course, if you can get away with doing something for free, that&#8217;s usually the option that makes the most business sense (that is, if the time you invest in learning the free tool is less than the money you would save by using the easier solution). The free solution in this case is <a href="http://jakarta.apache.org/jmeter/" title="JMeter">JMeter</a>, a Java-based program maintained by the <a href="http://www.apache.org" title="Apache Foundation">Apache Foundation</a>. Since I gained a basic understanding of the software through my recent research, I thought I&#8217;d share a bit here on how to create a basic load testing script. JMeter has many more options that what I&#8217;ll detail here, but hopefully this tutorial will at least get you over the initial learning curve.</p>
<p>Obviously, first of all you should <a href="http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi">download JMeter</a>. Unzip the downloaded package, and place the whole folder structure somewhere easy to remember. If you want, you can set the /bin directory on your path so you can start the program from the command line. I just double-click the ApacheJMeter.jar package to start the program. </p>
<p>After JMeter starts up, you&#8217;ll be faced with a totally blank slate. What we want to do is create a group of users, and have each of those users perform a certain sequence of actions (such as access a URL, post a form, or whatever). There are two ways to do this with JMeter: enter the sequence by hand, or configure a proxy server to intercept your browser requests and save them as an action sequence. If the list of actions you want to perform is complex, it might be a good idea to set up a proxy. I&#8217;ll show you how to manually set up your test; running the proxy server will be reserved for a future post.</p>
<p>First, let&#8217;s rename the test plan to be something more descriptive. Click on the &#8220;Test Plan&#8221; text in the project sidebar, and rename it to something descriptive, such as &#8220;My Jawesome Test Plan.&#8221;<a href="http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/jmeter-thread-group/" rel="attachment wp-att-368"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-thread-group-150x99.png" alt="" title="jmeter-thread-group" width="150" height="99" class="alignright size-thumbnail wp-image-368" /></a> Now, the first step in creating your test scenario is to make a group of users. Right click on your test plan, then select Add > Threads (Users) > Thread Group. &#8220;Thread Group&#8221; is kind of a confusing term, so you can rename the group to &#8220;Users&#8221; if you want. When you click on your user group in the sidebar, you&#8217;ll see there are various options you can change about it, the most significant being the number of users, how fast they start performing their tasks, and whether they repeat their tasks. Change the number of users to 10, and the ramp-up period to 10 as well. That means that it&#8217;ll take 10 seconds for all the users to be activated. Since there are 10 total users, that means that one will start up each second. Change the loop count to 2, so that each user runs through their tasks twice.</p>
<p>Next, we&#8217;ll add some configuration options to the test, so that you don&#8217;t have to enter certain info each time you want to add an action for the user group to perform (such as the base site URL). Right-click your user group and select Add > Config Element > HTTP Cache Manager. This simulates a browser cache for each of your users, so if they download a static resource on the first test run, they&#8217;ll have a cached version for the second, making the test more realistic. Select the user group again, right-click, and choose Add > Config Element > HTTP Request Defaults.<a href="http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/jmeter-http-request-defaults/" rel="attachment wp-att-364"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-http-request-defaults-150x99.png" alt="" title="jmeter-http-request-defaults" width="150" height="99" class="alignleft size-thumbnail wp-image-364" /></a> You can put in any default options you want here, such as the site name, port number, and path. So for example, if you were testing your site foo.com, you could put in &#8220;http://foo.com&#8221; as the server name. Then all subsequent requests from your users would use that information. If a user requested plain ol&#8217; &#8220;bar.html,&#8221; the defaults would be prepended to that request, resulting in a request to &#8220;foo.com/bar.html.&#8221; When creating a test by hand, the Request Defaults configuration becomes very useful. For our example, let&#8217;s query the JMeter site, so in the HTTP Request Defaults options, enter &#8220;http://jakarta.apache.org&#8221; as the server name.</p>
<p><a href="http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/jmeter-http-request/" rel="attachment wp-att-365"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-http-request-150x99.png" alt="" title="jmeter-http-request" width="150" height="99" class="alignright size-thumbnail wp-image-365" /></a>OK, we&#8217;ve got the test users all set up. Next, let&#8217;s have them try to make some requests. Right click on your user group in the sidebar, and select Add > Sampler > HTTP Request. This represents a request for a single page or resource on your site. Let&#8217;s have it request the JMeter homepage. If you remember, we already set up the default site URL and path, so the only option we have to change for the sampler is the path value, which we&#8217;ll set to &#8220;/jmeter/index.html&#8221; (for the homepage). Also, change the name of the HTTP Request to &#8220;JMeter Homepage&#8221; so that it&#8217;s easier to see what it&#8217;s requesting. </p>
<p>At this point, you&#8217;ve got enough set up to actually run the test and see real results, but let&#8217;s go ahead and add another HTTP Request to the test. Right-click your user group, add another HTTP Request, and set the path to &#8220;/jmeter/usermanual/index.html.&#8221; Rename this request to &#8220;JMeter User Manual.&#8221; Now the test is completely set up, but there&#8217;s no way to view the test results yet. To remedy this, we&#8217;ll add two &#8220;listeners,&#8221; which track results and display them in a human-readable way. Right-click your user group, and select Add > Listener > Graph Results. Also Add > Listener > Summary Report. These are two simple listeners that show your results in a graph and text-based summary.</p>
<p><a href="http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/jmeter-uniform-random-timer/" rel="attachment wp-att-369"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-uniform-random-timer-150x99.png" alt="" title="jmeter-uniform-random-timer" width="150" height="99" class="alignleft size-thumbnail wp-image-369" /></a>Now, go ahead and run the test by choosing Run > Start (or Command-R). Wait for a bit for the test to finish, then click on your results listeners. You should see the (hopefully successful) results of your test. Now for some embellishments. In a more realistic scenario, users would load a page, read it for a few seconds, then click a link to go to a different page. In the test script right now, your users make requests as fast as they can. To insert a random delay between requests, right click each HTTP Request in the sidebar, and choose Add > Timer > Uniform Random Timer. This timer allows you to set a base constant delay (such as 2 seconds), and then add another random delay on top of that. I like to have a 2 second constant delay and a 3 second random delay, so go ahead and edit both timers to have values of 3000 (random) and 2000 (constant).<a href="http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/jmeter-response-assertion/" rel="attachment wp-att-366"><img src="http://nathandemick.com/wp-content/uploads/2010/12/jmeter-response-assertion-150x99.png" alt="" title="jmeter-response-assertion" width="150" height="99" class="alignright size-thumbnail wp-image-366" /></a> Also, ideally we want to make sure that the results of each request were successful. There are a number of ways to do this in JMeter, but the simplest is to make an assertion that each request returned a HTTP status code of 200. Right-click each of the HTTP Requests and choose Add > Assertions > Response Assertion. Modify each assertion to check the Response Headers, choose &#8220;Equals&#8221; for the Pattern Matching Rules, and add &#8220;200&#8243; as a Pattern to Test. The Response Assertion is very powerful&#8230; you can modify it to check for patterns in the HTML of the requested page, etc., but this basic assertion is enough for our needs right now.</p>
<p>And that&#8217;s it! You now have a fully functional basic test plan. You can run it and see a cool graph of response times as well as get the summary report for the whole test. Hopefully that will get you started with the wonderful world of load testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2010/12/intro-to-load-testing-with-jmeter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Need a messenger bag?</title>
		<link>http://nathandemick.com/2010/10/need-a-messenger-bag/</link>
		<comments>http://nathandemick.com/2010/10/need-a-messenger-bag/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 14:53:56 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[personal projects]]></category>

		<guid isPermaLink="false">http://nathandemick.com/?p=351</guid>
		<description><![CDATA[Seagull Bags is a small Columbus-based company that makes (what else?) bike messenger bags and accessories. I&#8217;ve wanted to get one of their bags for a while, since the satchel that I currently use is designed to carry vinyl records, and can&#8217;t easily hold the stuff necessary for a work commute. Well, this story actually [...]]]></description>
			<content:encoded><![CDATA[<p>Seagull Bags is a small Columbus-based company that makes (what else?) bike messenger bags and accessories. I&#8217;ve wanted to get one of their bags for a while, since the satchel that I currently use is designed to carry vinyl records, and can&#8217;t easily hold the stuff necessary for a work commute. </p>
<p>Well, this story actually started last year(!). While browsing the Seagull Bags website, noticed that they didn&#8217;t have any sort of &#8220;preview&#8221; feature for ordering their custom bags online.  I had been tinkering around with Flash for a few months, so figured I might be able to offer some sort of a trade &#8211; &#8220;programming a bag preview widget in exchange for a messenger bag&#8221; sort of thing. I also already knew Dan McKewen, the owner of Seagull, through church, so I already had an &#8220;in.&#8221; Well, Dan liked the idea, and I started mucking around, trying to create a Flex app that would be a suitable order form replacement. I actually got pretty far, in spite of my lack of knowledge regarding Flex. What held me up was that I needed some good photos of messenger bags to use in order to create a &#8220;preview&#8221; of each custom bag. Dan promised me some, but he was always busy, and the project got pushed to the back burner.</p>
<p>Fast forward to July of this year. Out of the blue, Dan said that he had photos for me, and the project lurched from the grave. It had been so long since I&#8217;d touched any sort of Flash/Flex, I didn&#8217;t want to keep trying to build on what I had previously created. Since my current job had me doing a lot of Javascript and jQuery, I decided to re-build the order form using Javascript. Javascript also had the added bonus of being accessible to Apple&#8217;s iOS devices. </p>
<p>There were a few delays (such as me trying to publish my first iOS game and the birth of my daughter), but the form eventually got done! I think it works pretty well, and gives you a decent preview of what you&#8217;re getting before you plunk down some of the cold, hard-earned. Check it out at the <a href="http://www.seagullbags.com/buy/" title="Seagull Bags">Seagull Bags</a> site.</p>
<p><strong>UPDATE</strong>: They just posted a picture of my bag on Facebook. Awesome!<br /><a href="http://nathandemick.com/wp-content/uploads/2010/10/mario-luigi-bag.jpg"><img src="http://nathandemick.com/wp-content/uploads/2010/10/mario-luigi-bag-300x200.jpg" alt="Mario &amp; Luigi!" width="300" height="200" class="alignnone size-medium wp-image-354" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2010/10/need-a-messenger-bag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Salty!</title>
		<link>http://nathandemick.com/2007/09/salty/</link>
		<comments>http://nathandemick.com/2007/09/salty/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 14:09:53 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bitter-gamer.com/?p=75</guid>
		<description><![CDATA[So, I am in no way a cryptographer&#8230; I read Neal Stephenson&#8217;s The Cryptonomicon, but that&#8217;s about it. Plus, I don&#8217;t really have to do much with password security in web apps&#8230; usually securing a directory with .htaccess is as much as I have to do. Sometimes I need to write my own session-based password [...]]]></description>
			<content:encoded><![CDATA[<p>So, I am in no way a cryptographer&#8230; I read Neal Stephenson&#8217;s <em>The Cryptonomicon</em>, but that&#8217;s about it. Plus, I don&#8217;t really have to do much with password security in web apps&#8230; usually  securing a directory with .htaccess is as much as I have to do. Sometimes I need to write my own session-based password system, due to some hosts not running Apache. Anyway, for these simple systems, the password is usually stored in plaintext&#8230; the system is in place really only to deter, not to prevent attacks. I may change my mind on this if I get screwed by it in the future, but for the present, it&#8217;s good enough. However, when creating a system that allows users to make their own accounts, more care needs to be taken. Since people often use the same password in many different areas, obtaining a password in one place can lead to identity theft. So I whipped up this cute little salt generator. Remember, if you are using a salt, you should probably store it so you can validate passwords later. There may be better encryption methods in PHP, but I&#8217;m really just scratching the surface right now.</p>
<pre>
// Encrypt the password with Blowfish and a salt - 16 chars starting with $2$
$salt='$2$';
$salt_length=16;

// Chars to choose from to generate the salt
$chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&#038;*";

//Generate the salt string
while(strlen($salt)< $salt_length)
	$salt.=$chars{mt_rand(0,strlen($chars)-1)};

$hashed_password=crypt($password, $salt);
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2007/09/salty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari 2 = no input tag styles</title>
		<link>http://nathandemick.com/2007/09/safari-2-no-input-tag-styles/</link>
		<comments>http://nathandemick.com/2007/09/safari-2-no-input-tag-styles/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 13:00:54 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bitter-gamer.com/?p=74</guid>
		<description><![CDATA[So I just realized that Safari 2 doesn&#8217;t allow text input tags to be styled. What the heck, eh? I was confused for a while, since I had been using the Safari 3 beta on Windows, and it worked there. Then I get the Mac and nothing works to style those stupid tags. With Apple&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>So I just realized that Safari 2 doesn&#8217;t allow text input tags to be styled. What the heck, eh? I was confused for a while, since I had been using the Safari 3 beta on Windows, and it worked there. Then I get the Mac and <em>nothing works</em> to style those stupid tags. With Apple&#8217;s &#8220;oh yeah, standards, we got &#8216;em haha suck it IE&#8221; attitude, I can&#8217;t believe they would leave this in. Standardization of user interface elements aside, all the other browsers do this, so it&#8217;s about darn time. My recourse is to say &#8220;Sorry!&#8221; to the Safari 2 folks. I simply can&#8217;t do anything about how crappy forms will look to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2007/09/safari-2-no-input-tag-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switchin&#8217; ain&#8217;t easy</title>
		<link>http://nathandemick.com/2007/09/switchin-aint-easy/</link>
		<comments>http://nathandemick.com/2007/09/switchin-aint-easy/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 17:39:46 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bitter-gamer.com/?p=71</guid>
		<description><![CDATA[So, I&#8217;ve had my Mac Pro for a while, and am finally starting to get used to it. For a while, though, it was super frustrating to work on; one of the hardest things about switching computing platforms is the minor inconsistencies. For example, in Windows Explorer, hitting &#8216;return&#8217; will open a selected folder, and [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve had my Mac Pro for a while, and am finally starting to get used to it. For a while, though, it was super frustrating   to work on; one of the hardest things about switching computing platforms is the minor inconsistencies. For example, in Windows Explorer, hitting &#8216;return&#8217; will open a selected folder, and &#8216;F2&#8242; will rename it. In the OS X Finder, &#8216;Command-O&#8217; opens a folder, and &#8216;return&#8217; will rename it. Mouse behavior is quite different as well, with OS X using a very non-intuitive mouse acceleration algorithm. I had just gotten used to &#8216;Home&#8217; and &#8216;End&#8217; moving my text-editor&#8217;s cursor to the beginning and end of a line, but OS X&#8217;s default behavior moves the cursor to the beginning/end of the document. </p>
<p>Fortunately for me, it&#8217;s relatively easy to edit key mappings in OS X, which means that the functionality I&#8217;m used to has mostly returned. For the mouse issue, I had to install a Microsoft mouse driver, which conflicted with the mouse control panel option for a while. </p>
<p>On a somewhat related note, have I mentioned that the Mighty Mouse is horrible? It doesn&#8217;t fit my hand at all, has a worthless &#8220;scroll wheel&#8221; nubbin, and flaky left/right-click support. Sadly, back when I was working at my old job, I had thought about buying one, even going so far as to make some low bids on eBay. I think this piece o&#8217; junk is going up there for some other sod. I do like the Mac keyboard, though (not the new, shallow version). The keys, while not clicky, have an appropriate amount of tactile feedback. The keyboard itself is much narrower than my Model M IBM keyboard, though, which took a bit of time to get used to as well. </p>
<p>All in all, I&#8217;m pretty happy about my purchase&#8230; a little bit bitter about getting the shaft in terms of RAM and HD space (1 GB/250 GB in a machine of this class? Ridiculous! Plus no Bluetooth or WiFi=superlame), but prices for that stuff will keep going down. I&#8217;m glad to be using a more versatile machine, albeit one that&#8217;s a massive investment.</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2007/09/switchin-aint-easy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web dev tips #2</title>
		<link>http://nathandemick.com/2007/08/web-dev-tips-2/</link>
		<comments>http://nathandemick.com/2007/08/web-dev-tips-2/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 16:01:10 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bitter-gamer.com/?p=68</guid>
		<description><![CDATA[So, this probably doesn&#8217;t apply to a lot of folks, but if you&#8217;re trying to use tables for page layout (i.e. for HTML emails), you may notice that Firefox inserts blank space at the bottom of each image that you just can&#8217;t get rid of. The cause is that the &#60;img&#62; tag has the &#8220;display: [...]]]></description>
			<content:encoded><![CDATA[<p>So, this probably doesn&#8217;t apply to a lot of folks, but if you&#8217;re trying to use tables for page layout (i.e. for HTML emails), you may notice that Firefox inserts blank space at the bottom of each image that you just can&#8217;t get rid of. The cause is that the &lt;img&gt; tag has the &#8220;display: inline&#8221; property, which means that Firefox allows space for &#8220;descenders&#8221; (i.e. the parts of letters that go below the baseline; examples: jgpq). The solution in table layouts is to assign each image the &#8220;display: block&#8221; property. Alternately, you can use adjust the &#8220;vertical-align&#8221; property on the image. <a href="http://www.askthecssguy.com/2006/11/inline_images_showing_a_gap_of_1.html">Here&#8217;s a page</a> with a more detailed look at the problem/solution.</p>
<p>Another thing I just wanted to mention for my own reference was short conditionals in PHP. Example:</p>
<pre>
&lt;?
	if(empty($_GET['id']))
		echo 'No ID';
	else
		echo 'ID: '.$_GET['id'];
?&gt;
</pre>
<p>Can be replaced with:</p>
<pre>
&lt;?=empty($_GET['id'])?'No ID':'ID: '.$_GET['id']?&gt;
</pre>
<p>The syntax can be broken down into CONDITIONAL ? IF TRUE : IF FALSE</p>
<p>It&#8217;s basically just a way to make your code concise and look esoteric while doing so.</p>
]]></content:encoded>
			<wfw:commentRss>http://nathandemick.com/2007/08/web-dev-tips-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

