Skip to content

Instantly share code, notes, and snippets.

var repeat = function(x, i) {
if (i === 0) {
return "";
} else {
return x + repeat(x, i - 1);
}
};
var g = (function() {
var i = 0;
(define reverse2
(lambda (i)
(((lambda (x) (x x))
(lambda (f)
(lambda (a b)
(if (null? a)
b
((f f) (cdr a) (cons (car a) b))))))
i '())))
;; Guile 2.0.11
(use-modules (srfi srfi-1))
(let ((a (map (lambda (x) (char-upcase (string-ref x 0)))
'("John" "Marry" "Carson" "Zed")))
(b (map integer->char (iota 26 65))))
(map (lambda (x) (cons x (count (lambda (y) (char=? x y)) a))) b))
Connection A:
test=> begin;
BEGIN
test=> update test set foo = 2 where id = 1;
UPDATE 1
test=> end;
COMMIT
Connection B:
use std::fs::File;
use std::io::Read;
use std::string::String;
pub fn file_io_test(p: &str) {
let mut m = File::open(p).unwrap();
let ref mut buf = [0; 256];
let n = m.read(buf).unwrap();
int a();
int b();
int main() {
return a();
}
int a() {
return b();
}
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
@b4284
b4284 / init.el
Last active August 29, 2015 14:22
(require 'anthy)
(defun toggle-input-method-2 (im-name)
(if (string-equal current-input-method im-name)
(deactivate-input-method)
(activate-input-method im-name)))
(defun <f5> () (interactive) (toggle-input-method-2 "chinese-array30-colemak"))
(defun <f6> () (interactive) (toggle-input-method-2 "japanese-anthy"))
(global-set-key (kbd "<f5>") '<f5>)
(global-set-key (kbd "<f6>") '<f6>)
b4283@chakra-laptop /root/.guix-profile/bin % guix package -i luajit
warning: failed to install locale: Invalid argument
The following package will be installed:
luajit 2.0.3 /gnu/store/cjx2nnrp6mgpzridhczzy5hjhp9gi61i-luajit-2.0.3
substitute: warning: failed to install locale: Invalid argument
The following derivations will be built:
/gnu/store/2lqrhiqkn707lv8rhlzhw8rdrx4dsn5p-profile.drv
/gnu/store/bcd24hdd374qdxqnhlyxah3vk9v6bilp-ca-certificate-bundle.drv
/gnu/store/4dasjpa61bd38gczcqk88i5x4mxazkbd-info-dir.drv
@b4284
b4284 / BMI.java
Created September 30, 2015 12:31
class BMIGenerator {
private double height;
private double weight;
public BMIGenerator(w, h) {
}
public double getBMI() {