<?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>Hacker for Hire &#187; Technology</title>
	<atom:link href="http://blog.hackerforhire.org/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hackerforhire.org</link>
	<description>Burning Down People&#039;s Dreams Since That One Day ...</description>
	<lastBuildDate>Mon, 16 Jan 2012 02:39:24 +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>Stupid iPhone and Stupid Tethering</title>
		<link>http://blog.hackerforhire.org/2010/07/17/stupid-iphone-and-stupid-tethering/</link>
		<comments>http://blog.hackerforhire.org/2010/07/17/stupid-iphone-and-stupid-tethering/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 14:21:16 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips from a Hack]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tether]]></category>
		<category><![CDATA[tethering]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=416</guid>
		<description><![CDATA[The last time I installed the tethering packages from Cydia, I lost access to voicemail for 2 weeks, couldn't get them to uninstall, yada-yada-yada, annoying experience. But today, I actually had time to think about how to solve this issue and then it hit me: I'm a moron; I should have seen this last year. Five minutes later, I was on the net.]]></description>
			<content:encoded><![CDATA[<p>I was sitting at a coffee shop today I was disappointed I forgot to ask for the wifi key.  Now I could totally sit here and crack the WEP key, but that takes precious CPU and battery life and well, I just wasn&#8217;t that interested in getting the tools to compile for my Mac.  This led me to wax poetic about the days I used to have a tether to my iPhone 3G and I thought &#8230; &#8220;Man, I would sure like to be able to tether again;&#8221; but the last time, that didn&#8217;t go over so well.  The last time I installed the tethering packages from Cydia, I lost access to voicemail for 2 weeks, couldn&#8217;t get them to uninstall, yada-yada-yada, annoying experience.  But today, I actually had time to think about how to solve this issue and then it hit me:  I&#8217;m a moron, I should have seen this last year.  Five minutes later, I was on the net.<br />
<span id="more-416"></span><br />
At the very basic level, tethering is nothing more than providing a way to share your phone&#8217;s connection to the internet.  I&#8217;ve been using a similar tool for years to do the same sort of thing, <strong>ssh</strong>.  So why not just use that again?  For all you hackers out there, he&#8217;s the quick and dirty in 10 easy steps:</p>
<ol>
<li>Jail-break your iPhone.  I recommend any of the following the procedures <a href="http://gizmodo.com/tag/iphone-jailbreak/" target="_blank">here</a></li>
<li>Install SSH using Cydia</li>
<li>Setup a computer-to-computer network in whatever capacity you like (yea Mac!)</li>
<li>Join your iPhone to the computer-to-computer network</li>
<li>Open up a terminal and ping the broadcast address to find you iPhone (or whatever other method you want to find the IP address of the Iphone)</li>
<li>SSH over to your iPhone and change your password and install a public-private key pair</li>
<li>SSH back over to your iPhone using a command like this `ssh root@&lt;iphone_ip&gt; -D8080` to setup a SOCKS proxy tunnel</li>
<li>Setup your web browser to use a SOCKS proxy using any way you like (<a href="http://www.google.com/search?q=use+SSH+proxy" target="_blank">examples here</a>)</li>
<li>Open your iPhone and go to some web-page to get a 3G data IP address</li>
<li>Start surfing the web on your &#8220;tethered&#8221; iphone</li>
</ol>
<p>That&#8217;s all there is to it.  Now you can &#8220;tether&#8221; your iPhone, share the connection, whatever you want.  Oh, and AT&amp;T can&#8217;t actually &#8220;tell&#8221; you&#8217;re tethering without some effort.  Now there are obviously more things you can do to make life easier like:</p>
<ul>
<li>Installing the SSH reconnection tool</li>
<li>Disabling SSH timeouts with</li>
<li>Automatically connecting the Data IP address when you SSH</li>
</ul>
<p>However, those are left as an exercise to the reader.  Don&#8217;t you hate it when people do that?  I know I do.  Friggen jerks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2010/07/17/stupid-iphone-and-stupid-tethering/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Code Snippet Stable at 2.1.5</title>
		<link>http://blog.hackerforhire.org/2010/03/13/code-snippet-stable-at-2-1-5/</link>
		<comments>http://blog.hackerforhire.org/2010/03/13/code-snippet-stable-at-2-1-5/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 06:05:59 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[codesnippet]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=409</guid>
		<description><![CDATA[Alright, I goofed and accidentally updated a stable revision that I thought was being tested correctly and well &#8230; it wasn&#8217;t. So if you&#8217;re having issues with Code Snippet, just roll back to version 2.1.5 and life should be better. Sorry for the screw up, but this has actually brought to light some bugs I [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, I goofed and accidentally updated a stable revision that I thought was being tested correctly and well &#8230; it wasn&#8217;t.  So if you&#8217;re having issues with <a href="http://blog.hackerforhire.org/code-snippet/">Code Snippet</a>, just roll back to version 2.1.5 and life should be better.</p>
<p>Sorry for the screw up, but this has actually brought to light some bugs I never even knew were there so I&#8217;ll have those fixed up soon and we&#8217;ll be rolling again.</p>
<p>Download for 2.1.5 is here<a href="http://downloads.wordpress.org/plugin/codesnippet-20.2.1.5.zip">: http://downloads.wordpress.org/plugin/codesnippet-20.2.1.5.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2010/03/13/code-snippet-stable-at-2-1-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Denyhosts Redux</title>
		<link>http://blog.hackerforhire.org/2010/02/20/denyhosts-redux/</link>
		<comments>http://blog.hackerforhire.org/2010/02/20/denyhosts-redux/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 04:55:32 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Evil]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=402</guid>
		<description><![CDATA[It&#8217;s been a long time since I&#8217;ve actually had to think about using Denyhosts and if you&#8217;ve read my post before, you&#8217;ll know I&#8217;ll swear by it&#8217;s functionality. Recently, we&#8217;ve been getting hit by lots of SSH brute force attacks at HTG &#8230; and hit hard. The most recent stat was more than 2400 failed [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since I&#8217;ve actually had to think about using <a href="http://denyhosts.sourceforge.net/">Denyhosts</a> and if you&#8217;ve read my <a href="http://blog.hackerforhire.org/2006/01/08/denyhosts/">post before</a>, you&#8217;ll know I&#8217;ll swear by it&#8217;s functionality.</p>
<p>Recently, we&#8217;ve been getting hit by lots of SSH brute force attacks at <a href="http://htglimited.com">HTG</a> &#8230; and hit hard.  The most recent stat was more than 2400 failed login attempts from over 50 unique attackers in a 24 hour period.  Most times, I don&#8217;t care as long as they don&#8217;t get in &#8230; but then I sat back and thought, &#8220;Man, those fsckers are probably costing on bandwidth somehow.&#8221; and that&#8217;s where I draw the line.</p>
<p>So once again, <a href="http://denyhosts.sourceforge.net/">Denyhosts</a> is up and running, more than 60 hosts have been banned just today and more are going to get taken down.  Now, if only I could come up with a good <em>legal</em> reason to just give my servers the capability to attack back &#8230; but that&#8217;s not legal &#8230; yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2010/02/20/denyhosts-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick &amp; Dirty iPhone Macro Lens</title>
		<link>http://blog.hackerforhire.org/2009/03/31/quick-dirty-iphone-macro-lens/</link>
		<comments>http://blog.hackerforhire.org/2009/03/31/quick-dirty-iphone-macro-lens/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 04:26:59 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=351</guid>
		<description><![CDATA[I don&#8217;t know why I thought to do this especially since I think taking pictures on a cell phone is relatively stupid; however, I had the parts laying around and figured, &#8220;Why don&#8217;t I just see what that looks like?&#8221; Supplies Disposable Camera: $0.00 (ask your grocery store for an empty one) iPhone: $0.00 (fell [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know why I thought to do this especially since I think taking pictures on a cell phone is relatively stupid; however, I had the parts laying around and figured, &#8220;Why don&#8217;t I just see what that looks like?&#8221;</p>
<p><strong>Supplies</strong></p>
<ul>
<li>Disposable Camera: $0.00 (ask your grocery store for an empty one)</li>
<li>iPhone: $0.00 (fell off truck)</li>
<li>iPhone Soft-case (mine is an Incipio and it fell off the same truck)</li>
</ul>
<p><strong>Instructions</strong></p>
<ol>
<li>Disassemble the camera and salvage the len(s) without zapping yourself.  If you really want, you can zap yourself because some people like that &#8230; you freaks.</li>
<li>Put the lens inside the soft-case</li>
<li>Put your iPhone in the soft-case</li>
<li>Take macro pictures at a glorious 2.0 megapixels</li>
</ol>

<a href='http://blog.hackerforhire.org/2009/03/31/quick-dirty-iphone-macro-lens/p-1600-1200-90fb4005-5305-4af6-bc00-562a6655bd9ajpeg/' title='iphone-macro-3.jpeg'><img width="150" height="150" src="http://blog.hackerforhire.org/wp-content/uploads/2009/03/p-1600-1200-90fb4005-5305-4af6-bc00-562a6655bd9a-150x150.jpg" class="attachment-thumbnail" alt="iphone-macro-3.jpeg" title="iphone-macro-3.jpeg" /></a>
<a href='http://blog.hackerforhire.org/2009/03/31/quick-dirty-iphone-macro-lens/p-1600-1200-7981c2b0-8f3a-4dd2-8875-4bc9b36fb5f8jpeg/' title='iphone-macro-2.jpeg'><img width="150" height="150" src="http://blog.hackerforhire.org/wp-content/uploads/2009/03/p-1600-1200-7981c2b0-8f3a-4dd2-8875-4bc9b36fb5f8-150x150.jpg" class="attachment-thumbnail" alt="iphone-macro-2.jpeg" title="iphone-macro-2.jpeg" /></a>
<a href='http://blog.hackerforhire.org/2009/03/31/quick-dirty-iphone-macro-lens/p-1600-1200-cccceea4-a259-4599-aa64-14994deddc85jpeg/' title='iphone-macro-1.jpeg'><img width="150" height="150" src="http://blog.hackerforhire.org/wp-content/uploads/2009/03/p-1600-1200-cccceea4-a259-4599-aa64-14994deddc85-150x150.jpg" class="attachment-thumbnail" alt="iphone-macro-1.jpeg" title="iphone-macro-1.jpeg" /></a>

<p><strong>Update:</strong>  After writing this, I actually took the time to see if I was original as I though did a quick search at <a href="http://www.instructables.com/">instructables.com</a>.  Turns out, I&#8217;m not that creative:  <a href="http://www.instructables.com/id/SPH5FMOFPLXYS2R/">Cheap iphone macro lens for barcode scanning</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2009/03/31/quick-dirty-iphone-macro-lens/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Friends Don&#8217;t Let friends Use Dreamweaver</title>
		<link>http://blog.hackerforhire.org/2008/12/11/friends-dont-let-friends-use-dreamweaver/</link>
		<comments>http://blog.hackerforhire.org/2008/12/11/friends-dont-let-friends-use-dreamweaver/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 05:47:16 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[editors]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=254</guid>
		<description><![CDATA[Two of my friends and I have spent nearly 2 days fixing 5 pages that were "generated" by Dreamweaver]]></description>
			<content:encoded><![CDATA[<p>Really .. they don&#8217;t.  No one should every be allowed to &#8220;generate,&#8221; and I use that term so loosely, a website from what they create in <a href="http://www.adobe.com/products/dreamweaver/">Dreamweaver</a>.  Two of my friends and I have spent nearly 2 days fixing 5 pages that were &#8220;generated&#8221; by Dreamweaver.  Has any one ever looked at the crap HTML it generates???  It&#8217;s absolutely nuts.  The cramming of all the style sheets in to anonymous names and stuffed at the top of each HTML is beyond ridiculous.  And don&#8217;t even get me started on the static layout of all the pages it trys to render by default.  I took at page that was &#8220;generated&#8221; by Dreamweaver and ran it though the <a href="http://validator.w3.org/">W3C Markup Validation Service</a> &#8230; 138 errors.  And not hard to catch errors &#8230; they obvious really stupid errors.  Missing tags, improper style declarations, style declarations to absolutely nothing on the page; the list goes on.</p>
<p>So moral of the story &#8230; don&#8217;t let anyone use Dreamweaver to PRODUCE the live version of a website.  Build it in a REAL editor like Notepad, <a href="http://www.vim.org">Vim</a>, <a href="http://www.pnotepad.org/">The Programmer&#8217;s Notepad</a>, or <a href="http://macromates.com/">TextMate</a>.  Hell, build it in Visual Studio&#8217;s text editor &#8230; just don&#8217;t trust some bloated, crappy tool to produce something functional for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2008/12/11/friends-dont-let-friends-use-dreamweaver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickie: XMBC/Boxee Created in Linux</title>
		<link>http://blog.hackerforhire.org/2008/10/20/quickie-xmbcboxee-created-in-linux/</link>
		<comments>http://blog.hackerforhire.org/2008/10/20/quickie-xmbcboxee-created-in-linux/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 01:35:34 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips from a Hack]]></category>
		<category><![CDATA[apple tv]]></category>
		<category><![CDATA[patch stcik]]></category>
		<category><![CDATA[xbmc]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=247</guid>
		<description><![CDATA[Alright, I&#8217;m sure this will be documented much more clearly elsewhere and in a hacker-ish manner, but here&#8217;s the basic steps to make the atv-bootloader in a Linux environment so you can install Boxee or XBMC. Make sure you install the HFS/HFS+ tools for your Linux distribution. Open up the shell and roll up your [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, I&#8217;m sure this will be documented much more clearly elsewhere and in a hacker-ish manner, but here&#8217;s the basic steps to make the <a href="http://code.google.com/p/atv-bootloader/">atv-bootloader</a> in a Linux environment so you can install <a href="http://boxee.tv">Boxee</a> or <a href="http://xbmc.org">XBMC</a>.  Make sure you install the HFS/HFS+ tools for your Linux distribution.</p>
<ol>
<li>Open up the shell and roll up your sleeves</li>
<li>Get the latest from svn
<div class="codesnip-container" >
<div class="bash codesnip">wyatt<span class="sy0">@</span>hax0red:~<span class="sy0">/</span> <span class="kw2">svn</span> <span class="kw2">co</span> http:<span class="sy0">//</span>atvusb-creator.googlecode.com<span class="sy0">/</span>svn<span class="sy0">/</span>trunk<span class="sy0">/</span>atvusb-creator</div>
</div>
</li>
<li>Change into the atv-usbcreator directory and launch the creator
<div class="codesnip-container" >
<div class="bash codesnip">wyatt<span class="sy0">@</span>hax0red:~<span class="sy0">/</span>atvusb-creator$ <span class="kw2">sudo</span> .<span class="sy0">/</span>atvusb-creator.py</div>
</div>
</li>
<li>Plug in a partitioned USB drive and create the patch stick with Boxee/XBMC/whatever (which will do it wrong, but that&#8217;s ok!)</li>
<li>Now, write the <strong>real</strong> image to the device using dd like a good linux user
<div class="codesnip-container" >
<div class="bash codesnip">wyatt<span class="sy0">@</span>hax0red:~<span class="sy0">/</span>atvusb-creator$ <span class="kw2">dd</span> <span class="re2">if</span>=staging<span class="sy0">/</span>atv_512MB.img <span class="re2">of</span>=<span class="sy0">/</span>dev<span class="sy0">/</span>sdb</div>
</div>
</li>
<li>Once that&#8217;s done, pop out the USB drive and plug it back in</li>
<li>You should now be prompted to automount 2 partitions on the drive, the second should be empty</li>
<li>Copy everything from payloads into this mounted directory
<div class="codesnip-container" >
<div class="bash codesnip">wyatt<span class="sy0">@</span>hax0red:~<span class="sy0">/</span>atvusb-creator$ <span class="kw2">sudo</span> <span class="kw2">cp</span> <span class="re5">-r</span> payloads<span class="sy0">/</span>patchstick<span class="sy0">/*</span> <span class="sy0">/</span>media<span class="sy0">/</span>PATCHSTICK<span class="sy0">/</span>.</div>
</div>
</li>
</ol>
<p>Hope it works for you!  And if not, give it a few, they&#8217;ll have a Windows and Linux version working shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2008/10/20/quickie-xmbcboxee-created-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim Settings</title>
		<link>http://blog.hackerforhire.org/2008/06/03/vim-settings/</link>
		<comments>http://blog.hackerforhire.org/2008/06/03/vim-settings/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 19:58:47 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=211</guid>
		<description><![CDATA[This really isn&#8217;t for anyone else other than myself. I&#8217;m sick and tired of having to look up all the vim commands to put in my .vimrc file every time I build/logon to a new system. Maybe you&#8217;ll get some joy out of the comments. Here it is: &#8221; enable syntax highlighting because it&#8217;s pretty [...]]]></description>
			<content:encoded><![CDATA[<p>This really isn&#8217;t for anyone else other than myself.  I&#8217;m sick and tired of having to look up all the vim commands to put in my .vimrc file every time I build/logon to a new system.  Maybe you&#8217;ll get some joy out of the comments.  <a href="http://hackerforhire.org/vimrc">Here it is</a>:</p>
<div class="codesnip-container" >&#8221; enable syntax highlighting because it&#8217;s pretty and useful and it should be on by effing default!!!<br />
syntax on</p>
<p>&#8221; show the current cursor position in the bottom right cause i can&#8217;t count lines for crap<br />
set ruler</p>
<p>&#8221; show incomplete command in the lower right corner for when i forget insane vim commands<br />
set showcmd</p>
<p>&#8221; allow backspace to work and not annoy the ever living crap out of me<br />
set backspace=1</p>
<p>&#8221; jump to matching [({ thingys. sometimes i like this, sometimes i don&#8217;t<br />
set showmatch</p>
<p>&#8221; show search matches as you type because i&#8217;m generally looking for mis-speeellings<br />
set incsearch</p>
<p>&#8221; make the mouse enabled at all times because i like being able to paste crap in<br />
set mouse=a</p>
<p>&#8221; makes Vim use the indent of the previous line for a newly created line otherwise i can&#8217;t read my own code<br />
set autoindent</p>
<p>&#8221; i don&#8217;t know what this is, but if it makes my code smarter, i want to use it<br />
set smartindent</p>
<p>&#8221; highlight search results so you can actually find what you&#8217;re looking for<br />
set hlsearch</p>
<p>&#8221; lots of fun stuff for specific files<br />
filetype plugin indent on</p>
<p>&#8221; allow the EOL to be backspaced over cause i like getting the previous line too<br />
set backspace=2</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2008/06/03/vim-settings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Suggested Reading</title>
		<link>http://blog.hackerforhire.org/2008/05/06/suggested-reading/</link>
		<comments>http://blog.hackerforhire.org/2008/05/06/suggested-reading/#comments</comments>
		<pubDate>Wed, 07 May 2008 01:25:38 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[reverse engineering]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=207</guid>
		<description><![CDATA[Well, since the plane trip to Aruba is going to be a long one &#8230; anyone have some suggested reading? Someone has suggested The Art of Computer Virus Research and Defense; however, I was considering something more along the lines of Reversing: Secrets of Reverse Engineering. I&#8217;ve previously gone through The Shellcoder&#8217;s Handbook and it [...]]]></description>
			<content:encoded><![CDATA[<p>Well, since the plane trip to Aruba is going to be a long one &#8230; anyone have some suggested reading?</p>
<p>Someone has suggested <strong>The Art of Computer Virus Research and Defense</strong>; however, I was considering something more along the lines of <strong>Reversing: Secrets of Reverse Engineering</strong>.</p>
<p>I&#8217;ve previously gone through <strong>The Shellcoder&#8217;s Handbook</strong> and it was good (minus the code mistakes).  So instead of watching <a href="http://www.askaninja.com">Ask a Ninja</a> and other DVD&#8217;s any ideas of books?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2008/05/06/suggested-reading/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Make Developers Hate Your Platform</title>
		<link>http://blog.hackerforhire.org/2008/04/21/how-to-make-developers-hate-your-platform/</link>
		<comments>http://blog.hackerforhire.org/2008/04/21/how-to-make-developers-hate-your-platform/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 03:51:21 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[carbide.c++]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[e61]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[s60]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[visual stuido]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/?p=205</guid>
		<description><![CDATA[As a developer, I constantly use API&#8217;s and platforms created by others to develop software &#8230; just like every other developer in the world. Well, I got it in my head that I wanted to write an application for the S60 3rd Ed. platform, the same one that runs on my Nokia E61. So first [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer, I constantly use API&#8217;s and platforms created by others to develop software &#8230; just like every other developer in the world.</p>
<p>Well, I got it in my head that I wanted to write an application for the S60 3rd Ed. platform, the same one that runs on my Nokia E61.  So first things first, I head over and download the SDK from Symbain, which requires registration, but I&#8217;m used to that so I don&#8217;t mind.  Well, there are two downloads &#8230; the SDK files &#8230; and then the recommended IDE to build the application in without the SDK files.  Which brings me to the first way to make developers hate your platform.</p>
<p><strong>1. Make the IDE not include the SDK files</strong></p>
<p>OK, I get that not everyone wants to use Carbide.c++ to develop their application in &#8230; especially since Nokia charges for it.  And just so you know, Carbide.c++ is nothing more than Eclipse SDK with Nokia&#8217;s extra bells and whistles.</p>
<p><strong>2. Steal open source IDE&#8217;s and call them your own</strong></p>
<p>Screw that, I&#8217;ll use my copy of Visual Studio and run with it for free and not pay for your more than likely busted-ass Eclipse plug-in.  I&#8217;m sure that if I <em>really</em> wanted, I could break apart your stupid Carbide.c++  plug-in to not require any registration for all your &#8220;features&#8221; in your stolen IDE.  Whatever, I&#8217;ll start downloading the 400mb of SDK from Nokia and while that downloads and I&#8217;ll read some more on how to build a Symbian application instead of wasting my time (I like Visual Studio better for Windows style development anyway.)</p>
<p>Now if you&#8217;ve never played with a Nokia application, all of the applications have to be signed with a certificate &#8230; which is really, REALLY frustrating.  You can&#8217;t install an application unless it has been signed, which brings about the question, &#8220;Why the frick can&#8217;t I choose what to install on my phone???&#8221;  It&#8217;s my phone, if I want to melt it into a pile of goo after I write 0-s to the stupid flash module on it, I should be able to do that &#8230; especially if I&#8217;m a developer.</p>
<p>Well, alright, I&#8217;ll go get a certificate so I can test my application on my own phone.  There are a ton of places that tell you how to do this.  <a href="http://www.n91.us/nokia-n91-tips-tricks/howto-self-sign-symbian-sis-application-files-16.html">Here</a>, <a href="http://symbianwebblog.wordpress.com/2007/11/27/8/">here</a>, or <a href="http://then95blog.wordpress.com/2008/01/23/how-to-sign-symbian-applicationsagain-but-very-simple-this-time/">here</a> &#8230; but they&#8217;ve all been replaced with go to <a href="http://www.symbiansigned.com">SymbianSigned.com</a> method.  Fine, I&#8217;ll go here and get a certificate &#8230; oh wait, I can&#8217;t, I have to register to get a developer certificate.  OK, I&#8217;ll register &#8230; again &#8230; CRAP!</p>
<blockquote><p>Your email has address has been rejected as we do not accept registrations from publicly available email domains (e.g. gmail, yahoo, hotmail etc).</p></blockquote>
<p>Well, I&#8217;m glad I have another domain name in my pocket &#8230; not everyone does Symbian, you flippin&#8217; jackasses.  Alright, now I&#8217;m registered at another site (that I couldn&#8217;t use my perfered email address at) so I can get a developer certificate just for my phone.  Which brings me to my next way to make developers hate you:</p>
<p><strong>3. Make it so developers can&#8217;t test their applications without restrictions</strong></p>
<p>Trying to get a certificate results in a:</p>
<blockquote><p>
Your request has failed. Reason:<br />
-Developer Certificates will be ENABLED for users who have a Publisher ID ONLY<br />
-ONLY if you used a Publisher ID to create a .csr file with the DevCertCreate tool will you be able to use Open Signed Offline to create a Developer Certificate.<br />
-Developer Certificates are currently DISABLED for users without a Publisher ID. Users who DO NOT have a Publisher ID CANNOT request Developer Certificates or use Open Signed Offline.<br />
-If you have recently obtained a Publisher ID and are unable to create a Developer Certificate using Open Signed Offline please request support through the Symbian Signed forum on the Symbian Developer Network.
</p></blockquote>
<p><strong>4. Make the development process painful by requiring developers to send you their applications before usage.</strong></p>
<p>Well that&#8217;s just fricken great, I can&#8217;t even test my application on <strong>MY PHONE THAT I BOUGHT WITH MY MONEY</strong>.  FINE, where do I get the stupid fricken Publisher ID?  Oh wait, that&#8217;s <strong>$200</strong> per year to get a certificate (A.K.A Publisher ID) so you can take your stupid application, submit it to THEIR test center, so they can charge you <strong>$20</strong> for each submission that THEY HAVE TO TEST so that it can be Symbian signed so &#8220;normal&#8221; users can actually install your application.</p>
<p><font size="+2">F &#8211; THAT!</font></p>
<p>I&#8217;m not going to pay $200/year so I can give away an application for free.  I&#8217;ll go write apps for Windows Mobile or the fricken iPhone or some other platform because of this crap.  Screw you Symbian.  Screw you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2008/04/21/how-to-make-developers-hate-your-platform/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rails With Calendar Date Select</title>
		<link>http://blog.hackerforhire.org/2008/03/29/rails-with-calendar-date-select/</link>
		<comments>http://blog.hackerforhire.org/2008/03/29/rails-with-calendar-date-select/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 23:17:15 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[select]]></category>

		<guid isPermaLink="false">http://blog.hackerforhire.org/2008/03/29/rails-with-calendar-date-select/</guid>
		<description><![CDATA[Today, I spent 2-hours trying to figure out the correct way to implement an AJAX based call with the wonderful Calendar Date Select plugin. Now I&#8217;m sure it&#8217;s totally my fault for being a Rails noob, but I couldn&#8217;t come up with squat on Google for how to use this plugin with an server side [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I spent 2-hours trying to figure out the correct way to implement an AJAX based call with the wonderful <a href="http://code.google.com/p/calendardateselect/">Calendar Date Select</a> plugin.  Now I&#8217;m sure it&#8217;s totally my fault for being a Rails noob, but I couldn&#8217;t come up with squat on Google for how to use this plugin with an server side AJAX call.  So here&#8217;s my write up on how to do it using <strong>remote_function</strong>.<br />
<span id="more-197"></span></p>
<p>According to the documentation, if I want to use an AJAX style call, I should use the <strong>onchange</strong> attribute, which executes some JavaScript for you.  That&#8217;s cool, I can do that.  But that&#8217;s not really that helpful for trying to update the server unless you use the Ajax.Updater() like <a href="http://www.integrallis.com/ourblogs/articles/2008/01/15/building-tempo-with-rails-part-vi">these guys did</a>.  Alrighty, so now I&#8217;ve got to figure out my controller URL, build that in and then pass in some parameters to my JavaScript I&#8217;m writing inside my Rails code.</p>
<p><font size=3><strong>WRONG!</strong></font></p>
<p>The first time I saw that I had to be writing JavaScript, I should have know I was trolling the wrong websites.  I started to think and remembered that I used an AJAX call somewhere else in my code to sort a list.  No dice.  The implements sortable hides everything from me and again wasn&#8217;t even close to what I was looking for.  More searching and I finally &#8230; FINALLY &#8230; found some bastion of sanity that said you are supposed to use <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html">remote_function</a> to make AJAX based calls.  I knew this was exactly what I was looking for when I saw the name and when I read that you don&#8217;t have to write JavaScript to make it work &#8230; it writes it for you.</p>
<p>Only there was a snag.  <a href="http://code.google.com/p/calendardateselect/">Calendar Date Select</a>&#8216;s <strong>onchange</strong> gives you the function <strong>$F(this)</strong> to retrieve the date.  But it&#8217;s a JavaScript function, not a Rails function &#8230; so you have to some how get the JavaScript variable to be a Rails variable &#8230; going the other way is cake:</p>
<div class="codesnip-container" >
<div class="rails codesnip"><span class="st0">&quot;/* javascript in rails */ var t = #{@myObject.date};&quot;</span></div>
</div>
<p>So now, I started search for how to make a JavaScript variable part of a Rail&#8217;s POST request.  It&#8217;s the <strong>:with</strong> parameter.  So now my call looks like:</p>
<div class="codesnip-container" >
<div class="rails codesnip"><span class="sy0">&lt;</span>span <span class="kw1">class</span>=<span class="st0">&quot;emphasize&quot;</span><span class="sy0">&gt;</span>Scheduled <span class="kw1">for</span> <span class="sy0">&lt;</span>span id=<span class="st0">&#8216;current_show_date&#8217;</span><span class="sy0">&gt;&lt;</span> <span class="sy0">%</span>= date_no_time_format<span class="br0">&#40;</span>@<span class="kw5">show</span>.<span class="me1">date</span><span class="br0">&#41;</span> <span class="sy0">%&gt;&lt;/</span>span<span class="sy0">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&lt;</span> <span class="sy0">%</span>= calendar_date_select_tag <span class="st0">&quot;show[date]&quot;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; date_no_time_format<span class="br0">&#40;</span>@<span class="kw5">show</span>.<span class="me1">date</span><span class="br0">&#41;</span>.<span class="kw5">to_s</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re3">:time</span> <span class="sy0">=&gt;</span> <span class="kw2">false</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re3">:popup</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;force&quot;</span>, <span class="re3">:hidden</span> <span class="sy0">=&gt;</span> <span class="kw2">true</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re3"> <img src='http://blog.hackerforhire.org/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nchange</span> <span class="sy0">=&gt;</span> <span class="kw5">remote_function</span><span class="br0">&#40;</span>:<span class="kw5">update</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;current_show_date&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re3">:url</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>:action <span class="sy0">=&gt;</span> <span class="st0">&quot;update_show_date&quot;</span>, <span class="re3">:id</span> <span class="sy0">=&gt;</span> @<span class="kw5">show</span>.<span class="me1">id</span><span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re3">:with</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;&#8217;date=&#8217;+$F(this)&quot;</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">%&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span class="sy0">&lt;/</span>span<span class="sy0">&gt;</span></div>
</div>
<p>After 2-hours of trying to find this, I find the &#8220;F(this)&#8221; so true <img src='http://blog.hackerforhire.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  Well, now another problem &#8230; the date is coming across as &#8220;Monday, January 1 2009.&#8221;  Which I&#8217;m sure I can do all sorts of fun conversions on inside of the ruby code &#8230; but I don&#8217;t want to.  It&#8217;s going in the database as a <strong>DateTime</strong>, it should be passed as an ISO date.  But of course, there is no ISO date formate for <a href="http://code.google.com/p/calendardateselect/">Calendar Date Select</a>.  Fortunately, you can extend it and someone took the time to write an ISO formate for it &#8230; but they left it all busted to hell in the comments section.  So I fixed it.  Then I fixed all the <a href="http://jslint.org">jslint</a> problems with it so it would actually work in IE.  You can download it <a href='http://blog.hackerforhire.org/wp-content/uploads/2008/03/format_iso_date.js' title='ISO Formatter for Calendar Date Select'>here</a>, or copy it from here:</p>
<div class="codesnip-container" >
<div class="javascript codesnip">Date.<span class="me1">prototype</span>.<span class="me1">toFormattedString</span> <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span>include_time<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> hour<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> str <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">getFullYear</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">&quot;-&quot;</span> <span class="sy0">+</span> Date.<span class="me1">padded2</span><span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">getMonth</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="nu0">1</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">&quot;-&quot;</span> <span class="sy0">+</span>Date.<span class="me1">padded2</span><span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">getDate</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>include_time<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; hour <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">getHours</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; str <span class="sy0">+=</span> <span class="st0">&quot; &quot;</span> <span class="sy0">+</span> <span class="kw1">this</span>.<span class="me1">getHours</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">&quot;:&quot;</span> <span class="sy0">+</span> <span class="kw1">this</span>.<span class="me1">getPaddedMinutes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> str<span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="sy0">;</span></p>
<p>Date.<span class="me1">parseFormattedString</span> <span class="sy0">=</span> <span class="kw2">function</span> <span class="br0">&#40;</span>string<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">var</span> regexp <span class="sy0">=</span> <span class="st0">&quot;([0-9]{4})(-([0-9]{2})(-([0-9]{2})&quot;</span> <span class="sy0">+</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;( ([0-9]{1,2}):([0-9]{2})?&quot;</span> <span class="sy0">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;?)?)?)?&quot;</span><span class="sy0">;</span> </p>
<p>&nbsp; &nbsp; <span class="kw2">var</span> d <span class="sy0">=</span> string.<span class="me1">match</span><span class="br0">&#40;</span><span class="kw2">new</span> RegExp<span class="br0">&#40;</span>regexp<span class="sy0">,</span> <span class="st0">&quot;i&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d <span class="sy0">===</span> <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> Date.<span class="me1">parse</span><span class="br0">&#40;</span>string<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// at least give javascript a crack at it.</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> offset <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> <br />
&nbsp; &nbsp; <span class="kw2">var</span> date <span class="sy0">=</span> <span class="kw2">new</span> Date<span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; date.<span class="me1">setMonth</span><span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span> <span class="sy0">-</span> <span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">5</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; date.<span class="me1">setDate</span><span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">5</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">7</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; date.<span class="me1">setHours</span><span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">7</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">8</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; date.<span class="me1">setMinutes</span><span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">8</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; date.<span class="me1">setSeconds</span><span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; date.<span class="me1">setMilliseconds</span><span class="br0">&#40;</span>Number<span class="br0">&#40;</span><span class="st0">&quot;0.&quot;</span> <span class="sy0">+</span> d<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">4</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; offset <span class="sy0">=</span> <span class="br0">&#40;</span>Number<span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">6</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">+</span> Number<span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">8</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; offset <span class="sy0">=</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>d<span class="br0">&#91;</span><span class="nu0">5</span><span class="br0">&#93;</span> <span class="sy0">==</span> <span class="st0">&#8216;-&#8217;</span><span class="br0">&#41;</span> <span class="sy0">?</span> <span class="nu0">1</span> <span class="sy0">:</span> <span class="sy0">-</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">return</span> date<span class="sy0">;</span> <br />
<span class="br0">&#125;</span><span class="sy0">;</span></div>
</div>
<p>Drop in your as [project]/public/javascript/calendar_date_select/format_iso_date.js.  Then add the following lines to your <strong>environment.rb</strong>:</p>
<div class="codesnip-container" >
<div class="ruby codesnip"><span class="co1"># Custom Date/Time formating for CalendarDateSelect</span><br />
&nbsp; <span class="re2">CalendarDateSelect::FORMATS</span><span class="br0">&#91;</span><span class="re3">:iso_date</span><span class="br0">&#93;</span> = <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1"># Here&#8217;s the code to pass to Date#strftime</span><br />
&nbsp; &nbsp; <span class="re3">:date</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;%Y-%m-%d&quot;</span>,<br />
&nbsp; &nbsp; <span class="re3">:time</span> <span class="sy0">=&gt;</span> <span class="st0">&quot; %I:%M %p&quot;</span>, &nbsp;<span class="co1"># notice the space before time. &nbsp;If you want date and time to be seperated with a space, put the leading space here.</span><br />
&nbsp; &nbsp; <span class="re3">:javascript_include</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;format_iso_date&quot;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp; CalendarDateSelect.<span class="kw3">format</span> = <span class="re3">:iso_date</span></div>
</div>
<p>Lesson learned &#8230; if the path looks complex, it&#8217;s probably not the wrong way &#8230; but it&#8217;s more than likely not the right way.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackerforhire.org/2008/03/29/rails-with-calendar-date-select/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

