Skip to content

Instantly share code, notes, and snippets.

@rosslazer
rosslazer / HTML5 Audio formats
Created December 13, 2011 07:44 — forked from JohnAllsopp/HTML5 Audio formats
HTML5 Audio format/codec browser support
<table>
<caption>Codec support in modern browsers</caption>
<thead>
<tr>
<th>Browser</th>
<th>Ogg Vorbis</th>
<th>MP3</th>
<th>WAV</th>
<th>AAC</th>
</tr>
class MatchesController < ApplicationController
def index
@skills = current_user.skills.where('wants.wants_learn' => true)
@array_of_skill_ids = @skills.map
@users = User.joins(:wants).where(:wants=>{:name=>@array_of_skill_ids})
end
end
*** REMOTE GEMS ***
pg (0.14.1 ruby x86-mingw32 x86-mingw32, 0.11.0 x86-mswin32 x86-mswin32, 0.8.0 x86-mswin32-60 x86-mswin32-60)
pg-app-name (0.2.0 ruby)
pg-ct (0.10.0 ruby)
pg-jdguyot (0.10.0 ruby)
pg-ldap-sync (0.1.0 ruby)
pg-migrator (1.2.2 ruby)
pg-safesys (0.0.6 ruby)
pg_advisory_locker (1.0.2 ruby)
399: unexpected token at '{"broken_description":null,"category":null,"checked_out":false,"created_at":"2013-02-24T05:06:07Z","donor":null,"donor_email":null,"id":2,"location_id":null,"name"NEWTOOL,"qr_code":null,"return_date":null,"returnable":null,"user_id" 5,"working":null}]'
arted POST "/api/new_item" for 127.0.0.1 at 2013-02-24 00:08:38 -0500
Error occurred while parsing request parameters.
Contents:
MultiJson::LoadError (399: unexpected token at '{"broken_description":null,"category":null,"checked_out":false,"created_at":"2013-02-24T05:06:07Z","donor":null,"donor_email":null,"id":2,"location_id":null,"name"NEWTOOL,"qr_code":null,"return_date":null,"returnable":null,"user_id" 5,"working":null}]'):
json (1.7.7) lib/json/common.rb:155:in `parse'
json (1.7.7) lib/json/common.rb:155:in `parse'
multi_json (1.6.1) lib/multi_json/adapters/json_common.rb:6:in `load'
def new_item
@tool = Tool.new
@tool = Tool.new(params[:params])
respond_to do |format|
if @tool.save
format.json { render :json => @tool, :status => :created, :tool => @tool }
else
format.json { render :json => @tool.errors, :status => :unprocessable_entity }
Parameters: {"_json"=>[{"broken_description"=>nil, "category"=>nil, "checked_out"=>false, "created_at"=>"2013-02-24T05:05:16Z", "donor"=>nil, "donor_email"=>nil, "id"=>1, "location_id"=>nil, "name"=>"NEWTOOL", "qr_code"=>"newT", "return_date"=>nil, "returnable"=>nil, "updated_at"=>"2013-02-24T05:05:16Z", "user_id"=>nil, "working"=>nil}], "api"=>{"_json"=>[{"broken_description"=>nil, "category"=>nil, "checked_out"=>false, "created_at"=>"2013-02-24T05:05:16Z", "donor"=>nil, "donor_email"=>nil, "id"=>1, "location_id"=>nil, "name"=>"NEWTOOL", "qr_code"=>"newT", "return_date"=>nil, "returnable"=>nil, "updated_at"=>"2013-02-24T05:05:16Z", "user_id"=>nil, "working"=>nil}]}}
WARNING: Can't verify CSRF token authenticity
(0.2ms) BEGIN
SQL (0.5ms) INSERT INTO "tools" ("broken_description", "category", "checked_out", "created_at", "donor", "donor_email", "location_id", "name", "qr_code", "return_date", "returnable", "updated_at", "user_id", "working") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13
document.body.innerHTML = '<a href="https://myslice.syr.edu/psp/PTL9PROD/EMPLOYEE/HRMS/c/SA_LEARNER_SERVICES.SSR_SSENRL_LIST.GBL?PORTALPARAM_PTCNAV=SYR_VW_CLASS_SCHEDULE_CREF&EOPP.SCNode=EMPL&EOPP.SCPortal=EMPLOYEE&EOPP.SCName=ADMN_STUDENT_SERVICES&EOPP.SCLabel=&EOPP.SCPTcname=PT_PTPP_SCFNAV_BASEPAGE_SCR&FolderPath=PORTAL_ROOT_OBJECT.SYR_CREF_ROOT_FOLDER.SYR_STUDENT_SRVCS_FOLDER.SYR_ENROLLMENT_FOLDER.SYR_VW_CLASS_SCHEDULE_CREF&IsFolder=false">View Schedule</a>';
var regexDays = function(string)
{
var days = new RegExp("(Mo)|(Tu)|(We)|(Th)|(Fr)|(Sa)|(Su)", "g");
daysarr = string.match(days);
return daysarr;
}
@rosslazer
rosslazer / caltrain-otp.py
Created March 24, 2023 18:19
Caltrain on time performance analysis
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Read data from CSV
file = "otp.csv"
data = pd.read_csv(file)