Skip to content

Instantly share code, notes, and snippets.

View countvajhula's full-sized avatar

Siddhartha Kasivajhula countvajhula

View GitHub Profile
@countvajhula
countvajhula / GraphBugger.groovy
Created December 20, 2011 21:46
Test app for Blueprints Issue #197
#!/usr/bin/env groovy
import com.tinkerpop.blueprints.*
import com.tinkerpop.blueprints.pgm.*
import com.tinkerpop.blueprints.pgm.impls.neo4j.*
import com.tinkerpop.blueprints.pgm.impls.orientdb.*
import com.tinkerpop.blueprints.pgm.util.*
import com.tinkerpop.blueprints.pgm.util.graphml.GraphMLReader
import java.lang.Math
import java.util.Random
@countvajhula
countvajhula / gist:2693445
Created May 14, 2012 11:24
orientdb ODatabaseException 2
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on saving record in cluster #7
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:686)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.addRecord(OTransactionOptimistic.java:191)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.saveRecord(OTransactionOptimistic.java:180)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:220)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:213)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:34)
at com.orientechnologies.orient.core.record.ORecordAbstract.save(ORecordAbstract.java:269)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1241)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1230)
@countvajhula
countvajhula / pickledm.py
Last active December 13, 2015 19:58
pickle data manager w attempted hooks and synchronizer
import os
import pickle
import transaction
def before_commit(args, kws):
print "operating..."
print args
for arg in args:
print arg
for k,v in kws:
@countvajhula
countvajhula / gist:caff22de353ae4dc4caedf7ee1d1d856
Created September 18, 2020 19:31
racket variadic contract
#lang racket
(require racket/contract)
(define/contract (hello . args)
(-> any/c ... any/c)
(display args))
(hello)
(hello 1)
(hello 1 2 3)
(hello 1 2 3 4 5 6)
@countvajhula
countvajhula / gist:2bcf610cded6d82c52ea13ffdefa9466
Created September 20, 2020 16:57
raco setup error messages in 7.8cs
raco setup: 3 making: <pkgs>/algebraic/algebraic/data
open-input-file: cannot open module file
module path: /Users/siddhartha/Library/Racket/7.8/pkgs/ansi/ansi/private/tty-raw-extension.rkt
path: /Users/siddhartha/Library/Racket/7.8/pkgs/ansi/ansi/private/tty-raw-extension.rkt
system error: no such file or directory; rkt_err=3
compilation context...:
/Users/siddhartha/Library/Racket/7.8/pkgs/ansi/ansi/main.rkt
context...:
maybe-raise-missing-module
open-input-file
[...]
raco setup: 0 running: <pkgs>/relation/scribblings/relation.scrbl
raco setup: 1 skipping: <pkgs>/unix-signals/unix-signals/unix-signals.scrbl
user break
context...:
user break
context...:p
call-in-empty-metacontinuation-frame
check-break-prefix
raco setup: rendering: <pkgs>/relation/scribblings/relation.scrbl
user break
context...:
p
call-in-empty-metacontinuation-frame
check-break-prefix
call-with-empty-metacontinuation-frame-for-swap
l
loop
dynamic-wind
@countvajhula
countvajhula / gist:87512d3a7ed3ee2b5b55c9f45ac7a871
Last active November 4, 2020 20:08
scribble error with reproviding a required function
examples: exception raised in example
error: "dynamic-require: name is protected\n name: 'syntax-local-expand-observer\n module: #<resolved-module-path:'#%expobs>"
context...:
do-error
.../scribble/eval.rkt:308:23: with-handlers-handler102
.../private/more-scheme.rkt:163:2: select-handler/no-breaks
.../scribble/eval.rkt:356:9
.../private/map.rkt:40:19: loop
[repeats 6 more times]
.../private/manual-vars.rkt:218:40
@countvajhula
countvajhula / vim-normal-grammar.md
Last active April 20, 2022 00:49
A Grammar for Vim's Normal Mode

A Grammar for Vim's Normal Mode

A rough attempt at characterizing Vim's Normal Mode grammar that I made while writing this Vim series. See the bibliography there for more context.

Notation: | means or, [] means optional, * means zero or more, <> means literal class (e.g. <number> could expand to 1, 2, etc.), ... means there are more instances not enumerated here (these would need to be fleshed out to get a complete grammar).

It could be interesting to use a grammar like this one to organize an interactive Vim cheatsheet.

normal-command = motion-form

| verb-phrase

@countvajhula
countvajhula / AoC 2021 Day 1.rkt
Created December 6, 2021 04:09
AoC 2021 Day 1
#lang racket
(require qi
"util.rkt")
(define input (read-input-file "1.txt"))
(define depths
(parse-input input))