<?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>corey gilmore's blog &#187; Development</title>
	<atom:link href="http://coreygilmore.com/blog/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://coreygilmore.com</link>
	<description></description>
	<lastBuildDate>Fri, 16 Jul 2010 16:51:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VUVUZELA for BlackBerry</title>
		<link>http://coreygilmore.com/blog/2010/06/17/vuvuzela-for-blackberry/</link>
		<comments>http://coreygilmore.com/blog/2010/06/17/vuvuzela-for-blackberry/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 00:42:18 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[VUVUZELA]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1552</guid>
		<description><![CDATA[
The preferred noisemaker of the 2010 World Cup: the vuvuzela. For some reason these were distributed to fans attending World Cup matches, ruining the match for everyone watching at home.
When played by a stadium full of people the vuvuzela sounds like angry bees. I&#039;m always up for a small project to help improve (or build) my BlackBerry [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;" ><img border="1"  class="outline size-full wp-image-1556 aligncenter"  title="VUVUZELA"  src="http://coreygilmore.com/uploads/2010/06/vuvuzela2.jpg"  alt=""  width="300"  height="186"   style="border:1px solid black;"/></p>
<p>The preferred noisemaker of the 2010 World Cup: the <a href="http://en.wikipedia.org/wiki/Vuvuzela" >vuvuzela</a>. For some reason these were distributed to fans attending World Cup matches, ruining the match for everyone watching at home.</p>
<p>When played by a stadium full of people the vuvuzela sounds like angry bees. I&#039;m always up for a small project to help improve (or build) my BlackBerry development chops, and a vuvuzela app seemed like a perfect candidate. There are a slew of vuvuzela apps for the iPhone, but I only saw one other vuvuzela app for the BlackBerry, and that one only has a <em  style="font-style:italic;font-style:italic;">single</em> vuvuzela sound.</p>
<p>Mine? It has 7.</p>
<p>I built the app with the 5.0 JDE. I tested it on a Storm2 9550 and Bold 9700 both running OS 5 and an 8820 running 4.5 and it worked on all three. If it doesn&#039;t work for some ancient OS, get a new phone.</p>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Usage</h2>
<p>Visit <a href="http://j.mp/cfg-vuvuzela" >http://j.mp/cfg-vuvuzela</a> using your BlackBerry to install the app. On newer devices the icon can be found in your Downloads folder.</p>
<p>Scroll and click a button to play the sound, or press the keys 1-7. You don&#039;t need to hold the ALT down; pressing W is the same as pressing 1. I haven&#039;t tested this on a SureType (Pearl) device.</p>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Known Issues</h2>
<ul>
<li>Multiple audio threads &#8211; This is a J2ME limitation. I use <a href="http://www.blackberry.com/developers/docs/5.0.0api/javax/microedition/media/Player.html" >javax.microedition.media.Player</a> to play the audio, and you can only have one Player instance on CDMA devices and two on GSM. I read this on the <a href="http://supportforums.blackberry.com/t5/Java-Development/Play-2-sounds-in-one-time-Storm/td-p/228712" >BlackBerry support forums</a>, and confirmed with a member of RIM&#039;s media development team.</li>
<li>Initial launch &#8211; the first time you launch the app on OS 5 it can take up to two minutes before the screen displays. Oddly enough it launches immediately on an old 8820 running OS 4.5. I&#039;m looking into why this happens.</li>
<li>Volume control &#8211; I&#039;m actually not sure where the volume setting comes from, I just play the sound and it works, and it&#039;s loud. The way the VUVUZELA should be.</li>
<li>The folks over at <a href="http://www.sistman.es/" >SistMan Software</a> also have a vuvuzela app, and there is a conflict since both of our primary modules are named Vuvuzela (Vuvuzela.cod, etc). Until that&#039;s fixed, you can&#039;t have both apps installed. I like to think mine is better since it has more sounds, but they launched first and I&#039;ll publish a minor update with a unique module name.</li>
</ul>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Download</h2>
<p><a href="http://j.mp/cfg-vuvuzela" >Download it OTA</a> &#8211; Please link to this page, and not the .jad directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/06/17/vuvuzela-for-blackberry/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Passing Multiple Automator Variables to a Shell Script</title>
		<link>http://coreygilmore.com/blog/2010/05/07/passing-multiple-automator-variables-to-a-shell-script/</link>
		<comments>http://coreygilmore.com/blog/2010/05/07/passing-multiple-automator-variables-to-a-shell-script/#comments</comments>
		<pubDate>Fri, 07 May 2010 20:30:13 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1481</guid>
		<description><![CDATA[Automator is incredibly powerful, but at the same time the most useless and semi-functional piece software I&#039;ve ever encountered. I recently built my first Automator Workflow to watermark a PDF. I wanted to load selected PDFs from the Finder, and for each PDF create a file in the same directory with a -watermark suffix appended. [...]]]></description>
			<content:encoded><![CDATA[<p>Automator is incredibly powerful, but at the same time the most useless and semi-functional piece software I&#039;ve ever encountered. I recently built my first Automator Workflow to watermark a PDF. I wanted to load selected PDFs from the Finder, and for each PDF create a file in the same directory with a -watermark suffix appended.  <strong>file1.pdf</strong> and <strong>file2.pdf</strong> would yield <strong>file1-watermark.pdf</strong> and <strong>file2-watermark.pdf</strong>.</p>
<p>It took me much too long to figure out that it wasn&#039;t easy (or maybe even possible) with Automator, even though it&#039;s simple to do from the command line.</p>
<p>Each Automator action returns a result. That result is passed to the next item in the chain, assuming the item is accepting input.  The key is to chain a series of <strong>Get Value of Variable</strong> calls together, which are passed to a shell script as <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">$1-$<em  style="font-style:italic;font-style:italic;">n</em></code> and the special <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">$@</code> variable.  I&#039;ve written a <a href="http://coreygilmore.com/blog/2010/05/07/bash-array-primer/" >short primer on using Arrays in Bash</a> that may be helpful.</p>
<p>A crappy picture is worth at least 68 words, so here is what a sample workflow looks like:<br/>
<img border="1"  src="http://coreygilmore.com/uploads/2010/05/automator-workflow.jpg"  alt=""  title="Automator Workflow"  width="630"  height="1040"  class="outline alignnone size-full wp-image-1482"   style="border:1px solid black;"/></p>
<p>You can download the <a href="http://coreygilmore.com/uploads/projects/automator-variables.zip" >sample workflow here</a>.</p>
<p>If you want to loop through selected Finder items one-at-a-time, the best way is to use Nyhthawk Productions&#039;s excellent <a href="http://automator.us/leopard/downloads/" >Dispense Items Incrementally action</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/05/07/passing-multiple-automator-variables-to-a-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash &#8211; Array Primer</title>
		<link>http://coreygilmore.com/blog/2010/05/07/bash-array-primer/</link>
		<comments>http://coreygilmore.com/blog/2010/05/07/bash-array-primer/#comments</comments>
		<pubDate>Fri, 07 May 2010 16:53:30 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1476</guid>
		<description><![CDATA[Posted mostly for my own reference since I always forget the syntax, arrays are invaluable when writing moderately complex shell scripts.  If you&#039;re writing any serious shell scripts you&#039;ll want to refer The Linux Documentation Project&#039;s excellent primers: Bash Guide for Beginners and  Advanced Bash-Scripting Guide
array.sh

#!/bin/bash
&#160;
echo &#34;&#60;&#60;&#60; Load a file into an array&#34;
echo [...]]]></description>
			<content:encoded><![CDATA[<p>Posted mostly for my own reference since I always forget the syntax, arrays are invaluable when writing moderately complex shell scripts.  If you&#039;re writing any serious shell scripts you&#039;ll want to refer <a href="http://tldp.org/guides.html" >The Linux Documentation Project&#039;s</a> excellent primers: <a href="http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html" >Bash Guide for Beginners</a> and  <a href="http://tldp.org/LDP/abs/html/index.html" >Advanced Bash-Scripting Guide</a></p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">array.sh</h3>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="sh"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">#!/bin/bash
&nbsp;
echo &quot;&lt;&lt;&lt; Load a file into an array&quot;
echo &quot;# Set the IFS (Internal Field Separator) to a newline
IFS='
'
# Load file.txt from the current directory
arr=( \$( &lt; file.txt ) )
&quot;
&nbsp;
&nbsp;
IFS='
'
arr=( $( &lt; file.txt ) )
&nbsp;
&nbsp;
echo &quot;&lt;&lt;&lt; Addressing individual array elements&quot;
echo &quot;\${arr[0]} = ${arr[0]}&quot; # the first line of the file
echo &quot;\${arr[1]} = ${arr[1]}&quot; # the second line of the file
&nbsp;
&nbsp;
echo &quot;&quot;
echo &quot;&lt;&lt;&lt; \${#VARNAME[@]} will always return the number of elements in an array&quot;
echo &quot;\$arr contains ${#arr[@]} (\${#arr[@]}) items&quot;
&nbsp;
echo &quot;&quot;
echo &quot;&lt;&lt;&lt; Loop through the array (\${arr[@]}), loading each item as \$foo.&quot;
num=1
for foo in &quot;${arr[@]}&quot; ; do
	echo &quot;Loop iteration $num: $foo&quot;
	num=$((num+1))
done
&nbsp;
&nbsp;
echo &quot;&quot;
echo &quot;&lt;&lt;&lt; Loop through the array, addressing each item with an index&quot;
num=0
while [[ $num -lt ${#arr[@]} ]] ; do
	echo &quot;Array index $num (\${arr[$num]}): ${arr[$num]}&quot;
	num=$((num+1))
done</pre></div></div>

<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">file.txt</h3>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">file line 1
file line 2
file line 3
file line 4</pre></div></div>

<p>Saving the two files above as array.sh and file.txt, and running array.sh yields:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">$./array.sh 
&lt;&lt;&lt; Load a file into an array
# Set the IFS (Internal Field Separator) to a newline
IFS='
'
# Load file.txt from the current directory
arr=( $( &lt; file.txt ) )
&nbsp;
&lt;&lt;&lt; Addressing individual array elements
${arr[0]} = file line 1
${arr[1]} = file line 2
&nbsp;
&lt;&lt;&lt; ${#VARNAME[@]} will always return the number of elements in an array
$arr contains 4 (${#arr[@]}) items
&nbsp;
&lt;&lt;&lt; Loop through the array (${arr[@]}), loading each item as $foo.
Loop iteration 1: file line 1
Loop iteration 2: file line 2
Loop iteration 3: file line 3
Loop iteration 4: file line 4
&nbsp;
&lt;&lt;&lt; Loop through the array, addressing each item with an index
Array index 0 (${arr[0]}): file line 1
Array index 1 (${arr[1]}): file line 2
Array index 2 (${arr[2]}): file line 3
Array index 3 (${arr[3]}): file line 4</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/05/07/bash-array-primer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ScreenLock for BlackBerry</title>
		<link>http://coreygilmore.com/blog/2010/03/08/screenlock-for-blackberry/</link>
		<comments>http://coreygilmore.com/blog/2010/03/08/screenlock-for-blackberry/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 21:26:03 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[JDE]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1406</guid>
		<description><![CDATA[Adam Zeis from CrackBerry recently asked for an application to lock your BlackBerry screen, since the recently leaked 5.0.0.536 for the BlackBerry 9700 removed the icon.
I needed an excuse to add my new signing to the JDE, and quickly threw together an app (with an ugly icon) to lock your screen.
ScreenLock OTA (.jad) Installation
ScreenLock Offline [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/azeis/" >Adam Zeis</a> from <a href="http://crackberry.com/" >CrackBerry</a> <a href="http://twitter.com/azeis/status/10186820993" >recently asked</a> for an application to lock your BlackBerry screen, since the recently leaked 5.0.0.536 for the BlackBerry 9700 removed the icon.</p>
<p>I needed an excuse to add my new signing to the JDE, and quickly threw together an app (with an ugly icon) to lock your screen.</p>
<p><a href="http://coreygilmore.com/ota/screenlock/ScreenLock.jad" >ScreenLock OTA (.jad) Installation</a><br/>
<a href="http://coreygilmore.com/ota/screenlock/ScreenLock.zip" >ScreenLock Offline (.alx) Installation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/03/08/screenlock-for-blackberry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AppleScript to generate a SecurID token and automatically connect to a Cisco VPN</title>
		<link>http://coreygilmore.com/blog/2010/02/04/applescript-to-generate-a-securid-token-and-automatically-connect-to-a-cisco-vpn/</link>
		<comments>http://coreygilmore.com/blog/2010/02/04/applescript-to-generate-a-securid-token-and-automatically-connect-to-a-cisco-vpn/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:33:33 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[RSA]]></category>
		<category><![CDATA[SecurID]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1359</guid>
		<description><![CDATA[Apple obviously hates copy and paste. They didn&#039;t add it to the iPhone for years, and even when they did add it, they only briefly allowed users to paste into the VPN password field, removing it with one of the first incremental updates to OS 3.0.  Luckily there&#039;s an app for that &#8211; CopyPasteFix, [...]]]></description>
			<content:encoded><![CDATA[<p>Apple obviously hates copy and paste. They didn&#039;t add it to the iPhone for years, and even when they did add it, they only briefly allowed users to paste into the VPN password field, removing it with one of the first incremental updates to OS 3.0.  Luckily there&#039;s an app for that &#8211; <a href="http://modmyi.com/cydia/package.php?id=13960" >CopyPasteFix</a>, only for jailbroken iPhones.</p>
<p>And then came Snow Leopard, OS X 10.6. They included built-in IPSEC VPN, freeing users from the shackles of the <em  style="font-style:italic;font-style:italic;">horrible</em> Cisco IPSEC client. But yet again, Apple decided that users don&#039;t need to copy and paste text into the password field.</p>
<p>For anyone with a <abbr title="One time password" >OTP soft token (like a RSA SecurID), this is a pain in the ass. Half the benefits of generating a passcode on the same device that you&#039;re using it on, are not having to type it.</abbr></p>
<p>Enter AppleScript, everyone&#039;s favorite natural language that thinks it&#039;s acceptable to use apostrophes when referencing variables.  I&#039;ve never actually written an AppleScript longer than <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">tell application "iTunes" to playpause</code> so this was new ground for me. <a href="http://twitter.com/hildjj" >Joe</a> mentioned he has a similar script for junky non-RSA soft token solution he uses, but he left the country immediately after taunting me with the prospect of getting the code.</p>
<p>If you&#039;re doing <em  style="font-style:italic;font-style:italic;">any</em> moderately serious AppleScript development, I highly recommend <a href="http://www.latenightsw.com/sd4/index.html" >Script Debugger</a> from Late Night Software. It was invaluable to seeing what objects and properties were <em  style="font-style:italic;font-style:italic;">really</em> available, and troubleshooting errors.</p>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">What it does</h2>
<ul>
<li>Prompts for your SecurID PIN (you can save this in the script, I highly recommend you NOT do that)</li>
<li>Launches the <a href="http://www.rsa.com/node.aspx?id=3552" >SecurID application</a> (it if it&#039;s running it will quit it first), generates a token, stores the token in a variable, and then quits the SecurID application</li>
<li>Kicks off the VPN connection process, types in the generated passcode when the window is available, and logs in.</li>
</ul>
<p>If there&#039;s any type of a banner with terms to accept, it won&#039;t click OK there.</p>
<p>Download the script, view the source code and read more at the <a href="http://coreygilmore.com/projects/automated-securid-token-generation-and-vpn-login-applescript/" >project page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/02/04/applescript-to-generate-a-securid-token-and-automatically-connect-to-a-cisco-vpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seagal-arific</title>
		<link>http://coreygilmore.com/blog/2010/02/01/seagal-arific/</link>
		<comments>http://coreygilmore.com/blog/2010/02/01/seagal-arific/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 23:19:05 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[Steven Seagal]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1341</guid>
		<description><![CDATA[A couple weeks ago I announced my intent to codename all my future projects after Steven Seagal movies.
My first Seagal-themed project is off to a roaring start, and I built a custom DMG packaging script purely so I could force the beta testers to look at Seagal&#039;s (self described?) &#034;striking and somewhat boyishly handsome&#034; mug [...]]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago I <a href="http://twitter.com/coreygilmore/status/8017360598" >announced my intent</a> to codename all my future projects after <a href="http://www.imdb.com/name/nm0000219/" >Steven Seagal</a> movies.</p>
<p>My first Seagal-themed project is off to a roaring start, and I built a custom DMG packaging script purely so I could force the beta testers to look at Seagal&#039;s (self described?) <a href="http://www.imdb.com/name/nm0000219/bio" >&#034;striking and somewhat boyishly handsome&#034;</a> mug while they rush to install the latest build of my project.</p>
<p>Beta testers, this is what you have to look forward to for the next release!</p>
<p><img src="http://coreygilmore.com/uploads/2010/02/project-atl.jpg"  alt=""  title="Project ATL - custom DMG"  width="462"  height="401"  class="alignnone size-full wp-image-1342" /></p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/02/01/seagal-arific/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manipulate a plist from the command line</title>
		<link>http://coreygilmore.com/blog/2010/01/28/manipulate-a-plist-from-the-command-line/</link>
		<comments>http://coreygilmore.com/blog/2010/01/28/manipulate-a-plist-from-the-command-line/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 16:43:23 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1338</guid>
		<description><![CDATA[Since OS X 10.5 a command called PlistBuddy has been available.
It&#039;s useful for things like extracting the version number out of your Info.plist during a Run Script Build Phase.
PlistBuddy wasn&#039;t in my existing path, I found it at /usr/libexec/PlistBuddy
Example Usage

/usr/libexec/PlistBuddy -c &#34;Print :CFBundleVersion&#34; Info.plist

Outputs: 0.14, or whatever the value of the CFBundleVersion key in Info.plist [...]]]></description>
			<content:encoded><![CDATA[<p>Since OS X 10.5 a command called <a href="http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man8/PlistBuddy.8.html" >PlistBuddy</a> has been available.</p>
<p>It&#039;s useful for things like extracting the version number out of your Info.plist during a <a href="http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/200-Build_Phases/bs_build_phases.html" >Run Script Build Phase</a>.</p>
<p>PlistBuddy wasn&#039;t in my existing path, I found it at <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">/usr/libexec/PlistBuddy</code></p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Example Usage</h3>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">/usr/libexec/PlistBuddy -c &quot;Print :CFBundleVersion&quot; Info.plist</pre></div></div>

<p>Outputs: 0.14, or whatever the value of the <em  style="font-style:italic;font-style:italic;">CFBundleVersion</em> key in Info.plist is.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2010/01/28/manipulate-a-plist-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix PHP 5.3 hang on Windows</title>
		<link>http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/</link>
		<comments>http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 22:55:29 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1274</guid>
		<description><![CDATA[I just upgraded to PHP 5.3 on my Windows development box, and ran into an issue making any database connection with the MySQL and MySQLi drivers.  Pages not making any database connections worked fine, but any page with a database connection would sit and hang for about a minute, and then throw an error.
PHP [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded to PHP 5.3 on my Windows development box, and ran into an issue making any database connection with the MySQL and MySQLi drivers.  Pages not making any database connections worked fine, but any page with a database connection would sit and hang for about a minute, and then throw an error.</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>PHP Warning:  mysqli::mysqli(): [2002] A connection attempt failed because the connected party did not  (trying to connect via tcp://localhost:3306) in xxx.php on line 2<br/>
PHP Warning:  mysqli::mysqli(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.<br/>
 in xxx.php on line 2</p></blockquote>
<p><a href="http://bugs.php.net/bug.php?id=45150" >PHP bug #45150</a> suggests that this is due to issues resolving localhost on Windows.  This is partially correct, more specifically it&#039;s an issue with localhost resolving to ::1 when IPv6 is enabled.</p>
<p>While it feels like Windows has shoehorned in IPv6 support, the blame seems to lie with MySQL, which <a href="http://forge.mysql.com/worklog/task.php?id=798" >won&#039;t support IPv6 until version 6.0</a>.</p>
<p>I&#039;m not sure why the timeout isn&#039;t instant, the port is closed, so it could be partially a problem with PHP or Windows.</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">&gt; nmap -sT -p 80,3306,3389 -6 ::1
&nbsp;
Starting Nmap 5.00 ( http://nmap.org ) at 2009-11-20 15:48 Mountain Standard Time
Interesting ports on cfg64 (::1):
PORT     STATE  SERVICE
80/tcp   closed http
3306/tcp closed mysql
3389/tcp open   ms-term-serv
&nbsp;
Nmap done: 1 IP address (1 host up) scanned in 3.14 seconds</pre></div></div>

<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">The Fix</h3>
<p>Open up <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">%windir%\system32\drivers\etc\hosts</code> with a text editor and comment out the line that looks like:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">::1             localhost</pre></div></div>

<p>Prefix it with a #, like so:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">#::1             localhost</pre></div></div>

<p>Save it and your PHP/MySQL connections will immediately begin working.  You could also use 127.0.0.1 in your connection string instead of localhost, but I didn&#039;t want to change code in innumerable files.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Helper Application to View the Event Log on a BlackBerry Storm</title>
		<link>http://coreygilmore.com/blog/2009/11/02/helper-application-to-view-the-event-log-on-a-blackberry-storm/</link>
		<comments>http://coreygilmore.com/blog/2009/11/02/helper-application-to-view-the-event-log-on-a-blackberry-storm/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:06:48 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Event Log]]></category>
		<category><![CDATA[OTA]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1234</guid>
		<description><![CDATA[When Verizon shocked the world by releasing OS 5.0 for the 9530 Storm, the OS unfortunately shipped with a bug that prevents users from viewing the event log.
To view the Event Log on a Storm you need to switch to the Home screen, show the keyboard, and activate alt/num lock by holding down the &#039;123&#039; [...]]]></description>
			<content:encoded><![CDATA[<p>When Verizon shocked the world by <a href="http://coreygilmore.com/blog/2009/10/25/official-os-5-0-for-the-blackberry-storm-9530/" >releasing OS 5.0</a> for the 9530 Storm, the OS unfortunately shipped with a bug that prevents users from viewing the event log.</p>
<p>To view the Event Log on a Storm you need to switch to the Home screen, show the keyboard, and activate alt/num lock by holding down the &#039;123&#039; button.  Once alt is &#039;locked&#039;, press <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">"</code>, <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">/</code>, <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">"</code>, <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">/</code>.  That&#039;s double-quote, forward-slash, double-quote, forward-slash.  On all the QWERTY devices you can type <code  style="display:inline; font: 1.1em 'Courier New'display:inline; font: 1.1em 'Courier New'CourierCourierFixed; padding:0 1px;Fixed; padding:0 1px;">ALT+LGLG</code>.</p>
<p>The OS <del>released</del> approved for release by Verizon (application version 5.0.0.328, bundle 508) doesn&#039;t have a Show Keyboard menu item on the home screen, leaving users with no way to view the event log or configure any event log filters.</p>
<p>I thew together a quick little application that does one thing, and one thing only, launch the Event Log Viewer.</p>
<p>OTA install: <a href="http://coreygilmore.com/ota/eventviewer/EventViewer.jad" >http://coreygilmore.com/ota/eventviewer/EventViewer.jad</a><br/>
Desktop Manager install: <a href="http://coreygilmore.com/ota/eventviewer/EventViewer.zip" >http://coreygilmore.com/ota/eventviewer/EventViewer.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/11/02/helper-application-to-view-the-event-log-on-a-blackberry-storm/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Apple treats all iPhone developers equally &#8211; like crap</title>
		<link>http://coreygilmore.com/blog/2009/07/23/apple-treats-all-iphone-developers-equally-like-crap/</link>
		<comments>http://coreygilmore.com/blog/2009/07/23/apple-treats-all-iphone-developers-equally-like-crap/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 23:06:49 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Latitude]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1184</guid>
		<description><![CDATA[Today Google released Google Latitude for the iPhone, something BlackBerry and Android users have been enjoying for quite some time.
One paragraph in particular jumped out at me, emphasis mine:
We worked closely with Apple to bring Latitude to the iPhone in a way Apple thought would be best for iPhone users. After we developed a Latitude [...]]]></description>
			<content:encoded><![CDATA[<p>Today Google released <a href="http://googlemobile.blogspot.com/2009/07/google-latitude-now-for-iphone.html" >Google Latitude for the iPhone</a>, something BlackBerry and Android users have been enjoying for quite some time.</p>
<p>One paragraph in particular jumped out at me, emphasis mine:</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>We worked closely with Apple to bring Latitude to the iPhone in a way Apple thought would be best for iPhone users. <strong><span style="text-decoration: underline;" ><strong>After</strong></span> we developed a Latitude application for the iPhone, Apple requested we release Latitude as a web application </strong>in order to avoid confusion with Maps on the iPhone, which uses Google to serve maps tiles.</p></blockquote>
<p>So Google was working &#034;closely&#034; with Apple, built a native iPhone application<sup>1</sup> for <a href="http://www.google.com/latitude/" >Latitude</a>, and then Apple essentially rejected it and told them to build a web application.  Isn&#039;t building an entire application only to have it wholly rejected one of the leading complaints about the nightmarish <a href="http://www.google.com/search?hl=en&amp;q=app+store+approval+process+sucks" >App Store approval process</a>?</p>
<ol class="footnotes" ><li id="footnote_0_1184"  class="footnote" >I&#039;d love to see a build of this <a href="http://coreygilmore.com/contact/" >leaked out</a> so jailbreak users could run it</li></ol>]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/07/23/apple-treats-all-iphone-developers-equally-like-crap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Export a private key from a Java keystore</title>
		<link>http://coreygilmore.com/blog/2009/06/03/export-a-private-key-from-a-java-keystore/</link>
		<comments>http://coreygilmore.com/blog/2009/06/03/export-a-private-key-from-a-java-keystore/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 11:59:35 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[keytool]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1016</guid>
		<description><![CDATA[While trying to install my SSL certificate in JBoss one approach was to combine all your certificates into a PKCS12 keystore.  To do this you need to export the private key from your JKS keystore, and then use openssl to export your chained certificates into a new keystore.
The links on Atomeo are dead, and [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to install my <a href="http://coreygilmore.com/blog/2009/06/02/install-a-go-daddy-ssl-certificate-for-use-with-jboss-or-the-bes-5-bas/" >SSL certificate in JBoss</a> one approach was to combine all your certificates into a PKCS12 keystore.  To do this you need to export the private key from your JKS keystore, and then use openssl to export your chained certificates into a new keystore.</p>
<p>The links on <a href="http://www.atomeo.com/2007/10/how-to-install-godaddy-wildcard-ssl.html" >Atomeo</a> are dead, and the cached copy of the code threw some errors with JDE 1.6.  Eventually I stumbled across a post by <a href="http://www.anandsekar.com/2006/01/19/exporting-the-private-key-from-a-jks-keystore/" >Anand Rajasekar</a> containing <a href="http://coreygilmore.com/uploads/2009/06/exportprivatekey.zip" >ExportPrivateKey.zip</a> which can be used to export the private key from a JKS keystore.</p>
<p>The syntax is:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">java -jar ExportPrivateKey.zip {keystore_path} JKS {keystore_password} {alias} {target_file}</pre></div></div>

<div class="codesnip-container" >To export the private key from <em  style="font-style:italic;font-style:italic;">web.keystore</em> for a certificate with the alias <em  style="font-style:italic;font-style:italic;">bas</em> to the file <em  style="font-style:italic;font-style:italic;">bas.key</em> you&#039;d run:</div>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">java -jar ExportPrivateKey.zip web.keystore JKS KEYSTORE_PASSWORD bas bas.key</pre></div></div>

<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Related Resources</h3>
<p><a href="http://mark.foster.cc/blog/" >Mark Foster</a> maintains an excellent <a href="http://conshell.net/wiki/" >wiki</a> with resources on <a href="http://conshell.net/wiki/index.php/Keytool_to_OpenSSL_Conversion_tips" >Keytool to OpenSSL</a> and <a href="http://conshell.net/wiki/index.php/OpenSSL_to_Keytool_Conversion_tips" >OpenSSL to Keytool</a> conversion (among other things).</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/06/03/export-a-private-key-from-a-java-keystore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion Implicit Struct Creation Oddness</title>
		<link>http://coreygilmore.com/blog/2009/06/02/coldfusion-implicit-struct-creation-oddness/</link>
		<comments>http://coreygilmore.com/blog/2009/06/02/coldfusion-implicit-struct-creation-oddness/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 01:20:25 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=1021</guid>
		<description><![CDATA[Totally unexpected behavior, possibly showing some insight into how the Adobe&#039;s implementation of implicit struct creation works behind the scenes.  I&#039;d be curious to see if this different in Railo1

&#60;cfscript&#62;
wsConfig = {
 root = &#34;https://example.com/baaws/&#34;,
 corews = wsConfig.root &#38; &#34;core/ws?wsdl&#34;,
 utilws = wsConfig.root &#38; &#34;core/wsutil?wsdl&#34;,
 dispatcherws = wsConfig.root &#38; &#34;dispatcher/ws?wsdl&#34;,
 emailexchangews = wsConfig.root &#38; [...]]]></description>
			<content:encoded><![CDATA[<p>Totally unexpected behavior, possibly showing some insight into how the Adobe&#039;s implementation of <a href="http://www.simonwhatley.co.uk/implicit-structures-in-coldfusion-8" >implicit struct creation</a> works behind the scenes.  I&#039;d be curious to see if this different in <a href="http://www.getrailo.org/" >Railo</a><sup>1</sup></p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
wsConfig = {
 root = &quot;https://example.com/baaws/&quot;,
 corews = wsConfig.root &amp; &quot;core/ws?wsdl&quot;,
 utilws = wsConfig.root &amp; &quot;core/wsutil?wsdl&quot;,
 dispatcherws = wsConfig.root &amp; &quot;dispatcher/ws?wsdl&quot;,
 emailexchangews = wsConfig.root &amp; &quot;emailexchange/ws?wsdl&quot;,
 emaildominows = wsConfig.root &amp; &quot;emaildomino/ws?wsdl&quot;,
 emailgroupwisews = wsConfig.root &amp; &quot;emailgroupwise/ws?wsdl&quot;
};
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

<p>You&#039;re able to reference a member of the wsConfig struct before the struct is even created!  At least before I&#039;d expect it to be created.  To accomplish the same thing (avoid using temporary variables to create the object, but define my root URL for reuse) in PHP (without using <a href="http://php.net/unset" >unset()</a>) I&#039;d do something like:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="php"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #000000; font-weight: bold;" >&lt;?php</span>
<span style="color: #000088;" >$wsConfig</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span>
 root <span style="color: #339933;" >=&gt;</span> <span style="color: #0000ff;" >'https://example.com/baaws/'</span><span style="color: #339933;" >,</span>
<span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
&nbsp;
<span style="color: #000088;" >$wsConfig</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span>
 root <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span><span style="color: #339933;" >,</span>
 corews <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'core/ws?wsdl'</span><span style="color: #339933;" >,</span>
 utilws <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'core/wsutil?wsdl'</span><span style="color: #339933;" >,</span>
 dispatcherws <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'dispatcher/ws?wsdl'</span><span style="color: #339933;" >,</span>
 emailexchangews <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'emailexchange/ws?wsdl'</span><span style="color: #339933;" >,</span>
 emaildominows <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'emaildomino/ws?wsdl'</span><span style="color: #339933;" >,</span>
 emailgroupwisews <span style="color: #339933;" >=&gt;</span> <span style="color: #000088;" >$wsConfig</span><span style="color: #009900;" >&#91;</span><span style="color: #0000ff;" >'root'</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'emailgroupwise/ws?wsdl'</span><span style="color: #339933;" >,</span>
<span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
<span style="color: #000000; font-weight: bold;" >?&gt;</span></pre></div></div>

<p>In this case the second time I reference $wsConfig I&#039;m using the values from the first copy.  The first copy isn&#039;t destroyed until after the second copy is set.</p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Performance Impact</h3>
<p>The first question I have is if there is any performance impact to creating a large struct implicitly versus using a Java object.  In Adobe ColdFusion it seems the largest struct you can implicitly create <em  style="font-style:italic;font-style:italic;">outside</em> of a function is one with 16319 members.  Inside of a function the limit appears to be 3451 members.</p>
<p>Build yourself a testcase using the following code, or <a href="http://coreygilmore.com/uploads/2009/06/struct-cfm.txt" >download a pre-assembled testcase</a>:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfsetting</span> enablecfoutputonly<span style="color: #0000FF;" >=</span><span style="color: #009900;" >&quot;yes&quot;</span> showdebugoutput<span style="color: #0000FF;" >=</span><span style="color: #009900;" >&quot;no&quot;</span><span style="color: #0000FF;" >&gt;</span></span>
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
writeoutput(&quot;&amp;lt;cfscript&amp;gt;<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #000000; font-weight: bold;" >br</span> <span style="color: #0000FF;" >/&gt;</span></span>struct = {<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #000000; font-weight: bold;" >br</span> <span style="color: #0000FF;" >/&gt;</span></span>&quot;);
for( x = 1; x LT 16319; x = x+1 ) {
	writeoutput(&quot;abc<span style="color: #0000FF;" >#x#</span> = 'abc<span style="color: #0000FF;" >#x#</span>',<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #000000; font-weight: bold;" >br</span> <span style="color: #0000FF;" >/&gt;</span></span>&quot; );
}
x = x+1;
writeoutput(&quot;abc<span style="color: #0000FF;" >#x#</span> = 'abc<span style="color: #0000FF;" >#x#</span>'<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #000000; font-weight: bold;" >br</span> <span style="color: #0000FF;" >/&gt;</span></span>&quot; );
writeoutput(&quot;};<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #000000; font-weight: bold;" >br</span> <span style="color: #0000FF;" >/&gt;</span></span>&amp;lt;/cfscript&amp;gt;&quot;);
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

<p>I&#039;m not sure if you can use Java to implicitly create a struct (coldfusion.runtime.Struct in Adobe CF) or implicitly create a java.lang.object.  Implicit creation of a large struct is much faster than creating a struct repeatedly calling StructInsert() (<a href="http://coreygilmore.com/uploads/2009/06/timer-cfm.txt" >download testcase</a>).</p>
<ol class="footnotes" ><li id="footnote_0_1021"  class="footnote" ><a href="http://openbluedragon.org/" >OpenBD</a> doesn&#039;t support implicit creation yet.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/06/02/coldfusion-implicit-struct-creation-oddness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install a Go Daddy SSL Certificate for use with JBoss or the BES 5 BAS</title>
		<link>http://coreygilmore.com/blog/2009/06/02/install-a-go-daddy-ssl-certificate-for-use-with-jboss-or-the-bes-5-bas/</link>
		<comments>http://coreygilmore.com/blog/2009/06/02/install-a-go-daddy-ssl-certificate-for-use-with-jboss-or-the-bes-5-bas/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 21:39:40 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[BAS]]></category>
		<category><![CDATA[BES]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Go Daddy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=993</guid>
		<description><![CDATA[I&#039;m working on an application that uses the BlackBerry Enterprise Server 5.0 API and I wanted to install a valid SSL certificate to make development easier since it&#039;s a bit of a pain to trust self-signed certificates with ColdFusion.  I figured that a $12.99 SSL certificate from Go Daddy was cheap compared to the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#039;m working on an application that uses the BlackBerry Enterprise Server 5.0 API and I wanted to install a valid SSL certificate to make development easier since it&#039;s a bit of a pain to trust self-signed certificates with ColdFusion.  I figured that a <a href="http://www.google.com/search?q=go+daddy+%2412.99+ssl&amp;ie=UTF-8" >$12.99</a> SSL certificate from Go Daddy was cheap compared to the trouble I was having with ColdFusion.  Big mistake.</p>
<p>99% of these instructions apply to JBoss as well as the BlackBerry Administration Service (BAS) which is running on top of JBoss.  I read a few guides on installing a SSL Certificate in JBoss, but ran into issues with each of them.</p>
<p>For anyone who only needs vanillla JBoss instructions I&#039;ll flag BAS-specific items that can be ignored.  Some guides will have you extract the private key from your certificate and generate a PKCS12 keystore using openssl.  I&#039;m intentionally not taking that approach to avoid modifying the BAS server.xml.</p>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Installation</h2>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Outline</h3>
<p>The process goes like this:</p>
<ol>
<li>Generate a new key, optionally create a new keystore</li>
<li>Generate a <abbr title="Certificate Signing Request" >CSR</abbr></li>
<li>Purchase the SSL certificate</li>
<li>Prepare chained certificates &#8211; gather root certificate, intermediate certificates, reply</li>
<li>Import certificates</li>
<li>Install new certificate</li>
</ol>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Prerequisites</h3>
<p>Everything will be easier if you keep all the related files in a single location initially.</p>
<ol>
<li>Create a directory called &#034;<strong>req</strong>&#034; and open a new command prompt inside of it.</li>
<li>Choose a keystore name and certificate alias.  In the examples I&#039;m using <em  style="font-style:italic;font-style:italic;">web.keystore</em> and <em  style="font-style:italic;font-style:italic;">bas </em>respectively.<br/>
(<em  style="font-style:italic;font-style:italic;">BAS only</em>) the keystore name must be <strong>web.keystore</strong></li>
<li>Locate keytool.exe in the JRE bin directory. On my server it was in <strong>C:\Program Files\Java\jre1.6.0_07\bin\keytool.exe</strong></li>
<li>(<em  style="font-style:italic;font-style:italic;">BAS only</em>)Back up the current keystore file located in <em  style="font-style:italic;font-style:italic;"><span><span class="filepath" >&lt;drive:\program files&gt;</span></span></em><strong><span><span class="filepath" >\Research In Motion\BlackBerry Enterprise Server\BAS\bin\web.keystore</span></span></strong><span><span class="filepath" ><br/>
<em  style="font-style:italic;font-style:italic;"><strong>Note:</strong></em> Most likely this is in </span></span><span><span class="filepath" ><em  style="font-style:italic;font-style:italic;">&lt;drive&gt;</em></span></span><span><span class="filepath" ><strong>:\Program Files\</strong> unless you&#039;re on 64-bit Windows, in which case it will be <em  style="font-style:italic;font-style:italic;">&lt;drive&gt;</em><strong>:\Program Files (X86)</strong></span></span><strong></strong></li>
<li>(<em  style="font-style:italic;font-style:italic;">BAS only</em>)You&#039;ll need to know your current keystore password, use that whenever prompted for a password.  If you want to set a new password you will need to change the cacerts keystore password in the BlackBerry Server Configuration.<br/>
<strong><a href="http://coreygilmore.com/wp-content/uploads/2009/06/bas-cert.png"  rel="lightbox[993]" ><img class="alignnone size-full wp-image-996"  title="BAS - cacerts keystore"  src="http://coreygilmore.com/wp-content/uploads/2009/06/bas-cert.png"  alt="BAS - cacerts keystore"  width="194"  height="243"   style="border: none;"/></a></strong></li>
</ol>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Step 1 &#8211; Generate the Key</h3>
<pre>keytool -genkey -alias <em  style="font-style:italic;font-style:italic;">bas</em> -keyalg RSA -keystore <em  style="font-style:italic;font-style:italic;">web.keystore</em></pre>
<p>This will generate a new key with the alias <em  style="font-style:italic;font-style:italic;">bas</em> and create a new keystore in <em  style="font-style:italic;font-style:italic;">web.keystore</em> (if it doesn&#039;t exist).  (<em  style="font-style:italic;font-style:italic;">BAS only</em>) When prompted for a password us your current BAS cacert password.</p>
<p>Press RETURN when prompted for a key password to use the keystore password.  Replace <em  style="font-style:italic;font-style:italic;">bas.example.com</em> with the hostname you are purchasing a SSL certificate for.  Replace <em  style="font-style:italic;font-style:italic;">bas</em> and <em  style="font-style:italic;font-style:italic;">web.keystore</em> with the keystore name and certificate alias you chose in the Prerequisites section.</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">C:\req&gt;keytool -genkey -alias bas -keyalg RSA -keystore web.keystore
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  bas.example.com
What is the name of your organizational unit?
  [Unknown]:  bas.example.com
What is the name of your organization?
  [Unknown]:  bas.example.com
What is the name of your City or Locality?
  [Unknown]:  Denver
What is the name of your State or Province?
  [Unknown]:  CO
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=bas.example.com, OU=bas.example.com, O=bas.example.com, L=Denver, ST=CO, C=US correct?
  [no]:  yes
&nbsp;
Enter key password for
        (RETURN if same as keystore password):</pre></div></div>

<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Step 2 &#8211; Generate the CSR</h3>
<p>Next you must generate a Certificate Signing Request (CSR) to submit to Go Daddy (or whoever you&#039;ve chosen).</p>
<pre>keytool -certreq -keyalg RSA -alias <em  style="font-style:italic;font-style:italic;">bas</em> -file <em  style="font-style:italic;font-style:italic;">bas.example.com.csr</em> -keystore <em  style="font-style:italic;font-style:italic;">web.keystore</em></pre>
<p>Provide your keystore password when prompted.  This will generate a CSR from <em  style="font-style:italic;font-style:italic;">web.keystore</em> for the <em  style="font-style:italic;font-style:italic;">bas</em> entry.</p>
<p>The CSR should look something like:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">-----BEGIN NEW CERTIFICATE REQUEST-----
MIIBuTCCASICAQAweTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNPMQ8wDQYDVQQHEwZEZW52ZXIx
GDAWBgNVBAoTD2Jhcy5leGFtcGxlLmNvbTEYMBYGA1UECxMPYmFzLmV4YW1wbGUuY29tMRgwFgYD
VQQDEw9iYXMuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMNSDrG1vAxX
zaEelgKxl2Sr7zxTdUh+muoBN/uBiLrIZjMzz278tmqbKbZ3+ok4ZB99Pzto5SLKnpi1i8tuHL51
unGXqAZRCSQgN7agT4HqURsURjKEPJsvjR7pjRKcPOzmCYaus2KeOAP8BHCPCGZbZRlAS7aND3Qi
r4ArNFjrAgMBAAGgADANBgkqhkiG9w0BAQUFAAOBgQAs4avQ2JiUfAA2N2hOHwbPE7Wax5kIIldS
RNIpSW2jButL4YdbNoj1BgVGtY1D+/9vOUnMYWl63rHRGv1StTHzaqsZE3Wmb8b5epZbzfKe9p0b
pewqnuGnwcqTz9HRkR+rXizF0vPGnyKWQKRYuqFxtnCqVYXDbWYxv32qgggtQQ==
-----END NEW CERTIFICATE REQUEST-----</pre></div></div>

<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Step 3 &#8211; Purchase the SSL Certificate</h3>
<p>Open the generated CSR up in a text editor( eg, notepad <em  style="font-style:italic;font-style:italic;">bas.example.com.csr</em>) and paste the contents into the CSR Data field on Go Daddy.You&#039;re given the choice of which issuing organization to use (Starfield Root or Godaddy Root), and the Web Server Type.  I chose <strong>Starfield Root</strong>. The Web Server Type <em  style="font-style:italic;font-style:italic;">must</em> be <strong>Tomcat</strong>.</p>
<p><img border="1"  class="outline alignnone size-full wp-image-1010"  title="Go Daddy SSL Request - CSR Data"  src="http://coreygilmore.com/wp-content/uploads/2009/06/csr-data.png"  alt="Go Daddy SSL Request - CSR Data"  width="377"  height="263"   style="border:1px solid black;"/></p>
<p>Once you&#039;ve verified the ownership of the domain you will receive a zip file containing the SSL certificate and the intermediate certificates.</p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Step 4 &#8211; Prepare chained certificates</h3>
<p>Extract the contents of the the zip file (mine was named certbundle.zip) into your <strong>req</strong> working directory.  If you chose Starfield Root for the issuing organization you should have the following files in <strong>req</strong>:</p>
<ul>
<li><strong>web.keystore</strong> &#8211; Your keystore file</li>
<li><strong>bas.example.com.csr</strong> &#8211; Your generated CSR</li>
<li><strong>bas.example.com.crt</strong> &#8211; Your certificate response</li>
<li><strong>sf_bundle.crt</strong> (or <strong>gd_bundle.crt</strong>) &#8211; Bundled intermediate certificates</li>
<li><strong>sf_intermediate.crt</strong> (or <strong>gd_intermediate.crt</strong>) &#8211; Intermediate certificate</li>
<li><strong>sf_cross_intermediate.crt</strong> (or <strong>gd_cross_intermediate.crt</strong>) &#8211; Cross intermediate certificate</li>
</ul>
<p>I&#039;m not sure if this step is 100% necessary, but I did it and my certificate worked.  Download the appropriate root certificate for your issuing organization and save it into your <strong>req</strong> working directory &#8211; Starfield Root (<a href="https://certs.godaddy.com/repository/sfsroot.crt" >sfsroot.crt</a>) or Go Daddy Root (<a href="https://certs.godaddy.com/repository/gd-class2-root.crt" >gd-class2-root.crt</a>).</p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Step 5 &#8211; Import Certificates</h3>
<p>Once you&#039;ve gathered the various certificates they must be imported into your keystore.  The root and intermediate certificate are used to establish a chain of trust which eventually ends with your self-signed keystore.</p>
<ol>
<li>Import the root certificate (sfsroot.crt or gd-class2-root.crt)
<pre>keytool -import -alias root -keystore web.keystore -trustcacerts -file sfsroot.crt</pre>
</li>
<li>Import the cross intermediate certificate (sf_cross_intermediate.crt or gd_cross_intermediate.crt)
<pre>keytool -import -alias cross -keystore web.keystore -trustcacerts -file sf_cross_intermediate.crt</pre>
</li>
<li>Import the intermediate certificate (sf_intermediate.crt or gd_intermediate.crt)
<pre>keytool -import -alias intermed -keystore web.keystore -trustcacerts -file sf_intermediate.crt</pre>
</li>
<li>Import your reply. The alias you use here <strong>MUST</strong> match the alias you used when you generated the certificate in Step 1.
<pre>keytool -import -alias bas -keystore web.keystore -trustcacerts -file bas.example.com.crt</pre>
<p>The output should be similar to:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">C:\req&gt;keytool -import -alias bas -keystore web.keystore -trustcacerts -file bas.example.com.crt
Enter keystore password:
Certificate reply was installed in keystore</pre></div></div>

</li>
</ol>
<p>Your request is now complete, and your keystore contains a trusted, signed request.  You can verify this:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">C:\req&gt;keytool -list -keystore web.keystore -storetype jks
Enter keystore password:
&nbsp;
Keystore type: JKS
Keystore provider: SUN
&nbsp;
Your keystore contains 1 entry
&nbsp;
bas, Jun 2, 2009, PrivateKeyEntry,
Certificate fingerprint (MD5): F4:63:44:DA:33:BA:C2:2A:C3:0E:6C:92:AB:E9:45:12</pre></div></div>

<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Step 6 &#8211; Install the Certificate</h3>
<h4  style="font-size: 1.2em; margin: 20px 0 0;font-size: 1.2em; margin: 20px 0 0;">JBoss</h4>
<p>Install and activate your new keystore using the instructions on the <a href="http://www.jboss.org/community/wiki/sslsetup" >JBoss SSL Setup wiki page</a>.  If you&#039;ve followed all the steps properly you will have a JKS-type keystore, <em  style="font-style:italic;font-style:italic;">not</em> PKCS12.</p>
<h4  style="font-size: 1.2em; margin: 20px 0 0;font-size: 1.2em; margin: 20px 0 0;">BAS</h4>
<ol>
<li>Back up your <em  style="font-style:italic;font-style:italic;">web.keystore</em> file if you haven&#039;t already.</li>
<li>If the new keystore has a different password than the current keystore change the password in the <strong>BlackBerry Server Configuration</strong> tool, under the <strong>Administration Service &#8211; Cacerts keystore</strong> tab.</li>
<li>Stop the BAS services &#8211; BlackBerry Administration Service &#8211; Native Code Container and BlackBerry Administration Service &#8211; Application Server.</li>
<li>Rename <em  style="font-style:italic;font-style:italic;"><span><span class="filepath" >&lt;drive:\program files&gt;</span></span></em><strong><span><span class="filepath" >\Research In Motion\BlackBerry Enterprise Server\BAS\bin\web.keystore</span></span></strong><span><span class="filepath" > to </span></span><em  style="font-style:italic;font-style:italic;"><span><span class="filepath" >web.keystore.original</span></span></em></li>
<li><span><span class="filepath" >Copy <em  style="font-style:italic;font-style:italic;">web.keystore</em> from your <strong>req</strong> working directory into the BAS\bin directory.</span></span></li>
<li><span><span class="filepath" >Restart the BAS services &#8211; starting the Application Server service will automatically start the Native Code Container service.<br/>
</span></span></li>
</ol>
<p>Browse to your BAS using HTTPS and verify the server is working correctly.  To undo the changes stop the BAS services, delete <em  style="font-style:italic;font-style:italic;">web.keystore</em> and rename <em  style="font-style:italic;font-style:italic;">web.keystore.original</em> to <em  style="font-style:italic;font-style:italic;">web.keystore</em>.  Restart the BAS services, which are now using the original, working keystore.</p>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Troubleshooting</h2>
<ul>
<li>When importing your reply you <em  style="font-style:italic;font-style:italic;">must</em> use the same alias as you did to generate the original key which was used to generate the CSR.</li>
<li>The key password <em  style="font-style:italic;font-style:italic;">must</em> match the keystore password.</li>
<li>(<em  style="font-style:italic;font-style:italic;">BAS only</em>) The keystore filename <em  style="font-style:italic;font-style:italic;">must</em> be web.keystore</li>
<li>(<em  style="font-style:italic;font-style:italic;">BAS only</em>) The keystore password <em  style="font-style:italic;font-style:italic;">must</em> match what is entered in <strong>BlackBerry Server Configuration</strong> &gt; <strong>Administration Service &#8211; Cacerts keystore</strong></li>
<li>(<em  style="font-style:italic;font-style:italic;">BAS only</em>) Open the highest-numbered &lt;<em  style="font-style:italic;font-style:italic;">servername</em>&gt;_BBAS-AS_01_<em  style="font-style:italic;font-style:italic;">YYYYMMDD</em>_00##.txt log file and search for <em  style="font-style:italic;font-style:italic;">error</em>, <em  style="font-style:italic;font-style:italic;">ssl</em> and <em  style="font-style:italic;font-style:italic;">keystore</em> for information about why the server didn&#039;t start.  Most commonly this will be a password mismatch between the keystore and the BAS or a missing certificate.</li>
<li>Verify the keystore using <em  style="font-style:italic;font-style:italic;">keytool -list</em>.</li>
<li>If the keystore is valid but the certificate is shown to be issued by <em  style="font-style:italic;font-style:italic;">bas.example.com</em> instead of Go Daddy or Starfield you most likely did not import your reply (Step 5, <em  style="font-style:italic;font-style:italic;">keytool -import &#8230; bas.example.com.crt</em>)  using the same alias as the generated key (Step 1, <em  style="font-style:italic;font-style:italic;">keytool -genkey</em>).</li>
</ul>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Resources</h2>
<p>The following sites were helpful:</p>
<ul>
<li><a href="https://certs.godaddy.com/Tomcat.go" >Go Daddy Tomcat SSL Installation instructions</a></li>
<li><a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html" >keytool documentation</a></li>
<li><a href="http://www.jboss.org/community/wiki/sslsetup" >JBoss SSL Setup</a></li>
<li><a href="http://www.atomeo.com/2007/10/how-to-install-godaddy-wildcard-ssl.html" >How to install a Go Daddy Wildcard Certificate on JBoss</a></li>
<li><a href="http://na.blackberry.com/eng/deliverables/8322/Import_new_SSL_cert_for_BAS_WD_432582_11.jsp" >Import a new SSL certificate for the BlackBerry Administration Service and BlackBerry Web Desktop Manager</a></li>
<li><a href="https://certs.godaddy.com/Repository.go" >Go Daddy Certificate Repository</a></li>
<li><a href="http://portecle.sourceforge.net/" >Portecle</a> &#8211; A wonderful Java GUI application for managing keystores and certificates.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/06/02/install-a-go-daddy-ssl-certificate-for-use-with-jboss-or-the-bes-5-bas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The App Store is full of sex</title>
		<link>http://coreygilmore.com/blog/2009/05/22/the-app-store-is-full-of-sex/</link>
		<comments>http://coreygilmore.com/blog/2009/05/22/the-app-store-is-full-of-sex/#comments</comments>
		<pubDate>Fri, 22 May 2009 17:00:22 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=973</guid>
		<description><![CDATA[Eucalyptus is $9.99 book reading app that was rejected by Apple because you could search for objectionable content.
I suspect that no-one at Apple knows how genuinely torturous the app store approval process is for developers personally after a rejection. When they hold the key to the only distribution pipe for something you’ve spent a lot [...]]]></description>
			<content:encoded><![CDATA[<p>Eucalyptus is $9.99 book reading app that was <a href="http://www.blog.montgomerie.net/whither-eucalyptus" >rejected by Apple</a> because you could search for objectionable content.</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>I suspect that no-one at Apple knows how genuinely torturous the app store approval process is for developers personally after a rejection. When they hold the key to the only distribution pipe for something you’ve spent a lot of your time on &#8211; in my case a year &#8211; something you’re hoping could provide you with a livelihood &#8211; and polite email enquiries are not replied to &#8211; not even with an autoresponder, it is extremely frustrating. I don’t think I’ve ever felt as powerless in my life (and I’ve had to deal with US immigration authorities…).</p></blockquote>
<p>I suspect quite a few people at Apple know what a nightmare the App Store approval process is, but I doubt a single one of them is in a position to do anything about it.  Apple Inc. is no more likely to publicly acknowledge a problem than the Catholic church, and the App Store approval process <span style="text-decoration: line-through;" >is Apple&#039;s abortion</span> is sure to be a sensitive topic.</p>
<p>When the basis of approval is subjective, you need talented, intelligent and rational people making decisions and passing jdugement.  Good luck finding that combination in someone who is willing to earn $30k/year to run iPhone apps all day searching for boob pictures or profanity.</p>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Objectionable Content</h2>
<p>For your enjoyment, here are a few of the titillating terms that Apple objected to.  I&#039;ve no doubt that by posting this text my site will be masturbation fodder for teens everywhere.</p>
<ul>
<li><strong>Auparishtaka or mouth congress</strong> &#8211; Another way of saying fellatio, but I can see how the term mouth congress is totally hot.</li>
<li><strong>Lingam</strong> &#8211; Penis.  It&#039;s about time someone came up with a non-scientific way to refer to the male genitalia.</li>
<li><strong>Yoni</strong> &#8211; Vaginia &#8211; definitely the most offensive 4-letter word you can use to describe one.</li>
</ul>
<h2  style="font-size: 1.6em; margin: 20px 0 0;font-size: 1.6em; margin: 20px 0 0;">Fill in the Blanks</h2>
<p>Sometimes it&#039;s what is left out that counts.  See if you can guess what the missing words are.</p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Assets</h3>
<p>I&#039;ve removed three words from the following paragraph.</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>The qualities of good <span class="ks1-1" >______</span>(1.1) are that they should be bright, well set, clean, entire, convex, soft, and <span class="ks1-2" >______</span>(1.2) in appearance. <span class="ks1-1" >______</span>(1.1) are of three kinds according to their size:</p>
<p>Small<br/>
Middling<br/>
Large</p>
<p>Large <span class="ks1-1" >______</span>(1.1), which give grace to the <span class="ks1-3" >______</span>(1.3), and attract the hearts of women from their appearance, are possessed by the Bengalees.</p></blockquote>
<h4  style="font-size: 1.2em; margin: 20px 0 0;font-size: 1.2em; margin: 20px 0 0;">Good Qualities</h4>
<p>5 words this time, have at it.</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>The qualities of good  <span class="ks2-1" >______</span>(2.1) are as follows: They should be equal, possessed of a pleasing brightness, capable of being <span class="ks2-2" >______</span>(2.2), of proper proportions, <span class="ks2-3" >______</span>(2.3), and with <span class="ks2-4" >______</span>(2.4) ends.</p>
<p>The defects of <span class="ks2-1" >______</span>(2.1) on the other hand are that they are blunt, protruding from the <span class="ks2-5" >______</span>(2.5), rough, soft, large, and loosely set.</p></blockquote>
<p>There you have it.  Smut! Pornography!  It&#039;s obvious that this needs to be kept out of the hands of young children, so they can safely peruse Google Images with their morality intact.<br/>
a<br/>
<noscript>Answers after the jump.</noscript></p>
<p><span id="more-973" ></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">Answers</h3>
<p><a href="javascript:showAnswers();void(0);" >Fill in the blanks</a> or use your imagination.<br/>
<strong>Assets<br/>
</strong>1.1: nails<br/>
1.2: glossy<br/>
1.3: hands</p>
<p><strong>Good Qualities</strong><br/>
2.1: teeth<br/>
2.2: coloured<br/>
2.3: unbroken<br/>
2.4: sharp<br/>
2.5: gums</p>
<pre>
<script type="text/javascript" >
function showAnswers() {
	var answers = {
		"1-1": "nails",
		"1-2": "glossy",
		"1-3": "hands",
		"2-1": "teeth",
		"2-2": "coloured",
		"2-3": "unbroken",
		"2-4": "sharp",
		"2-5": "gums"
	};
	for( var k in answers ) {
		jQuery("div.entry span.ks"+k).html(unescape("%3Cu%3E")+answers[k]+unescape("%3C/u%3E"));
	}
}
</script>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/05/22/the-app-store-is-full-of-sex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wishlist for the ColdFusion Advisory Committee</title>
		<link>http://coreygilmore.com/blog/2009/04/17/coldfusion-advisory-committee-wishlist/</link>
		<comments>http://coreygilmore.com/blog/2009/04/17/coldfusion-advisory-committee-wishlist/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 21:36:18 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[OpenBD]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=909</guid>
		<description><![CDATA[I only recently learned about the CFML Advisory Committee, but I was impressed that such a thing would even exist.  I suppose with two open source CFML engines (Open BlueDragon and Railo) it was only a matter of time, but without buy-in from Adobe the utility of such an organization is seriously limited. Fortunately [...]]]></description>
			<content:encoded><![CDATA[<p>I only recently learned about the <a href="http://opencfml.org/" >CFML Advisory Committee</a>, but I was impressed that such a thing would even exist.  I suppose with two open source CFML engines (<a href="http://www.openbluedragon.org/" >Open BlueDragon</a> and <a href="http://www.getrailo.org/" >Railo</a>) it was only a matter of time, but without buy-in from Adobe the utility of such an organization is seriously limited. Fortunately Adobe <em  style="font-style:italic;font-style:italic;">has</em> bought in and has members on the committee.</p>
<p>I&#039;m not sure what percentage of my time I spend working with ColdFusion, but whenever I do I always run into arbitrary limitations or inconsistencies that are incredibly obnoxious.  It gives ColdFusion the feeling of a language that was started by one group of people, picked up half-finished by another group with many features are implemented very shallowly in order to meet a ship date.  And all too often Adobe never looks back to address those flaws.  Hopefully the CFML Advisory Committee will address these flaws.</p>
<p>A great example blatantly rushing a feature is the implicit creation of structs and arrays.  With the initial release of ColdFusion 8.0 you could use { } and [ ] notation to create both inside of a CFSCRIPT block, but you couldn&#039;t nest them until the release of ColdFusion 8.0.1</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
// This only works in Adobe ColdFusion 8.0.1+
someStruct = {
 key1 = {
  subKey1 = 'xyz'
 }
};
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

<p>I&#039;m hesitant to email my entire wishlist the Committee as <a href="http://corfield.org/blog/index.cfm/do/blog.entry/entry/The_CFML_Advisory_Committee" >Sean suggested</a>, but I did want to write it out and solicit some feedback.  Some of these are specific to Adobe ColdFusion (such as var declaration positions), and there is the possibility that some of the issues are fixed or under consideration to be fixed in the upcoming release of <a href="http://labs.adobe.com/wiki/index.php/Centaur" >CF 9 Centaur</a>.</p>
<h3  style="font-size: 1.3em; padding: 0; margin: 20px 0 0;font-size: 1.3em; padding: 0; margin: 20px 0 0;">ColdFusion/CFML Wishlist (or gripes)</h3>
<ul>
<li>Consistency between cfscript, cfml functions. cfquery, cfdump, and all of the other functions missing from CFSCRIPT</li>
<li>Allow var declarations anywhere (<strong>Note:</strong> Supported in <a href="http://wiki.openbluedragon.org/wiki/index.php/Compatibility:CFCs" >OpenBD</a>)</li>
<li>Fully document CFQUERYPARAM type mapping (cf_sqltype_* to actual SQL type)</li>
<li>Fully document the SQL commands/functions available for CFQUERY Query-of-Queries</li>
<li>Ordered structs &#8211; I can&#039;t think of a good reason not to preserve the order of items.</li>
<li>Implicit creation of structs with case sensitive names and names containing spaces

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
struct = {
 'one key' = 'abc',
 'mixedCase' = 'def'
};
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

</li>
<li>Support a more standard struct declaration format.

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
struct = {
	key: 'val',
	orKey =&amp;gt; 'val'
};
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

</li>
<li>Pass implicitly created objects as function arguments.</li>
<li>Allow [] notation to append to arrays.

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
someArr = [ 'one, 'two', 'three' ];
someArr[] = 'four';
// someArr is now [ 'one, 'two', 'three', 'four' ]
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

</li>
<li>NO WHITESPACE RESIDUE FROM ANY CFML CODE &#8211; Seriously, don&#039;t leave a mess when you&#039;re parsing. Every byte counts.</li>
<li>Defined way to pass <em  style="font-style:italic;font-style:italic;">any</em> variable by reference</li>
<li>Allow optional args and default values in cfscript function declarations</li>
<li>True eval() function. I want to be able to dynamically parse code. DE and EVALUATE are about as healthy as cigarettes.</li>
<li>Public/private key encryption added to cfencrypt w/o needing <a href="http://www.bouncycastle.org/" >Bouncy Castle</a>. OK, this one is probably just for me :)</li>
<li>Zero-based arrays. I bet people that like 1-based arrays also hang their toilet paper <a href="http://currentconfig.com/2005/02/22/essential-life-lesson-1-over-is-right-under-is-wrong/" >under instead of over</a>. Savages.</li>
<li>A better way to handle caching, such as named caches so that you can expire individual caches easier if/when they need to change. (<strong>Note:</strong> Supported in <a href="http://wiki.openbluedragon.org/wiki/index.php/CFQUERY" >OpenBD</a> and <a href="http://wiki.getrailo.org/wiki/3-1-Tags:CFQuery" >Railo</a>)</li>
<li>Dynamic function calls. Also check out the PHP <a href="http://php.net/call_user_func_array" >call_user_func_array</a> function.

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
function printPrefix(str) {
	writeoutput(&quot;PREFIX: <span style="color: #0000FF;" >#str#</span>\n&quot;);
}
func = &quot;printPrefix&quot;;
<span style="color: #0000FF;" >#func#</span>(&quot;test&quot;);
// Outputs:
//  PREFIX:TEST
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

</li>
<li><a href="http://en.wikipedia.org/wiki/Ternary_operation" >Ternary operator</a>. WTF? Anyone who is thinking about suggesting <a href="http://cfquickdocs.com/cf8/#IIf" >IIF</a> should stop right now. IIF doesn&#039;t even come close to being true ternary operator.</li>
<li>Improved For-In loops &#8211; Loop through structs with keys/values, like <a href="http://php.net/foreach" >foreach</a> in PHP

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span>
for( key =&amp;gt; val IN someStruct ) {
	writeoutput(&quot;someStruct[<span style="color: #0000FF;" >#key#</span>] = <span style="color: #0000FF;" >#val#</span>\n&quot;);
}
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >cfscript</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

</li>
<li>StructValueArray &#8211; Return an array of all the values from a struct (just as StructKeyArray returns an array of all the keys). (<strong>Note:</strong> <a href="http://mattwoodward.com/blog/" >Matt</a> has <a href="http://groups.google.com/group/openbluedragon-issue-tracking/msg/70ea0df42735cc16" >requested this</a> for OpenBD.)</li>
</ul>
<p>In a perfect world things like zero-based array indexes and ordered structs could be set at the application level to maintain backwards compatibility, but I&#039;d even settle for server-wide.</p>
<p>Leave a comment if I&#039;m missing compatibility for one of the CFML engines and I&#039;ll update the post accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/04/17/coldfusion-advisory-committee-wishlist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The VAR parameter to the renderOutput function is required but was not passed in.</title>
		<link>http://coreygilmore.com/blog/2009/03/26/the-var-parameter-to-the-renderoutput-function-is-required-but-was-not-passed-in/</link>
		<comments>http://coreygilmore.com/blog/2009/03/26/the-var-parameter-to-the-renderoutput-function-is-required-but-was-not-passed-in/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 13:30:01 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=879</guid>
		<description><![CDATA[Man, I love ColdFusion.  In my debug output I kept seeing:
The VAR parameter to the renderOutput function is required but was not passed in.
I didn&#039;t have any functions named renderOutput.  Nor did I have any arguments named VAR.
Apparently this is the error you get when you&#039;ve got CFDUMP call inside of a function with output=&#034;no&#034;.
Did [...]]]></description>
			<content:encoded><![CDATA[<p>Man, I love ColdFusion.  In my debug output I kept seeing:</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>The VAR parameter to the renderOutput function is required but was not passed in.</p></blockquote>
<p>I didn&#039;t have any functions named <strong>renderOutput</strong>.  Nor did I have any arguments named <strong>VAR</strong>.</p>
<p>Apparently this is the error you get when you&#039;ve got <a href="http://livedocs.adobe.com/coldfusion/8/Tags_d-e_08.html" >CFDUMP</a> call inside of a function with output=&#034;no&#034;.</p>
<p>Did I say apparently? I meant obviously.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/03/26/the-var-parameter-to-the-renderoutput-function-is-required-but-was-not-passed-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion &#8211; SQLServer JDBC Driver Unsupported data conversion</title>
		<link>http://coreygilmore.com/blog/2009/03/25/coldfusion-sqlserver-jdbc-driver-unsupported-data-conversion/</link>
		<comments>http://coreygilmore.com/blog/2009/03/25/coldfusion-sqlserver-jdbc-driver-unsupported-data-conversion/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 03:32:51 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=871</guid>
		<description><![CDATA[I always forget about this until I start working with ColdFusion and MSSQL again.  You&#039;re plugging along, and suddenly a page that was previously working starts throwing an error:
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver]Unsupported data conversion.
Relax, your code is (likely) fine.  This typically happens when you add a column to your table and use &#034;SELECT [...]]]></description>
			<content:encoded><![CDATA[<p>I always forget about this until I start working with ColdFusion and MSSQL again.  You&#039;re plugging along, and suddenly a page that was previously working starts throwing an error:</p>
<blockquote  style="border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;border-color: #ddd; border-style: solid; border-width: 1px 1px 1px 5px; margin: 15px 30px 15px 10px; padding: 0pt 15px; color: #777;"><p>Error Executing Database Query.<br/>
[Macromedia][SQLServer JDBC Driver]Unsupported data conversion.</p></blockquote>
<p>Relax, your code is (likely) fine.  This typically happens when you add a column to your table and use &#034;SELECT *&#034; in the query.  Somewhere along the line the list of columns is cached and since the list of columns you&#039;re selecting in the query hasn&#039;t changed ColdFusion chokes when what it receives doesn&#039;t match what it expects.</p>
<p>The fix couldn&#039;t be simpler &#8211; just toss a semi-colon at the end of your CFQUERY and watch your problems go away.  If you make another change just remove the semi-colon.</p>
<p>So a query that looks like this:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >CFQUERY</span> <span style="color: #0000FF;" >NAME</span><span style="color: #0000FF;" >=</span><span style="color: #009900;" >&quot;qryUsers&quot;</span> <span style="color: #0000FF;" >DATASOURCE</span><span style="color: #0000FF;" >=</span><span style="color: #009900;" >&quot;dsn&quot;</span><span style="color: #0000FF;" >&gt;</span></span>
	SELECT * FROM users
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >CFQUERY</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

<p>Becomes:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="cfm"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #333333;" ><span style="color: #0000FF;" >&lt;</span><span style="color: #990000; font-weight: bold;" >CFQUERY</span> <span style="color: #0000FF;" >NAME</span><span style="color: #0000FF;" >=</span><span style="color: #009900;" >&quot;qryUsers&quot;</span> <span style="color: #0000FF;" >DATASOURCE</span><span style="color: #0000FF;" >=</span><span style="color: #009900;" >&quot;dsn&quot;</span><span style="color: #0000FF;" >&gt;</span></span>
	SELECT * FROM users;
<span style="color: #333333;" ><span style="color: #0000FF;" >&lt;/</span><span style="color: #990000; font-weight: bold;" >CFQUERY</span><span style="color: #0000FF;" >&gt;</span></span></pre></div></div>

<p>I fully expect that I&#039;ll be stumbling across this page in 6 months.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/03/25/coldfusion-sqlserver-jdbc-driver-unsupported-data-conversion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Print a MySQL-style table with PHP</title>
		<link>http://coreygilmore.com/blog/2009/02/02/print-a-mysql-style-table-with-php/</link>
		<comments>http://coreygilmore.com/blog/2009/02/02/print-a-mysql-style-table-with-php/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 04:08:44 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=725</guid>
		<description><![CDATA[I wanted to cleanly display tabular data from a PHP command line script, and I like how MySQL formats its output.  This is quick, somewhat inefficient, hacky code, but it got the job done.  You&#039;ll find nothing to be proud of in this code; I don&#039;t want to spend more time writing this post [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to cleanly display tabular data from a PHP command line script, and I like how MySQL formats its output.  This is quick, somewhat inefficient, hacky code, but it got the job done.  You&#039;ll find nothing to be proud of in this code; I don&#039;t want to spend more time writing this post <em  style="font-style:italic;font-style:italic;">about</em> it than I did writing it :)</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="php"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #009933; font-style: italic;" >/**
 * Out a MySQL-style table of data
 *
 * @param	array  $data         Associative array of data to output. 
 * @param	array  $header_keys  Optional; Assoc array of display names to use for headers. Keys must match those of $data. Defaults to keys of $data.
 * @param	string $glue         String to join lines with, defaults to newline.
 * @return string
 *
 */</span>
<span style="color: #000000; font-weight: bold;" >function</span> build_table<span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$data</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$header_keys</span><span style="color: #339933;" >=</span><span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$glue</span><span style="color: #339933;" >=</span><span style="color: #0000ff;" >&quot;<span style="color: #000099; font-weight: bold;" >\n</span>&quot;</span><span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
  <span style="color: #000088;" >$table</span> <span style="color: #339933;" >=</span> <span style="color: #0000ff;" >''</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$data_fmt</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$divider_row</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$header_fmt</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
&nbsp;
  <span style="color: #000088;" >$keys</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array_keys</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$data</span><span style="color: #009900;" >&#91;</span><span style="color: #cc66cc;" >0</span><span style="color: #009900;" >&#93;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$col_lengths</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array_flip</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$keys</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span> <span style="color: #666666; font-style: italic;" >// used to determine the max column width</span>
&nbsp;
  <span style="color: #b1b100;" >if</span><span style="color: #009900;" >&#40;</span> <span style="color: #990000;" >empty</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$header_keys</span><span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
    <span style="color: #000088;" >$header_keys</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array_combine</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$keys</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$keys</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #009900;" >&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;" >// set the base max length to the length of our header keys</span>
  <span style="color: #b1b100;" >foreach</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$keys</span> <span style="color: #b1b100;" >as</span> <span style="color: #000088;" >$key</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
    <span style="color: #000088;" >$col_lengths</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >strlen</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$header_keys</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #009900;" >&#125;</span>
&nbsp;
  <span style="color: #b1b100;" >foreach</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$data</span> <span style="color: #b1b100;" >as</span> <span style="color: #000088;" >$row</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
    <span style="color: #b1b100;" >foreach</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$keys</span> <span style="color: #b1b100;" >as</span> <span style="color: #000088;" >$key</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
      <span style="color: #000088;" >$col_lengths</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >max</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$col_lengths</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span><span style="color: #339933;" >,</span> <span style="color: #990000;" >strlen</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$row</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span><span style="color: #009900;" >&#41;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
    <span style="color: #009900;" >&#125;</span>
  <span style="color: #009900;" >&#125;</span>
&nbsp;
  <span style="color: #b1b100;" >foreach</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$keys</span> <span style="color: #b1b100;" >as</span> <span style="color: #000088;" >$key</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
    <span style="color: #000088;" >$data_fmt</span><span style="color: #009900;" >&#91;</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >=</span> <span style="color: #0000ff;" >'%-'</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$col_lengths</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'s'</span><span style="color: #339933;" >;</span>
    <span style="color: #000088;" >$header_fmt</span><span style="color: #009900;" >&#91;</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >=</span> <span style="color: #0000ff;" >'%-'</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$col_lengths</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'s'</span><span style="color: #339933;" >;</span>
    <span style="color: #000088;" >$divider_row</span><span style="color: #009900;" >&#91;</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >str_pad</span><span style="color: #009900;" >&#40;</span><span style="color: #0000ff;" >''</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$col_lengths</span><span style="color: #009900;" >&#91;</span><span style="color: #000088;" >$key</span><span style="color: #009900;" >&#93;</span><span style="color: #339933;" >+</span><span style="color: #cc66cc;" >2</span><span style="color: #339933;" >,</span> <span style="color: #0000ff;" >'-'</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span> <span style="color: #666666; font-style: italic;" >// fill the spacing</span>
  <span style="color: #009900;" >&#125;</span>
  <span style="color: #000088;" >$data_fmt</span> <span style="color: #339933;" >=</span> <span style="color: #0000ff;" >'| '</span> <span style="color: #339933;" >.</span> <span style="color: #990000;" >implode</span><span style="color: #009900;" >&#40;</span><span style="color: #0000ff;" >' | '</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$data_fmt</span><span style="color: #009900;" >&#41;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >' |'</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$divider_row</span> <span style="color: #339933;" >=</span> <span style="color: #0000ff;" >'+'</span> <span style="color: #339933;" >.</span> <span style="color: #990000;" >implode</span><span style="color: #009900;" >&#40;</span><span style="color: #0000ff;" >'+'</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$divider_row</span><span style="color: #009900;" >&#41;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >'+'</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$header_fmt</span> <span style="color: #339933;" >=</span> <span style="color: #0000ff;" >'| '</span> <span style="color: #339933;" >.</span> <span style="color: #990000;" >implode</span><span style="color: #009900;" >&#40;</span><span style="color: #0000ff;" >' | '</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$header_fmt</span><span style="color: #009900;" >&#41;</span> <span style="color: #339933;" >.</span> <span style="color: #0000ff;" >' |'</span><span style="color: #339933;" >;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;" >// assemble the table</span>
  <span style="color: #000088;" >$table</span> <span style="color: #339933;" >.=</span> <span style="color: #000088;" >$divider_row</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$glue</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$table</span> <span style="color: #339933;" >.=</span> <span style="color: #990000;" >vsprintf</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$header_fmt</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$glue</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$header_keys</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$table</span> <span style="color: #339933;" >.=</span> <span style="color: #000088;" >$divider_row</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$glue</span><span style="color: #339933;" >;</span>
  <span style="color: #b1b100;" >foreach</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$data</span> <span style="color: #b1b100;" >as</span> <span style="color: #000088;" >$row</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
    <span style="color: #000088;" >$table</span> <span style="color: #339933;" >.=</span> <span style="color: #990000;" >vsprintf</span><span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$data_fmt</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$glue</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$row</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #009900;" >&#125;</span>
  <span style="color: #000088;" >$table</span> <span style="color: #339933;" >.=</span> <span style="color: #000088;" >$divider_row</span> <span style="color: #339933;" >.</span> <span style="color: #000088;" >$glue</span><span style="color: #339933;" >;</span>
&nbsp;
  <span style="color: #b1b100;" >return</span> <span style="color: #000088;" >$table</span><span style="color: #339933;" >;</span>
<span style="color: #009900;" >&#125;</span></pre></div></div>

<p>The output will be similar to:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="text"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;">+--------------------+--------------------+---------------+
| First              | Second col         | Random Column |
+--------------------+--------------------+---------------+
| 60386980488376     | 597655305189574649 | 51            |
| 959432             | 459191             | 396802        |
| 73874213           | 570702             | 771           |
| 144579584678722975 | 892300317939345    | 59180         |
| 293172             | 314                | 127725766727  |
+--------------------+--------------------+---------------+</pre></div></div>

<p>It only works with associative arrays, but that&#039;s easy enough to fix. You can proudly test it out using this glorious snippet:</p>

<div class="wp_syntax"   style="color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;color: #100; border: 1px solid #ccc; padding-bottom:16px; overflow-x: auto; overflow: auto; overflow-y: hidden; width:100%; margin: 0 0 1.5em 0; font-size:9.5pt; line-height:1.1em;"><div class="code" ><pre class="php"     style="font-family:monospace;font-family:monospace;margin: 0; width: auto; float: none; clear: none; overflow: visible;margin: 0; width: auto; float: none; clear: none; overflow: visible;"><span style="color: #000088;" >$data</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;" >function</span> get_rand<span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
  <span style="color: #000088;" >$max</span><span style="color: #339933;" >=</span><span style="color: #990000;" >rand</span><span style="color: #009900;" >&#40;</span><span style="color: #cc66cc;" >1</span><span style="color: #339933;" >,</span><span style="color: #cc66cc;" >6</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$str</span><span style="color: #339933;" >=</span><span style="color: #0000ff;" >''</span><span style="color: #339933;" >;</span>
  <span style="color: #b1b100;" >for</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$i</span> <span style="color: #339933;" >=</span> <span style="color: #cc66cc;" >0</span><span style="color: #339933;" >;</span> <span style="color: #000088;" >$i</span> <span style="color: #339933;" >&lt;</span> <span style="color: #000088;" >$max</span><span style="color: #339933;" >;</span> <span style="color: #000088;" >$i</span><span style="color: #339933;" >++</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
    <span style="color: #000088;" >$str</span> <span style="color: #339933;" >.=</span> <span style="color: #990000;" >rand</span><span style="color: #009900;" >&#40;</span><span style="color: #cc66cc;" >10</span><span style="color: #339933;" >,</span> <span style="color: #cc66cc;" >1000</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #009900;" >&#125;</span>
  <span style="color: #b1b100;" >return</span> <span style="color: #000088;" >$str</span><span style="color: #339933;" >;</span>
<span style="color: #009900;" >&#125;</span>
&nbsp;
<span style="color: #b1b100;" >for</span><span style="color: #009900;" >&#40;</span> <span style="color: #000088;" >$i</span> <span style="color: #339933;" >=</span> <span style="color: #cc66cc;" >0</span><span style="color: #339933;" >;</span> <span style="color: #000088;" >$i</span> <span style="color: #339933;" >&lt;</span> <span style="color: #cc66cc;" >5</span><span style="color: #339933;" >;</span> <span style="color: #000088;" >$i</span><span style="color: #339933;" >++</span> <span style="color: #009900;" >&#41;</span> <span style="color: #009900;" >&#123;</span>
  <span style="color: #000088;" >$row</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span>
    <span style="color: #0000ff;" >'one'</span>   <span style="color: #339933;" >=&gt;</span> get_rand<span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >,</span>
    <span style="color: #0000ff;" >'two'</span>   <span style="color: #339933;" >=&gt;</span> get_rand<span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >,</span>
    <span style="color: #0000ff;" >'three'</span> <span style="color: #339933;" >=&gt;</span> get_rand<span style="color: #009900;" >&#40;</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >,</span>
  <span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
  <span style="color: #000088;" >$data</span><span style="color: #009900;" >&#91;</span><span style="color: #009900;" >&#93;</span> <span style="color: #339933;" >=</span> <span style="color: #000088;" >$row</span><span style="color: #339933;" >;</span>
<span style="color: #009900;" >&#125;</span>
&nbsp;
<span style="color: #000088;" >$disp</span> <span style="color: #339933;" >=</span> <span style="color: #990000;" >array</span><span style="color: #009900;" >&#40;</span>
  <span style="color: #0000ff;" >'one'</span>   <span style="color: #339933;" >=&gt;</span> <span style="color: #0000ff;" >'First'</span><span style="color: #339933;" >,</span>
  <span style="color: #0000ff;" >'two'</span>   <span style="color: #339933;" >=&gt;</span> <span style="color: #0000ff;" >'Second col'</span><span style="color: #339933;" >,</span>
  <span style="color: #0000ff;" >'three'</span> <span style="color: #339933;" >=&gt;</span> <span style="color: #0000ff;" >'Random Column'</span><span style="color: #339933;" >,</span>
<span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span>
&nbsp;
<span style="color: #b1b100;" >echo</span> build_table<span style="color: #009900;" >&#40;</span><span style="color: #000088;" >$data</span><span style="color: #339933;" >,</span> <span style="color: #000088;" >$disp</span><span style="color: #009900;" >&#41;</span><span style="color: #339933;" >;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/02/02/print-a-mysql-style-table-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Numeric-only DU Meter Vista Gadget</title>
		<link>http://coreygilmore.com/blog/2009/01/14/numeric-only-du-meter-vista-gadget/</link>
		<comments>http://coreygilmore.com/blog/2009/01/14/numeric-only-du-meter-vista-gadget/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 23:22:05 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Gadget]]></category>
		<category><![CDATA[Sidebar]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=666</guid>
		<description><![CDATA[I always like to know how much bandwidth I&#039;m using &#8211; I&#039;m a little weird.  I&#039;ve been a big fan of DU Meter for bandwidth monitoring on Windows (on OS X I highly recommend iStat menus) for a long time, but I don&#039;t like the distraction of moving graphs.
There are two bugs in the current [...]]]></description>
			<content:encoded><![CDATA[<p>I always like to know how much bandwidth I&#039;m using &#8211; I&#039;m a little weird.  I&#039;ve been a big fan of <a href="http://www.dumeter.com/" >DU Meter</a> for bandwidth monitoring on Windows (on OS X I highly recommend <a href="http://www.islayer.com/apps/istatmenus/" >iStat menus</a>) for a long time, but I don&#039;t like the distraction of moving graphs.</p>
<p>There are two bugs in the current release of DU Meter (4.0.3076) that really aggravate me.  The first is position related; the window remembers it&#039;s last position, and doesn&#039;t check to see if that might be offscreen.  If it remembered it&#039;s position relative to the nearest corner this wouldn&#039;t be an issue, instead if I go between my 15&#034; laptop screen and a 30&#034; LCD it&#039;s either right in the middle of the window or hidden.  The second bug involves the display of the numeric graph.  Every time you open the Options window it resets the display mode setting to &#034;Graphical and numeric display&#034;.</p>
<p>I was thrilled to see that there was a Vista Sidebar Gadget available (sadly only for 32-bit Windows), and hoped that it would offer a numeric-only display.  By virtue of being in the sidebar I wouldn&#039;t have to worry about positioning either.</p>
<p>Nope.  Only the combination graph and numeric display.  I can&#039;t fix the app, but I&#039;ve got some control over the gadget.  I grabbed uncompressed gadget directory (%Program Files%\Windows Sidebar\Shared Gadgets\DUMeter.gadget) and began editing.  The background was a fixed size so I created a new one that was the correct height of the numeric display.  The stats window comes from a COM control which I very hackily modified the height of, to make it fit my new background.</p>
<p>The new gadget is supposed to be 28 pixels high, but there&#039;s an <a href="http://msdn.microsoft.com/en-us/magazine/cc163370.aspx" >undocumented minimum height</a> of 57 pixels for gadgets.  This is due to the height of toolbar being 57 pixels.  As a result of this the gadget will look a little odd if it&#039;s not at the bottom of the Sidebar &#8211; it&#039;s 28 pixels of content followed by 29 pixels of empty space.</p>
<div id="attachment_668"  class="wp-caption alignnone"     style="width: 205pxwidth: 205pxtext-align: center; padding-top: 4px; margin: 10px;text-align: center; padding-top: 4px; margin: 10px;"><img hspace="0"  vspace="0"  class="size-full wp-image-668"  title="du-meter-add-gadget"  src="http://coreygilmore.com/wp-content/uploads/2009/01/du-meter-add-gadget.png"  alt="Adding the DI Meter and DU Meter Mod Gadget"  width="195"  height="106"   style="margin: 0; padding: 0; border: 0 none;"/><p class="wp-caption-text"   style="font: bold 11px/17px 'Lucida Grande'font: bold 11px/17px 'Lucida Grande''Lucida Sans Unicode''Lucida Sans Unicode'TahomaTahomaVerdanaVerdanasans-serif; font-weight:bold; color:#000; margin:0; padding:1px 4px 5px; font-style:italic;sans-serif; font-weight:bold; color:#000; margin:0; padding:1px 4px 5px; font-style:italic;">Adding the DI Meter and DU Meter Mod Gadget</p></div>
<div id="attachment_667"  class="wp-caption alignnone"     style="width: 155pxwidth: 155pxtext-align: center; padding-top: 4px; margin: 10px;text-align: center; padding-top: 4px; margin: 10px;"><img hspace="0"  vspace="0"  class="size-full wp-image-667"  title="du-meter-custom-gadget"  src="http://coreygilmore.com/wp-content/uploads/2009/01/du-meter-custom-gadget.png"  alt="The modified and original DU Meter gadgets"  width="145"  height="157"   style="margin: 0; padding: 0; border: 0 none;"/><p class="wp-caption-text"   style="font: bold 11px/17px 'Lucida Grande'font: bold 11px/17px 'Lucida Grande''Lucida Sans Unicode''Lucida Sans Unicode'TahomaTahomaVerdanaVerdanasans-serif; font-weight:bold; color:#000; margin:0; padding:1px 4px 5px; font-style:italic;sans-serif; font-weight:bold; color:#000; margin:0; padding:1px 4px 5px; font-style:italic;">The modified and original DU Meter gadgets</p></div>
<p>You can <a href="http://coreygilmore.com/projects/du-meter-vista-sidebar-gadget" >download the gadget</a> from my <a href="http://coreygilmore.com/projects/du-meter-vista-sidebar-gadget" >DU Meter Gadget project page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/01/14/numeric-only-du-meter-vista-gadget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Datejs with Ext JS 2.2</title>
		<link>http://coreygilmore.com/blog/2009/01/07/using-datejs-with-ext-js-22/</link>
		<comments>http://coreygilmore.com/blog/2009/01/07/using-datejs-with-ext-js-22/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 21:33:23 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Datejs]]></category>
		<category><![CDATA[Ext JS]]></category>

		<guid isPermaLink="false">http://coreygilmore.com/?p=623</guid>
		<description><![CDATA[Recently on Twitter Matt Raible asked if anyone had ever used Datejs with Ext JS.  I hadn&#039;t, but I love Ext JS and I really like the free-form dates that Datejs allows such as &#039;yesterday&#039; or &#039;5 years from now&#039;.
Geoffrey McGill, one of the Datejs developers, had posted some code in late 2007 to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently on Twitter <a href="http://twitter.com/mraible/status/1099969644" >Matt Raible asked</a> if anyone had ever used <a href="http://www.datejs.com/" >Datejs</a> with <a href="http://extjs.com/" >Ext JS</a>.  I hadn&#039;t, but I love Ext JS and I really like the free-form dates that Datejs allows such as &#039;yesterday&#039; or &#039;5 years from now&#039;.</p>
<p>Geoffrey McGill, one of the Datejs developers, had <a href="http://groups.google.com/group/datejs/browse_thread/thread/b343b2eb7372405c?pli=1" >posted some code</a> in late 2007 to get Datejs working with an older version of Ext, but it didn&#039;t work with the latest release of Ext, version 2.2.</p>
<p>It didn&#039;t take long to update Geoffrey&#039;s changes to work with Ext 2.2, and I&#039;ve put a <a href="http://coreygilmore.com/projects/ext-js-datejs-integration/" >demo online</a> along with the <a href="http://coreygilmore.com/uploads/projects/extjs_datejs/ext_datejs.js" >Ext override code</a>.</p>
<p>The code will override properties of all <a href="http://extjs.com/deploy/dev/docs/?class=Ext.form.DateField" >Ext.form.DateField</a> objects and allow you to use the <a href="http://code.google.com/p/datejs/wiki/APIDocumentation" >Datejs syntax</a>.  If this isn&#039;t the behavior you want you can easily extend and create your own class using <a href="http://extjs.com/deploy/dev/docs/?class=Ext" >Ext.extend</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coreygilmore.com/blog/2009/01/07/using-datejs-with-ext-js-22/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
