Skip to content

Instantly share code, notes, and snippets.

public boolean removeNode(Node aNode) {
Node prevNode = this;
Node curNode = this.next;
do {
if (curNode == aNode) {
prevNode.next = curNode.next;
return true;
}
CMUser* user = [[CMUser alloc] initWithUsername:@"jim" password:@"pw"];
Recipe* r = [[Recipe alloc] initWithUser:... name:.....];
Review* rv = [[Review alloc] initWithUser:user recipe:r stars:5];
CMFuture* future = [user saveFuture];
CMFuture* future2 = [future andThen:^{ return [r saveFuture]; }];
CMFuture* future3 = [future andThen:^{ return [rv saveFuture]; }];
// or: future3 =
// [CMFuture doSeq:^{ return [user saveFuture]; },
Test csw:csw-2.0.2-GetRecordById-tc1.2 (s0003/d1e6546_1/d1e6418_1/d1e1830_1)
Assertion:
The response to a GetRecordById request without the ElementSetName parameter
must produce a response containing a summary view of all matching records.
Request d1e1992_1:
Method: POST
URL: http://76.124.185.24:9810/pycsw/csw.py
Log for test s0002/d1e6546_1/d1e6418_1/d1e1830_1
Test csw:csw-2.0.2-GetRecordById-tc1.2 (s0002/d1e6546_1/d1e6418_1/d1e1830_1)
Assertion:
The response to a GetRecordById request without the ElementSetName parameter
must produce a response containing a summary view of all matching records.
Request d1e1992_1:
;; Use a better buffer switcher
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-c C-l e") 'erc-buffers)
(global-set-key (kbd "C-c C-l t") 'term-buffers)
(defun erc-buffers ()
(interactive)
(list-buffers-with-mode 'erc-mode))
def getqattr(obj, name):
''' get value of an object, safely '''
try:
if hasattr(name,'__call__'):
return name(obj)
else:
value = getattr(obj, name)
if hasattr(value, '__call__'): # function generated value
if name.find('link') != -1: # link tuple triplet
return _linkify(value())
@ahinz
ahinz / gist:3314704
Created August 10, 2012 14:38
Point Parsing
typedef struct {
uint8_t xoffset;
uint8_t yoffset;
uint8_t style;
} AZPoint;
typedef enum {
AZPointParserBadLength = 1,
AZPointParserBadMagicNumber = 2,
@ahinz
ahinz / gist:6495407
Last active December 22, 2015 15:49
# apt-get install apt-get install libblas-dev liblapack-dev gfortran
# pip install numpy
# pip install scipy pil
from math import exp, sqrt
from scipy import array, zeros
from scipy.signal import fftconvolve
from scipy.misc import imsave
from random import randint
@ahinz
ahinz / gist:6780144
Last active December 24, 2015 09:49
(defun to-webm (lat lng)
(let ((origin-shift (/ (* 2.0 pi (/ 6378137.0 2.0)) 180.0)))
(list
(* origin-shift lng)
(* origin-shift
(/ (log (tan (*
(+ 90.0 lat)
(/ pi 360.0))))
(/ pi 180.0))))))