<?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>Adventures in Japanese Programming</title>
	<atom:link href="http://blog.japanesetesting.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.japanesetesting.com</link>
	<description>Design and Programming of a mISV Site</description>
	<lastBuildDate>Tue, 24 Nov 2009 02:49:10 +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>The Programmer&#8217;s Folly: Simple is best</title>
		<link>http://blog.japanesetesting.com/2009/11/24/the-programmers-folly-simple-is-best/</link>
		<comments>http://blog.japanesetesting.com/2009/11/24/the-programmers-folly-simple-is-best/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 02:44:38 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[system design]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=132</guid>
		<description><![CDATA[First, let me get this out in the open: I am not a marketer. I am not a content-organizer. I am a programmer. I like writing code, and I like creating new ways to do things. I like making things because it helps me see how they work &#8212; out-of-the-box-solutions bore me.
And that&#8217;s where I [...]]]></description>
			<content:encoded><![CDATA[<p>First, let me get this out in the open: I am not a marketer. I am not a content-organizer. I am a programmer. I like writing code, and I like creating new ways to do things. I like making things because it helps me see how they work &#8212; out-of-the-box-solutions bore me.</p>
<h2>And that&#8217;s where I screw up</h2>
<p>On Monday it was a national holiday here in Japan (勤労感謝の日) and I had about 4 hours to kill while the wife was out on her daily walk. I decided to work on my site &#8212; and what I needed more than anything was a nice heatmap to log user clicks.</p>
<p>I used the amazing <a href="http://www.labsmedia.com/clickheat/index.html" target="_blank">ClickHeat </a>which is a free heat-mapping application written in PHP. It works <strong>right out of the box</strong>, is amazingly configurable, and runs quickly thanks to it being written in clear PHP.</p>
<h2>Wouldn&#8217;t this be great as a CakePHP Plugin!</h2>
<p>This is where things start to get messy.</p>
<p>I love CakePHP. It makes development easy, is rather fast, and is highly extensible. So, I decided to wrap the ClickHeat application in a cake plugin, make it &#8220;<em>easy to integrate</em>&#8221; and put it in the <a href="http://bakery.cakephp.org" target="_blank">CakePHP Bakery</a>, instantly receiving fame, fortune and the accolades of my peers!</p>
<h2>4 hours later</h2>
<p>I had a mostly-working prototype that logged the data beautifully (although I couldn&#8217;t decide how to group the data on a dynamic site),  but didn&#8217;t have any of the nifty functions of the ClickHeat software such as sorting by date, admin panels, etc. because I hadn&#8217;t built those views yet. <strong>But I was hopeful!</strong></p>
<p>Then my wife came home and I stopped programming for the day.</p>
<h2>The next day, in 10 minutes</h2>
<p>I decided to install ClickHeat on one of my corporate sites at work.</p>
<ol>
<li>Copy ClickHeat folder</li>
<li>Set Cache &amp; Log permissions</li>
<li>Turn on Japanese Interface</li>
<li>Done</li>
</ol>
<p><strong>10 minutes</strong>. In ten minutes I had accomplished what I couldn&#8217;t complete in 4 hours, because I was prepared to use an out-of-the-box solution instead of trying the be the programming bad-ass and integrate it with CakePHP.</p>
<p>So this morning, I copied the folder to my CakePHP dir, made one change to the .htaccess file:</p>
<pre class="brush: plain;">
RewriteRule    clickheat/(.*)   -   [L]
</pre>
<p>And now I have working heatmaps on my site. (I also put them on my wordpress blog, so that you can see them in action for yourself).</p>
<p><a href="http://blog.japanesetesting.com/clickheat" target="_blank">See the amazing Japanese Programming Heatmaps</a>! (User: demo / Password: demo)</p>
<h1>The final Score</h1>
<p>So, what&#8217;s the final score?</p>
<h2>Being a &#8220;bad-ass&#8221; programmer</h2>
<ol>
<li><span style="color: #ff0000;">4 Hours Development</span></li>
<li><span style="color: #ff0000;">1 extra hour of planning before sleep</span></li>
<li><span style="color: #ff0000;">No Viewing Functionality</span></li>
<li><span style="color: #ff0000;">Installation NOT user friendly</span></li>
<li><span style="color: #ff0000;">Call time of 300ms per click for spinning up the cake processor<br />
</span></li>
<li><span style="color: #339966;">Logging Works</span></li>
</ol>
<h2>Being a smart programmer</h2>
<ol>
<li><span style="color: #339966;">1 Change in my htaccess file</span></li>
<li><span style="color: #339966;">10 minutes to install/configure</span></li>
<li><span style="color: #339966;">Call time of 150ms / click<br />
</span></li>
<li><span style="color: #ff0000;">Not following &#8220;best practices&#8221; for cakephp</span></li>
</ol>
<p>I think it&#8217;s pretty obvious what the best choice here is.</p>
<p>While I adore CakePHP and the things it lets you do simply by following convention &#8212; it&#8217;s very easy to get sucked into the &#8220;Best Practice&#8221; mindset, and waste a lot of time working on something that honestly doesn&#8217;t need to be tinkered with.</p>
<h2>Don&#8217;t re-invent the wheel</h2>
<p>It&#8217;s amazing how many times you can read that phrase and still find yourself re-inventing wheel after wheel after wheel. If you have a tool that does a job &#8212; <strong>use it</strong>. Do not worry about your fiddly code, and your &#8220;it&#8217;s not made here&#8221; mentality.</p>
<p>If the application is <strong>LACKING</strong> you can always edit it. But it makes no sense to start with something that does everything that you want, and then try to hack it apart just because you can. (Although I have to admit, it can be fun)</p>
<h2>With those four hours, I could have</h2>
<ul>
<li>written 1 article for my site,</li>
<li>uploaded around 10 flashcard packs</li>
<li>added 2 tests to the site</li>
<li>read a book</li>
<li>played a lot of video games</li>
<li>watched a movie</li>
<li>watched <strong>four</strong> (4) episodes of Doctor Who or The Green Wing.</li>
</ul>
<p>So Keith, this is a message to you:</p>
<ul>
<li>Don&#8217;t be a tool</li>
<li>Use your time wisely</li>
<li>If something works, do NOT break it just because you want to see how it works.</li>
<li>(Eat your veggies &#8212; love mom)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/11/24/the-programmers-folly-simple-is-best/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CakePHP DebugKit: Take Back your Debugging</title>
		<link>http://blog.japanesetesting.com/2009/11/12/cakephp-debugkit-take-back-your-debugging/</link>
		<comments>http://blog.japanesetesting.com/2009/11/12/cakephp-debugkit-take-back-your-debugging/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 03:48:47 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=115</guid>
		<description><![CDATA[Yet another foray into the WORD: The Subtitle blog posts; today we&#8217;re going to look at the amazing features of the CakePHP DebugKit.
The DebugKit is a standard plugin for CakePHP written by Mark Story. It provides a lot more information that the standard debugging features of cake (Errors, warnings, SQL Queries) and also keeps them [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another foray into the <strong>WORD: The Subtitle</strong> blog posts; today we&#8217;re going to look at the amazing features of the CakePHP DebugKit.</p>
<p>The <a href="http://www.ohloh.net/p/cakephp-debugkit">DebugKit </a>is a standard plugin for CakePHP written by <a href="http://mark-story.com/">Mark Story</a>. It provides a lot more information that the standard debugging features of cake (Errors, warnings, SQL Queries) and also keeps them in a nice contained collapsible icon at the top of your page so you don&#8217;t have to have error messages and sql queries appearing all over the page.</p>
<h2>The Debug Kit Interface</h2>
<div id="attachment_120" class="wp-caption aligncenter" style="width: 206px"><img class="size-full wp-image-120 " title="debug_icon" src="http://blog.japanesetesting.com/wp-content/uploads/2009/11/debug_icon.jpg" alt="DebugKit Icon" width="196" height="81" /><p class="wp-caption-text">DebugKit Icon</p></div>
<p>Click the Cake icon at the top of your page, and it expands to all the tools you&#8217;ll need.</p>
<div id="attachment_119" class="wp-caption aligncenter" style="width: 412px"><img class="size-full wp-image-119" title="debug_expanded" src="http://blog.japanesetesting.com/wp-content/uploads/2009/11/debug_expanded.jpg" alt="DebugKit Expanded" width="402" height="35" /><p class="wp-caption-text">DebugKit Expanded</p></div>
<p>If you click any of the titles there, it shows you various debug information such as the current Session information, how the Request was processed, the SQL Log, a timer for all the functions that were called, currently accessible variables and the current memory usage.</p>
<div id="attachment_122" class="wp-caption aligncenter" style="width: 341px"><img class="size-full wp-image-122 " title="debug_variables" src="http://blog.japanesetesting.com/wp-content/uploads/2009/11/debug_variables.jpg" alt="DebugKit Variables View" width="331" height="186" /><p class="wp-caption-text">DebugKit Variables View</p></div>
<div id="attachment_121" class="wp-caption aligncenter" style="width: 341px"><img class="size-full wp-image-121" title="debug_timer" src="http://blog.japanesetesting.com/wp-content/uploads/2009/11/debug_timer.jpg" alt="DebugKit Timer View" width="331" height="277" /><p class="wp-caption-text">DebugKit Timer View</p></div>
<p>All in all, an amazing amount of information. And best of all? It stays out of the way so your designs don&#8217;t get cluttered with debug information while you&#8217;re testing.</p>
<h2>Installation</h2>
<p>Installation is easy.</p>
<h3>Download</h3>
<p>Download the debug kit from ohloh. <a href="http://www.ohloh.net/p/cakephp-debugkit" target="_blank">http://www.ohloh.net/p/cakephp-debugkit</a></p>
<h3>Install</h3>
<p>Place the DebugKig in the plugins folder of your application:</p>
<p>/app/plugins/debug_kit/[INSERT ME HERE]</p>
<h3>Connect</h3>
<p>Add the DebugKit Toolbar component to your app_controller, so it will be available to all your controllers.</p>
<pre class="brush: php;">

// app_controller.php
var $components = array('DebugKit.Toolbar');
</pre>
<p>Then set the debug mode to at least 1.</p>
<h2>Problems</h2>
<p>DebugKit isn&#8217;t a perfect system (or maybe my understanding of it isn&#8217;t quite perfect). In any case, these are some problems I&#8217;ve had with DebugKit, but even they&#8217;re not enough to really gripe about.</p>
<h3>Speed</h3>
<p>DebugKit does seem to take <strong>a lot</strong> more processing power to run it than the standard Debug functions of cake.</p>
<p>This is easy to understand, though, as with the timers, reporters and everything, it&#8217;s doing quite a bit more than the standard Debug functions, and gives you a lot more information. I&#8217;ve had my dev-laptop exceed the 30sec execution time limit quite a few times while running DebugKit, but nothing like that has ever happened on my dev-server, so I doubt it&#8217;s anything major. It does make navigation a bit slower though, so when testing user flow, I would recommend turning it off by setting the Debug level to 0 for the duration of the session.</p>
<p>And remember, if you switch your debug to 0, then the DebugKit isn&#8217;t run at all, so there&#8217;s no worries about it eating precious resources on your live server.</p>
<h3>Ajax Reporting</h3>
<div id="attachment_123" class="wp-caption alignright" style="width: 250px"><img class="size-full wp-image-123" title="debug_ajax" src="http://blog.japanesetesting.com/wp-content/uploads/2009/11/debug_ajax.jpg" alt="Ajax doesn't seem to be affected" width="240" height="187" /><p class="wp-caption-text">Ajax doesn&#39;t seem to be affected</p></div>
<p>When you make a request with Ajax, the DebugKit doesn&#8217;t seem to get spun up like it should &#8212; which results in it reverting to the standard CakePHP reporting, which (while not bad) is definitely a grade down compared to the glory of DebugKit. It would have been nice to have the reporting fed into another icon inside the div that displays the ajax result, or something to that effect. Perhaps there is a way, and I just haven&#8217;t found it yet. Always a possibility.</p>
<h2>Conclusion</h2>
<p>Really, there isn&#8217;t much else to say except: why are you waiting? <a href="http://www.ohloh.net/p/cakephp-debugkit" target="_blank">Go download this thing now!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/11/12/cakephp-debugkit-take-back-your-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Return of the FaceBox: Iframes!</title>
		<link>http://blog.japanesetesting.com/2009/10/19/return-of-the-facebox-iframes/</link>
		<comments>http://blog.japanesetesting.com/2009/10/19/return-of-the-facebox-iframes/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 07:27:36 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[facebox]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=106</guid>
		<description><![CDATA[This article is a follow-up to my (oddly?) popular article Simple Modal Boxes: FaceBox with Prototype which, as the name implies, talks about how to get FaceBox ( the amazingly cool JQuery Facebox-like modal window) to work with the Prototype framework, and then releases that code under the MIT license.
Where things went wrong: IFrames
I was [...]]]></description>
			<content:encoded><![CDATA[<p>This article is a follow-up to my (oddly?) popular article <a href="http://blog.japanesetesting.com/2009/08/28/simple-modal-boxes-facebox-with-prototype/" target="_blank">Simple Modal Boxes: FaceBox with Prototype</a> which, as the name implies, talks about how to get <a href="http://famspam.com/facebox" target="_blank">FaceBox </a>( the amazingly cool JQuery Facebox-like modal window) to work with the Prototype framework, and then releases that code under the MIT license.</p>
<div id="attachment_93" class="wp-caption aligncenter" style="width: 360px"><img class="size-full wp-image-93" title="ippatsu_facebox" src="http://blog.japanesetesting.com/wp-content/uploads/2009/08/ippatsu_facebox.jpg" alt="Ippatsu's Flashcard FaceBox" width="350" height="220" /><p class="wp-caption-text">Ippatsu&#39;s Flashcard FaceBox</p></div>
<h2>Where things went wrong: IFrames</h2>
<p>I was fairly forthcoming about it when I released version 1.1, but my FaceBox had a major problem: Loading full HTML pages <em>(as opposed to html snippets)</em> borked the system. It was a combination of the &lt;head&gt; and &lt;body&gt; tags along with all that excess Javascript and CSS being loaded into an inline div that pretty much did it in. IE6 would display it (poorly) while anything else just gave up and displayed an empty box.</p>
<p><strong>So I fixed it. </strong></p>
<p>Starting with version 1.2 you can set a facebox to load in an IFrame by simply adding the tag &#8220;iframe&#8221; to the rel tag of the link.</p>
<pre class="brush: xml;">
So
&lt;a rel=&quot;facebox&quot; href=&quot;mypage.html&quot;&gt;My Page!&lt;/a&gt;

becomes
&lt;a rel=&quot;facebox iframe&quot; href=&quot;http://google.com&quot;&gt;Google&lt;/a&gt;
</pre>
<p>and now you&#8217;re cooking with crisco. The page will be loaded in an IFrame, and any links will be self-contained within that iframe unless you specifically break out of it.</p>
<h2>Breaking backwards compatibility</h2>
<p>So, I am a big believer in backwards compatibility, but unfortunately adding the iframe option, along with my desire to adhere to better HTML coding practices has made me break backwards compatibility with version 1.1.</p>
<h3>But wait!</h3>
<p>It&#8217;s <strong>simple </strong>to change over, and you can change over almost all your code with a simple search/replace! <strong>So let&#8217;s get to it!</strong></p>
<h2>New way to handle classes</h2>
<p>The old way of handing classes was to simply put all the classes you wanted to use after a hyphen after the facebox tag, like so:</p>
<pre class="brush: xml;">
&lt;a href=&quot;mypage.html&quot; rel=&quot;facebox-class1 class2&quot;&gt;My Classy Page!&lt;/a&gt;
</pre>
<p>This brings about the problem that now &#8220;iframe&#8221; is just thought of as a class. (It&#8217;s also not very contained, and rather messy). So I changed to to be more self-contained by putting the classes in square brackets []:</p>
<p><strong>The new Code</strong></p>
<pre class="brush: xml;">
&lt;a href=&quot;mypage.html&quot; rel=&quot;facebox[class1 class2]&quot;&gt;My Classy Page!&lt;/a&gt;
</pre>
<p>Now you know exactly what is a class, and what is not, and it&#8217;s easier to use it in conjunction with the IFrames option above.</p>
<pre class="brush: xml;">
&lt;a href=&quot;http://google.com&quot; rel=&quot;facebox[class1 class2] iframe&quot;&gt;This loads google in its own classy iframe&lt;/a&gt;
</pre>
<p>Simple as pie.</p>
<h2>New way to handle styles</h2>
<p>Originally, my way to handle styles (useful for setting the height and width of a Facebox for a single message or page) was to put the data in the <strong>rev</strong> tag and just pass that through to the FaceBox. However, with the new class syntax, I had a chance to change the way that the styling works.</p>
<p><em>Also, the <strong>rev </strong>tag is used to describe how the <strong>current</strong> document applies to the link, so it really isn&#8217;t a good place to put the data syntactically. It&#8217;s much better to put it in the <strong>rel</strong> tag along with the class information.</em></p>
<h3>The new code</h3>
<pre class="brush: xml;">
So where you used to use the rev tag:
&lt;a href=&quot;mypage.html&quot; rel=&quot;facebox&quot; rev=&quot;width: 500px; height: 300px&quot;&gt;My Stylish Page!&lt;/a&gt;

You'll now use curly brackets in the rel tag:
&lt;a href=&quot;mypage.html&quot; rel=&quot;facebox{width: 500px; height: 300px}&quot;&gt;My Stylish Page!&lt;/a&gt;
</pre>
<p>And we can combine that with the iframes and classes above, to further customize our facebox</p>
<pre class="brush: xml;">
Class and Style
&lt;a href=&quot;mypage.html&quot; rel=&quot;facebox[class1 class2]{width: 500px; height: 300px}&quot;&gt;My Classy Stylish Page!&lt;/a&gt;

Iframe Class and Style
&lt;a href=&quot;http://google.com&quot; rel=&quot;facebox[class1 class2]{width: 500px; height: 300px} iframe&quot;&gt;This loads google in its own classy and stylish iframe&lt;/a&gt;
</pre>
<h2>Download the code</h2>
<p>You can download the code right here! It&#8217;s Open sourced under the MIT License.</p>
<p>If you find any problems or bugs, feel free to drop me a comment!</p>
<p>Download <a href="../download/facebox_1_2.zip">FaceBox v 1.2</a> (Open sourced under the MIT License)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/10/19/return-of-the-facebox-iframes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Things I never knew about CSS</title>
		<link>http://blog.japanesetesting.com/2009/10/06/things-i-never-knew-about-css/</link>
		<comments>http://blog.japanesetesting.com/2009/10/06/things-i-never-knew-about-css/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 08:20:07 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=99</guid>
		<description><![CDATA[Smashing Magazine, for all their &#8220;Top 10&#8243; and &#8220;Best 50&#8243; articles, continues to occasionally post very helpful and mind-bending articles about Design and Production.
Their newest article about CSS is aimed at the CSS beginner, but has a few tricks that I wasn&#8217;t even aware of.
Floating and Overflow
The first, I want to point out is something [...]]]></description>
			<content:encoded><![CDATA[<p>Smashing Magazine, for all their &#8220;Top 10&#8243; and &#8220;Best 50&#8243; articles, continues to occasionally post very helpful and mind-bending articles about Design and Production.</p>
<p>Their newest article about CSS is aimed at the CSS beginner, but has a few tricks that I wasn&#8217;t even aware of.</p>
<h2>Floating and Overflow</h2>
<p>The first, I want to point out is something that has always bugged me: the fact that a floated image is not completely contained within its parent container. Apparently this can be fixed simply by adding overflow:hidden to the div (autoflow:auto also works).</p>
<p><a href="http://www.sohtanaka.com/web-design/examples/css-back-to-basics/overflow-hidden-trick.htm"><img class="alignnone size-full wp-image-103" title="Floats and Images" src="http://blog.japanesetesting.com/wp-content/uploads/2009/10/6_b.jpg" alt="Floats and Images" width="500" height="254" /></a></p>
<h2><a href="http://www.sohtanaka.com/web-design/examples/css-back-to-basics/overflow-hidden-trick.htm" target="_blank"></a>Floating and Double Margins (ie6 Bug)</h2>
<p>Additionally, Internet Explorer 6 seems to <strong>double</strong> the margin of floated elements. So your 5px margin becomes 10px in IE6, and is the cause of all of my perfectly aligned floating divs crashing to the ground when I test the page in IE6 <strong>(grumble grumble hate hate)</strong></p>
<p>This is also easy to fix: just add <strong>display: inline</strong> to your floated element.</p>
<pre class="brush: css;">
.floated_element {
     float: left;
     width: 200px;
     margin: 5px;
     display: inline; /*--IE6 workaround--*/
     }
</pre>
<h2>Deserves a once-over</h2>
<p>There were alot of other great tips and points that even seasoned CSS-ers should look at &#8212; you never know when you might find something new, or an easy way to do something you had been futzing with. If you get a chance, it&#8217;s <a title="Smashing Magazine" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/" target="_blank">definitely worth a look.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/10/06/things-i-never-knew-about-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete Cached Models in CakePHP</title>
		<link>http://blog.japanesetesting.com/2009/09/15/delete-cached-models-in-cakephp/</link>
		<comments>http://blog.japanesetesting.com/2009/09/15/delete-cached-models-in-cakephp/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 09:25:45 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=78</guid>
		<description><![CDATA[Did you know that CakePHP automatically caches a lot of your data so that you don&#8217;t have to call (for example) model references over and over again? Isn&#8217;t that nice?
Did you know that if you make a change to your database (for example: adding a column) and the caches haven&#8217;t been updated, it will neither [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Did you know</strong> that CakePHP automatically caches a lot of your data so that you don&#8217;t have to call (for example) model references over and over again? Isn&#8217;t that nice?</p>
<p><strong>Did you know </strong>that if you make a change to your database (for example: adding a column) and the caches haven&#8217;t been updated, it will neither <strong>SAVE </strong>nor <strong>RETRIEVE </strong>any data relating to those changes?</p>
<p><strong>Did you know</strong> that cake won&#8217;t tell you that your models might be out of date, and that you can easily waste 2-3 <strong>HOURS</strong> of your life on something stupid like that?</p>
<p>Do yourself a favor: When you change your database, delete <strong>EVERYTHING </strong>in <strong>app\tmp\cache\models</strong></p>
<p>And thankyou for the heads up, <a href="http://snook.ca/archives/cakephp/delete_cached_models/" target="_blank">Snook.ca</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/09/15/delete-cached-models-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress and Syntax Highlighting</title>
		<link>http://blog.japanesetesting.com/2009/09/12/wordpress-and-syntax-highlighting/</link>
		<comments>http://blog.japanesetesting.com/2009/09/12/wordpress-and-syntax-highlighting/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 00:00:01 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=73</guid>
		<description><![CDATA[Just a quicky:
I was looking for some good syntax-highlighting plugins for WordPress, but so many of them were hard to use, required configuration or just plain mangled my code.
So then I found Syntax Highlighter Evolved. Set it up in 5 minutes, easy as pie to use, and no more code mangling. Definitely recommended.
Syntax Highlighter Evolved [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quicky:</p>
<p>I was looking for some good syntax-highlighting plugins for WordPress, but so many of them were hard to use, required configuration or just plain mangled my code.</p>
<p>So then I found <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/" target="_blank">Syntax Highlighter Evolved</a>. Set it up in 5 minutes, easy as pie to use, and no more code mangling. Definitely recommended.</p>
<h3>Syntax Highlighter Evolved is recommended by some guy in Japan!</h3>
<p>Now that&#8217;s a tagline that will sell products if I ever heard one!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/09/12/wordpress-and-syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP and RememberMe &#8212; AutoLogins for the soul</title>
		<link>http://blog.japanesetesting.com/2009/09/11/cakephp-and-rememberme-autologins-for-the-soul/</link>
		<comments>http://blog.japanesetesting.com/2009/09/11/cakephp-and-rememberme-autologins-for-the-soul/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 23:45:01 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=48</guid>
		<description><![CDATA[So, as I as spent half the day today working on getting my &#8220;Remember Me&#8221; function to work, I figured it would be a good thing to share with the rest of the world, so that they didn&#8217;t have to ever EVER put up with the kind of stuff I went through today.
So, first of [...]]]></description>
			<content:encoded><![CDATA[<p>So, as I as spent half the day today working on getting my &#8220;Remember Me&#8221; function to work, I figured it would be a good thing to share with the rest of the world, so that they didn&#8217;t have to ever EVER put up with the kind of stuff I went through today.</p>
<p>So, first of all, we all know what a remember me function is, right?</p>
<div id="attachment_52" class="wp-caption alignnone" style="width: 343px"><img class="size-full wp-image-52 " title="rememberme_1" src="http://blog.japanesetesting.com/wp-content/uploads/2009/09/rememberme_1.jpg" alt="Yup, that's it (Wordpress)" width="333" height="347" /><p class="wp-caption-text">Yup, that&#39;s it (Wordpress)</p></div>
<div id="attachment_50" class="wp-caption alignnone" style="width: 319px"><img class="size-full wp-image-50 " title="remember_me2" src="http://blog.japanesetesting.com/wp-content/uploads/2009/09/remember_me2.jpg" alt="Yup, that's it (google)" width="309" height="221" /><p class="wp-caption-text">And there it is again (google)</p></div>
<p>The &#8220;Remember me&#8221; function is a little checkbox that the user checks when they log in so that they don&#8217;t have to bother logging in again as long as they keep visiting the site every XX days where XX is the number of days that the site will remember them for.</p>
<h1>Sounds easy! Let&#8217;s do it in cake!</h1>
<p>Great idea! Cake should make it super easy! And if you search for cake and remember me functions, a lot (or rather a lot of variations based around 2 or 3 guys&#8217; code) of sites will pop up. I personally recommend the <a href="http://dsi.vozibrale.com/articles/view/rememberme-component-the-final-word" target="_blank">RememberMe component from the Neutrino CMS</a>, as it&#8217;s small, lightweight and doesn&#8217;t take much configuring. (And don&#8217;t believe the <a href="http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/" target="_blank" rel="nofollow">page that comes up when you enter &#8220;CakePHP rememberme&#8221; into google</a>. That&#8217;s what got me off on the wrong foot)</p>
<p>And if you plan on something really simple with your site (i.e. logged in or not logged in) then it&#8217;s really easy to set up.</p>
<ol>
<li>Get the component that you&#8217;re going to use (I used RememberMe)</li>
<li>Plop it in the components.</li>
<li>Set your references to it in your users/login function, and</li>
<li>(The most important part) <strong>attach the component&#8217;s cookie checking function to the app_controller&#8217;s beforeRender function.</strong></li>
</ol>
<p>Now, why&#8217;s the last step the most important? Because the &#8220;remember me&#8221; cookie needs to be checked for every time a page is visited, otherwise it can&#8217;t do it&#8217;s job. The first version of the remember me code I had used when I first started CakePHP had the cookie management in the users/login function. Like this:</p>
<pre class="brush: php;">
function login() {
//-- code inside this function will execute only when autoRedirect was set to false (i.e. in a beforeFilter).
if ($this-&gt;Auth-&gt;user()) {
if (!empty($this-&gt;data) &amp;amp;&amp;amp; $this-&gt;data['User']['remember_me']) {
$cookie = array();
$cookie['username'] = $this-&gt;data['User']['username'];
$cookie['password'] = $this-&gt;data['User']['password'];
$this-&gt;Cookie-&gt;write('Auth.User', $cookie, true, '+2 weeks');
unset($this-&gt;data['User']['remember_me']);
}
$this-&gt;redirect($this-&gt;Auth-&gt;redirect());
}
if (empty($this-&gt;data)) {
$cookie = $this-&gt;Cookie-&gt;read('Auth.User');
if (!is_null($cookie)) {
if ($this-&gt;Auth-&gt;login($cookie)) {
//  Clear auth message, just in case we use it.
$this-&gt;Session-&gt;del('Message.auth');
$this-&gt;redirect($this-&gt;Auth-&gt;redirect());
} else { // Delete invalid Cookie
$this-&gt;Cookie-&gt;del('Auth.User');
}
}
}
}
</pre>
<p>Makes perfect sense, right?</p>
<h1>NO</h1>
<p>The problem is that users/login only gets called when there&#8217;s a login to be processed (which is not explained very well in the documentation). This becomes a problem when you are using the Auth-&gt;allow() array to let people access parts of the site, and not others. (Even more of a problem when the same page has different data for logged in and non-logged in users)</p>
<p>What happens is that since the action is allowed, Cake decides that there&#8217;s no reason to check for a login, so even if the login cookie exists, it doesn&#8217;t get checked because the Users/Login function never gets called.</p>
<p>So, in most cases, this is not a problem &#8212; just put the RememberMe-&gt;check() function into the AppController&#8217;s beforeRender &#8212; but what if you want do something more after a user logs in? Something like increasing their login count, setting login time, getting info about them, etc etc.</p>
<h1>Custom Functions and Remember Me</h1>
<p>Most RememberMe components and solutions have a provision for callbacks after a successful cookie login (much like isAuthorized) however (also like isAuthorized) the function has to be in either:</p>
<ul>
<li>The AppController</li>
<li>The Current Controller</li>
</ul>
<p>Because the component only has access to the controller that&#8217;s currently calling it, you&#8217;re confined to either the code in the <strong>AppController </strong>or the currently viewed controller. And if your current controller is Articles (because your user is looking at an article) then we can&#8217;t directly access the users controller to run our little _after_login function. <span style="color: #808080;">(With <strong>Models </strong>you can get to from almost anywhere in your code through skillful use of relations, but <strong>Controllers </strong>are a bit trickier)</span></p>
<p>So, what do we do? We take a little hint from the cake library, and use the wonderful <strong>App:import</strong> function to forcibly bring the Controller to us. Now this is an <strong><span style="text-decoration: underline;">expensive </span></strong>call, because it&#8217;s essentially ringing up an entire new controller with all its associated models, et al. <span style="color: #ff0000;">So we need to be sure to do this only when the user is logging in through a cookie. <span style="color: #000000;">That way, it&#8217;ll only happen once for the user&#8217;s session, and we can quickly get rid of its memory-eating load on the next page view.</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">So, let&#8217;s look at some code:</span></span></p>
<h1><span style="color: #ff0000;"><span style="color: #000000;">The Original RememberMe component</span></span></h1>
<pre class="brush: php;">
&lt;?php
class RememberMeComponent extends Object
{
var $components = array('Auth', 'Cookie');
var $controller = null;

/**
* Cookie retention period.
*
* @var string
*/
var $period = '+2 weeks';
var $cookieName = 'User';

function startup(&amp;$controller)
{
$this-&gt;controller =&amp; $controller;
}

function remember($username, $password)
{
$cookie = array();
$cookie[$this-&gt;Auth-&gt;fields['username']] = $username;
$cookie[$this-&gt;Auth-&gt;fields['password']] = $password;
$this-&gt;Cookie-&gt;write($this-&gt;cookieName, $cookie, true, $this-&gt;period);
}

function check()
{
$cookie = $this-&gt;Cookie-&gt;read($this-&gt;cookieName);

if (!is_array($cookie) || $this-&gt;Auth-&gt;user())
return;

if ($this-&gt;Auth-&gt;login($cookie))
{
$this-&gt;Cookie-&gt;write($this-&gt;cookieName, $cookie, true, $this-&gt;period);
}
else
{
$this-&gt;delete();
}
}

function delete()
{
$this-&gt;Cookie-&gt;del($this-&gt;cookieName);
}
}

?&gt;
</pre>
<h1>So, this check function has got to go</h1>
<p>We need to be able to load the <strong>UsersController</strong> so that we can get to our <strong>_post_login()</strong> function to do all our login magic like checking how the user&#8217;s subscription is going, how long many times they&#8217;ve logged in, etc.</p>
<pre class="brush: php;">
function check()
{
// If you want to change the cookie name, change it here
$this-&gt;Cookie-&gt;name = 'rememberme';
$cookie = $this-&gt;Cookie-&gt;read($this-&gt;cookieName);

if (!is_array($cookie) || $this-&gt;Auth-&gt;user())
return;

if ($this-&gt;Auth-&gt;login($cookie))
{
$this-&gt;Cookie-&gt;write($this-&gt;cookieName, $cookie, true, $this-&gt;period);
if (!App::import('Controller', 'Users')) {
return false;
}
$className = 'UsersController';
$Ctrl =&amp; new $className();
$Ctrl-&gt;constructClasses();
$Ctrl-&gt;_post_login($this-&gt;Auth-&gt;user('id'));
}
else
{
$this-&gt;delete();
}
}
</pre>
<p>So, here&#8217;s my code as it stands now. What I&#8217;ve done is if there is a cookie, and you can successfully login with said cookie (Through <strong>$this-&gt;Auth-&gt;login($cookie)</strong> ) then we&#8217;re going to spin up the <strong>Controller </strong>called <strong>Users </strong>through the <strong>App:import</strong> function. If it can&#8217;t load, then we return false, but if it <strong>DOES </strong>load, then we create a new Controller and construct it so that we can then call our post_login script with the <strong>Auth-&gt;user</strong> Info. Everything else is set up just how the instructions on the <a href="http://dsi.vozibrale.com/articles/view/rememberme-component-the-final-word" target="_blank">RememberMe Component </a>Page say.</p>
<h1>Conclusion</h1>
<p>Getting a RememberMe function working in CakePHP really isn&#8217;t that difficult, but the problem (like a lot of CakePHP) is that the signal-to-noise ratio of those who know what they&#8217;re doing and those that don&#8217;t is incredibly high. I don&#8217;t profess to have all the answers, but hopefully just some of the problems that I&#8217;ve had will help others who are struggling with the same issues.</p>
<p>Till next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/09/11/cakephp-and-rememberme-autologins-for-the-soul/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Modal Boxes: FaceBox with Prototype</title>
		<link>http://blog.japanesetesting.com/2009/08/28/simple-modal-boxes-facebox-with-prototype/</link>
		<comments>http://blog.japanesetesting.com/2009/08/28/simple-modal-boxes-facebox-with-prototype/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 01:33:56 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[facebox]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=36</guid>
		<description><![CDATA[I&#8217;ve updated my code with a newer version: Version 1.2 which includes such awesome things as full IFrame support and better support for classes and styles! You can check out the Article, or just download the code from here! The way the code is used has been changed, so be sure to read the README!

This [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; border: 1px solid #616161; background: lightYellow;"><img class="alignleft size-full wp-image-112" style="margin-right: 10px;" title="alert" src="http://blog.japanesetesting.com/wp-content/uploads/2009/08/icon_notice_alert.png" alt="alert" width="79" height="73" />I&#8217;ve updated my code with a newer version: <a href="/download/facebox_1_2.zip">Version 1.2</a> which includes such awesome things as full IFrame support and better support for classes and styles! You can check out the <a href="http://blog.japanesetesting.com/2009/10/19/return-of-the-facebox-iframes/">Article</a>, or just <a href="/download/facebox_1_2.zip">download the code from here</a>! <strong>The way the code is used has been changed, so be sure to read the README!</strong>
</div>
<h2>This article will teach you how to:</h2>
<p>Open facebook-styled modal windows in both alert box and full ajax-styled version, using the FaceBox modal window script and Prototype.</p>
<p>I wanted my<a href="http://japanesetesting.com/news" target="_blank"> signup page for Ippatsu</a>, an online Japanese learning application, to use a modal window for the sign up dialog.  This allows me to use most of the visible area for copywriting, while not requiring a page transition to load the signup form.<br />
You can also create modal windows like these with Prototype and the<a href="/download/facebox_1_1.zip"> OSS code I&#8217;m releasing below.</a></p>
<div id="attachment_93" class="wp-caption aligncenter" style="width: 360px"><img class="size-full wp-image-93" title="ippatsu_facebox" src="http://blog.japanesetesting.com/wp-content/uploads/2009/08/ippatsu_facebox.jpg" alt="Ippatsu's Flashcard FaceBox" width="350" height="220" /><p class="wp-caption-text">Ippatsu&#39;s Flashcard FaceBox</p></div>
<h2>A little history</h2>
<p>Originally these modal boxes were used mainly for photogalleries and whatnot, and took up the entire screen with a cool faded out background and had a lot of animations. Probably the nicest and most well known was <a href="http://www.phatfusion.net/" target="_blank">PhatFusion&#8217;s</a> lightbox and multibox which are written on the MooTools javascript library.</p>
<p>As time went on, people wanted simpler boxes that did away with all the animation and crap and so extremely simple boxes like <a href="http://particletree.com/features/lightbox-gone-wild/">Particletree&#8217;s Lightbox Gone Wild </a>which is a simple box with no animation over a 70% black border. It&#8217;s small, simple and gives a rather nice effect.</p>
<h2>So what&#8217;s the problem?</h2>
<p>Well, the problem with animation should be obvious: It&#8217;s slow and can be jerky on certain browsers. Definately not something you want to use for a UI Element.</p>
<p>And the issue with the background is that when you have your entire site blacked out, while you gain focus on the window you&#8217;ve just put up, it&#8217;s not very useful for information that you want to give the user without preventing them from seeing the rest of your site. In other words, we want a <strong>Modal Window </strong>instead of a lightbox type thing.</p>
<h2>So Bring on the Modal Windows!</h2>
<p>As far as this discussion is concerned, I&#8217;m going to be ignoring the windows-like full modal windows that allow dragging and dropping and whatnot, and only focus on simple Modal Boxes that can be used to display data. In particular, FaceBox.</p>
<h2>Get to the Code Already</h2>
<p>Ok, so FaceBox is a JQuery based modal window that is pretty much copied from the facebook site where they use it to display small bits of ajax text. It is amazing. You can get it at <a href="http://famspam.com/facebox" target="_blank">http://famspam.com/facebox</a> . However, it only works with JQuery, whose existance I was not aware of at the time of creating my site, so I had to find a Prototype version.</p>
<p>FaceBox Prototype in google gave me a couple of good links, the most popular being <a href="http://blog.philburrows.com/articles/2008/05/05/porting-facebox-from-jquery-to-prototype/" target="_blank">Phill Burrows&#8217; blog</a> in which he ported FaceBox from JQuery to Prototype. Unfortunately, the post (and code) is rather old, and did not work on the newest version of Prototype that I was using (1.6.0.3).</p>
<p>Eventually I came to two guys who took Phill Burrow&#8217;s code and updated it: <a href="http://github.com/robertgaal/facebox-for-prototype/tree/master" target="_blank">Robert Gaal</a> and <a href="http://github.com/jetviper21/prototype-facebox/" target="_blank">Scott Davis</a>. Both seem very nice, but I was having some problems with the slightly older Robert Gaal version, and so decided to go with JetViper&#8217;s version, as it also proposed to have class support.</p>
<p>Unfortunately there were a few large problems with the FaceBox code as it as written:</p>
<ol>
<li>The code did not support class definitions of the FaceBox like it purported to (because of a coding error)</li>
<li>There was no way to set the size of the FaceBox from code</li>
<li>If the page being loaded was really long (such as having cakephp debug information) the window would stretch to fit all the contents height-wise, without scrolling</li>
<li>No iframe support, so loading a page with javascript borked the load.</li>
<li>No Close on Escape button</li>
</ol>
<p>So I dug into the code and made some changes, and was able to fix problems 1-3 and 5 (and am still working on 4). The entirety of the code can be downloaded at the bottom of this page.</p>
<h2>Fixing the classes</h2>
<p>Looking at the original .js (line 175), you can see that Scott&#8217;s code says that you can add a class to the FaceBox content by changing the rel tag in the link to &#8220;facebox[.my_class]&#8221;</p>
<pre class="brush: jscript;">
// support for rel=&quot;facebox[.inline_popup]&quot; syntax, to add a class
var klass = elem.rel.match(/facebox\[\.(\w+)\]/);
if (klass) klass = klass[1];
</pre>
<p>Unfortunately, due to the way that FaceBox searches for FaceBox-enabled links, it will not recognize &#8220;facebox[.my_class]&#8221; as a FaceBox, as it looks for a direct match with rel=facebox.</p>
<p>So, I fixed that bug by changing line 93 in the watchClickEvents from</p>
<pre class="brush: jscript;">$$('a[rel=facebox]').each .....</pre>
<p>to</p>
<pre class="brush: jscript;">$$('a[rel|=facebox]').each .....</pre>
<p>The |= selector is a CSS Selector (valid in prototype) that allows you to define that The attribute&#8217;s exact value is &#8220;facebox&#8221; or starts with the word &#8220;facebox&#8221; and is immediately followed by &#8220;-&#8221;, so it would be &#8220;facebox-&#8221;. You can read more about Attribute Selectors at <a href="http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/" target="_blank">Smashing Magazine&#8217;s Taming Advanced CSS Selectors</a>. It&#8217;s an amazing read. You can also learn about ~= (whitespace seperated) ^= (starts with) $= (ends with) and *= (contains) all of which are valid types of CSS selectors.</p>
<p>But wait, you say! How does &#8220;facebox-&#8221; translated to &#8220;facebox[.my_class]&#8220;?!?</p>
<p>It doesn&#8217;t.</p>
<p>I find facebox[.my_class] to be really unwieldy, so I changed it to facebox-my_class. This way, you can also put additional rel data in the link if you need, as long as facebox comes first.<br />
All of these are valid:</p>
<pre class="brush: jscript;">rel=&quot;facebox-my_class help&quot;
rel=&quot;facebox-my_class&quot;
rel=&quot;facebox&quot;
</pre>
<p>So, in light of this, we have to change the regex match in the click_handler from:</p>
<pre class="brush: jscript;">
// support for rel=&quot;facebox[.inline_popup]&quot; syntax, to add a class
var klass = elem.rel.match(/facebox\[\.(\w+)\]/);
if (klass) klass = klass[1];
</pre>
<p>to</p>
<pre class="brush: jscript;">
// support for rel=&quot;facebox-inline_popup&quot; syntax, to add a class
 var klass = elem.rel.match(/facebox\-(\w+)/);
 if (klass) klass = klass[1];
</pre>
<p>And then in your CSS to use the class:</p>
<pre class="brush: css;">
#facebox_content.my_class{
 height: 300px;
 width: 500px;
 }
</pre>
<p>Done and done!</p>
<p>(As a smaller bug fix, I noticed that the original code never deletes previously added classes &#8212; only appends them, so I added this line to the reveal function to make sure that the classes were reset each time you opened a FaceBox</p>
<pre class="brush: jscript;">contentWrapper.className = 'content';</pre>
<h2>Stylize that Sucker!</h2>
<p>So, problem 2 is that FaceBox has no way to stylize the lightwindow contents on a per-link basis &#8212; you have to define a whole new class for each type of lightwindow that you want. This in itself is not so bad, but it would be nice to have that slight extra amount of customizable power.</p>
<p>So, what I did is just add a &#8220;style&#8221; variable to each of the reveal/ajax/etc function calls, and had it append that style to the facebox_content div.</p>
<pre class="brush: jscript;">
reveal    : function(data, klass, style){
....
//Set H/W or any other styles (also clears styles)
 contentWrapper.writeAttribute('style', style);
....
</pre>
<p>If you&#8217;re calling the lightbox from code, you just add whatever style attributes you want to the call</p>
<pre>facebox.ajax('mypage.html', 'my_class', 'height:300px;width:400px;'</pre>
<p>If you&#8217;re using the automatic calling from the rel tag, then you have to add a rev tag, and put your stylesheet in there. Anything you put in the rev tag will be copied to the style attribute of the contentWrapper</p>
<pre class="brush: xml;">&lt;a href=&quot;mypage.html&quot; rel=&quot;facebox-my_class&quot; rev=&quot;height:300px;width:400px&quot;&gt;Link&lt;/a&gt;</pre>
<p>Simple as that!</p>
<p>(It should be noted however, that the height and width of the content_window does not take into account the borders, padding and footer of the FaceBox, so be sure to leave yourself a little margin of error)</p>
<h2>No Scrollbars?!?</h2>
<p>You still with me? It&#8217;s been long, I know, but just hang with me a little more. This is the last point.</p>
<p>So, as I said earlier, there&#8217;s a problem(?) with FaceBox wherein long content just makes the FaceBox longer until all the content is shown. As this system is made for display quick banners and small ajax pages and what not, it&#8217;s understandable that it would be left out, but why not put it in when it&#8217;s so damn simple?</p>
<p>So how do you do it?</p>
<pre class="brush: css;">
//facebox.css
#facebox_content{
 overflow: auto;
 }
</pre>
<p>That&#8217;s it.</p>
<p>What this does is allows the FaceBox to extend to show all the content normally, but if you decided that the FaceBox needs a certain height (through a class or styling) then the FaceBox will be set to that height, and anything that goes over that height will be scrollable.</p>
<p>That Damn Simple.</p>
<h2>In Conclusion</h2>
<p>Not much of an &#8220;In Conclusion.&#8221; I&#8217;ve pretty much said all I want to say, so all there is left is to check out the codes~</p>
<p>If you find any problems or bugs, feel free to drop me a comment!</p>
<div style="padding: 5px; border: 1px solid #616161; background: lightYellow;"><img class="alignleft size-full wp-image-112" style="margin-right: 10px;" title="alert" src="http://blog.japanesetesting.com/wp-content/uploads/2009/08/icon_notice_alert.png" alt="alert" width="79" height="73" />I&#8217;ve updated my code with a newer version: <a href="/download/facebox_1_2.zip">Version 1.2</a> which includes such awesome things as full IFrame support and better support for classes and styles! You can check out the <a href="http://blog.japanesetesting.com/2009/10/19/return-of-the-facebox-iframes/">Article</a>, or just <a href="/download/facebox_1_2.zip">download the code from here</a>! <strong>The way the code is used has been changed, so be sure to read the README!</strong></div>
<p><span style="text-decoration: line-through;">Download <a href="/download/facebox_1_1.zip">FaceBox v 1.1</a> </span>(Open sourced under the MIT License)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/08/28/simple-modal-boxes-facebox-with-prototype/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>You never know what you need until you don&#8217;t have it</title>
		<link>http://blog.japanesetesting.com/2009/08/25/you-never-know-what-you-need-until-you-dont-have-it/</link>
		<comments>http://blog.japanesetesting.com/2009/08/25/you-never-know-what-you-need-until-you-dont-have-it/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 01:43:08 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[system design]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=24</guid>
		<description><![CDATA[Just like the age-old axiom: &#8220;You never know what you have until it&#8217;s gone,&#8221; in programming and web design the more apropo phrase should be &#8220;You never know what you need until after you launch.&#8221;
Now, I&#8217;m perhaps the worst pundit of designing before creating (as I&#8217;ll delve into in another post) especially when I&#8217;m trying [...]]]></description>
			<content:encoded><![CDATA[<p>Just like the age-old axiom: &#8220;You never know what you have until it&#8217;s gone,&#8221; in programming and web design the more apropo phrase should be &#8220;You never know what you need until after you launch.&#8221;</p>
<p>Now, I&#8217;m perhaps the worst pundit of designing before creating (as I&#8217;ll delve into in another post) <strong>especially</strong> when I&#8217;m trying to learn a new system at the same time (as was the case with cakePHP and Ippatsu). However, I&#8217;ve noticed that even the most anal-retentive planners and system designers cannot foresee exactly what features and what data will be necessary for their users.</p>
<p>We can all make grand ideas about what would be a) cool to have or b) necessary for our users. But in the end, without actually having the system move, and have those desired functions come to the forefront, there&#8217;s really no way to figure out everything that you&#8217;ll need right from the get-go.</p>
<p>So, as I launched my site last week, and have finally started getting users coming in, I&#8217;ve noticed that there is some admin-only information that I really want.</p>
<ol>
<li>User information pages &#8212; At current, I can&#8217;t see how many flashcards each individual user has, and what they&#8217;ve been doing lately. I can only see how many times each flashcard has been registered, but not by whom.</li>
<li>User login numbers &#8212; I currently have the login times of each user logged for security reasons, but it would be nice to also have the number of times each user has logged in. I could conceivably use this in the future for a &#8220;most active users&#8221; contest or widget or something.</li>
<li>Full news pages &#8212; My top news page only shows excerpts, much like my grammar article pages (because they use the same template) but since I&#8217;m planning on having a lot more consistent and necessary data on that page, I think we need to show the full news articles, or at least until the &#8220;More&#8221; tag.</li>
<li>A more complete messaging system &#8212; At current, I have a rather anemic messaging system that just logs a message to the DB with a topic, and who sent the message. I really need to pump that up a little so that I can have a full messaging system and then be able to extend that to the users.</li>
</ol>
<p>So, within a week of opening, I already have a load of changes and fixes that to be perfectly honest, I should have had to start with, but never even noticed the need for.</p>
<p>Next time I&#8217;m going to delve into some programming issues, and talk about generating automatic sitemaps with CakePHP. Till then!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/08/25/you-never-know-what-you-need-until-you-dont-have-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Harisenbon Speaks: Welcome to the blog!</title>
		<link>http://blog.japanesetesting.com/2009/08/19/hello-world/</link>
		<comments>http://blog.japanesetesting.com/2009/08/19/hello-world/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 00:29:21 +0000</pubDate>
		<dc:creator>Harisenbon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.japanesetesting.com/?p=1</guid>
		<description><![CDATA[In which Harisenbon lays out the purpose for this blog, gives some shoutouts to those who have helped him figure out how to get a site up and running, and is generally rather long-winded.]]></description>
			<content:encoded><![CDATA[<p>So here I am starting my first foray into the world of blogging.</p>
<p>I&#8217;ve never been much into blogging, even though I have to my credit: a livejournal page, a shared facebook account, a mixi account, a blogger account, and whatever microsoft was using for their blog system 2 years ago.</p>
<p>Suffice it to say none of these have ever been really updated with anything resembling regularity.</p>
<p>But I&#8217;m hoping that this blog will be a bit different. I&#8217;ve been inspired (or beaten around the head, whichever way you want to look at it) by my friend who runs <a href="http://bingocardcreator.com" target="_blank">BingoCardcreator.com</a> and is also the owner of the increasingly popular small business blog <a href="http://www.kalzumeus.com/" target="_blank">MicroISV on a Shoestring</a> which in fact was so popular that he even got interviewed for a book called <em>Blog Blazers</em> (Which I have a copy of, but still have never read).</p>
<p>In any case, he started out with the dream of making bingo cards for English Teachers in Japan, and got sucked in to the wonderful world of website optimizations and internet marketing. He&#8217;s surprisingly done very well for himself almost to the point that he makes about as much as I do at my day job by selling bingocards to school teachers.  Part of me is always glad that he chose to focus his diabolic marketing energy into something like bingocards instead of say, world domination, otherwise we&#8217;d all by singing hail to the Patrick.</p>
<p>So, back to the main point, I took his idea and decided to try my hand at some marketing / site-design and try to learn some new systems that I never knew before. The experience has completely changed the way that I view programming and design. Bingocard Creator is run off of RubyOnRails, the newest-and-greatest technology to ever hit the web (apparently), but as I am a dyed-in-the-wool PHP programmer I decided to try and find some sort of framework that could match the &#8220;it just works&#8221; methodology of RubyOnRails while not leaving my comfortable niche of PHP.</p>
<p>After checking out a lot of frameworks, I finally settled on <a href="http://cakephp.org" target="_blank">CakePHP</a> which is a framework for PHP based on RubyOnRails. It took a lot of getting used to, but a few months later, I feel that I am fully confident to actually use CakePHP for projects in the future, and hopefully erase some of the evil code that plagues my main site ( <a href="http://japanesetesting.com" target="_blank">Ippatsu @ JapaneseTesting.com</a> ) in future upgrades.</p>
<p>So, after a long and windy introduction, I lay out the purpose of this blog:</p>
<p>To share with anyone else who is thinking of making their own CMS-based site, the trials, tribulations and resources that helped me to get my site up and running.</p>
<p>Essentially I&#8217;ll be sharing programming tricks that I&#8217;ve found, marketing ideas, design resources, etc. Pretty much anything that I think that&#8217;s useful to people trying to make their own site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.japanesetesting.com/2009/08/19/hello-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
