Skip to content

Instantly share code, notes, and snippets.

(ns richeverpos.handler
(:use compojure.core
ring.adapter.jetty
richeverpos.index_page)
(:require [compojure.handler :as handler]
[compojure.route :as route]))
(defroutes app-routes
(GET "/" [] (index-page))
(route/resources "/")
@gzmask
gzmask / handler.clj
Created May 21, 2013 01:57
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: index-page in this context, compiling:(richever_clj/handler.clj:8:15)
(ns richever_clj.handler
(:use compojure.core
hiccup.core)
(:require [compojure.handler :as handler]
[compojure.route :as route]))
(defroutes app-routes
(GET "/" [] (index-page))
(route/resources "/")
(route/not-found "Not Found"))
@gzmask
gzmask / promise.js
Created July 25, 2012 20:01
[TypeError: Cannot call method 'call' of undefined]
var Browser = require("zombie");
var expect = require("expect.js");
browser = new Browser();
browser.visit("http://somedomain.com").
then(function () {
console.log("yo");
return fill("username", "monkeyeater").fill("password", "ispassed");
}).
then(function () {
@gzmask
gzmask / pe3.hs
Created June 19, 2012 21:16
project euler Problem 3
num = 600851475143
nums = reverse [1..600851475143]
isPrime :: (Integral a) => a -> Bool
isPrime x = (product $ map (mod x) [2..(x-1)]) /= 0
getPrimes :: (Integral a) => [a] -> [a]
getPrimes xs = filter isPrime $ xs
primes = getPrimes nums
@gzmask
gzmask / gist:2783950
Created May 24, 2012 20:16
donation block error
ojs2 has produced an error Message: WARNING: Missing argument 2 for DonationBlockPlugin::getContents(), called in /Library/Server/Web/Data/Sites/Default/ojs/lib/pkp/classes/plugins/BlockPlugin.inc.php on line 159 and defined In file: /Library/Server/Web/Data/Sites/Default/ojs/plugins/blocks/donation/DonationBlockPlugin.inc.php At line: 72 Stacktrace: File: /Library/Server/Web/Data/Sites/Default/ojs/plugins/blocks/donation/DonationBlockPlugin.inc.php line 72 Function: PKPApplication->errorHandler(2, "Missing argument 2 for DonationBlockPlugin::getContents(), called in /Library/Server/Web/Data/Sites/Default/ojs/lib/pkp/classes/plugins/BlockPlugin.inc.php on line 159 and defined", "/Library/Server/Web/Data/Sites/Default/ojs/plugins/blocks/donation/DonationBlockPlugin.inc.php", 72, Array(1)) File: /Library/Server/Web/Data/Sites/Default/ojs/lib/pkp/classes/plugins/BlockPlugin.inc.php line 159 Function: DonationBlockPlugin->getContents(Object(TemplateManager)) File: (unknown) line (unknown) Function: BlockPlugin->c
corwin:naclray1 ray$ ./scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/Users/ray/projects/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/nacl-g++ -o dbg_x86_32/naclray1.o -c -std=gnu++98 -Wno-long-long -Wall -Wswitch-enum -pthread -O0 -g -m32 -D_GNU_SOURCE=1 -D__STDC_FORMAT_MACROS=1 -D_BSD_SOURCE=1 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=600 naclray1.cc
naclray1.cc: In member function 'virtual void Naclray1Instance::HandleMessage(const pp::Var&)':
naclray1.cc:59: error: 'FileIO' is not a member of 'pp'
naclray1.cc:59: error: expected ';' before 'file1'
scons: *** [dbg_x86_32/naclray1.o] Error 1
scons: building terminated because of errors.
corwin:naclray1 ray$ ./scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/Users/ray/projects/native_client_sdk_0_5_1052/toolchain/mac_x86/bin/nacl-g++ -o dbg_x86_32/naclray1.o -c -std=gnu++98 -Wno-long-long -Wall -Wswitch-enum -pthread -O0 -g -m32 -D_GNU_SOURCE=1 -D__STDC_FORMAT_MACROS=1 -D_BSD_SOURCE=1 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=600 naclray1.cc
naclray1.cc: In member function 'virtual void Naclray1Instance::HandleMessage(const pp::Var&)':
naclray1.cc:59: error: 'FileIO' is not a member of 'pp'
naclray1.cc:59: error: expected ';' before 'file1'
scons: *** [dbg_x86_32/naclray1.o] Error 1
scons: building terminated because of errors.
@gzmask
gzmask / example.xml
Created August 24, 2011 21:20
rapidxml parsing error
<DISTRIBUTIONS>
<DIST TYPE="discrete">
<PRIVATE NAME="Alarm"/>
<CONDSET>
<CONDELEM NAME="Burglary"/>
<CONDELEM NAME="Earthquake"/>
</CONDSET>
<DPIS>
<DPI INDEXES="0 0 ">0.95 0.05 </DPI>
@gzmask
gzmask / gist:1001404
Created May 31, 2011 22:21
crash without warning
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main() {
string xbn_filename;
string line_str;
string block_str;
// this function happens on the thread pool
// doing v8 things in here will make bad happen.
static int DoSomething (eio_req *req) {
struct simple_request * sr = (struct simple_request *)req->data;
//sleep(2); // just to make it less pointless to be async.
//req->result = sr->x + sr->y;
req->result = bayesian_test(sr->x, sr->y, sr->name);
return 0;
}