Undefined Range : http://www.undefinedrange.com/articles.rss en-us 40 Git Submodules, External Repositories, and Deployment <p>Even though I switched a few of my projects from Subversion to Git a couple of months ago, I still had lots to learn. So I dedicated last weekend to use submodules for Rails plugins. Unfortunately, it wasn&#8217;t the quick conversion I thought it would be but it turned out for the best.</p> <h3>Git Submodules</h3> External repository references was handled so elegantly by <a href="http://piston.rubyforge.org/">Piston</a> for Subversion repositories that I was willing to wait for its Git support. But I came across <a href="http://daniel.collectiveidea.com/blog/2008/4/12/git-submodules-part-2">this blog post</a> that dispelled misconceptions and it turns out submodules act just like Piston. In short, submodules will keep track of which revision it is on and won&#8217;t hit external resources unless it has to. Sweet! Submodules are great and simple to work with on the development side. Do: <div class="typocode"><pre><code class="typocode_default "> git submodule add git://github.com/rails/acts_as_list.git vendor/plugins/acts_as_list git submodule init git submodule update</code></pre></div> <p>And you&#8217;re golden. But there is still much to do. In order to deploy efficiently with Capistrano, I&#8217;d needed to do a &#8220;set :deploy_via, :remote_cache&#8221;. Onwards in search of a Internet accessible Git repository that I can call my own.</p> <h3>Git Repository Hosting</h3> Enter <a href="http://railsplayground.com">Railsplayground.com Ruby on Rails Hosting</a>. They have been hosting this blog for several years and have always been great for shared hosting. Bonus points for <a href="http://railsplayground.com/sub_trac.html">free Subversion and Trac hosting</a>, up to 1GB disk space, with any hosting account. <p>Little did I know that they have been doing Git repository hosting for the past several months. Their homepage doesn&#8217;t mention it although their forum as well as their <a href="http://svnrepository.com/">sister site</a> do.</p> <p>If you&#8217;re thinking about their git repository hosting solution, there are a couple of things to keep in mind.</p> <p><span class="caps">PRO</span>: Custom control panel: easy to create/delete git repositories and manage user accounts that has access to them</p> <p><span class="caps">PRO</span>: Trac integration is underway</p> <p><span class="caps">CON</span>: The only protocols they support are <span class="caps">HTTP</span> and <span class="caps">HTTPS</span>.</p> <p><span class="caps">CON</span>: It requires creating a ~/.netrc with my login and password. I don&#8217;t want to store any passwords in plain text on my laptop so I symlinked the file to an <a href="http://www.knoxformac.com/">encrypted vault</a> where my project files are anyways</p> <h3>MacPorts Pain</h3> I&#8217;m using MacPorts on my Macbook Pro to compile git. This setup worked fine before but I couldn&#8217;t access the newly created git repository. <div class="typocode"><pre><code class="typocode_default "> $ git push upload master fatal: git-push is not available for http/https repository when not compiled with USE_CURL_MULTI error: failed to push some refs to 'https://secure2.svnrepository.com/g_vwoo/jamieliu/'</code></pre></div> Unfortunately, MacPorts added in a patch to remove the <span class="caps">USE</span>_CURL_MULTI flag for <a href="https://trac.macports.org/ticket/15100">stability reasons</a>. Since the bug is triggered by a very large checkout on a powerpc mac, not applicable in my case, I removed the patch by editing the git Portfile. <div class="typocode"><pre><code class="typocode_default "> #/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/git-core/Portfile patchfiles patch-Makefile.diff patch-http.h.diff # Before patchfiles patch-Makefile.diff # After</code></pre></div> I&#8217;m not sure how to tell MacPorts to recompile git. I cheapened out and added a variant to force a recompile. <div class="typocode"><pre><code class="typocode_default "> sudo port deactivate git-core @1.6.0_1+doc+svn sudo port install git-core +doc +svn +bash_completion</code></pre></div> Once that was resolved, I encountered yet another error. <div class="typocode"><pre><code class="typocode_default "> $ git push upload master error: Cannot access URL https://secure2.svnrepository.com/username/repository_name/, return code 1 error: failed to push some refs to 'https://secure2.svnrepository.com/username/repository_name/'</code></pre></div> Turned out that curl needs to be compiled with the ssl variant. Normally, this should work: <div class="typocode"><pre><code class="typocode_default "> $ sudo port install curl +ssl ---&gt; Fetching curl-ca-bundle ---&gt; Attempting to fetch certdata-1.48.txt from http://lxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 ---&gt; Verifying checksum(s) for curl-ca-bundle Error: Checksum (md5) mismatch for certdata-1.48.txt Error: Checksum (sha1) mismatch for certdata-1.48.txt Error: Checksum (rmd160) mismatch for certdata-1.48.txt Error: Target org.macports.checksum returned: Unable to verify file checksums Error: The following dependencies failed to build: curl-ca-bundle Error: Status 1 encountered during processing.</code></pre></div> MacPorts should already have <a href="https://trac.macports.org/ticket/16386">this fixed</a> but just in case, I got around the error by skipping checksums. <div class="typocode"><pre><code class="typocode_default "> sudo port install curl +ssl checksum.skip=yes</code></pre></div> <h3>Deployment Issues</h3> Here&#8217;s the git related entries in my Capistrano deployment script: <div class="typocode"><pre><code class="typocode_default "> set :repository, &quot;https://secure2.svnrepository.com/g_username/project_name&quot; set :scm, 'git' set :deploy_via, :remote_cache set :branch, &quot;master&quot; set :git_shallow_clone, 1 set :git_enable_submodules, 1 default_environment['GIT_SSL_NO_VERIFY'] = 'true'</code></pre></div> But deployment failed midway: <div class="typocode"><pre><code class="typocode_default "> $ cap staging deploy Initialized empty Git repository in /home/username/project_name/shared/cached-copy/vendor/plugins/acts_as_list/.git/ github.com[0: 65.74.177.129]: errno=Connection timed out ** fatal: unable to connect a socket (Connection timed out) ** Clone of 'git://github.com/rails/acts_as_list.git' into submodule path 'vendor/plugins/acts_as_list' failed</code></pre></div> The server firewall was getting in the way so I punched a hole for the git protocol: <div class="typocode"><pre><code class="typocode_default "> iptables -I OUTPUT -p tcp --dport 9418 -j ACCEPT</code></pre></div> <h3>Sweet Oblivion</h3> With that all out of the way, I can now successfully deploy to the server the way I want to. Now I can get back to work :) Tue, 26 Aug 2008 00:41:00 -0700 urn:uuid:427af239-c39c-443d-b4c2-905452cf990d blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/08/26/git-submodules-external-repositories-and-deployment#comments Ruby on Rails Web iptables capistrano deployment curl macports hosting repository subversion piston railsplayground submodules git http://www.undefinedrange.com/trackbacks?article_id=git-submodules-external-repositories-and-deployment&day=26&month=08&year=2008 http://www.undefinedrange.com/articles/2008/08/26/git-submodules-external-repositories-and-deployment A Look at Web Browser Market Share <p>Firefox 3 has been out for almost 2 weeks now and I wanted to know how its adoption was going and if it had any effect against IE. A quick look at some Google Analytics data showed that it isn&#8217;t as good as I had hoped. I present to you a quickie browser market share comparison between last month and the time period that <span class="caps">FF3</span> was available as of this writing.</p> <p style="margin-top: 70px;"><a href="http://www.my604.com">My604.com</a><br /> Thanks goes out to My604.com for letting me post this info. My604 is a Chinese language forum specific to the Vancouver / Lower Mainland region. I don&#8217;t have any particular demographics information but I&#8217;m seeing a sizable percentage of university students there.</p> <p>Interestingly enough, there is no change in browser usage except that a quarter of Firefox users are now using the newest version.</p> <table cellpadding="10px" style="color: #333"> <tr> <th style="background: black; color: white;">Market Share<br />Scope</th> <th style="background: black; color: white;">Browser</th> <th style="background: black; color: white;">May 2008<br />15,098 visits</th> <th style="background: black; color: white;">June 17 &#8211; 28, 2008<br />6,279 visits</th> <tr style="background: #bbb;"> <td>All</td> <td>IE</td> <td style="text-align: center;">74%</td> <td style="text-align: center;">74%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Firefox</td> <td style="text-align: center;">22%</td> <td style="text-align: center;">22%</td> </tr> <tr style="background: #67d1fd;"> <td>% of IE</td> <td><span class="caps">IE 7</span></td> <td style="text-align: center;">54%</td> <td style="text-align: center;">55%</td> </tr> <tr style="background: #67d1fd;"> <td>% of IE</td> <td><span class="caps">IE 6</span></td> <td style="text-align: center;">46%</td> <td style="text-align: center;">45%</td> </tr> <tr style="background: #ea9701;"> <td>% of FF</td> <td><span class="caps">FF 3</span></td> <td style="text-align: center;">4%</td> <td style="text-align: center;">26%</td> </tr> <tr style="background: #ea9701;"> <td>% of FF</td> <td><span class="caps">FF 2</span>.0.0.14</td> <td style="text-align: center;">85%</td> <td style="text-align: center;">65%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Safari</td> <td style="text-align: center;">3%</td> <td style="text-align: center;">3%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Opera</td> <td style="text-align: center;">0.5%</td> <td style="text-align: center;">0.5%</td> </tr> </table> <p style="margin-top: 70px;"><a href="http://vt-online.vsb.bc.ca">vt-online.vsb.bc.ca</a><br /> A website for a local high school where staff members can post messages to each other, students, and parents. Note that there is a significant drop in visits since the school year ended at the same time that <span class="caps">FF3</span> was released. Thus the numbers between months are not directly comparable but it should still give you an idea about their web browser usage.</p> <p>Some good news on the Firefox front. Again, Firefox 3 captured at least a quarter of all Firefox users. Perhaps more importantly, Firefox is taking over at the expense of IE! Hopefully, this trend will continue when school starts up again.</p> <p>Loving the <span class="caps">IE6</span> numbers. I&#8217;m going to take a wild guess and assume that with high schoolers in the mix, there would be more new computers that are pre-installed with <span class="caps">IE7</span>. In any case, <span class="caps">IE6</span> browser share has been dropping steadily over the past year and if it continues on like this, I might be able to drop <span class="caps">IE6</span> support this time next year. </p> <table cellpadding="10px" style="color: #333"> <tr> <th style="background: black; color: white;">Market Share<br />Scope</th> <th style="background: black; color: white;">Browser</th> <th style="background: black; color: white;">May 2008<br />4,267 visits</th> <th style="background: black; color: white;">June 17 &#8211; 28, 2008<br />528 visits</th> <tr style="background: #bbb;"> <td>All</td> <td>IE</td> <td style="text-align: center;">78%</td> <td style="text-align: center;">66%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Firefox</td> <td style="text-align: center;">18%</td> <td style="text-align: center;">29%</td> </tr> <tr style="background: #67d1fd;"> <td>% of IE</td> <td><span class="caps">IE 7</span></td> <td style="text-align: center;">80%</td> <td style="text-align: center;">83%</td> </tr> <tr style="background: #67d1fd;"> <td>% of IE</td> <td><span class="caps">IE 6</span></td> <td style="text-align: center;">20%</td> <td style="text-align: center;">17%</td> </tr> <tr style="background: #ea9701;"> <td>% of FF</td> <td><span class="caps">FF 3</span></td> <td style="text-align: center;">1%</td> <td style="text-align: center;">30%</td> </tr> <tr style="background: #ea9701;"> <td>% of FF</td> <td><span class="caps">FF 2</span>.0.0.14</td> <td style="text-align: center;">88%</td> <td style="text-align: center;">66%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Safari</td> <td style="text-align: center;">4%</td> <td style="text-align: center;">3.5%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Opera</td> <td style="text-align: center;">0%</td> <td style="text-align: center;">1%</td> </tr> </table> <p style="margin-top: 70px;"><a href="http://www.undefinedrange.com">Undefined Range</a><br /> This blog which is more web developer / techie oriented. As expected, not many visitors, percentage-wise, use IE. You guys rock! Still, a third of IE users and rising are on version 6. In absolute numbers it isn&#8217;t that much but I&#8217;d thought that web developers have universally shunned <span class="caps">IE6</span>. I&#8217;m trying to justify this discrepancy but I can&#8217;t. In the past month, there was about 1% of windows users on Windows 2000, NT, or lower so upgrade options are available. Also, web developers would need to verify their work on a myriad of browsers so they should already have browser options.</p> <p>Safari is doing very well here. Since my blog posts generally are about Rails, this is not a surprise. Sadly, no such love from Opera fans.</p> <table cellpadding="10px" style="color: #333"> <tr> <th style="background: black; color: white;">Market Share<br />Scope</th> <th style="background: black; color: white;">Browser</th> <th style="background: black; color: white;">May 2008<br />441 visits</th> <th style="background: black; color: white;">June 17 &#8211; 28, 2008<br />204 visits</th> <tr style="background: #bbb;"> <td>All</td> <td>IE</td> <td style="text-align: center;">15%</td> <td style="text-align: center;">10%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Firefox</td> <td style="text-align: center;">71%</td> <td style="text-align: center;">70%</td> </tr> <tr style="background: #67d1fd;"> <td>% of IE</td> <td><span class="caps">IE 7</span></td> <td style="text-align: center;">66%</td> <td style="text-align: center;">62%</td> </tr> <tr style="background: #67d1fd;"> <td>% of IE</td> <td><span class="caps">IE 6</span></td> <td style="text-align: center;">34%</td> <td style="text-align: center;">38%</td> </tr> <tr style="background: #ea9701;"> <td>% of FF</td> <td><span class="caps">FF 3</span></td> <td style="text-align: center;">19%</td> <td style="text-align: center;">59%</td> </tr> <tr style="background: #ea9701;"> <td>% of FF</td> <td><span class="caps">FF 2</span>.0.0.14</td> <td style="text-align: center;">71%</td> <td style="text-align: center;">33%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Safari</td> <td style="text-align: center;">12%</td> <td style="text-align: center;">18%</td> </tr> <tr style="background: #bbb;"> <td>All</td> <td>Opera</td> <td style="text-align: center;">1%</td> <td style="text-align: center;">0.5%</td> </tr> </table> <p style="margin-top: 70px;">Overall, I&#8217;m a little disappointed with Firefox 3&#8217;s adoption rate. I&#8217;ve always assumed that people using Firefox are more passionate about their choice of browsers and would upgrade more readily. But perhaps this is normal for Firefox since I don&#8217;t know how fast <span class="caps">FF2</span> was adopted.</p> <p>A bigger disappointment is how <span class="caps">IE6</span> is holding steady. What would it take to sink it?</p> Sun, 29 Jun 2008 17:01:00 -0700 urn:uuid:cfdf94d4-4e4a-4a4b-9f64-8b67073fee48 blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/06/29/a-look-at-web-browser-market-share#comments Web adoption stats visits my604.com opera safari firefox ie browsers web analytics google http://www.undefinedrange.com/trackbacks?article_id=a-look-at-web-browser-market-share&day=29&month=06&year=2008 http://www.undefinedrange.com/articles/2008/06/29/a-look-at-web-browser-market-share Finding Inspiration Pre and Post Release - Comments on a Daniel Burka Presentation <p>I highly recommend listening to the <span class="caps">MP3</span> and following along with the slides of <a href="http://www.webdirections.org/resources/wdn08-daniel-burka/">The why and how: UI case studies</a> presentation given at Web Directions North 2008 by Daniel Burka. On the surface, it is an hour presentation fussing over insignificant details but that is what&#8217;s so great about it. Much of it isn&#8217;t about aesthetics or graphic design. Instead, the spotlight is on the process of tweaking placement, wording, and prominence. It is about rearranging for clarity and directing user actions processes. It is about intuitiveness; the end users should understand why things are in chronological order or in a threading model. The kind of design, as illustrated in the presentation with <a href="http://digg.com/">Digg</a> and <a href="http://pownce.com/">Pownce</a> examples, that exhibits <a href="http://gettingreal.37signals.com/toc.php">Getting Real</a>.</p> <p>Daniel Burka&#8217;s examples are fascinating because he starts off with something entirely acceptable but they are then iterated into something that is clearly better. Better not so that end users bask in awe over it&#8217;s majesty, but through transparency and clarity in its form. Yet, it is the journey that can provide the direction, incentive, and inspiration that guides design, not just some divine inspiration or foresight.</p> <p>One of the things that Daniel Burka talks about is his success with using <span class="caps">HTML</span> mockups. I whole heartily agree as I found sketching with pen and paper and mockups in photoshop have their place in defining the general form but I&#8217;m hard pressed to properly define function in this manner. I don&#8217;t feel like I&#8217;m the only one since I&#8217;ve converted photoshop mockups to webapps, but sometimes would run into issues and ambiguity that the photoshop artist didn&#8217;t expect. It&#8217;s not their fault but unless you&#8217;re working in a webapp or through <span class="caps">HTML</span>, you won&#8217;t be thinking about webapp related issues. So it is refreshing to hear a designer say (loose transcript starting around 35min):</p> <blockquote> <p>&#8220;This is actually a mockup of about eight connected <span class="caps">HTML</span> pages a little bit of javascript and <span class="caps">CSS</span> files. And so this is something I didn&#8217;t do with the previous comment system. <b>I went immediately into implementation.</b> So implemented in real code. Which took a lot longer and wasn&#8217;t as easy to play with because it was half broken most of the time while the code was being written. And so what is happening here is I can play around with if I digg this comment what happens. If I bury it, I can actually change your vote now and if I bury it OK that&#8217;s what happens. I want to see the comment again after I bury it OK that&#8217;s what happens. You can hide it. I can report the user. I was playing around with these things and now these interactions I can actually kind of &#8211; it&#8217;s so awkward having a bunch of <span class="caps">HTML</span> files interlinked but <b>being able to play around with these interactions means I&#8217;m significantly more confident this time that when we release this thing</b>. The flow of when you&#8217;re playing around and writing comments and editing comments, I got it setup for what happens when you write a comment we open it and save it, you edit it, you save those changes, <b>so all those things I feel much more confident that each of those little processes all fit together alot better, they&#8217;re alot tighter</b>.&#8221;</p> </blockquote> <p>Design is an organic, ongoing and collaborative process and one in which all team members should have a hand in. Here, we have an example of a designer crossing the boundaries and working partly in the realm of the web developer. In the same manner, I would love to cross the boundary in the other direction more often. But too often client project work necessitates design up front for signing off and limiting cost/time resources that prevents creativity and experimentation in the latter stages of the project. In such cases, the webapp&#8217;s growth is stunted before it has a chance to mature.</p> <p>Continuous refinements occur alongside continuous inspiration. Daniel Burka shows example after example where he focused and improved on design elements <b>post release</b> despite how sufficient they were already. The lesson: please don&#8217;t discount the inspiration generated through production use. If given the freedom of multiple iterations, projects will flourish.</p> <p>I leave you with one last presentation reference about finding design inspiration from within the webpage itself. Remember, form follows function.</p> <blockquote> <p>(~40min into the presentation): &#8220;Like I was saying before with the yellow dig button, is take that idea then take it further. Let it design language breath through the rest of the site. And so the story format has it on the left, I took it to the homepage, so you take this really basic horizontal line, you add one little off center hatch to the page and it adds a sense of brand, a sense of identity to the page. Adds a little drama to the page.&#8221;</p> </blockquote> Wed, 25 Jun 2008 15:02:00 -0700 urn:uuid:28e76d5e-f65a-44c0-9628-af195d64f4c4 blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/06/25/finding-inspiration-pre-and-post-release-comments-on-a-daniel-burka-presentation#comments Design Web daniel burka presentation digg pownce getting_real interface interaction design mockups release form function http://www.undefinedrange.com/trackbacks?article_id=finding-inspiration-pre-and-post-release-comments-on-a-daniel-burka-presentation&day=25&month=06&year=2008 http://www.undefinedrange.com/articles/2008/06/25/finding-inspiration-pre-and-post-release-comments-on-a-daniel-burka-presentation New Age Dawns on the Web <p>Yesterday has seen the release of <a href="http://www.getfirefox.com">Firefox 3</a> and it has spread far and wide. As of this writing, some 14 hours after release, there were <a href="http://www.spreadfirefox.com/en-US/worldrecord">5,099,057 downloads</a>. That&#8217;s a spectacular achievement and a clear message to all that quality and standards matter.</p> <p>I&#8217;ve been running the release candidates and the difference between it and <span class="caps">FF2</span> is dramatic. As much as I love Firefox and use it as my primary browser, it would noticeably slow down over time until it required a restart every 2-4 days. Inconvenient, but now only a memory.</p> <p>With <a href="http://www.getfirefox.com">Firefox 3.0</a>, <a href="http://www.opera.com/">Opera 9.5</a>, and <a href="http://www.apple.com/safari/">Safari 3.1</a> all succeeding, us web developers can now realistically dream of working without legacy constraints in the near future. While generally we&#8217;re still stuck devoting half our time and sanity to necromantic and arcane arts for the purpose of persisting the one undead browser, <a href="http://www.37signals.com/svn/posts/1072-apples-mobileme-drops-support-for-ie-6">there is still hope</a>. It is an ongoing battle but one that <a href="http://b.lesseverything.com/2008/6/5/no-more-internet-explorer-6-support">we will eventually win</a> &#8211; inching closer to the promised land with every switch to one of the above browsers or <a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">upgrade to Internet Explorer 7</a>.</p> <p>Final note: For the web developers out there, get <a href="https://addons.mozilla.org/firefox/addon/1843">Firebug 1.2.0b3</a>. It works great with Firefox 3.</p> Wed, 18 Jun 2008 01:11:00 -0700 urn:uuid:4d62c35f-0272-4319-ba7d-213aba0d676c blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/06/18/new-age-dawns-on-the-web#comments Web future web ie firebug safari opera firefox http://www.undefinedrange.com/trackbacks?article_id=new-age-dawns-on-the-web&day=18&month=06&year=2008 http://www.undefinedrange.com/articles/2008/06/18/new-age-dawns-on-the-web RSpec Tips <p>Since I&#8217;ve been following <a href="http://weblog.jamisbuck.org/2007/1/29/testing-your-views">Jamis Buck&#8217;s advice</a> to limit the brittleness of view tests, development has been much more productive. Test the things that matter most else you&#8217;ll end up with diminishing returns and the week passed by without any productive work done.</p> <p>I&#8217;m taking one step further and I&#8217;ve decided not to write RSpec view specifications.</p> <p>I will still continue to occasionally test important view elements. It just isn&#8217;t worth the extra baggage of writing and maintaining another set of specs for every single view. I&#8217;m feeling the pain there and I&#8217;m taking steps to eliminating it.</p> <p>But it is also painful to sprinkle &#8220;integrate_views&#8221; syntactic vinegar throughout controller specifications. I don&#8217;t want to do without that since I would still get notified of template errors. Unfortunately, this is not the recommended behavior and not much was written on the subject.</p> <p><a href="http://www.marklunds.com/articles/one/367">Peter Marklund</a> has a solution but it didn&#8217;t work for me. Maybe because RSpec was updated since his blog post was written but it is more likely that I&#8217;m missing something obvious. However, I dug around the plugin and was happy to discover a simple method override that worked. Add to spec_helper.rb:</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">module </span><span class="module">Spec</span> <span class="keyword">module </span><span class="module">Rails</span> <span class="keyword">module </span><span class="module">Example</span> <span class="keyword">class </span><span class="class">ControllerExampleGroup</span> <span class="keyword">module </span><span class="module">ControllerInstanceMethods</span> <span class="keyword">def </span><span class="method">integrate_views?</span> <span class="constant">true</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">end</span></code></pre></div> <p>btw, while browsing the RSpec mailing list, I came across a post that explains <a href="http://rubyforge.org/pipermail/rspec-users/2008-March/006509.html">a way to slightly speed up test runs</a>.</p> Tue, 15 Apr 2008 14:53:00 -0700 urn:uuid:d7f8c48b-fb7c-4daf-bebb-6b14e901447d blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/04/15/rspec-tips#comments Ruby on Rails rspec rails tests override http://www.undefinedrange.com/trackbacks?article_id=rspec-tips&day=15&month=04&year=2008 http://www.undefinedrange.com/articles/2008/04/15/rspec-tips Console Gaming in OSX <p><br /></p> <p><img src="http://undefinedrange.com/files/videoglide.jpg" /></p> <p>A year ago, I made the switch from the PC world to <span class="caps">OSX</span> rapture &#8211; specifically a 15 inch MacBook Pro. It greatly improved my workflow but gaming is definitely a weak point. While there are a few <span class="caps">OSX</span> native games that spark my interest, I seriously doubt they&#8217;d run well on a laptop. Also, I was given a friend&#8217;s old Xbox collection that I could put to use.</p> <p>Thus began my quest for a cheap <span class="caps">USB</span> video capture device. The only find was this product called the EasyCAP. Despite all the negative reviews and comments and the fact that it was Windows only (Parallels should take care of that), I went ahead and bought one of them off eBay.</p> <p>It was as all the naysayers said it was: a massive disappointment. To its credit, it did manage to work once, though choppy in both video and sound. Nevertheless, No magic incantations or configuration would revive the usb device afterwards. Instead, the laptop locked hard several times.</p> <p>After all that frustration, salvation was found in <a href="http://www.echofx.com/videoglide.html">VideoGlide</a>, a collection of native <span class="caps">OSX</span> drivers and video capture software. It just works and it worked the first time. That&#8217;s really all that needs to be said about it. It just works.</p> <p><b>Update: July 26, 08</b>: The VideoGlide webpage now lists support for EasyCAP009, EasyCap <span class="caps">DC60</span>+ models. EasyCAP <span class="caps">DC60</span>, however is <span class="caps">NOT</span> supported.</p> <p>Also, thought I should post some of my config in case it might help people setup their video capture.</p> <p>Under &#8220;Record -&gt; Video Settings&#8230;&#8221;, make sure that the correct input is selected and/or choose the auto-detect option.</p> <p><img src="http://www.undefinedrange.com/files/video1.png" /></p> <p><img src="http://www.undefinedrange.com/files/video2.png" /></p> <p>This is what I have under &#8220;Record -&gt; Sound Settings&#8230;&#8221;.</p> <p><img src="http://www.undefinedrange.com/files/sound1.png" /></p> <p><img src="http://www.undefinedrange.com/files/sound2.png" /></p> <p><img src="http://www.undefinedrange.com/files/sound3.png" /></p> <p>Finally, select the right digitizer. &#8220;USB Video Class Video&#8221; is for the built in webcam.</p> <p><img src="http://www.undefinedrange.com/files/digitizers.png" /></p> Sun, 03 Feb 2008 01:03:00 -0800 urn:uuid:54f7f294-7b8e-4b9d-869d-cd169538658a blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/02/03/console-gaming-in-osx#comments Misc. videoglide easycap xbox mbp osx http://www.undefinedrange.com/trackbacks?article_id=console-gaming-in-osx&day=03&month=02&year=2008 http://www.undefinedrange.com/articles/2008/02/03/console-gaming-in-osx Rake task runs both Test::Unit and RSpec tests <p>I&#8217;m in the middle of converting tests from Test::Unit to RSpec in an older Rails project. So far so good although I&#8217;m sure that would change as I dive into more complicated test cases. Still, I&#8217;m hoping the pain is worth it for the multiple contexts and lessened fixture reliance.</p> <p>A nifty feature that I accidentally stumbled upon is that the default rake task would run the test in both test and spec directories. It&#8217;s not like I have to exclusively choose one or the other.</p> <p>That opens up lots of test conversion options. I could convert the tests all at once or a little at a time. Or I could forget about conversion completely and merely write new tests in RSpec.</p> <p>It&#8217;s little surprises like this that brightens up my workday.</p> <p><span class="caps">UPDATE</span> (FEB8,08): RSpec tests won&#8217;t run unless all Test::Unit tests passes.</p> Fri, 18 Jan 2008 19:04:00 -0800 urn:uuid:7abea194-30e6-48ac-a4dd-42f8100a8a87 blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2008/01/18/rake-task-runs-both-test-unit-and-rspec-tests#comments Ruby on Rails rake rails test bdd rspec http://www.undefinedrange.com/trackbacks?article_id=rake-task-runs-both-test-unit-and-rspec-tests&day=18&month=01&year=2008 http://www.undefinedrange.com/articles/2008/01/18/rake-task-runs-both-test-unit-and-rspec-tests Early Christmas Gift: Rails 2.0 Release Imminent <p>Rejoice, for Rails <a href="http://dev.rubyonrails.org/changeset/8321">Changeset 8321</a> indicates today as the day Rails 2.0 will be released.</p> Thu, 06 Dec 2007 13:53:00 -0800 urn:uuid:3dbbf7a0-fe26-4a9f-96b5-4f7c13317ec2 blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2007/12/06/early-christmas-gift-rails-2-0-release-imminent#comments Ruby on Rails http://www.undefinedrange.com/trackbacks?article_id=early-christmas-gift-rails-2-0-release-imminent&day=06&month=12&year=2007 http://www.undefinedrange.com/articles/2007/12/06/early-christmas-gift-rails-2-0-release-imminent Rails String Core Extensions Cheatsheet <p><a href="http://undefinedrange.com/files/strings_cheatsheet.png"><img src="http://undefinedrange.com/files/strings_cheatsheet_thumbnail.png" /></a></p> <p><a href="http://undefinedrange.com/files/strings_cheatsheet.png"><span class="caps">PNG</span></a> <a href="http://undefinedrange.com/files/strings_cheatsheet.pdf"><span class="caps">PDF</span></a></p> <p><br /> <br /> References<br /> <a href ="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Access.html">/CoreExtensions/String/Access.html</a><br /> <a href ="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Conversions.html">/CoreExtensions/String/Conversions.html</a><br /> <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html">/CoreExtensions/String/Inflections.html</a><br /> <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Iterators.html">/CoreExtensions/String/Iterators.html</a><br /> <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/StartsEndsWith.html">/CoreExtensions/String/StartsEndsWith.html</a><br /> <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Unicode.html">/CoreExtensions/String/Unicode.html</a><br /> <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Conversions.html">/CoreExtensions/Time/Conversions.html</a><br /> <a href="http://www.ruby-forum.com/topic/57923">Changing default date format in Rails @ Ruby Forum</a><br /> <a href="http://errtheblog.com/post/44">Rails Rubyisms Advent @ errtheblog.com</p> Mon, 16 Jul 2007 15:43:00 -0700 urn:uuid:3242ac3a-d6a6-4724-ae0a-183838fe02c4 blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2007/07/16/rails-string-core-extensions-cheatsheet#comments Ruby on Rails Portfolio cheatsheet rails string extensions inflections unicode http://www.undefinedrange.com/trackbacks?article_id=rails-string-core-extensions-cheatsheet&day=16&month=07&year=2007 http://www.undefinedrange.com/articles/2007/07/16/rails-string-core-extensions-cheatsheet Revisory Project Reflection <p><a href="http://undefinedrange.com/files/revisory.mov"><img src="http://undefinedrange.com/files/revisory.jpg" /></a></p> <p><a href="http://undefinedrange.com/files/revisory.mov">Demo movie [1MB].</a> Revisory: Summer 2006. <br /></p> <h3>Description</h3> <p>Online discussion space on graphical assets or unpolished concepts through message threads and image manipulation tools. Revisory facilitates non-linear design processes between people in distributed teams to better explore brainstormed ideas.</p> <h3>Development</h3> The primary goal of this project to begin an introductory exploration of various web scripting technologies: <ul> <li>Ruby on Rails</li> <li><span class="caps">HTML5</span> canvas element</li> <li>Prototype and script.aculo.us frameworks</li> <li>Javascript</li> </ul> <p>The initial technical feasibility assessment concluded that the project was not commercially viable. A crucial factor was that the canvas element lacked current and future support by Internet Explorer. However, it was included in the latest version of Firefox, Safari, and Opera at the time. A decision was made to build a simple conceptional tech prototype as a learning experience through a project lifecycle.</p> <p>Athestics is based on the simplicity of a blank canvas. The low key design encourages quick freeform sketches regardless of artistic ability. With its monochrome nature, the site design should fall back into the background and stand in contrast to the color possibilities of the user generated content.</p> <h3>End Results</h3> <p>Some testing was conducted near the end of this experiment. Revisory was utilized in highlighting the various design considerations given to a dynamic <span class="caps">PDF</span> document for review by a client. We found that keeping images updated and in context as per discussion point through appropriate zooming, panning, and highlighting held great value. The web app was relevant when visual communication was desired.</p> <p>One area needing of improvement is in the generalized drawing tools. Most marks were kept simple to merely augment the existing image. Also, tools do not suggest efficient uses. Instead, future iterations should involve testing for more common behaviors to automate before any additional development starts.</p> <hr /> Image used in demo is <a href="http://www.deviantart.com/deviation/214726/">&#8220;More Fun Than Tekken&#8221;</a> by Sevenflow and Kultdesign. Sun, 08 Jul 2007 16:59:00 -0700 urn:uuid:48472c82-2e0e-406a-8dd9-0ebdaba4734b blog@undefinedrange.com (Vincent Woo) http://www.undefinedrange.com/articles/2007/07/08/revisory-project-reflection#comments Ruby on Rails Design Portfolio concepts canvas draw http://www.undefinedrange.com/trackbacks?article_id=revisory-project-reflection&day=08&month=07&year=2007 http://www.undefinedrange.com/articles/2007/07/08/revisory-project-reflection