Skip to content

Instantly share code, notes, and snippets.

View felixdae's full-sized avatar

Zhangqiu Yu felixdae

  • lemei tech
  • ShenZhen, China
View GitHub Profile
{------------------------------------------------
A Haskell solution to: http://www.coinheist.com/rubik/a_regular_crossword/grid.pdf
using the Z3 SMT solver.
Z3 finds the following solution in about 7 mins
on my Mac Core-i5, and another 7 mins to prove
it's unique.
NHPEHAS
DIOMOMTH
@felixdae
felixdae / mysqlpool.scala
Created July 16, 2016 12:50 — forked from tsuna/mysqlpool.scala
MySQL JDBC connection pool for Scala + Finagle
// Copyright (C) 2012 Benoit Sigoure
// Copyright (C) 2012 StumbleUpon, Inc.
// This library is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version. This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
// General Public License for more details. You should have received a copy
// of the GNU Lesser General Public License along with this program. If not,
import io
import numpy as np
from PIL import Image
import tensorflow as tf
class Tensorboard:
def __init__(self, logdir):
self.writer = tf.summary.FileWriter(logdir)
def close(self):
@felixdae
felixdae / Y Combinator in Haskell.md
Created June 9, 2019 08:02 — forked from lukechampine/Y Combinator in Haskell.md
Deriving the Y Combinator in Haskell

The Y Combinator

The Y Combinator is a classic lambda calculus construct that many people find baffling. Here's my attempt to explain it as clearly as possible (no promises!). Familiarity with Haskell syntax is assumed.

The problem we're trying to solve is how to write an anonymous function (a "lambda") that is recursive. Normally, if you want to write a recursive function, it looks like this:

fac n = if n == 0 then 1
        else n * fac (n-1)