Skip to content

Instantly share code, notes, and snippets.

View igalshilman's full-sized avatar

Igal Shilman igalshilman

View GitHub Profile
(defprotocol RandomOperations
(uniform [this])
(exponential [this rate])
(normal [this avg stddev])
(geometric [this rate]))
(extend-protocol RandomOperations
java.util.Random
(uniform [this]
;; code of a simple program that counts to zero.
(def count-to-zero-code
'(defn count-to-zero [n]
(if (zero? n)
0
(count-to-zero (dec n)))))
;; simple AST
(defrecord Function [name args body])
(defn base->base
[input-bit-width output-bit-width]
(comp
(number->bits input-bit-width)
(partition-all output-bit-width)
(map bits->number)))
import random
import bisect
from array import array
def decode(n):
return INDEX[n]
class VertexSet(object):
def __init__(self):
self.items = array('H')
'use strict';
const VERTEX_COUNT = 7*7*7*7*7;
const VERTEX_DEGREE = 243;
function buildGraph() {
function* range(lo,hi) {
var index = 0;
for (var i = lo ; i < hi ; i++) {
yield i;
<html>
<body>
<div>
<div id="results"></div>
<div>
<script>
'use strict';
function appendResult(div, data) {
var list = document.createElement("ul");
package com.igal
import java.lang.{Iterable => JavaIterable}
import org.apache.flink.api.common.functions.{GroupReduceFunction, Partitioner}
import org.apache.flink.api.common.operators.Order
import org.apache.flink.api.java.utils.ParameterTool
import org.apache.flink.api.scala.{DataSet, _}
import org.apache.flink.util.Collector
FROM ubuntu:latest
RUN apt-get update && apt-get install -y \
build-essential \
autoconf \
libtool \
pkg-config \
libprotobuf-dev \
protobuf-compiler \
protobuf-compiler-grpc \
Smoke Python Test
=================
from datetime import timedelta
from statefun import *
################################################################################
type TodoItem = {
title: string,
completed: boolean,
}
export default restate.object({
name : "todo",
handlers: {
add: async (ctx: ObjectContext, item: TodoItem) => {
const items = await ctx.get("items") ?? [];