<?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>crimulus-dot-com &#187; Programming</title>
	<atom:link href="http://www.crimulus.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.crimulus.com</link>
	<description>A blog; ineptly autobiographical</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:20:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The Solution: Use PHP&#8217;s pcntl_fork to limit execution time of MySQL queries</title>
		<link>http://www.crimulus.com/2011/12/16/the-solution-use-phps-pcntl_fork-to-limit-execution-time-of-mysql-queries/</link>
		<comments>http://www.crimulus.com/2011/12/16/the-solution-use-phps-pcntl_fork-to-limit-execution-time-of-mysql-queries/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 23:13:54 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[limit mysql query execution time with php]]></category>
		<category><![CDATA[pcntl_fork]]></category>
		<category><![CDATA[pcntl_fork share data from child process to parent]]></category>
		<category><![CDATA[php fork child to parent communication]]></category>

		<guid isPermaLink="false">http://www.crimulus.com/?p=1438</guid>
		<description><![CDATA[One of the worst parts of a web application can be the variability of mysql queries that get sent into your database.  You can add indices, tweak hardware configurations, etc., but wouldn&#8217;t it be nice to simply kill any database query that takes longer than whatever you deem is &#8220;too long&#8221;? Well, no, not any [...]]]></description>
			<content:encoded><![CDATA[<p>One of the worst parts of a web application can be the variability of mysql queries that get sent into your database.  You can add indices, tweak hardware configurations, etc., but wouldn&#8217;t it be nice to simply kill any database query that takes longer than whatever you deem is &#8220;too long&#8221;?</p>
<p>Well, no, not any query.  I would never want to kill a write &#8212; just a read-only query; in particular: search queries.</p>
<p>So, as it turns out, the hurdles for this are immense, and, because my solution uses PHP&#8217;s pcntl_fork() function, even my solution, while it works, it has to make assumptions and is not perfect.</p>
<p>That being said, it would seem easy enough for this to be built into PHP or for some similar mechanism to be built into MySQL: Execute this query but only if it takes less than n seconds.  If not, kill it.  This is not the case, however, so we&#8217;re left to our own cleverness.</p>
<p>There are hundreds of reasons why you would never want to do this, but I only need one reason to want to do it to try to implement it.</p>
<p>So here is my solution steps in techno-layman&#8217;s terms, followed by the necessary code:</p>
<ul>
<li>Call a function to execute a MySQL query (again, preferably read-only)</li>
<li>Open a shared memory space so that we can pass the query results back to the parent from the child</li>
<li>Store process state information in a database</li>
<li>Fork, and execute the query in the child process</li>
<li>Keep time in the parent process</li>
<li>Kill the child process if it takes longer than n seconds</li>
<li>Return the results</li>
</ul>
<p>&nbsp;</p>
<p>Just to forwarn, I have tested this as proof of concept, but I am uncertain about the particulars of PHP&#8217;s shared memory and am not confident how reliable the shared memory implementation will in a production environment.  I plan to try it out, but right now I&#8217;m just getting the info out there.</p>
<p>So the state database will be defined as follows:</p>
<p><code>CREATE TABLE IF NOT EXISTS `pcntlFork` (<br />
`idx` bigint(20) unsigned NOT NULL AUTO_INCREMENT,<br />
`status` enum('0','1') NOT NULL DEFAULT '0',<br />
`output` longblob NOT NULL,<br />
PRIMARY KEY (`idx`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=58 ;</code></p>
<p>The PHP class is available to download here:  <a href="http://mysql-restrictor.googlecode.com/files/mysqlRestrictor.class.php">http://mysql-restrictor.googlecode.com/files/mysqlRestrictor.class.php</a> (I had it inline, but WordPress did not want to format it properly)</p>
<p>And you would use it something like this</p>
<p><code>$m = new mysqlRestrictor();<br />
$results = $m-&gt;dbQuery("SELECT * FROM `table`");<br />
var_dump($results);</code></p>
<p>Since this took me an extremely long time to build and just verify that it even works, I welcome comments for improvement, and by all means use it for yourself. Let me know how it does in production!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2011/12/16/the-solution-use-phps-pcntl_fork-to-limit-execution-time-of-mysql-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Random String and POST Form Generator</title>
		<link>http://www.crimulus.com/2011/07/08/php-random-string-and-post-form-generator/</link>
		<comments>http://www.crimulus.com/2011/07/08/php-random-string-and-post-form-generator/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 15:17:37 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[php random form generator]]></category>
		<category><![CDATA[php random string generator]]></category>
		<category><![CDATA[random POST form]]></category>
		<category><![CDATA[random string]]></category>

		<guid isPermaLink="false">http://www.crimulus.com/?p=1387</guid>
		<description><![CDATA[Just a little snippet of sample code.  Sometimes you just need a random string generator, and on top of that, a random form to test a page. Maybe I&#8217;m just keeping this for my own future reference, but maybe someone else out there could use it too.  The function generates a string containing numbers and [...]]]></description>
			<content:encoded><![CDATA[<p>Just a little snippet of sample code.  Sometimes you just need a random string generator, and on top of that, a random form to test a page.</p>
<p>Maybe I&#8217;m just keeping this for my own future reference, but maybe someone else out there could use it too.  <img src='http://www.crimulus.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The function generates a string containing numbers and letters only (it&#8217;s easily customizable to contain other chars).  The form just creates inputs with random names from the string generator and random values from the string generator.</p>
<p><code><br />
function randomString() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';<br />
&nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $i&lt;rand(10,20); $i++) { $string .= $chars[rand(0,strlen($chars))]; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $string;<br />
}</p>
<p>?&gt;&lt;form action=&quot;&quot; method=&quot;POST&quot;&gt;&lt;?php<br />
&nbsp; &nbsp; &nbsp; &nbsp; for ($i=1; $i&lt;=rand(5,10); $i++) { ?&gt;&lt;p /&gt;&lt;input name=&quot;&lt;?php echo randomString(); ?&gt;&quot; value=&quot;&lt;?php echo randomString(); ?&gt;&quot; /&gt;&lt;?php }<br />
&nbsp; &nbsp; &nbsp; &nbsp; ?&gt;&lt;p /&gt;&lt;input type=&quot;submit&quot; /&gt;&lt;?php<br />
?&gt;&lt;/form&gt;&lt;?php<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2011/07/08/php-random-string-and-post-form-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to process PayPal Express Checkout for third party merchants</title>
		<link>http://www.crimulus.com/2011/05/18/how-to-process-paypal-express-checkout-for-third-party-merchants/</link>
		<comments>http://www.crimulus.com/2011/05/18/how-to-process-paypal-express-checkout-for-third-party-merchants/#comments</comments>
		<pubDate>Wed, 18 May 2011 19:11:53 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Electronic commerce]]></category>
		<category><![CDATA[google-search-query-nuance tweaking]]></category>
		<category><![CDATA[Payment systems]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[paypal express checkout for third party merchants]]></category>

		<guid isPermaLink="false">http://www.crimulus.com/?p=1379</guid>
		<description><![CDATA[This is a very simple one, but one that can take a lot of google-search-query-nuance tweaking to find. It&#8217;s easy to find the documentation to do PayPal Express Checkout, but to find that one little field where you send an alternate user as the recipient of the payments, well that&#8217;s downright impossible.  It is not [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very simple one, but one that can take a lot of google-search-query-nuance tweaking to find.</p>
<p>It&#8217;s easy to find the documentation to do PayPal Express Checkout, but to find that one little field where you send an alternate user as the recipient of the payments, well that&#8217;s downright impossible.  It is not in the docs (at least not as of this writing 5-18-2011).</p>
<p>How simple is it? Very &#8212; the variable is &#8220;SUBJECT&#8221;</p>
<p>Yes, you specify an alternate &#8220;SUBJECT&#8221; of the transaction.</p>
<p>Normally your SetExpressCheckout request looks something like:</p>
<pre>METHOD=&lt;method_name&gt;&amp;VERSION=&lt;version&gt;&amp;PWD=&lt;API_Password&gt;&amp;USER=&lt;API_UserName&gt;&amp;SIGNATURE=&lt;API_Signature&gt;&amp;...</pre>
<p>Now it will look like this:</p>
<pre>METHOD=&lt;method_name&gt;&amp;VERSION=&lt;version&gt;&amp;PWD=&lt;API_Password&gt;&amp;USER=&lt;API_UserName&gt;&amp;SIGNATURE=&lt;API_Signature&gt;&amp;SUBJECT=&lt;Payee_PayPal_Account&gt;...</pre>
<p>Payee_PayPal_Account is the email address/username the user uses to log in.</p>
<p>Hope this helps!  Took us valuable time to find &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2011/05/18/how-to-process-paypal-express-checkout-for-third-party-merchants/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nano global search and replace tabs to spaces or spaces to tabs</title>
		<link>http://www.crimulus.com/2011/05/17/nano-global-search-and-replace-tabs-to-spaces-or-spaces-to-tabs/</link>
		<comments>http://www.crimulus.com/2011/05/17/nano-global-search-and-replace-tabs-to-spaces-or-spaces-to-tabs/#comments</comments>
		<pubDate>Tue, 17 May 2011 12:39:06 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[linux text editors]]></category>
		<category><![CDATA[nano convert spaces to tabs]]></category>
		<category><![CDATA[nano convert tabs to spaces]]></category>
		<category><![CDATA[nano text editor]]></category>

		<guid isPermaLink="false">http://www.crimulus.com/?p=1374</guid>
		<description><![CDATA[I have been an avid user of nano/pico since about 1999, and yes, many naysayers think it is crap for programming, but it works for me, and I like it. That being said, one of the major issues I&#8217;ve had is that the Xorg select/paste always copies tab characters as the corresponding number of spaces.  [...]]]></description>
			<content:encoded><![CDATA[<p>I have been an avid user of <a href="http://www.nano-editor.org/">nano</a>/pico since about 1999, and yes, many naysayers think it is crap for programming, but it works for me, and I like it.</p>
<p>That being said, one of the major issues I&#8217;ve had is that the Xorg select/paste always copies tab characters as the corresponding number of spaces.  So, when I select text in one file, paste into another, I have to replace all the spaces with tabs.</p>
<p>Typically I paste into <a href="http://projects.gnome.org/gedit/">gedit</a> first, do the replace there, then c/p into the file.  This preserves the tabs.</p>
<p>(If you&#8217;re still wondering why I use nano, I just like having my editor accessible as long as I have server access.  I never got used to vi, and nano is more than effective for me.)</p>
<p>I have always thought nano should be able to search and replace tabs and spaces, but I could never get it to work.  Even without the gedit technique, I would typically just replace all double spaces to nothing, then manually insert the tabs.  My workarounds, again, are generally sufficient.  I have not NEEDED search and replace of tabs within nano, but today I decided I wanted to really find out if I could.</p>
<p>And it required some digging &#8230;</p>
<p>But, I finally found it: verbatim input!</p>
<p>Nano has a feature to disable character interpretation, and for one character, accept input literally.</p>
<p>To turn it on (again it&#8217;s for just the first character typed), hit alt-SHIFT-V (alt-V without shift may trigger x-windows menus), then just hit the tab key (it may or may not show a note that you&#8217;re in verbatim input mode).</p>
<p>You only need to do this in the search / replace prompts.  Obviously, you can type tabs directly into the file.</p>
<p>So an example &#8212; let&#8217;s say you want to convert any instance of 8 spaces to a tab character.</p>
<p>Here is the command stack:</p>
<p>control-W (search)<br />
control-R (replace)<br />
hit space 8 times, then hit enter<br />
alt-shift-V (verbatim input)<br />
hit the tab key, hit enter</p>
<p>Proceed as normal.</p>
<p>Hopefully this post is easier to find than the seemingly impossible digging I just undertook &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2011/05/17/nano-global-search-and-replace-tabs-to-spaces-or-spaces-to-tabs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HOWTO: Linux SSH to Remote Server, execute a command and stay logged in</title>
		<link>http://www.crimulus.com/2010/12/14/howto-linux-ssh-to-remote-server-execute-a-command-and-stay-logged-in/</link>
		<comments>http://www.crimulus.com/2010/12/14/howto-linux-ssh-to-remote-server-execute-a-command-and-stay-logged-in/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 17:10:52 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[remote ssh commands]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh execute command and stay logged in]]></category>

		<guid isPermaLink="false">http://www.crimulus.com/?p=1289</guid>
		<description><![CDATA[One of the shortcuts I always keep in my gnome taskbar is a link to a gnome-terminal with 3 tabs, each in the websites base directory of my web development server. It took my quite a long time to figure out how to get it to change to that directory then stay logged in, even [...]]]></description>
			<content:encoded><![CDATA[<p>One of the shortcuts I always keep in my gnome taskbar is a link to a  gnome-terminal with 3 tabs, each in the websites base directory of my  web development server.</p>
<p>It took my quite a long time to figure out  how to get it to change to that directory then stay logged in, even  though it is rather simple.  It also took my a long time again recently  because I reinstalled without backing that up.  So, this post is mainly  so I don&#8217;t have to do that again, but maybe it will help others too.</p>
<p>The  trick is to make SSH behave like a terminal (with the oft-overlooked -t  flag), then to execute a login bash shell using normal SSH command  execution.</p>
<p>So:</p>
<p>ssh -t &#8216;cd /path/to/go/to; bash -l&#8217;</p>
<p>So for me, my shortcut in the gnome taskbar is</p>
<p>gnome-terminal &#8211;tab -e &#8220;ssh -t &#8216;cd /path; bash -l&#8217;&#8221; &#8211;tab -e &#8220;ssh -t &#8216;cd /path; bash -l&#8217;&#8221; &#8211;tab -e &#8220;ssh -t &#8216;cd /path; bash -l&#8217;&#8221;</p>
<p>There &#8212; saved myself (and you) some time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2010/12/14/howto-linux-ssh-to-remote-server-execute-a-command-and-stay-logged-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The mathematical effectiveness of salt and hash (using sha1)</title>
		<link>http://www.crimulus.com/2010/09/30/the-effectiveness-of-salting-a-sha1-hash-then-storing-it-as-a-sha1-hash/</link>
		<comments>http://www.crimulus.com/2010/09/30/the-effectiveness-of-salting-a-sha1-hash-then-storing-it-as-a-sha1-hash/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 14:35:52 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Computer security]]></category>
		<category><![CDATA[Cryptographic hash functions]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Hash function]]></category>
		<category><![CDATA[internet security]]></category>
		<category><![CDATA[novemdecillion]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Password cracking]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quindecillion]]></category>
		<category><![CDATA[Rainbow table]]></category>
		<category><![CDATA[Salt]]></category>
		<category><![CDATA[SHA hash functions]]></category>
		<category><![CDATA[sha1 encryption]]></category>

		<guid isPermaLink="false">http://www.crimulus.com/?p=1235</guid>
		<description><![CDATA[I have been heavily researching password storage lately, because I believe there are still lapses in internet security that keep it far behind what hackers are able to achieve, and, as a programmer, I want to keep such things as lock-tight as possible. It, shamefully, just clicked with me the power of rainbow tables (for [...]]]></description>
			<content:encoded><![CDATA[<p>I have been heavily researching password storage lately, because I believe there are still lapses in internet security that keep it far behind what hackers are able to achieve, and, as a programmer, I want to keep such things as lock-tight as possible.</p>
<p>It, shamefully, just clicked with me the power of rainbow tables (for which I only learned the term in the last few days).  For some background, any legitimate website or authentication system does not store your password in plain text.  It uses a one-way encryption and stores that encryption.  Then to check if you used the right password, it encrypts the one you send it and compares it against the stored encryption.  This minimizes opportunities for a copy of your password to be easily accessible, decryptable, or readable, in any sense to someone who want to use it for malfeasance.</p>
<p>The trick with all one-way encryptions used for such &#8220;hashing&#8221; purposes is their resulting strings are fixed length.  For example, sha1, which is probably the most widely used method on the web, creates <span style="text-decoration: line-through;">alphanumeric (0-9, a-z not case sensitive)</span> hexadecimal strings of length 40 (at least using the php sha1() method with which I am familiar &#8212; I&#8217;m not a sha1 expert).  Because of this, there are possible collisions.  In other words, although your password might encrypt to one string, there are effectively infinite other strings that would encrypt to that same string.</p>
<p>Before getting too uptight about this, just do the basic numbers.  The sha1 encryption creates 40 character strings with <span style="text-decoration: line-through;">36</span> 16 possible characters in each place, meaning there are <span style="text-decoration: line-through;">36^40</span> 16^40 possible resulting encryptions.  That number?</p>
<p><span style="text-decoration: line-through;">178,689,910,246,017,054,531,432,477,289,437,798,228,285,773,001,601,743,140,683,776<br />
</span>1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976</p>
<p>Is there even a word for that?  Yes &#8230; <span style="text-decoration: line-through;">178.69 novemdecillion</span> 1.46 quindecillion.  (that is a big number)</p>
<p>So a hacker would build the corresponding rainbow table by finding exactly 1 string that converts to each of those <span style="text-decoration: line-through;">178,689</span> 1,461,501 &#8230; hashes.  Then, somehow, they get your encrypted password, and all they have to do is look it up in this table, and they have your password (or at least one that collides with yours&#8217; hash).</p>
<p>It is very simple, but, fortunately, at this point, that rainbow table would not fit on all the hard drives in the world.  In fact, <span style="text-decoration: line-through;">it would take about 50 billion earths to find an equivalent number of <em>atoms</em></span> the earth is only composed of about 133 quindecillion <em>atoms</em>. (That&#8217;s one hash per 89 atoms &#8212; a human hair is about 10000 atoms thick).</p>
<p>But let&#8217;s abandon the seeming impossibility of the existence of this table temporarily.  A common practice in secure storage of passwords these days is to &#8220;salt&#8221; the password before hashing and storing it.  That is, you take the password, prepend (or append) a random string, then encrypt the resulting string.  (More complex salts can exist, but the idea is that you modify the password in a predictable, repeatable way).  What this does is force a hacker to build a corresponding rainbow table for EVERY password he/she wants to hack, because the unsalted rainbow table won&#8217;t work (I&#8217;ll leave this to you to figure out why if you don&#8217;t know at this point.)</p>
<p>The problem is, if you&#8217;re still using sha1 to encrypt the salted password, it&#8217;s no different than if you didn&#8217;t salt the password.  If this complete sha1 rainbow table DID exist, the salt would serve absolutely no purpose, it would just shift the collision.  Some infinite subset of strings would still map to this encrypted string.</p>
<p>As a side note, the rainbow tables that exist are simply compilations of common types of passwords, and, in many instances, they work, because people just don&#8217;t use strong enough passwords.  This reduces the size of the tables to a usable form, so, in this case, the salting is imperative.  I am discussing today the case where a complete sha1 rainbow table exists.  I have said that it is pretty much impossible, but, from a purely theoretical standpoint, eventually, even the number <span style="text-decoration: line-through;">178.69 novemdecillion</span> 1.46 quindecillion will become small as technology improves with time.</p>
<p>By the way, &#8220;strong,&#8221; for all intents and purposes of one-way hashing, just means  long.  Knowing a password is short drastically decreases the number of  hashes that need to be generated for the table.  Good advice? Use  passwords 20 characters or longer &#8212; i.e. a sentence &#8220;This is my  password, baby. Nothing personal, but don&#8217;t steal it.&#8221;</p>
<p>My question is, is it really effective to use the same encryption mechanism after you salt the password?  Salting is little more than an obfuscation in the presence of a complete rainbow table.  In the face of the assumed existence of this rainbow table, and ignoring that most passwords aren&#8217;t truly &#8220;random,&#8221; there is exactly no difference between &#8220;salt and hash&#8221; and simply &#8220;hash.&#8221; This just leads me to the conclusion that the inherent flaw in one way hashes is that they create strings of finite length, but that is exactly why they are useful.</p>
<p>Perhaps the only purpose of this post was to legitimately use the word <span style="text-decoration: line-through;">novemdecillion</span> quindecillion more than once.  I dunno, but I would certainly appreciate expert commentary on the topic.</p>
<p><em>Edit: After initially writing this, I realized that sha1 created hex strings, not alphanumeric.  This changed the numbers, but fortunately not the article.  I decided to leave the old numbers in strikethrough because, well, novemdecillion is a cool freaking word.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2010/09/30/the-effectiveness-of-salting-a-sha1-hash-then-storing-it-as-a-sha1-hash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>USPS Shipping XML API Testing Idiosyncrasies</title>
		<link>http://www.crimulus.com/2010/05/20/usps-shipping-xml-api-testing-idiosyncrasies/</link>
		<comments>http://www.crimulus.com/2010/05/20/usps-shipping-xml-api-testing-idiosyncrasies/#comments</comments>
		<pubDate>Thu, 20 May 2010 17:55:49 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[e - commerce]]></category>
		<category><![CDATA[exact values]]></category>
		<category><![CDATA[fedex]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[math teacher]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[package dimensions]]></category>
		<category><![CDATA[rate request]]></category>
		<category><![CDATA[RateV]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[United States Postal Service]]></category>
		<category><![CDATA[usps]]></category>
		<category><![CDATA[valid zip code]]></category>
		<category><![CDATA[web developer]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[zip]]></category>
		<category><![CDATA[ZIP Code]]></category>

		<guid isPermaLink="false">http://www.coffeecuphalfmoons.com/?p=963</guid>
		<description><![CDATA[If you&#8217;re a web developer and happen to develop software for use in e-commerce, chances are, somewhere along the lines you&#8217;ll need or want to integrate with the big 4 shippers&#8217; (UPS, USPS, FedEx, DHL) APIs.  You&#8217;ll find right off the bat that they all offer rather robust APIs, so your options are sufficient. Then [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a web developer and happen to develop software for use in e-commerce, chances are, somewhere along the lines you&#8217;ll need or want to integrate with the big 4 shippers&#8217; (UPS, USPS, FedEx, DHL) APIs.  You&#8217;ll find right off the bat that they all offer rather robust APIs, so your options are sufficient.</p>
<p>Then you&#8217;ll get to programming and realize that the documentation is pretty crappy, but specifically I want to address the idiosyncrasies of the USPS &#8220;test&#8221; environment.  Effectively, what USPS means when they say &#8220;test&#8221; is not a test of robustness of your application, but simply whether or not your application can build a sample request (an EXACT sample request), and send it to their server.  Yeah &#8212; it&#8217;s like asking a math teacher to write the numbers 1 to 30 on a sheet of paper (in order) before he/she can get hired.</p>
<p>The problem is, the USPS docs don&#8217;t tell you this, nor do they show you the sample request.  So, for others who are about to embark on a few hour journey finding these details on Google (or worse, emailing USPS directly &#8230;eeek) I&#8217;m going to sum up a few facts here.</p>
<p>The most laborious for me so far is the one I already mentioned above.  For a rate request, the docs show you a RateV3Request, but in testing you can only use a RateV2 request (which does not support package dimensions).  Also, you must use the zip codes 10022 and 20008 for origination and zip, as well as 10 lbs. 5 oz. for the weight, and &#8220;LARGE&#8221; for the size.  Everything else (LAUGH) you have leeway with.</p>
<p>If you don&#8217;t use these exact values, you&#8217;ll get responses like &#8220;Please enter a valid zip code for the sender&#8221; (which of course makes you think you wrote the XML incorrectly) or &#8220;The package size must be &#8216;Regular&#8217;, &#8216;Large&#8217;, or &#8216;Oversize.&#8217;&#8221; (even though you have &#8220;regular&#8221; quite clearly in the request.</p>
<p>The advice is to get to production as soon as possible, though why USPS would design things this way is beyond me, but them&#8217;s the cards, you gotta play &#8216;em.</p>
<p>I will add more here as I find them obstaclicious enough (yeah I just made up that word).</p>
<p>Amendment 1:  <em>I should add that the issues about the documentation not mentioning the &#8220;canned&#8221; requests is only applicable to the PDF documentation.  It is stated quite clearly in the HTML versions.  Go figure &#8230;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2010/05/20/usps-shipping-xml-api-testing-idiosyncrasies/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WORDPRESS HOW-TO: Ignore/Hide A Category On Your Home Page</title>
		<link>http://www.crimulus.com/2010/02/28/wordpress-how-to-how-to-ignorehide-a-category-on-the-home-page/</link>
		<comments>http://www.crimulus.com/2010/02/28/wordpress-how-to-how-to-ignorehide-a-category-on-the-home-page/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 11:00:25 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[comma]]></category>
		<category><![CDATA[content themes]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[numeric id]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[query posts]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[url note]]></category>
		<category><![CDATA[wordpress get category id]]></category>
		<category><![CDATA[wordpress hide category]]></category>
		<category><![CDATA[wordpress hide multiple categories]]></category>
		<category><![CDATA[wordpress hide tag]]></category>
		<category><![CDATA[wordpress home]]></category>
		<category><![CDATA[XXX]]></category>

		<guid isPermaLink="false">http://www.coffeecuphalfmoons.com/?p=823</guid>
		<description><![CDATA[Sometimes you don&#8217;t want a particular category to appear on your WordPress home page.  For me, I create weekly Twitter digests, and I&#8217;d rather they not be part of the page welcome. The process of hiding them actually took me a little bit to figure out, so I thought I&#8217;d share.  It&#8217;s rather simple, so [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you don&#8217;t want a particular category to appear on your WordPress home page.  For me, I create weekly Twitter digests, and I&#8217;d rather they not be part of the page welcome.</p>
<p>The process of hiding them actually took me a little bit to figure out, so I thought I&#8217;d share.  It&#8217;s rather simple, so don&#8217;t blink!  <img src='http://www.crimulus.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Simply edit &#8220;index.php&#8221; in the wp-content/themes/&lt;your_theme_here&gt;/ directory.</p>
<p>Between the lines:</p>
<p><code>&lt;?php if (have_posts()) : ?&gt;</code></p>
<p>and</p>
<p><code>&lt;?php while (have_posts()) : the post(); ?&gt;</code></p>
<p>Insert the line:</p>
<p><code>&lt;?php if (is_home()) { query_posts("cat=-XXX"); } ?&gt;</code></p>
<p>Be sure to replace &#8220;XXX&#8221; with the unique numeric ID of the category you want to ignore.  To find the ID, log into your admin, navigate to your categories, and select the one you want to ignore.  The number will then appear in the URL.</p>
<p><strong>NOTE: Make sure you don&#8217;t delete the &#8220;-&#8221; before the &#8220;XXX&#8221; or else you will ONLY show entries from the category.</strong></p>
<p>If you update your theme, you will probably have to repeat this procedure.</p>
<p>If you want to hide <strong>multiple categories</strong> simply append the other categories to the string with a comma: (Example: &#8220;cat=-12,-82,-4&#8243;)</p>
<p>It also follows, then, that this technique can also be used to hide tags, posts, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2010/02/28/wordpress-how-to-how-to-ignorehide-a-category-on-the-home-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coffee Cup Half Moons now has an official URL Shortener!</title>
		<link>http://www.crimulus.com/2009/10/27/coffee-cup-half-moons-now-has-an-official-url-shortener/</link>
		<comments>http://www.crimulus.com/2009/10/27/coffee-cup-half-moons-now-has-an-official-url-shortener/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 17:31:01 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[abbreviate me]]></category>
		<category><![CDATA[company]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[geexmedia]]></category>
		<category><![CDATA[i heart it]]></category>
		<category><![CDATA[tharp]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[url shortener]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web company]]></category>

		<guid isPermaLink="false">http://www.coffeecuphalfmoons.com/?p=236</guid>
		<description><![CDATA[http://cchm.us/ Based on the same engine as http://abv8.me/ and http://ihrt.it/ (developed by my web company, geeXmedia). I plan soon to launch URL shorteners on http://tharp.me/ and http://tharp.us/]]></description>
			<content:encoded><![CDATA[<p>http://cchm.us/</p>
<p>Based on the same engine as http://abv8.me/ and http://ihrt.it/ (developed by my web company, geeXmedia).</p>
<p>I plan soon to launch URL shorteners on http://tharp.me/ and http://tharp.us/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2009/10/27/coffee-cup-half-moons-now-has-an-official-url-shortener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Day 1 of eBay DevCon 2009 plus a little tour of Northern California!</title>
		<link>http://www.crimulus.com/2009/06/16/day-1-of-ebay-devcon-2009-plus-a-little-tour-of-northern-california/</link>
		<comments>http://www.crimulus.com/2009/06/16/day-1-of-ebay-devcon-2009-plus-a-little-tour-of-northern-california/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 04:26:22 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Aldo]]></category>
		<category><![CDATA[Aldos]]></category>
		<category><![CDATA[baby]]></category>
		<category><![CDATA[Big Basin]]></category>
		<category><![CDATA[big basin redwoods]]></category>
		<category><![CDATA[california]]></category>
		<category><![CDATA[california vegetation]]></category>
		<category><![CDATA[Chris]]></category>
		<category><![CDATA[coastal redwoods]]></category>
		<category><![CDATA[eBay]]></category>
		<category><![CDATA[ebaydevcon]]></category>
		<category><![CDATA[ebaydevcon09]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[flight]]></category>
		<category><![CDATA[Fred]]></category>
		<category><![CDATA[grand scheme of things]]></category>
		<category><![CDATA[Guy]]></category>
		<category><![CDATA[guy fieri]]></category>
		<category><![CDATA[happy hour]]></category>
		<category><![CDATA[Kansas]]></category>
		<category><![CDATA[northern California]]></category>
		<category><![CDATA[Pacific ocean]]></category>
		<category><![CDATA[Paris]]></category>
		<category><![CDATA[Platform]]></category>
		<category><![CDATA[project echo]]></category>
		<category><![CDATA[redwoods]]></category>
		<category><![CDATA[redwoods state park]]></category>
		<category><![CDATA[San Jose]]></category>
		<category><![CDATA[santa cruz]]></category>
		<category><![CDATA[selling manager apps]]></category>
		<category><![CDATA[Starling]]></category>
		<category><![CDATA[State Park]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[Washington Dulles]]></category>

		<guid isPermaLink="false">http://www.coffeecuphalfmoons.com/?p=113</guid>
		<description><![CDATA[Corresponding pictures for this blog are available here:    http://abv8.me/2Q. My business partner Chris and I have made our 3rd voyage to eBay DevCon, this year in wonderful San Jose in northern California (where the girls are warm so I could hear my sweet baby say &#8230; ). We flew in last night, Jet Blue [...]]]></description>
			<content:encoded><![CDATA[<p>Corresponding pictures for this blog are available here:    <strong><a title="Click To Visit http://www.facebook.com/photo.php?pid=2782656&amp;l=2a3de04cb4&amp;id=671095756" href="http://abv8.me/2Q">http://abv8.me/2Q</a></strong>.</p>
<p>My business partner Chris and I have made our 3rd voyage to eBay DevCon, this year in wonderful San Jose in northern California (where the girls are warm so I could hear my sweet baby say &#8230; ).</p>
<p>We flew in last night, Jet Blue flight 317 direct from Washington Dulles to Oakland International.  Oddly enough, Chris&#8217; neighbor Tooland happened to be the pilot, and he hooked us up with a free Heineken &#8212; yeah baby.  Anyway, it was a very long 6 hour flight (it was only 6 hours 23 minutes in the air when I flew to Paris from Philly), and we had some rocky air with a little detour as there were t-storms and tornadoes in Kansas.</p>
<p>We touched down at around 9pm local time (12am EST) and headed over to Budget Rental where we picked up our awesome Kia compact POS.  <img src='http://www.crimulus.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Actually, it&#8217;s not too bad &#8212; good turning radius and small &#8212; hard for all the crazy California drivers to smash into.  We got to the hotel at 10:30 or so and proceeded to pass out.</p>
<p>So here we are in beautiful San Jose.  Well, cities are just cities, and, being the tree fanatic that I am, we had to visit the redwoods.  We got up early this morning &#8212; 6:30 or so, and decided to make our way to the Big Basin Redwoods State Park.  Now, for whatever reason, we put &#8220;shortest distance&#8221; into the GPS instead of &#8220;fastest time,&#8221; and we ended up on California route 35 &#8212; heading across the mountains on one of the <a title="Requires a Facebook account to see" href="http://abv8.me/2R">steepest, windiest, but most scenic roads</a>, I could have ever imagined.  I got some awesome pics of northern California vegetation, and, finally, about 2 hours later, we got to the park.</p>
<p>Now let me tell you, the coastal redwoods surprised me.  For all that they are huge, in the grand scheme of things, they really don&#8217;t seem all that large.  Really, a 300ft tall tree is only as tall as a football is long.  Gargantuan for a tree, yes, but in the grand scheme of things, they just feel like another tree &#8212; just ones that dwarf any big tree we have back east.  That being said, they are so tall and straight, they are kind of modest.  If a broad, bushy oak grew 300ft tall with a 200ft wide crown, I doubt I could relate to the perspective of such a tree being so modest.</p>
<p>From the park, we made our way to Santa Cruz so we could at least see the Pacific ocean.  We spent a little time at Seabright beach <a href="http://abv8.me/2R">http://abv8.me/2R</a>, and ate at a nice little place on the wharf named Aldo&#8217;s.  Apparently Guy Fieri ate there once.  The burger was delicious, and we had a little European Starling join us for a bite.  We named him Fred, and we were the best of buds.</p>
<p>From there, we headed back up route 17 to the eBay campus here in San Jose to listen to Madhu Gupta and company present the basic ins and outs of the new eBay selling manager pro applications platform.</p>
<p>General high points:</p>
<ul>
<li>eBay items trade at a velocity of $2000/second</li>
<li>Some eBay sellers might put more trust in third party apps if they appeared to be hosted by eBay</li>
<li>eBay decided to make a platform where third party developers could integrate with eBay in a smart iframe or in hosted HTML</li>
<li>They will use the open gadgets specification</li>
<li>This will launch in August</li>
</ul>
<p>Now, we have already developed our first application for this platform.  It is eZ labelZ for eBay, and it is a variation on our site ezbarcodez.com &#8212; geared to provide great integration with the already present eBay APIs so that sellers can print functional labels for their items.</p>
<p>Since we have been involved in the project since the alpha, most information was nothing new, but it was good to get a concrete overview.</p>
<p>Afterwards was &#8220;Happy Hour&#8221; with free beer and hors-d&#8217;oeuvres, and some networking.  We had some great chats with some eBay personnel, especially the documentation team, and well, what can I say?  Free beer.</p>
<p>So now we&#8217;re back at the hotel and I have hundreds of pics to parse through.  Hopefully they will appear on Facebook tonight and I will link them here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crimulus.com/2009/06/16/day-1-of-ebay-devcon-2009-plus-a-little-tour-of-northern-california/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

