Skip to content

Instantly share code, notes, and snippets.

@dcguim
dcguim / create-node.md
Last active August 13, 2017 09:06
Applying the given arguments to def-neo4j-fun
(apply (eval
	(cadr (macroexpand-1 '(def-neo4j-fun create-node (properties)
				:post
				(:uri-spec (format nil "node"))
				(:encode properties :string)
				(:status-handlers
				 (201 (decode-neo4j-json-output body))
				 (400 (error 'invalid-data-sent-error
					     :uri uri :json json)))))))
@dcguim
dcguim / cl-neo4j.test.md
Last active August 10, 2017 18:18
Running cl-neo4j.test.md
(ql:quickload :cl-neo4j.tests)
(cl-neo4j.tests:run-all-tests)
 Running test suite CL-NEO4J
 Running test suite RESTAPI
 Running test CREATE-DELETE-NODE X
 Running test GET-NODE X
 Running test NODE-PROPERTIES X
@dcguim
dcguim / cl-neo4j.test.md
Created August 10, 2017 18:12
Running cl-neo4j.test.md

(cl-neo4j.tests:run-all-tests)

Running test suite CL-NEO4J Running test suite RESTAPI Running test CREATE-DELETE-NODE X Running test GET-NODE X Running test NODE-PROPERTIES X Running test CREATE-DELETE-RELATIONSHIP X Running test GET-RELATIONSHIP X Running test RELATIONSHIP-PROPERTIES X

----------------------------- -- 001
-- Simple Functional Language -- 002
----------------------------- -- 003
-- variables are just names -- 006
type Var = String -- 007
-- 008
-- values are integers and functions -- 009
data Value = ValInt Integer -- 010
| ValFunc (Value -> Value) -- 011
(defun call-get-method (url &key parameters)
"Alternative to CALL-REST-METHOD that uses a stream; this is more
memory efficient, but it may cause problems if YASON:PARSE takes
too long to parse the stream and the stream may be cut due to
timeout."
(with-open-stream (s (drakma:http-request url
:parameters parameters
:external-format-out :utf-8
:method :get
:connection-timeout 120
(let ((continuation (drakma:http-request "http://localhost:8983/solr/gettingstarted/update"
:method :post
:content :continuation)))
(funcall continuation "id" t)
(funcall continuation "0553573403" t)
(funcall continuation "author" t)
(funcall continuation "add" t)
(funcall continuation "Paulo Coelho" t))
var elasticsearch = require('elasticsearch')
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
});
client.ping({
requestTimeout:30000,
hello:"elasticsearch"
}, function(error) {
void imprimeMinusculasMaiusculas(char* cad)
{// caso base
if (cad[0] == '\0')
return;
// passo indutivo
if (cad[0] >= 'a' && cad[0] <= 'z')
// transforma de minuscula pra maiuscula
cad[0] = cad[0] - ('a'-'A');
else if (cad[0] >= 'A' && cad[0] <= 'Z')
(defun proj (n k list)
(if (equal n (list-length list))
(nth k list)))
(defun zero (n)
(* 0 n))
(defun primrec (g h)
(labels ((f (&rest args)
(if (zerop (cadr args))
(defun lattes-to-bibtex (filename)
"Transform the given filename to bibtexml and then parse it"
(let ((xml (lattes-to-bibtexml filename))
(i (make-instance 'lattes-handler)))
(cxml:parse xml i)
(print-hash (lh-hash i))
(loop for entry being each hash-value in (lh-hash i) do
(bibtex-runtime:write-bib-entry entry))))