<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: create code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 00:07:47 GMT</pubDate>
    <description>DZone Snippets: create code</description>
    <item>
      <title>Drawing a single Polyline using SVG</title>
      <link>http://snippets.dzone.com/posts/show/5270</link>
      <description>This code is very similar to &lt;a href="http://snippets.dzone.com/posts/show/5269"&gt;Draw a series of lines using SVG&lt;/a&gt; [dzone.com] but now we can draw a series of points at the same time the mouse button is pressed and is moving. Here's an &lt;a href="http://twitxr.com/image/18451/"&gt;example of the SVG squiggle output&lt;/a&gt; [twitxr.com].&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;svg	xmlns="http://www.w3.org/2000/svg" width="100%"&lt;br /&gt;		xmlns:xlink="http://www.w3.org/1999/xlink" &gt;&lt;br /&gt;  &lt;g id="sketch" class="sketch"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;rect x="0"&lt;br /&gt;y="0" width="100%" height="100%" fill="yellow" /&gt;&lt;br /&gt;  &lt;/g&gt;&lt;br /&gt;&lt;br /&gt;  &lt;script&gt;&lt;br /&gt;  &lt;![CDATA[&lt;br /&gt;  var	xmlns="http://www.w3.org/2000/svg"&lt;br /&gt;  Root=document.documentElement&lt;br /&gt;  on_start(Root)&lt;br /&gt;&lt;br /&gt;  function mouseUp(evt) {&lt;br /&gt;	  on_pen_up(Root);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function on_start(R){&lt;br /&gt;	  var Attr={&lt;br /&gt;	    "onmousemove":"mouseMove",&lt;br /&gt;      "onmousedown":"add_line(evt)",	&lt;br /&gt;      "onmouseup":"mouseUp"&lt;br /&gt;	  }&lt;br /&gt;	  assignAttr(R,Attr)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function on_pen_down(R){&lt;br /&gt;	  var Attr={&lt;br /&gt;	    "onmousemove":"addPoint(evt)",&lt;br /&gt;	    "onmouseup":"on_pen_up(Root)"&lt;br /&gt;	  }&lt;br /&gt;	  assignAttr(R,Attr)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function on_pen_up(R){&lt;br /&gt;	  var Attr={&lt;br /&gt;	    "onmousemove":"null"&lt;br /&gt;	  }&lt;br /&gt;	  assignAttr(R,Attr)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function add_line(evt){&lt;br /&gt;	  //if (evt.target.nodeName!="rect") return&lt;br /&gt;	  var C=document.createElementNS(xmlns,"polyline") &lt;br /&gt;	&lt;br /&gt;	  var Attr={&lt;br /&gt;		  "x":30,&lt;br /&gt;		  "y":180,&lt;br /&gt;		  "fill":'none',&lt;br /&gt;		  "stroke": '#44a',&lt;br /&gt;		  "id":'pl1',&lt;br /&gt;		  "stroke-width":2&lt;br /&gt;	  }&lt;br /&gt;    &lt;br /&gt;	  assignAttr(C,Attr)&lt;br /&gt;	  Root.appendChild(C)&lt;br /&gt;    &lt;br /&gt;	  on_pen_down(Root)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function addPoint (evt) {&lt;br /&gt;    element = document.getElementById('pl1') 	&lt;br /&gt;    var point = element.ownerDocument.documentElement.createSVGPoint(); &lt;br /&gt;    point.x = evt.clientX; &lt;br /&gt;    point.y = evt.clientY;&lt;br /&gt;    &lt;br /&gt;    element.points.appendItem(point);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function assignAttr(O,A){&lt;br /&gt;	  for (i in A) O.setAttributeNS(null,i, A[i])&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  ]]&gt;&lt;br /&gt;  &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;  &lt;text font-size="12pt" x="50" y="20" id="t1"&gt;Click something to move it&lt;/text&gt;&lt;br /&gt;  &lt;text font-size="12pt" x="80" y="40" id="t2"&gt;Click nothing to add something&lt;/text&gt;&lt;br /&gt;&lt;/svg&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;*update 7:44pm*&lt;br /&gt;By simply making the id unique using a global variable count it was possible to draw &lt;a href="http://www.twitxr.com/image/18474/"&gt;multiple polylines&lt;/a&gt; [twitxr.com].</description>
      <pubDate>Sat, 22 Mar 2008 19:15:43 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5270</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Draw a series of lines using SVG</title>
      <link>http://snippets.dzone.com/posts/show/5269</link>
      <description>This code draws a line every time the user presses the mouse button.  Here is an &lt;a href="http://twitxr.com/image/18406/"&gt;example of the SVG output&lt;/a&gt; [twitxr.com].&lt;br /&gt;&lt;br /&gt;Tested in Firefox 3 beta 4.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;br /&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&lt;br /&gt; onclick="addPoint(evt, document.getElementById('pl1'));"&gt; &lt;br /&gt;  &lt;title&gt;click to add point to polyline&lt;/title&gt;&lt;br /&gt;  &lt;script type="text/ecmascript"&gt;&lt;br /&gt;    &lt;![CDATA[ &lt;br /&gt;      function addPoint (evt, element) {&lt;br /&gt;        var point = element.ownerDocument.documentElement.createSVGPoint(); &lt;br /&gt;        point.x = evt.clientX; &lt;br /&gt;        point.y = evt.clientY; &lt;br /&gt;        element.points.appendItem(point);&lt;br /&gt;      }&lt;br /&gt;    ]]&gt;&lt;br /&gt;  &lt;/script&gt; &lt;br /&gt;  &lt;rect x="0" y="0" width="100%" height="100%" fill-opacity="0" /&gt;&lt;br /&gt;  &lt;polyline id="pl1" fill="none" stroke="green" stroke-width="2" points="30,180 50,150" /&gt;&lt;br /&gt;&lt;/svg&gt; &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 22 Mar 2008 16:50:18 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5269</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Create and drag circles in SVG</title>
      <link>http://snippets.dzone.com/posts/show/5268</link>
      <description>Demonstrates creating creating and dragging circles using SVG and ECMAScript.&lt;br /&gt;&lt;br /&gt;Tested on Firefox 3 beta 4.&lt;br /&gt;&lt;br /&gt;file: makeDragDrop.svg&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;svg	xmlns="http://www.w3.org/2000/svg" width="100%"&lt;br /&gt;		xmlns:xlink="http://www.w3.org/1999/xlink" &gt;&lt;br /&gt;&lt;script&gt;&lt;![CDATA[&lt;br /&gt;var	xmlns="http://www.w3.org/2000/svg"&lt;br /&gt;	xlink="http://www.w3.org/1999/xlink" &lt;br /&gt;	Root=document.documentElement&lt;br /&gt;standardize(Root)&lt;br /&gt;&lt;br /&gt;function standardize(R){&lt;br /&gt;	var Attr={&lt;br /&gt;		"onmouseup":"add(evt)",&lt;br /&gt;		"onmousedown":"grab(evt)",&lt;br /&gt;		"onmousemove":null,&lt;br /&gt;		"onmouseover":"hilight(evt)",&lt;br /&gt;		"onmouseout":"hilight(evt)"&lt;br /&gt;	}&lt;br /&gt;	assignAttr(R,Attr)&lt;br /&gt;}&lt;br /&gt;function hilight(evt){&lt;br /&gt;	var T=evt.target&lt;br /&gt;	if (T.nodeName=="rect") return&lt;br /&gt;	if (evt.type=="mouseover") T.setAttributeNS(null,"stroke-opacity",1)&lt;br /&gt;	else T.setAttributeNS(null,"stroke-opacity",.5)&lt;br /&gt;}&lt;br /&gt;function add(evt){&lt;br /&gt;	if (evt.target.nodeName!="rect") return&lt;br /&gt;	var C=document.createElementNS(xmlns,"circle") &lt;br /&gt;	var stroke=Color()&lt;br /&gt;	var rad=10+Math.random()*50&lt;br /&gt;	var Attr={&lt;br /&gt;		r:rad,&lt;br /&gt;		cx:evt.clientX,&lt;br /&gt;		cy:evt.clientY,&lt;br /&gt;		"fill": Color(),&lt;br /&gt;		"fill-opacity":.75,&lt;br /&gt;		"stroke": stroke,&lt;br /&gt;		"stroke-opacity":.5,&lt;br /&gt;		"id":stroke,&lt;br /&gt;		"stroke-width":10+Math.random()*(55-rad)&lt;br /&gt;	}&lt;br /&gt;	assignAttr(C,Attr)&lt;br /&gt;	Root.appendChild(C)&lt;br /&gt;}&lt;br /&gt;function grab(evt){&lt;br /&gt;	var O=evt.target&lt;br /&gt;	if (evt.target.nodeName=="rect") return&lt;br /&gt;	var Attr={&lt;br /&gt;		"onmousemove":"slide(evt,'"+O.id+"')",&lt;br /&gt;		"onmouseup":"standardize(Root)"&lt;br /&gt;	}&lt;br /&gt;	assignAttr(Root,Attr)&lt;br /&gt;}&lt;br /&gt;function slide(evt,id){&lt;br /&gt;	var o=document.getElementById(id)&lt;br /&gt;	var c=""; if (o.nodeName=="circle") c="c"&lt;br /&gt;	o.setAttributeNS(null, c+"x", evt.clientX)&lt;br /&gt;	o.setAttributeNS(null, c+"y", evt.clientY)&lt;br /&gt;}&lt;br /&gt;function assignAttr(O,A){&lt;br /&gt;	for (i in A) O.setAttributeNS(null,i, A[i])&lt;br /&gt;}&lt;br /&gt;function Color(){&lt;br /&gt;	return "rgb("+parseInt(Math.random()*255)+","+parseInt(Math.random()*255)+","+parseInt(Math.random()*255)+")"&lt;br /&gt;}&lt;br /&gt;]]&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;rect width="100%" height="100%" fill="white"/&gt;&lt;br /&gt;&lt;text font-size="12pt" x="50" y="20" id="t1"&gt;Click something to move it&lt;/text&gt;&lt;br /&gt;&lt;text font-size="12pt" x="80" y="40" id="t2"&gt;Click nothing to add something&lt;/text&gt;&lt;br /&gt;&lt;/svg&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Source file copied from &lt;a href="http://srufaculty.sru.edu/david.dailey/svg/makeDragDrop.svg"&gt;http://srufaculty.sru.edu/david.dailey/svg/makeDragDrop.svg&lt;/a&gt;&lt;br /&gt;</description>
      <pubDate>Sat, 22 Mar 2008 00:30:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5268</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Creating a DateTime object with Ruby</title>
      <link>http://snippets.dzone.com/posts/show/5190</link>
      <description>This example creates a date and time variable which represents 22nd March 2008 4:30pm and 12 seconds.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;d2 = DateTime.new(y=200,m=3,d=22, h=16,min=30,s=12)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;or convert a date string into a DataTime object:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;"17/03/2009 17:48:00"[/(\d+)\/(\d+)\/(\d+)\s(\d+):(\d+):(\d+)/]&lt;br /&gt;d2 = DateTime.new(y=$3.to_i,m=$2.to_i,d=$1.to_i, h=$4.to_i,min=$5.to_i,s=$6.to_i)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;or convert a date string into a Time object:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;"22/03/2008 17:48:00"[/(\d+)\/(\d+)\/(\d+)\s(\d+):(\d+):(\d+)/]&lt;br /&gt;iyear = $3.to_i; imonth = $2.to_i; iday = $1.to_i; ihour = $4.to_i; imin = $5.to_i; isec = $6.to_i&lt;br /&gt;twork = Time.local(iyear,imonth,iday,ihour,imin,isec) &lt;br /&gt;puts 'we still have time to party' if Time.now &lt; twork &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Reference:&lt;br /&gt;  &lt;a href="http://www.ruby-doc.org/core/classes/DateTime.html"&gt;Class: DateTime&lt;/a&gt; [ruby-doc.org]&lt;br /&gt;  &lt;a href="http://www.ruby-doc.org/core/classes/Time.html"&gt;Class: Time&lt;/a&gt; [ruby-doc.org]</description>
      <pubDate>Sat, 01 Mar 2008 21:53:38 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5190</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Use Ruby to create a directory</title>
      <link>http://snippets.dzone.com/posts/show/4968</link>
      <description>Create a directory named 'temp' if it doesn't already exist. Source: 'Create a new directory if it's missing' http://snippets.dzone.com/posts/show/2554 [snippets.dzone.com] Reference: mkdir_p http://ruby-doc.org/core/classes/FileUtils.html#M004346 [ruby-doc.org]&lt;br /&gt;&lt;code&gt;&lt;br /&gt;FileUtils.mkdir_p 'temp'&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 09 Jan 2008 20:18:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4968</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Creating a date with Ruby</title>
      <link>http://snippets.dzone.com/posts/show/4917</link>
      <description>This example creates a date variable which represents 22nd March 2008.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  require 'date'&lt;br /&gt;  d1 = Date.new(y=2008,m=3,d=22)&lt;br /&gt;  puts d1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;output: 2008-03-22&lt;br /&gt;</description>
      <pubDate>Sat, 22 Dec 2007 21:41:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4917</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Create a 'countries' table for rails</title>
      <link>http://snippets.dzone.com/posts/show/1727</link>
      <description>I use rails.  It's great.  It automatically creates a select list of countries.  It doesn't, however, know about the 2 and 3 character country code.&lt;br /&gt;&lt;br /&gt;So, I need a country table, with countries.&lt;br /&gt;&lt;br /&gt;This migration creates and populates a 'countries' table.&lt;br /&gt;&lt;br /&gt;You'll have to &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  ./script/generate model Country&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;before you run it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class CreateCountryTable &lt; ActiveRecord::Migration&lt;br /&gt;  def self.up&lt;br /&gt;    ## Create country table&lt;br /&gt;    create_table :countries do |t|&lt;br /&gt;      t.column :iso, :string, :size =&gt; 2&lt;br /&gt;      t.column :name, :string, :size =&gt; 80&lt;br /&gt;      t.column :printable_name, :string, :size =&gt; 80&lt;br /&gt;      t.column :iso3, :string, :size =&gt; 3&lt;br /&gt;      t.column :numcode, :integer&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;    Country.reset_column_information&lt;br /&gt;    Country.create(:iso =&gt; 'AF', :name =&gt; 'AFGHANISTAN', :printable_name =&gt; 'Afghanistan', :iso3 =&gt; 'AFG', :numcode =&gt; '004') &lt;br /&gt;    Country.create(:iso =&gt; 'AL', :name =&gt; 'ALBANIA', :printable_name =&gt; 'Albania', :iso3 =&gt; 'ALB', :numcode =&gt; '008') &lt;br /&gt;    Country.create(:iso =&gt; 'DZ', :name =&gt; 'ALGERIA', :printable_name =&gt; 'Algeria', :iso3 =&gt; 'DZA', :numcode =&gt; '012') &lt;br /&gt;    Country.create(:iso =&gt; 'AS', :name =&gt; 'AMERICAN SAMOA', :printable_name =&gt; 'American Samoa', :iso3 =&gt; 'ASM', :numcode =&gt; '016') &lt;br /&gt;    Country.create(:iso =&gt; 'AD', :name =&gt; 'ANDORRA', :printable_name =&gt; 'Andorra', :iso3 =&gt; 'AND', :numcode =&gt; '020') &lt;br /&gt;    Country.create(:iso =&gt; 'AO', :name =&gt; 'ANGOLA', :printable_name =&gt; 'Angola', :iso3 =&gt; 'AGO', :numcode =&gt; '024') &lt;br /&gt;    Country.create(:iso =&gt; 'AI', :name =&gt; 'ANGUILLA', :printable_name =&gt; 'Anguilla', :iso3 =&gt; 'AIA', :numcode =&gt; '660') &lt;br /&gt;    Country.create(:iso =&gt; 'AG', :name =&gt; 'ANTIGUA AND BARBUDA', :printable_name =&gt; 'Antigua and Barbuda', :iso3 =&gt; 'ATG', :numcode =&gt; '028') &lt;br /&gt;    Country.create(:iso =&gt; 'AR', :name =&gt; 'ARGENTINA', :printable_name =&gt; 'Argentina', :iso3 =&gt; 'ARG', :numcode =&gt; '032') &lt;br /&gt;    Country.create(:iso =&gt; 'AM', :name =&gt; 'ARMENIA', :printable_name =&gt; 'Armenia', :iso3 =&gt; 'ARM', :numcode =&gt; '051') &lt;br /&gt;    Country.create(:iso =&gt; 'AW', :name =&gt; 'ARUBA', :printable_name =&gt; 'Aruba', :iso3 =&gt; 'ABW', :numcode =&gt; '533') &lt;br /&gt;    Country.create(:iso =&gt; 'AU', :name =&gt; 'AUSTRALIA', :printable_name =&gt; 'Australia', :iso3 =&gt; 'AUS', :numcode =&gt; '036') &lt;br /&gt;    Country.create(:iso =&gt; 'AT', :name =&gt; 'AUSTRIA', :printable_name =&gt; 'Austria', :iso3 =&gt; 'AUT', :numcode =&gt; '040') &lt;br /&gt;    Country.create(:iso =&gt; 'AZ', :name =&gt; 'AZERBAIJAN', :printable_name =&gt; 'Azerbaijan', :iso3 =&gt; 'AZE', :numcode =&gt; '031') &lt;br /&gt;    Country.create(:iso =&gt; 'BS', :name =&gt; 'BAHAMAS', :printable_name =&gt; 'Bahamas', :iso3 =&gt; 'BHS', :numcode =&gt; '044') &lt;br /&gt;    Country.create(:iso =&gt; 'BH', :name =&gt; 'BAHRAIN', :printable_name =&gt; 'Bahrain', :iso3 =&gt; 'BHR', :numcode =&gt; '048') &lt;br /&gt;    Country.create(:iso =&gt; 'BD', :name =&gt; 'BANGLADESH', :printable_name =&gt; 'Bangladesh', :iso3 =&gt; 'BGD', :numcode =&gt; '050') &lt;br /&gt;    Country.create(:iso =&gt; 'BB', :name =&gt; 'BARBADOS', :printable_name =&gt; 'Barbados', :iso3 =&gt; 'BRB', :numcode =&gt; '052') &lt;br /&gt;    Country.create(:iso =&gt; 'BY', :name =&gt; 'BELARUS', :printable_name =&gt; 'Belarus', :iso3 =&gt; 'BLR', :numcode =&gt; '112') &lt;br /&gt;    Country.create(:iso =&gt; 'BE', :name =&gt; 'BELGIUM', :printable_name =&gt; 'Belgium', :iso3 =&gt; 'BEL', :numcode =&gt; '056') &lt;br /&gt;    Country.create(:iso =&gt; 'BZ', :name =&gt; 'BELIZE', :printable_name =&gt; 'Belize', :iso3 =&gt; 'BLZ', :numcode =&gt; '084') &lt;br /&gt;    Country.create(:iso =&gt; 'BJ', :name =&gt; 'BENIN', :printable_name =&gt; 'Benin', :iso3 =&gt; 'BEN', :numcode =&gt; '204') &lt;br /&gt;    Country.create(:iso =&gt; 'BM', :name =&gt; 'BERMUDA', :printable_name =&gt; 'Bermuda', :iso3 =&gt; 'BMU', :numcode =&gt; '060') &lt;br /&gt;    Country.create(:iso =&gt; 'BT', :name =&gt; 'BHUTAN', :printable_name =&gt; 'Bhutan', :iso3 =&gt; 'BTN', :numcode =&gt; '064') &lt;br /&gt;    Country.create(:iso =&gt; 'BO', :name =&gt; 'BOLIVIA', :printable_name =&gt; 'Bolivia', :iso3 =&gt; 'BOL', :numcode =&gt; '068') &lt;br /&gt;    Country.create(:iso =&gt; 'BA', :name =&gt; 'BOSNIA AND HERZEGOVINA', :printable_name =&gt; 'Bosnia and Herzegovina', :iso3 =&gt; 'BIH', :numcode =&gt; '070') &lt;br /&gt;    Country.create(:iso =&gt; 'BW', :name =&gt; 'BOTSWANA', :printable_name =&gt; 'Botswana', :iso3 =&gt; 'BWA', :numcode =&gt; '072') &lt;br /&gt;    Country.create(:iso =&gt; 'BR', :name =&gt; 'BRAZIL', :printable_name =&gt; 'Brazil', :iso3 =&gt; 'BRA', :numcode =&gt; '076') &lt;br /&gt;    Country.create(:iso =&gt; 'BN', :name =&gt; 'BRUNEI DARUSSALAM', :printable_name =&gt; 'Brunei Darussalam', :iso3 =&gt; 'BRN', :numcode =&gt; '096') &lt;br /&gt;    Country.create(:iso =&gt; 'BG', :name =&gt; 'BULGARIA', :printable_name =&gt; 'Bulgaria', :iso3 =&gt; 'BGR', :numcode =&gt; '100') &lt;br /&gt;    Country.create(:iso =&gt; 'BF', :name =&gt; 'BURKINA FASO', :printable_name =&gt; 'Burkina Faso', :iso3 =&gt; 'BFA', :numcode =&gt; '854') &lt;br /&gt;    Country.create(:iso =&gt; 'BI', :name =&gt; 'BURUNDI', :printable_name =&gt; 'Burundi', :iso3 =&gt; 'BDI', :numcode =&gt; '108') &lt;br /&gt;    Country.create(:iso =&gt; 'KH', :name =&gt; 'CAMBODIA', :printable_name =&gt; 'Cambodia', :iso3 =&gt; 'KHM', :numcode =&gt; '116') &lt;br /&gt;    Country.create(:iso =&gt; 'CM', :name =&gt; 'CAMEROON', :printable_name =&gt; 'Cameroon', :iso3 =&gt; 'CMR', :numcode =&gt; '120') &lt;br /&gt;    Country.create(:iso =&gt; 'CA', :name =&gt; 'CANADA', :printable_name =&gt; 'Canada', :iso3 =&gt; 'CAN', :numcode =&gt; '124') &lt;br /&gt;    Country.create(:iso =&gt; 'CV', :name =&gt; 'CAPE VERDE', :printable_name =&gt; 'Cape Verde', :iso3 =&gt; 'CPV', :numcode =&gt; '132') &lt;br /&gt;    Country.create(:iso =&gt; 'KY', :name =&gt; 'CAYMAN ISLANDS', :printable_name =&gt; 'Cayman Islands', :iso3 =&gt; 'CYM', :numcode =&gt; '136') &lt;br /&gt;    Country.create(:iso =&gt; 'CF', :name =&gt; 'CENTRAL AFRICAN REPUBLIC', :printable_name =&gt; 'Central African Republic', :iso3 =&gt; 'CAF', :numcode =&gt; '140') &lt;br /&gt;    Country.create(:iso =&gt; 'TD', :name =&gt; 'CHAD', :printable_name =&gt; 'Chad', :iso3 =&gt; 'TCD', :numcode =&gt; '148') &lt;br /&gt;    Country.create(:iso =&gt; 'CL', :name =&gt; 'CHILE', :printable_name =&gt; 'Chile', :iso3 =&gt; 'CHL', :numcode =&gt; '152') &lt;br /&gt;    Country.create(:iso =&gt; 'CN', :name =&gt; 'CHINA', :printable_name =&gt; 'China', :iso3 =&gt; 'CHN', :numcode =&gt; '156') &lt;br /&gt;    Country.create(:iso =&gt; 'CO', :name =&gt; 'COLOMBIA', :printable_name =&gt; 'Colombia', :iso3 =&gt; 'COL', :numcode =&gt; '170') &lt;br /&gt;    Country.create(:iso =&gt; 'KM', :name =&gt; 'COMOROS', :printable_name =&gt; 'Comoros', :iso3 =&gt; 'COM', :numcode =&gt; '174') &lt;br /&gt;    Country.create(:iso =&gt; 'CG', :name =&gt; 'CONGO', :printable_name =&gt; 'Congo', :iso3 =&gt; 'COG', :numcode =&gt; '178') &lt;br /&gt;    Country.create(:iso =&gt; 'CD', :name =&gt; 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', :printable_name =&gt; 'Congo, the Democratic Republic of the', :iso3 =&gt; 'COD', :numcode =&gt; '180') &lt;br /&gt;    Country.create(:iso =&gt; 'CK', :name =&gt; 'COOK ISLANDS', :printable_name =&gt; 'Cook Islands', :iso3 =&gt; 'COK', :numcode =&gt; '184') &lt;br /&gt;    Country.create(:iso =&gt; 'CR', :name =&gt; 'COSTA RICA', :printable_name =&gt; 'Costa Rica', :iso3 =&gt; 'CRI', :numcode =&gt; '188') &lt;br /&gt;    Country.create(:iso =&gt; 'CI', :name =&gt; 'COTE D\'IVOIRE', :printable_name =&gt; 'Cote D\'Ivoire', :iso3 =&gt; 'CIV', :numcode =&gt; '384') &lt;br /&gt;    Country.create(:iso =&gt; 'HR', :name =&gt; 'CROATIA', :printable_name =&gt; 'Croatia', :iso3 =&gt; 'HRV', :numcode =&gt; '191') &lt;br /&gt;    Country.create(:iso =&gt; 'CU', :name =&gt; 'CUBA', :printable_name =&gt; 'Cuba', :iso3 =&gt; 'CUB', :numcode =&gt; '192') &lt;br /&gt;    Country.create(:iso =&gt; 'CY', :name =&gt; 'CYPRUS', :printable_name =&gt; 'Cyprus', :iso3 =&gt; 'CYP', :numcode =&gt; '196') &lt;br /&gt;    Country.create(:iso =&gt; 'CZ', :name =&gt; 'CZECH REPUBLIC', :printable_name =&gt; 'Czech Republic', :iso3 =&gt; 'CZE', :numcode =&gt; '203') &lt;br /&gt;    Country.create(:iso =&gt; 'DK', :name =&gt; 'DENMARK', :printable_name =&gt; 'Denmark', :iso3 =&gt; 'DNK', :numcode =&gt; '208') &lt;br /&gt;    Country.create(:iso =&gt; 'DJ', :name =&gt; 'DJIBOUTI', :printable_name =&gt; 'Djibouti', :iso3 =&gt; 'DJI', :numcode =&gt; '262') &lt;br /&gt;    Country.create(:iso =&gt; 'DM', :name =&gt; 'DOMINICA', :printable_name =&gt; 'Dominica', :iso3 =&gt; 'DMA', :numcode =&gt; '212') &lt;br /&gt;    Country.create(:iso =&gt; 'DO', :name =&gt; 'DOMINICAN REPUBLIC', :printable_name =&gt; 'Dominican Republic', :iso3 =&gt; 'DOM', :numcode =&gt; '214') &lt;br /&gt;    Country.create(:iso =&gt; 'EC', :name =&gt; 'ECUADOR', :printable_name =&gt; 'Ecuador', :iso3 =&gt; 'ECU', :numcode =&gt; '218') &lt;br /&gt;    Country.create(:iso =&gt; 'EG', :name =&gt; 'EGYPT', :printable_name =&gt; 'Egypt', :iso3 =&gt; 'EGY', :numcode =&gt; '818') &lt;br /&gt;    Country.create(:iso =&gt; 'SV', :name =&gt; 'EL SALVADOR', :printable_name =&gt; 'El Salvador', :iso3 =&gt; 'SLV', :numcode =&gt; '222') &lt;br /&gt;    Country.create(:iso =&gt; 'GQ', :name =&gt; 'EQUATORIAL GUINEA', :printable_name =&gt; 'Equatorial Guinea', :iso3 =&gt; 'GNQ', :numcode =&gt; '226') &lt;br /&gt;    Country.create(:iso =&gt; 'ER', :name =&gt; 'ERITREA', :printable_name =&gt; 'Eritrea', :iso3 =&gt; 'ERI', :numcode =&gt; '232') &lt;br /&gt;    Country.create(:iso =&gt; 'EE', :name =&gt; 'ESTONIA', :printable_name =&gt; 'Estonia', :iso3 =&gt; 'EST', :numcode =&gt; '233') &lt;br /&gt;    Country.create(:iso =&gt; 'ET', :name =&gt; 'ETHIOPIA', :printable_name =&gt; 'Ethiopia', :iso3 =&gt; 'ETH', :numcode =&gt; '231') &lt;br /&gt;    Country.create(:iso =&gt; 'FK', :name =&gt; 'FALKLAND ISLANDS (MALVINAS)', :printable_name =&gt; 'Falkland Islands (Malvinas)', :iso3 =&gt; 'FLK', :numcode =&gt; '238') &lt;br /&gt;    Country.create(:iso =&gt; 'FO', :name =&gt; 'FAROE ISLANDS', :printable_name =&gt; 'Faroe Islands', :iso3 =&gt; 'FRO', :numcode =&gt; '234') &lt;br /&gt;    Country.create(:iso =&gt; 'FJ', :name =&gt; 'FIJI', :printable_name =&gt; 'Fiji', :iso3 =&gt; 'FJI', :numcode =&gt; '242') &lt;br /&gt;    Country.create(:iso =&gt; 'FI', :name =&gt; 'FINLAND', :printable_name =&gt; 'Finland', :iso3 =&gt; 'FIN', :numcode =&gt; '246') &lt;br /&gt;    Country.create(:iso =&gt; 'FR', :name =&gt; 'FRANCE', :printable_name =&gt; 'France', :iso3 =&gt; 'FRA', :numcode =&gt; '250') &lt;br /&gt;    Country.create(:iso =&gt; 'GF', :name =&gt; 'FRENCH GUIANA', :printable_name =&gt; 'French Guiana', :iso3 =&gt; 'GUF', :numcode =&gt; '254') &lt;br /&gt;    Country.create(:iso =&gt; 'PF', :name =&gt; 'FRENCH POLYNESIA', :printable_name =&gt; 'French Polynesia', :iso3 =&gt; 'PYF', :numcode =&gt; '258') &lt;br /&gt;    Country.create(:iso =&gt; 'GA', :name =&gt; 'GABON', :printable_name =&gt; 'Gabon', :iso3 =&gt; 'GAB', :numcode =&gt; '266') &lt;br /&gt;    Country.create(:iso =&gt; 'GM', :name =&gt; 'GAMBIA', :printable_name =&gt; 'Gambia', :iso3 =&gt; 'GMB', :numcode =&gt; '270') &lt;br /&gt;    Country.create(:iso =&gt; 'GE', :name =&gt; 'GEORGIA', :printable_name =&gt; 'Georgia', :iso3 =&gt; 'GEO', :numcode =&gt; '268') &lt;br /&gt;    Country.create(:iso =&gt; 'DE', :name =&gt; 'GERMANY', :printable_name =&gt; 'Germany', :iso3 =&gt; 'DEU', :numcode =&gt; '276') &lt;br /&gt;    Country.create(:iso =&gt; 'GH', :name =&gt; 'GHANA', :printable_name =&gt; 'Ghana', :iso3 =&gt; 'GHA', :numcode =&gt; '288') &lt;br /&gt;    Country.create(:iso =&gt; 'GI', :name =&gt; 'GIBRALTAR', :printable_name =&gt; 'Gibraltar', :iso3 =&gt; 'GIB', :numcode =&gt; '292') &lt;br /&gt;    Country.create(:iso =&gt; 'GR', :name =&gt; 'GREECE', :printable_name =&gt; 'Greece', :iso3 =&gt; 'GRC', :numcode =&gt; '300') &lt;br /&gt;    Country.create(:iso =&gt; 'GL', :name =&gt; 'GREENLAND', :printable_name =&gt; 'Greenland', :iso3 =&gt; 'GRL', :numcode =&gt; '304') &lt;br /&gt;    Country.create(:iso =&gt; 'GD', :name =&gt; 'GRENADA', :printable_name =&gt; 'Grenada', :iso3 =&gt; 'GRD', :numcode =&gt; '308') &lt;br /&gt;    Country.create(:iso =&gt; 'GP', :name =&gt; 'GUADELOUPE', :printable_name =&gt; 'Guadeloupe', :iso3 =&gt; 'GLP', :numcode =&gt; '312') &lt;br /&gt;    Country.create(:iso =&gt; 'GU', :name =&gt; 'GUAM', :printable_name =&gt; 'Guam', :iso3 =&gt; 'GUM', :numcode =&gt; '316') &lt;br /&gt;    Country.create(:iso =&gt; 'GT', :name =&gt; 'GUATEMALA', :printable_name =&gt; 'Guatemala', :iso3 =&gt; 'GTM', :numcode =&gt; '320') &lt;br /&gt;    Country.create(:iso =&gt; 'GN', :name =&gt; 'GUINEA', :printable_name =&gt; 'Guinea', :iso3 =&gt; 'GIN', :numcode =&gt; '324') &lt;br /&gt;    Country.create(:iso =&gt; 'GW', :name =&gt; 'GUINEA-BISSAU', :printable_name =&gt; 'Guinea-Bissau', :iso3 =&gt; 'GNB', :numcode =&gt; '624') &lt;br /&gt;    Country.create(:iso =&gt; 'GY', :name =&gt; 'GUYANA', :printable_name =&gt; 'Guyana', :iso3 =&gt; 'GUY', :numcode =&gt; '328') &lt;br /&gt;    Country.create(:iso =&gt; 'HT', :name =&gt; 'HAITI', :printable_name =&gt; 'Haiti', :iso3 =&gt; 'HTI', :numcode =&gt; '332') &lt;br /&gt;    Country.create(:iso =&gt; 'VA', :name =&gt; 'HOLY SEE (VATICAN CITY STATE)', :printable_name =&gt; 'Holy See (Vatican City State)', :iso3 =&gt; 'VAT', :numcode =&gt; '336') &lt;br /&gt;    Country.create(:iso =&gt; 'HN', :name =&gt; 'HONDURAS', :printable_name =&gt; 'Honduras', :iso3 =&gt; 'HND', :numcode =&gt; '340') &lt;br /&gt;    Country.create(:iso =&gt; 'HK', :name =&gt; 'HONG KONG', :printable_name =&gt; 'Hong Kong', :iso3 =&gt; 'HKG', :numcode =&gt; '344') &lt;br /&gt;    Country.create(:iso =&gt; 'HU', :name =&gt; 'HUNGARY', :printable_name =&gt; 'Hungary', :iso3 =&gt; 'HUN', :numcode =&gt; '348') &lt;br /&gt;    Country.create(:iso =&gt; 'IS', :name =&gt; 'ICELAND', :printable_name =&gt; 'Iceland', :iso3 =&gt; 'ISL', :numcode =&gt; '352') &lt;br /&gt;    Country.create(:iso =&gt; 'IN', :name =&gt; 'INDIA', :printable_name =&gt; 'India', :iso3 =&gt; 'IND', :numcode =&gt; '356') &lt;br /&gt;    Country.create(:iso =&gt; 'ID', :name =&gt; 'INDONESIA', :printable_name =&gt; 'Indonesia', :iso3 =&gt; 'IDN', :numcode =&gt; '360') &lt;br /&gt;    Country.create(:iso =&gt; 'IR', :name =&gt; 'IRAN, ISLAMIC REPUBLIC OF', :printable_name =&gt; 'Iran, Islamic Republic of', :iso3 =&gt; 'IRN', :numcode =&gt; '364') &lt;br /&gt;    Country.create(:iso =&gt; 'IQ', :name =&gt; 'IRAQ', :printable_name =&gt; 'Iraq', :iso3 =&gt; 'IRQ', :numcode =&gt; '368') &lt;br /&gt;    Country.create(:iso =&gt; 'IE', :name =&gt; 'IRELAND', :printable_name =&gt; 'Ireland', :iso3 =&gt; 'IRL', :numcode =&gt; '372') &lt;br /&gt;    Country.create(:iso =&gt; 'IL', :name =&gt; 'ISRAEL', :printable_name =&gt; 'Israel', :iso3 =&gt; 'ISR', :numcode =&gt; '376') &lt;br /&gt;    Country.create(:iso =&gt; 'IT', :name =&gt; 'ITALY', :printable_name =&gt; 'Italy', :iso3 =&gt; 'ITA', :numcode =&gt; '380') &lt;br /&gt;    Country.create(:iso =&gt; 'JM', :name =&gt; 'JAMAICA', :printable_name =&gt; 'Jamaica', :iso3 =&gt; 'JAM', :numcode =&gt; '388') &lt;br /&gt;    Country.create(:iso =&gt; 'JP', :name =&gt; 'JAPAN', :printable_name =&gt; 'Japan', :iso3 =&gt; 'JPN', :numcode =&gt; '392') &lt;br /&gt;    Country.create(:iso =&gt; 'JO', :name =&gt; 'JORDAN', :printable_name =&gt; 'Jordan', :iso3 =&gt; 'JOR', :numcode =&gt; '400') &lt;br /&gt;    Country.create(:iso =&gt; 'KZ', :name =&gt; 'KAZAKHSTAN', :printable_name =&gt; 'Kazakhstan', :iso3 =&gt; 'KAZ', :numcode =&gt; '398') &lt;br /&gt;    Country.create(:iso =&gt; 'KE', :name =&gt; 'KENYA', :printable_name =&gt; 'Kenya', :iso3 =&gt; 'KEN', :numcode =&gt; '404') &lt;br /&gt;    Country.create(:iso =&gt; 'KI', :name =&gt; 'KIRIBATI', :printable_name =&gt; 'Kiribati', :iso3 =&gt; 'KIR', :numcode =&gt; '296') &lt;br /&gt;    Country.create(:iso =&gt; 'KP', :name =&gt; 'KOREA, DEMOCRATIC PEOPLE\'S REPUBLIC OF', :printable_name =&gt; 'Korea, Democratic People\'s Republic of', :iso3 =&gt; 'PRK', :numcode =&gt; '408') &lt;br /&gt;    Country.create(:iso =&gt; 'KR', :name =&gt; 'KOREA, REPUBLIC OF', :printable_name =&gt; 'Korea, Republic of', :iso3 =&gt; 'KOR', :numcode =&gt; '410') &lt;br /&gt;    Country.create(:iso =&gt; 'KW', :name =&gt; 'KUWAIT', :printable_name =&gt; 'Kuwait', :iso3 =&gt; 'KWT', :numcode =&gt; '414') &lt;br /&gt;    Country.create(:iso =&gt; 'KG', :name =&gt; 'KYRGYZSTAN', :printable_name =&gt; 'Kyrgyzstan', :iso3 =&gt; 'KGZ', :numcode =&gt; '417') &lt;br /&gt;    Country.create(:iso =&gt; 'LA', :name =&gt; 'LAO PEOPLE\'S DEMOCRATIC REPUBLIC', :printable_name =&gt; 'Lao People\'s Democratic Republic', :iso3 =&gt; 'LAO', :numcode =&gt; '418') &lt;br /&gt;    Country.create(:iso =&gt; 'LV', :name =&gt; 'LATVIA', :printable_name =&gt; 'Latvia', :iso3 =&gt; 'LVA', :numcode =&gt; '428') &lt;br /&gt;    Country.create(:iso =&gt; 'LB', :name =&gt; 'LEBANON', :printable_name =&gt; 'Lebanon', :iso3 =&gt; 'LBN', :numcode =&gt; '422') &lt;br /&gt;    Country.create(:iso =&gt; 'LS', :name =&gt; 'LESOTHO', :printable_name =&gt; 'Lesotho', :iso3 =&gt; 'LSO', :numcode =&gt; '426') &lt;br /&gt;    Country.create(:iso =&gt; 'LR', :name =&gt; 'LIBERIA', :printable_name =&gt; 'Liberia', :iso3 =&gt; 'LBR', :numcode =&gt; '430') &lt;br /&gt;    Country.create(:iso =&gt; 'LY', :name =&gt; 'LIBYAN ARAB JAMAHIRIYA', :printable_name =&gt; 'Libyan Arab Jamahiriya', :iso3 =&gt; 'LBY', :numcode =&gt; '434') &lt;br /&gt;    Country.create(:iso =&gt; 'LI', :name =&gt; 'LIECHTENSTEIN', :printable_name =&gt; 'Liechtenstein', :iso3 =&gt; 'LIE', :numcode =&gt; '438') &lt;br /&gt;    Country.create(:iso =&gt; 'LT', :name =&gt; 'LITHUANIA', :printable_name =&gt; 'Lithuania', :iso3 =&gt; 'LTU', :numcode =&gt; '440') &lt;br /&gt;    Country.create(:iso =&gt; 'LU', :name =&gt; 'LUXEMBOURG', :printable_name =&gt; 'Luxembourg', :iso3 =&gt; 'LUX', :numcode =&gt; '442') &lt;br /&gt;    Country.create(:iso =&gt; 'MO', :name =&gt; 'MACAO', :printable_name =&gt; 'Macao', :iso3 =&gt; 'MAC', :numcode =&gt; '446') &lt;br /&gt;    Country.create(:iso =&gt; 'MK', :name =&gt; 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', :printable_name =&gt; 'Macedonia, the Former Yugoslav Republic of', :iso3 =&gt; 'MKD', :numcode =&gt; '807') &lt;br /&gt;    Country.create(:iso =&gt; 'MG', :name =&gt; 'MADAGASCAR', :printable_name =&gt; 'Madagascar', :iso3 =&gt; 'MDG', :numcode =&gt; '450') &lt;br /&gt;    Country.create(:iso =&gt; 'MW', :name =&gt; 'MALAWI', :printable_name =&gt; 'Malawi', :iso3 =&gt; 'MWI', :numcode =&gt; '454') &lt;br /&gt;    Country.create(:iso =&gt; 'MY', :name =&gt; 'MALAYSIA', :printable_name =&gt; 'Malaysia', :iso3 =&gt; 'MYS', :numcode =&gt; '458') &lt;br /&gt;    Country.create(:iso =&gt; 'MV', :name =&gt; 'MALDIVES', :printable_name =&gt; 'Maldives', :iso3 =&gt; 'MDV', :numcode =&gt; '462') &lt;br /&gt;    Country.create(:iso =&gt; 'ML', :name =&gt; 'MALI', :printable_name =&gt; 'Mali', :iso3 =&gt; 'MLI', :numcode =&gt; '466') &lt;br /&gt;    Country.create(:iso =&gt; 'MT', :name =&gt; 'MALTA', :printable_name =&gt; 'Malta', :iso3 =&gt; 'MLT', :numcode =&gt; '470') &lt;br /&gt;    Country.create(:iso =&gt; 'MH', :name =&gt; 'MARSHALL ISLANDS', :printable_name =&gt; 'Marshall Islands', :iso3 =&gt; 'MHL', :numcode =&gt; '584') &lt;br /&gt;    Country.create(:iso =&gt; 'MQ', :name =&gt; 'MARTINIQUE', :printable_name =&gt; 'Martinique', :iso3 =&gt; 'MTQ', :numcode =&gt; '474') &lt;br /&gt;    Country.create(:iso =&gt; 'MR', :name =&gt; 'MAURITANIA', :printable_name =&gt; 'Mauritania', :iso3 =&gt; 'MRT', :numcode =&gt; '478') &lt;br /&gt;    Country.create(:iso =&gt; 'MU', :name =&gt; 'MAURITIUS', :printable_name =&gt; 'Mauritius', :iso3 =&gt; 'MUS', :numcode =&gt; '480') &lt;br /&gt;    Country.create(:iso =&gt; 'MX', :name =&gt; 'MEXICO', :printable_name =&gt; 'Mexico', :iso3 =&gt; 'MEX', :numcode =&gt; '484') &lt;br /&gt;    Country.create(:iso =&gt; 'FM', :name =&gt; 'MICRONESIA, FEDERATED STATES OF', :printable_name =&gt; 'Micronesia, Federated States of', :iso3 =&gt; 'FSM', :numcode =&gt; '583') &lt;br /&gt;    Country.create(:iso =&gt; 'MD', :name =&gt; 'MOLDOVA, REPUBLIC OF', :printable_name =&gt; 'Moldova, Republic of', :iso3 =&gt; 'MDA', :numcode =&gt; '498') &lt;br /&gt;    Country.create(:iso =&gt; 'MC', :name =&gt; 'MONACO', :printable_name =&gt; 'Monaco', :iso3 =&gt; 'MCO', :numcode =&gt; '492') &lt;br /&gt;    Country.create(:iso =&gt; 'MN', :name =&gt; 'MONGOLIA', :printable_name =&gt; 'Mongolia', :iso3 =&gt; 'MNG', :numcode =&gt; '496') &lt;br /&gt;    Country.create(:iso =&gt; 'MS', :name =&gt; 'MONTSERRAT', :printable_name =&gt; 'Montserrat', :iso3 =&gt; 'MSR', :numcode =&gt; '500') &lt;br /&gt;    Country.create(:iso =&gt; 'MA', :name =&gt; 'MOROCCO', :printable_name =&gt; 'Morocco', :iso3 =&gt; 'MAR', :numcode =&gt; '504') &lt;br /&gt;    Country.create(:iso =&gt; 'MZ', :name =&gt; 'MOZAMBIQUE', :printable_name =&gt; 'Mozambique', :iso3 =&gt; 'MOZ', :numcode =&gt; '508') &lt;br /&gt;    Country.create(:iso =&gt; 'MM', :name =&gt; 'MYANMAR', :printable_name =&gt; 'Myanmar', :iso3 =&gt; 'MMR', :numcode =&gt; '104') &lt;br /&gt;    Country.create(:iso =&gt; 'NA', :name =&gt; 'NAMIBIA', :printable_name =&gt; 'Namibia', :iso3 =&gt; 'NAM', :numcode =&gt; '516') &lt;br /&gt;    Country.create(:iso =&gt; 'NR', :name =&gt; 'NAURU', :printable_name =&gt; 'Nauru', :iso3 =&gt; 'NRU', :numcode =&gt; '520') &lt;br /&gt;    Country.create(:iso =&gt; 'NP', :name =&gt; 'NEPAL', :printable_name =&gt; 'Nepal', :iso3 =&gt; 'NPL', :numcode =&gt; '524') &lt;br /&gt;    Country.create(:iso =&gt; 'NL', :name =&gt; 'NETHERLANDS', :printable_name =&gt; 'Netherlands', :iso3 =&gt; 'NLD', :numcode =&gt; '528') &lt;br /&gt;    Country.create(:iso =&gt; 'AN', :name =&gt; 'NETHERLANDS ANTILLES', :printable_name =&gt; 'Netherlands Antilles', :iso3 =&gt; 'ANT', :numcode =&gt; '530') &lt;br /&gt;    Country.create(:iso =&gt; 'NC', :name =&gt; 'NEW CALEDONIA', :printable_name =&gt; 'New Caledonia', :iso3 =&gt; 'NCL', :numcode =&gt; '540') &lt;br /&gt;    Country.create(:iso =&gt; 'NZ', :name =&gt; 'NEW ZEALAND', :printable_name =&gt; 'New Zealand', :iso3 =&gt; 'NZL', :numcode =&gt; '554') &lt;br /&gt;    Country.create(:iso =&gt; 'NI', :name =&gt; 'NICARAGUA', :printable_name =&gt; 'Nicaragua', :iso3 =&gt; 'NIC', :numcode =&gt; '558') &lt;br /&gt;    Country.create(:iso =&gt; 'NE', :name =&gt; 'NIGER', :printable_name =&gt; 'Niger', :iso3 =&gt; 'NER', :numcode =&gt; '562') &lt;br /&gt;    Country.create(:iso =&gt; 'NG', :name =&gt; 'NIGERIA', :printable_name =&gt; 'Nigeria', :iso3 =&gt; 'NGA', :numcode =&gt; '566') &lt;br /&gt;    Country.create(:iso =&gt; 'NU', :name =&gt; 'NIUE', :printable_name =&gt; 'Niue', :iso3 =&gt; 'NIU', :numcode =&gt; '570') &lt;br /&gt;    Country.create(:iso =&gt; 'NF', :name =&gt; 'NORFOLK ISLAND', :printable_name =&gt; 'Norfolk Island', :iso3 =&gt; 'NFK', :numcode =&gt; '574') &lt;br /&gt;    Country.create(:iso =&gt; 'MP', :name =&gt; 'NORTHERN MARIANA ISLANDS', :printable_name =&gt; 'Northern Mariana Islands', :iso3 =&gt; 'MNP', :numcode =&gt; '580') &lt;br /&gt;    Country.create(:iso =&gt; 'NO', :name =&gt; 'NORWAY', :printable_name =&gt; 'Norway', :iso3 =&gt; 'NOR', :numcode =&gt; '578') &lt;br /&gt;    Country.create(:iso =&gt; 'OM', :name =&gt; 'OMAN', :printable_name =&gt; 'Oman', :iso3 =&gt; 'OMN', :numcode =&gt; '512') &lt;br /&gt;    Country.create(:iso =&gt; 'PK', :name =&gt; 'PAKISTAN', :printable_name =&gt; 'Pakistan', :iso3 =&gt; 'PAK', :numcode =&gt; '586') &lt;br /&gt;    Country.create(:iso =&gt; 'PW', :name =&gt; 'PALAU', :printable_name =&gt; 'Palau', :iso3 =&gt; 'PLW', :numcode =&gt; '585') &lt;br /&gt;    Country.create(:iso =&gt; 'PA', :name =&gt; 'PANAMA', :printable_name =&gt; 'Panama', :iso3 =&gt; 'PAN', :numcode =&gt; '591') &lt;br /&gt;    Country.create(:iso =&gt; 'PG', :name =&gt; 'PAPUA NEW GUINEA', :printable_name =&gt; 'Papua New Guinea', :iso3 =&gt; 'PNG', :numcode =&gt; '598') &lt;br /&gt;    Country.create(:iso =&gt; 'PY', :name =&gt; 'PARAGUAY', :printable_name =&gt; 'Paraguay', :iso3 =&gt; 'PRY', :numcode =&gt; '600') &lt;br /&gt;    Country.create(:iso =&gt; 'PE', :name =&gt; 'PERU', :printable_name =&gt; 'Peru', :iso3 =&gt; 'PER', :numcode =&gt; '604') &lt;br /&gt;    Country.create(:iso =&gt; 'PH', :name =&gt; 'PHILIPPINES', :printable_name =&gt; 'Philippines', :iso3 =&gt; 'PHL', :numcode =&gt; '608') &lt;br /&gt;    Country.create(:iso =&gt; 'PN', :name =&gt; 'PITCAIRN', :printable_name =&gt; 'Pitcairn', :iso3 =&gt; 'PCN', :numcode =&gt; '612') &lt;br /&gt;    Country.create(:iso =&gt; 'PL', :name =&gt; 'POLAND', :printable_name =&gt; 'Poland', :iso3 =&gt; 'POL', :numcode =&gt; '616') &lt;br /&gt;    Country.create(:iso =&gt; 'PT', :name =&gt; 'PORTUGAL', :printable_name =&gt; 'Portugal', :iso3 =&gt; 'PRT', :numcode =&gt; '620') &lt;br /&gt;    Country.create(:iso =&gt; 'PR', :name =&gt; 'PUERTO RICO', :printable_name =&gt; 'Puerto Rico', :iso3 =&gt; 'PRI', :numcode =&gt; '630') &lt;br /&gt;    Country.create(:iso =&gt; 'QA', :name =&gt; 'QATAR', :printable_name =&gt; 'Qatar', :iso3 =&gt; 'QAT', :numcode =&gt; '634') &lt;br /&gt;    Country.create(:iso =&gt; 'RE', :name =&gt; 'REUNION', :printable_name =&gt; 'Reunion', :iso3 =&gt; 'REU', :numcode =&gt; '638') &lt;br /&gt;    Country.create(:iso =&gt; 'RO', :name =&gt; 'ROMANIA', :printable_name =&gt; 'Romania', :iso3 =&gt; 'ROM', :numcode =&gt; '642') &lt;br /&gt;    Country.create(:iso =&gt; 'RU', :name =&gt; 'RUSSIAN FEDERATION', :printable_name =&gt; 'Russian Federation', :iso3 =&gt; 'RUS', :numcode =&gt; '643') &lt;br /&gt;    Country.create(:iso =&gt; 'RW', :name =&gt; 'RWANDA', :printable_name =&gt; 'Rwanda', :iso3 =&gt; 'RWA', :numcode =&gt; '646') &lt;br /&gt;    Country.create(:iso =&gt; 'SH', :name =&gt; 'SAINT HELENA', :printable_name =&gt; 'Saint Helena', :iso3 =&gt; 'SHN', :numcode =&gt; '654') &lt;br /&gt;    Country.create(:iso =&gt; 'KN', :name =&gt; 'SAINT KITTS AND NEVIS', :printable_name =&gt; 'Saint Kitts and Nevis', :iso3 =&gt; 'KNA', :numcode =&gt; '659') &lt;br /&gt;    Country.create(:iso =&gt; 'LC', :name =&gt; 'SAINT LUCIA', :printable_name =&gt; 'Saint Lucia', :iso3 =&gt; 'LCA', :numcode =&gt; '662') &lt;br /&gt;    Country.create(:iso =&gt; 'PM', :name =&gt; 'SAINT PIERRE AND MIQUELON', :printable_name =&gt; 'Saint Pierre and Miquelon', :iso3 =&gt; 'SPM', :numcode =&gt; '666') &lt;br /&gt;    Country.create(:iso =&gt; 'VC', :name =&gt; 'SAINT VINCENT AND THE GRENADINES', :printable_name =&gt; 'Saint Vincent and the Grenadines', :iso3 =&gt; 'VCT', :numcode =&gt; '670') &lt;br /&gt;    Country.create(:iso =&gt; 'WS', :name =&gt; 'SAMOA', :printable_name =&gt; 'Samoa', :iso3 =&gt; 'WSM', :numcode =&gt; '882') &lt;br /&gt;    Country.create(:iso =&gt; 'SM', :name =&gt; 'SAN MARINO', :printable_name =&gt; 'San Marino', :iso3 =&gt; 'SMR', :numcode =&gt; '674') &lt;br /&gt;    Country.create(:iso =&gt; 'ST', :name =&gt; 'SAO TOME AND PRINCIPE', :printable_name =&gt; 'Sao Tome and Principe', :iso3 =&gt; 'STP', :numcode =&gt; '678') &lt;br /&gt;    Country.create(:iso =&gt; 'SA', :name =&gt; 'SAUDI ARABIA', :printable_name =&gt; 'Saudi Arabia', :iso3 =&gt; 'SAU', :numcode =&gt; '682') &lt;br /&gt;    Country.create(:iso =&gt; 'SN', :name =&gt; 'SENEGAL', :printable_name =&gt; 'Senegal', :iso3 =&gt; 'SEN', :numcode =&gt; '686') &lt;br /&gt;    Country.create(:iso =&gt; 'SC', :name =&gt; 'SEYCHELLES', :printable_name =&gt; 'Seychelles', :iso3 =&gt; 'SYC', :numcode =&gt; '690') &lt;br /&gt;    Country.create(:iso =&gt; 'SL', :name =&gt; 'SIERRA LEONE', :printable_name =&gt; 'Sierra Leone', :iso3 =&gt; 'SLE', :numcode =&gt; '694') &lt;br /&gt;    Country.create(:iso =&gt; 'SG', :name =&gt; 'SINGAPORE', :printable_name =&gt; 'Singapore', :iso3 =&gt; 'SGP', :numcode =&gt; '702') &lt;br /&gt;    Country.create(:iso =&gt; 'SK', :name =&gt; 'SLOVAKIA', :printable_name =&gt; 'Slovakia', :iso3 =&gt; 'SVK', :numcode =&gt; '703') &lt;br /&gt;    Country.create(:iso =&gt; 'SI', :name =&gt; 'SLOVENIA', :printable_name =&gt; 'Slovenia', :iso3 =&gt; 'SVN', :numcode =&gt; '705') &lt;br /&gt;    Country.create(:iso =&gt; 'SB', :name =&gt; 'SOLOMON ISLANDS', :printable_name =&gt; 'Solomon Islands', :iso3 =&gt; 'SLB', :numcode =&gt; '090') &lt;br /&gt;    Country.create(:iso =&gt; 'SO', :name =&gt; 'SOMALIA', :printable_name =&gt; 'Somalia', :iso3 =&gt; 'SOM', :numcode =&gt; '706') &lt;br /&gt;    Country.create(:iso =&gt; 'ZA', :name =&gt; 'SOUTH AFRICA', :printable_name =&gt; 'South Africa', :iso3 =&gt; 'ZAF', :numcode =&gt; '710') &lt;br /&gt;    Country.create(:iso =&gt; 'ES', :name =&gt; 'SPAIN', :printable_name =&gt; 'Spain', :iso3 =&gt; 'ESP', :numcode =&gt; '724') &lt;br /&gt;    Country.create(:iso =&gt; 'LK', :name =&gt; 'SRI LANKA', :printable_name =&gt; 'Sri Lanka', :iso3 =&gt; 'LKA', :numcode =&gt; '144') &lt;br /&gt;    Country.create(:iso =&gt; 'SD', :name =&gt; 'SUDAN', :printable_name =&gt; 'Sudan', :iso3 =&gt; 'SDN', :numcode =&gt; '736') &lt;br /&gt;    Country.create(:iso =&gt; 'SR', :name =&gt; 'SURINAME', :printable_name =&gt; 'Suriname', :iso3 =&gt; 'SUR', :numcode =&gt; '740') &lt;br /&gt;    Country.create(:iso =&gt; 'SJ', :name =&gt; 'SVALBARD AND JAN MAYEN', :printable_name =&gt; 'Svalbard and Jan Mayen', :iso3 =&gt; 'SJM', :numcode =&gt; '744') &lt;br /&gt;    Country.create(:iso =&gt; 'SZ', :name =&gt; 'SWAZILAND', :printable_name =&gt; 'Swaziland', :iso3 =&gt; 'SWZ', :numcode =&gt; '748') &lt;br /&gt;    Country.create(:iso =&gt; 'SE', :name =&gt; 'SWEDEN', :printable_name =&gt; 'Sweden', :iso3 =&gt; 'SWE', :numcode =&gt; '752') &lt;br /&gt;    Country.create(:iso =&gt; 'CH', :name =&gt; 'SWITZERLAND', :printable_name =&gt; 'Switzerland', :iso3 =&gt; 'CHE', :numcode =&gt; '756') &lt;br /&gt;    Country.create(:iso =&gt; 'SY', :name =&gt; 'SYRIAN ARAB REPUBLIC', :printable_name =&gt; 'Syrian Arab Republic', :iso3 =&gt; 'SYR', :numcode =&gt; '760') &lt;br /&gt;    Country.create(:iso =&gt; 'TW', :name =&gt; 'TAIWAN, PROVINCE OF CHINA', :printable_name =&gt; 'Taiwan, Province of China', :iso3 =&gt; 'TWN', :numcode =&gt; '158') &lt;br /&gt;    Country.create(:iso =&gt; 'TJ', :name =&gt; 'TAJIKISTAN', :printable_name =&gt; 'Tajikistan', :iso3 =&gt; 'TJK', :numcode =&gt; '762') &lt;br /&gt;    Country.create(:iso =&gt; 'TZ', :name =&gt; 'TANZANIA, UNITED REPUBLIC OF', :printable_name =&gt; 'Tanzania, United Republic of', :iso3 =&gt; 'TZA', :numcode =&gt; '834') &lt;br /&gt;    Country.create(:iso =&gt; 'TH', :name =&gt; 'THAILAND', :printable_name =&gt; 'Thailand', :iso3 =&gt; 'THA', :numcode =&gt; '764') &lt;br /&gt;    Country.create(:iso =&gt; 'TG', :name =&gt; 'TOGO', :printable_name =&gt; 'Togo', :iso3 =&gt; 'TGO', :numcode =&gt; '768') &lt;br /&gt;    Country.create(:iso =&gt; 'TK', :name =&gt; 'TOKELAU', :printable_name =&gt; 'Tokelau', :iso3 =&gt; 'TKL', :numcode =&gt; '772') &lt;br /&gt;    Country.create(:iso =&gt; 'TO', :name =&gt; 'TONGA', :printable_name =&gt; 'Tonga', :iso3 =&gt; 'TON', :numcode =&gt; '776') &lt;br /&gt;    Country.create(:iso =&gt; 'TT', :name =&gt; 'TRINIDAD AND TOBAGO', :printable_name =&gt; 'Trinidad and Tobago', :iso3 =&gt; 'TTO', :numcode =&gt; '780') &lt;br /&gt;    Country.create(:iso =&gt; 'TN', :name =&gt; 'TUNISIA', :printable_name =&gt; 'Tunisia', :iso3 =&gt; 'TUN', :numcode =&gt; '788') &lt;br /&gt;    Country.create(:iso =&gt; 'TR', :name =&gt; 'TURKEY', :printable_name =&gt; 'Turkey', :iso3 =&gt; 'TUR', :numcode =&gt; '792') &lt;br /&gt;    Country.create(:iso =&gt; 'TM', :name =&gt; 'TURKMENISTAN', :printable_name =&gt; 'Turkmenistan', :iso3 =&gt; 'TKM', :numcode =&gt; '795') &lt;br /&gt;    Country.create(:iso =&gt; 'TC', :name =&gt; 'TURKS AND CAICOS ISLANDS', :printable_name =&gt; 'Turks and Caicos Islands', :iso3 =&gt; 'TCA', :numcode =&gt; '796') &lt;br /&gt;    Country.create(:iso =&gt; 'TV', :name =&gt; 'TUVALU', :printable_name =&gt; 'Tuvalu', :iso3 =&gt; 'TUV', :numcode =&gt; '798') &lt;br /&gt;    Country.create(:iso =&gt; 'UG', :name =&gt; 'UGANDA', :printable_name =&gt; 'Uganda', :iso3 =&gt; 'UGA', :numcode =&gt; '800') &lt;br /&gt;    Country.create(:iso =&gt; 'UA', :name =&gt; 'UKRAINE', :printable_name =&gt; 'Ukraine', :iso3 =&gt; 'UKR', :numcode =&gt; '804') &lt;br /&gt;    Country.create(:iso =&gt; 'AE', :name =&gt; 'UNITED ARAB EMIRATES', :printable_name =&gt; 'United Arab Emirates', :iso3 =&gt; 'ARE', :numcode =&gt; '784') &lt;br /&gt;    Country.create(:iso =&gt; 'GB', :name =&gt; 'UNITED KINGDOM', :printable_name =&gt; 'United Kingdom', :iso3 =&gt; 'GBR', :numcode =&gt; '826') &lt;br /&gt;    Country.create(:iso =&gt; 'US', :name =&gt; 'UNITED STATES', :printable_name =&gt; 'United States', :iso3 =&gt; 'USA', :numcode =&gt; '840') &lt;br /&gt;    Country.create(:iso =&gt; 'UY', :name =&gt; 'URUGUAY', :printable_name =&gt; 'Uruguay', :iso3 =&gt; 'URY', :numcode =&gt; '858') &lt;br /&gt;    Country.create(:iso =&gt; 'UZ', :name =&gt; 'UZBEKISTAN', :printable_name =&gt; 'Uzbekistan', :iso3 =&gt; 'UZB', :numcode =&gt; '860') &lt;br /&gt;    Country.create(:iso =&gt; 'VU', :name =&gt; 'VANUATU', :printable_name =&gt; 'Vanuatu', :iso3 =&gt; 'VUT', :numcode =&gt; '548') &lt;br /&gt;    Country.create(:iso =&gt; 'VE', :name =&gt; 'VENEZUELA', :printable_name =&gt; 'Venezuela', :iso3 =&gt; 'VEN', :numcode =&gt; '862') &lt;br /&gt;    Country.create(:iso =&gt; 'VN', :name =&gt; 'VIET NAM', :printable_name =&gt; 'Viet Nam', :iso3 =&gt; 'VNM', :numcode =&gt; '704') &lt;br /&gt;    Country.create(:iso =&gt; 'VG', :name =&gt; 'VIRGIN ISLANDS, BRITISH', :printable_name =&gt; 'Virgin Islands, British', :iso3 =&gt; 'VGB', :numcode =&gt; '092') &lt;br /&gt;    Country.create(:iso =&gt; 'VI', :name =&gt; 'VIRGIN ISLANDS, U.S.', :printable_name =&gt; 'Virgin Islands, U.s.', :iso3 =&gt; 'VIR', :numcode =&gt; '850') &lt;br /&gt;    Country.create(:iso =&gt; 'WF', :name =&gt; 'WALLIS AND FUTUNA', :printable_name =&gt; 'Wallis and Futuna', :iso3 =&gt; 'WLF', :numcode =&gt; '876') &lt;br /&gt;    Country.create(:iso =&gt; 'EH', :name =&gt; 'WESTERN SAHARA', :printable_name =&gt; 'Western Sahara', :iso3 =&gt; 'ESH', :numcode =&gt; '732') &lt;br /&gt;    Country.create(:iso =&gt; 'YE', :name =&gt; 'YEMEN', :printable_name =&gt; 'Yemen', :iso3 =&gt; 'YEM', :numcode =&gt; '887') &lt;br /&gt;    Country.create(:iso =&gt; 'ZM', :name =&gt; 'ZAMBIA', :printable_name =&gt; 'Zambia', :iso3 =&gt; 'ZMB', :numcode =&gt; '894') &lt;br /&gt;    Country.create(:iso =&gt; 'ZW', :name =&gt; 'ZIMBABWE', :printable_name =&gt; 'Zimbabwe', :iso3 =&gt; 'ZWE', :numcode =&gt; '716') &lt;br /&gt;&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def self.down&lt;br /&gt;    drop_table :countries&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 22 Mar 2006 22:51:25 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1727</guid>
      <author>jmoses (jon)</author>
    </item>
  </channel>
</rss>
