<?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>moment * star</title>
	<atom:link href="http://www.momentstar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.momentstar.com</link>
	<description></description>
	<lastBuildDate>Mon, 02 Jan 2012 19:37:00 +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>Moving to new location</title>
		<link>http://blog.momentstar.com</link>
		<comments>http://blog.momentstar.com#comments</comments>
		<pubDate>Mon, 02 Jan 2012 19:36:05 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.momentstar.com/?p=363</guid>
		<description><![CDATA[I used wordpress for awhile just to keep my notes on my development progresses, but I have been wanting to be a part of a community so I started my blog over at Tumblr.]]></description>
			<content:encoded><![CDATA[<p>I used wordpress for awhile just to keep my notes on my development progresses, but I have been wanting to be a part of a community so I started my blog over at <a href="http://blog.momentstar.com" title="moment * star">Tumblr</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rbenv and rubygems on a osx installation</title>
		<link>http://blog.momentstar.com/post/14813769913/rbenv-and-rubygems-on-a-osx-installation</link>
		<comments>http://blog.momentstar.com/post/14813769913/rbenv-and-rubygems-on-a-osx-installation#comments</comments>
		<pubDate>Mon, 03 Oct 2011 02:33:06 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.momentstar.com/?p=273</guid>
		<description><![CDATA[Edit: I had tried to install on Ubuntu, I had to install some extra packages to build ruby, $ sudo apt-get install build-essential zlib1g zlib1g-dev zlibc libxml2 libxml2-dev libxslt-dev libssl-dev End Edit; I really like rvm because it has lots &#8230; <a href="http://blog.momentstar.com/post/14813769913/rbenv-and-rubygems-on-a-osx-installation">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Edit:</p>
<p>I had tried to install on Ubuntu, I had to install some extra packages to build ruby,</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ sudo apt-get install build-essential zlib1g zlib1g-dev zlibc libxml2 libxml2-dev libxslt-dev libssl-dev</pre></div></div>

<p>End Edit;</p>
<p>I really like <a href="http://beginrescueend.com/" target="_blank">rvm</a> because it has lots of great features and I never had a problem with it when I used it, but I wanted to give <a href="https://github.com/sstephenson/rbenv" target="_blank">rbenv</a> a try. Finally, I had a fresh installation of Lion to try it on. I followed all the steps found in the rbenv wiki, followed by  downloading and installing the latest version of Ruby and RubyGems.</p>
<p>The following are my steps that I want to use as a reminder of what I did.  I opted not to install via homebrew, which would probably have been easier, but I always like doing things the hard way first to figure out how it all works. I also had to install xcode, in order to compile new gems and ruby versions.</p>
<p>Installing rbenv:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ git clone git://github.com/sstephenson/rbenv.git .rbenv</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ echo 'export PATH=&quot;$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH&quot;' &gt;&gt; ~/.zshrc</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ echo 'eval &quot;$(rbenv init -)&quot;' &gt;&gt; ~/.zshrc</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ source ~/.zshrc</pre></div></div>

<p>That&#8217;s it for install rbenv, now I need to install ruby. </p>
<p>Since I opted to install rbenv the hard way, I also opted not to install ruby-build, and download the ruby source directly from <a href="http://ruby-lang.org" rel="no-follow">http://ruby-lang.org</a>. I got ruby-1.9.2-p290 and ruby-1.8.7-p352 tarballs.  </p>
<p>Installing ruby:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~/Downloads/ruby-1.9.2-p290 $ ./configure --prefix=$HOME/.rbenv/versions/1.9.2-p290</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~/Downloads/ruby-1.9.2-p290 $ make &amp;&amp; make install</pre></div></div>

<p>Refresh rbenv after installing gems and ruby versions:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ rbenv rehash</pre></div></div>

<p>I check the version available, and then set my global preference to the latest installed version:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ rbenv versions
  1.9.2-p290
~ $ rbenv global 1.9.2-p290
~ $ rbenv versions
* 1.9.2-p290</pre></div></div>

<p>Next, I wanted to install the bundler gem, but I found out that by default &#8216;gem&#8217; executable is pointing to the OSX version.  After confirming I was installing into the right version of ruby, I needed to download and install <a href="http://rubygems.org/pages/download" rel="no-follow">rubygems</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~/Downloads/rubygems-1.8.10 $ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
~/Downloads/rubygems-1.8.10 $ ruby setup.rb</pre></div></div>

<p>Then I need to rebuild the rbenv shim binaries to get the gem executable.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ rbenv rehash</pre></div></div>

<p>That&#8217;s it.  I double checked the gem version I was running:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">~ $ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.1.0]
  - INSTALLATION DIRECTORY: /Users/beverlyguillermo/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /Users/beverlyguillermo/.rbenv/versions/1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/beverlyguillermo/.rbenv/versions/1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/beverlyguillermo/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
     - /Users/beverlyguillermo/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources =&gt; true
     - :verbose =&gt; true
     - :benchmark =&gt; false
     - :backtrace =&gt; false
     - :bulk_threshold =&gt; 1000
  - REMOTE SOURCES:
     - http://rubygems.org/</pre></div></div>

<p>Happy with all of that, I installed any gems I wanted.  Yea, rbenv!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813769913/rbenv-and-rubygems-on-a-osx-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vmware, ubuntu, and shared folders</title>
		<link>http://blog.momentstar.com/post/14813732270/vmware-ubuntu-and-shared-folders</link>
		<comments>http://blog.momentstar.com/post/14813732270/vmware-ubuntu-and-shared-folders#comments</comments>
		<pubDate>Sat, 01 Oct 2011 22:50:36 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.momentstar.com/?p=270</guid>
		<description><![CDATA[I use VMWare Fusion a lot, simply because I like to replicate the server configurations on my local development machine and it&#8217;s easier to have multiple instances of servers readily available with it. I also like to have my code &#8230; <a href="http://blog.momentstar.com/post/14813732270/vmware-ubuntu-and-shared-folders">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use VMWare Fusion a lot, simply because I like to replicate the server configurations on my local development machine and it&#8217;s easier to have multiple instances of servers readily available with it. I also like to have my code available at all times with whichever VM I am using, so the code is shared.  One thing I notice is that the VMTools defaults to using Mac&#8217;s UID/GID information, rather than the equivalent on the VM. So using these <a href="http://communities.vmware.com/message/1829238?tstart=0" rel="no-follow">comments</a>, I found a way to make the changes.</p>
<p>First, I double checked /etc/mtab to find out how it&#8217;s mounted.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ vim /etc/mtab</pre></div></div>

<p>and it looks like this in that file on my machine:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">.host:/ /mnt/hgfs vmhgfs rw,ttl=1 0 0</pre></div></div>

<p>I copied that and edited the /etc/fstab file and added the UID/GID for my user or whatever existing user or group. I also got from the <a href="http://communities.vmware.com/message/1829238?tstart=0" rel="no-follow">comments</a> that it fails mounting automatically, and that I should also add nobootwait to the parameters and manually perform unmount and mount.  It really sucks but that&#8217;s what you got to deal with for the flexibility of multiple development OSes.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ vim /etc/fstab</pre></div></div>

<p>In the file, I added:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">.host:/ /mnt/hgfs vmhgfs rw,ttl=1,uid=1000,gid=1000,nobootwait 0 0</pre></div></div>

<p>When you restart the VM, you&#8217;ll get some errors (if you&#8217;re using the GUI, you probably won&#8217;t see it), but login and then do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># umount /mnt/hgfs
# mount /mnt/hgfs</pre></div></div>

<p>Create a script per the <a href="http://communities.vmware.com/message/1829238?tstart=0" rel="no-follow">comments</a> if you want. It saved me a lot of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813732270/vmware-ubuntu-and-shared-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git: push rejected non-fast-forward</title>
		<link>http://blog.momentstar.com/post/14813695263/git-push-rejected-non-fast-forward</link>
		<comments>http://blog.momentstar.com/post/14813695263/git-push-rejected-non-fast-forward#comments</comments>
		<pubDate>Wed, 28 Sep 2011 15:04:20 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://www.momentstar.com/?p=264</guid>
		<description><![CDATA[I always get this when I am add a remote repository and I am trying to sync up branches. In order to resolve it, I pull from the repository and get any changes and then try to re-push. $ git &#8230; <a href="http://blog.momentstar.com/post/14813695263/git-push-rejected-non-fast-forward">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I always get this when I am add a remote repository and I am trying to sync up branches.  In order to resolve it, I pull from the repository and get any changes and then try to re-push.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ git pull otherrepo
...
$ git push otherrepo localbranch</pre></div></div>

<p>This will try to push the changes, but you should probably specify the remote branch as well if that still throws the non-fast-forward error.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ git push otherrepo localbranch:remotebranch</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813695263/git-push-rejected-non-fast-forward/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiline comments in ruby</title>
		<link>http://blog.momentstar.com/post/14813647192/multiline-comments-in-ruby</link>
		<comments>http://blog.momentstar.com/post/14813647192/multiline-comments-in-ruby#comments</comments>
		<pubDate>Thu, 22 Sep 2011 05:09:21 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.momentstar.com/?p=257</guid>
		<description><![CDATA[I have noticed a lot of books or sites don&#8217;t say how to do multi-line comments in ruby. Well, you can use the ruby documentation blocks &#8211; =begin and =end Anything in between the two lines will be &#8220;commented&#8221; out. &#8230; <a href="http://blog.momentstar.com/post/14813647192/multiline-comments-in-ruby">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have noticed a lot of books or sites don&#8217;t say how to do multi-line comments in ruby.  Well, you can use the ruby documentation blocks &#8211;</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#000080; font-style:italic;">=begin</span></pre></div></div>

<p>and</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">=<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Anything in between the two lines will be &#8220;commented&#8221; out. The purpose of the above lines is for documentation though, but it&#8217;s really useful to &#8220;temporarily&#8221; block on multiple lines of code&#8230;</p>
<p>For true comments, do single line commenting&#8230;</p>
<h2>Vim and Single Line Commenting</h2>
<p>If you wanted to do single line commenting (i.e., adding # in front of the line) in Vim, use the regex search and replace.</p>
<p>Visually select the lines (using Shift-v and the arrow keys to select), then going into command mode by enter &#8216;:&#8217; (colon), where you get something like this</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">:'&lt;,'&gt;</pre></div></div>

<p>Then all you have to do is enter</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">:'&lt;,'&gt;s!^!#!g</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813647192/multiline-comments-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging all queries that goes through mysql</title>
		<link>http://blog.momentstar.com/post/14813594492/logging-all-queries-that-goes-through-mysql</link>
		<comments>http://blog.momentstar.com/post/14813594492/logging-all-queries-that-goes-through-mysql#comments</comments>
		<pubDate>Wed, 21 Sep 2011 01:23:18 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.momentstar.com/?p=249</guid>
		<description><![CDATA[All I want to know is what these frameworks are doing when they load a page, and they like to do a lot of things behind the scenes. Some of them allow you to log the sql out, but some &#8230; <a href="http://blog.momentstar.com/post/14813594492/logging-all-queries-that-goes-through-mysql">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>All I want to know is what these frameworks are doing when they load a page, and they like to do a lot of things behind the scenes.  Some of them allow you to log the sql out, but some of them are don&#8217;t have it or make it difficult to output.  In mysql, you can turn on logging through it&#8217;s configuration, but sometimes I like to just do it via command-line without have to restart the server.</p>
<p>As root, enter:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> GLOBAL general_log<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ON&quot;</span>;
<span style="color: #993333; font-weight: bold;">SET</span> GLOBAL log_output<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;TABLE&quot;</span>;</pre></div></div>

<p>Run through your website, and you can grab all your queries using:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> mysql<span style="color: #66cc66;">.</span>general_log;</pre></div></div>

<p>and to disable the logging, just run:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> GLOBAL general_log<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;OFF&quot;</span>;
<span style="color: #993333; font-weight: bold;">SET</span> GLOBAL log_output<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;FILE&quot;</span>;</pre></div></div>

<p>Reference: <a href="http://dev.mysql.com/doc/refman/5.1/en/log-destinations.html" title="http://dev.mysql.com/doc/refman/5.1/en/log-destinations.html">http://dev.mysql.com/doc/refman/5.1/en/log-destinations.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813594492/logging-all-queries-that-goes-through-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7 and HTML5 video</title>
		<link>http://blog.momentstar.com/post/14813549122/ie7-and-html5-video</link>
		<comments>http://blog.momentstar.com/post/14813549122/ie7-and-html5-video#comments</comments>
		<pubDate>Wed, 13 Apr 2011 15:08:59 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://momentstar.com/?p=245</guid>
		<description><![CDATA[I use Modernizr and HTML5 innerShiv to enable using html5 tags in IE. One of those tags is the video tag that will work in the latest browsers, for example from VideoJS: &#60;video class=&#34;video-js&#34; width=&#34;640&#34; height=&#34;264&#34; controls preload poster=&#34;http://video-js.zencoder.com/oceans-clip.png&#34;&#62; &#60;source &#8230; <a href="http://blog.momentstar.com/post/14813549122/ie7-and-html5-video">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://www.modernizr.com/">Modernizr</a> and <a href="http://jdbartlett.github.com/innershiv/">HTML5 innerShiv</a> to enable using html5 tags in IE.  One of those tags is the video tag that will work in the latest browsers, for example from <a href="http://videojs.com/">VideoJS</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">    &lt;video class=&quot;video-js&quot; width=&quot;640&quot; height=&quot;264&quot; controls preload poster=&quot;http://video-js.zencoder.com/oceans-clip.png&quot;&gt;
      &lt;source src=&quot;http://video-js.zencoder.com/oceans-clip.mp4&quot; type='video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;' /&gt;
      &lt;source src=&quot;http://video-js.zencoder.com/oceans-clip.webm&quot; type='video/webm; codecs=&quot;vp8, vorbis&quot;' /&gt;
      &lt;source src=&quot;http://video-js.zencoder.com/oceans-clip.ogv&quot; type='video/ogg; codecs=&quot;theora, vorbis&quot;' /&gt;
      &lt;!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. --&gt;
      &lt;object class=&quot;vjs-flash-fallback&quot; width=&quot;640&quot; height=&quot;264&quot; type=&quot;application/x-shockwave-flash&quot;
        data=&quot;http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf&quot;&gt;
        &lt;param name=&quot;movie&quot; value=&quot;http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf&quot; /&gt;
        &lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;
        &lt;param name=&quot;flashvars&quot; value='config={&quot;playlist&quot;:[&quot;http://video-js.zencoder.com/oceans-clip.png&quot;, {&quot;url&quot;: &quot;http://video-js.zencoder.com/oceans-clip.mp4&quot;,&quot;autoPlay&quot;:false,&quot;autoBuffering&quot;:true}]}' /&gt;
        &lt;!-- Image Fallback. Typically the same as the poster image. --&gt;
        &lt;img src=&quot;http://video-js.zencoder.com/oceans-clip.png&quot; width=&quot;640&quot; height=&quot;264&quot; alt=&quot;Poster Image&quot;
          title=&quot;No video playback capabilities.&quot; /&gt;
      &lt;/object&gt;
    &lt;/video&gt;</pre></div></div>

<p>The above video is the demo video used by VideoJS.  When I debugged with IE7, this video tag, it kept throwing a javascript warning.<br />
<code><br />
'null' is null or not an object.<br />
</code></p>
<p>The message would repeat several times in the IE developer tools console and the only way to remove the warnings was to remove the embedded video tag.  So in order to get it to work with IE7, I had to make some changes &#8212; note, if you&#8217;re going to try this code, you need Modernizr, VideoJS, and jQuery.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</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>Modernizr.<span style="color: #660066;">video</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;http://video-js.zencoder.com/oceans-clip.mp4&quot; id=&quot;player&quot;&gt;&lt;img src=&quot;http://video-js.zencoder.com/oceans-clip.png&quot; title=&quot;Click to play&quot; /&gt;&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     flowplayer<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'player'</span><span style="color: #339933;">,</span>  <span style="color: #3366CC;">'http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;video class=&quot;video-js&quot; width=&quot;640&quot; height=&quot;264&quot; controls preload poster=&quot;http://video-js.zencoder.com/oceans-clip.png&quot;&gt;'</span> <span style="color: #339933;">+</span>
     <span style="color: #006600; font-style: italic;">// The rest of the video tag contents</span>
      <span style="color: #3366CC;">'&lt;/video&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    VideoJS.<span style="color: #660066;">setupAllWhenReady</span><span style="color: #009900;">&#40;</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></div></div>

<p>The above code would just force the flowplayer as the default for browsers unable to support the video tag properly, and any other browser, the video tag would be added to the body and the videojs javascript would handle the ui interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813549122/ie7-and-html5-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://video-js.zencoder.com/oceans-clip.mp4" length="19448241" type="video/mp4" />
<enclosure url="http://video-js.zencoder.com/oceans-clip.webm" length="14625011" type="video/webm" />
<enclosure url="http://video-js.zencoder.com/oceans-clip.ogv" length="13235468" type="video/ogg" />
		</item>
		<item>
		<title>VMWare Fusion, static vm ips, and port forwarding</title>
		<link>http://blog.momentstar.com/post/14813507050/vmware-fusion-static-vm-ips-and-port-forwarding</link>
		<comments>http://blog.momentstar.com/post/14813507050/vmware-fusion-static-vm-ips-and-port-forwarding#comments</comments>
		<pubDate>Mon, 21 Mar 2011 20:13:24 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://momentstar.com/?p=231</guid>
		<description><![CDATA[Edit: 2011-09-14 It looks like VMWare stores all the configuration files in /Library/Preferences/VMWare Fusion directory. I recently just found this out and anything that I had mentioned earlier works now. Edit: 2011-07-05 I decided to set the ip address statically &#8230; <a href="http://blog.momentstar.com/post/14813507050/vmware-fusion-static-vm-ips-and-port-forwarding">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Edit: 2011-09-14</p>
<p>It looks like VMWare stores all the configuration files in /Library/Preferences/VMWare Fusion directory.  I recently just found this out and anything that I had mentioned earlier works now.</p>
<p>Edit: 2011-07-05</p>
<p>I decided to set the ip address statically in my VMs.  In ubuntu, my VMs&#8217; interface is called eth0 (you can check your interface&#8217;s name via ifconfig) and then edit /etc/network/interfaces, where you&#8217;d add</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">auto lo
iface lo inet loopback
&nbsp;
<span style="color: #666666; font-style: italic;"># default ip, if you didn't have an alias</span>
auto eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
&nbsp;
<span style="color: #666666; font-style: italic;"># alias to ip</span>
auto eth0:<span style="color: #000000;">0</span>
iface eth0:<span style="color: #000000;">0</span> inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1</pre></div></div>

<p>and restart</p>
<pre class="bash">
$ sudo /etc/init.d/networking restart
</pre>
<p>Edit: 2011-06-29</p>
<p>I was doing some testing with the latest June 2011 beta of VMWare, and I notice the files mentioned below are missing. I&#8217;ll update the post when I figure out what the ___what___ happened.</p>
<p>For now I am switching between a NAT and Bridge.  Using the Bridge to allow other computers on my network to access the the VM services I enabled (i.e., nginx, mysql, and ssh..etc).  NAT when I&#8217;m not on a network, and a Bridge when I&#8217;m connected to a router.</p>
<p>&#8212;</p>
<p>I use my VMs on my machine for development and sometimes I need my vms to talk to each other.  In order to keep the IPs static, I had to do the following:</p>
<ol>
<li>Edit /Library/Application Support/VMWare Fusion/vmnet8/dhcpd.conf</li>
<li>Add the following to the very end:
<pre class="bash">
host VirtualHost {
     hardware ethernet 00:50:56:3e:fa:ff;
     fixed-address 172.16.230.xxx;
}
</pre>
</li>
<li>Change VirtualHost to the name of my virtual host and the fixed-address to the IP I want.</li>
</ol>
<p>Another thing I want is to be able to use http://localhost or http://127.0.0.1 on my machine in order to allow other computers in my network to access my dev machines web servers.  In order to do this, you need to setup NAT forwarding.</p>
<ol>
<li>Edit /Library/Application Support/VMWare Fusion/vmnet8/nat.conf</li>
<li>Add the following under the [incomingtcp] section:
<pre class="bash">
# the static ip address you had assigned earlier
80 = 172.16.230.xxx:80
</pre>
</li>
</ol>
<p>After all the configuration changes, reboot vmware fusion either by restarting the app or running this in the terminal:</p>
<pre class="bash">
$ sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813507050/vmware-fusion-static-vm-ips-and-port-forwarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying frame rates in Flash</title>
		<link>http://blog.momentstar.com/post/14813463343/displaying-frame-rates-in-flash</link>
		<comments>http://blog.momentstar.com/post/14813463343/displaying-frame-rates-in-flash#comments</comments>
		<pubDate>Sat, 05 Feb 2011 03:55:29 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://momentstar.com/?p=217</guid>
		<description><![CDATA[Sample frame rate code. package &#123; import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.utils.getTimer; &#160; public class FPS_Test extends Sprite &#123; private var ball:Sprite; private time:int; private last_time:int; private fps:TextField; &#160; public function FPS_Test&#40;&#41; &#123; time = 0; last_time = &#8230; <a href="http://blog.momentstar.com/post/14813463343/displaying-frame-rates-in-flash">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sample frame rate code.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
  <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span>;
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FPS_Test <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> ball:Sprite;
    <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">time</span>:<span style="color: #0066CC;">int</span>;
    <span style="color: #0066CC;">private</span> last_time:<span style="color: #0066CC;">int</span>;
    <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">fps</span>:<span style="color: #0066CC;">TextField</span>;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> FPS_Test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">time</span> = <span style="color: #cc66cc;">0</span>;
      last_time = <span style="color: #cc66cc;">0</span>;
      <span style="color: #0066CC;">fps</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      addChild<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">fps</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      ball = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      addChild<span style="color: #66cc66;">&#40;</span>ball<span style="color: #66cc66;">&#41;</span>;
&nbsp;
      ball.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xff0000<span style="color: #66cc66;">&#41;</span>;
      ball.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawCircle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">40</span><span style="color: #66cc66;">&#41;</span>;
      ball.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      ball.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">20</span>;
      ball.<span style="color: #006600;">y</span>  = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>;
&nbsp;
      addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, <span style="color: #0066CC;">onEnterFrame</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onEnterFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
  <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">time</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0066CC;">fps</span>.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;fps: &quot;</span> + <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1000</span> <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">time</span> - last_time<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
    ball.<span style="color: #006600;">x</span>++;
    last_time = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813463343/displaying-frame-rates-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Ubuntu, Nginx, FastCGI, Python, and Django</title>
		<link>http://blog.momentstar.com/post/14813414872/using-ubuntu-nginx-fastcgi-python-and-django</link>
		<comments>http://blog.momentstar.com/post/14813414872/using-ubuntu-nginx-fastcgi-python-and-django#comments</comments>
		<pubDate>Sun, 09 Jan 2011 23:51:16 +0000</pubDate>
		<dc:creator>beverly</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://momentstar.com/?p=188</guid>
		<description><![CDATA[NOTE: No security on the following, this was for development purposes just to learn python and django. From a fresh install of Ubuntu Meerkat (10.10), I added the following packages: python python-flup python-mysqldb nginx After making sure, python is installed &#8230; <a href="http://blog.momentstar.com/post/14813414872/using-ubuntu-nginx-fastcgi-python-and-django">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong><em>NOTE: No security on the following, this was for development purposes just to learn python and django.</em></strong></p>
<p>From a fresh install of Ubuntu Meerkat (10.10), I added the following packages:</p>
<ol>
<li>python</li>
<li>python-flup</li>
<li>python-mysqldb</li>
<li>nginx</li>
</ol>
<p>After making sure, python is installed and installing the <a href="http://www.djangoproject.com/download/">django</a> framework sdk. I check to make sure django will use fastCGI by running the following:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">$ cd <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>path to django project root<span style="">&#93;</span></span>
$ python manage.py runfcgi host<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">127.0.0.1 port=8080 --settings=settings</span></pre></div></div>

<p>And to kill the process:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">$ pkill -f <span style="color: #933;">&quot;python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings&quot;</span></pre></div></div>

<p>Next, is to edit nginx configuration, adding the new django site to nginx&#8217;s sites-enabled directory:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">  server <span style="">&#123;</span>
    listen <span style="">80</span><span style="color: #666666; font-style: italic;">; </span>
    server_name localhost<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
    location ~* ^.+.<span style="">&#40;</span>js|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov<span style="">&#41;</span> <span style="">&#123;</span>
      rroot /media/<span style="color: #666666; font-style: italic;">;</span>
      access_log   off<span style="color: #666666; font-style: italic;">;</span>
      expires      30d<span style="color: #666666; font-style: italic;">;</span>
    <span style="">&#125;</span>   
    location / <span style="">&#123;</span> 
          # host and port to fastcgi server
          fastcgi_pass 127.0.0.1:<span style="">8080</span><span style="color: #666666; font-style: italic;">;</span>
          fastcgi_param PATH_INFO $fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
          fastcgi_param REQUEST_METHOD $request_method<span style="color: #666666; font-style: italic;">;</span>
          fastcgi_param QUERY_STRING $query_string<span style="color: #666666; font-style: italic;">;</span>
          fastcgi_param CONTENT_TYPE $content_type<span style="color: #666666; font-style: italic;">;</span>
          fastcgi_param CONTENT_LENGTH $content_length<span style="color: #666666; font-style: italic;">;</span>
          fastcgi_pass_header Authorization<span style="color: #666666; font-style: italic;">;</span>
          fastcgi_intercept_errors off<span style="color: #666666; font-style: italic;">;</span>
      <span style="">&#125;</span>   
      access_log  /var/log/nginx/localhost.access_log main<span style="color: #666666; font-style: italic;">;</span>
      error_log  /var/log/nginx/localhost.error_log<span style="color: #666666; font-style: italic;">;</span>
  <span style="">&#125;</span></pre></div></div>

<p>Then, restarting nginx and then trying to access the site via the regular port 80 access.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.momentstar.com/post/14813414872/using-ubuntu-nginx-fastcgi-python-and-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

