Skip to content

Instantly share code, notes, and snippets.

View jsmpereira's full-sized avatar

José Santos Martins Pereira jsmpereira

  • Clearhaus A/S
  • Denmark
View GitHub Profile
Step 11 : RUN curl -sL https://get.docker.io/ | /bin/sh
---> Running in 74b35155ec62
sh: 1: modprobe: not found
dpkg-query: no packages found matching linux-image-*-generic
Warning: current kernel is not supported by the linux-image-extra-virtual
package. We have no AUFS support. Consider installing the packages
linux-image-virtual kernel and linux-image-extra-virtual for AUFS support.
+ sleep 10
$ RUNS=100 REQUESTS=10 CLIENTS=10 ruby perf.rb
Running ab 100 times for 10 requests and 10 clients
....................................................................................................
Average total time: 4.979
Average reqs/s: 2.247
Complete requests: 1000, Failed requests: 0
/* The purpose of this program is to monitor routing
* table changes
*/
#include <sys/socket.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
(defparameter *world* nil)
(defclass tile ()
((x :initarg :x
:accessor x)
(y :initarg :y
:accessor y)
(size :initarg :size
:accessor size)
(color :initarg :color
Hi,
After trying out GSLL, Clem, also FemLisp, Lisplab managed to get me
the functionality I needed with the least trouble.
I'm trying to get the connectivity of a graph (second smallest eigen value) from eigenvalues.
Given the fully connected 4x4 adjacency matrix:
#md(( 0.000 1.000 1.000 1.000 )
(defun build-matrix ()
(let* ((n-nodes (length (nodes)))
(dim `(,n-nodes ,n-nodes)))
(gsll:set-zero (grid:make-foreign-array 'double-float :dimensions dim))))
(defparameter *adj-matrix* nil)
(defparameter *diag-matrix* nil)
(defmacro with-matrix (matrix &body body)
`(loop for i below (first (grid:dimensions ,matrix)) do
$ heroku run bash
Running `bash` attached to terminal... up, run.1256
~ $ cd sbcl/sbcl-1.0.54-x86-64-linux/
~/sbcl/sbcl-1.0.54-x86-64-linux $ chmod +x run-sbcl.sh
~/sbcl/sbcl-1.0.54-x86-64-linux $ ./run-sbcl.sh
(running SBCL from: /app/sbcl/sbcl-1.0.54-x86-64-linux)
This is SBCL 1.0.54, an implementation of ANSI Common Lisp.
@jsmpereira
jsmpereira / gist:3827894
Created October 3, 2012 16:09
heroku config/database.yml
<%
require 'cgi'
require 'uri'
begin
uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
raise "Invalid DATABASE_URL"
end
;; DISCONNECT_REQ
(defun disconnect-req ()
(with-buffer (make-buffer)
(serialize* :uint8 27
:uint16 8
:uint16 32865
:uint16 29
:uint16 7))) ;; command code
@jsmpereira
jsmpereira / gist:3763404
Created September 21, 2012 19:28
cl-inotify
(defun pickaxe (directory)
(inotify:with-inotify (inot `((,directory ,(logior inotify:in-create
inotify:in-moved-to))))
(write-line "Waiting for sales...")
(loop
(dolist (event (inotify:read-events inot))
(when (equal
(pathname-type (inotify:event-full-name event))
"xml")
(if (string-equal directory "/path/to/dropbox/")