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
#lang typed/racket | |
(require racket/list) | |
(define (operator c ) | |
(match c | |
['+' Plus] | |
['-' Minus] | |
['/' Div])) |
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
\* BEGIN TRANSLATION (chksum(pcal) = "e913b13a" /\ chksum(tla) = "2d410eef") | |
CONSTANT defaultInitValue | |
VARIABLES i, m, l, n, j, k, p, skips, x, y, flag, pc | |
vars == << i, m, l, n, j, k, p, skips, x, y, flag, pc >> | |
Init == (* Global variables *) | |
/\ i = defaultInitValue | |
/\ m = defaultInitValue | |
/\ l = defaultInitValue |
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 bayermoore ----------------------------- | |
EXTENDS Integers, Sequences,Naturals, TLC | |
CONSTANTS Character, text, pattern | |
ASSUME text \in Seq(Character) | |
ASSUME pattern \in Seq(Character) | |
Max(x,y) == IF x < y THEN y ELSE x | |
struct == [a |-> 97, b |-> 98, c |-> 99] | |
(*--algorithm bayermoore | |
variables |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
let testcompare () = Alcotest.(check bool) "Test for weight comparison" true (Graph.EDGECOMPARE_weight.compare [1,2,4] [ 5,6,7] ) | |
let () = | |
Alcotest.run "Weights" | |
[ | |
("test compare weights of edges", [ | |
Alcotest.test_case "Compare weights" `Quick testcompare; | |
]); | |
] |
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
(library | |
(modules graph) | |
(name graph) | |
) | |
(test | |
(name kruskaltest) | |
(modules kruskaltest) | |
(libraries alcotest graph)) |
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
type edge = ( int * int * int ) list | |
module type EDGECOMPARE = sig | |
type t | |
val compare : 'a list -> 'a list ->bool | |
end | |
module EDGECOMPARE_weight : EDGECOMPARE with type t = edge = struct | |
type t = edge | |
let compare l r = ( List.nth l ( List.length l/ 2 )) == ( List.nth r (List.length r/2)) |
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
import tensorflow as tf | |
import numpy as np | |
v = tf.constant([1.,-2.,0.5]) | |
tv = tf.convert_to_tensor(v,dtype=np.float32) | |
with tf.Session() as sess: | |
x = tf.nn.softmax(tv) | |
tf.Print(x, [x], message="Softmax") | |
print(sess.run(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
module Simulator where | |
import Numeric.LinearAlgebra | |
import Graphics.Matplotlib | |
import Control.Monad.State | |
import qualified Data.Map as Map | |
import Text.Printf | |
import System.Random | |
import Control.Monad | |
import Data.Array | |
import Data.Foldable |
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
(package-initialize) | |
(load "/home/mohan/.opam/4.02.1/share/emacs/site-lisp/tuareg-site-file") | |
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" | |
"share"))))) | |
(when (and opam-share (file-directory-p opam-share)) | |
;; Register Merlin | |
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share)) | |
(autoload 'merlin-mode "merlin" nil t nil) | |
;; Automatically start it in OCaml buffers |
NewerOlder