<?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>undesigned &#187; rails</title>
	<atom:link href="http://www.joelduffin.com/blog/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joelduffin.com/blog</link>
	<description>life is a rum go guv’nor, and that’s the truth</description>
	<lastBuildDate>Wed, 28 Jul 2010 04:12:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compiling bcrypt-ruby gem for Windows</title>
		<link>http://www.joelduffin.com/blog/2009/05/11/compiling-bcrypt-for-windows/</link>
		<comments>http://www.joelduffin.com/blog/2009/05/11/compiling-bcrypt-for-windows/#comments</comments>
		<pubDate>Mon, 11 May 2009 21:40:18 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/?p=287</guid>
		<description><![CDATA[I am a heretic. I develop Rails apps on Windows. I own a Macbook, but I usually boot it into Windows. Justin thinks I should just should just move to developing on a Mac. I keep holding out. But periodically I try to install a gem that needs to compile native extensions for Windows, and [...]]]></description>
			<content:encoded><![CDATA[<p>I am a heretic. I develop Rails apps on Windows. I own a Macbook, but I usually boot it into Windows. <a href="http://justinball.com/">Justin</a> thinks I should just should just move to developing on a Mac. I keep holding out. But periodically I try to install a gem that needs to compile native extensions for Windows, and it fails. This just makes me mad. My latest encounter was with <a href="http://blog.codahale.com/2007/02/28/bcrypt-ruby-secure-password-hashing/">the bcrypt gem</a>. I did some googling and finally found a solution:</p>
<ol>
<li>Dug up my old copy of Visual Studio 6 CDs and installed the command line utilities. Apparently, not just any version will do; you have to be in sync with the version used to compile ruby.</li>
<li>Added VS6&#8217;s bin directories to my Windows path. Default install locations are:<br />
C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;</p>
<p>Alternatively, you can get a command prompt in  C:\Program Files\Microsoft Visual Studio\VC98\Bin and run VCVARS32.BAT to add those directories to your path.</li>
<li>Added some typedefs and a function to C:\Program Files\Microsoft Visual Studio\VC98\Include\SYS\TYPES.H that are not available on Windows:
<pre>#ifndef _UINT_T_DEFINED
typedef unsigned char  u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int   u_int32_t;
typedef unsigned __int64 u_int64_t;
#define _UINT_T_DEFINED
#endif</pre>
<pre>#ifndef snprintf
#define snprintf _snprintf
#endif</pre>
</li>
</ol>
<p>Now I can do:</p>
<pre>gem install bcrypt-ruby</pre>
<p>I get the &#8220;Building native extensions. This could take a while&#8230;&#8221; message and it works!</p>
<p>I&#8217;m happy once again. I&#8217;m satisfied. And I didn&#8217;t even have to change religions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2009/05/11/compiling-bcrypt-for-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multilingual Google search mashup</title>
		<link>http://www.joelduffin.com/blog/2008/04/21/multi-lingual-google-search-mashup/</link>
		<comments>http://www.joelduffin.com/blog/2008/04/21/multi-lingual-google-search-mashup/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 23:08:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[multi-lingual]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/?p=56</guid>
		<description><![CDATA[For sometime I have envisioned a web browser that allows me to search and browse all of the web-pages of the world and view them in English. I figure there have got to be lots of cool things going on in the non-English speaking world that I would be interested in but I never hear [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.joelduffin.com/blog/wp-content/uploads/2008/04/sombrero.jpg"><img class="alignright alignnone size-medium wp-image-57" style="float: right;" title="multi-lingual Kedward" src="http://www.joelduffin.com/blog/wp-content/uploads/2008/04/sombrero.jpg" alt="" width="300" height="225" /></a>For sometime I have envisioned a web browser that allows me to search and browse all of the web-pages of the world and view them in English. I figure there have got to be lots of cool things going on in the non-English speaking world that I would be interested in but I never hear about them because I don&#8217;t speak those languages.</p>
<p>While attending the <a href="http://mtnwestrubyconf.org/">2008 Mountain West Ruby Conference</a> and needing something to hack on I decided to take a crack at the project. I already hacked <a href="http://translate.google.com/translate_t">Google Translate</a> for Send2Wiki so I figured it would be a snap to do for this project. My plan was to take the search text, run it through the translator for each of the languages to search, then pass the translated queries off to the Google search sites for each of the languages and then pass those pages through Google translate to get English versions of the pages. I <a href="http://googlesystem.blogspot.com/2007/05/google-multilingual-search.html">soon found</a> that Google has already done most of the work for me with their <a href="http://translate.google.com/translate_s">cross-language search</a>.</p>
<p>The only thing cross-language search doesn&#8217;t do for me is collate all of the language results into a single results page. You can only search for results in a single targeted language. Anyway, between sessions (a coder has always got to brag about how fast he can work right <img src='http://www.joelduffin.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I threw together a <a href="http://www.toolsforsolving.com/">Multilingual Google Search Mashup</a> that does the job. As I put it together, a couple of things almost immediately stood out:</p>
<ul>
<li><strong>Wikipedia owns the top hit slot for many searches</strong>. Because their pages are essentially equivalent in the different languages, listing that entry for each of the languages isn&#8217;t especially useful.</li>
<li><strong>Interleaving search results is difficult</strong>. Rather than try to figure out an intelligent way to order in real-time the search results from the various languages, I just give the first two from each language and provide a language for getting more. I&#8217;ve got ideas for interleaving results, but none of them are too easy. Notice also that I haven&#8217;t included English in the search, which is probably where the most relevant pages will actually come from.</li>
</ul>
<p>These issues makes me wonder if a different approach would be preferrable. Perhaps Google could annotate search results with relevant pages in different languages. This also makes me think about Google&#8217;s search result ordering. Google search results appear to be determinative (if you execute the same search twice, the same item will show up at the top of the list). While this may be what we have come to expect, my experience with writing <a href="http://www.oerrecommender.org/">OER Recommender</a> makes me believe that it isn&#8217;t necessarily the best or the fairest thing to do. When ranking pages it is often the case that the scores of the top two or even 10 pages are statistically indistinguishable. So why should the one that happens to have a .00000001% higher score always show up first. My approach with was to identify a strata of rankings for those &#8220;highest ranked pages&#8221; that are virtually indistinguishable, I randomize the order. This seems fairer since it is quite natural for users to click on the first item in on a search results page, thus biasing it to become more and more popular.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2008/04/21/multi-lingual-google-search-mashup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RailsConf2007: Your First Day with JRuby on Rails</title>
		<link>http://www.joelduffin.com/blog/2007/05/17/railsconf2007-your-first-day-with-jruby-on-rails/</link>
		<comments>http://www.joelduffin.com/blog/2007/05/17/railsconf2007-your-first-day-with-jruby-on-rails/#comments</comments>
		<pubDate>Thu, 17 May 2007 17:58:23 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[railsconf2007]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/?p=7</guid>
		<description><![CDATA[RailsConf2007. We ran in circles last night trying to find a restaurant that had been recommended to us and ended up eating at Wendy&#8217;s. Yum   Apparently the double tree didn&#8217;t have our reservations. Gratefully they gave us a room anyway.
I&#8217;m here at the First Day with JRuby on Rails tutorial with Charlie Nutter [...]]]></description>
			<content:encoded><![CDATA[<p>RailsConf2007. We ran in circles last night trying to find a restaurant that had been recommended to us and ended up eating at Wendy&#8217;s. Yum <img src='http://www.joelduffin.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Apparently the double tree didn&#8217;t have our reservations. Gratefully they gave us a room anyway.</p>
<p>I&#8217;m here at the <a href="http://conferences.oreillynet.com/cs/rails2007/view/e_sess/12190">First Day with JRuby on Rails</a> tutorial with Charlie Nutter and Tom Enebo. We ate lunch with them at the Oasis at the Mtn West Ruby Conference in SLC. Cool guys.</p>
<p>I just downloaded JRuby. This tutorial is supposed to get me started with JRuby.</p>
<p>To get going we include the Java library and then fire away.</p>
<p><strong>First problem</strong>. This is a new laptop and while I have Eclipse loaded on it, I didn&#8217;t have a JDK installed. Ok, here goes trying to download 53 MB of JDK across the conference&#8217;s wireless. Trent predicted that the wireless would be brought down within the first 30 minutes of the conference. I guess I&#8217;m contributing to this eventuality. We will see.</p>
<p>Topics Charlie and Tom covered:</p>
<ul>
<li>Installing JRub</li>
<li>Why JRuby?</li>
<li>Unicode support</li>
<li>Threads</li>
</ul>
<p>I&#8217;m still back on installing Ruby thanks to no JDK installed. Even if I had that, they spent all of about 10 seconds on Installing Ruby. Hopefully they will come back to that topic later and I will have the JDK downloaded.</p>
<p>They are spending a lot of time talking about threads. They motivate the topic by saying &#8220;have you ever wanted to launch a long running process from ruby?&#8221; Actually yes, I have and I do. For Ozmozr and OCWFinder we run various daemons to harvest RSS and work on the database. When we first started looking at this I spent some time looking at the various open source tools available for doing RSS on Python, Ruby, and Java. I benchmarked a number of them on all three platforms. Java won hands down by about a factor of 3. I&#8217;m sure it wasn&#8217;t super scientific, but it was enough to convince me insomuch that I&#8217;ve been developing Java for about 5 years. Anyway, we wrote our daemons and harvesters in Java and it seems to be a great combination of Java and Rails (our apps are written in Rails) to solve the problems we need to.</p>
<p>9:02 JDK download is 23% complete</p>
<p>Class path. Instead of having to list full class paths you can just throw the jar files in the directory:</p>
<p>~/work/jruby/lib</p>
<p>Charlie claims that classpath is one of the most painful things about getting things up and running in Java. Funny how many times I&#8217;ve run into that. The fact that you can&#8217;t tell java to load all of the jar files in a directory is truly amusing and unexpected.</p>
<p>9:12 JDK download is 49% complete</p>
<p>Charlie mentioned that implementing migration support for JDBC was a bit challenging and required DB specific code.</p>
<p>Charlie points out that Java start up time is abysmal. This can be a problem if you are running lots of command line rails scripts. To solve this problem they are looking at running a Java server that you send requests to so that you don&#8217;t have to start up Java every time you want to run a script.</p>
<p>9:23 JDK download is 92% complete. My connection keeps flaking out. Please don&#8217;t die, please don&#8217;t die.</p>
<p><strong>Set up and Deployment</strong>. Is the single aspect of Rails development right now.</p>
<p>9:25 Finished JDK download. Wahoo!</p>
<p><strong>GoldSpike!</strong> A Rails plugin for building WAR files. A WAR file is a single file containing all of a libraries and dependencies for a web application.</p>
<p>They love GlassFlish (Sun&#8217;s application server). glassfish.dev.java.net. Swell. I&#8217;ll have to tell trent about this.</p>
<p>Mephisto is a web publishing system that contains blogging and simple CMS support. I will have to check it out.</p>
<p><strong>Glitches.</strong> I had to define JRUBY_HOME to point to the root of the installed JRUBY and then add the JRUBY_HOME\bin to my path. Tom says I shouldn&#8217;t have to define JRUBY_HOME. Anyway I get all of this set up and go to my favorite rails app (OCWFinder) and try jruby script/server. Output:</p>
<p>Cannot find gem for Rails ~&gt;1.2.3.0:<br />
Install the missing gem with &#8216;gem install -v=1.2.3 rails&#8217;, or<br />
change environment.rb to define RAILS_GEM_VERSION with your desired version.</p>
<p>Hmmm&#8230;.</p>
<p>K, Duhh. Charlie helped  me realize that I just needed to follow the slides that we blew through quickly at the beginning of the session. I needed to install rails from within JRuby:</p>
<p>jruby -S gem install rails</p>
<p>Ok, now I&#8217;m starting to see the same error messages that I&#8217;ve seen before when I didn&#8217;t have my postgres driver set up correctly. I&#8217;ll continue to follow up when I get back from lunch.</p>
<p>I posted my problem to #railsconf and got no help. I asked if anyone has gotten a railsapp under jruby and one person came forward but then said that it was a while ago.</p>
<p>I&#8217;ve seen stuff like this before, but am scratching my head on where to go right now.</p>
<p>NetBeans. Supposedly the best Java IDE available. Now has Ruby support.</p>
<p>Someone is snoring really loudly. How rude <img src='http://www.joelduffin.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>NetBeans provides for ruby: code completion, jump to declaration, and refactoring support. All things I&#8217;ve come to expect from using Eclipse. I wonder when they will be implemented there.</p>
<p>Someone from freenode has come onto #railsconf asking for an official contact from the conference. I guess everyone is connecting on the same IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2007/05/17/railsconf2007-your-first-day-with-jruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
