Skip to content

Instantly share code, notes, and snippets.

var repeat = function(c,max,floop,fend,env) {
if(arguments.length===4) { env = {}; }
if(c<max) {
env._i = c;
floop(function(floop,env){
repeat(c+1, max, floop, fend, env);
},env);
} else {
fend(env);
}
-- monadic evalution because reading the job offer is impure code
-- with important side effects
do
laugh_or_cry <- (discard . acept_or_reject . read ) spanish_it_offer_for_ninjas
return laugh_or_cry
;; Previous window
(global-set-key (kbd "C-x p")
(lambda ()
(interactive)
(other-window -1)))
@antoniogarrote
antoniogarrote / jetty_foaf_ssl.clj
Created March 13, 2011 19:33
A modified Ring jetty adapter to authenticate webIDs using FOAF+SSL
(ns clj-r2rml.web.jetty-foaf-ssl
"Adapter for the Jetty webserver handling FOAF-SSL authentications."
(:import (org.mortbay.jetty.handler AbstractHandler)
(org.mortbay.jetty Server Request Response)
(org.mortbay.jetty.bio SocketConnector)
;; Modified version of SSLSocketConnector accepting
;; client certificates not associated to a valid authority
(cljr2rml.web FOAFSSLSocketConnector)
(javax.servlet.http HttpServletRequest HttpServletResponse)
(com.hp.hpl.jena.rdf.model ModelFactory)
(ns jobim.examples.philosophers
(:use [jobim]))
;;;;;;;;;;;;;
;;; Forks
;;;;;;;;;;;;
(defn do-forks
([forks-list]
(loop [forks-list forks-list]
pstDelIn = (PTMX_DEL_IN)&pCMMIda->stDelIn;
pstDelOut = (PTMX_DEL_OUT)&pCMMIda->stDelOut;
strcpy(pCMMIda->stDelIn.stTmDel.szSource, pstExtOut->stTmExt.szSource );
strcpy(pCMMIda->stDelIn.stTmDel.szTarget, pstExtOut->stTmExt.szTarget );
strcpy(pCMMIda->stDelIn.stTmDel.szSourceLanguage, pCMMIda->szSourceLng);
strcpy(pCMMIda->stDelIn.stTmDel.szTargetLanguage, pstExtOut->stTmExt.szTargetLanguage );
pCMMIda->stDelIn.stTmDel.fMachineTranslation = pstExtOut->stTmExt.fMachineTranslation;
strcpy(pCMMIda->stDelIn.stTmDel.szFileName, pstExtOut->stTmExt.szFileName );
strcpy(pCMMIda->stDelIn.stTmDel.szLongName, pstExtOut->stTmExt.szLongName );
(ns backend.levenshtein-command
(:use [somnium.congomongo :only [get-coll]])
(:use [somnium.congomongo.coerce :only [coerce]])
(:import [com.mongodb BasicDBObjectBuilder BasicDBObject]))
(defn- build-bson-object
([collection-object source field threshold level separators limit output-field]
(let [level (if (nil? level) "word" level)
builder (BasicDBObjectBuilder/start)]
(doto builder
print("connected");
var mapFn = function(){
var minSim = 0.1;
var fieldName = "text";
var queryText = "ola";
var maxSimilarity = function(a,b) {
var aSize = a.length;
var bSize = b.length;
<script type='text/javascript'>
jQuery(document).ready(function(){
rdfstore.create(function(store) {
var myLocLat = 0;
var myLocLng = 0;
var nearbyRadius = 0.5; // in km
// extracts data from remote SPARQL endpoint
var queryStr2 = 'PREFIX lgdo:<http://linkedgeodata.org/ontology/>\
jQuery(document).ready(function(){
rdfstore.create(function(store) {
var myLocLat = 0;
var myLocLng = 0;
var nearbyRadius = 0.5; // in km
// extracts data from remote SPARQL endpoint
var queryStr2 = 'PREFIX lgdo:<http://linkedgeodata.org/ontology/>\
CONSTRUCT {\