<?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; web development</title>
	<atom:link href="http://www.joelduffin.com/blog/category/web-development/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>Moved to slicehost</title>
		<link>http://www.joelduffin.com/blog/2008/04/21/moved-to-slicehost/</link>
		<comments>http://www.joelduffin.com/blog/2008/04/21/moved-to-slicehost/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 16:37:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[folksemantic]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/?p=53</guid>
		<description><![CDATA[I recently moved from hostgator to slicehost. I signed up with hostgator because it seemed to be a cheap place ($10/mo) to play with rails. It turns out that hostgator doesn&#8217;t really do rails (they offer it via cgi, not even fastcgi). They didn&#8217;t allow me to install things like the Send2Wiki perl module or [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved from hostgator to slicehost. I signed up with hostgator because it seemed to be a cheap place ($10/mo) to play with rails. It turns out that <a href="http://www.hostgator.com/">hostgator doesn&#8217;t really do rails</a> (they offer it via cgi, not even fastcgi). They didn&#8217;t allow me to install things like the <a href="http://www.mediawiki.org/wiki/Extension:Send2Wiki">Send2Wiki</a> perl module or give me access to execute scripts from PHP either.</p>
<p>With <a href="http://www.slicehost.com/">slicehost I get a VPS for $20 / mo</a>. I&#8217;ve never used a VPS before but have run my own web servers, so it seems worth a shot. In the process of getting it set up I&#8217;ve learned more about DNS, iptables, fastcgi, etc than before, so that is fun, but also a time drain. Anyway, now I&#8217;ve got the access I need to set up Send2Wiki and run rails apps.</p>
<p>After hearing <a href="http://www.justinball.com/2008/03/06/social-wordpress/">Justin rave about WPMU</a>, I thought I would give it a shot. WP normally installs easy, so I expected the same. It would have except I wanted to install WPMU in a subdirectory. My Googling gave warnings against doing so, but I shrugged them off and forged ahead and tried to hack it to get it to work. Bad idea. It may be possible to do, and I got it to almost work, but certainly it doesn&#8217;t fall within the scope of famous 5 minutes install. So I&#8217;ve backed off and returned to the single user version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2008/04/21/moved-to-slicehost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lucene and Multi-Lingual Updates to OER Recommender</title>
		<link>http://www.joelduffin.com/blog/2008/04/03/lucene-and-multi-lingual-updates-to-oer-recommender/</link>
		<comments>http://www.joelduffin.com/blog/2008/04/03/lucene-and-multi-lingual-updates-to-oer-recommender/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 14:16:23 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[folksemantic]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[multi-lingual]]></category>
		<category><![CDATA[recommender]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/2008/04/03/lucene-and-multi-lingual-updates-to-oer-recommender/</guid>
		<description><![CDATA[Last week I posted an update to OER Recommender. The source for the project is posted in Google code projects: oerrecommender, recommenderd, and aggregatord. The biggest change was moving OER Recommender from my home-brewed indexing and recommendation engine to using the super fast, super easy, open source search engine Lucene. I made the move because [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted an update to <a href="http://www.oerrecommender.org/">OER Recommender</a>. The source for the project is posted in Google code projects: <a href="http://code.google.com/p/oerrecommender/">oerrecommender</a>, <a href="http://code.google.com/p/recommenderd/">recommenderd</a>, and <a href="http://code.google.com/p/aggregatord/">aggregatord</a>. The biggest change was moving OER Recommender from my home-brewed indexing and recommendation engine to using the <a href="http://lucene.apache.org/">super fast, super easy, open source search engine Lucene</a>. I made the move because I had heard many good things about Lucene and wanted to explore using it. In addition, Lucene supports multiple languages nicely. Because the OER Recommender web app is in written in Rails, I used the <a href="http://wiki.rubyonrails.org/rails/pages/Acts+as+Solr+Plugin">acts_as_solr</a> plugin which depends on <a href="http://lucene.apache.org/solr/">Solr</a>, another Apache project which provides easy integration with Web applications. Here is a list of the changes I made:</p>
<ul>
<li><strong>Added Collections</strong>. The index now contains more than 90,000 records from <a href="http://www.oerrecommender.org/collections">over 100 collections and 26 languages</a>.</li>
<li><strong>Added Support for Harvesting via SQI/WSDL</strong>. Support for harvesting SQI/WSDL using <a href="http://ws.apache.org/axis/">Axis</a> was added in order to harvest <a href="http://www.merlot.org/">MERLOT</a> via <a href="http://ariadne.cs.kuleuven.be/SqiInterop/free/SQIImplementationsRegistry.jsp#Merlot">Araidne</a>.</li>
<li><strong>Catalog Links</strong>. When providing recommendations if we have catalog links and direct links for resouces such as in the case of <a href="http://www.oercommons.org/">OER Commons</a> and <a href="http://www.merlot.org/">MERLOT</a> both are provided.</li>
<li><strong>OAI Set Discovery</strong> &#8211; In order to get the names of collections from OER Commons the ability to discover the OAI Sets (collections) was added to the harvester.</li>
<li><strong>Lucene</strong>. The home brewed search and recommendation system was swapped out with Lucene. This makes for faster and better searching as well as faster indexing. The full range of <a href="http://lucene.apache.org/java/docs/queryparsersyntax.html">query syntax supported by Lucene</a> is now supported.</li>
<li><strong>Multi-Lingual</strong>. With Lucene in place OER Recommender can now support language-specific search and recommendation.</li>
<li><strong>Additional Metadata</strong>. Additional metadata was added to search and recommendation results: Descriptions, Authors, Date (metadata), Date (relevance was calculated).</li>
<li><strong>Home Page Cleanup</strong>. The home page was simplified by moving the <a href="http://www.oerrecommender.org/help/demo.html">Greasemonkey script and example resources</a> and to a separate page.</li>
<li><strong>Search Results</strong>. Search results were modified to look similar to Google search results. In cases where the index contains both links to catalog pages and direct links for a resource, a Metadata link next to the title takes you to the catalog page. A &#8220;Related Resources&#8221; link is also provided next to each item in search results. This makes it easy to see recommendations.</li>
<li><strong>More Recommendations Page</strong>. The geek friendly page was replaced with a page that looks essentially like the search results page. A link to the original page containing details such as is included near the top of the page.</li>
<li><strong>Incremental Updates Support</strong>. The recommender was modified to support incrementally updating the indexes and recommendations without losing user data. It now runs every night, harvesting the collections, indexing and creating recommendations for new records. Once a week it re-runs all recommendations so that recommendations could be created that point at new records.</li>
<li><strong>Time on Page</strong>. Average time on page tracking was added and used to adapt the recommendations algorithm.</li>
<li><strong>Localized Interface</strong>. The main web pages were translated into Spanish, French, German, Japanese, Dutch, Russian, and Chinese using <a href="http://www.google.com/translate_t">Google Translate</a> (if you speak one of those languages and want to help the translation, feel free to send me fixes). Localization is supported via the <a href="http://simple-localization.arkanis.de/">swell Simple Localization rails plugin</a>. The web app also auto-detects the language set in your web browser and sets that as the default search interface.</li>
</ul>
<p>More on implementation later&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2008/04/03/lucene-and-multi-lingual-updates-to-oer-recommender/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging browser incompatibilities</title>
		<link>http://www.joelduffin.com/blog/2007/12/13/debugging-browser-incompatibilities/</link>
		<comments>http://www.joelduffin.com/blog/2007/12/13/debugging-browser-incompatibilities/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 15:27:29 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[interactive online math]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[nlvm]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/2007/12/13/debugging-browser-incompatibilities/</guid>
		<description><![CDATA[Every time we update the NLVM website like we did a few weeks ago we receive email from people that are no longer able to access the applets. Often times the causes are somewhat mysterious. Some of the problems are caused by proxy and browser caching; some of the updated files arrive at peoples&#8217; browsers [...]]]></description>
			<content:encoded><![CDATA[<p>Every time we update the <a href="http://nlvm.usu.edu/">NLVM</a> website like we did a few weeks ago we receive email from people that are no longer able to access the applets. Often times the causes are somewhat mysterious. Some of the problems are caused by proxy and browser caching; some of the updated files arrive at peoples&#8217; browsers and others do not. After a few days the problems seem to work themselves out.</p>
<p>Other times problems occur because we broke something <img src='http://www.joelduffin.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  and we didn&#8217;t catch it in our testing. This is aggravated by browser incompatibilities. Because old hardware and software tend to hang around schools longer than other places, strange things show up. Right now I&#8217;m trying to track down some of those types of issues.</p>
<p>A few years ago when I was more actively developing the NLVM I used to keep old machines around so I could test old browsers. One of the reasons multiple machines were needed was that I couldn&#8217;t find an easy way to run multiple versions of Internet Explorer on the same machine. Yesterday I googled to see if there is anything new out there to help with this issue. I was pleasantly surprised to find a utility by tredosoft that allows you to <a href="http://tredosoft.com/Multiple_IE">install multiple versions of IE on your PC</a>. Thanks tredosoft! Unfortunately after installing the multiple browsers, I&#8217;m still not able to see the reported problem even when running on the same browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2007/12/13/debugging-browser-incompatibilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OER Recommender Released</title>
		<link>http://www.joelduffin.com/blog/2007/08/23/oer-recommender-released/</link>
		<comments>http://www.joelduffin.com/blog/2007/08/23/oer-recommender-released/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 04:15:06 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[information retrieval]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[folksemantic]]></category>
		<category><![CDATA[nsdl]]></category>
		<category><![CDATA[recommender]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/?p=12</guid>
		<description><![CDATA[Here is the updated OER Recommender White Paper.
Yesterday we released the OER Recommender system that I have worked on.  There are still many things that could be added or tweaked, but it does something useful already so out the door it goes! I&#8217;m concerned that we are calling it a recommender as the &#8220;recommendations&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the updated <a title="OER Recommender White Paper" href="http://www.joelduffin.com/blog/wp-content/uploads/2008/01/recommender.pdf">OER Recommender White Paper</a>.</p>
<p>Yesterday we <a href="http://opencontent.org/blog/archives/367">released</a> the <a href="http://www.oerrecommender.org/">OER Recommender</a> system that I have worked on<a href="http://opencontent.org/blog/archives/367"></a>.  There are still many things that could be added or tweaked, but it does something useful already so out the door it goes! I&#8217;m concerned that we are calling it a <a href="http://en.wikipedia.org/wiki/Recommendation_system">recommender</a> as the &#8220;recommendations&#8221; it currently provides are not specific to a user, they are related resources generated via a content-based approach. The proposal and plans are to make it a recommender based on user profiles. See <a href="http://www.joelduffin.com/blog/2007/05/09/implementing-a-recommender-system/">my previous post</a> for details about where it is intended to go.</p>
<p><strong>The Problem</strong>. The <a href="http://www.hewlett.org/" target="_blank">William and Flora Hewlett Foundation</a>, the <a href="http://nsdl.org/">National Science Digital Library</a>, and other large organizations have made large investments in the development of electronic resources that can be used for teaching, learning, and research. They are keen on finding ways to increase the impact of their investment. One way to do that is to create tools that make it easier for poeple to find resources that are useful to them. One approach to solving this problem are search and browsing tools that help people find good resources such as NSDL, <a href="http://www.ocwfinder.org/">OCW Finder</a>, and of course Google. Recommender systems approach the problem by helping bringing resources to peoples&#8217; attention without having them to go look for them specifically Google&#8217;s Adsense technology and Amazon&#8217;s recommendations are two of the most common examples. Some of the challenges with general search tools such as Google and even more focused ones such as NSDL&#8217;s main search is that they cast too wide a net and you get back resources do not match. On the other hand, while most collections of open courseware and digital libraries provide search, it is nice to be able to search across repositories at the same time to find the best resources wherever they reside.</p>
<p><strong>The Vision</strong>. In creating the OER Recommender we set out to create a service that would help people find relevant open education resources. The first step in this was to create an automated process for clustering related resources. The hope is that presenting links to related resources to users when looking at a resource could help people stumble upon resources that are relevant to them even though they might have not been actively looking for them. We could tune this service by monitoring what resources people visit, share, rate, tag, and otherwise pay attention to. We could use this attention metadata to create profiles of what people&#8217;s interest are. The profiles could be used to push recommendations to people even when they are not browsing perhaps via email or other means.</p>
<p><strong>Exploration</strong>. Since learning about it I have felt that the recommender would be one of the more interesting <a href="http://www.folksemantic.org/">folksemantic</a> tools to work on since I initially thought to pursue a <a href="http://en.wikipedia.org/wiki/Latent_semantic_analysis">latent semantic analysis</a> approach. I had heard about LSA from my exposure to <a href="http://sitcogblog.blogspot.com/">Andy Walker&#8217;s</a> and <a href="http://home.autotutor.org/graesser/">Art Graesser&#8217;s</a> work. I have also had a number of interesting discussions about clustering with <a href="http://http://www.math.usu.edu/~adele/home.htm">Adele Cutler</a> about her work on <a href="http://www.math.usu.edu/~adele/forests/index.htm">Random Forests</a>. I got a hold of the <span class="sans"><a href="http://www.amazon.com/Handbook-Semantic-University-Institute-Cognitive/dp/0805854185">Handbook of Latent Semantic Analysis</a> and explored the <a href="http://del.icio.us/jduffin/lsa">LSA online resources I could find</a> as well as the <a href="http://cran.r-project.org/src/contrib/Descriptions/lsa.html">lsa module for R</a></span>. After spending significant time reading and playing I came to the conclusion that it would likely more complex to implement and computationally expensive than I wanted. I also concluded that everything that I would need to do to implement a standard <a href="http://en.wikipedia.org/wiki/Vector_space_model">Term Vector Model</a> approach could be used to later implement an LSA approach. During my exploration, I came across a number of <a href="http://del.icio.us/jduffin/recommender">useful online resources</a> and books including <a href="http://www.cs.cornell.edu/Info/Department/Annual95/Faculty/Salton.html">Gerard Salton&#8217;s</a> work.</p>
<p><strong>An Explanation for My Mother</strong>. I&#8217;ve already been asked by <a href="http://shelleylyn.blogspot.com/">Shelly</a> to explain the implementation of the recommender in language that my mother would understand, so I&#8217;ll give that explanation first. We use the folksemantic feed harvester to gather information (metadata) about OERs into databases. For each pair of resources that are related enough, the recommender uses the titles, description, and tags to calculate a score indicating how related they are. Recommended resources are the ones scored to be the most similar. The similarity of two resources is based on an automated analysis of the words in their metadata. Got that Mom?</p>
<p>We use four phases to arrive at recommendations: (1) parse metadata, (2) calculate local term weights, (3) calculate global term weights, (4) calculate similarity scores.</p>
<p><strong>Parse Metadata</strong>. Using a string tokenizer we break metadata text into terms. We throw away stop words (common words such as &#8216;and&#8217;, &#8216;is&#8217;, &#8216;of&#8217; that do not add meaning). Next we convert terms into their stems using a <a href="http://www.tartarus.org/~martin/PorterStemmer">common algorithm</a>; for example &#8216;running&#8217;, &#8216;ran&#8217;, and &#8216;runs&#8217; all get collapsed into &#8216;run&#8217;.</p>
<p><strong>Calculate Local Term Weights</strong>. A local term weight is a measure of how important a word is for describing a document. The more frequently a word appears in a document, the more important it is&#8230; up to a point. Of course, where a word appears in a document is probably a good indicator of how important the word is as well. For example if a word appears in a title, it is probably more important than if it appears in the body. One more important factor to consider is document length (total number of terms in the document); all other things being equal, the longer a document is, the more times a term will appear in it. So we normalize term frequencies using the document length. One last issue relates to filler words.</p>
<p>To calculate local term weights OER Recommender uses a function that looks like this.</p>
<p><a title="Global Term Weights Function" href="http://www.joelduffin.com/blog/wp-content/uploads/2007/08/gtw.jpg"><img src="http://www.joelduffin.com/blog/wp-content/uploads/2007/08/gtw.jpg" alt="Global Term Weights Function" /></a></p>
<p>The x-axis represents term frequency and the y-axis represents the local term weight. As you can see, the more time a term appears in a document, the more weight it is given. However after reaching a threshold, it plateaus. I think this is especially important in situations where document creators might be trying to game the system. The formula used is:</p>
<p><em>ltw<sub>i</sub> = 1 / (1 + (e<sup>(.0044)dlen</sup>) .7<sup>(fti &#8211; 1)</sup>)</em></p>
<p><em>ltw<sub>i</sub></em> is the local term weight for a given term in a document.</p>
<p><em>dlen</em> is the total number of terms in the document.</p>
<p><em>ft</em><em><sub>i</sub></em> is the number of times a given term appears in a document.</p>
<p>Note that the constants .0044 and .7 in the equation determine the shape of the curve. I chose those values based on their use in the <a href="http://lhncbc.nlm.nih.gov/lhc/docs/published/2001/pub2001045.pdf">MeSH system</a>. As explained there, the values should be tuned to your data set using an empirical approach. I played with the parameters some and the values they used seemed fine, so I adopted them.</p>
<p><strong>Calculate Global Term Weights</strong>. Global term weights are a measure of how important a word is for distinguishing documents within a collection. The more documents a word appears in, the less value it has for characterizing documents. For example, the term &#8216;USU&#8217; appears in every metadata record for resources in USU&#8217;s OpenCourseware. As a result, it has no value for characterizing clustering resources. The term &#8216;USU&#8217; becomes in a sense, a stop word, similar to those thrown away during the parse phase. To calculate the global term weight for a term, the number of documents that it appears in are counted as well as the total number of documents.</p>
<p>To calculate global term weights OER Recommender uses a function that looks like.</p>
<p><a title="Local Term Weights Function" href="http://www.joelduffin.com/blog/wp-content/uploads/2007/08/ltw.jpg"><img src="http://www.joelduffin.com/blog/wp-content/uploads/2007/08/ltw.jpg" alt="Local Term Weights Function" /></a></p>
<p>The x-axis represents the number of documents that a term appears in. The y-axis represents the global weight assigned to the term. The formula used is:</p>
<p><em>gtw<sub>i</sub> = log (D/df<sub>i</sub>) </em></p>
<p><em>gtw<sub>i</sub></em> is the global term weight for term.</p>
<p><em>D</em> is the total number of documents.</p>
<p><em>df<sub>i</sub></em> is the number of documents that the term appears in.</p>
<p>See <a href="http://www.miislita.com/term-vector/term-vector-1.html">Mi lslita&#8217;s explanation of Term Vector Theory</a> for details.</p>
<p><strong>Calculate Similarity Scores</strong>. Once local term weights and global term weights are calculated, we are ready to create recommendations. To create recommendations for a document we first find all documents that have any of the same terms in it. It turns out that this can be a very large number of documents (e.g. 40,000 in our system).  For each pairing of the document being considered and a document with matching terms we calculate a similarity score. Because calculating 40,000 scores can take a long time (about 15 seconds in our current system), we shorten the list to consider to 200. We do this by sorting the pairs according to the number of overlapping terms. To calculate the similarity score for a pair of documents, we sum over all of the terms that they share in common. The contribution from each term is a combination of the local term weight in the first document, the local term weight in the second document and the global term weight. Because in OER recommender, each feed can be considered a separate collection, we calculate global term weights for each of the feeds and use them in calculating the similarity score.</p>
<p>To calculate the contribution of an individual term to the similarity score, OER Recommender uses:</p>
<p><em>sst<sub>i</sub> = (gtw<sub>1i</sub>)(ltw<sub>1i</sub>)</em><em>(gtw<sub>2i</sub>)</em><em>(ltw<sub>2i</sub>)</em></p>
<p><em>sst<sub>i</sub></em> Is the contribution to the similarity score for a given term.</p>
<p><em>gtw<sub>1i</sub></em> is the global term weight from the feed that the first document is in.</p>
<p><em>ltw<sub>1i</sub></em> is the local term weight from the first document.</p>
<p><em>gtw<sub>2i</sub></em> is the global term weight from the feed that the second document is in.</p>
<p><em>ltw<sub>2i</sub></em> is the local term weight from the second document.</p>
<p>See <a href="http://www.ncbi.nlm.nih.gov/entrez/query/static/computation.html">NCBI&#8217;s explanation of how MeSH calculates Related Articles</a> for details. Once OER Recommender has calculated similarity scores for the 200 documents, it sorts the documents by those scores and stores the top 10 in a database.</p>
<p><strong>Displaying Recommendations</strong>. Now that the recommendations are stored in a database, displaying them to the user is straightforward. We have created a <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasmonkey script</a> that requests recommendations for each web page that a user browses. If OER Recommender returns any, the script inserts HTML for the recommendations into the web page. The eduCommons team is building a plone tool so that anyone running eduCommons can turn on recommendations. That way users won&#8217;t have to have install the Greasemonkey script in order to see recommendations on the eduCommons website. The OER Recommender site publishes the XML format it returns so others could add recommendations into their websites.</p>
<p><strong>Getting Resources into the Recommender</strong>. Currently OER Recommender only provides recommendations for URLs that it has metadata for, so in order to get recommendations, you need to register a metadata feed. If you have an OCW site that provides an RSS feed, you can do that at <a href="http://www.ocwfinder.org/">OCW Finder</a>. If you have an OAI feed or an RSS feed for learning objects or other OERs, you can add your metadata by sending a feed title, URL, and display URL (home page of the repository) to oerrecommender AT cosl DOT usu DOT edu.</p>
<p><strong>Future Directions</strong>. There are many things left to be done: (1) adapt recommendations by monitoring which recommended resources people click on and how long they stay at recommended resources, (2) provide links to more recommendations (so users can see more than the default 5), (3) provide a way for people to indicate when a recommendation doesn&#8217;t work, (4) provide a way for people to register and login, so they can receive personalized recommendations (perhaps via email), (5) create a process whereby recommendations can be updated without going through all the documents in the database, (6) add functionality for retrieving recommendations for arbitrary web pages (recommending on demand) perhaps via a bookmarklet, (7) create whatever Greasemonkey-like add on is supported on IE. We also plan to integrate the recommender with the aggregator and feed reader to provide recommended news items based on the attention people have previously paid to news articles.</p>
<p>Wow! I realize that this is a long post, but it is not a simple topic. Hopefully the explanation is useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2007/08/23/oer-recommender-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scaling Rails (Debugging Ozmozr)</title>
		<link>http://www.joelduffin.com/blog/2007/08/23/scaling-rails-debugging-ozmozr/</link>
		<comments>http://www.joelduffin.com/blog/2007/08/23/scaling-rails-debugging-ozmozr/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 22:28:02 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[aggregator]]></category>
		<category><![CDATA[cosl]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/?p=11</guid>
		<description><![CDATA[Justin and I have been debating whether or not we really believe that Rails can scale. As we talked about this issue, we realized that ozmozr is probably a good test case. We stopped working on ozmozr months ago, realizing that it needed additional work. We needed to move on to other projects we had [...]]]></description>
			<content:encoded><![CDATA[<p>Justin and I have been debating whether or not we really believe that Rails can scale. As we talked about this issue, we realized that <a href="http://www.ozmozr.com/">ozmozr</a> is probably a good test case. We stopped working on ozmozr months ago, realizing that it needed additional work. We needed to move on to other projects we had committed to. Over time, ozmozr&#8217;s up time has been less and less. I suspected that the problem was in the ugly queries that we were throwing its way. Well, today I checked and here is what I found. It turns out that so far our problems have nothing to do with Rails, rather they have to do with the amount of data we are working over, poorly designed queries, and Java daemon processes that are stealing all of the CPU.</p>
<p><strong>The database</strong>. I&#8217;ve checked the database and found that we have nearly 2 million rss entries and about 350 thousand unique tags. We&#8217;ve indexed the entries so that we can access recent ones quickly. We haven&#8217;t indexed the entries for fast searching by tag.</p>
<p><strong>Search was dog slow</strong>. Ozmozr&#8217;s search which is visible from most pages, takes entered terms and treats them as tags with which to search entries. Joining through the massive tag table to the even more massive entries table was taking forever (on the order of 45-60 seconds per query). We temporarily disabled entry searching until I poked around and found that we hadn&#8217;t created an index on tag names. Just putting an index on tag names reduced the query time to around 8 seconds. Much shorter, but still too long. So I reduced the complexity of the query. It may not be as powerful as it used to be, but now executes in under two seconds.</p>
<p><strong>Aggregator&#8217;s 20 Java threads talking to postgres was stealing the CPU</strong>. We use a Java aggregator daemon that I wrote to harvest RSS feeds. We haven&#8217;t harvested in a while because of the problems we have experienced. When I fired it up today I found that it brought the site to its knees when it started doing its work. By monitoring the CPU I saw that the aggregator daemon was stealing all of the CPU leaving none for Rails to use to serve pages. By default the aggregator checks feeds every hour. When doing this it can use up to 20 threads. Each thread creates a connection to postgres. It was actually postgres that was stealing all of the CPU, but only because of how the Java daemon was talking to it. My quick fix is to limit the aggregator to 1 thread. I initially designed the aggregator to use many threads because it turns out that most of the time spent in harvesting is used up in waiting for web servers to respond. I guess I need to figure out another approach. I&#8217;m going to look to see if we can throttle how much CPU the Java threads (and corresponding Postgres processes) use.</p>
<p><strong>Shrinking tag clouds are a fun idea but a pig to implement</strong>. Similar to how <a href="http://www.ocwfinder.org/">OCW Finder</a> allows you to filter your browsing by selecting tags, we initially implemented the same idea in oz via a shrinking tag cloud. The idea was that as soon as you clicked on a tag in a cloud, in addition to the items being filtered, the tags in the resulting tag cloud would be filtered as well (shrinking the cloud). It turns out that this kind of query is horrendously expensive, at least the way we implemented it. It also turns out that users don&#8217;t seem to understand what is going on. As a result of this, we ripped the shrinking tag clouds out&#8230; almost. I just found an instance where it was left in. They are gone now.</p>
<p>There are more ugly queries to look at but I&#8217;ve gotten most queries down to under 4 seconds, which is still a long time, but at least the website doesn&#8217;t die. I&#8217;ll write more as I find it out.</p>
<p>As a note, the way I was able to easily identify the nasty queries was by going into the postgres config file (var/lib/pgsql/data/postgresql.conf) and setting the option log_min_duration_statement = 3000 (milliseconds). With this option set, every query that takes longer than three seconds is written to the postgres log file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2007/08/23/scaling-rails-debugging-ozmozr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D-Lib Math Tools DL article</title>
		<link>http://www.joelduffin.com/blog/2004/03/01/d-lib-math-tools-dl-article/</link>
		<comments>http://www.joelduffin.com/blog/2004/03/01/d-lib-math-tools-dl-article/#comments</comments>
		<pubDate>Mon, 01 Mar 2004 21:20:52 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[authoring tools]]></category>
		<category><![CDATA[interactive online math]]></category>
		<category><![CDATA[math education]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[enlvm]]></category>

		<guid isPermaLink="false">http://www.joelduffin.com/blog/2004/03/01/d-lib-math-tools-dl-article/</guid>
		<description><![CDATA[I just read an article by SRI researchers that reports on a user study of the Math Tools DL. As one of the participants in the study I was interested to see what they had to say. The basic structure of the report was to: (a) summarize the results, (b) propose representative personas, and (c) [...]]]></description>
			<content:encoded><![CDATA[<p>I just read <a href="http://web.archive.org/web/20041101193359/http://www.dlib.org/dlib/february04/shechtman/02shechtman.html">an article</a> by SRI researchers that reports on a user study of the <a href="http://www.mathforum.org/mathtools/">Math Tools DL</a>. As one of the participants in the study I was interested to see what they had to say. The basic structure of the report was to: (a) summarize the results, (b) propose representative personas, and (c) propose a metaphor and a set of design principles.One thing that was not really touched on that I hope MTDL can become is a place for people to <strong>DO</strong> stuff, not just find and talk about stuff. I&#8217;m working on a proposal for adding functionality to MTDL for using TADRIOLA to adapt existing lessons, activities, and mathlets and then sharing the derived works.</p>
<p><a name="more" href="http://web.archive.org/web/20041101193359/http://www.reusability.org/blogs/joel/archives/000478.html"></a><strong>Summary</strong></p>
<ul>
<li><em>Searching and Publishing</em> &#8211; People come to the MTDL to find and share resources</li>
<li><em>Overcoming Isolation</em> &#8211; People come to the MTDL to help overcome isolation</li>
<li><em>Discuss Development</em> &#8211; Talk with others about the development of math software</li>
</ul>
<p><strong>Personas</strong></p>
<ul>
<li>Teacher Developer</li>
<li>Professional Developer</li>
<li>Educational Researcher</li>
<li>Inexperienced Developer</li>
<li>Hobbyist Developer</li>
</ul>
<p><strong>Metaphor and Principles</strong></p>
<ul>
<li>Workshop metaphor</li>
<li>Design for multiple roles</li>
<li>Design for multiple levels of expertise</li>
<li>Provide activity indicators</li>
</ul>
<p>I like the workshop metaphor, though I think that perhaps there are better. I can&#8217;t really discern the implication of designing for different roles and different levels of expertise. I lilke the idea of activity indicators. I realize that this is an area of recent interest throughout the field.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joelduffin.com/blog/2004/03/01/d-lib-math-tools-dl-article/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
