randys.org

Wasting your precious bandwidth since 1999

Archive for September, 2005

New Machine Is On It’s Way

OK, so I ordered the parts for the new machine. I tried to keep the cost down and at the same time keep my upgrade options open. I spent the better part of two weeks looking obsessing on what I was going to actually build (and I should really REALLY thank my wife for putting up with me during this time).

I started out thinking about building an AMD Athlon XP system because parts are cheaper and since it’s an older CPU, better supported in Linux. While the XP is a strong CPU and should last for a couple years (at least for my use), I don’t foresee AMD continuing production of this line. That would mean I would be stuck at a Athlon XP 3200+ 400MHz. That’s probably a fast CPU and overclocking it would make it even faster, however, the CPU is not the only thing that would create a road block when upgrading a system. The motherboards that support the socket A use older chipsets and none that I have found support PCI Express. Most of them do support SATA Raid (some support PATA Raid as well). Another thing is memory. Most of the boards max out at 3GB of PC3200 (some will only do 2GB at 400MHz *or* 3GB at 333MHz). Furthermore, the cost between an Athlon XP and an Athlon 64 (939) setup aren’t that significant. Therefor, I decided to go 64.

True, 64-bit Linux is still relatively new, but I can run 32-bit Linux just fine with a 64-bit CPU. And, from what I’ve heard, an Athlon 64 3000+ will run circles around an Athlon XP 3000+.

So, armed with a bunch of “knowledge,” I ordered up some parts to put together a machine I think will last me for the next 2 to 3 years. Even beyond that, I can upgrade my CPU/RAM/Hard Drive/Video Card without having to buy a new motherboard or the entire system.

Here’s a list of what’s on order:

I’ll have to detail the build when I get around to it. Hopefully I don’t get any DOA items that will need to be RMA’d… don’t know if I have the patience for that right now.

• • •

JavaScript Logging & Debugging

I’m a huge fan of A List Apart (even though I don’t find myself reading it that often). They have some really good articles on many different issues surrounding web design and coding techniques. Today I stumbled upon an article on JavaScript Logging that looks like it will prove to be very helpful when developing complex JavaScript applications. In fact, I’m working on project where I think this may come in handy.

• • •

Berkeley DB and Geo::Coder::US

Well, I found out something interesting yesterday. After hours and hours of fiddling with Geo:Coder::US perl module on both my OS X machine and my webhost (Dreamhost) running Debian, I could not get the geocoder DB I generated on my OS X machine to work on Dreamhost. Turns out that Berkeley DB environments are NOT portable. And since I can’t generate the geocoder DB on Dreamhost (too processor intesive), I’m out of luck.

<p>...or am I?</p>


<p>I&#8217;m about to build a PC from scratch on which I will be installing <a href="http://www.gentoo.org">Gentoo</a>. I&#8217;m hoping that a Linux -&gt; Linux DB transfer will work (since, obviously, the Mac <span class="caps">OS X</span> -&gt; Linux transfer did not).</p>


<p>Stay tuned&#8230;</p>
• • •

Google Maps API: Geocoder Fun

So, I’ve been looking into Google maps and the Google maps API recently. It’s a fairly simple JavaScript API that enables one to impliment Google’s maps into a website. The API is in beta but it allows developers (and sites) to use their map interface. The only caveat is that Google doesn’t provide the maping coordinates (i.e. the latitude and longitude).

<p>This caveat can be over come though. Uplon doing a little searching, I came across <a href="http://geocoder.us">geocoder.us</a>, a site that offers a free address to geocode service. You pass them an address, they spit back some coordinates. They run three different interfaces to their service; a <span class="caps">SOAP</span> interface, a <span class="caps">REST</span> interface (which returns a <span class="caps">RDF</span>/XML feed) and an <span class="caps">XML</span>-RPC interface. If you&#8217;re using <span class="caps">PHP</span> &gt;= 4.1.0, you can use <a href="http://www.keithdevens.com/software/xmlrpc/">this handy little script</a> to make an <span class="caps">XML</span>-RPC call to geocoder.us and retrive the results in an array.</p>


<pre><code>require_once('xml_rpc.php');

$rpc_host = ‘rpc.geocoder.us’; $rpc_path = ‘/service/xmlrpc/RPC2′ $result = XMLRPC_request( $rpc_host, $rpc_path, ‘geocode’, array( XMLRPC_prepare(’1600 Amphitheatre Parkway, Mountain View CA 94043′) ) );

<p>This will make the call to the gecoder.us site and return the results as an array (<em>$results</em>)</p>


<pre><code>Array

( [0] => 1 [1] => Array ( [0] => Array ( [number] => 1600 [lat] => 37.423269 [street] => Amphitheatre [state] => CA [zip] => 94043 [city] => Mountain View [suffix] => [long] => -122.082667 [type] => Pky [prefix] => )

<pre><code>)</code></pre>


<pre><code>)</code></pre>


<p>You can then use <em>$result<a href="0">1</a>[&#8216;long&#8217;]</em> and <em>$result<a href="0">1</a>[&#8216;lat&#8217;]</em> to pass into the maps <span class="caps">API</span> and plot a point on the map. Spiffy!</p>


<p>There&#8217;s really only one downside to this: geocoder.us also offers a paid service along side of the free service. What does this mean? It means (and I believe they state it on their site) that they throttle the free service so that the paid service is unaffected. In fact, if you plan on using the service on a for-proffit site or are using their service to make money, you must purchase a license to use the service. It&#8217;s actually reasonably priced for the kind of information you&#8217;re getting. You get 20,000 lookups for $50 <span class="caps">USD</span>.</p>

Geocoding

<p>Geocoder.us also offers the <a href="http://search.cpan.org/~sderle/Geo-Coder-US/">Perl mods</a> that is used to import and query the <a href="http://www.census.gov/geo/www/tiger/tiger2004fe/tgr2004fe.html">2004 <span class="caps">TIGER</span>/Line</a> Census data. With geocoder.us throttling the free service I thought I&#8217;d give the import process and Perl mods a try. I don&#8217;t really recommend trying this unless you really need to&#8230; it&#8217;s kind of a pain in the ass and takes quite a bit of processor power for about 12 hours (on a 1Ghz G4 with 1GB <span class="caps">RAM</span>). I&#8217;m not going to spell everything out for you <a href="http://ian.blenke.com/blog/projects/geocoder/">since it&#8217;s already been done</a>, but I will say that it does work.</p>



<p>Be forewarned. The <span class="caps">TIGER</span>/Line data is around <b>4.5GB</b> of <em>compressed</em> data (which is around <b>25</b> uncompressed). The Geo::Coder::US Perl module chugs through all the zip files and generates a Berkeley DB that&#8217;s around 750MB. Not bad.</p>

Other Geocoding

<p>I did manage to find <a href="http://dan.egnor.name/google.html">another geocoding software</a>, which I assume is what Google is using currently to translate addresses to coordinates since it <a href="http://www.google.com/programming-contest/winner.html">won the 2002 Google Programming Contest</a>. I also got that to compile and import some data. However, I believe that it unzips <em><span class="caps">ALL</span></em> of the <span class="caps">TIGER</span>/Line data files into a temp directory while importing so you&#8217;re gonna need about <b>30GB</b> of free space to use this tool (40GB ro be onthe safe side). I actually ran out of disk space (on my root partition no less) while importing so it never ran completely.</p>



<p>In the end, I ended up scrapping the idea of running a similar service on my web host. Not because I didn&#8217;t have the disk space available (I&#8217;ve got 6GB currently), but because I couldn&#8217;t get the Perl modules to work with the Berkeley DB that was generated on my machine. But, I did play around with <a href="http://geo.randys.org">Google Maps</a>.</p>


<p>Long story short, I wasted about 2 days on something I&#8217;ll probably never use. <span class="caps">JOY</span>!</p>
• • •

All content Copyright © Randy Sesser | Hosted by WebFaction
Entries (RSS) | Comments (RSS)

randys.org is Digg proof thanks to caching by WP Super Cache!