I examined the number of recreational visitors to the nine California National Parks in 2017. I used a combination of charts to examine the attendance variation between parks, months, and even temperatures.
Charts created with Flourish.
SELECT | |
( | |
SELECT ARRAY_AGG(coalesce(ncbi_nodes.superkingdom, '--') || '|' || coalesce(ncbi_nodes.kingdom, '--')) | |
FROM ncbi_nodes | |
WHERE taxon_id in (SELECT ncbi_names.taxon_id from ncbi_names where lower(gbif_ct.class_name) = lower(ncbi_names.name)) | |
) AS ncbi_taxa | |
FROM combine_taxa as gbif_ct |
fine prior to 5.1
class A < ApplicationRecord
has_many :foo, through: :boo
has_many :boo
# https://bugs.ruby-lang.org/issues/10930 | |
ids = [1, 2, 3] | |
sql = "SELECT * FROM table WHERE id IN (#{ids.to_s[1..-2]})" | |
ActiveRecord::Base.connection.execute(sql) |
// export tables from local database | |
pg_dump -Fc --no-acl --no-owner -t taxa -t taxa_names --data-only my_database > taxa.dump | |
// import tables into heroku | |
pg_restore --verbose --no-acl --no-owner -t taxa -t taxa_names -d postgres://user:password@host:port/database taxa.dump |
class AutocompleteController < ApplicationController | |
def index | |
query = params[:query].downcase | |
taxa = ::Taxon.where('lower("name") like ?', "#{query}%") | |
.limit(10) | |
render json: taxa | |
end | |
end |
license: mit |
license: mit |
license: mit |
connect to database | |
var file = './db/library.db'; | |
var sqlite3 = require('sqlite3').verbose(); | |
var db = new sqlite3.Database(file); |