Skip to content

Instantly share code, notes, and snippets.

@carylee
carylee / IsBingWorking.rb
Created December 23, 2011 17:49
Script to check if Bing API is working or broken
require 'rbing'
$BINGAPPID = ENV['BINGAPPID']
print "Does bing seem to be working?... "
bing = RBing.new($BINGAPPID)
rsp = bing.web("site:chicagotribune.com budget", :count=>50)
if rsp.web.total == 42
puts "nope."
else
puts "yes! found #{rsp.web.total.to_s} results!"
@carylee
carylee / gist:1446323
Created December 8, 2011 06:49
latex output
pdflatex final-writeup.tex
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
restricted \write18 enabled.
entering extended mode
(./final-writeup.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2009-06-19, ngerman-x-2009-06-19, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
@carylee
carylee / gist:1445873
Created December 8, 2011 02:38
pdflatex error
LaTeX Warning: Reference `sec:conclusion' on page \thepage undefined on input
line 90.
Overfull \hbox (4.37234pt too wide) in paragraph at lines 110--119
\T1/aer/m/n/9 learn-ing al-go-rithm and were cal-cu-lated for each sam-ple. Com
-
Overfull \hbox (1.20367pt too wide) in paragraph at lines 110--119
\T1/aer/m/n/9 lab to ap-prox-i-mate the CTF al-go-ritm found in [4]. \T1/aer/bx
@carylee
carylee / gist:1300213
Created October 20, 2011 01:47
backtrace
#0 0x0000003f7d6aabd0 in __nanosleep_nocancel () from /lib64/libc.so.6
#1 0x0000003f7d6aaa60 in sleep () from /lib64/libc.so.6
#2 0x0000000000402deb in waitForJob (job=0x605d90) at runtime.c:898
#3 0x0000000000402dd1 in foregroundJob (job=0x605d90, cont=0) at runtime.c:890
#4 0x000000000040256a in Exec (job=0x605d90, forceFork=1, background=0) at runtime.c:583
#5 0x0000000000402168 in RunExternalCmd (job=0x605d90, fork=1) at runtime.c:463
#6 0x0000000000401c18 in RunCmdFork (cmd=0x6057b0, fork=1) at runtime.c:224
#7 0x0000000000401bce in RunCmd (cmd=0x6057b0) at runtime.c:201
#8 0x00000000004013ac in Interpret (cmdLine=0x605520 "ls") at interpreter.c:103
#9 0x0000000000403284 in main (argc=1, argv=0x7fffffffe528) at tsh.c:104
@carylee
carylee / gist:1282889
Created October 12, 2011 22:54
Sample output of api/webform/$NID/fullreport.json
{
"cumulative_report" : {
"question" : "How much do you like reporting?",
"answers" : {
"3" : {
"responders" : [
{
"time" : "1318453303",
"email" : "foobar@bar.com"
},
@carylee
carylee / gist:1271386
Created October 7, 2011 21:26
http://localhost/api/webform/1316/report/yesno.yaml
---
total: 4
yes:
count: 2
percentage: 50
responses:
-
email: carylee@gmail.com
time: 1317330924
-
@carylee
carylee / gist:1271012
Created October 7, 2011 18:26
Webform responses query
SELECT all1.nid as nid, all1.email as email, all1.submitted as submitted, all1.node_uid as node_uid, all2.form_key as answer_type,
all2.name as question, all2.response_uid as response_uid
FROM
(SELECT rest.nid, rest.response, rest.email, rest.sid, rest.submitted, rest.response_uid, rest.node_uid, form_key, name, type
FROM (SELECT wsd1.nid as nid,
wsd1.data as response, wsd2.data as email, wsd1.sid as sid, ws.submitted, ws.uid as response_uid, node.uid as node_uid
FROM webform_submitted_data wsd1
JOIN webform_submitted_data wsd2 ON wsd1.sid=wsd2.sid
JOIN webform_submissions ws ON wsd1.sid=ws.sid
JOIN node ON node.nid=wsd1.nid
@carylee
carylee / gist:963485
Created May 9, 2011 21:45
Output from /all
[
{"location":
{"name":"Arch",
"id":3},
"stops":[
{"time":"16:41:00",
"route":
{"name":"Intercampus Northbound",
"id":8}},
{"time":"16:51:00",
@carylee
carylee / gist:963476
Created May 9, 2011 21:40
Output from locations/3
{"location":
{"name":"Arch",
"id":"3"},
"stops":[
{"time":"16:41:00",
"route":
{"name":"Intercampus Northbound",
"id":8}},
{"time":"16:51:00",
"route":
@carylee
carylee / get_alternate_language_link.php
Created January 28, 2010 20:48
A function and subfunctions to find links to the same content on two different sites (of different languages) - for use on myoncofertility.org