<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>Break through the darkness</title>
    <description></description>
    <link>http://gene.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>IIS problem fix notes</title>
        <author>Gene</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://gene.javaeye.com">Gene</a>&nbsp;
          链接：<a href="http://gene.javaeye.com/blog/39560" style="color:red;">http://gene.javaeye.com/blog/39560</a>&nbsp;
          发表时间: 2006年12月18日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <div class="CommentText3">Max, look in your machine.config file under the processModel element. Ensure that its username is set to &quot;machine&quot; and the password is set to &quot;AutoGenerate&quot; as this means that it is set up with the defaults. <br />
<br />
If you've done that, and it's still not working, try running aspnet_regiis.exe from the 1.1 framework directory and restarting IIS. This should sync up the ASPNET password. <br />
<br />
If it still doesn't work, you maybe modified the default permissions for the ASPNET account, so look at this KB article for info on the perms it needs: <br />
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q317012#4" target="_new">http://support.microsoft.com/default.aspx?scid=kb;en-us;Q317012#4</a> <br />
<br />
If you're on a domain controller, look at this article: <br />
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;315158" target="_new">http://support.microsoft.com/default.aspx?scid=kb;en-us;315158</a> <br />
<br />
If you're still stuck, try asking in the ASP.NET Forums (<a href="http://www.asp.net/Forums" target="_new">http://www.asp.net/Forums</a>).</div>
          <br/><br/>
          <span style="color:red;">
            <a href="http://gene.javaeye.com/blog/39560#comments" style="color:red;">已有 <strong>0</strong> 人发表留言，猛击-&gt;&gt;<strong>这里</strong>&lt;&lt;-参与讨论</a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 18 Dec 2006 14:12:17 +0800</pubDate>
        <link>http://gene.javaeye.com/blog/39560</link>
        <guid>http://gene.javaeye.com/blog/39560</guid>
      </item>
      <item>
        <title>Librarian's Ultimate Guide to Search Engines</title>
        <author>Gene</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://gene.javaeye.com">Gene</a>&nbsp;
          链接：<a href="http://gene.javaeye.com/blog/38703" style="color:red;">http://gene.javaeye.com/blog/38703</a>&nbsp;
          发表时间: 2006年12月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <h1>Librarian's Ultimate Guide to Search Engines</h1>
<p class="entry-meta">Published on Friday December 8th , 2006</p>
<!-- post-hook-A -->
<h3>The Librarians Ultimate Guide to Search Engines</h3>
<p>Librarians were the ultimate search guides before search was re-invented with the web. They are trusted, credible sources for historical information, and pioneers and innovators of taxonomy of information. Librarians witness, search for, find, organize and catalog knowledge.Online research and the power of the web, have made accessing information only fingertips away from all of us, but the taxonomies and standards used for search will impact <a href="http://www.degreetutor.com/library/distance-vs-local/10-reasons-to-dropout">how people learn online</a> and off for years to come. Below are some of the things librarians understand about search - and things that anyone doing <a href="http://www.degreetutor.com/library/choosing-school/research-tools">online research</a> can benefit from.<br />
</p>
<h3>Brief Recent History Of Search Engines</h3>
While there are many search engines, about 80-90% of the search market belongs to just a few: Google, Yahoo, and MSN, approximately in that order of decreasing use. There are a few other engines that are relatively popular but some are white-labelled versions of the above. If you want to see a chart of approximate web traffic figures for these engines, use <a href="http://www.alexaholic.com/">alexaholic.com</a>. Alexaholic uses <a href="http://www.alexa.com/">Alexa.com</a> but will let you view multiple traffic charts simultaneously. These will give you a relative comparison of which is more popular.<br />
More in depth <a href="http://www.search-marketing.info/search-engine-history/">history of search engines</a>, and <a href="http://www.seobook.com/glossary/">search glossary.</a><br />
<br />
For example, traffic to Google, Yahoo, and MSN has been <a href="http://www.alexaholic.com/google.com+yahoo.com+msn.com+ask.com">relatively equal</a> over the past 3 months. Though if you plot Alexa traffic figures over the past 5 years, you'll see how incredibly fast Google's popularity has increased, right up through early 2006. Ask.com traffic line is at the very bottom of the chart.<br />
<br />
<h3>Web2.0 Search Engines</h3>
These are the new breed, some labelled as <a href="http://en.wikipedia.org/wiki/Web2.0">web2.0</a> applications. The <a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html">definition of web 2.0</a> is still <a href="http://www.go2web20.net/">fairly broad</a>, but it's easy to see the <a href="http://www.seomoz.org/web2.0/">award winning stuff</a>. They're the tip of the iceberg of advanced search applications for what is known as the <a href="http://en.wikipedia.org/wiki/Semantic_Web">semantic web</a>. They literally add another dimension to searching. Some offer visual search using an initial image that you select or even draw. Others let you search by color or meta tags of audio files. A few of these engines include <a href="http://like.com/">Like</a>, <a href="http://shape.cs.princeton.edu/search.html">Princeton Shape</a>, SystemOne <a href="http://labs.systemone.at/retrievr/">Retrievr</a>, <a href="http://www.mnemo.org/">Mnemomap</a>, <a href="http://nualart.com/casual/">Casual</a>, <a href="http://www.kwmap.net/">KWMap</a>, <a href="http://www.ujiko.com/" set="yes">Ujiko</a>, <a href="http://www.webbrain.com/">Webbrain</a>. [See <a href="http://infosthetics.com/">Information Aesthetics</a> for writeups about most of these.]<br />
<br />
Most of these new engines are works in progress that need a few generations of revisions. A few are truly brilliant, all of them innovative. Some use meta level concepts such as synonym matching, color or shape similarity, thematic concepts, semantics. There's even a <a href="http://infosthetics.com/archives/2006/03/search_engine_shape_milling.html">device that carves</a> rivers, canyons and valleys into foam based on search engine queries.<br />
<br />
All of them appear to improve the search experience, but mostly for advanced users who are familiar with unusual search paradigms. If you're interested, visit some to get a sense of them. The rest of this article focuses on traditional text-based search engines.<br />
<br />
<h3>Text-Based Search Engines - Overview </h3>
Text-based search engines are the mainstay of the web. They've come and gone, and will continue to do so. Many left the public web and focused on corporate Intranets (private webs; also part of the &quot;invisble web&quot;). It took Google, however, to successfully monetize a public search engine.<br />
<br />
Because Google and other engines store a list of all the search queries that users perform, there is a vast pool of information that can be data-mined from the queries. For example, <a href="http://www.msnbc.msn.com/">CNBC TV</a> ran a segment about how a murderer was convicted of killing his wife, based on the overwhelming evidence of gruesome search queries. They were able to trace the queries back to his personal computer at home. Using pattern analysis and other evidence, they convicted him.<br />
<br />
Information is essentially cheap on the Internet. It's what you make of it, data-mining for patterns, that can be valuable. Though the average person does not care about that. They are looking for something specific, and usually, they get more search results than they care to look at. That's where power search techniques come in. They are not very complicated, and use a fairly simple syntax to give you the power to cull the search results down to what you are really looking for - most of the time, anyway.<br />
<br />
<h3>Glossary: Search Engine + Related</h3>
Before discussing ways to refine search queries, let's have a look at a few terms either specifically related to search engines, or related to topics in this article.<br />
<br />
<strong>Anchor Text</strong><br />
When ever you see a hyperlink on a web page, the actual words used to specify the link are referred to as the anchor text.<br />
<br />
<strong>Blog/ Weblog</strong><br />
A blog (aka weblog) is a special website that has been structured with articles (blog posts) in reverse chronological order. Blog posts are also organized into page groups and monthly archives. They have a structural advantage in search engines, though they often result in false search results.<br />
<br />
<strong>Bot/ Spider</strong><br />
A search engine bot or spider is a special automated web application that indexes web pages for a search engine.<br />
<br />
<strong>Cache</strong><br />
Some engines store the full-text of an indexed web page. Whenever the page is updated, the engine's cache will also be updated, eventually. So you can view a cached page from another site by using the &quot;cache:&quot; operator, without leaving the search engine.<br />
<br />
<strong>Invisible Web</strong><br />
The <a href="http://www.lib.berkeley.edu/TeachingLib/Guides/Internet/InvisibleWeb.html">Invisible Web</a> consists of web sites that are difficult or impossible to find, either because they are not indexed in a search engine or because they require a password.<br />
<br />
<strong>Query Strings</strong><br />
This simply means the actual text that you enter in a search query, including letters, digits, punctuation, and any special operator characters.<br />
<br />
<strong>SEM/ SEO</strong><br />
Search engine marketing/ Search engine optimization<br />
<br />
<strong>Semantic Web</strong><br />
The Semantic Web is a project to derive consistent meaning from websites through advanced search engines. Most web content is designed for humans. When you search for something, you don't always get what you were thinking. The semantic web will improve that by allowing search bots to extract meaning from semantically organized informatino. Sir Tim Berners-Lee, father of the modern Internet, gives his <a href="http://www.w3.org/DesignIssues/Semantic.html">road map for the semantic web</a> (Sept 1998).<br />
<br />
<strong>SERPs</strong><br />
SERP means Search Engine Results Page - those pages that result when you do a search query.<br />
<br />
<strong>Stop Words</strong><br />
<a href="http://en.wikipedia.org/wiki/Stop_words">Stop words</a> are any words, such as &quot;the&quot;, &quot;and&quot;, &quot;a&quot;, &quot;or&quot;, that add little value in being part of a search query string. Most engines do not store these when indexing web pages.<br />
<br />
<strong>Tags</strong><br />
Tags refer to a topic category classification, primarily for weblog sites. So if you write a blog post about food, it might have tags such as &quot;recipe&quot;, &quot;italian&quot;, &quot;mushrooms&quot;, &quot;pasta&quot;. Tags are applied by the author of a post.<br />
<br />
<strong>TLD</strong><br />
TLD means Top Level Domain and refers to the final part of the name of a web domain. For example, http://www.msn.com/ is an URL. The TLD is the &quot;.com&quot; part. The &quot;msn&quot; part is known as the second-level domain.<br />
<br />
<strong>URL</strong><br />
URL means Uniform Resource Locator and essentially means the web address of a specific web page.<br />
<br />
<strong>Web Feeds</strong><br />
Web feeds are a special form of web content that organizes new content from a website or blog into the form of headlines and excerpts. Web feeds make it easy to syndicate content online, as well to subscribe to such content for frequent browsing using a &quot;web feed reader&quot;. (See &quot;Bloglines&quot; in the final section of this article.)<br />
<br />
<br />
<h3>Refining Search Queries</h3>
All text-based search engines work on a query string supplied by the user. But most of the time, the SERPs returned number in the hundreds or even millions of pages, making it difficult to find what you want. To reduce the number of SERPs, we need to refine our search strings. To do that, we need to use special query operators that are derived mostly from <a href="http://en.wikipedia.org/wiki/Boolean_logic">Boolean logic</a>, pus a few specialized operators.<br />
<br />
All search engines use a fairly common set of advanced query operators (AQOs). However, not all engines process AQOs the same way. So if you do use advanced operators, you will want to play around with them in your favorite search engine to learn how they're handled. The operator descriptions below are generalized; not all engines will support them in exactly the way described.<br />
<br />
<br />
<strong>General Query Operators</strong><br />
These include using double quotes to force results that include a specific text string, brackets &quot;()&quot;, Booleans (AND, OR, NOT), and &quot;+&quot; or &quot;-&quot; (plus/ minus). Plus typically means include a term, and minus means exclude a term. For example:<br />
<br />
<ul>
    <li><strong>library taxonomy </strong> is usually the same as <strong>+library +taxonomy</strong>, which is the same as <strong>library AND taxonomy</strong>. Both words have to appear in the results, but order and proximity may vary. If you want adjacent words (i.e., that specific string), use double quotes: <strong>&quot;library taxonomy&quot;</strong>. Some engines offer a <strong>near</strong> operator as well, which controls proximity within a certain number of words, say ten. </li>
    <li>Plural forms are usually automatically offered, as are some verb forms of a root word, unless double quotes are used. </li>
    <li>The <strong>OR</strong> operator might work on exclusion or it work on supplemental rules. For example, <strong>libarary OR taxonomy</strong> usually means either/both, but could mean one or the other, only (exclusive or), which would make it the same as the next form. </li>
    <li><strong>library NOT taxonomy</strong> means return only those web pages with just the word <strong>library</strong>, never with <strong>taxonomy</strong>. This is the same, in most engines, as <strong>+library -taxonomy</strong>. </li>
    <li>Brackets help arrange processing order in complex queries. For example: <strong>(EMF OR &quot;electro magnetic fields&quot;) AND health</strong> means that the SERPs must have the word health and either of the terms <strong>EMF</strong> or &quot;<strong>electro magnetic fields</strong>&quot;. You can add a bit more leeway in some engines by using <strong>(EMF OR (electro magnetic fields)) AND health</strong>. This lets the order and proximity of the words <strong>electro magnetic fields</strong> be more flexible in the results. </li>
</ul>
<p><br />
<strong>Site Operators</strong><br />
These are powerful operators that most engines have but which are not always well-known. While there is a common set of operators, a few engines have their own variations. Here is an amalgamated list. A few references are included after this section, if you are interested in finding out more. All of them consist of a predefined keyword and a semicolon, &quot;:&quot;, character, which are then followed by a word or URL or domain name, etc. There should be no spaces on either side of the semicolon.<br />
<br />
<strong>allinanchor:</strong>, <strong>inanchor:</strong> - Use allinanchor: to specify one or more words that must all be in anchor text. (See definition of anchor text in Glossary above.) Use inanchor to specify one word in anchor text and one or more words in the rest of the document body.<br />
Example: <a href="http://www.google.com/search?num=100&amp;hl=en&amp;lr=&amp;safe=off&amp;c2coff=1&amp;q=allinanchor%3Alibrarian&amp;btnG=Search">allinanchor:librarian</a></p>
<p><strong>allintitle:</strong> , <strong>intitle:</strong> - Use allintitle: to specify one or more words that must all be in the title of a web page. Use intitle: to check for a single word in the title, and one or more words in the document body.<br />
Example:<a href="http://www.google.com/search?q=allintitle%3Alibrarians"> allintitle: librarians</a></p>
<p><strong>allinurl:</strong>, <strong>inurl:</strong> - Use allinurl: to specify one or more words to be checked in the URL of a web page. Use inurl: to check one word in the URL and one or more words in the document body.<br />
Example:<a href="http://www.google.com/search?q=allinurl%3Alibrarians" set="yes">allinurl: librarians</a></p>
<p><strong>cache:</strong> - Varies by engine, but it typically shows the last cached version of a page.<br />
Example:<a href="http://72.14.209.104/search?q=cache%3Ahttp%3A%2F%2Flii.org">cache:http://lii.org</a></p>
<p><strong>define:</strong>  - Returns definitions of a specific word, from various sources.<br />
Example: <a href="http://www.google.com/search?num=100&amp;hl=en&amp;lr=&amp;safe=off&amp;c2coff=1&amp;q=define%3Alibrarian&amp;btnG=Search" set="yes">define:librarian</a></p>
<p><strong>domain:</strong>, <strong>site:</strong> - Use with a domain name to limit searches to pages on that site. <br />
Example:<strong><a href="http://www.google.com/search?q=site%3Astanford.edu">site:stanford.edu.</a></strong><br />
</p>
<p>  <strong>filetype:</strong> - Use with a media file type (e.g., PDF) to limit SERPs to that type of document.<br />
Example: <a href="http://www.google.com/search?as_q=library&amp;hl=en&amp;c2coff=1&amp;num=100&amp;btnG=Google%2BSearch&amp;as_epq=&amp;as_oq=&amp;as_eq=&amp;lr=&amp;as_ft=i&amp;as_filetype=xls&amp;as_qdr=all&amp;as_nlo=&amp;as_nhi=&amp;as_occt=any&amp;as_dt=i&amp;as_sitesearch=&amp;as_rights=&amp;safe=off">library filetype:xls</a></p>
<p><strong>info:</strong> - Provides engine-specific info about a particular URL or its parent site.<br />
Example: <a href="http://www.google.com/search?q=info%3Ahttp%3A%2F%2Fwww.becomealibrarian.org%2F">info:becomealibrarian.org</a></p>
<p><strong>link:</strong>, <strong>linkto:</strong> - Use this to find websites linking to a specific URL or domain. <br />
E.g.: <a href="http://search.yahoo.com/search?p=linkdomain%3Alibrarian.net%2B-site%3Alibrarian.net">link:www.librarian.net</a>.<br />
</p>
<p>  <strong>related:</strong> - Engines determine topic similarity of web pages on different sites. This operator, when used with an URL, will return pages from other sites that are similar.<br />
Example:  <a href="http://www.google.com/search?hl=en&amp;lr=&amp;c2coff=1&amp;safe=off&amp;q=related:lii.org/">related:lii.org</a><strong> </strong> <br />
<br />
There are actually many more specialized operators, some of which are covered in the references below. They are not absolutely necessary, but are useful for power users.<br />
<br />
<br />
<strong>Miscellaneous Operators</strong><br />
Some engines offer additional operator functionality by allowing you to click on a checkbox. Some such features include domain exclusion, choice of site TLDs, and date published range. In some engines, you can specify year range by using something like <strong>2000..2006</strong>.<br />
<br />
<br />
<strong>Additional References</strong><br />
Here are a few links to pages about advanced queries. </p>
<ul>
    <li><a href="http://www.altavista.com/help/search/syntax">Altavista search syntax</a>.</li>
    <li><a href="http://www.google.com/help/operators.html">Google query operators</a>.</li>
    <li><a href="http://www.googleguide.com/advanced_operators_reference.html">GoogleGuide</a>.</li>
    <li><a href="http://www.lib.berkeley.edu/TeachingLib/Guides/Internet/FindInfo.html" set="yes">Berkeley search tutorial</a>.</li>
    <li>Search Engine Weblog:  <a href="http://www.searchengine-weblog.com/50226711/how_do_search_engines_find_you.php">How search engines find you</a>, <a href="http://www.searchengine-weblog.com/50226711/simple_math_in_using_search_engines.php">Simple math in search engines</a>. </li>
    <li><a href="http://www.thelearningsite.net/cyberlibrarian/searching/ismain.html">The Learning Site search tutorial</a>. </li>
</ul>
<br />
<h3>Google</h3>
<br />
<a href="http://www.google.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-google.png" border="0" align="left" alt="google" style="padding: 5px;" /></a><br />
<br />
While <a href="http://www.google.com/">Google</a> is not the oldest existing engine around, it is the most popular, especially among web-savvy users. They have a whole host of features, and they're always adding more. They <a href="http://www.searchengine-weblog.com/50226711/google_supports_17_new_languages.php">just added</a> support for 17 new languages. While Google is more selective about what websites and web pages they index, advanced users tend to favor this engine over others. Here is Google's full list of <a href="http://www.google.com/help/operators.html" set="yes">advanced operators</a> for search queries.<br />
<br />
<br />
<br />
<h3>Yahoo</h3>
<br />
<a href="http://www.yahoo.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-yahoo.png" border="0" align="left" alt="yahoo" style="padding: 5px;" /></a><br />
<br />
Yahoo was originally a human-approved directory that you paid to have your site listed in. They still do that, but they added <a href="http://search.yahoo.com/">YahooSearch</a> to compete with Google, who ousted many other engines that are no longer around, or put their focus elsewhere than the public web.<br />
<br />
Yahoo may show far fewer results for some search keywords than Google, though more complex phrases often show significantly different results. Their <a href="http://search.yahoo.com/web/advanced?ei=UTF-8" set="yes">advanced features</a> include the ability to search specific TLDs (eg., .gov, .edu, .org, .com) and specific content (<a href="http://search.yahoo.com/cc/faq">Creative Commons</a>, adult, non-adult, subscription content, language results).<br />
<br />
<br />
<br />
<h3>MSN</h3>
<br />
<a href="http://www.msn.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-msn.png" border="0" align="left" alt="MSN" style="padding: 5px;" /></a><br />
<br />
<a href="http://www.msn.com/">MSN Search</a> (now called <a href="http://search.msn.com/results.aspx?q=&amp;FORM=MSNH">Live Search</a>) is Microsoft's baby. They long dominated desktop computer software but have lagged behind in the Internet race, if their flat stock share price is any indication. For some reason, the average query in MSN tends to produce more SERPS than for Google. Though this conclusion is based on a very small sample of queries over a year. It's 100% likely that MSN uses different criteria to index web pages, and Google is selective, as mentioned earlier. MSN's advanced features include language choice of search interface, language results, and safe search, amongst others. They also allow you to search for images, video and maps, within news or academic sites only, and in web feeds. There is a new QnA (Questions and Answers) beta feature, at the time of this writing, which lets you ask a question that a member of the community may answer for you - better than a search engine.<br />
<br />
<br />
<br />
<h3>Other Textual Search Engines</h3>
<p align="left">Below are some of the other text-based search engines, each of which enjoys a varying degree of mild popularity. Not every engine is included below (alphabetical order), but the following should give you a light overview of your options. Defunct engines are not mentioned, and this list is by no means comprehensive.<br />
<br />
<br />
<strong>AllTheWeb</strong><br />
<br />
<a href="http://www.alltheweb.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-alltheweb.png" border="0" align="left" alt="alltheweb" style="padding: 5px;" /></a><br />
<br />
<a href="http://www.alltheweb.com/">AllTheWeb</a> is a search engine and information portal. Content is divided into web, news, pictures, video, and audio. For example, a search for &quot;trees&quot; under the video category produces SERPS of only video files that have the text string &quot;trees&quot; in the file name. If you were looking for MP3 files of legendary blues master Robert Johnson, you could use the audio tab to get all 2,666 results. (Is that a joke? Who knows. Johnson was said to have made a deal with devil, to be the best blues guitarist ever, and reputed to have 3 graves.) AllTheWeb has a number of advance operators in <a href="http://www.alltheweb.com/help/faqs/query_language">their query language</a>. A look under the hood reveals that AllTheWeb is just YahooSearch white-labelled.<br />
**Alltheweb utilizes the Yahoo database<br />
<br />
<br />
<strong>AltaVista</strong><br />
<br />
<a href="http://www.altavista.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-altavista.png" border="0" align="left" alt="altavista" style="padding: 5px;" /></a><br />
<br />
<a href="http://www.altavista.com/">Altavista</a> was one of the early challengers for the search engine throne, appearing probably around 1994-95. They were at one time one of the fastest search engines around, based on pure computing horsepower, and were somewhat popular, briefly, until Google appeared. They appear at present to be a white-labelled YahooSearch, with <a href="http://www.altavista.com/web/adv">advanced features</a> that are standard.<br />
**Altavista utilizes the Yahoo database  <br />
<br />
<br />
<strong>Ask + Excite</strong><br />
<br />
<a href="http://www.ask.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-ask.png" border="0" align="left" alt="ask" style="padding: 5px;" /></a><a href="http://www.excite.com/"><img src="http://www.degreetutor.com/lg-ss/snaps-excite.png" border="0" align="left" alt="excite" style="padding: 5px;" /></a><br />
<br />
<a href="http://www.ask.com/">Ask.com</a> is part of a group of engines and &quot;information retrieval products&quot; owned by IAC Search &amp; Media. This group includes <a href="http://www.excite.com/">excite.com</a>, which was once extremely popular when it debuted around 1995, a few years before Google. Ask.com was once called AskJeeves, and was white-labelled by a number of web portals that regular readers visited daily.<br />
<br />
Ask also offers some non-standard search functionality (added courtesy of <a href="http://www.resourceshelf.com/">Gary Price</a>)</p>
<p align="left"> 1) <a href="http://www.ask.com/web?q=%3A-%29&amp;qsrc=0&amp;o=0&amp;l=dir">Definition of non-alphanumeric searches</a><br />
We have started to slowly offer non-alphanumeric searches</p>
<p>2) <a href="http://www.ask.com/web?q=zip%2Bcode%2Bspringfield&amp;qsrc=2&amp;o=0&amp;l=dir">Zip Code search</a><br />
Notice the box to help you select the proper state and to see all the Zips for a<br />
specific city.</p>
<p>3) <a href="http://www.ask.com/blogsearch?q=new%2Byork%2Bmets&amp;t=a&amp;s=f&amp;bql=&amp;qsrc=2103&amp;rpp=10%0A%0A">Blog and feed search</a><br />
NOTE THE pull down boxes to subscribe to a feed (even using a competitors<br />
reader) or post the item with one click using digg, Reddit, etc.</p>
<p>4) <a href="http://www.ask.com/web?q=plays%2B10036&amp;qsrc=1&amp;o=0&amp;l=dir">New, event listings.</a> <br />
Part of the new AskCity service.<br />
</p>
<p align="left">   <br />
<br />
<br />
<strong>Blogsearch (Google)</strong><br />
<br />
<a href="http://blogsearch.google.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-google-blogsearch.png" border="0" align="left" alt="google blogsearch" style="padding: 5px;" /></a><br />
<br />
<a href="http://blogsearch.google.com/">Google Blogsearch</a> works in the same way as regular Google, the results are dedicated to weblog sites only. That does not mean blogs are not included in regular Google, but they don't show as prominently there. This way, if you are specifically looking for topics discussed in blogs only, it's easier to find them since many millions of web pages from regular websites have been pre-filtered.<br />
<br />
<br />
<br />
<strong>Hotbot (Lycos)</strong><br />
<br />
<a href="http://www.lycos.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-hotbot.png" border="0" align="left" alt="lycos" style="padding: 5px;" /></a><br />
<br />
<a href="http://hotbot.lycos.com/">Lycos</a> has enjoyed some popularity and even a loyal following. You can find a summary of <a href="http://hotbot.lycos.com/adv.php">advanced features</a> there.<br />
<br />
<br />
<br />
<strong>Indeed</strong><br />
<br />
<a href="http://www.indeed.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-indeed.png" border="0" align="left" alt="" style="padding: 5px;" /></a><br />
<br />
<a href="http://www.indeed.com%20/">Indeed</a> is a job search engine, in case you are looking for a new job in the Library Sciences field. They also have a version for <a href="http://canada.indeed.com/">Canadian jobs</a>.<br />
<br />
<br />
<br />
<strong>Information</strong><br />
<br />
<img src="http://www.degreetutor.com/lg-ss/snaps-information.png" align="left" alt="" style="padding: 5px;" /><br />
<br />
<a href="http://information.com/">Information</a> appears to be a specialized engine that has also categorizes content into the groups web search, encyclopedia, blogs, articles, groups.<br />
<br />
<br />
<br />
<strong>Librarian's Internet Index</strong><br />
<br />
<a href="http://www.lii.org/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-librarians-internet-index.png" border="0" align="left" alt="Librarians Internet Index" style="padding: 5px;" /></a><br />
<br />
The publicly-funded <a href="http://lii.org/">LII</a>, or Librarian's Internet Index, is more of an information portal than a search engine. Each week, hand-selected websites adhering to some current theme are added to the Index, and their content can be searched in the LII. There's also a free newsletter that you can subscribe to. New entries can be subscribed to via the web feed.<br />
<br />
<br />
<strong>Northern Light</strong><br />
<br />
<a href="http://www.northernlights.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-northern.png" border="0" align="left" alt="northern lights" style="padding: 5px;" /></a><br />
<br />
<a href="http://www.northernlight.com/">Northern Light</a> focuses on offering searches of a wide variety of business content as well as industry journals.<br />
<br />
<br />
<br />
<strong>Technorati</strong><br />
<br />
<a href="http://www.technorati.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-technorati.png" border="0" align="left" alt="technorati" style="padding: 5px;" /></a><br />
<br />
Like Google Blogsearch, <a href="http://technorati.com/">Technorati</a> is dedicated to weblogs only. However, it's far more than just a search engine and includes many features specifically of use to bloggers. Technorati, amongst other features, lets you know what is popular in a number of blog categories and content types (text, video), as well as in topics. It's also easy to determine what other weblogs are linked to a specific weblog. Finally, in addition to searching indexed blog posts, you can also search through blog post tags and other blog directories.<br />
<br />
<br />
<br />
<strong>Digg</strong> <br />
<a href="http://www.digg.com/">Digg</a> is a new form of search engine based on social community as the driving force for relevance. The technique is fairly new, but seems to be catching on with increasing popularity. Digg is currently the 2nd highest trafficked site in the &quot;tech&quot; category according to several resources.</p>
<h3 align="left">Other Librarian Search Resources</h3>
<p align="left">Additional Librarian search resources added courtesy of Gary Price's insight.</p>
<ul>
    <li><a href="http://www.intute.ac.uk/" align="left">Intute</a><br />
    Including the Intutue Virtual Training Suite </li>
    <li><a href="http://www.infomine.ucr.edu%0a%0a/">Infomine</a></li>
    <li>  <a href="http://www.academicinfo.net/index.html%0A%0A">AcademicInfo</a></li>
    <li>Free <a href="http://www.sfpl.org/sfplonline/dbcategories.htm%0A%0A">public database</a> information available with a library card - similar to <a href="http://www.sfpl.org/sfplonline/dbcategories.htm%0A%0A">this (from the San Francisco Public library)</a></li>
    <li><a href="http://www.searchengineshowdown.com/">Greg Notess guide to web engines</a><br />
    </li>
</ul>
<h3>  </h3>
<h3>Miscellaneous Resources </h3>
To round out the discussion, here are a couple of other resources that may be of interest to librarians or anyone doing regular research.<br />
<br />
<br />
<strong>API/ SDKs For White-Labelling Custom Engines</strong><br />
Several search engines offer APIs (Application Programmer Interfaces) and SDKs (Software Development Kits) that allow you to embed their functionality into your own web applications. Thus, you could very easily use, say, a customized Google to build a special librarian's search engine, which would index a select set of websites and weblogs pertaining to library sciences.<br />
<br />
<br />
<strong>Bloglines Web Feed Subscription Tool</strong><br />
<br />
<a href="http://www.bloglines.com/" set="yes"><img src="http://www.degreetutor.com/lg-ss/snaps-bloglines.png" border="0" align="left" alt="bloglines" style="padding: 5px;" /></a><br />
<br />
If you plan to browse dozens or even hundreds of websites and weblogs on a daily or otherwise regular basis, one of the best tools for this is Bloglines. Professional bloggers and online researchers have been known to use this tool to monitor new articles/ blog posts from as many as 1,000 sites. The drawback is that only websites/ weblogs that publish a web feed can be tracked in this manner. Bloglines is owned by the same company as Ask.com and Excite.<br />
<br />
<br />
<strong>Meta Search Engines</strong><br />
There are a couple of search tools, such as <a href="http://www.dogpile.com/">Dogpile</a> and <a href="http://www.metacrawler.com/">Metacrawler</a>, that take your query and submit it to several engines simultaneously, returning to you aggregate SERPs.<br />
<br />
<br />
<strong>Search Tutorials</strong><br />
The Learning Site has a six-part tutorial on <a href="http://www.thelearningsite.net/cyberlibrarian/searching/ismain.html" set="yes">web searching, sleuthing and sifting</a> through information on the Internet.<br />
<br />
<br />
<strong>Web Search Start Point</strong><br />
<a href="http://www.accesscom.com/%7Eziegler/search.html">Accesscom.com</a> has a somewhat out of date list of 200+ categorized hyperlinks, in case you are looking for something but don't know where to start, as they put it.<br />
<br />
<br />
<strong>Query Views</strong><br />
Ever wonder what other people are searching for? Metacrawler's <a href="http://www.metacrawler.com/info.metac/searchspy/">SearchSpy</a> gives you a scrolling, near-realtime list of actual search query strings. There are two versions: unexposed and exposed, with the latter being unfiltered - that is, with possible adult content
          <br/><br/>
          <span style="color:red;">
            <a href="http://gene.javaeye.com/blog/38703#comments" style="color:red;">已有 <strong>0</strong> 人发表留言，猛击-&gt;&gt;<strong>这里</strong>&lt;&lt;-参与讨论</a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 12 Dec 2006 15:47:35 +0800</pubDate>
        <link>http://gene.javaeye.com/blog/38703</link>
        <guid>http://gene.javaeye.com/blog/38703</guid>
      </item>
      <item>
        <title>Crossing borders: Ajax on Rails</title>
        <author>Gene</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://gene.javaeye.com">Gene</a>&nbsp;
          链接：<a href="http://gene.javaeye.com/blog/37790" style="color:red;">http://gene.javaeye.com/blog/37790</a>&nbsp;
          发表时间: 2006年12月07日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <table cellspacing="0" border="0" cellpadding="0" width="100%">
    <tbody>
        <tr valign="top">
            <td width="100%">
            <h1><span style="color: rgb(153, 153, 153);">Crossing borders: </span>Ajax on Rails</h1>
            <p id="subtitle"><em>Why Ajax works so well with Ruby</em></p>
            <img class="display-img" src="http://www.ibm.com/i/c.gif" height="6" alt="" width="1" /></td>
            <td class="no-print" width="192"><a href="http://www.ibm.com/developerworks/" set="yes"><img src="http://www-128.ibm.com/developerworks/i/dw.gif" border="0" height="18" alt="developerWorks" width="192" /></a></td>
        </tr>
    </tbody>
</table>
<table cellspacing="0" border="0" cellpadding="0" width="100%">
    <tbody>
        <tr valign="top">
            <td width="10"><img src="http://www.ibm.com/i/c.gif" height="1" alt="" width="10" /></td>
            <td width="100%">
            <table class="no-print" cellspacing="0" border="0" align="right" cellpadding="0" width="160">
                <tbody>
                    <tr>
                        <td width="10"><img src="http://www.ibm.com/i/c.gif" height="1" alt="" width="10" /></td>
                        <td>
                        <table cellspacing="0" border="0" cellpadding="0" width="150">
                            <tbody>
                                <tr>
                                    <td class="v14-header-1-small">Document options</td>
                                </tr>
                            </tbody>
                        </table>
                        <table class="v14-gray-table-border" cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td class="no-padding" width="150"><noscript></noscript><noscript>&lt;tr valign=&quot;top&quot;&gt;&lt;td width=&quot;8&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;1&quot; width=&quot;8&quot; src=&quot;//www.ibm.com/i/c.gif&quot;/&gt;&lt;/td&gt;&lt;td width=&quot;16&quot;&gt;&lt;img alt=&quot;&quot; width=&quot;16&quot; height=&quot;16&quot; src=&quot;//www.ibm.com/i/c.gif&quot;/&gt;&lt;/td&gt;&lt;td class=&quot;small&quot; width=&quot;122&quot;&gt;&lt;p&gt;&lt;span class=&quot;ast&quot;&gt;Document options requiring JavaScript are not displayed&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;</noscript>
                                    <table cellspacing="0" border="0" cellpadding="0" width="143">
                                        <script language="JavaScript" type="text/javascript">
<!--
document.write('<tr valign="top"><td width="8"><img src="//www.ibm.com/i/c.gif" width="8" height="1" alt=""/></td><td width="16"><img alt="Set printer orientation to landscape mode" height="16" src="//www.ibm.com/i/v14/icons/printer.gif" width="16" vspace="3" /></td><td width="122"><p><b><a class="smallplainlink" href="javascript:print()">Print this page</a></b></p></td></tr>');
//-->
</script>
                                        <tbody>
                                            <tr valign="top">
                                                <td width="8"><img src="http://www.ibm.com/i/c.gif" height="1" alt="" width="8" /></td>
                                                <td width="16"><img src="http://www.ibm.com/i/v14/icons/printer.gif" vspace="3" height="16" alt="Set printer orientation to landscape mode" width="16" /></td>
                                                <td width="122">
                                                <p><strong><a href="javascript:print()" class="smallplainlink">Print this page</a></strong></p>
                                                </td>
                                            </tr>
                                            <script language="JavaScript" type="text/javascript">
<!--
document.write('<tr valign="top"><td width="8"><img src="//www.ibm.com/i/c.gif" width="8" height="1" alt=""/></td><td width="16"><img src="//www.ibm.com/i/v14/icons/em.gif" height="16" width="16" vspace="3" alt="Email this page" /></td><td width="122"><p><a class="smallplainlink" href="javascript:void newWindow()"><b>E-mail this page</b></a></p></td></tr>');
//-->
</script>
                                            <tr valign="top">
                                                <td width="8"><img src="http://www.ibm.com/i/c.gif" height="1" alt="" width="8" /></td>
                                                <td width="16"><img src="http://www.ibm.com/i/v14/icons/em.gif" vspace="3" height="16" alt="Email this page" width="16" /></td>
                                                <td width="122">
                                                <p><a href="javascript:void newWindow()" class="smallplainlink"><strong>E-mail this page</strong></a></p>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <!--START RESERVED FOR FUTURE USE INCLUDE FILES--><!-- 11/29/06 commented out by Jill-->   <!--<br  />
                        <table border="0" cellpadding="0" cellspacing="0" width="150">
                            <tr>
                                <td class="v14-header-2-small">Using XML, but need to do more?</td>
                            </tr>
                        </table>
                        <table border="0" cellpadding="0" cellspacing="0" class="v14-gray-table-border">
                            <tr>
                                <td width="150" class="no-padding">
                                <table border="0" cellpadding="0" cellspacing="0" width="143">
                                    <tr valign="top">
                                        <td width="8"><img src="//www.ibm.com/i/c.gif" width="8" height="1" alt="" /></td>
                                        <td><img src="//www.ibm.com/i/v14/icons/fw_bold.gif" height="16" width="16" border="0" vspace="3" alt="" /></td>
                                        <td width="125">
                                        <p><a href="http://www.ibm.com/developerworks/kickstart/database.html?S_TACT=105AGX01&amp;S_CMP=SIMPLEART" class="smallplainlink">Download DB2 Express-C 9</a>
                                        </p>
                                        </td>
                                    </tr>
                                </table>
                                </td>
                            </tr>
                        </table>
                        --><!--END RESERVED FOR FUTURE USE INCLUDE FILES--><br />
                        <table cellspacing="0" border="0" cellpadding="0" width="150">
                            <tbody>
                                <tr>
                                    <td class="v14-header-2-small">Rate this page</td>
                                </tr>
                            </tbody>
                        </table>
                        <table class="v14-gray-table-border" cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td class="no-padding" width="150">
                                    <table cellspacing="0" border="0" cellpadding="0" width="143">
                                        <tbody>
                                            <tr valign="top">
                                                <td width="8"><img src="http://www.ibm.com/i/c.gif" height="1" alt="" width="8" /></td>
                                                <td><img src="http://www.ibm.com/i/v14/icons/d_bold.gif" border="0" vspace="3" height="16" alt="" width="16" /></td>
                                                <td width="125">
                                                <p><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#rate" class="smallplainlink"><strong>Help us improve this content</strong></a></p>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <br />
                        </td>
                    </tr>
                </tbody>
            </table>
            <p>Level: Intermediate</p>
            <p><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#author">Bruce Tate</a> (<a href="mailto:bruce.tate@j2life.com?subject=Ajax%20on%20Rails&amp;cc=bruce.tate@j2life.com">bruce.tate@j2life.com</a>), President, RapidRed<br />
            </p>
            <p> 05 Dec  2006</p>
            <blockquote>The hype for Ajax, a technique for making Web pages more interactive, is in overdrive. The Ruby on Rails framework is also flourishing, partly on the strength of its excellent Ajax integration. Find out what makes Ajax on Rails such a powerful combination. </blockquote><!--START RESERVED FOR FUTURE USE INCLUDE FILES-->
            <script language="JavaScript" type="text/javascript">
<!--
if (document.referrer&&document.referrer!="") { 
   // document.write(document.referrer);
   var q = document.referrer;
   var engine = q;
   var isG = engine.search(/google\.com/i);
   var searchTerms;
   //var searchTermsForDisplay;
   if (isG != -1) { 
	   var i = q.search(/q=/);
	   var q2 = q.substring(i+2);
	   var j = q2.search(/&/);
	   j = (j == -1)?q2.length:j;
	   searchTerms = q.substring(i+2,i+2+j);
	   if (searchTerms.length != 0) {
	       searchQuery(searchTerms);
	       document.write("<div id=\"contents\"></div>");
	   }
   } 
}
//-->
</script>
            <!--END RESERVED FOR FUTURE USE INCLUDE FILES-->
            <p>The previous two <em>Crossing borders</em> articles (see <a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#resources">Resources</a>) walked you through Streamlined, a Rails add-on that makes effective use of scaffolding to generate simple, Ajax-enabled user interfaces quickly. Unless you've been hiding under a rock, you recognize Ajax as a programming technique that uses XML, JavaScript, and Web standards to create highly interactive Web pages, such as those you'll find at Google Maps and hundreds of other sites. Several readers of the Streamlined articles asked me to describe the way Ajax works on Ruby on Rails. This article walks through a couple of simple Ajax examples and, along the way, shows you what makes the Ruby/Ajax combination so successful. In the next article in this series, I'll dig into JavaScript as a programming language.</p>
            <p><a name="N10069"><span class="atitle">Ajax defined</span></a></p>
            <p> Ajax stands for Asynchronous JavaScript + XML. Jesse James Garrett, an information architect, came up with the term in 2005 to describe a technique that had seen niche use for nearly a decade (see <a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#resources">Resources</a>). Ajax use then exploded, with a simultaneous growth in libraries, popular Web sites, and literature.  </p>
            <p> Ajax redefines the basic browser's usage model, which was to render a page at a time. Ajax lets the browser communicate with the server between page updates. The upside is a richer user experience, at the cost of complexity. Ajax works by sending XML between the client and server using JavaScript client-side libraries. Ajax developers can send asynchronous requests from the client at any time, so user interactions can continue while the server processes the requests. This is the flow of an Ajax request:</p>
            <table cellspacing="0" border="0" align="right" cellpadding="0" width="40%">
                <tbody>
                    <tr>
                        <td width="10"><img src="http://www.ibm.com/i/c.gif" height="1" alt="" width="10" /></td>
                        <td>
                        <table cellspacing="0" border="1" cellpadding="5" width="100%">
                            <tbody>
                                <tr>
                                    <td bgcolor="#eeeeee"> <a name="N1007C"><strong>About this series</strong></a><br />
                                    <p>In the <a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=crossing+borders:">Crossing borders series</a>, author Bruce Tate advances the notion that today's Java programmers are well served by learning other approaches and languages. The programming landscape has changed since Java technology was the obvious best choice for all development projects. Other frameworks are shaping the way Java frameworks are built, and the concepts you learn from other languages can inform your Java programming. The Python (or Ruby, or Smalltalk, or ... fill in the blank) code you write can change the way that you approach Java coding.</p>
                                    <p>This series introduces you to programming concepts and techniques that are radically different from, but also directly applicable to, Java development. In some cases, you'll need to integrate the technology to take advantage of it. In others, you'll be able to apply the concepts directly. The individual tool isn't as important as the idea that other languages and frameworks can influence developers, frameworks, and even fundamental approaches in the Java community. </p>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <ol>
                <li>An event, such as a user mouse click or a programming timer trigger, initiates a JavaScript function.<br />
                <br />
                </li>
                <li>The JavaScript function creates a request for a partial page rather than a full page. JavaScript then sends that request to the Web server via HTTP.<br />
                <br />
                </li>
                <li>This HTTP request invokes a script on the server, such as a Rails controller method or a Java&trade; servlet.<br />
                <br />
                </li>
                <li>The server script creates an XML document and returns it to the client.<br />
                <br />
                </li>
                <li>Upon receiving the result, the client asynchronously creates, updates, or deletes part of the Web page, such as a list element, <code>div</code> tag, or image.</li>
            </ol>
            <p> All Ajax applications use an approach that looks something like this sequence. For example, consider an application that lets you maintain dictionary words with their definitions. Old-style applications would force a new page view for you to edit a definition. Ajax would allow in-place editing, by replacing definition text with an entry field, and then replacing that form with the updated definition. </p>
            <p>The components of an Ajax solution are:</p>
            <ul>
                <li>A client-side JavaScript library to manage the asynchronous request.</li>
                <li>A server-side library for dealing with the incoming request and formulating an XML response.</li>
                <li>A client-side library to deal with the resulting XML.</li>
                <li>A library -- called the document object model (DOM) -- allowing updates of the existing Web page.</li>
                <li>Helper routines to deal with inevitable UI and integration issues.</li>
            </ul>
            <p> This event/request/response/replace model is the core model for most Ajax applications, but if you're new to Ajax, you'd be surprised at the number of available libraries and the broad differences among them. Many Ajax frameworks dot the industry landscape, with frequent overlap and no sure winners. In the Java marketplace alone, dozens of libraries are in use, including Echo, Dojo, DWR, the Google Web Toolkit (GWT), Java Web Parts, AjaxAnywhere, AjaxTags, Scriptaculous, and Prototype. These frameworks use dramatically different approaches. Some, such as GWT, seek to hide any JavaScript by providing Java libraries that generate JavaScript code. Others aim to make JavaScript easier to use. Some are wildly comprehensive, such as Dom4J, and others simply strive to solve one small problem well. As with many popular new technologies, this checkerboard landscape of solutions will be difficult to navigate for quite some time, and the debugging tools, UI practices (such as the Back button), and wise development practices will materialize slowly. The strength of Ajax libraries on the Java platform is their diversity. That's also the weakness, because that diversity breeds indecision, integration concerns, and complexity. </p>
            <p> With Ruby on Rails, the experience is dramatically different for two reasons. First, Ruby on Rails has one core Web development platform: Ruby on Rails. Second, most of the Ajax development experience on Rails so far has centered around two core frameworks: Scriptaculous and Prototype (see <a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#resources">Resources</a>). The Rails approach, using run-time code generation and custom tags, insulates you from the complexities of JavaScript. It's time to see for yourself. As always, if you want to code along, you need to download Rails, which comes with the necessary Ajax frameworks (see <a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#resources">Resources</a>). Crack open your Rails environment, and take a look with me.  </p>
            <br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" height="1" alt="" width="100%" /></td>
                    </tr>
                </tbody>
            </table>
            <table class="no-print" cellspacing="0" align="right" cellpadding="0">
                <tbody>
                    <tr align="right">
                        <td>
                        <table cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" height="16" alt="" width="16" /><br />
                                    </td>
                                    <td align="right" valign="top"><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#main" class="fbox"><strong>Back to top</strong></a></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <br />
            <p><a name="N100D3"><span class="atitle">A simple Rails application without Ajax</span></a></p>
            <p> To use Rails and Ajax, you'll create an empty project and generate a controller with two methods. One controls a simple page, and another sets up an Ajax response. Type the following commands: </p>
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">rails ajax<br />cd ajax<br />script/generate controller ajax show time</pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p> The first and second lines generate a Rails project and switch to the new directory. The third generates a controller called <code>ajax</code> and views for two actions: <code>show</code> and <code>time</code>. Listing 1 shows the controller code: </p>
            <br />
            <a name="N100F4"><strong>Listing 1. A controller with two empty methods</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">class AjaxController &lt; ApplicationController<br /><br />   def show<br />   end<br /><br />   def time<br />   end<br />end<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>You'll first build two simple views without Ajax and then tie them together with Ajax. Edit the show.rhtml view in app/views/ajax and make it look like Listing 2: </p>
            <br />
            <a name="N10102"><strong>Listing 2. A simple view</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;h1&gt;Ajax show&lt;/h1&gt;<br />Click this link to show the current &lt;%= link_to &quot;time&quot;, :action =&gt; &quot;time&quot; %&gt;.<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>The code in Listings 1 and 2 includes no Ajax support, but I'll dissect it anyway. First, look at the controller in Listing 1. Two empty controller methods process incoming HTTP requests. If you don't explicitly render a view (using a <code>render</code> method), Rails renders the view with the same name as the method. Because the Scriptaculous and Prototype libraries also use HTTP, Rails doesn't need to make any distinction between standard HTTP methods and Ajax methods. </p>
            <p>Now turn your attention to the view in Listing 2. Most of the code is simple HTML, with the exception of the <code>link_to</code> helper in the second line:  <code>&lt;%= link_to &quot;time&quot;, :action =&gt; &quot;time&quot; %&gt;</code>.</p>
            <p>  As you've seen in previous <em>Crossing borders</em> articles, Ruby replaces the code between <code>&lt;%=h</code> and <code>%&gt;</code> with the value of the expression. In this case, the <code>link-to</code> method is a helper that generates a simple HTML link. You can see the link by executing the code. Start the server by typing <code>script/server</code> and then point your browser to http://localhost:3000/ajax/show. You'll see the view shown in Figure 1:</p>
            <br />
            <a name="figure1"><strong>Figure 1. A simple user interface without Ajax</strong></a><br />
            <img src="http://www-128.ibm.com/developerworks/java/library/j-cb12056/figure-1.jpg" height="211" alt="Simple user interface without Ajax" width="296" />  <br />
            <p>In your browser, click the menu options to view the page source (<strong>View &gt; Source</strong> in Internet Explorer and <strong>View &gt; Page Source</strong> in Firefox).  You'll see the code in Listing 3: </p>
            <br />
            <a name="N1014D"><strong>Listing 3. The view generated by show.rhtml</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;h1&gt;Ajax show&lt;/h1&gt;<br />Click this link to show the current &lt;a href=&quot;/ajax/time&quot;&gt;time&lt;/a&gt;.<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p> Notice the link code in Listing 3. The template shields the Rails user from the tedious and error-prone HTML syntax. (The Ajax code works in the same way: you use helper methods to drop in JavaScript code that manages the remote requests and HTML replacement for you.) If you click the link, you'll see the default view for the <code>time</code> method, but I haven't implemented it yet. To remedy that, replace the <code>time</code> method in app/controllers/ajax_controller.rb with the code in Listing 4. Keeping things simple, I'm rendering the view directly from the controller. Later, I'll clean things up and render a view. </p>
            <br />
            <a name="N10163"><strong>Listing 4. Rendering the time</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">def time<br />  render_text &quot;The current time is #{Time.now.to_s}&quot;<br />end<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>Now, when you click the link, you get the view in Figure 2: </p>
            <br />
            <a name="figure2"><strong>Figure 2. A view with no Ajax</strong></a><br />
            <img src="http://www-128.ibm.com/developerworks/java/library/j-cb12056/figure-2.jpg" height="215" alt="Simple view with no Ajax" width="394" />  <br />
            <p>You can immediately see a problem with this UI. The two views don't belong on separate pages. The application represents a single concept: click a link to show the time. To update the time repeatedly, you need to click the link and then the Back button each time. You might solve this problem by placing the link and the time on the same page. But if the show page becomes very large or complex, redisplaying the whole page is wasteful and can lead to too much complexity. </p>
            <br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" height="1" alt="" width="100%" /></td>
                    </tr>
                </tbody>
            </table>
            <table class="no-print" cellspacing="0" align="right" cellpadding="0">
                <tbody>
                    <tr align="right">
                        <td>
                        <table cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" height="16" alt="" width="16" /><br />
                                    </td>
                                    <td align="right" valign="top"><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#main" class="fbox"><strong>Back to top</strong></a></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <br />
            <p><a name="N1017F"><span class="atitle">Adding Ajax</span></a></p>
            <p> Ajax lets you update just a fragment of your Web page. The Rails libraries do most of the work for you. To add Ajax to this application, you need to do four things: </p>
            <ol>
                <li>Configure Rails to use JavaScript.</li>
                <li>Change the time link to submit a JavaScript Ajax request, instead of simply rendering an HTML link.</li>
                <li>Specify the HTML fragment to be updated.</li>
                <li>Prepare a place for the updated HTML content.</li>
                <li>Build a controller method and possibly a view to render the Ajax response.</li>
            </ol>
            <p> To get started, change the code in app/views/ajax/show.rhtml to look like Listing 5:</p>
            <br />
            <a name="N101A1"><strong>Listing 5. Changing the show view to use Ajax</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;%= javascript_include_tag :defaults %&gt;<br />&lt;h1&gt;Ajax show&lt;/h1&gt;<br />Click this link to show the current <br />&lt;%= link_to_remote &quot;time&quot;, <br />    :update =&gt; 'time_div', <br />    :url =&gt; {:action =&gt; &quot;time&quot;} %&gt;.&lt;br/&gt;<br />&lt;div id='time_div'&gt;<br />&lt;/div&gt;<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>I've made a few changes. First, to handle the configuration, I simply included the requisite JavaScript libraries directly in the view. Usually, I'd have more views, and to avoid repetition I'd include the JavaScript files in a common Rails component, such as a Rails layout. This example has only one view, so I'll keep things simple instead. </p>
            <p> Second, I changed the link tag to use <code>link_to_remote</code>. You'll see what this link does in a moment. Notice the three parameters:</p>
            <ul>
                <li>The link text, which is unchanged from the non-Ajax example.<br />
                <br />
                </li>
                <li>An <code>:update</code> parameter. If you've not seen this syntax before, think of <code>:update =&gt; 'time_div'</code> as a named parameter, where <code>:update</code> is the name and <code>update_div</code> is the value. This code tells the Prototype library that the results from this link will update the HTML element with the name <code>time_div</code>.<br />
                <br />
                </li>
                <li><code>:url =&gt; {:action =&gt; &quot;time&quot;}</code>, which specifies the URL that the link will invoke. <code>:url</code> takes the value of a hash map. In practice, the hash map has only an element for the controller action: <code>:time</code>. In theory, the URL could also include the name of a controller and any optional parameters the controller might need.</li>
            </ul>
            <p>In Listing 5, you can also see the empty <code>div</code> that Rails will update with the current time.</p>
            <p>In your browser, load the page http://localhost:3000/ajax/show. Click the link, and you'll see the result in Figure 3:</p>
            <br />
            <a name="figure3"><strong>Figure 3. A view with Ajax</strong></a><br />
            <img src="http://www-128.ibm.com/developerworks/java/library/j-cb12056/figure-3.jpg" height="197" alt="Simple view with Ajax" width="443" />  <br />
            <p>To get a good feel for what's happening here, view the source for the Web page. Listing 6 shows the code: </p>
            <br />
            <a name="N10201"><strong>Listing 6. The results of the show template, enabled for Ajax</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;script src=&quot;/javascripts/prototype.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/effects.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/dragdrop.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/controls.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/application.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;h1&gt;Ajax show&lt;/h1&gt;<br />Click this link to show the current <br />&lt;a href=&quot;#&quot; onclick=&quot;new Ajax.Updater(<br />   'time_div', '/ajax/time', {asynchronous:true, evalScripts:true}); <br />   return false;&quot;&gt;time&lt;/a&gt;.&lt;br/&gt;<br />&lt;div id='time_div'&gt;<br /><br />&lt;/div&gt;<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>Notice the list of JavaScript includes. The Rails helper -- <code>include_javascript_tags :defaults</code> -- built this list for you. Next, instead of an HTML link, you see a JavaScript function call to build a new <code>Ajax.Updater</code> object. The parameter called <code>asynchronous</code> is set to true, as you would expect. Finally, you see no value within the HTML <code>div</code> tags because the initial page had no value there.</p>
            <br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" height="1" alt="" width="100%" /></td>
                    </tr>
                </tbody>
            </table>
            <table class="no-print" cellspacing="0" align="right" cellpadding="0">
                <tbody>
                    <tr align="right">
                        <td>
                        <table cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" height="16" alt="" width="16" /><br />
                                    </td>
                                    <td align="right" valign="top"><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#main" class="fbox"><strong>Back to top</strong></a></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <br />
            <p><a name="N1021B"><span class="atitle">Using other Ajax options</span></a></p>
            <p> Ajax can generate powerful behaviors, even some unexpected ones. For example, my users might not notice the updated time link. The <code>link_to_remote</code> option lets you easily apply special effects to the item so the user notices the result. I'll apply some of the effects now. Change the <code>link_to_remote</code> helper in show.rhtml to resemble Listing 7: </p>
            <br />
            <a name="N10230"><strong>Listing 7. Adding effects</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">  <br />&lt;%= link_to_remote &quot;time&quot;, <br />    :update =&gt; 'time_div', <br />    :url =&gt; {:action =&gt; &quot;time&quot;},<br />    :complete =&gt; &quot;new Effect.Highlight('time_div')&quot; %&gt;<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>The best Ajax effects draw temporary attention to your change but don't last forever. Your goal should be to alert users to the change without disrupting their workflow. Techniques like this yellow fading highlight, or content that slides in or fades out, won't be permanently distracting. </p>
            <p>So far, the link is the only trigger you've seen. Ajax has several others you can use, with some driven by users and others driven by programmatic events, such as a timer. Something like a clock should not necessarily require user intervention. You can update a timer periodically with Ajax with the <code>periodically_call_remote</code> method. Edit the code in show.rhtml to look like Listing 8:  </p>
            <br />
            <a name="N10245"><strong>Listing 8. Periodically call the remote method</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;%= javascript_include_tag :defaults %&gt;<br />&lt;h1&gt;Ajax show&lt;/h1&gt;<br />&lt;%= periodically_call_remote :update =&gt; 'time_div', <br />                             :url =&gt; {:action =&gt; &quot;time&quot;},<br />                             :frequency =&gt; 1.0 %&gt;<br />&lt;div id='time_div'&gt;<br />&lt;/div&gt;<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>Figure 4 shows the result: a clock that updates at one-second intervals without requiring user interaction:</p>
            <br />
            <a name="figure4"><strong>Figure 4. A clock periodically updated with Ajax</strong></a><br />
            <img src="http://www-128.ibm.com/developerworks/java/library/j-cb12056/figure-4.jpg" height="223" alt="Simple view with Ajax" width="367" />  <br />
            <p>Though the code in the Rails view is similar to the version without Ajax, the underlying code is much different: this version uses JavaScript instead of HTML. You can see the code in Listing 9 by viewing the source in your browser:</p>
            <br />
            <a name="N10265"><strong>Listing 9. The source for periodically_call_remote</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;script src=&quot;/javascripts/prototype.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/effects.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/dragdrop.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/controls.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script src=&quot;/javascripts/application.js?1159113688&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;h1&gt;Ajax show&lt;/h1&gt;<br />&lt;script type=&quot;text/javascript&quot;&gt;<br />//&lt;![CDATA[<br />new PeriodicalExecuter(function() {new Ajax.Updater(<br />   'time_div', '/ajax/time', {asynchronous:true, evalScripts:true})}, 1.0)<br />//]]&gt;<br />&lt;/script&gt;<br />&lt;div id='time_div'&gt;<br />&lt;/div&gt;<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>Pay close attention to what's happening here. Instead of working with tiny fragments of custom JavaScript, you are effectively working at a higher level of abstraction, and the Ruby on Rails templating system makes the usage model feel quite natural. </p>
            <p>As I pointed out earlier, I'm rendering text directly from a controller. That simplification makes it easy to get started but won't hold up over time. My views should handle presentation, and my controllers should marshal data between the view and model. This design technique, called model-view-controller (MVC), makes it easier to isolate changes to a view or model. To enable this application for MVC, I can simply let Rails render the default view, and the contents will replace the previous contents of <code>time-div</code>, just as you'd expect. Change the <code>time</code> method in app/controllers/ajax_controller.rb to resemble the code in Listing 10:</p>
            <br />
            <a name="N1027E"><strong>Listing 10. Refactoring </strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">def time<br />  @time = Time.now<br />end<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>Change the view in app/views/ajax/time.rhtml to resemble Listing 11: </p>
            <br />
            <a name="N1028C"><strong>Listing 11. Using a view to render Ajax content</strong></a><br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="code-outline">
                        <pre class="displaycode">&lt;p&gt;The current time is &lt;%=h @time %&gt;&lt;/p&gt;<br /></pre>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <p>The controller method sets an instance variable called <code>@time</code>. Because the controller renders nothing explicitly, Rails renders the time.rhtml view. <em>That usage model is exactly the same as rendering a view without Ajax.</em> Once again, you can see that the Rails insulates developers from the differences between applications that use Ajax and those that don't. The usage model is strikingly similar across traditional Web applications and Ajax. More Rails applications take advantage of Ajax because the cost of doing so is so low. </p>
            <br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" height="1" alt="" width="100%" /></td>
                    </tr>
                </tbody>
            </table>
            <table class="no-print" cellspacing="0" align="right" cellpadding="0">
                <tbody>
                    <tr align="right">
                        <td>
                        <table cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" height="16" alt="" width="16" /><br />
                                    </td>
                                    <td align="right" valign="top"><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#main" class="fbox"><strong>Back to top</strong></a></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <br />
            <p><a name="N1029D"><span class="atitle">Other uses for Ajax in Rails</span></a></p>
            <p>The Rails Ajax experience is broad and deep -- much deeper than I can cover in a single article or even a series. Rest assured that Rails Ajax support solves some other problems as well. These are some common uses of Ajax in Rails: </p>
            <ul>
                <li> <strong>Submitting remote forms.</strong> Ajax forms in Rails work exactly like traditional forms, except you must submit them asynchronously. That means that <code>Forms</code> helper tags in Rails must let you specify a URL to update, and execute visual effects, just as you did with <code>link_to_remote</code>. The Rails <code>submit_to_remote</code> extends a Rails <code>submit</code> helper just as <code>link-to-remote</code> extends the <code>link_to</code> helper.  <br />
                <br />
                </li>
                <li><strong>Executing complex scripts.</strong> Rails developers often need to execute complex scripts that do more than update a single <code>div</code> and execute effects. Rails provides JavaScript templates for this purpose. With a JavaScript template, you can execute an arbitrary JavaScript script as the result of an Ajax request. Some common uses for these templates, called RJS templates, are updating more than one <code>div</code>, handling form validations, and managing Ajax error scenarios.<br />
                <br />
                </li>
                <li><strong>Completion.</strong> You'd often like to offer your users completion, based on items in a database. For example, if the user types <code>Bru</code>, I'd like my application to notice a value of &quot;Bruce Tate&quot; in the database. I can use Ajax to check periodically for changes in a field and send down suggestions for completion as the user types.<br />
                <br />
                </li>
                <li><strong>Dynamically building complex forms.</strong> In business, you often need to see part of a completed form before you know which fields a user should complete. For example, a 1040EZ tax form is invalid if a user has certain kinds of income or expenses. With Ajax, you can update the form in progress. <br />
                <br />
                </li>
                <li><strong>Drag and drop.</strong> With Rails, you can quickly implement drag-and-drop support with much less effort than most other frameworks require. </li>
            </ul>
            <br />
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" height="1" alt="" width="100%" /></td>
                    </tr>
                </tbody>
            </table>
            <table class="no-print" cellspacing="0" align="right" cellpadding="0">
                <tbody>
                    <tr align="right">
                        <td>
                        <table cellspacing="0" border="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" height="16" alt="" width="16" /><br />
                                    </td>
                                    <td align="right" valign="top"><a href="http://www-128.ibm.com/developerworks/java/library/j-cb12056/#main" class="fbox"><strong>Back to top</strong></a></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <br />
            <p><a name="N102EE"><span class="atitle">Conclusion</span></a></p>
            <p> Ajax is not without its problems. When things go well, the whole experience can be breathtaking. When things break, you may find that debugging takes on a whole new dimension, and debugging techniques and tools still don't match those you'll find in other languages. Ruby on Rails does have one core advantage: simplicity. The Rails wrappers, combined with fantastic community support, make it easy to break into this new world with a very low initial investment. But the Rails support can take you only so far. Two frameworks that do not span the whole Ajax continuum will not satisfy every user. </p>
            <p>The Java language has many more Ajax frameworks and approaches to choose from. You can find much greater flexibility, and you'll also find a fantastic support base. But flexibility comes at a price. You'll need to pick not only a strong Ajax framework, but also a Web development framework. For example, integrating the JSF framework is a dramatically different experience from integrating Struts. New technologies often call for simplification. Ajax on Rails may be just the ticket for problems that require the sophistication of Ajax in the UI but none of the advanced enterprise-integration features the Java language provides. Next time, I'll take a deeper look into JavaScript. Until then, keep crossing borders. </p>
            <br />
            <br />
            <p><a name="resources"><span class="atitle">Resources</span></a></p>
            <strong>Learn</strong><br />
            <ul>
                <li> <a href="http://www.pragmaticprogrammer.com/titles/fr_j2r/index.html"><em>Java To Ruby: Things Every Manager Should Know</em></a> (Pragmatic Bookshelf, 2006): The author's book about when and where it makes sense to make a switch from Java programming to Ruby on Rails, and how to make it. <br />
                <br />
                </li>
                <li> <a href="http://www.oreilly.com/catalog/beyondjava/index.html"><em>Beyond Java</em></a> (O'Reilly, 2005): The author's book about the Java language's rise and plateau and the technologies that could challenge the Java platform in some niches. <br />
                <br />
                </li>
                <li>&quot;<a href="http://www.ibm.com/developerworks/rational/library/dec05/reader/torpey.html">Book review: <em>Agile Web Development with Rails</em></a>&quot; (Darren Torpey, developerWorks, May 2005): Get the scoop on a book that deepens readers' understanding of Rails and the rationale behind agile development approaches. <br />
                <br />
                </li>
                <li>&quot;<a href="http://adaptivepath.com/publications/essays/archives/000385.php">Ajax: A New Approach to Web Applications</a>&quot; (Jesse James Garrett, Adaptive Path, February 2005): Garrett, who coined the term &quot;Ajax,&quot; describes its basic architectural and user experience properties.<br />
                <br />
                </li>
                <li><a href="http://script.aculo.us/">Scriptaculous</a> and <a href="http://prototype.conio.net/">Prototype</a>: The  two JavaScript frameworks that power Rails Ajax. <br />
                <br />
                </li>
                <li><a href="http://wiki.rubyonrails.org/rails/pages/How+to+use+the+Ajax+helpers">Rails Ajax helpers</a>: These helpers shield the Rails developer from the complexities of low-level Ajax programming. <br />
                <br />
                </li>
                <li><a href="http://www.ibm.com/developerworks/ajax">Ajax resource center</a>: The developerWorks Ajax portal includes content, blogs, forums and other resources focused on Ajax programming.  <br />
                <br />
                </li>
                <li><a href="http://ajaxian.com/">Ajaxian</a>: This Ajax portal is an excellent discussion of all things related to Ajax.  <br />
                <br />
                </li>
                <li><a href="http://java.sun.com/blueprints/ajax.html">Ajax BluePrints</a>: A discussion of Ajax frameworks and design techniques for the Java programming language.  <br />
                <br />
                </li>
                <li><a href="http://www.pragmaticprogrammer.com/titles/ruby/index.html"><em>Programming Ruby</em></a> (Dave Thomas et al., Pragmatic Bookshelf, 2005): A popular book on Ruby programming. <br />
                <br />
                </li>
                <li><a href="http://www.ibm.com/developerworks/java/">The Java technology zone</a>: Hundreds of articles about every aspect of Java programming.<br />
                <br />
                </li>
            </ul>
            <br />
            <strong>Get products and technologies</strong><br />
            <ul>
                <li><a href="http://rubyonrails.org/">Ruby on Rails</a>: Download the open source Ruby on Rails Web framework. <br />
                <br />
                </li>
                <li><a href="http://www.ruby-lang.org/en/20020102.html">Ruby</a>: Get Ruby from the project Web site. <br />
                <br />
                </li>
            </ul>
            <br />
            <strong>Discuss</strong><br />
            <ul>
                <li><a href="http://www.ibm.com/developerworks/blogs/">developerWorks blogs</a>: Get involved in the developerWorks community.</li>
            </ul>
            <br />
            <br />
            <p><a name="author"><span class="atitle">About the author</span></a></p>
            <table cellspacing="0" border="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td colspan="3"><img src="http://www.ibm.com/i/c.gif" height="5" alt="" width="100%" /></td>
                    </tr>
                    <tr align="left" valign="top">
                        <td>
                        <p><img src="http://www-106.ibm.com/developerworks/i/p-brucetate.jpg" height="80" align="left" valign="top" alt="Bruce Tate" width="64" /></p>
                        </td>
                        <td><img src="http://www.ibm.com/i/c.gif" height="5" alt="" width="4" /></td>
                        <td width="100%">
                        <p>Bruce Tate is a father, mountain biker, and kayaker in Austin, Texas. He's the author of three best-selling Java books, including the Jolt winner <em>Better, Faster, Lighter Java</em>. He recently released <em>From Java to Ruby</em> and <em>Rails: Up and Running</em>. He spent 13 years at IBM and later formed the RapidRed consultancy, where he specialized in lightweight development strategies and architectures based on Ruby, and in the Ruby on Rails framework. He is now the CTO of WellGood LLC, a company that is forming a marketplace for nonprofit organizations and charitable giving.</p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
          <br/><br/>
          <span style="color:red;">
            <a href="http://gene.javaeye.com/blog/37790#comments" style="color:red;">已有 <strong>0</strong> 人发表留言，猛击-&gt;&gt;<strong>这里</strong>&lt;&lt;-参与讨论</a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 07 Dec 2006 17:07:37 +0800</pubDate>
        <link>http://gene.javaeye.com/blog/37790</link>
        <guid>http://gene.javaeye.com/blog/37790</guid>
      </item>
      <item>
        <title>Ruby on Rails with Oracle FAQs</title>
        <author>Gene</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://gene.javaeye.com">Gene</a>&nbsp;
          链接：<a href="http://gene.javaeye.com/blog/37789" style="color:red;">http://gene.javaeye.com/blog/37789</a>&nbsp;
          发表时间: 2006年12月07日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span class="boldbodycopy"><font color="#666666">Developer: Open Source</font></span>                    <!-- start of download and tags box -->
<table cellspacing="0" border="0" align="right" cellpadding="5" width="200">
    <tbody>
        <tr>
            <td>
            <table cellspacing="0" border="0" align="right" cellpadding="0" width="200">
                <tbody>
                    <tr valign="top">
                        <td height="21" valign="top" colspan="3">
                        <table cellspacing="0" border="0" cellpadding="0" width="200">
                            <tbody>
                                <tr>
                                    <td rowspan="3" height="21" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                                    <td height="1" bgcolor="#cccccc" width="198"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="100%" /></td>
                                    <td rowspan="3" height="21" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                                </tr>
                                <tr>
                                    <td class="portletTitle" height="19" bgcolor="#cccccc" width="198">&nbsp;&nbsp;<strong>DOWNLOAD</strong></td>
                                </tr>
                                <tr>
                                    <td height="1" bgcolor="#cccccc"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="1" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                        <td height="1" valign="top" bgcolor="#efefef" width="198"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="198" /></td>
                        <td height="1" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                    </tr>
                    <tr>
                        <td height="1" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                        <td height="1" valign="top" width="198">
                        <table cellspacing="0" border="0" cellpadding="6">
                            <tbody>
                                <tr>
                                    <td valign="top" width="179">
                                    <table cellspacing="0" border="0" style="width: 179px; height: 41px;" bgcolor="#ffffff" cellpadding="1">
                                        <tbody>
                                            <tr>
                                                <td>
                                                <table border="0" cellpadding="0" width="100%">
                                                    <tbody>
                                                        <tr>
                                                            <td class="bodycopy"><img src="http://oracleimg.com/admin/images/ocom/bullet_5x5.gif" border="0" height="5" align="bottom" alt="" width="5" /> <a href="http://www.oracle.com/technology/software/products/database/xe/index.html" class="bodylink">Oracle Database XE</a> <br />
                                                            <img src="http://oracleimg.com/admin/images/ocom/bullet_5x5.gif" border="0" height="5" align="bottom" alt="" width="5" /> <a href="http://www.oracle.com/technology/tech/oci/instantclient/index.html" class="bodylink">Oracle Instant Client</a> <br />
                                                            <img src="http://oracleimg.com/admin/images/ocom/bullet_5x5.gif" border="0" height="5" align="bottom" alt="" width="5" /> <a href="http://www.rubyonrails.org/down" class="bodylink" target="_blank">Ruby on Rails</a> </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                        <td bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="15" alt="" width="1" /></td>
                    </tr>
                    <tr>
                        <td height="1" colspan="3" bgcolor="#cccccc"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
        <tr>
            <td>
            <table cellspacing="0" border="0" align="right" cellpadding="0" width="200">
                <tbody>
                    <tr valign="top">
                        <td height="21" valign="top" colspan="3">
                        <table cellspacing="0" border="0" cellpadding="0" width="200">
                            <tbody>
                                <tr>
                                    <td rowspan="3" height="21" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                                    <td height="1" bgcolor="#cccccc" width="198"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="198" /></td>
                                    <td rowspan="3" height="21" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                                </tr>
                                <tr>
                                    <td class="portletTitle" height="19" bgcolor="#cccccc" width="200">&nbsp;&nbsp;<strong>TAGS</strong></td>
                                </tr>
                                <tr>
                                    <td height="1" bgcolor="#cccccc"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="1" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                        <td height="1" valign="top" bgcolor="#efefef" width="198"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="198" /></td>
                        <td height="1" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                    </tr>
                    <tr>
                        <td height="1" bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                        <td height="1" valign="top" width="200">
                        <table cellspacing="0" border="0" cellpadding="6">
                            <tbody>
                                <tr>
                                    <td valign="top">
                                    <table cellspacing="0" border="0" bgcolor="#ffffff" cellpadding="1" width="100%">
                                        <tbody>
                                            <tr>
                                                <td>
                                                <table border="0" cellpadding="0" width="100%">
                                                    <tbody>
                                                        <tr>
                                                            <td class="bodycopy"><a href="http://del.icio.us/OracleTechnologyNetwork/ruby" class="bodylink">ruby</a>, <a href="http://del.icio.us/OracleTechnologyNetwork/rubyonrails" class="bodylink">rubyonrails</a>, <a href="http://del.icio.us/OracleTechnologyNetwork" class="bodylink">All</a></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                        <td bgcolor="#cccccc" width="1"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="15" alt="" width="1" /></td>
                    </tr>
                    <tr>
                        <td height="1" colspan="3" bgcolor="#cccccc"><img src="http://www.oracle.com/admin/images/ocom/spacer.gif" border="0" height="1" alt="" width="1" /></td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<!-- end of download and tags box -->
<h1>Ruby on Rails with Oracle FAQs</h1>
<br />
<em>by Casimir Saternos</em>
<p class="boldbodycopy">Exploring Ruby on Rails (RoR)? This FAQ provides basic information about connecting to Oracle, installation, and creating Oracle Database XE + RoR applications. </p>
<p class="legalese">Published December 2006 </p>
<h3>Contents</h3>
<ol>
    <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#1" set="yes" class="bodylink">WHY RUBY ON RAILS?</a></li>
    <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#2" class="bodylink">DEFINITIONS</a>
    <ul>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#2-1" set="yes" class="bodylink">What is Ruby?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#2-2" set="yes" class="bodylink">What is Rails?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#2-3" set="yes" class="bodylink">What is the Model-View-Controller Pattern (MVC)?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#2-4" set="yes" class="bodylink">What is RubyGems?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#2-5" class="bodylink">What is OCI8?</a></li>
    </ul>
    </li>
    <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3" set="yes" class="bodylink">ORACLE DATABASE CONNECTIONS</a>
    <ul>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3-1" set="yes" class="bodylink">What do I need to install to run Ruby on Rails using Oracle Database?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3-2" set="yes" class="bodylink">How can I test OCI8 connectivity?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3-3" set="yes" class="bodylink">How do I configure an Oracle TNSNAMES.ora entry?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3-4" set="yes" class="bodylink">What is Oracle Instance Client?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3-5" set="yes" class="bodylink">What is Oracle Easy Connect Naming?</a></li>
    </ul>
    </li>
    <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4" class="bodylink">INSTALLATION</a>
    <ul>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-1" set="yes" class="bodylink">How do I install Rails and its dependencies?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-2" set="yes" class="bodylink">How do I install Rails and its dependencies if a remote installation fails?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-3" set="yes" class="bodylink">How do I install Ruby on Rails on the Windows OS?</a>
        <ol>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-3-1" class="bodylink">Install Ruby</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-3-2" set="yes" class="bodylink">Install Oracle Database Connectivity Support</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-3-3" class="bodylink">Test the OCI8 connectivity</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-3-4" set="yes" class="bodylink">Install Rails and its dependencies</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-3-5" class="bodylink">Verify the Rails Installation</a></li>
        </ol>
        </li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-4" set="yes" class="bodylink">How do I install Ruby on Rails on Linux?</a>
        <ol>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-4-1" class="bodylink">Install Ruby</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-4-2" class="bodylink">Install Gems</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-4-3" class="bodylink">Install OCI8</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-4-4" set="yes" class="bodylink">Install Rails and its dependencies</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-4-5" class="bodylink">Verify the Rails installation</a></li>
        </ol>
        </li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-5" class="bodylink">Errors During Installation</a>
        <ul>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-5-1" set="yes" class="bodylink">How do I handle an error that indicates a RubyGem could not be found?</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-5-2" class="bodylink">How do I handle an error indicating that a gem could not be found?</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-5-3" set="yes" class="bodylink">How do I handle an error that says the service name cannot be resolved?</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-5-4" set="yes" class="bodylink">What are some Linux-specific erros that can occur?</a></li>
        </ul>
        </li>
    </ul>
    </li>
    <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5" class="bodylink">CREATING AN APPLICATION</a>
    <ul>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-1" set="yes" class="bodylink">What are the Database Object Conventions required by Rails when using Oracle?</a></li>
        <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-2" set="yes" class="bodylink">How do I create a basic Rails application?</a>
        <ol>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-2-1" class="bodylink">Configure the Database</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-2-2" class="bodylink">Create the Rails application</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-2-3" set="yes" class="bodylink">Configure the application to use the Database</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-2-4" class="bodylink">Create the basic Model, Views, and Controller</a></li>
            <li><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-2-5" set="yes" class="bodylink">Test the newly created application</a></li>
        </ol>
        </li>
    </ul>
    </li>
</ol>
<hr />
<!-- **************** [ 1 ] ************************************************************ --> <a name="1"></a>
<h2>1. WHY RUBY ON RAILS?</h2>
<p>Many platforms are available for Web development including Microsoft&rsquo;s .NET, Java 2 Enterprise Edition, and PHP. Why, then, is there so much interest in a new platform using a relatively unfamiliar language?&nbsp; </p>
<p>By its design, Ruby on Rails (RoR) lets you develop Web applications very quickly. It does this by adhering to conventions rather than forcing you to make all of your configuration decisions upfront. As a result, RoR lets you develop running applications in a surprisingly short length of time. Once you install Ruby and its various required packages, you can create a minimal Web application by running less than a half-dozen commands and editing one file (database.yml). RoR includes code generators or libraries that address many of the most common Web development tasks. The Ruby language has the object-oriented capabilities of a language like Java, yet you can also use it to create simple scripts. The language&rsquo;s range of capabilities increases your ability to create applications without having to resort to numerous divergent technologies.</p>
<hr />
<!-- **************** [ 2 ] ************************************************************ --> <a name="2"></a>
<h2>2. DEFINITIONS</h2>
<br />
<a name="2-1"></a>
<h3>What is Ruby?</h3>
<p><a href="http://www.ruby-lang.org/" class="bodylink">Ruby </a> is an object-oriented interpreted scripting language created by Yukihiro Matsumoto. Since the mid 1990s, it has grown in popularity in Japan and has gained recent attention as the language behind the Rails framework. You can use the language for a striking variety of functions&mdash;from basic scripting to creating Windows applications to developing Web applications. You can start using Rails without extensive knowledge of the language; the Rails framework generates the fundamental classes needed for the Web application and uses reflection to perform object-relational mapping to the database. </p>
<a name="2-2"></a>
<h3>What is Rails?</h3>
<p>Rails is a Web application and persistence framework created by David Heinemeier Hansson. It includes the infrastructure you need to create database-backed Web applications that use the Model-View-Control (MVC) pattern. Rails has gained attention as a development framework that lets you rapidly create full-featured database-backed Web applications. </p>
<a name="2-3"></a>
<h3>What is the Model-View-Controller Pattern (MVC)?</h3>
<p>The MVC design pattern is used to separate the following  concerns of an application:</p>
<table class="bodycopy" cellspacing="0" border="1" cellpadding="5" width="60%">
    <tbody>
        <tr>
            <td bgcolor="#cccccc">
            <div align="right"><strong>Model:</strong></div>
            </td>
            <td>Application data, including validation rules</td>
        </tr>
        <tr>
            <td bgcolor="#cccccc">
            <div align="right"><strong>View:</strong></div>
            </td>
            <td>The way data is presented to the end user</td>
        </tr>
        <tr>
            <td bgcolor="#cccccc">
            <div align="right"><strong>Controller:</strong></div>
            </td>
            <td>The way a user manipulates the data within the model</td>
        </tr>
    </tbody>
</table>
<p>This pattern has become popular for Web application development, but it has existed for much longer. Implementations of the pattern have been refined over time and products have been developed to implement it as a framework. You can use Java projects such as Struts and Hibernate to develop applications that leverage the MVC architecture.&nbsp; </p>
<p>In the Rails framework, ActiveRecord deals with Model concerns. It maps database tables to Ruby objects and provides many other features, including a way to easily access data, represent and traverse relationships between tables, validate data, and get data summaries. It also lets you use straight SQL when desired.</p>
<p>The ActionController coordinates interactions between the View and Model layers (letting users change data through the Web). It routes all requests sent to the Web application, provides a filtering mechanism, Web session access, and other features.</p>
<p>The ActionView deals with what&rsquo;s actually displayed to the user (generally in the Web browser). Files that contain HTML and Ruby code are appended with an .rhtml extension. Helper classes are also available to provide data formatting.</p>
<a name="2-4"></a>
<h3>What is RubyGems?</h3>
<p>RubyGems (or simply gems) is the Ruby packaging system used to package Rails components. It provides a standard format for distributing Ruby programs and libraries as well as a tool for managing package installation.</p>
<a name="2-5"></a>
<h3>What is OCI8?</h3>
<p>The Ruby/Oracle Call Interface (OCI8) is a database driver for Ruby/DBI. RubyDBI provides a database-independent interface for Ruby. You install OCI8 to provide a Ruby interface to the underlying Oracle client software. It&rsquo;s somewhat analogous to ODBC or JDBC.</p>
<hr />
<!-- **************** [ 3 ] ************************************************************ --> <a name="3"></a>
<h2>3. ORACLE DATABASE CONNECTIONS</h2>
<br />
<a name="3-1"></a>
<h3>What do I need to install to run Ruby on Rails using Oracle  Database?</h3>
<p>The minimum installation for an  RoR Web application that integrates with Oracle Database must include the  following:</p>
<ul>
    <li>Oracle SQL*Plus or Oracle  Instant Client software</li>
    <li>Ruby</li>
    <li>Gem </li>
    <li>OCI8</li>
    <li>Rails</li>
</ul>
<p>The Rails installation includes an application server sufficient for development and small implementations (WEBrick - for WEB server toolkit). </p>
<p>You can use your favorite text  editor to edit source code files associated with your Web application. </p>
<p>You&rsquo;ll need to install either an Oracle Client or Instant Client to work with the OCI8 software. You must configure the TNSNAMES.ora file with the connection information that lets the Oracle client software connect with the database. A great way to get started is to <a href="http://www.oracle.com/technology/software/products/database/xe/index.html" class="bodylink">download</a> the free <a href="http://www.oracle.com/technology/products/database/xe/index.html" class="bodylink">Oracle Database XE</a>, which will install the Oracle client  and database.</p>
<p>Strictly speaking, you don&rsquo;t need SQL*Plus to run Rails applications. There are Rails-based methods (such as migrations) of creating and maintaining database schemas.&nbsp; </p>
<a name="3-2"></a>
<h3>How can I test OCI8 connectivity?</h3>
<p>To do a simple test to see if you can query a database that contains the demo (HR) schema, run the following one-liner. The output will be a pipe-delimited file. Make sure the HR schema exists and the account is unlocked and enabled. Substitute the name of your Oracle database (designated below as ORCL) and HR password (indicated as hr_password below) in the following command:</p>
<pre>ruby -r oci8 -e &quot;OCI8.new('hr', 'hr_password', 'ORCL').exec('SELECT * FROM jobs<br />ORDER BY 1') do |r| puts  r.join(' | '); end&quot;</pre>
<p>If the connection and query were  successful, the output should look something like this:</p>
<pre>AC_ACCOUNT | Public Accountant  | 4200 | 9000<br />AC_MGR | Accounting Manager  | 8200 | 16000<br />AD_ASST | Administration  Assistant | 3000 | 6000<br />AD_PRES | President | 20000  | 40000<br />AD_VP | Administration Vice  President | 15000 | 30000<br />FI_ACCOUNT | Accountant |  4200 | 9000<br />FI_MGR | Finance Manager |  8200 | 16000<br />HR_REP | Human Resources  Representative | 4000 | 9000<br />IT_PROG | Programmer | 4000  | 10000<br />MK_MAN | Marketing Manager  | 9000 | 15000<br />MK_REP | Marketing  Representative | 4000 | 9000<br />PR_REP | Public Relations  Representative | 4500 | 10500<br />PU_CLERK | Purchasing Clerk  | 2500 | 5500<br />PU_MAN | Purchasing Manager  | 8000 | 15000<br />SA_MAN | Sales Manager |  10000 | 20000<br />SA_REP | Sales  Representative | 6000 | 12000<br />SH_CLERK | Shipping Clerk |  2500 | 5500<br />ST_CLERK | Stock Clerk |  2000 | 5000<br />ST_MAN | Stock Manager |  5500 | 8500</pre>
<a name="3-3"></a>
<h3>How do I configure an Oracle TNSNAMES.ora entry?</h3>
<p>The TNSNAMES.ora file is a plain-text file used by Oracle to determine the information needed to connect to a database. You&rsquo;ll typically find it within the Oracle Home /network/admin directory. Every connection includes the server name (or IP address), the port where the Oracle Listener is running, and the name of the database in view.</p>
<p>Here&rsquo;s an example of a TNS entry  that might appear in the file:</p>
<pre>ORCL =<br />  (DESCRIPTION =<br />    (ADDRESS_LIST =<br />      (ADDRESS = (PROTOCOL = TCP)(HOST = server.company.com)(PORT = 1521))<br />    )<br />    (CONNECT_DATA =<br />      (SERVICE_NAME = ORCL)<br />    )<br />  )<br /></pre>
<p>If you&rsquo;re using Oracle Express Edition, an entry named XE will appear in this file, indicating the database that was created when you installed the software.&nbsp; </p>
<p>To create a new TNS Entry, you can copy an existing entry and modify the database name, port number, and server name accordingly. Depending on your installation, you might also be able to perform the same task with the Oracle Net Configuration Assistant, which provides a GUI that will edit the file for you.</p>
<a name="3-4"></a>
<h3>What is Oracle Instance Client?</h3>
<p>Oracle <br />
Instant Client is software that lets you run your applications without installing the standard Oracle client or having an ORACLE_HOME. You can find a description of the software, download the file, and get installation instructions here: <a href="http://www.oracle.com/technology/tech/oci/instantclient/index.html" set="yes">http://www.oracle.com/technology/tech/oci/instantclient/index.html</a></p>
<p>Once you install Oracle Instant  Client, you can reference databases using Oracle Easy Connect Naming.</p>
<a name="3-5"></a>
<h3>What is Oracle Easy Connect Naming?</h3>
<p>If you don&rsquo;t have a database entry specified in your Oracle TNSNAMES.ora, you can make a connection using easy connect naming.&nbsp; This lets you connect to an Oracle database using only a TCP/IP connect string made up of a host name, port, and service name. You can run a test of OCI8 using Easy Connect Naming as follows (substituting the appropriate values for your password, server, port, and database):</p>
<pre>ruby -r oci8 -e &quot;OCI8.new('hr',  'hr_password', <br />'//server.company.com:1521/orcl').exec('SELECT * FROM jobs order  by 1) do |r| <br />puts r.join(' | '); end&quot;<br /></pre>
<hr />
<!-- **************** [ 4 ] ************************************************************ --> <a name="4"></a>
<h2>4. INSTALLATION</h2>
<br />
<a name="4-1"></a>
<h3>How do I install Rails and its dependencies?</h3>
<p>Before you install Rails, you must  install Ruby and Gems.&nbsp; </p>
<p>To install Rails and its  dependencies, run the following command:</p>
<pre>gem install rails  --include-dependencies</pre>
<p>A number of gems are required for Rails to function. These are the versions we used to create the application described in this FAQ:</p>
<table class="bodycopy" cellspacing="0" border="1" cellpadding="5" width="70%">
    <tbody>
        <tr>
            <td valign="top" bgcolor="#cccccc" width="117">
            <p><strong>Package Name</strong></p>
            </td>
            <td valign="top" bgcolor="#cccccc" width="202">
            <p><strong>File Name (including version)</strong></p>
            </td>
            <td valign="top" bgcolor="#cccccc" width="272">
            <p><strong>Description</strong></p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>actionmailer</p>
            </td>
            <td valign="top" width="202">
            <p>actionmailer-1[1].1.5.gem</p>
            </td>
            <td valign="top" width="272">
            <p>E-mail    support</p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>actionpack</p>
            </td>
            <td valign="top" width="202">
            <p>actionpack-1[1].11.2.gem</p>
            </td>
            <td valign="top" width="272">
            <p>Controller    and View Framework</p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>actionwebservice</p>
            </td>
            <td valign="top" width="202">
            <p>actionwebservice-1[1].0.0.gem</p>
            </td>
            <td valign="top" width="272">
            <p>Web    Service Support</p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>activerecord</p>
            </td>
            <td valign="top" width="202">
            <p>activerecord-1[1].13.2.gem</p>
            </td>
            <td valign="top" width="272">
            <p>Object    Relational Mapping Layer</p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>activesupport</p>
            </td>
            <td valign="top" width="202">
            <p>activesupport-1[1].2.5.gem</p>
            </td>
            <td valign="top" width="272">
            <p>Utility    Classes Used by Rails</p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>Rails</p>
            </td>
            <td valign="top" width="202">
            <p>rails-1[1].0.0.gem</p>
            </td>
            <td valign="top" width="272">
            <p>Ruby-based    MVC Web Application Framework</p>
            </td>
        </tr>
        <tr>
            <td valign="top" width="117">
            <p>Rake</p>
            </td>
            <td valign="top" width="202">
            <p>rake-0[1].6.2.gem</p>
            </td>
            <td valign="top" width="272">
            <p>Ruby Build Program </p>
            </td>
        </tr>
    </tbody>
</table>
<p>If you&rsquo;re behind a firewall or if,  for other reasons, you can&rsquo;t access the remote gems, you can install the  software locally.</p>
<a name="4-2"></a>
<h3>How do I install Rails and its dependencies if a remote  installation fails?</h3>
<p>If your machine is located behind a firewall or if, for other reasons, you can&rsquo;t access the remote gems, download Rails and its dependencies from <a href="http://www.rubyforge.org/" target="_blank">http://www.rubyforge.org</a> and transfer them to your  computer. You can then install each gem locally using a command in the  following form:</p>
<pre>gem install &lt;gem name up to the dash  preceding the version number&gt;.</pre>
<p>For instance:</p>
<pre>gem install actionmailer</pre>
<a name="4-3"></a>
<h3>How do I install Ruby on Rails on the Windows OS?</h3>
<blockquote> <a name="4-3-1"></a>
<h4>1. Install Ruby</h4>
<p>Installing Ruby on Windows is relatively straightforward: download the appropriate version of Ruby (we used ruby182-15.exe with this article) and double-click the installer. If you&rsquo;re not sure which components to install, choose Full Install. In any case, you&rsquo;ll need the RubyGems Package Manager to proceed with the Rails installation.</p>
<p>To make sure that both Ruby and  Gems were installed correctly, run <tt>gem list --local</tt> at the command line to list local gems. The output should  looks something like this:</p>
<pre>*** LOCAL GEMS ***<br /><br />fxri (0.3.2)<br />    Graphical interface to the RI documentation, with search engine.<br /><br />fxruby (1.2.6)<br />    FXRuby is the Ruby binding to the FOX GUI toolkit.<br /><br />sources (0.0.1)<br />    This package provides download sources for remote gem installation<br /></pre>
<p>The installation steps and links  to the various resources are listed on the Ruby on Rails Web site  (<a href="http://www.rubyonrails.org/down">http://www.rubyonrails.org/down</a>).</p>
<a name="4-3-2"></a>
<h4>2. Install Oracle Database Connectivity Support</h4>
<p>Download the Ruby interface for  Oracle from <a href="http://www.rubyforge.org/projects/ruby-oci8">http://www.rubyforge.org/projects/ruby-oci8</a>. This software provides an interface between Oracle Database 8, Oracle Database 9, or Oracle Database 10 through the standard Oracle Client software or through Instant Client. Make sure you choose the Windows version. Navigate to the directory that contains the Ruby program that you downloaded (ruby-oci8-0[1].1.13-mswin.rb at the time of this writing). Run the following command and choose Yes when prompted:</p>
<pre>C:\&gt;ruby ruby-oci8-0[1].1.13-mswin.rb<br /><br />Copy OCI8.rb to c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8<br />Copy oci8.rb to c:/ruby/lib/ruby/site_ruby/1.8<br />Copy oci8lib.so to c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt<br />OK?<br />Enter Yes/No: Yes<br />Copying OCI8.rb to c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8 ... done<br />Copying oci8.rb to c:/ruby/lib/ruby/site_ruby/1.8 ... done<br />Copying oci8lib.so to c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt ... done<br />OK<br /></pre>
<a name="4-3-3"></a>
<h4>3. Test the OCI8 connectivity</h4>
<p>See <em><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#3-2">How can I test OCI8 connectivity?</a></em> </p>
<a name="4-3-4"></a>
<h4>4. Install Rails and its dependencies</h4>
<p>See <em><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#4-1">How do I install Rails and its dependencies?</a></em></p>
<a name="4-3-5"></a>
<h4>5. Verify the Rails Installation</h4>
<p>Using the following command:</p>
<pre>rails -&ndash;help</pre>
<p>should display a Usage message  followed by available options:</p>
<pre>Usage: c:/ruby/bin/rails /path/to/your/app [options]<br />.<br />.<br />.<br /></pre>
</blockquote> <a name="4-4"></a>
<h3>How do I install Ruby on Rails on Linux?</h3>
<blockquote> <a name="4-4-1"></a>
<h4>1. Install Ruby</h4>
<p>Installing Ruby on Linux requires a few extra steps that may not be familiar to those new to Linux. After downloading the appropriate files, follow the same bas