<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>GiveGoodWeb</title>
	<link>http://www.givegoodweb.com</link>
	<description>Web n' What-Not</description>
	<pubDate>Thu, 15 May 2008 16:36:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Turn Numerous Television Without Pity Review Pages into One Page</title>
		<link>http://www.givegoodweb.com/post/64/twop-1pager</link>
		<comments>http://www.givegoodweb.com/post/64/twop-1pager#comments</comments>
		<pubDate>Thu, 15 May 2008 16:19:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/64/twop-1pager</guid>
		<description><![CDATA[Tired of clicking through those long Television Without Pity reviews? Then you should try out this simple tool that collects all the pages for you into 1 printer friendly page.]]></description>
			<content:encoded><![CDATA[<p>One day I got tired enough of clicking through 20+ page <a href="http://www.televisionwithoutpity.com" title="www.televisionwithoutpity.com">TWOP reviews</a>, and decided to experiment with creating a tool that would collect all the pages in a given review, and assemble them into one clean page for easy printing.</p>
<p>So I went into the lab, and came up with a <a href="http://www.givegoodweb.com/tools/twop/" title="check it out">working program</a> that does just this.</p>
<p>Now, I originally thought that TWOP made you click page to page instead of offering an all-in-one page because they placed different ads on each page of the review, but the ads are the same on every page. So I don&#8217;t feel like I&#8217;m cheating anyone here. Yet, I still click an ad before I run the review through my program - you should too.</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/05/twop2.jpg" alt="twop2.jpg" /></p>
<p>To use it, simply find a review on TWOP, copy the URL, and paste in into the tool. If you find a review that doesn&#8217;t seem to work, please leave it in the comments section below so I can debug it. Any other comments are also appreciated. Now&#8230;</p>
<p><a href="http://www.givegoodweb.com/tools/twop/" class="tool" title="TWOP 1 Pager">1-Page-i-fy That TWOP Review! </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/64/twop-1pager/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Very Simple SEO Tool</title>
		<link>http://www.givegoodweb.com/post/63/page-title-heading-one-tool</link>
		<comments>http://www.givegoodweb.com/post/63/page-title-heading-one-tool#comments</comments>
		<pubDate>Tue, 06 May 2008 21:07:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/63/page-title-heading-one-tool</guid>
		<description><![CDATA[Whenever somebody asks me how they can get more "organic" search engine traffic to their site, one of the first things I look at are the Page Title and Heading 1 tags on the page. I created this handy tool as an easy to to tell what they are, or aren't.]]></description>
			<content:encoded><![CDATA[<p>Often I see articles in newspapers and magazines that tell you to &#8220;use keywords&#8221; and &#8220;refine text.&#8221; While doing these things is a very good idea, where is the best place to put your keywords? Or a better question might be, where is the best place to put your <em>most important</em> keywords?</p>
<p align="left">Whenever somebody asks me how they can get more &#8220;organic&#8221;<sup>1</sup> search engine traffic, the first things I look at are the Page Title and Heading 1 tags (&lt;title&gt; and &lt;h1&gt;). If they don&#8217;t exist, or if they aren&#8217;t being used well (&#8221;Welcome&#8221; isn&#8217;t a good main heading), it&#8217;s often the easiest way to improve.</p>
<p>The trouble is, sometimes what looks like a Heading 1 really isn&#8217;t. It could be a bold tag, or any other HTML tag that&#8217;s just styled to look like a heading 1 tag. Or worse, it could be an image masquerading as text. Search engines can&#8217;t read text that&#8217;s inside an image, or any sort of rich media like Flash. <em>(And if you wrap your image in a Heading 1 tag, that still doesn&#8217;t count.)</em></p>
<h2>Page Titles and Heading 1&#8217;s Are the Perfect Place for Your Best Keywords</h2>
<p>Don&#8217;t cheat yourself out of potential traffic (not to mention clarity) by not using these tags to their fullest potential. Note that it&#8217;s the Page Title that shows up in search engine result pages (SERPs). Sometimes you hear people say that your website is somebody&#8217;s first impression of you/your biz, but often the first thing people see is your page title on a SERP. Make it clear and inviting to click. Got a sale going on? Let &#8216;em know on the SERP, don&#8217;t wait for them to get to your site. Then bring it home with a good Heading 1 tag that assures people they are in the right place.</p>
<p align="left">What I did here is create a simple online tool that will tell you what the Page Title and Heading One tags are on the provided page. The idea is to have something that slogs through the underlying HTML for you to see what&#8217;s really going on. I&#8217;ve been quite surprised with some of the results. For example, I&#8217;ve seen a website that uses a Heading One tag for every link in the menu bar, totaling seventeen of them when you should only use one.</p>
<p>For more detail, here&#8217;s <a href="http://www.givegoodweb.com/post/61/seo-page-titles-h1" title="Take Advatage of Page Title and H1 Tags!">relating article I wrote</a>. And for excruciating detail, check out <a href="http://www.givegoodweb.com/seobook" title="SEOBook.com - check it out">SEOBook.com</a>.</p>
<p><a href="http://www.givegoodweb.com/tools/page-check/" style="border: 1px solid #b0dab0; padding: 8px; background: #ffffcc none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-weight: bold" title="Launch the tool">Now let&#8217;s get started, and check a page! </a></p>
<p id="footNote"> <sup>1</sup>&#8220;Organic&#8221; refers to search engine traffic that happens naturally, as opposed to being paid for. On a Google SERP, organic results are in the main part of the page, whereas paid placement is located to the right and sometimes at the top of the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/63/page-title-heading-one-tool/feed</wfw:commentRss>
		</item>
		<item>
		<title>Easy SEO with Page Titles and Header 1 tags</title>
		<link>http://www.givegoodweb.com/post/61/seo-page-titles-h1</link>
		<comments>http://www.givegoodweb.com/post/61/seo-page-titles-h1#comments</comments>
		<pubDate>Tue, 29 Apr 2008 15:47:09 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/61/seo-page-titles-h1</guid>
		<description><![CDATA[These tend to be the first two HTML tags that search engines look at. Learn what they do, how they relate to search, and how to really take advantage of them. It's not that hard, honest!]]></description>
			<content:encoded><![CDATA[<p>Getting the basics of search engine optimization doesn&#8217;t have to be rocket science. Sure, there can be a lot to it, but as Aaron Wall of <a href="/seobook" title="Go to SEOBook.com">SEOBook.com</a> says, if you do just one SEO-type-thing to your website, it should be to take advantage of the page title (&lt;title&gt;) and header 1 (&lt;h1&gt;) tags. These tend to be the first thing that search engines look at, so you should be using them well.</p>
<p>Note that your page&#8217;s title tag is what is displayed on the SERPs (search engine result pages). Your main keywords should be in here, yet it should still make sense to people. In fact, it should not only cue people in that this page is what they&#8217;re looking for, but if you&#8217;re selling something, this will actually be your first chance to entice the customer. If your page title is enticing enough, it will get clicked.</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/04/h1-page-title-google.jpg" alt="h1-page-title-google.jpg" /></p>
<p>Also note that with my page title, I put my blog name last, not first. Whether it&#8217;s your blog name or company name, it&#8217;s questionable if you really need it on every page, but if you want it there, put it last so that it doesn&#8217;t dilute your keywords.</p>
<h2>After the Click</h2>
<p>When somebody clicks a Google link and arrives on your page, your header 1 tag should re-enforce / confirm the message that you started with your page title. The lazy thing to do is to make them the same (which I&#8217;ve been guilty of here). If you use some sort of CMS (content management system) or blogging tool, make sure there&#8217;s a plugin or some other functionality that allows you to do this.</p>
<p>Also, check that it is really a &lt;h1&gt; tag, and that it is the only such tag on the page. If you have to use more headers to break your content up (which you should do every couple paragraphs, or whenever applicable), make them &lt;h2&gt;, &lt;h3&gt;&#8217;s - you can typical go down to &lt;h6&gt;, tags. Not only will this help search engines outline what your page is about, but it makes the page more readable to people.</p>
<p>Also, I say to make sure that your headers really are proper header tags because with CSS (cascading style sheets), you can easily make a simple bold tag look like a header tag, and that doesn&#8217;t work as well - you&#8217;re actually cheating yourself if you do that. Basic bold text is fine, but save it for stuff within your paragraphs.</p>
<p>Cheers, and happy optimizing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/61/seo-page-titles-h1/feed</wfw:commentRss>
		</item>
		<item>
		<title>Beautiful Soup Tutorial Featuring Select Boxes</title>
		<link>http://www.givegoodweb.com/post/59/beautiful-soup-example-2</link>
		<comments>http://www.givegoodweb.com/post/59/beautiful-soup-example-2#comments</comments>
		<pubDate>Sun, 20 Apr 2008 23:46:43 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/59/beautiful-soup-example-2</guid>
		<description><![CDATA[This example deals primarily with pulling option values out of select boxes, and should be much easier to understand than my last, somewhat convoluted Beautiful Soup example. However, much like the previous example, this one stemmed from a &#8220;real world&#8221; need. I&#8217;m talking about trying to find a bargain vacation on the super slow website, [...]]]></description>
			<content:encoded><![CDATA[<p>This example deals primarily with pulling option values out of select boxes, and should be much easier to understand than my last, somewhat convoluted <a href="http://www.givegoodweb.com/post/38/beautiful-soup-example-1" title="example #1, lists and links">Beautiful Soup example</a>. However, much like the previous example, this one stemmed from a &#8220;real world&#8221; need. I&#8217;m talking about trying to find a bargain vacation on the super slow website, AppleVacations.com.</p>
<p>The issue at hand is that the price is different for about every departure date, and they give you many to choose from in a SELECT element. The problem is that you have to select each date, one at a time, from the list box in order to know what the price is. If the site was snappy, this would be annoying at best. But the fact that the site is slow as dirt makes it a serious waste of time if you want to check them all out:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/04/apple-vac.jpg" style="border: 1px solid #cccccc" alt="apple-vac.jpg" /></p>
<p>So using <a href="http://www.crummy.com/software/BeautifulSoup/" title="BeautifulSoup website">Beautiful Soup</a>, I wrote an 11 line python script that grabs the values from each of the options in this list, and opens it in a new web browser. While all the pages are loading, I can do something useful with my time, like contemplate if my bathing suit can survive another year.</p>
<p align="left">This was a good exercise in scraping info out of &lt;option&gt; values, and identifying a &lt;select&gt; list by it&#8217;s name attribute. The basic code is below, and here&#8217;s a <a href="http://pastie.textmate.org/183948" title="http://pastie.textmate.org/183948">link to the code with better comments</a>.</p>
<pre>import urllib2, webbrowser
from BeautifulSoup import BeautifulSoup

select_list_page = 'http://the-apple-page-with-the-select-element'

page = urllib2.urlopen(select_list_page)
soup = BeautifulSoup(page)

# This is basically their template page, sans the id that
# identifies the package (at very end of the URL)

url = 'http://the-page-that-lists-the-price-without-the-ending-id'

# Now we identify the select list that has the dates
# Easy enough, the name of this select list is also selectedBatchNumber

select = soup.find('select',{'name':"selectedBatchNumber"})
option_tags = select.findAll('option')

# The 1st one has no value, so strip it out

option_tags = option_tags[1:]

# Now we loop through each value
# webbrowser.open will attempt to identify the default browser,
# and open each page in a new window/tab

for option in option_tags:
    webbrowser.open(url + option['value'].strip())

# Best to get a cup of coffee while all the pages load</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/59/beautiful-soup-example-2/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using Python and os.walk to Locate the Firefox Cache</title>
		<link>http://www.givegoodweb.com/post/58/python-oswalk-firefox</link>
		<comments>http://www.givegoodweb.com/post/58/python-oswalk-firefox#comments</comments>
		<pubDate>Thu, 17 Apr 2008 19:15:32 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/58/python-oswalk-firefox</guid>
		<description><![CDATA[My series of Beazley-related Python lessons picks up again here. This is actually a small part of a bigger assignment, which was to decode the files within a user&#8217;s Firefox cache (coming later), but this nice little script can be handy to find about anything on your system with Python.
Every Firefox cache contains a file [...]]]></description>
			<content:encoded><![CDATA[<p>My series of <a href="http://www.dabeaz.com/" title="DaBeaz">Beazley</a>-related Python lessons picks up again here. This is actually a small part of a bigger assignment, which was to decode the files within a user&#8217;s Firefox cache (coming later), but this nice little script can be handy to find about anything on your system with Python.</p>
<p>Every Firefox cache contains a file called &#8220;_CACHE_MAP_&#8221;, so this script will search for that. You can run the script by passing a parameter in for the folder you want to begin your search tree with. This might be a User folder, or even just root (&#8217;/'). Just remember that the closer you get to root, the more there is to search, and the longer this will take. For example, you might run the script like this:</p>
<pre> python findcache.py /Users/username</pre>
<p>And it will spit out the paths it finds the _CACHE_MAP_ file in. On my system, this took just under 6 seconds and located 4 cache folders within my user folder <em>(a test installation of Komodo created one, and besides the &#8220;real&#8221; one I actually use, I also had two &#8220;fake&#8221; ones for study)</em>.</p>
<h2>If You&#8217;re So Inclined</h2>
<p>Try writing the script! Here&#8217;s the man page on <a href="http://docs.python.org/lib/os-file-dir.html" title="'walk' is towards the bottom">os.walk</a>. The solution is very short. Here&#8217;s my version:</p>
<pre>#!/usr/bin/env python
# encoding: utf-8
"""
findcache.py
Created by Matt Mayes on 2008-02-18.
Finds the Firefox cache directory when given a home directory
"""

import sys
import os

searchFile = '_CACHE_MAP_'
cacheFolder = None

try:
    home = sys.argv[1]
except IndexError,e:
    print "Please enter your home directory: (no trailing slash) "
    home = raw_input()

for root, dirs, files in os.walk(home):
    for x in files:
        if x == searchFile:
            cacheFolder = root
            print cacheFolder

if cacheFolder == None: print "Cache folder not found under that directory."</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/58/python-oswalk-firefox/feed</wfw:commentRss>
		</item>
		<item>
		<title>Canceling Your GoDaddy Account</title>
		<link>http://www.givegoodweb.com/post/56/cancel-godaddy</link>
		<comments>http://www.givegoodweb.com/post/56/cancel-godaddy#comments</comments>
		<pubDate>Tue, 15 Apr 2008 14:55:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/56/cancel-godaddy</guid>
		<description><![CDATA[Sick of getting nickel and dimed? How about that great tech support? Here's a way to get rid of GoDaddy, or at least cease all emails and payments to them.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/04/no-godaddy.jpg" alt="no-godaddy.jpg" align="right" />I cannot believe that at one point I was considering moving all my domains over to <a href="http://godaddy.com" rel="nofollow" rev="vote-against" title="GoDaddy site">GoDaddy</a><sup>1</sup>. Their management interface is confusing to the point that I believe it&#8217;s <em>intentionally confusing</em>, so that you have a hard time figuring out exactly what charges you are incurring (there&#8217;s no single page that shows all of your charges), and when such charges will incur. When you do get one of those annoying $2.95 charges, there&#8217;s no indication on the bill as to what it was for. Well, no more! I finally bit the bullet, transferred the domains, and begin trying to figure out how to cancel my account.</p>
<h2>Like I Said, They Don&#8217;t Make It Easy</h2>
<p>I looked and looked, and found no way to cancel my account. Searching their online help system for &#8220;cancel account&#8221; turned up nothing useful. I resorted to emailing their &#8220;tech support&#8221; - here&#8217;s the response I got, which is little more than a map through their convoluted system - hope it helps someone else out!</p>
<h3>From GoDaddy:<br />
How to Cancel Your Account</h3>
<p><em>The following is an email I received from GoDaddy, regarding my inquiry to cancel all services:</em></p>
<p>Unfortunately Go Daddy cannot completely remove a customer account from our system for legal reasons. However, you can use the instructions below to cancel all products or services for this account, remove all payment methods from this account, and turn off all opt-in email notifications. Company policy restricts Go Daddy Customer Support representatives from making changes to customer accounts or services on behalf of the customer. You will need to make this change from within your account.<br />
<strong><br />
To cancel all products and services, follow the directions below:</strong></p>
<p>First, log into your customer account:</p>
<ol>
<li>Go to the <a href="http://godaddy.com" rel="nofollow" rev="vote-against" title="GoDaddy site">GoDaddy Account Login Page</a></li>
<li>Log in using your account username (which may be the same as your customer number) and password</li>
</ol>
<p>If you have trouble logging in, our password reset form may help you. You can find this form through the following link: <a href="https://mya.godaddy.com/account/AccountRetrieval/retrieveaccount.aspx?isc=webjsb" title="retried GoDaddy password">Account Retrieval Page</a></p>
<p>Once you have logged in to your account, follow the steps below to cancel:</p>
<ol>
<li>Select &#8216;Payments and Renewing Items&#8217; from the &#8216;Renewals&#8217; menu.</li>
<li>Check the box next to the item(s) you would like to cancel and click on the &#8216;Cancel Item&#8217; button.</li>
<li>Select &#8216;Cancel Now&#8217; or &#8216;Cancel at Expiration Date&#8217; in the menu that appears to the right.</li>
<li>Click on &#8216;Save Changes&#8217;.</li>
</ol>
<p>* Canceling now will immediately remove the service from your account. If you choose to &#8220;Cancel at Expiration Date&#8221; the service will remain active until the date specified and will not be renewed.</p>
<p>Please use the below instructions to remove a payment method from our system. Note that there must be no products or services in our system which are currently linked to that payment method before you can remove it.</p>
<ol>
<li>Select &#8216;Credit Card &amp; Payment Info&#8217; from the &#8216;My Account&#8217; menu</li>
<li>Select the radio button next to the desired payment method in the list.</li>
<li>Click the &#8216;Deactivate Payment Method&#8217; button.</li>
<li>If there are any products or services currently associated with this item you will then be forced to move them to another payment method before you can continue.</li>
<li>After moving any products or services to another payment method, click the &#8216;Save Changes&#8217; button.</li>
</ol>
<p>You can choose not to receive email notices by updating your customer account settings. Follow the directions below:</p>
<ol>
<li>Select &#8216;Account Settings&#8217; from the &#8216;My Account&#8217; menu.</li>
<li>Click on the &#8220;Email Preference Information&#8221; link.</li>
<li>Go through the choices and select your preference for each.</li>
<li>When you are done, click on the green &#8220;Save Changes&#8221; button.</li>
</ol>
<p>You can also use the &#8220;UNSUBSCRIBE&#8221; link found at the bottom of all the notices that we send out.</p>
<p id="footNote">Footnotes:<br />
<sup>1</sup>Note that sometimes you want to link to a website, but you don&#8217;t want that link to count for anything in terms of Search Engine value (as search engines use the total number of inbound links to a website in their ranking algorithms).  To still link to a site, but not pass any SEO relevance onto it, or even to have it count as a vote against the website you are linking to, you can use the <a href="http://microformats.org/wiki/vote-links" title="More on vote links">vote-link</a> and <a href="http://microformats.org/wiki/rel-nofollow" title="rel-nofollow">rel-nofollow</a> <a href="http://microformats.org/" title="microformats home page">microformats,</a> as I did with the links to the GoDaddy home page:</p>
<pre>&lt;a href="http://godaddy.com" rel="nofollow" rev="vote-against" title="GoDaddy site"&gt;GoDaddy&lt;/a&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/56/cancel-godaddy/feed</wfw:commentRss>
		</item>
		<item>
		<title>Combo Pack: CakePHP and Leopard Virtual Hosts</title>
		<link>http://www.givegoodweb.com/post/53/cakephp-leopard-virtual-hosts</link>
		<comments>http://www.givegoodweb.com/post/53/cakephp-leopard-virtual-hosts#comments</comments>
		<pubDate>Fri, 04 Apr 2008 21:52:22 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[OS X]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/53/combo-pack-cakephp-and-leopard-virtual-hosts</guid>
		<description><![CDATA[A bit about CakePHP, but more about getting several virtual hosts/domains up and running on Leopard. For example, you can setup www.testsite1.dev and www.testsite2.dev with full PHP/MySQL database-driven goodness.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been checking out CakePHP, and while I haven&#8217;t really fully explored it yet, I&#8217;m pysched to have learned how to get numerous test sites up and running under Leopard&#8217;s default installation of Apache and PHP. It was a bit of an adventure, so I&#8217;m taking notes here that will a) remind me how I did it and (b) hopefully save somebody else some time. This assumes some technical skill at the command line, and use of a trusty text editor.</p>
<h2>Step One: Get MySQL, PHP, and Virtual Hosts running on Apache</h2>
<p>I&#8217;ll be running all my applications from my home user &#8220;Sites&#8221; directory (~/Sites). If you haven&#8217;t already done so, install MySQL - I followed <a href="http://hivelogic.com/articles/installing-mysql-on-mac-os-x/" title="Hive and MySQL">these directions</a> with a strong cup of coffee and got it working.</p>
<p>Next, I followed <a href="http://keithmedlin.com/?p=26" title="Keith's tutorial">this excellent Cake Tutorial</a>, which includes how to get PHP and Cake up and running <em>(as well as the Cake Command Line tool)</em>, and begins to cover virtual hosts set-up (which we&#8217;ll modify a bit later).  It also runs over how to get MySQL up and running, but I didn&#8217;t try it as I already had it installed. Getting PHP and VHosts up and running is as easy as commenting out two lines in httpd.conf.</p>
<p>Note that the Cake tutorial will say that you&#8217;ll be able to view the website right after editing <strong>httpd-vhosts.conf</strong> - this is not true. You will need to complete the next step   and edit the <strong>/etc/hosts</strong> file as well, and then you can view the site.</p>
<h3>Why Virtual Hosts Are Cool</h3>
<p>Because you can simulate domains on your local computer. For example, you can create and view a development site like <u>http://www.caketest.dev</u> right in your browser, with full PHP/Database functionality, as opposed to something less fun like <u>http://127.0.0.1/~username/caketest</u> - this sort of URL breaks many of CakePHP&#8217;s references, which means your external CSS and JavaScript files won&#8217;t get loaded.</p>
<h2>Give Me More Domains, Dammit</h2>
<p>OK, by now you might want to have several testing domains setup - a great way to avoid trying out new things on a live website. After a bunch of research and experimentation, here&#8217;s how I got it working.</p>
<p>For reference, my user folder is &#8220;mmayes&#8221; - I&#8217;ll be referring to it in the following commands.</p>
<p>We&#8217;ll need to open some buried files, so let&#8217;s use the command line. The &#8220;mate&#8221; command here opens the file in Textmate, but you can use vi, vim, emacs, nano, etc.</p>
<pre>sudo mate /etc/hosts
sudo mate /private/etc/apache2/extra/httpd-vhosts.conf</pre>
<p>Stop web sharing in System Prefs -&gt; Sharing.</p>
<p>I have two cake test sites up and running: caketest and cakeblog. Here&#8217;s what my httpd-vhosts.conf looks like. Note the &lt;Directory &#8230; &gt; options are to allow .htaccess to work:</p>
<pre>NameVirtualHost *

# default folder when none specified
&lt;VirtualHost *&gt;
  DocumentRoot "/Users/mmayes/Sites"
&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
  DocumentRoot "/Users/mmayes/Sites/caketest"
  ServerName caketest.dev
  ServerAlias www.caketest.dev
  &lt;Directory "/Users/mmayes/Sites/caketest/"&gt;
    Options FollowSymLinks
    AllowOverride All
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
  DocumentRoot "/Users/mmayes/Sites/cakeblog"
  ServerName cakeblog.dev
  ServerAlias www.cakeblog.dev
  &lt;Directory "/Users/mmayes/Sites/cakeblog/"&gt;
    Options FollowSymLinks
    AllowOverride All
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
<p>And here&#8217;s what /etc/hosts looks like:</p>
<pre>### Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1    localhost
127.0.0.1   www.cakeblog.dev
127.0.0.1   www.caketest.dev
255.255.255.255    broadcasthost
::1             localhost
fe80::1%lo0    localhost</pre>
<p>Restart web sharing in System Prefs, and you should be able to view each domain.</p>
<p>I assume to add more domains, I can just proceed along these lines.  Hope this makes sense! Cheers.</p>
<p id="footNote"> References:<br />
<a href="http://alexking.org/blog/2007/11/01/apache-2-only-serves-first-virtual-host" title="Apache 2 Only...">Apache 2 Only Servers First Virtual Host | alexking.org</a><br />
<a href="http://alexking.org/blog/2007/11/01/apache-2-only-serves-first-virtual-host" title="Apache 2 Only..."></a><a href="http://keithmedlin.com/?p=26" title="installing CakePHP on...">Installing CakePHP on OS X Leopard | KeithMedlin.com</a><br />
<a href="http://alexking.org/blog/2007/11/01/apache-2-only-serves-first-virtual-host" title="Apache 2 Only..."></a><a href="http://hivelogic.com/articles/installing-mysql-on-mac-os-x/" title="Installing MySQL...">Installing MySQL on Mac OS X | HiveLogic.com</a><br />
<a href="http://alexking.org/blog/2007/11/01/apache-2-only-serves-first-virtual-host" title="Apache 2 Only..."></a><a href="http://www.cakephp.org/" title="CakePHP">CakePHP.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/53/cakephp-leopard-virtual-hosts/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using BBEdit&#8217;s Update Document Feature</title>
		<link>http://www.givegoodweb.com/post/50/bbedit-update-doc</link>
		<comments>http://www.givegoodweb.com/post/50/bbedit-update-doc#comments</comments>
		<pubDate>Wed, 02 Apr 2008 15:50:07 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[General Code]]></category>

		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/50/bbedit-update-doc</guid>
		<description><![CDATA[When you find yourself updating the same static HTML files over and over again, like with a newsletter, BBEdit's templating feature can really save you time and your clients money. Here's an example of the process I use with a bi-weekly HTML newsletter I do.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m becoming a hardcore <a href="http://macromates.com/" title="textmate home page">Textmate</a> guy when it comes to getting things done. When I open any other Texteditor, it&#8217;s using Emacs or Vim, and I&#8217;m just messing around (and discovering that Textmate has many of their cool features), and wondering when, <em>when!?</em>, is Textmate 2.0 coming out? <em>*sigh* </em>I can&#8217;t wait to see the new features.</p>
<p>Anyways, there is one thing I keep using <a href="http://www.barebones.com/products/bbedit/" title="BBEdit site">BBEdit</a> for - repetitive HTML newsletter design. With all the inline styles you have to do with newsletters, any sort of automation setup pays off.</p>
<p><a href="http://www.givegoodweb.com/wp-content/uploads/2008/04/bbedit-cb-news.jpg" title="bbedit-cb-news.jpg"><img src="http://www.givegoodweb.com/wp-content/uploads/2008/04/bbedit-cb-news.thumbnail.jpg" style="border: 1px solid #cccccc" alt="click for full size" align="right" /></a>Basically, you take 2 files, one with your variable declarations and one with your HTML template, and run the Update -&gt; Document command to spit out the completed HTML file. Here&#8217;s how it works - I&#8217;ll run through the step I take to do the <a href="http://www.ChronicBabe.com" title="ChronicBabe.com home page">ChronicBabe.com</a> newsletter. In this example, I&#8217;m creating this newsletter: <a href="http://orangegrovemedia.cmail1.com/campaign/campaignPreview.aspx?cID=XChO1r9e1Cs%3d&amp;f=t" title="Chronicbabe Write: How to get out of a rut">How to get out of a rut</a>.</p>
<ol>
<li> I receive the newsletter&#8217;s content in an MS Word document. I copy the entire thing into a new BBEdit window, and clean up all the MS Word gobbly-gook with <a href="http://www.unmarked.com/textsoap/" title="TextSoap website">TextSoap</a>.</li>
<li>I open my <a href="/examples/variables.html.txt" title="variable file example">variables file</a> in a new window, and just drag and drop the appropriate text into the variables. Note that this file needs to be formatted a certain way. At the top we need:
<pre>&lt;!-- #bbinclude "template.html"</pre>
<p>where &#8220;template.html&#8221; is the relative path to our HTML template, using the same folder your variables are in makes it easy. Our variables then look like:</p>
<pre>#h1_text# = "put your header text here"</pre>
<p>And at the very end of the file we need:</p>
<pre>--&gt;</pre>
<pre>&lt;!-- end bbinclude --&gt;</pre>
<p>Note that you <strong>cannot have quotes inside the variables</strong>! You need to either escape them with a backslash (which means un-escaping the finished file), or use their HTML entity. This is why I separate as many links from the content as possible, like in the <em>Amazon</em> and <em>Fab 5 Sites</em> sections of this particular newsletter.</li>
<li><a href="http://www.givegoodweb.com/wp-content/uploads/2008/04/update-doc.jpg" title="update-doc.jpg"><img src="http://www.givegoodweb.com/wp-content/uploads/2008/04/update-doc.thumbnail.jpg" alt="click for full size" align="right" /></a>When you&#8217;re all done, select Markup -&gt; Update -&gt; Document. If all goes well, your variable file will &#8220;suck in&#8221; the <a href="/examples/template.html.txt" title="template example">template file</a>, complete with the variables. If it looks like it stopped short, that likely means you have a stray quote somewhere. Locate it, <em>Undo</em> the update, and try again.</li>
<li>Though variables are all commented out, I usually clean everything up and cut/paste the final HTML, sans variable declarations, into a clean file.</li>
<li>From there, I save and reopen the newly minted HTML newsletter in Textmate for further tweaking and image placements. Often this is just placing text links, as my client often provides them as &#8220;&#8230; check out this site (link to: www.somesite.com).&#8221; Textmate makes this trivially easy with the hyperlink helper function, and I hardly touch the mouse, which is how I like it.</li>
<li>From there, the newsletter is ready to go!</li>
</ol>
<p>For monthly newsletter service, I typically charge a flat fee to keep billing easier. This saved me so much time that I actually lowered the fee for my client. Call me crazy, but when you run a referral based business, it rewards you with more business. Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/50/bbedit-update-doc/feed</wfw:commentRss>
		</item>
		<item>
		<title>Google Documentary: Good vs. Evil</title>
		<link>http://www.givegoodweb.com/post/48/google-documentary-good-vs-evil</link>
		<comments>http://www.givegoodweb.com/post/48/google-documentary-good-vs-evil#comments</comments>
		<pubDate>Fri, 28 Mar 2008 15:41:01 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/48/google-documentary-good-vs-evil</guid>
		<description><![CDATA[Every wonder what goes on behind the scenes of Google? Or what Google means to your privacy? Then check out this very well done, online video documentary.]]></description>
			<content:encoded><![CDATA[<p>This morning I watched this very interesting <a href="http://video.google.com/videoplay?docid=-1508211417393454786&#038;hl=en" title="Documentary on Google">documentary video on Google</a>. Coming in at around 45 minutes, I found it very well done and engaging. If you are interested in not only the base methodology behind how Google search works (there&#8217;s a very good explanation of Page Rank in the first 7 minutes), but the questions that arise when one company is building an information monopoly. Is Google good? If so, will they always be good? For a company who&#8217;s insider slogan is <em>Don&#8217;t be evil</em>, only time will tell.</p>
<p><a href="http://video.google.com/videoplay?docid=-1508211417393454786&#038;hl=en" title="Google documentary"><img src="http://www.givegoodweb.com/wp-content/uploads/2008/03/google-video.jpg" style="border: 1px solid #cccccc" alt="google-video.jpg" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/48/google-documentary-good-vs-evil/feed</wfw:commentRss>
		</item>
		<item>
		<title>Parsing and Calculating Data with Python and CSV Files</title>
		<link>http://www.givegoodweb.com/post/46/python-parse-calculate-csv</link>
		<comments>http://www.givegoodweb.com/post/46/python-parse-calculate-csv#comments</comments>
		<pubDate>Tue, 25 Mar 2008 16:58:11 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/46/parsing-and-calculating-data-with-python-and-csv-files</guid>
		<description><![CDATA[I&#8217;ve recently wrapped up a Dynamic Languages class, taught by David Beazley. Being a Python guru, this sorta turned into a Python class, but I had no problem with that. With Dave&#8217;s permission, I&#8217;ll be posting a few of the lessons here, as well as their solutions. I&#8217;ve already posted the first assignment and a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently wrapped up a Dynamic Languages class, taught by <a href="http://www.dabeaz.com/" title="DaBeaz">David Beazley</a>. Being a Python guru, this sorta turned into a Python class, but I had no problem with that. With Dave&#8217;s permission, I&#8217;ll be posting a few of the lessons here, as well as their solutions. I&#8217;ve already posted the <a href="http://www.givegoodweb.com/post/9/basic-file-parsing-with-php-and-python" title="Basic file parsing">first assignment</a> and a couple solutions, and here&#8217;s another one.</p>
<p>What we&#8217;ll do here is take a csv file that contains our stock portfolio. We&#8217;ll then take another csv file of stock data, and calculate the minimum and maximum value of our portfolio over time, and spit out a nicely formatted text table. All <a href="/examples/python-stock.zip" title="zip file">the files</a> are available for you to download and play with. I highly encourage newbies to try things out and beat their heads against the wall before viewing the solution, lord knows that&#8217;s how I&#8217;ve been picking up Python. Books can only take you so far.</p>
<h2>Your Mission, Should You Choose to Accept It:</h2>
<p><em>(Taken straight from Dave&#8217;s syllabus.)</em> The file <tt>dowstocks.csv</tt> contains a trace of stock market data scraped off of a finance web site over about a two day period.   This was done using a Python program:</p>
<pre>import urllib
import time

url = "http://someurl.known.to.me.but.not.to.you.com"
f = open("dowstocks.csv","w")

while True:
    u = urllib.urlopen(url)
    for line in u:
        f.write(line)
    f.flush()
    u.close()
    time.sleep(5*60)</pre>
<p>The contents of this file look like this:</p>
<pre>...
"GE",36.90,"8/15/2007","4:02pm",-0.78,37.58,37.93,36.72,45992656"
"GM",31.54,"8/15/2007","4:01pm",-1.53,32.85,33.31,31.19,12348300
"HD",33.36,"8/15/2007","4:01pm",-0.16,33.51,34.44,N/A,15896314
"HON",54.72,"8/15/2007","4:01pm",-1.65,56.59,57.21,54.55,3692121
"HPQ",46.15,"8/15/2007","4:00pm",-1.13,47.00,47.59,45.95,8860623
...</pre>
<p>The different fields are follows:</p>
<pre>symbol, price, date, time, change, open, low, high, volume</pre>
<p>If you look at the file, you will find that it&#8217;s a little messy. Certain fields have &#8220;N/A&#8221; filled in as a value. Moreover, you&#8217;ll probably find time gaps in the data (since I probably put my machine to sleep from time to time while this was running). The file <tt>dowportfolio.csv</tt> contains a portfolio of stocks that have been purchased earlier.   This file looks like this:</p>
<pre>MSFT,100,54.25
IBM,50,91.10
AA,25,23.10
...</pre>
<p>The different fields are follows:</p>
<pre>symbol, shares, purchase_price</pre>
<p><strong>The Big Perl Stock Smackdown</strong></p>
<p>Perl programmers are well aware that it is quite adept at processing data files.   Therefore, your challenge in this assignment is to put them all in their rightful place!  Well, if you can.</p>
<p>Your task is really quite simple: You are to write a program that reads the stock portfolio in <tt>dowportfolio.csv</tt>, the stock price data in <tt>dowstocks.csv</tt> and does the following:</p>
<ul>
<li>Finds the maximum value of the entire stock portfolio and the approximate date/time when it occurred.</li>
<li>Finds the minimum value of the entire stock portfolio and the approximate date/time when it occurred.</li>
<li>Produces a nicely formatted report that shows the performance of all holdings in the portfolio at both of those times.  For example:</li>
</ul>
<pre><img src="http://www.givegoodweb.com/wp-content/uploads/2008/03/stock-ex.png" alt="stock table example" /></pre>
<h3>Wrapping it Up</h3>
<p>OK now - the perl script I&#8217;ve provided in the zip file was written by Dave. I&#8217;ve also included my own script, which is the 3rd incantation of my original Python script. The 1st I wrote was not so good. After a few pointers from Dave, my second was better. The 3rd version I&#8217;m including I did off the top of my head, and it&#8217;s much cleaner, leaner, and faster, and beats the Perl script by 4 seconds or so when put up against this <a href="/examples/bigdowstocks.csv.zip" title="Take the challenge">50MB stock csv file</a>. Also note that the CSV module was NOT used. Another facet of this is to learn how powerful Python&#8217;s string manipulation tools are.</p>
<p>Again, try this out - take a few days with it before just looking at the answer. I&#8217;m no Python guru, but I sure learned a lot about how <strong>not</strong> to do things as I struggled with this, and sometimes the most learning occurs then. Good luck! Please leave your questions and comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/46/python-parse-calculate-csv/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
