Table of Contents
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
module type TNT = sig | |
type 'a typed_name | |
val inj : string -> 'a typed_name | |
val prj : 'a typed_name -> string | |
end | |
module TN : TNT = struct | |
type 'a typed_name = string | |
let inj = fun x -> x | |
let prj = fun x -> x |
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
# https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make | |
rwildcard=$(foreach d,$(wildcard $(1:=/*)), \ | |
$(call rwildcard,$d,$2) \ | |
$(filter $(subst *,%,$2),$d)) | |
# http://www.jsk.t.u-tokyo.ac.jp/~k-okada/makefile/ | |
empty:= | |
space:= $(empty) $(empty) | |
myjoin=$(subst $(space),$2,$1) | |
# -------------------------------------------------- | |
LOCAL_ROOT = http://localhost:8000/ |
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
module Main | |
import IdrisJvm.FFI | |
import IdrisJvm.IO | |
import Java.Lang | |
%default total | |
record Java a ret where |
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
% https://tex.stackexchange.com/a/273223/124998 | |
\documentclass[a4paper]{article} | |
\usepackage{tcolorbox} | |
\tcbuselibrary{skins} | |
\title{ | |
\vspace{-3em} | |
\begin{tcolorbox}[colframe=white,opacityback=0] | |
\begin{tcolorbox} |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
(*--------------------------------------------------------------------------- | |
Copyright (c) 2015 Daniel C. Bünzli. All rights reserved. | |
Distributed under the BSD3 license, see license at the end of the file. | |
%%NAME%% release %%VERSION%% | |
---------------------------------------------------------------------------*) | |
(* Simple generators according to: | |
Kiselyov, Peyton-Jones, Sabry | |
Lazy v. Yield: Incremental, Linear Pretty-printing |
defprotocol
: defines an interfacedeftype
: create a bare-bones object which implements a protocoldefrecord
: creates an immutable persistent map which implements a protocol
Typically you'll use defrecord
(or even a basic map
);
unless you need some specific Java inter-op,
where by you'll want to use deftype
instead.
Note:
defprotocol
allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,
This is a comparison of the different formatting styles including with clang-format.
Generated via:
styles=( LLVM Google Chromium Mozilla WebKit )
for style in $styles
do
clang-format -style=$style ChLcpIterativeAPGD.h > ChLcpIterativeAPGD.$style.h
done
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
(ns reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
NewerOlder