This file contains hidden or 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-modules (srfi srfi-1) | |
| (ice-9 pretty-print)) | |
| (define (sum ls) | |
| (if (null? ls) | |
| 0 | |
| (+ (car ls) (sum (cdr ls))))) | |
| (define (sum2 ls) | |
| (apply + ls)) |
This file contains hidden or 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
| ;; This buffer is for notes you don't want to save, and for Lisp evaluation. | |
| ;; If you want to create a file, visit that file with C-x C-f, | |
| ;; then enter the text in that file's own buffer. | |
| (defun comment-toggle-current-line () | |
| "comment or uncomment current line" | |
| (interactive) | |
| (comment-or-uncomment-region (line-beginning-position) (line-end-position))) | |
| (global-set-key (kbd "M-[") 'comment-toggle-current-line) |
This file contains hidden or 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
| open Core.Std | |
| open Lwt | |
| let usb_send_recv send recv = | |
| let device = USB.open_device_with ~vendor_id:0x0000 | |
| ~product_id:0x0000 in | |
| let t = | |
| USB.claim_interface device 0 | |
| >>= |
This file contains hidden or 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
| open Core.Std | |
| open Lwt | |
| let cmd = "\x00\x00\x00\x00\x00\x00\x00\x00";; | |
| let buf = String.make 500 (char_of_int 0);; | |
| let device = USB.open_device_with ~vendor_id:0x0CA6 ~product_id:0xA010 in | |
| let t = | |
| USB.claim_interface device 0 |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| (0x6EAB, ["UC";"C/U";"CPU"]); | |
| (0x5ABC, ["W/U";"WPU"]); | |
| (0x555F, ["G;.";"G.;"]); | |
| (0x83A0, ["FLVG";"FLVL"]); | |
| (0x4E38, ["LSH";"SLH"]); | |
| (0x5E7E, ["XZ";"XXZX";"XXAX"]); | |
| (0x7228, ["OUD,";"OJA,";"OJQ,"]); | |
| (0xFF0C, [","]); | |
| (0x3002, ["."]); | |
| (0x53E3, [";"]); |
This file contains hidden or 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
| (0x6EAB, ["UC";"C/U";"CPU"]); | |
| (0x5ABC, ["W/U";"WPU"]); | |
| (0x555F, ["G;.";"G.;"]); | |
| (0x83A0, ["FLVG";"FLVL"]); | |
| (0x4E38, ["LSH";"SLH"]); | |
| (0x5E7E, ["XZ";"XXZX";"XXAX"]); | |
| (0x7228, ["OUD,";"OJA,";"OJQ,"]); | |
| (0x25CB, ["OU";";"]); | |
| (0x7684, ["LPLH";"T"]); | |
| (0x4E09, ["S/";"AAA"]); |
This file contains hidden or 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-modules (srfi srfi-1)) | |
| (define* (partition-by f l #:optional (p eqv?)) | |
| (if (null? l) | |
| '() | |
| (let A ((L '()) (M (list (car l))) (R (cdr l)) (f1 (f (car l)))) | |
| (if (null? R) | |
| (reverse (cons (reverse M) L)) | |
| (let* ((R1 (car R)) (f2 (f R1)) (R2 (cdr R))) | |
| (if (p f1 f2) |
This file contains hidden or 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
| START_TIME=$(( $(date -d "2016-01-01 00:00:00" +%s) - 60 * $MINUTE - $SECOND )) | |
| while :; do | |
| if [[ $(date +%s) -ge $START_TIME ]]; then | |
| mplayer $FILE; | |
| break; | |
| fi; | |
| sleep 1; | |
This file contains hidden or 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
| 000000000040069a <xorswap>: | |
| 40069a: 8b 07 mov (%rdi),%eax | |
| 40069c: 33 06 xor (%rsi),%eax | |
| 40069e: 89 07 mov %eax,(%rdi) | |
| 4006a0: 33 06 xor (%rsi),%eax | |
| 4006a2: 89 06 mov %eax,(%rsi) | |
| 4006a4: 31 07 xor %eax,(%rdi) | |
| 4006a6: c3 retq | |
| 00000000004006a7 <swap>: |
This file contains hidden or 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
| #include <libtcc.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| void gen_addx(char *s, int x) { | |
| sprintf(s, "\ | |
| int addx(int y) { \ | |
| return (%d + y); \ | |
| }", x); | |
| } |