<?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>the Blog of the Lion &#187; Code</title>
	<atom:link href="http://www.padizio.com/blog/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.padizio.com/blog</link>
	<description>Hi. My blog. This description is non-normative.</description>
	<lastBuildDate>Sat, 04 Sep 2010 22:50:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Interpreting CSS, part 1</title>
		<link>http://www.padizio.com/blog/code/interpreting-css-part-1/</link>
		<comments>http://www.padizio.com/blog/code/interpreting-css-part-1/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 17:17:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.padizio.com/blog/?p=113</guid>
		<description><![CDATA[Hey folks!
I&#8217;ve been seeing on the web lately that a lot of people are still having a hard time &#8220;getting&#8221; CSS.  It&#8217;s not really code, in that it doesn&#8217;t execute, so it doesn&#8217;t really look right to programmers.  Yet, it a kind of language, in that it has a syntax and a grammar, [...]]]></description>
			<content:encoded><![CDATA[<p>Hey folks!</p>
<p>I&#8217;ve been seeing on the web lately that a lot of people are still having a hard time &#8220;getting&#8221; <abbr title="Cascading Style Sheets">CSS</abbr>.  It&#8217;s not really code, in that it doesn&#8217;t execute, so it doesn&#8217;t really look right to programmers.  Yet, it a kind of language, in that it has a syntax and a grammar, that is very terse, and not exactly straightforward &#8211; tough on the graphic design folks I know.</p>
<p><span id="more-113"></span></p>
<p>However, CSS has distinct advantages over the classic ways of styling and laying out HTML.  It&#8217;s biggest advantage is write-once / style-anywhere:  change a line of CSS in your stylesheet file, and every page that uses that stylesheet has the new style applied.  This is a double-edged sword: it saves a lot of time once your style is put together, because any style changes do not have to be applied across every page (remember the <samp>&lt;font&gt;</samp> tag?  Ick!).  But, change the wrong line, and every linked page suffers!  With great power, comes great responsibility.</p>
<p>Really, though, there&#8217;s a few simple rules to CSS, and a few caveats to learn.  To try and help, I thought I&#8217;d lend a hand and share what I know.  This is all from my experience building web pages.  I&#8217;ve not found a teacher yet that really tries to teach CSS; often given the tools we currently have, it&#8217;s easier to use tables and tags for layout and style, respectively.</p>
<h4>Here&#8217;s the basics:</h4>
<ol>
<li>A line or block of CSS is called a rule.  The rule has two parts:  the &#8220;Selector&#8221;, and the style block.  The style block contains one or more style statements, with an attribute, and value specified for that attribute.</li>
<li>Styles apply to elements in HTML.  The CSS Selector determines to which elements the style applies.</li>
<li>Styles apply in order.  This means that if more than one rule applies to an element, the later one, either later in the same stylesheet, or in a stylesheet that is loaded after a previous sheet, override the earlier.</li>
<li>More specific selectors get preference &#8211; even if the more specific rule is before the more generic rule.</li>
<li>The <samp>!important</samp> also gets preference.</li>
<li>Extra white space is ignored.</li>
<li>In the style block, style attribute/value pairs should be separated with a &#8216;:&#8217; and end with a &#8216;;&#8217;.</li>
</ol>
<h3>Building Selectors</h3>
<h4>Tag Selectors</h4>
<p>You can specify all <samp>&lt;p&gt;</samp> tags very easily.  The selector?  Just <samp>p</samp>.</p>
<p><code>p { text-align: left; }<br />
</code></p>
<p>With that rule applied, all paragraphs specified by a p tag in the HTML will have text aligned left.  More examples:</p>
<p><code>h1 {<br />
  font-weight: bold;<br />
  text-align: right;<br />
  font-size: 18pt;<br />
}<br />
div {<br />
  display: block;<br />
}<br />
</code></p>
<p>It&#8217;s should be easy enough to interpret that h1 rule: the text will be bold, aligned right, and 18pt.  The div &#8211; diplay: block &#8211; is a layout thing.  In HTML, there are block elements and inline elements &#8211; headers (h1-h6) and paragraphs are block by default, but <samp>&lt;em&gt;</samp> or <samp>&lt;strong&gt;</samp> tags are rendered inline.</p>
<p>What does that mean?  A block element renders on it&#8217;s own line.  There will be a line break before and after a block element. Essentially, it &#8220;blocks off&#8221; it&#8217;s own part of the page.  An inline element displays exactly so: in-line.  A <samp>&lt;strong&gt;</samp> tag is intended to bold text within a paragraph or heading, for example.  Of course, using CSS, you can change this behavior.  You could make the strong tag render as a block, and make it italicize the text rather than bold it, if you wanted to.  CSS styles always override the browser&#8217;s default styling (this will be useful later!).</p>
<p>Tag based selectors are fantastic &#8211; you can re-purpose HTML to display exactly as you like it, and it will do your bidding.  Any time you can use an existing tag to mark up your data or content in a way that makes sense, you should do it &#8211; this is called semantic HTML.  The best semantic tags are the basic ones:</p>
<ul>
<li>Headers (<samp>h1</samp>-<samp>h6</samp>)</li>
<li>Paragraphs (<samp>p</samp>)</li>
<li>Numberd Lists (<samp>ol</samp> and <samp>li</samp>)</li>
<li>Bullet lists (<samp>ul</samp> and <samp>li</samp>)</li>
<li>Abbreviations (<sampl>abbr</samp> and the <samp>title</samp> attribute &#8211; look at the word CSS in the first paragraph of this article)</li>
</ul>
<h4>Class Selectors</h4>
<p>Sometimes, you need to specialize a tag so that it has a specific style.  You want to re-use the tag and style, but not in absolutely every instance of the tag.  This is where classes come into play.</p>
<p><code>&lt;div class="note"&gt;<br />
This is a special note.<br />
&lt;/div&gt;<br />
</code></p>
<p>Above we have a <samp>&lt;div&gt;</samp> tag, and we&#8217;d like to make it look like a &#8220;note&#8221; or a notation of some kind.  It should get set apart from our content in some way, and styled appropriately.  However, we don&#8217;t want every <samp>&lt;div&gt;</samp> block to look like a note.  So, we&#8217;ve added &#8220;note&#8221; to the <samp>class</samp> attribute of the <samp>&lt;div&gt;</samp> tag.  That way, we can craft a CSS selector that doesn&#8217;t target the tag, it targets the class.  That CSS selector will look like this:</p>
<p><code>.note {<br />
 background-color: yellow;<br />
 margin: 5px;<br />
}<br />
</code></p>
<p>Now the <samp>&lt;div&gt;</samp> tag shown above will have a yellow background, and a 5 pixel margin surrounding the block.  <samp>div</samp>&#8217;s are rendered as blocks by default; the <samp>&lt;span&gt;</samp> tag is the inline equivalent.</p>
<p>Don&#8217;t be too hasty to mark up your code with a bunch of classes.  There are times when they make sense &#8211; you have a class of block elements that need to be styled a specific way.  However, if there&#8217;s an HTML tag that already makes sense for that purpose, use it instead.  That makes your code more semantic, which means it is easier to maintain and read.  It also keeps the code shorter if you can use a tag rather than a tag + class combo.</p>
<h4>ID selectors</h4>
<p>OK, so let&#8217;s say you have a specific element on a page that you need to target.  Say it&#8217;s the logo, and you want to make sure it appears in the top-left corner of your page.  You can give that element an ID, and then build a selector to style it. Like so:</p>
<p><code>&lt;img id="logo" src="/img/logo.jpg"&gt;<br />
</code></p>
<p>Now that you&#8217;ve got the id in your HTML, you can style it like so:</p>
<p><code>#logo {<br />
position: absolute;<br />
top: 0px;<br />
left: 0px;<br />
}</code></p>
<p>That bit of CSS will grab the logo image and put it in the top, left corner of the page. (It also pulls it out of the document flow &#8211; that&#8217;s a whole other article, though!)</p>
<h3>Specificity</h3>
<p>So now that you&#8217;ve got an idea of how these selectors get built, you can start to get a feel for specificity.  Here&#8217;s the rules on that:</p>
<ul>
<li>Tag selectors are the most general.</li>
<li>Class selectors are more specific than tags.  Given a tag rule and a class rule, the browser will apply override styles in the tag rule with those from the class rule.</li>
<li>ID selectors are the most specific.  Given a tag, class, and id rule, the browser will over ride tag and class style with those of the id rule.</li>
</ul>
<p>So, given this CSS:</p>
<p><code>#logo {<br />
border: none;<br />
position: absolute;<br />
top: 0px;<br />
left: 0px;<br />
}<br />
img {<br />
display: block;<br />
border: 1px solid black;<br />
}<br />
.special {<br />
border: 2px solid red;<br />
margin: 3px;<br />
}<br />
</code></p>
<p>The <samp>&lt;img&gt;</samp> with <samp>id=&#8221;logo&#8221;</samp> will have no border, and it will be positioned in the upper left corner.  This is because the id rule is considered the most specific rule, even though it&#8217;s an img tag.</p>
<p>All images in the document will have a black border of 1px width.  An image with a <samp>class=&#8221;special&#8221;</samp>, however, will drop the 1px black border, and have a 2px red border, as well as a 3px margin on all sides.  The class rule is more specific than the tag rule.</p>
<p>Note that in this case, the order of these rules doesn&#8217;t matter; they have clear specificity distinctions.  Order only matters when the specificity is equal: if you are styling the img tag in one stylesheet, and then re-styling it in a second stylesheet, whichever sheet loads second in the HTML will be the overriding rule.</p>
<h3>Conclusion</h3>
<p>There&#8217;s a lot more that you can do with stylesheets beyond this.  Look out for the next post, which will be about combining selectors (using tags, ids, and classes in the same rule), and give you some more style attributes.</p>
<h4>Tags Covered:</h4>
<ul>
<li><a href="http://www.w3schools.com/tags/tag_div.asp" title="Div Tag">div</a></li>
<li><a href="http://www.w3schools.com/tags/tag_phrase_elements.asp" title="Emphasis Tag">em</a></li>
<li><a href="http://www.w3schools.com/tags/tag_hn.asp" title="Header Tags">h1-h6</a></li>
<li><a href="http://www.w3schools.com/tags/tag_li.asp" title="List Item Tag">li</a></li>
<li><a href="http://www.w3schools.com/tags/tag_ol.asp" title="Ordered List Tag">ol</a></li>
<li><a href="http://www.w3schools.com/tags/tag_p.asp" title="Paragraph Tag">p</a></li>
<li><a href="http://www.w3schools.com/tags/tag_span.asp" title="Span Tag">span</a></li>
<li><a href="http://www.w3schools.com/tags/tag_phrase_elements.asp" title="Strong Tag">strong</a></li>
<li><a href="http://www.w3schools.com/tags/tag_ul.asp" title="Unordered List Tag">ul</a></li>
</ul>
<h4>Style Attributes Covered:</h4>
<ul>
<li><a href="http://www.w3schools.com/css/pr_background-color.asp" title="Background Color Property">background-color</a></li>
<li><a href="http://www.w3schools.com/css/pr_border.asp" title="Border Property">border</a></li>
<li><a href="http://www.w3schools.com/css/pr_class_display.asp" title="Display Property">display</a></li>
<li><a href="http://www.w3schools.com/css/pr_font_font-size.asp" title="Font Size Property">font-size</a></li>
<li><a href="http://www.w3schools.com/css/pr_font_weight.asp" title="Font Weight Property">font-weight</a></li>
<li><a href="http://www.w3schools.com/css/pr_pos_left.asp" title="Position Left Property">left</a></li>
<li><a href="http://www.w3schools.com/css/pr_margin.asp" title="Margin Property">margin</a></li>
<li><a href="http://www.w3schools.com/css/pr_class_position.asp" title="Position Property">position</a></li>
<li><a href="http://www.w3schools.com/css/pr_text_text-align.asp" title="Text Align Property">text-align</a></li>
<li><a href="http://www.w3schools.com/css/pr_pos_top.asp" title="Position Top Property">top</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.padizio.com/blog/code/interpreting-css-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress, I really love you.</title>
		<link>http://www.padizio.com/blog/code/wordpress-i-really-love-you/</link>
		<comments>http://www.padizio.com/blog/code/wordpress-i-really-love-you/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 20:47:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.padizio.com/blog/?p=98</guid>
		<description><![CDATA[Have I mentioned that Wordpress is awesome lately?  Today I needed to dynamically create an XSPF playlist for a website mp3 player.  There&#8217;s a great XSPF player available over at Sourceforge that my client wanted to use.  XSPF is just an XML dialect, so it shouldn&#8217;t be too tough to output from [...]]]></description>
			<content:encoded><![CDATA[<p>Have I mentioned that <a href="http://www.worpress.org" title="Wordpress">Wordpress</a> is awesome lately?  Today I needed to dynamically create an <a href="http://www.xspf.org" title="XML Shareable Playlist Format">XSPF playlist</a> for a website mp3 player.  There&#8217;s a great XSPF player available over at <a href="http://musicplayer.sourceforge.net/" title="XSPF Flash Music Player">Sourceforge</a> that my client wanted to use.  XSPF is just an XML dialect, so it shouldn&#8217;t be too tough to output from Wordpress, right?</p>
<p>My plan was to make a special category of links in Wordpress.  Call it something special (how&#8217;s about &#8220;Playlist&#8221;) and add a bunch of links to .mp3 files posted out on the ol&#8217; internet.</p>
<p><span id="more-98"></span></p>
<p>Couldn&#8217;t find a plugin to do exactly what I wanted, but I knew the <a href="http://wordpress.org/extend/plugins/podcasting/" title="Podcasting for Wordpress">Podcasting Plugin</a> basically extended the RSS functionality of Wordpress to add special tags to the feed.  Looking at the source of WP, as well as the Podcasting plugin, it became almost trivial to write a plugin to create a special &#8220;feed&#8221; format (xspf).  From there, I created a template XSPF file, and pulled the links with the <samp><a href="http://codex.wordpress.org/Template_Tags/get_bookmarks" title="get_bookmarks documentation">get_bookmarks</a></samp> command.  (Note that I use the word &#8220;feed&#8221; in quotes, as XSPF is not really intended as a &#8220;feed&#8221; format to my knowledge.)</p>
<p><a href="http://codex.wordpress.org" title="Wordpress Docs">Wordpress&#8217;s documentation</a> is excellent.  Their coding standards are awesome &#8211; that&#8217;s what makes this quick synthesis and creation possible.  I hope to do a little more work with this plugin, so I can push it to the Wordpress Plugins archive.  I really love this piece of software, and if I can, I want to contribute when I extend it in a useful way.</p>
<p>Take a look over <a href="http://www.deludigi.com/wordpress-plugins/xspf/" title="XSPF &#8220;Feed&#8221; Creator">here</a> if you&#8217;d like to use the XSPF plugin yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.padizio.com/blog/code/wordpress-i-really-love-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piece of Cake</title>
		<link>http://www.padizio.com/blog/code/piece-of-cake/</link>
		<comments>http://www.padizio.com/blog/code/piece-of-cake/#comments</comments>
		<pubDate>Tue, 27 Jun 2006 13:22:00 +0000</pubDate>
		<dc:creator>PD</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.padizio.com/blog/?p=11</guid>
		<description><![CDATA[Well, folks, I&#8217;m back from Summer Film with a vengance.  And it&#8217;s time to get down to some programming, so here goes.
We&#8217;ve all heard about Ruby on Rails.   &#8220;It&#8217;s so great,&#8221; they say.  &#8220;Ruby is so simple, and efficient,&#8221; I hear.  &#8220;There&#8217;s a cool guide that has Foxes!&#8221; says some [...]]]></description>
			<content:encoded><![CDATA[<p>Well, folks, I&#8217;m back from Summer Film with a vengance.  And it&#8217;s time to get down to some programming, so here goes.</p>
<p>We&#8217;ve all heard about Ruby on Rails.   &#8220;It&#8217;s so great,&#8221; they say.  &#8220;Ruby is so simple, and efficient,&#8221; I hear.  &#8220;There&#8217;s a cool <a href="http://poignantguide.net/ruby/">guide that has Foxes</a>!&#8221; says some other guy from the back.</p>
<p><span id="more-11"></span></p>
<p>But I already know PHP.  I like PHP.  In fact, I <span style="font-style: italic;">really</span> like PHP.  It has that old-school C style syntax, and yet, it&#8217;s just frustratingly different enough from C to make it enjoyable to code in. (I use 4; 5&#8217;s good too, but I haven&#8217;t bothered to seriously update, because my hosts still use 4 on the majority of their boxes, including the one I&#8217;m on.)</p>
<p>So what great MVC package is there for PHP similar to Rails for Ruby?  Well, there&#8217;s <a href="http://www.phpontrax.com">PHP on Trax.</a>  A plus is that it fairly closely follows Rails.  But, it requires PHP 5.  Hmm.  Yeah.  5&#8217;s great, but no thanks right now.</p>
<p>There&#8217;s also <a href="http://taniphp.dumitrup.com/">TaniPHP</a>, which supports PHP 4.  But that&#8217;s not been updated in ages, and it looks like it won&#8217;t be.</p>
<p>And then there&#8217;s <a href="http://cakephp.org">CakePHP</a>.  PHP 4 support, check.  Inspired by Rails, check.  Good documentation, check.  Active community, check. Fantastic.</p>
<p>So here&#8217;s my adventure installing CakePHP on Mac OS X.  You can follow along, if you like.</p>
<p><span style="font-weight: bold;">Step Zero:</span><br />
Install PHP and MySQL for OS X.  I did this a long time ago, but if you&#8217;re just getting started, you&#8217;ll probably like to do this.  Otherwise, things are really not going to make sense later.  There are great instructions for installing PHP &amp; MySQL by hand on <a href="http://developer.apple.com/internet/opensource/php.html">Apple&#8217;s Developer Connection</a>, but I&#8217;m not setting up a production box, I&#8217;m setting up a development box.  For that, I do things the easy way.  I&#8217;ll optimize later.</p>
<p>So here&#8217;s the easy way: Marc Liyanage&#8217;s <a href="http://www.entropy.ch/software/macosx/">OS X Packages</a>.  Easy, helpful, just follow his instructions.</p>
<p><span style="font-weight: bold;">Step One:</span><br />
Download and unzip Cake.  Because I&#8217;m developing multiple Cake apps, I&#8217;m going to put the resulting directory in my /Library (that&#8217;s Root Library.  Not the User or System Library.)  On most Unix systems, a shared Cake install goes to /usr/lib.</p>
<p>The latest stable version at the time of this writing is 1.1.5.3148.  Go ahead and download it from <a href="http://cakeforge.org/frs/?group_id=23&amp;release_id=108">CakeForge</a>.  Once you&#8217;ve unzipped it, rename the resulting folder &#8220;Cake&#8221; and move Cake to /Library.  Now you&#8217;ll have your Cake Libraries installed in /Library/Cake.  Recursively delicious.</p>
<p><span style="font-weight: bold;">Step Two:</span><br />
It&#8217;s likely you want to work on your Cake application somewhere other than /Library.  And you probably don&#8217;t feel like modifying httpd.conf either.  So good news &#8211; you can simply move the /Library/Cake/app folder wherever you feel like working &#8211; and name it whatever you like.  You can also duplicate this folder and create <span style="font-style: italic;">multiple</span> Cake apps.  I simply put it in my home directory.  Thus, I end up with /Users/myhomedir/app.  If I want to start a blog application (like the <a href="http://manual.cakephp.org/chapter/18">tutorial app</a>, for example) I&#8217;ll duplicate that folder and rename it &#8216;blog.&#8217;  I can duplicate this folder over and over to create my applications.</p>
<p><span style="font-weight: bold;">Step Three:</span><br />
Now that you have your library and applications folders in place, you need to move Cake&#8217;s webroot directory into the place where you want to serve your files from.  For example, when you activate Personal Web Sharing, the Apache serves files from /Library/WebServer/Documents.  If I move /Users/myhomedir/app/webroot to /Library/WebServer/Documents/webroot, then my Cake application will be accessible at http://localhost/webroot/.  If I copy the <span style="font-style: italic;">contents</span> of app/webroot, to /Library/WebServer/Documents, then my Cake app will simply serve out of http://localhost.</p>
<p>I like working out of my home directory, though.  Fortunately, Personal Web Sharing also enables the Sites folder of my home directory to serve files: http://localhost/~myhomedir/.  Using the blog example, I&#8217;ll typically move the webroot folder (in /Users/myhomedir/app) to /Users/myhomedir/Sites, and then rename it &#8216;blog.&#8217;  Now, my Cake blog will be served from http://localhost/~myhomedir/blog/.  Flexible, and handy.</p>
<p><span style="font-weight: bold;">Step Four:</span><br />
Now all your files are in place.  To give Cake a working install, though, you&#8217;ll need to tell it where your libraries and app files are!</p>
<p>Going back to the blog example, let&#8217;s review:<br />
My Cake Libraries are in /Library/Cake.<br />
My Application Folder is /Users/myhomedir/blog.<br />
My Application Webroot is /Users/myhomedir/Sites/blog.</p>
<p>First, modify the index.php file in your webroot. Look for the comment box that talks about Cake being installed in a directory layout different from it&#8217;s distribution.  Modify the code like so:</p>
<pre class="code">/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed.
* Each define has a commented line of code that explains what you would change.
*
*/
if (!defined('ROOT')) {
  //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS
               //LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
  //You should also use the DS define to seperate your directories
  //define('ROOT', dirname(dirname(dirname(__FILE__))));
  define('ROOT', DS . 'Users' . DS . 'myhomedir');
}
if (!defined('APP_DIR')) {
  //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
  //define('APP_DIR', basename(dirname(dirname(__FILE__))));
  define('APP_DIR', 'blog');
}
/**
* This only needs to be changed if the cake installed libs are located
* outside of the distributed directory structure.
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE
        //CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
  //You should also use the DS define to seperate your directories
  //define('CAKE_CORE_INCLUDE_PATH', ROOT);
  define('CAKE_CORE_INCLUDE_PATH', DS . 'Library' . DS . 'Cake');
}</pre>
<p>Now Cake knows where to find it&#8217;s library and application files.</p>
<p>All that&#8217;s left is to setup the database connection.  Easy peasy:  go to the application directory (/Users/myhomedir/blog).  You&#8217;ll see a &#8220;config&#8221; folder.  Within that folder, duplicate &#8220;database.php.default&#8221; and rename the copy database.php.  Open up this file in your text editor of choice (I like <a href="http://jedit.org">jEdit</a> as far as programming, by the way).</p>
<p>Cake is nice in that you can be simultaneously running a few databases in order to have a &#8216;testing&#8217; environment and a &#8216;default&#8217; environment.  Since this is just a development box, I generally just modify the default array.  For this setup, you need only change the &#8220;login&#8221;, &#8220;password,&#8221; and &#8220;database&#8221; values to their appropriate MySQL values.  For example:</p>
<pre class="code">
var $default = array('driver' => 'mysql',
      'connect' => 'mysql_connect',
      'host' => 'localhost',
      'login' => 'mymysqluser',
      'password' => 'foxessuckoknotreally',
      'database' => 'blog',
      'prefix' => '');
</pre>
<p><span style="font-weight: bold;">Step Five:</span><br />
Start coding!</p>
<p>That&#8217;s all there is to it.  You&#8217;re ready to code up the Blog tutorial, or start your own application.  And a big plus is that for any major Cake changes, you can just install the new libraries into /Library/Cake, without having to change your application code!</p>
<p>Out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.padizio.com/blog/code/piece-of-cake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag &#8216;n Drop Googley Goodness</title>
		<link>http://www.padizio.com/blog/code/drag-n-drop-googley-goodness/</link>
		<comments>http://www.padizio.com/blog/code/drag-n-drop-googley-goodness/#comments</comments>
		<pubDate>Sun, 28 May 2006 13:53:00 +0000</pubDate>
		<dc:creator>PD</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.padizio.com/blog/?p=8</guid>
		<description><![CDATA[Hey all.
Got a pet project I&#8217;m gonna lay on &#8216;ya.  It&#8217;s a Google Search builder.
One of the fun things about Google is the interesting stuff you can find by just surfing and modifying your searches.  But it&#8217;s such a hassle typing all the time.  You gotta put your hand on the mouse [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all.</p>
<p>Got a pet project I&#8217;m gonna lay on &#8216;ya.  It&#8217;s a Google Search builder.</p>
<p>One of the fun things about Google is the interesting stuff you can find by just surfing and modifying your searches.  But it&#8217;s such a hassle typing all the time.  You gotta put your hand on the mouse to click links anyway, right?</p>
<p>So with <a href="http://www.deludigi.com/googletest/builder.php">this (very beta! so beta, it&#8217;s alpha!) page</a>, you can drag-and-drop words.  The green box is words you&#8217;re looking for, the red box is words you&#8217;re ignoring.  The orange box is a shelf to save interesting results in.  Yellow words are draggable.  Give it a shot.  Click the &#8220;Semi-Live&#8221; to get a new page of results every time you drag a word around.</p>
<p>One caveat: This does break the &#8220;back&#8221; button.  It&#8217;s all AJAX-y and cool, but I haven&#8217;t given it any kind of memory yet.  I&#8217;ll get to it.</p>
<p>Rock.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.padizio.com/blog/code/drag-n-drop-googley-goodness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Adsense and Blogger</title>
		<link>http://www.padizio.com/blog/code/fun-with-adsense-and-blogger/</link>
		<comments>http://www.padizio.com/blog/code/fun-with-adsense-and-blogger/#comments</comments>
		<pubDate>Sun, 28 May 2006 01:10:00 +0000</pubDate>
		<dc:creator>PD</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.padizio.com/blog/?p=6</guid>
		<description><![CDATA[Hey all!
Soooo&#8230;. I&#8217;ve set up this blog, right.  It&#8217;s right here.  You&#8217;re reading it.  Good on ya.
And Blogger makes it really easy to add Google Adsense to the blog.  Real easy.  &#8216;Cuz Google owns Blogger.  Cool beans.  It&#8217;s all good.

But, you&#8217;ve got one spot (according to the Blogger [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all!</p>
<p>Soooo&#8230;. I&#8217;ve set up this blog, right.  It&#8217;s right here.  You&#8217;re reading it.  Good on ya.</p>
<p>And Blogger makes it really easy to add Google Adsense to the blog.  Real easy.  &#8216;Cuz Google owns Blogger.  Cool beans.  It&#8217;s all good.</p>
<p><span id="more-6"></span></p>
<p>But, you&#8217;ve got one spot (according to the Blogger Template tools) that those ads can go.  I&#8217;m a rebel, so I manually re-placed the adds over in the Sidebar where they don&#8217;t look like some crazy post where I when jumbo-doodle-cakes talkin&#8217; &#8216;bout Pistons Collectible Gear in crazy link-type format.  Fantastic.</p>
<p>Then I went to change the color scheme of the Adsense.  That&#8217;s when it hit me.  Boom.  Jackhammer.  You simply can&#8217;t move the Adsense.  We want it up top.  That&#8217;s it.</p>
<p>So I re-moved it down to the side bar and figured I&#8217;d fix the colors in the code.  If you&#8217;re like me and you&#8217;ve moved your Adsense button, <span style="font-weight: bold;">don&#8217;t ever</span> touch the Adsense tab in Template editor, or you&#8217;ll find all your hard work undone.</p>
<p>So I go to edit the colors.  I do so.  The Adsense code is nice in that it gives you helpful javascript variables that you can set to the appropriate color as you see fit.  I did so.  I preview&#8217;ed.  Everything is cool.</p>
<p>But when I go to re-publish my site, the colors won&#8217;t stick.  The Adsense is right where it&#8217;s supposed to be.  It looks OK.  But it&#8217;s stuck color-wise.  Which is really odd, because it <span style="font-style: italic;">works</span> in the Blogger Preview.  But not fo-real I guess.  Not cool, guys.</p>
<p>Huh.</p>
<p>UPDATE: Well, the colors updated between runs of Firefox.  Which is interesting, because the first thing I tried was a reload, followed by a reload-frame, followed by a clear of the cache.  Another interesting quirk: when I went to update this post, Firefox would routinely crash.  I am now updating in Safari.  Freaky.</p>
<p>Huh again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.padizio.com/blog/code/fun-with-adsense-and-blogger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
