Skip to content

Instantly share code, notes, and snippets.

@dgonzo
dgonzo / Week4Ex3.rb
Created May 24, 2011 19:23
Method call from ternary
@byes = 0
def prompt(*args)
print(*args)
gets.chomp
end
def random_year
rand(21) + 1930
end
@dgonzo
dgonzo / FRED
Created June 8, 2012 03:14
Federal Reserve FRED Java API
cPropertyURIProperty
public static final java.lang.String cPropertyURIProperty
System.getProperty(cPropertyURIProperty) returns the URI of the property file. Define this on the java command line. For example, if your properties file is fred.properties then the command line should be
java -Dcom.uniservsolutions.stlouisfed.fred.properties="fred"
It is also necessary that the classpath contains the directory fred.properties is in.
The properties it's looking for are these:
# FRED API parameters
fredAPIKey=<api_key>
@dgonzo
dgonzo / isq demo day
Created July 18, 2013 18:52
ISQ demo day presentation
1. Open
1. Clayton Christensen or Salaman Khan
2. Problem
1. Which actor is the most important?
{
"data":{
"school_name":"Adams Elementary School",
"district_name":"Logan School District",
"report_type":"overview",
"report_data":{
"school_year_id":"2013",
"school_year_title":"2012/2013",
"response_tally":{
"students":217,
>>> x = 1 + 4
>>> y = x & 0x01
>>> x
5
>>> y
1
>>> x = x >> 1
>>> x
2
>>> y = x & 0x01
@dgonzo
dgonzo / gist:8046505
Created December 19, 2013 21:25
titan
{% set home = '/root' %}
{% set titan_dir = home + "titan-server-0.4.1-ND" %}
java7_ppa:
cmd.run:
- name: add-apt-repository ppa:webupd8team/java --yes && apt-get update
- user: root
accept-license:
cmd.run:
- name: echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
@dgonzo
dgonzo / school info
Last active August 29, 2015 13:56
new school info
{
"data": {
"school_name": "Adams Elementary School",
"district_name": "Logan School District",
"report_type": "school_info",
"years": [{
"data": [{
"report_data": {
"school_year_id":2014,
"signal_value": 4.39993, // this is what we sort by
Retrieving data for: Charter Ranches Academy
rake aborted!
undefined method `year' for nil:NilClass
/var/www/releases/20140305203233/app/models/enrollment.rb:16:in `enrollment_year'
/var/www/releases/20140305203233/app/services/report_service.rb:210:in `block in get_years_from_enrollments'
/var/www/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:13:in `each'
/var/www/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:13:in `each'
/var/www/releases/20140305203233/app/services/report_service.rb:208:in `get_years_from_enrollments'
/var/www/releases/20140305203233/app/services/district_info_service.rb:23:in `block in load_data'
/var/www/releases/20140305203233/app/services/district_info_service.rb:17:in `each'
Skullcandy S2IKDY-003 Ink'd 2.0 Earbud Headphones with Mic (Black)
Skullcandy S2IKDZ-010 Ink'd 2.0 Earbud Headphones (Black/Red)
Skullcandy S2IKDY-010 Ink'd 2.0 Earbud Headphones with Mic (Black/Red)
Skullcandy S6HSDZ-161 Hesh 2.0 with Detatchable Cable - Black/Black
Skullcandy S2IKDY-101 Ink'd 2.0 Earbud Headphones with Mic (Blue/Black)
Skullcandy S2IKDY-102 Ink'd 2.0 Earbud Headphones with Mic (Rasta)
Skullcandy S2IKDZ-058 Ink'd 2.0 Earbud Headphones (Rasta)
Skullcandy Crusher Over-Ear Headphones with Built-in Amplifier & Mic - Black
Skullcandy S2IKDY-103 Ink'd 2.0 Earbud Headphones with Mic (Pink/Black)
Skullcandy S6HSFZ-319 Hesh 2 Headphones, Gray/Black/Lime
@dgonzo
dgonzo / readme
Created August 25, 2014 15:32
data competitiong
# Data Competition Instructions
Contact: Ben Taylor, @bentaylordata, www.linkedin.com/in/bentaylordata/
Files:
* train_X.csv
* train_Y.csv
* val_X.csv
* val_Y.csv