<?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>Second-cup-of-coffee</title>
	<atom:link href="http://second-cup-of-coffee.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://second-cup-of-coffee.com</link>
	<description>Programming and politics</description>
	<lastBuildDate>Fri, 18 May 2012 15:17:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Easy way to pass multiple variables to a CodeIgniter validation callback</title>
		<link>http://second-cup-of-coffee.com/easy-way-to-pass-multiple-variables-to-a-codeigniter-validation-callback/</link>
		<comments>http://second-cup-of-coffee.com/easy-way-to-pass-multiple-variables-to-a-codeigniter-validation-callback/#comments</comments>
		<pubDate>Fri, 18 May 2012 15:17:55 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://second-cup-of-coffee.com/?p=26</guid>
		<description><![CDATA[I was recently working on a custom form validation callback for my CodeIgniter script. By default, one gets the field that you&#8217;re validating available in the callback function. For example, if I have the following form validation rule: $this-&#62;form_validation-&#62;set_rules('discountGlobal', 'Global &#8230; <a href="http://second-cup-of-coffee.com/easy-way-to-pass-multiple-variables-to-a-codeigniter-validation-callback/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently working on a <a title="Custom form validation callbacks" href="http://codeigniter.com/user_guide/libraries/form_validation.html#callbacks" target="_blank">custom form validation callback</a> for my <a title="CodeIgniter" href="http://codeigniter.com" target="_blank">CodeIgniter</a> script. By default, one gets the field that you&#8217;re validating available in the callback function. For example, if I have the following form validation rule:</p>
<p><code> $this-&gt;form_validation-&gt;set_rules('discountGlobal', 'Global Discount', 'trim|integer|max_length[1]|xss_clean|prep_for_form|only_one_global_discount[]');</code></p>
<p>My custom callback is only_one_global_discount. I am not explicitly passing anything through to it. However, in the function I have in my MY_Form_validation.php file, I can access the $discountGlobal value:</p>
<p><code>public function only_one_global_discount($discountGlobal) {<br />
$CI =&amp; get_instance();<br />
echo $discountGlobal;</code></p>
<p>You can also pass a second value, though. You would change your callback call to:</p>
<p><code>$this-&gt;form_validation-&gt;set_rules('discountGlobal', 'Global Discount', 'trim|integer|max_length[1]|xss_clean|prep_for_form|only_one_global_discount['.$test.']');</code></p>
<p>Where $test is the second value you want available to you in your function. The function call would then change to:</p>
<p><code>public function only_one_global_discount($discountGlobal, $test) {</code></p>
<p>And the value of $test would be available to you in the function. But what can you do if you need a third, fourth or even more values? My solution is to package up the variables you need in an array. Just passing through an array just gives me &#8220;Array&#8221; when using a print_r on it in my callback function. So, I used <a title="JSON Encode" href="http://il.php.net/manual/en/function.json-encode.php" target="_blank">json_encode</a> on the array before passing it through and then <a title="JSON Decode" href="http://www.php.net/manual/en/function.json-decode.php" target="_blank">json_decode</a> in my callback function. Viola! I have access to as many variables as I need.</p>
]]></content:encoded>
			<wfw:commentRss>http://second-cup-of-coffee.com/easy-way-to-pass-multiple-variables-to-a-codeigniter-validation-callback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari Extensions</title>
		<link>http://second-cup-of-coffee.com/safari-extensions/</link>
		<comments>http://second-cup-of-coffee.com/safari-extensions/#comments</comments>
		<pubDate>Thu, 17 May 2012 11:52:29 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://second-cup-of-coffee.com/?p=23</guid>
		<description><![CDATA[One of the things that bothers me about using Safari as a main browser, is that there is no simple way to see if the page you loaded contains a JavaScript error without actually opening the Web Inspector. I would &#8230; <a href="http://second-cup-of-coffee.com/safari-extensions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the things that bothers me about using Safari as a main browser, is that there is no simple way to see if the page you loaded contains a JavaScript error without actually opening the Web Inspector. I would love to have a simple button that would simply alert you to any JavaScript errors and then give a pop-up window of what those errors are. Something like this extension for Chrome:</p>
<p><a href="https://chrome.google.com/webstore/detail/jafmfknfnkoekkdocjiaipcnmkklaajd">JavaScript Errors Notifier</a></p>
<p>I would think accomplishing something like this would be fairly easy in a Safari extension but, after looking at the documentation, I don&#8217;t think there is a way to access messages in the Error Console. I see where one can log their own messages to go in there, but I didn&#8217;t see where one can actually read messages that Safari puts into there. I was looking at the documentation here:</p>
<p><a href="http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/Safari_Developer_Guide/DebuggingYourWebsite/DebuggingYourWebsite.html">Safari documentation</a></p>
<p>I am going to have to look for a resource where I can ask someone if this is possible. Another potential extension I was thinking about was an image overlay where a web developer could load in a comp above their webpage for comparison and adjust the opacity and position of the comp. This seems doable and I don&#8217;t see an existing one for Safari. There are ones for Chrome and Firefox but none of them seem to work all that great (at least on my Mac with the most up-to-date version of Chrome). The best I have found so far is:</p>
<p><a href="https://chrome.google.com/webstore/detail/olfihdjffmgfmmcdodcgciejhnhibalg">WebDeveloper Image Overlay</a></p>
<p>I think my first project, though, needs to be a redo of a site I built and abandoned, <a title="Dog Walk Spot" href="http://dogwalkspot.com" target="_blank">Dog Walk Spot</a>. I am trying to figure out now if I should build it totally custom in <a title="CodeIgniter" href="http://codeigniter.com" target="_blank">CodeIgniter</a> or make it a customized <a href="http://wordpress.org" target="_blank">WordPress</a> site. Since I want to have advanced searches and sorting on a custom data type (a walking location) I was leaning toward CodeIgniter. I know that I can use Custom Post Types in WordPress to add the fields I would want but I am unsure how flexible it would be in allowing sorting and advanced searching on criteria for those fields.</p>
]]></content:encoded>
			<wfw:commentRss>http://second-cup-of-coffee.com/safari-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>And the alternative is?</title>
		<link>http://second-cup-of-coffee.com/and-the-alternative-is/</link>
		<comments>http://second-cup-of-coffee.com/and-the-alternative-is/#comments</comments>
		<pubDate>Wed, 16 May 2012 01:31:17 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://second-cup-of-coffee.com/?p=18</guid>
		<description><![CDATA[When I see Republican critiques of the Obama administration&#8217;s handling of the economy, they seem be missing something&#8230; any kind of compelling alternative vision. As far as I can tell, Republicans want to repeal the Affordable Care Act (aka Obamacare) &#8230; <a href="http://second-cup-of-coffee.com/and-the-alternative-is/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I see Republican critiques of the Obama administration&#8217;s handling of the economy, they seem be missing something&#8230; any kind of compelling alternative vision. As far as I can tell, Republicans want to repeal the Affordable Care Act (aka Obamacare) but they don&#8217;t have anything to replace it with. Presumably the health care system before the health care overhaul was just fine? A shining example of the efficiencies of free market capitalism?</p>
<p>How would President Romney handle the issue of people not being able to get insured because of pre-existing conditions? When he was on the <em>Tonight Show</em>, Romney said:</p>
<blockquote><p>Well, if they are 45 years old and they show up and say I want insurance because I have heart disease, it’s like, ‘Hey guys. <strong>We can’t play the game like that. You’ve got to get insurance when you are well</strong> and then if you get ill, you are going to be covered. [...]</p></blockquote>
<p>So what is he saying here? He doesn&#8217;t want the government to have a mandate to compel people to purchase insurance. But he&#8217;s saying the only way to be guaranteed insurance is if you&#8217;ve kept it current since before you were 45 years old (why 45 years old?) So, you&#8217;re free to not get insurance but what happens to this irresponsible 45 year old with heart disease? What is the logical next step? We saddle the person with a health care debt that they have no hope of ever paying? Or, as some enthusiastic Republican debate attendees would want, do we &#8220;let him die?&#8221; What is the alternative?</p>
<p>As far as I can tell, there is absolutely no Republican plan for dealing with banks that are too big to fail and to address possibly risky financial tools like Credit Default Swaps that partially caused the financial sector meltdown in 2008. Their solution seems to be to roll back any and all regulations. And, I guess if big losses happen in the future (see what just happened at JP Morgan) and a large bank gets into trouble we&#8230; what? Let it fail and drag down the economy? Have another bailout?</p>
<p>From everything I can see, the Republicans seem to be running on a continuation of George W. Bush&#8217;s policies &#8211; more tax cuts geared toward the wealthy, rolling back any regulations, cutting social programs and attacking organized labor.</p>
]]></content:encoded>
			<wfw:commentRss>http://second-cup-of-coffee.com/and-the-alternative-is/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wolfenstein 3D in a browser</title>
		<link>http://second-cup-of-coffee.com/wolfenstein-3d-in-a-browser/</link>
		<comments>http://second-cup-of-coffee.com/wolfenstein-3d-in-a-browser/#comments</comments>
		<pubDate>Fri, 11 May 2012 10:40:56 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://second-cup-of-coffee.com/?p=14</guid>
		<description><![CDATA[To celebrate Wolfenstein 3D&#8217;s 20th anniversary, a browser version has been made available: http://wolfenstein.bethsoft.com/game/ It isn&#8217;t the most playable but it is really neat. I had some fun using Firebug in Firefox to explore the elements in the game and &#8230; <a href="http://second-cup-of-coffee.com/wolfenstein-3d-in-a-browser/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To celebrate Wolfenstein 3D&#8217;s 20th anniversary, a browser version has been made available:</p>
<p><a href="http://wolfenstein.bethsoft.com/game/">http://wolfenstein.bethsoft.com/game/</a></p>
<p>It isn&#8217;t the most playable but it is really neat. I had some fun using Firebug in Firefox to explore the elements in the game and to tweak the CSS on individual elements. For example, I found that the Game Over graphic is a hidden div that I could click off the display: none rule, set a higher z-index and display over the game screen during the game. I was also peeking at the Javascript files for the game like:</p>
<p><a href="http://wolfenstein.bethsoft.com/game/js/game.js">http://wolfenstein.bethsoft.com/game/js/game.js</a></p>
<p>Very neat stuff!</p>
]]></content:encoded>
			<wfw:commentRss>http://second-cup-of-coffee.com/wolfenstein-3d-in-a-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Launchbar 50% off at Macupdate.com</title>
		<link>http://second-cup-of-coffee.com/launchbar-50-off-at-macupdate-com/</link>
		<comments>http://second-cup-of-coffee.com/launchbar-50-off-at-macupdate-com/#comments</comments>
		<pubDate>Thu, 10 May 2012 10:39:08 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://second-cup-of-coffee.com/?p=12</guid>
		<description><![CDATA[Perhaps my favorite Macintosh utility, Launchbar, is on sale at MacUpdate today for half off. If I were to be using a Windows or Linux machine, I think that Launchbar is what I would miss most. It is hard to &#8230; <a href="http://second-cup-of-coffee.com/launchbar-50-off-at-macupdate-com/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Perhaps my favorite Macintosh utility, <a href="http://www.obdev.at/products/launchbar/index.html" target="_blank">Launchbar</a>, is <a href="http://www.mupromo.com/deal/1849/launchbar" target="_blank">on sale at MacUpdate</a> today for half off. If I were to be using a Windows or Linux machine, I think that Launchbar is what I would miss most. It is hard to explain how nice Launchbar is to someone who hasn&#8217;t used it and, indeed, it took me a while of using Quicksilver to really appreciate the usefulness of this kind of tool. My favorite features are the clipboard history at my fingertips and pulling up a contact&#8217;s information quickly. And I never ceased to be impressed by how quickly Launchbar seems to learn my preferences and anticipate what I most likely want to do. If you are using a Mac, check it out.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://second-cup-of-coffee.com/launchbar-50-off-at-macupdate-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Google Analytics</title>
		<link>http://second-cup-of-coffee.com/debugging-google-analytics/</link>
		<comments>http://second-cup-of-coffee.com/debugging-google-analytics/#comments</comments>
		<pubDate>Wed, 09 May 2012 01:06:25 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://second-cup-of-coffee.com/?p=6</guid>
		<description><![CDATA[I was recently working with Google Analytics and discovered the Google Analytics Tracking Code Debugger. In the past, one of the biggest frustrations I had was that I would make a change and then have to wait until the next &#8230; <a href="http://second-cup-of-coffee.com/debugging-google-analytics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently working with Google Analytics and discovered the Google Analytics Tracking Code Debugger. In the past, one of the biggest frustrations I had was that I would make a change and then have to wait until the next day to see if the changes worked. I guess that the time to see results with Google Analytics has been lessened recently but, in my experience, it still isn&#8217;t instantaneous. Google Analytics Debugger gives you instant feedback during development:</p>
<p><a title="Google Analytics " href="https://developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#gaDebug" target="_blank">https://developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#gaDebug</a></p>
<p>This allows you to see the results in a tool like Firefox&#8217;s <a title="Firebug" href="http://getfirebug.com/" target="_blank">Firebug</a> while testing on a local development server. It is much nicer than running tests and coming back hours later only to find that there was an error in your code. I am not sure when this tool was made available, but I wish I knew about it earlier.</p>
]]></content:encoded>
			<wfw:commentRss>http://second-cup-of-coffee.com/debugging-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

