<?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>... coding (the life) &#187; work related</title>
	<atom:link href="http://www.marvinmarcelo.com/category/work-related/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marvinmarcelo.com</link>
	<description>Anything about programming, and a little about me.</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:44:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>rvm libz.1.2.5.dylib and zlib on Mac</title>
		<link>http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/</link>
		<comments>http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:00:36 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[libz.dyld]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[upgrade rails app]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1861</guid>
		<description><![CDATA[Got stuck on this while following Setting up a fresh Rails 3.1 project safely and Upgrading to Rails 3 Part 1. Took the first tutorial&#8217;s tip on setting up rvm per project or per application, the latter is for the &#8230; <a href="http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Got stuck on this while following <a href="http://andrewcox.org/post/6187261893/setting-up-a-fresh-rails-3-1-project-safely" target="_blank">Setting up a fresh Rails 3.1 project safely</a> and <a href="http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1" target="_blank">Upgrading to Rails 3 Part 1</a>. Took the first tutorial&#8217;s tip on setting up rvm per project or per application, the latter is for the upgrade procedure.</p>
<p>I have 1.8.7 and 1.92 rubies installed, and the app I was upgrading is from 2.2.x. I&#8217;ve setup a new .rvmrc on the app folder so it automatically uses 1.9.2. Though in the upgrade tutorial you have to do it manually by calling <code>rvm 1.9.2</code> or <code>rvm system</code>, my setup already loads 1.9.2 and to switch to 1.8.7 I&#8217;ll just issue <code>rvm system</code>.</p>
<p>On the part where I run <code>gem install rails</code> from <a href="http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1" target="_blank">upgrading to rails 3</a>, I get this error:</p>

<div class="wp_syntax"><div class="code"><pre class="awk" style="font-family:monospace;">$ Irb ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;font-weight:bold;">:</span> 001<span style="color:black;">&gt;</span>
  require 'zlib' LoadError<span style="color:black;font-weight:bold;">:</span> dlopen<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>x86_64<span style="color:black;">-</span>darwin10.7.0<span style="color:black;">/</span>zlib.bundle, <span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color:black;font-weight:bold;">:</span> Library not loaded<span style="color:black;font-weight:bold;">:</span> libz.1.2.5.dylib
  Referenced from<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>x86_64<span style="color:black;">-</span>darwin10.7.0<span style="color:black;">/</span>zlib.bundle
  Reason<span style="color:black;font-weight:bold;">:</span> image not found <span style="color:black;">-</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>x86_64<span style="color:black;">-</span>darwin10.7.0<span style="color:black;">/</span>zlib.bundle
  from <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>site_ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>rubygems<span style="color:black;">/</span>custom_require.rb<span style="color:black;font-weight:bold;">:</span> <span style="color: #000000;">36</span><span style="color:black;font-weight:bold;">:</span> <span style="color: #000000; font-weight: bold;">in</span> `require'
  from <span style="color: #7a0874; font-weight: bold;">&#40;</span>irb<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color:black;font-weight:bold;">:</span> <span style="color: #000000;">1</span> from <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>bin<span style="color:black;">/</span>irb<span style="color:black;font-weight:bold;">:</span> <span style="color: #000000;">16</span><span style="color:black;font-weight:bold;">:</span> <span style="color: #000000; font-weight: bold;">in</span>`<span style="color:black;">&lt;</span>main<span style="color:black;">&gt;</span>'</pre></div></div>

<p>I tried a lot of rvm docs, gem uninstall-install, gem update, switching apps and even sudo&#8217;ing (yeah I know, it defies the purpose of using rvm), but no dice. To cut the story short, the fix was <code>DYLD_FALLBACK_LIBRARY_PATH</code></p>
<p><code>export DYLD_FALLBACK_LIBRARY_PATH = $HOME/.rvm/usr/lib/</code></p>
<p>This can be in your bash profile or in .rvmrc, in case this only happens on one of you apps.</p>
<p><code>export DYLD_FALLBACK_LIBRARY_PATH = $rvm_path/usr/lib/</code></p>
<p>Found the answer here <a href="http://apribase.net/2010/11/13/macports-dyld_library_path/" target="_blank">http://apribase.net/2010/11/13/macports-dyld_library_path/</a> (it&#8217;s in Japanese though, just use G translate). Hope this helps.</p>
<p>Oh, I&#8217;ll update this as well for the Mac setup I use in the office plus the gem env.</p>
<p><em><strong>Update:</strong></em></p>
<p><code>System</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2011</span>-02-<span style="color: #000000;">18</span> patchlevel <span style="color: #000000;">334</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>i686-darwin10.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>
  - INSTALLATION DIRECTORY: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334
  - RUBY EXECUTABLE: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>rubies<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby
  - EXECUTABLE DIRECTORY: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334<span style="color: #000000; font-weight: bold;">/</span>bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-<span style="color: #000000;">10</span>
  - GEM PATHS:
     - <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334
     - <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334<span style="color: #000000; font-weight: bold;">@</span>global
  - GEM CONFIGURATION:
     - :update_sources =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
     - :verbose =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
     - :benchmark =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">false</span>
     - :backtrace =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">false</span>
     - :bulk_threshold =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">1000</span>
  - REMOTE SOURCES:
     - http:<span style="color: #000000; font-weight: bold;">//</span>rubygems.org<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><code>rvmrc</code></p>

<div class="wp_syntax"><div class="code"><pre class="awk" style="font-family:monospace;">RubyGems Environment<span style="color:black;font-weight:bold;">:</span>
  <span style="color:black;">-</span> RUBYGEMS VERSION<span style="color:black;font-weight:bold;">:</span> 1.8.10
  <span style="color:black;">-</span> RUBY VERSION<span style="color:black;font-weight:bold;">:</span> 1.9.2 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2011</span><span style="color:black;">-</span>07<span style="color:black;">-</span>09 patchlevel <span style="color: #000000;">290</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>x86_64<span style="color:black;">-</span>darwin10.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color:black;">-</span> INSTALLATION DIRECTORY<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290
  <span style="color:black;">-</span> RUBY EXECUTABLE<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290<span style="color:black;">/</span>bin<span style="color:black;">/</span>ruby
  <span style="color:black;">-</span> EXECUTABLE DIRECTORY<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290<span style="color:black;">/</span>bin
  <span style="color:black;">-</span> RUBYGEMS PLATFORMS<span style="color:black;font-weight:bold;">:</span>
    <span style="color:black;">-</span> ruby
    <span style="color:black;">-</span> x86_64<span style="color:black;">-</span>darwin<span style="color:black;">-</span><span style="color: #000000;">10</span>
  <span style="color:black;">-</span> GEM PATHS<span style="color:black;font-weight:bold;">:</span>
     <span style="color:black;">-</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290
     <span style="color:black;">-</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290@global
  <span style="color:black;">-</span> GEM CONFIGURATION<span style="color:black;font-weight:bold;">:</span>
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>update_sources =<span style="color:black;">&gt;</span> true
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>verbose =<span style="color:black;">&gt;</span> true
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>benchmark =<span style="color:black;">&gt;</span> false
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>backtrace =<span style="color:black;">&gt;</span> false
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>bulk_threshold =<span style="color:black;">&gt;</span> <span style="color: #000000;">1000</span>
  <span style="color:black;">-</span> REMOTE SOURCES<span style="color:black;font-weight:bold;">:</span>
     <span style="color:black;">-</span> http<span style="color:black;font-weight:bold;">:</span><span style="color:black;">//</span>rubygems.org<span style="color:black;">/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Popcorn machine</title>
		<link>http://www.marvinmarcelo.com/popcorn-machine/</link>
		<comments>http://www.marvinmarcelo.com/popcorn-machine/#comments</comments>
		<pubDate>Wed, 11 May 2011 08:57:55 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[not about code]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[Office]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/popcorn-machine/</guid>
		<description><![CDATA[Just posting this cute machine I saw in our office]]></description>
			<content:encoded><![CDATA[<p>Just posting this cute machine I saw in our office</p>
<p><a href="http://www.marvinmarcelo.com/wp-content/uploads/2011/05/20110511-045719.jpg"><img src="http://www.marvinmarcelo.com/wp-content/uploads/2011/05/20110511-045719.jpg" alt="20110511-045719.jpg" class="alignnone size-full" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/popcorn-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gameloft &#8211; my new employer</title>
		<link>http://www.marvinmarcelo.com/gameloft-my-new-employer/</link>
		<comments>http://www.marvinmarcelo.com/gameloft-my-new-employer/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 01:35:20 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[not about code]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1747</guid>
		<description><![CDATA[In theaters November 2010 Goodbye OffShoring, it&#8217;s been a while.]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center; text-decoration: underline;">In theaters November 2010</h3>
<div id="attachment_1748" class="wp-caption aligncenter" style="width: 550px"><a href="http://www.gameloft.com"><img class="size-full wp-image-1748 " title="gameloft-logo" src="http://www.marvinmarcelo.com/wp-content/uploads/2010/10/gameloft-logo.jpg" alt="Gameloft" width="540" height="268" /></a><p class="wp-caption-text">Gameloft</p></div>
<p style="text-align: center;">Goodbye <a href="http://www.offshoring.com">OffShoring</a>, it&#8217;s been a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/gameloft-my-new-employer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Playing around with jQuery &#8211; prefill search input field with description</title>
		<link>http://www.marvinmarcelo.com/playing-around-with-jquery-prefill-search-input-field-with-description/</link>
		<comments>http://www.marvinmarcelo.com/playing-around-with-jquery-prefill-search-input-field-with-description/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 05:38:28 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[addClass]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[removeClass]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1739</guid>
		<description><![CDATA[It&#8217;s been long since I made changes to my wordpress blog site, this is what happens when you have free time as a programmer. So, I just realized the submit button on the search form on the header is not &#8230; <a href="http://www.marvinmarcelo.com/playing-around-with-jquery-prefill-search-input-field-with-description/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been long since I made changes to my wordpress blog site, this is what happens when you have free time as a programmer. </p>
<p>So, I just realized the submit button on the search form on the header is not really important, I hid it now by simply <code>display: hidden;</code>. Then, some text might help to indicate that that form above is used for search. </p>
<p>Here&#8217;s the code</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> changed <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#searchform #s'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'quiet'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Search...'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'change'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>changed <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> changed <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'focus'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'quiet'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>changed <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>  <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'blur'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>changed <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Search...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'quiet'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>In wordpress, the search input field name is &#8216;s&#8217;, in case you find this helpful and want to use it, just replace the <code>#searchform #s</code> with your own <a href="http://api.jquery.com/jQuery/">selector</a>. I might make this a plugin someday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/playing-around-with-jquery-prefill-search-input-field-with-description/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back-end vs Front-end Dev</title>
		<link>http://www.marvinmarcelo.com/back-end-vs-front-end-dev/</link>
		<comments>http://www.marvinmarcelo.com/back-end-vs-front-end-dev/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 03:39:37 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1718</guid>
		<description><![CDATA[So which one is better?]]></description>
			<content:encoded><![CDATA[<p>So which one is better? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/back-end-vs-front-end-dev/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Smarty&#8217;s count_words and count_characters in design</title>
		<link>http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/</link>
		<comments>http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 05:47:07 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[me stuff]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1590</guid>
		<description><![CDATA[This product page inspired me to write this post. It was launched around February last year (uh oh time flies!) and the first successful order was made around that time too. By then, there were only about 20 products or &#8230; <a href="http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://bit.ly/3vlyM">product page</a> inspired me to write this post. It was launched around February last year (uh oh time flies!) and the first successful order was made around that time too. By then, there were only about 20 products or less, and really short attributes i.e. volumes in 8, 12 or 16 oz. strength like mild, regular, etc. Last monday, new products came in for addition to the site and they have quite longer attributes. It could have had a liquid width on the attribute and cart buttons but they had a really good design advisers and wanted to follow the design to the pixel.</p>
<p><img class="alignnone size-full wp-image-1602" title="Screenshot" src="http://www.marvinmarcelo.com/wp-content/uploads/2010/02/Screenshot.png" alt="" width="319" height="111" /></p>
<p>Initially, this html code composes the product attribute and cart button, notice that <tt>&lt;span class="c"&gt;Cherry&lt;/span&gt;</tt> is a one word attribute for <tt>scent</tt></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cartbutton&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-image: url(images/button-long-add-to-bag.gif);&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>Cherry<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>8 oz.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>$5.99<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;d&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cart.php?product=5|33404&amp;amp;as=5&quot;</span>&gt;</span>Add to bag<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span>&gt;</span>» ITEM: 33404<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>And the new ones came with the colors &#8220;Casino Red&#8221;, &#8220;Golden Chestnut&#8221; and &#8220;Orchid Black&#8221; &#8211; long attributes, and two others &#8220;Copper&#8221; and &#8220;Spice&#8221; &#8211; short and manageable, as the column width will fit the entire word.</p>
<p>I was really planning to rewrite the whole attribute and cart button section, but I didn&#8217;t had much time. I figured I can make the font smaller and paddings or margins can go smaller than the regular so that two lines would fit in the box if the attribute value is a word longer. But I cannot be in PHP, its not really the way to go. So, if I can add another class that would override existing font-size and parent margin/padding, that would work. Here, I thought, word count doesn&#8217;t really need be in the PHP side and since I&#8217;m using <a href="http://www.smarty.net/">Smarty</a>, I found in it a variable modifier that can print the <a href="http://www.smarty.net/manual/en/language.modifier.count.words.php">number of words</a> in a variable, and that&#8217;s it. I can add another class in the column span like <tt>words-10</tt> or <tt>countwords-3</tt> in my template by the number of words that is present in the variable. Below is the generated code</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cartbutton&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-image: url(images/button-long-add-to-bag.gif);&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c col-color words-2&quot;</span>&gt;</span>Casino Red<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c col-volume&quot;</span>&gt;</span>8 oz.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>$11.39<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;d&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cart.php?product=28|33825&amp;amp;as=14&quot;</span>&gt;</span>Add to bag<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span>&gt;</span>» ITEM: 33825<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>CSS rules</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* default rules */</span>
<span style="color: #6666ff;">.cartbutton</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">23px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'/images/button-add-to-bag.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.c</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.d</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.d</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.e</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* special rule for two word attribute */</span>
span<span style="color: #6666ff;">.words-2</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">98%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><img class="alignnone size-full wp-image-1610" title="Screenshot" src="http://www.marvinmarcelo.com/wp-content/uploads/2010/02/Screenshot1.png" alt="" width="348" height="222" /></p>
<p>And this is how it is setup in the template.</p>

<div class="wp_syntax"><div class="code"><pre class="smarty" style="font-family:monospace;"><span style="color: #009000;">&lt;div class=&quot;cartbutton&quot; style=&quot;background-image: url(images/button-long-add-to-bag.gif);&quot;&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">color</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-color words-{$attr[at].color|count_words}&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">color</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">strength</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-strength words-{$attr[at].strength|count_words}&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">strength</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">scent</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-scent&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">scent</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">volume</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-volume&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">volume</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #009000;">&lt;span class=&quot;c&quot;&gt;</span>
  $ <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #D36900;">!</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">amount</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$results</span><span style="color: #D36900;">&#91;</span>r<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">amount</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">else</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">math</span> equation<span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;x&quot;</span> x<span style="color: #D36900;">=</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">amount</span> format<span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #009000;">&lt;span class=&quot;d&quot;&gt;</span>
  <span style="color: #009000;">&lt;a class=&quot;e&quot; href=&quot;cart.php?product={$results[r].id}|{if $results[r].sku &amp;amp;&amp;amp; !$attr[at].sku}{$results[r].sku}{elseif $attr[at].sku}{$attr[at].sku}{/if}&amp;amp;as={$attr[at].pas_id}&quot;&gt;</span>Add to bag<span style="color: #009000;">&lt;/a&gt;</span>
<span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #009000;">&lt;span class=&quot;e&quot;&gt;</span>» ITEM: <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$results</span><span style="color: #D36900;">&#91;</span>r<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span> &amp;amp;&amp;amp; <span style="color: #D36900;">!</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$results</span><span style="color: #D36900;">&#91;</span>r<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">elseif</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;&lt;/div&gt;</span></pre></div></div>

<p>Those extra class names like <tt>col-volume</tt>, <tt>col-scent</tt> and <tt>col-strength</tt> are only for future use, who knows what other formatting and adjustments on the data and theme will happen. Its really fun working with MVC model. Hope it helps <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>List of Philippine Holidays for 2010</title>
		<link>http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/</link>
		<comments>http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 01:00:15 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[not about code]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1533</guid>
		<description><![CDATA[Regular Holidays New Year’s Day – January 1 (Friday) Maundy Thursday / Good Friday – April 1 / 2 (Thursday / Friday) Araw ng Kagitingan – April 9 (Friday) Labor Day – May 1 (Saturday) Independence Day – June 14 &#8230; <a href="http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Regular Holidays</strong></p>
<ul>
<li>New Year’s Day – January 1 (Friday)</li>
<li>Maundy Thursday / Good Friday – April 1 / 2 (Thursday / Friday)</li>
<li>Araw ng Kagitingan – April 9 (Friday)</li>
<li>Labor Day – May 1 (Saturday)</li>
<li>Independence Day – June 14 (Monday), moved from June 12</li>
<li>National Heroes Day – August 30 (Monday)</li>
<li>Bonifacio Day – November 29 (Monday), moved from November 30</li>
<li>Christmas Day – December 25 (Saturday)</li>
<li>Rizal Day – December 27 (Monday), moved from December 30</li>
</ul>
<p><strong>Special (non-working) holidays</strong></p>
<ul>
<li>Ninoy Aquino Day – August 23 (Monday), moved from August 21</li>
<li>All Saints’ Day – November 1 (Monday)</li>
<li>Christmas Eve – December 24 (Friday)</li>
<li>New Year’s Eve – December 31 (Friday)</li>
</ul>
<p><strong>Others</strong></p>
<ul>
<li>1986 EDSA People Power Revolution anniversary – Special holiday for schools – February 22 (Monday), moved from February 25</li>
<li>Eid’l Fitr and Eid’l Adha 2010 &#8211; To be announced later</li>
<li>Founding Anniversary of Iglesia ni Cristo – July 27, 2010 – Special national working holiday</li>
</ul>
<p>Source : <a href="http://www.pinoymoneytalk.com/philippine-holidays-2008/">http://www.pinoymoneytalk.com/philippine-holidays-2008/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>If Windows, Linux and OSX Opened Cafes</title>
		<link>http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/</link>
		<comments>http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 03:58:10 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[me stuff]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[funky]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1395</guid>
		<description><![CDATA[What if really&#8230; LOL! I found this from DaniWeb, it&#8217;s short and entertaining! Read on&#8230; The New York Times reported today that Apple has opened its first Apple Store in Paris, underneath the Louvre no less, and just two weeks &#8230; <a href="http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>What if really&#8230; LOL! I found <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title">this</a> from <a href="http://www.daniweb.com">DaniWeb</a>, it&#8217;s short and entertaining! Read on&#8230;</p>
<p>The New York Times <a href="http://www.nytimes.com/reuters/2009/11/06/technology/tech-us-france-apple-louvre.html" target="_blank">reported today</a> that Apple has opened its first Apple Store in Paris, underneath the Louvre no less, and just two weeks after Microsoft opened up a <a href="http://www.engadget.com/2009/10/22/microsofts-windows-cafe-opens-its-doors-in-paris/" target="_blank">Windows 7 cafe</a> in Paris in another location. The idea of these two companies competing in a retail environment, and especially a Windows-themed cafe, got me thinking about what would happen if three cafes opened each run in the same style of the operating system it was named for. I figure it might look something like this:</p>
<h4>Windows Cafe</h4>
<p>The Windows Cafe is in a bland store front. The furniture consists of straight wooden chairs with tables with sharp angles. Unfortunately, every so often when you sit in a chair it crashes the to the floor, but you get used to this and figure it&#8217;s just part of the experience of going to the Windows Cafe. (To be fair they have been testing chairs from a new manufacturer and they are reportedly less prone to breaking in this fashion.) Pictures of a smiling Bill Gates and Windows logos adorn the walls. The coffee tastes fine most of the time, but a surprising number of patrons get sick there, so that it&#8217;s become standard practice to use <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title" target="_blank">hand sanitizer</a> before you go in to protect yourself. The coffee is expensive, and refills are definitely not free, but it&#8217;s a known quantity, and many people are comfortable going there.</p>
<h4>Linux Cafe</h4>
<p>The Linux Cafe is a funky place in an artsy neighborhood with eclectic furniture donated by the patrons. It doesn&#8217;t match, but it&#8217;s comfortable and the walls are covered with donated pictures and paintings by local artists. The coffee is free, served in black cups (or you can just bring your own), but you need to make it yourself. If you can&#8217;t do it yourself, the cafe has consultants available to help you for a fee. It&#8217;s great for people who know about coffee brewing, but many people are intimidated by the idea of making their own coffee and stay away, even though very few people ever get sick who go there.</p>
<h4>Apple Cafe</h4>
<p>The Apple Cafe is a modern, state-of-the-art facility. The tables are stainless steel and the chairs are ultra-contemporary. Shrines to Apple CEO <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title#" target="_blank">Steve Jobs</a> are dotted around the wide space. The cups are cool and come in a variety of bright colors. The coffee is well made by a highly trained staff, and even though it costs a lot more, people line up around the block for a chance to drink it. Just don&#8217;t ask the staff about their coffee-making techniques because they are extremely tight lipped about this. People occasionally get sick there, but it&#8217;s rare enough for the cafe to brag about its safety record.</p>
<p>So there you have it. Three cafes with three distinct personalities just like the operating systems they represent</p>
<p>Source: <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title">http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title</a> by <a href="http://www.daniweb.com/news/writer313540.html">Ron Miller</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickie Visitors Country WP Plugin</title>
		<link>http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/</link>
		<comments>http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:14:54 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[me stuff]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1382</guid>
		<description><![CDATA[This plugin is dependent on WP/GeoTrack by Johannes Lietz, this is NOT a stand-alone plugin, it won&#8217;t work if WP/GeoTrack is not installed anyway, so it&#8217;s safe. And don&#8217;t look for it in WP Plugins repo, you won&#8217;t find it &#8230; <a href="http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This plugin is dependent on <a title="Visit plugin site" href="http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin">WP/GeoTrack</a> by <a title="Visit author homepage" href="http://dadabase.de/">Johannes Lietz</a>, this is NOT a stand-alone plugin, it won&#8217;t work if <a title="Visit plugin site" href="http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin">WP/GeoTrack</a> is not installed anyway, so it&#8217;s safe.</p>
<p>And don&#8217;t look for it in <a href="http://wordpress.org/extend/plugins/">WP Plugins</a> repo, you won&#8217;t find it there <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
Plugin Name: Top Visitors Flag
Plugin URI: http://www.marvinmarcelo.com/
Description: This plugin displays visitors on sidebar as widget dependent on &lt;a href=&quot;http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin&quot;&gt;WP/GEO-Track plugin&lt;/a&gt;.
Author: Marvin Marcelo
Author URI: http://www.marvinmarcelo.com/
Version: 1.0.0
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> tvf_get_topvisits<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">,</span> <span style="color: #000088;">$table_prefix</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select count(*) as `rows` , `country` , `flagname` from `&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$table_prefix</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;geotrack` group by `country` order by `rows` desc limit 0 , 12&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$flagstats</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;li id='top-country-flags'&gt;&lt;h2&gt;Top Visiting Countries&lt;/h2&gt;&lt;div&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/*  id string */</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$flagstats</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$cf</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$cf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rows</span> <span style="color: #339933;">=</span> <span style="color: #990000;">number_format</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rows</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span> GEOTRACK_URL <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;flags/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$cf</span><span style="color: #339933;">-/&gt;</span>flagname <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.png<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>Flag of <span style="color: #006699; font-weight: bold;">$cf-&gt;country</span> with <span style="color: #006699; font-weight: bold;">$cf-&gt;rows</span> visits<span style="color: #000099; font-weight: bold;">\&quot;</span> title=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$cf-&gt;country</span> with <span style="color: #006699; font-weight: bold;">$cf-&gt;rows</span> visits<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$html</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> init_tvf_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	register_sidebar_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Top Visitors Flags&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;tvf_get_topvisits&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GT_NOT_INSTALLED'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;!-- You need <span style="color: #000099; font-weight: bold;">\&quot;</span>http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin<span style="color: #000099; font-weight: bold;">\&quot;</span> installed first--&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
  add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;plugins_loaded&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;init_tvf_init&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Also, you have to forgive the function, constants, and variables names, we all struggle for a better and sensible one <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Social, didn&#8217;t complain</title>
		<link>http://www.marvinmarcelo.com/windows-social-didnt-complain/</link>
		<comments>http://www.marvinmarcelo.com/windows-social-didnt-complain/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 00:55:56 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[win7]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1366</guid>
		<description><![CDATA[Ok, this is actually the first post I did about Windows. I haven&#8217;t used it as my working platform for more than 2 years, though honestly, it&#8217;s also where I started, back in Windows 95 in my school years. Even &#8230; <a href="http://www.marvinmarcelo.com/windows-social-didnt-complain/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-1380" title="2qa6yp0" src="http://www.marvinmarcelo.com/wp-content/uploads/2009/10/2qa6yp0-150x150.png" alt="2qa6yp0" width="150" height="150" />Ok, this is actually the first post I did about <a href="http://www.microsoft.com/windows/">Windows</a>. I haven&#8217;t used it as my working platform for more than 2 years, though honestly, it&#8217;s also where I started, back in Windows 95 in my school years. Even if that&#8217;s the only available version we had in 1999, it was huge then! I am now more in the FOSS community, and have been enjoying doing my stuff in <a href="http://www.ubuntu.com/products/WhatIsUbuntu/desktopedition">Ubuntu Desktop</a>. But what I really wanted to point out in this post is the new <a href="http://www.microsoft.com/windows/social/">Windows Social</a>, it is just like any social media but it runs real time feeds, &#8220;popping in&#8221; every second into the stream area with streams coming from different major social media out there &#8211; Facebook, Flickr, Twitter, etc. And that is a &#8220;WOW&#8221;, I admit. That&#8217;s the feature Facebook Developers haven&#8217;t really implemented in full capacity. But Facebook already rolled out their version with that feature, sort of saying &#8220;we&#8217;re on the way!&#8221;, as they had also announced in that release.</p>
<p><a href="http://www.microsoft.com/windows/social/"><img class="alignnone size-full wp-image-1371" title="Screenshot" src="http://www.marvinmarcelo.com/wp-content/uploads/2009/10/Screenshot1.png" alt="Windows Social" width="670" height="419" /></a></p>
<p>I still remember way back the upgrade of MSN&#8217;s Hotmail (or not exactly sure if older versions work smoothly on Firefox), it was always complaining that it&#8217;s not compatible with my browser. But this one, this one is really good, so Kudo&#8217;s to <a href="http://www.microsoft.co/windows/social/">Windows Social</a> team. When I found this in the Twitter&#8217;s box in popurls, posts just started popping in, sweet! Though I suppose it would do the same as on MS and IE platform. But if someone knew of a &#8220;flaw&#8221;, &#8220;fail&#8221; or &#8220;weak link&#8221;, complain about it properly to their support, and if you can bother to let me know <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  LOL</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/windows-social-didnt-complain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

