This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function svn_line_changes { | |
echo "Scanning $@" | |
removed=`svn diff $@ | grep "^-[^-]" | wc -l` | |
echo "Removed: $removed" | |
added=`svn diff $@ | grep "^+[^+]" | wc -l` | |
echo "Added: $added" | |
difference=`expr $added - $removed` | |
echo "Difference: $difference" | |
unset removed added difference | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup your DB connection, cursor, etc | |
cur.execute('BACKUP DATABASE ? TO DISK=?', | |
['test', r'd:\temp\test.bak']) | |
while cur.nextset(): | |
pass | |
#backup done, close everything |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro make-coroutine ((&key (coroutine-done-value :done)) &body body) | |
(alexandria:with-gensyms ((thrfn "thread body") | |
(c "channel")) | |
`(let* ((,c (make-instance 'chanl:bounded-channel)) | |
(,thrfn (lambda () | |
(flet ((yield (&optional n) | |
(chanl:send ,c n))) | |
,@body | |
(yield ,coroutine-done-value))))) | |
(let ((alive-p T) val thr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun coroutine-test () | |
(let ((cor (make-coroutine (:coroutine-done-value :done) | |
(yield 1) | |
(yield) | |
(yield 4)))) | |
(assert (eql 1 (funcall cor)) ) | |
(assert (null (funcall cor))) | |
(assert (eql 4 (funcall cor))) | |
(assert (eql :done (funcall cor))) | |
(assert (eql :done (funcall cor))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro make-coroutine ((&key (coroutine-done-value :done)) &body body) | |
(alexandria:with-gensyms ((thrfn "thread body") | |
(c "channel")) | |
`(let* ((,c (make-instance 'chanl:bounded-channel)) | |
(,thrfn (lambda () | |
(flet ((yield (&optional n) | |
(chanl:send ,c n))) | |
,@body | |
(yield ,coroutine-done-value))))) | |
(let ((alive-p T) val thr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro make-coroutine ((&key (coroutine-done-value :done)) &body body) | |
(alexandria:with-gensyms ((yield-cv "can we yield?") | |
(run-cv "can we run?") | |
(run-lck "lock for the runner thread") | |
(val "yielding value") | |
(thrfn "thread body")) | |
`(let* ((,yield-cv (bordeaux-threads:make-condition-variable | |
:name "yield")) | |
(,run-cv (bordeaux-threads:make-condition-variable | |
:name "run")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; from SimPy.Simulation import * | |
;; class Message(Process): | |
;; """ a simple Process """ | |
;; def __init__(self,i,len): | |
;; Process.__init__(self,name="Message"+str(i)) | |
;; self.i = i | |
;; self.len = len | |
;; def go(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmethod asdf:perform :around ((o asdf:test-op) (system asdf:system)) | |
;; find a good filename, inside the current Jenkins workspace | |
(let ((outfile | |
(merge-pathnames (format nil "TAP/~a.tap" (asdf:component-name system)) | |
(truename (sb-ext:posix-getenv "WORKSPACE")))) | |
;; keep a list of how many tests we've got | |
(num-tests 0) | |
;; keep a list of test names and how many assertions passed | |
(working-tests (make-hash-table))) | |
(ensure-directories-exist outfile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#read from emacs server file what port it is currently listening on | |
PORT=`egrep -o '127.0.0.1:([0-9]*)' ~/.emacs.d/server/server | sed 's/127.0.0.1://'` | |
HOST="${@: -1}" | |
echo "Found host '$HOST'" | |
ssh "$HOST" "mkdir -m 700 -p ~/.emacs.d/server" | |
scp -p ~/.emacs.d/server/server $HOST:.emacs.d/server/server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en" ng-app> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dev log</title> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div class="container" ng-controller="DevLogController"> | |
<h2>Dev Log</h2> |
OlderNewer