Skip to content

Instantly share code, notes, and snippets.

View carlcrott's full-sized avatar

Carl Crott carlcrott

  • <( '.' <) <( '.' )> (> '.' )>
  • San Francisco CA
View GitHub Profile
<Polygon>
<extrude>0</extrude> <altitudeMode>absolute</altitudeMode>
<outerBoundaryIs><LinearRing><coordinates> 145.0360983029253,-40.77916090164992,0 144.985995308916,-40.74867793137243,0 144.7622102281709,-40.72805895241742,0 144.7013522465292,-40.759171
90653934,0 144.7085883435607,-40.82556496177752,0 144.6996872652777,-40.87547902768867,0 144.6806613508447,-40.89611594391653,0 144.6488642657837,-40.90124600395036,0 144.6187053398839,-40.93110787
520081,0 144.6372092293857,-41.03194401470181,0 144.653589312255,-41.04695600333098,0 144.6677552315752,-41.07520687278661,0 144.6953942220973,-41.18110987277132,0 144.6857912432405,-41.21658795444
115,0 144.7316283514357,-41.30611087155658,0 144.7816413238046,-41.39055787573285,0 144.8585823336663,-41.54444894791169,0 144.9549542715236,-41.71333390380877,0 145.0549622789885,-41.8466599764892
,0 145.1845533756036,-41.93832497278614,0 145.2478863656219,-42.03486790146869,0 145.2627722904269,-42.08000294145198,0 145.2651212349794,-42.11
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document id="tnc_terr_ecoregions" xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
<name>tnc_terr_ecoregions</name>
<visibility>0</visibility>
<open>1</open>
<Snippet maxLines="0"></Snippet>
<GroundOverlay>
<name>tnc_terr_ecoregions: Composite</name>
<visibility>0</visibility>
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
<Document id="Layers">
<name>Layers</name>
<Snippet></Snippet>
<Folder id="legend2">
<name></name>
<Style id="LegendRadioFolder2"><IconStyle><scale>0</scale></IconStyle><ListStyle><listItemType>radioFolder</listItemType></ListStyle></Style>
<ScreenOverlay id="A2"><name>Upper Left</name>
class AddModelTypeToModels < ActiveRecord::Migration
class Models < ActiveRecord::Base; end
def self.up
add_column :models, :model_type, :string
Model.update_all("model_type = 'ED2'", "model_name like 'ed%'")
Model.update_all("model_type = 'SIPNET'", "model_name like 'sipnet%'")
CREATE TABLE `workflows` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL,
`model_type` varchar(255) DEFAULT NULL,
`model_id` int(11) NOT NULL,
`hostname` varchar(255) DEFAULT NULL,
`start_date` datetime DEFAULT NULL,
`end_date` datetime DEFAULT NULL,
`params` text,
`folder` text,
class RenameModelsToSimulationModels < ActiveRecord::Migration
def self.up
rename_table :models, :simulationmodels
end
def self.down
rename_table :simulationmodels, :models
end
end
@carlcrott
carlcrott / gist:4075661
Created November 14, 2012 23:45
successful migration
pecan@pecan32:~/pecan$ sudo ./robs.sh
--2012-11-14 17:36:42-- http://isda.ncsa.illinois.edu/~kooper/EBI/betydump.sql
Resolving isda.ncsa.illinois.edu (isda.ncsa.illinois.edu)... 141.142.227.9
Connecting to isda.ncsa.illinois.edu (isda.ncsa.illinois.edu)|141.142.227.9|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 44965804 (43M) [text/plain]
Saving to: `betydump.sql'
100%[======================================>] 44,965,804 2.26M/s in 44s
@carlcrott
carlcrott / gist:4075662
Created November 14, 2012 23:45
successful migration
pecan@pecan32:~/pecan$ sudo ./robs.sh
--2012-11-14 17:36:42-- http://isda.ncsa.illinois.edu/~kooper/EBI/betydump.sql
Resolving isda.ncsa.illinois.edu (isda.ncsa.illinois.edu)... 141.142.227.9
Connecting to isda.ncsa.illinois.edu (isda.ncsa.illinois.edu)|141.142.227.9|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 44965804 (43M) [text/plain]
Saving to: `betydump.sql'
100%[======================================>] 44,965,804 2.26M/s in 44s
== AddMissingIndexes: migrating ==============================================
-- add_index(:citations, :user_id)
-> 0.6124s
-- add_index(:dbfiles, :created_user_id)
rake aborted!
An error has occurred, all later migrations canceled:
Mysql2::Error: Key column 'created_user_id' doesn't exist in table: CREATE INDEX `index_dbfiles_on_created_user_id` ON `dbfiles` (`created_user_id`)
/home/thrive/.rvm/gems/ruby-1.9.3-p125@ghgvc/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
/home/thrive/.rvm/gems/ruby-1.9.3-p125@ghgvc/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `block in execute'
-rw-r--r-- 1 thrive thrive 571 2012-09-24 17:28 001_create_traits.rb
-rw-r--r-- 1 thrive thrive 498 2012-09-24 17:28 002_create_yields.rb
-rw-r--r-- 1 thrive thrive 411 2012-09-24 17:28 003_create_priors.rb
-rw-r--r-- 1 thrive thrive 187 2012-09-24 17:28 006_create_pfts.rb
-rw-r--r-- 1 thrive thrive 275 2012-09-24 17:28 007_create_cultivars.rb
-rw-r--r-- 1 thrive thrive 325 2012-09-24 17:28 008_create_species.rb
-rw-r--r-- 1 thrive thrive 254 2012-09-24 17:28 009_create_variables.rb
-rw-r--r-- 1 thrive thrive 355 2012-09-24 17:28 010_create_citations.rb
-rw-r--r-- 1 thrive thrive 552 2012-09-24 17:28 011_create_sites.rb
-rw-r--r-- 1 thrive thrive 228 2012-09-24 17:28 012_create_treatments.rb