<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Keith's Web Blog RSS Feed</title>
<language>en-us</language>
<link>http://www.keithwatanabe.net/index.php</link>
<description>Keith Watanabe's Website</description>
<item>
<title>Very Productive At Work</title>
<link>http://www.keithwatanabe.net/blogs/2008/2/14/69f343033cd927b333aba268df2adb28.html</link>
<description><![CDATA[Man, you should've seen the amount of code I spat out today.  Tons of AJAX/JQuery stuff.  Most of it is CRUD with AJAX, but I'm about to build a kind of webtop application that utilizes a great deal of interactive elements with javascript, CSS, and AJAX for handling some administrative tasks.  I'm quite happy with the code I've got at work.  For instance, my average JQuery function call is around 4 lines while the organization of the code is working out quite well.  Stylistically, I've got things done in such a way that my code is EXTREMELY clean cut.  Not sure if it's the most optimal, but my application doesn't have extreme performance requirements.<br />
<br />
Another aspect I got to work with recently is the Reflection API in PHP.  I do some quirky things where I have my authorization piece defined as a combination of the controller name and the action name (where the action part is handled via convention in the Zend Framework).  From a search prompt, you can enter the name of an application and it will examine for the controller directories of the application.  Then using Reflection, I am able to query the controller for public methods.  From there, I reconstruct the authorization permission name and am able to display it.  It's quite cool actually because I don't have to manually run all these insert SQL commands to put the permissions into the database.<br />
<br />
Also, in the future, I'm hoping to write some web services for Bugzilla, PhpMyAdmin and MediaWiki to create permissions and user accounts from my system.  User management is a royal pain in the butt when you have disparate applications containing their own proprietary form of entitlements.  I hope to unify these aspects through my administration application and make granting access easier to these applications.<br />
<br />
Then my boss and I did a little interesting experiment where we compared the performance of different slurp methods with Perl.  We tried using one of the slurp modules as well as this little Perl idiom:<br />
<br />
open (&lt;$fh&gt;, &quot;somefile.txt&quot;) || die $!;<br />
my $txt = do { local $; &lt;$fh&gt;; };<br />
close &lt;$fh&gt;;<br />
<br />
Found out that this piece of code runs REALLY fast.  The way he was doing it was building an array using map.  However, my theory is that when you're reading a file in line-by-line, it's more memory/IO intensive, compared to storing the whole content into a scalar value.  I think in the former case, because you're building a data structure, it's also slower.  We tried each scenario with a file around 143 MB.  The code above ran at 2 seconds compared to the other routines, which all ran slower.<br />
<br />
I swear, it's a totally different world than being at the Anti-Productive company (i.e. HLIKK).  I get so much done at work these days.  Heck, I have to force myself to leave because my work can be so interesting at times.  Considering I've been here only a little over 4 months, I've accomplished a lot and learned a tremendous amount.  It makes me wonder how much more I can produce in a year's time?]]></description>
<pubDate>Thu, 14 Feb 2008 09:17:17 -0700</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2008/2/14/69f343033cd927b333aba268df2adb28.html</guid>
</item>
<item>
<title>Javascript/CSS Display Issue</title>
<link>http://www.keithwatanabe.net/blogs/2008/3/6/49c4ff3f8272ab2df16fcd7af6e13195.html</link>
<description><![CDATA[I ran into a rather frustrating problem that I only solved the other day.  It was that I had embedded a stylesheet within the HTML using the <strong>style</strong> tags.  Inside, I used the ID selector to style a particular div element.  In particular, I used a kind of display: none; thing.<br />
<br />
Well, one of the things I needed was to be able to make that part visible again once a person unchecked that element.  Before I was doing something like $(ele).style.display = '';.  Turns out, that the precedence of Javascript is lower than the one in inline style.  So to rectify this, I had to instead do $(ele).style.display = 'block' (or inline).  Pretty annoying but a nice little fix to this problem.]]></description>
<pubDate>Thu, 06 Mar 2008 09:14:44 -0700</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2008/3/6/49c4ff3f8272ab2df16fcd7af6e13195.html</guid>
</item>
</channel>
</rss>
