kamelzcs's library 2020-06-24T20:41:20+09:00 http://kamelzcs.github.com kamelzcs Copyright (c) 2012 kamelzcs From Jackknife to A/B Testing 2019-12-23T22:28:32+09:00 http://kamelzcs.github.com/2019/12/23/from-jackknife-to-ab-testing/ Background In A/B Testing, there is a group of data and , the metrics we interested in are the difference... Monads 2015-08-24T19:16:47+09:00 http://kamelzcs.github.com/2015/08/24/monads/ Lecture Contents Type class really gives one good intuition about Monad. Intuitively, it is this ability to use the output... Applicative functors, Part II 2015-08-24T00:25:09+09:00 http://kamelzcs.github.com/2015/08/24/applicative-functors-part-ii/ Lecture Contents The classification about Levels of Abstraction is really great. With respect to Applicative and Monad in particular, there... Applicative functors, Part I 2015-08-23T19:40:32+09:00 http://kamelzcs.github.com/2015/08/23/applicative-functors-part-i/ Lecture Contents The induction from Functor to Applicative is quite beautiful. Recalled that there exists fmap :: (a -> b)... IO 2015-08-22T06:08:38+09:00 http://kamelzcs.github.com/2015/08/22/io/ Lecture Contents There is no String “inside” an IO String, IO String is a promise, to produce a String requires... Folds and monoids 2015-08-21T01:32:54+09:00 http://kamelzcs.github.com/2015/08/21/folds-and-monoids/ Lecture Contents To understand the different relations between type classes, Type class is a great reference. This is a fantastic... Lazy evaluation 2015-08-18T20:18:10+09:00 http://kamelzcs.github.com/2015/08/18/lazy-evaluation/ Lecture Contents Lazy evaluation is beautiful because it makes infinite data structures possible. But it makes reasoning about the programme... More polymorphism and type classes 2015-08-18T01:01:33+09:00 http://kamelzcs.github.com/2015/08/18/more-polymorphism-and-type-classes/ Lecture Contents f :: a -> a -> a f x y = x && y The reason this doesn’t... Higher-order programming and type inference 2015-08-17T19:46:29+09:00 http://kamelzcs.github.com/2015/08/17/higher-order-programming-and-type-inference/ Lecture Contents There is an art to deciding the order of arguments to a function to make partial applications of... Recursion patterns, polymorphism, and the Prelude 2015-08-17T01:13:17+09:00 http://kamelzcs.github.com/2015/08/17/recursion-patterns-polymorphism-and-the-prelude/ Lecture Content In fact, experienced Haskell programmers hardly ever write recursive functions! This is quite unbelieable for me at first... Algebraic Data Types 2015-08-16T23:42:59+09:00 http://kamelzcs.github.com/2015/08/16/algebraic-data-types/ Lecture Content Algebraic data types in general data AlgDataType = Constr1 Type11 Type12 | Constr2 Type21 | Constr3 Type31 Type32... Introduction to Haskell 2015-08-15T22:16:12+09:00 http://kamelzcs.github.com/2015/08/15/introduction/ Lecture Content Among all of them, Pure is the most tricky part. In the current computer system model, side effects... Learn Haskell 2015-08-14T02:11:25+09:00 http://kamelzcs.github.com/2015/08/14/cis194-1/ Why Functional Programming In the current world, tons of programming languages exist now, and tons of new ones are being... Decouple the relation and approach in different metrics 2015-07-27T07:49:07+09:00 http://kamelzcs.github.com/2015/07/27/ipsc2015-h2/ Problem H – Humble Captains The problem is given an undirected graph (Vertices<=300), and need to color its vertices into... SRM663 2015-07-27T01:24:30+09:00 http://kamelzcs.github.com/2015/07/27/srm663/ ChangingChange Analyze The constraint on D is the key to solve this problem. As different ways are given, Generating function... Function_overriding in Java vs C++ 2015-06-22T17:27:24+09:00 http://kamelzcs.github.com/2015/06/22/function_overriding/ Similar code, different behaviour Quesion in stackoverflow: Java version: class base{ public void func1(){ func2(); } public void func2(){ System.out.println("... SRM 661 div1 2015-06-13T18:41:40+09:00 http://kamelzcs.github.com/2015/06/13/srm661/ SRM 661 consists of 250 + 450 + 1000. 250 and 450 are two maths problems. MissingLCM Given $N \in... One C++ polymorphism quesion 2015-05-24T19:58:27+09:00 http://kamelzcs.github.com/2015/05/24/polymorphism-c/ Confusing subtype polymorphism When I first began to learn the polymorphism of C++, the Subtype Polymorphism similar to the following... sicp-4-3-3 2015-03-16T21:02:58+09:00 http://kamelzcs.github.com/2015/03/16/sicp-4-3-3/ 4.51 It would always be (a b 1). 4.52 (define (analyze-if-fail exp) (let ((first (analyze (cadr exp))) (second (analyze (caddr... sicp-4-3-2 2015-03-15T06:36:17+09:00 http://kamelzcs.github.com/2015/03/15/sicp-4-3-2/ 4.39 (require (> miller cooper)) (require (not (= baker 5))) (require (not (= cooper 1))) (require (not (= fletcher 5)))... sicp-4-3-1 2015-03-13T22:47:34+09:00 http://kamelzcs.github.com/2015/03/13/sicp-4-3-1/ I just find 4.3 very hard to understand. Eventhough I followed the author’s ideas, and find it work. But this... sicp-4-2-3 2015-03-12T20:27:03+09:00 http://kamelzcs.github.com/2015/03/12/sicp-4-2-3/ 4.32 In the current version, car is lazy as well, which makes it possible to build structures such as infinite... sicp-4-2-1 2015-03-11T19:20:01+09:00 http://kamelzcs.github.com/2015/03/11/sicp-4-2-1/ 4.25 (define (unless condition usual-value exceptional-value) (if condition exceptional-value usual-value)) (define (factorial n) (unless (= n 1) (* n (factorial... sicp-4-1-6-4-1-7 2015-03-09T23:37:54+09:00 http://kamelzcs.github.com/2015/03/09/sicp-4-1-6-4-1-7/ 4.16 a: (define (lookup-variable-value var env) (define (env-loop env) (define (scan vars vals) (cond ((null? vars) (env-loop (enclosing-environment env))) ((eq?... sicp-4-1-3-4-1-5 2015-03-06T20:12:10+09:00 http://kamelzcs.github.com/2015/03/06/sicp-4-1-3-4-1-5/ 4.11 (define (make-frame variables values) (if (= (length variables) (length values)) (map cons variables values) (error "length mismatch -- MAKE-FRAME"... sicp-4-1 2015-03-06T00:51:11+09:00 http://kamelzcs.github.com/2015/03/06/sicp-4-1/ 4.1 It takes me several minutes to really understand the quanstion. :( It really only has something to do with... sicp-3-5-4-3-5-5 2015-03-05T06:11:43+09:00 http://kamelzcs.github.com/2015/03/05/sicp-3-5-4-3-5-5/ 3.77 (define (integral delayed-integrand initial-value dt) (cons-stream initial-value (let ((integrand (force delayed-integrand))) (if (stream-null? integrand) the-empty-stream (integral (delay (stream-cdr integrand))... sicp-3-5-3 2015-03-03T22:24:29+09:00 http://kamelzcs.github.com/2015/03/03/sicp-3-5-3/ 3.63 guess is used to share the computation result between the succssive calling. Otherwise each call to sqrt-stream x would... sicp-3-5-1-3-5-2 2015-03-02T20:24:25+09:00 http://kamelzcs.github.com/2015/03/02/sicp-3-5-1-3-5-2/ Code from the text. (define (stream-ref s n) (if (= n 0) (stream-car s) (stream-ref (stream-cdr s) (- n 1))))... sicp-3-4 2015-03-02T01:03:22+09:00 http://kamelzcs.github.com/2015/03/02/sicp-3-4/ 3.39 101: P1 , P2 121: P2, P1 100: P1 computes (* x x), then P2 completes and sets x...