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
var repeat = function(x, i) { | |
if (i === 0) { | |
return ""; | |
} else { | |
return x + repeat(x, i - 1); | |
} | |
}; | |
var g = (function() { | |
var i = 0; |
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
(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 '()))) |
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
;; 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)) |
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
Connection A: | |
test=> begin; | |
BEGIN | |
test=> update test set foo = 2 where id = 1; | |
UPDATE 1 | |
test=> end; | |
COMMIT | |
Connection B: |
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
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(); |
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
int a(); | |
int b(); | |
int main() { | |
return a(); | |
} | |
int a() { | |
return b(); | |
} |
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
# | |
# /etc/bash.bashrc | |
# | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
PS1='[\u@\h \W]\$ ' | |
PS2='> ' | |
PS3='> ' |
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
(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>) |
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
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 |
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
class BMIGenerator { | |
private double height; | |
private double weight; | |
public BMIGenerator(w, h) { | |
} | |
public double getBMI() { | |
OlderNewer