Skip to content

Instantly share code, notes, and snippets.

View stesla's full-sized avatar

Samantha Tesla stesla

  • DRW
  • Chicago, Illinois, USA
View GitHub Profile
var paper = Raphael("path-shapes", 785, 200);
paper.path("M 150 15 L 50 180 L 250 180 Z")
.attr({fill: "gray", "stroke-width": "5px"});
paper.path("M 400 100 h -75 a 75 75 0 1 0 75 -75 z")
.attr({fill: "yellow", "stroke-width": "3px"});
paper.path("M 390 90 v -75 a 75 75 0 0 0 -75 75 z")
.attr({fill: "red", "stroke-width": "3px"});
paper.path("M 250 75 L 323 301 131 161 369 161 177 301 z")
.scale(.75, .75).translate(400, -90)
.attr({fill: "blue", stroke: "blue"});
var paper = Raphael("shapes", 785, 200);
paper.rect(68, 0, 300, 200)
.attr("stroke-width", "1px");
paper.circle(68+150, 100, 75)
.attr("fill", "red").attr("stroke", "white");
paper.ellipse(600, 100, 100, 50)
.attr("fill", "#aaa").attr("stroke-width", "5px");
// Creates SVG 320 × 200 at 10, 50
var absPaper = Raphael(10, 50, 320, 200);
// Creates SVG 320 x 200 at position of element #foo
var fooPaper = Raphael("foo", 320, 200);
-- Find required skills for Sin
SELECT skill.typeName, skillLevel.valueInt
FROM dgmTypeAttributes AS attr
INNER JOIN dgmAttributeTypes AS attrType
ON attr.attributeID = attrType.attributeID
AND attrType.attributeName LIKE 'requiredSkill_'
INNER JOIN invTypes AS skill
ON skill.typeID = attr.valueInt
INNER JOIN dgmTypeAttributes AS skillLevel
ON skillLevel.typeID = attr.typeID
(defun muon-input-send-lines (start end)
(let ((proc (start-process "muon-quote" nil
"perl" "-ne" "print; sleep(1)")))
(lexical-let ((buffer (current-buffer)))
(set-process-filter proc (lambda (proc string)
(with-current-buffer buffer
(muon-input-send-line string)))))
(let ((lines (muon-region-lines start end)))
(mapc (lambda (line)
(process-send-string proc (concat line "\n")))
#define MAJOR(dev) ((dev)>>8)
#define MINOR(dev) ((dev) & 0xff)
#define MKDEV(ma,mi) ((ma)<<8 | (mi))
[samuel@Dahlia:~/Projects/objection][master*]$ ./a.out
page 0: 0x100021000
page 0: 0x100022000
^Z
[1]+ Stopped ./a.out
[samuel@Dahlia:~/Projects/objection][master*]$ vmmap a.out
Virtual Memory Map of process 31789 (a.out)
Output report format: 2.2 -- 64-bit process
==== Non-writable regions for process 31789
/*
* Lists
*/
struct cons {
ref_t car, cdr;
};
ref_t make_cons(ref_t car, ref_t cdr) {
struct cons *ptr = safe_malloc(sizeof(struct cons));
ptr->car = car, ptr->cdr = cdr;
boards :: [Int] -> Int -> [Int]
boards _ 0 = []
boards selection length =
case filter (>= length) selection of
[] -> split selection length
xs -> [minimum xs]
split :: [Int] -> Int -> [Int]
split selection length = smallBoards ++ bigBoards
where max = maximum selection
import Control.Monad (liftM)
import System.Environment (getArgs)
board = 16 * 12
cut :: Integer -> (Integer, Integer) -> (Integer, Integer)
cut 0 acc = acc
cut x (n, 0) = cut x (n + 1, board)
cut x (n, r) | x <= r = (n, r - x)
| x > board = cut (x - board) (n + 1, r)