<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: simulate code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 18 May 2008 14:05:04 GMT</pubDate>
    <description>DZone Snippets: simulate code</description>
    <item>
      <title>Getting Started With WWW::Mechanize</title>
      <link>http://snippets.dzone.com/posts/show/5134</link>
      <description>This Ruby code uses WWW:mechanize to act like a web browser.  &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; require 'rubygems'&lt;br /&gt; require 'mechanize'&lt;br /&gt;&lt;br /&gt; agent = WWW::Mechanize.new&lt;br /&gt; page = agent.get('http://google.com/')&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Refer to the documentation at http://mechanize.rubyforge.org/mechanize/. Then gem install mechanize, and try running the code in an irb session.&lt;br /&gt;&lt;br /&gt;output (extract):&lt;br /&gt;&lt;code&gt;&lt;br /&gt;=&gt; #&lt;WWW::Mechanize::Page&lt;br /&gt; {url #&lt;URI::HTTP:0xfdbbbb286 URL:http://www.google.com/&gt;}&lt;br /&gt; {meta}&lt;br /&gt; {title "Google"}&lt;br /&gt; {iframes}&lt;br /&gt; {frames}&lt;br /&gt; {links&lt;br /&gt;  #&lt;WWW::Mechanize::Page::Link&lt;br /&gt;   "Images"&lt;br /&gt;   "http://images.google.com/imghp?hl=en&amp;tab=wi"&gt;&lt;br /&gt;  #&lt;WWW::Mechanize::Page::Link&lt;br /&gt;   "Maps"&lt;br /&gt;   "http://maps.google.com/maps?hl=en&amp;tab=wl"&gt;&lt;br /&gt;  #&lt;WWW::Mechanize::Page::Link&lt;br /&gt;   "News"&lt;br /&gt;   "http://news.google.com/nwshp?hl=en&amp;tab=wn"&gt;&lt;br /&gt;  #&lt;WWW::Mechanize::Page::Link&lt;br /&gt;   "Shopping"&lt;br /&gt;   "http://www.google.com/prdhp?hl=en&amp;tab=wf"&gt;&lt;br /&gt;  #&lt;WWW::Mechanize::Page::Link&lt;br /&gt;   "Gmail"&lt;br /&gt;   "http://mail.google.com/mail/?hl=en&amp;tab=wm"&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 12 Feb 2008 17:53:54 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5134</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Create data frame from variable number of vectors</title>
      <link>http://snippets.dzone.com/posts/show/3842</link>
      <description>// Create a data frame from a varied number of vectors&lt;br /&gt;// Taken from http://article.gmane.org/gmane.comp.lang.r.general/56501/match=create+data+frame&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;N1 &lt;-c(1,2,3,4)&lt;br /&gt;N2 &lt;-c(1,2,3,4)&lt;br /&gt;N3 &lt;-c(1,2,3,4)&lt;br /&gt;abc &lt;-c(1,2,3)&lt;br /&gt;lab &lt;- paste("N", seq(along=abc), sep="")&lt;br /&gt;D &lt;- data.frame(lapply(lab, get))&lt;br /&gt;names(D) &lt;- lab&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 19 Apr 2007 20:08:15 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3842</guid>
      <author>mroutley (Matthew Routley)</author>
    </item>
  </channel>
</rss>
