author: @deltam
Colojure用DBアクセスライブラリ、Kormaの検索系機能の紹介とリレーション機能の実験。
Korma 0.3.0-beta11
author: @deltam
Colojure用DBアクセスライブラリ、Kormaの検索系機能の紹介とリレーション機能の実験。
Korma 0.3.0-beta11
<?php | |
/** | |
* 「ビューティフル・コード」(P.91)で、普通のプログラマは二分探索をまともに書けないと煽られたので書いた。 | |
*/ | |
function search($needle,$haystack) | |
{ | |
$start=0; | |
$end=count($haystack); | |
do |
<html> | |
<!-- forのかわりにhogeを使う --> | |
<script id="hoge" type="text/oreore-javascript"> | |
hoge(var i=0; i<10; i++) | |
console.log(i); | |
</script> | |
<script type="text/javascript"> | |
var script=document.getElementById('hoge'); |
user=> (def my-name (.toByteArray (BigInteger. "7234307623547114003"))) | |
#'user/my-name | |
user=> (-> (java.io.FileOutputStream. "name.txt") .getChannel (.write (java.nio.ByteBuffer/wrap my-name))) | |
8 | |
; Ctrl-D | |
; $ cat name.txt | |
; deltam |
;;; Usage: clj decode.clj prime.txt > decss.c.gz | |
;;; gunzip decss.c.gz | |
(def src (slurp (first *command-line-args*))) | |
(def illegal-prime (bigint (.replaceAll src "[^0-9]" ""))) | |
(def prime-bytes (.toByteArray (.toBigInteger illegal-prime))) | |
(def stdout (.getChannel (java.io.FileOutputStream. java.io.FileDescriptor/out))) | |
(.write stdout (java.nio.ByteBuffer/wrap prime-bytes)) |
<?php | |
require 'stream.php'; | |
/** SICP3.5.2 無限ストリーム */ | |
function integers_start_from($n) | |
{ | |
return cons_stream($n, function() use ($n) {return integers_start_from($n + 1);}); | |
} | |
$integers = integers_start_from(1); | |
echo "integers\n"; |
// nand2tetris 「コンピュータシステムの理論と実装」 | |
// 01のNandだけで論理素子を作る | |
CHIP And { | |
IN a, b; | |
OUT out; | |
PARTS: | |
// Put your code here: | |
Nand (a=a, b=b, out=c0); |
// This file is part of www.nand2tetris.org | |
// and the book "The Elements of Computing Systems" | |
// by Nisan and Schocken, MIT Press. | |
// File name: projects/05/CPU.hdl | |
/** | |
* The Central Processing unit (CPU). | |
* Consists of an ALU and a set of registers, designed to fetch and | |
* execute instructions written in the Hack machine language. | |
* In particular, functions as follows: |
package main | |
import ( | |
"code.google.com/p/goauth2/oauth" | |
"fmt" | |
// "code.google.com/p/google-api-go-client/drive/v2" | |
"google.golang.org/api/drive/v2" // こっちに書き換え | |
"log" | |
"net/http" | |
"os" |
package mypackage | |
import ( | |
"fmt" | |
"time" | |
someLibrary "github.com/deltam/some-library-go" // パッケージ名と同じ別名をつける | |
) | |
func Hoge() { |