Skip to main content

Log: 202105-06

· One min read

Achievement

  • The C++ Programming Language (C++11) (4th Edition) / Bjarne Stroustrup
    • Done
  • Cracking the Coding Interview (6th Edition) / Gayle Laakmann McDowell
  • A First Course in Graph Theory / Gary Chartrand, Ping Zhang
  • Mathematics for Machine Learning / Marc Peter Deisenroth, A. Aldo Faisal, Cheng Soon Ong
    • Done

Log: 202103

· One min read

Achivements

  • Introduction to the Theory of Computation
    • 0 Introduction -
  • Friendly Introduction to Number Theory
    • Chapter 15 - Chapter 18
  • AtCoder: 851 -> 939
    • Joined
      • ABC 194
      • ABC 195
      • ABC 196
      • ABC 197
    • Solved
      • Browns
      • Waterblues
  • Programming in Scala
    • Readed
      • too rich for me to master it, so I don't thnk I'll use Scala for now.
  • Linux Inside
    • Booting
    • Initialization

Music

  • THE STARBEMS
    • Sweet Nothing Blues

Log: 202102

· One min read

Achievements

  • "Programming in Haskell (Second Edition)" / Graham Hutton

    • I learned many new perspective of programming.
      • lazy evaluation
      • induction by code to guarantee specifications and refactor implements
  • "Programming in Scala (Fourth Edition)" / artima / Martin Odersky, Lex Spoon, Bill Venners

    • that for loop can be used with functional really helps me write code
    • traits is a strong implementation tool in term of scalability.
      • but I worry about abusing traits makes our codes chaos such as awful C++ codes...
  • "A Friendly Introduction to Number Theory" / Joseph H. Silverman

    • Chap. 4 -
    • I understood the mechanism of the Euclidean Algorithm (gcd) as last
  • "情報科学における論理" / 日本評論社 / 小野寛晰

    • Predicate Logic
    • Modal Logic
  • "計算理論の基礎 (原著第 2 版)" / 共立出版 / Michael Sipser

  • AtCoder

    • achived all AC about difficulty 800 - 1199 (185 problems)
    • rank up from Brown to Green (highest 831)

Log: 202101

· 5 min read

Achivement

  • "りあクト! TypeScript で始めるつらくない React 開発(第 3.1 版)【I. 言語・環境編】"

  • "りあクト! TypeScript で始めるつらくない React 開発(第 3.1 版)【II. React 基礎編】"

  • "りあクト! TypeScript で始めるつらくない React 開発(第 3.1 版)【III. React 応用編】" / 大岡 由佳

  • "体系的に学ぶ 安全な Web アプリケーションの作り方(第 2 版)" / 徳丸 浩

  • AtCoder Problems / BC4B / Hard 100 (2 nd)

  • "Programming in Haskell (2nd Edition)" / Grahm Hutton

りあクト!

Original: https://github.com/oukayuka/Riakuto-StartingReact-ja3.1
https://github.com/e5pe0n/rea-ct

  • very nice book
  • Learned history of front end
  • Learned grammer of JavaScript and TypeScript
  • Learned tools for JavaScript and TypeScript
    • nodenv
    • node
    • yarn
    • create-react-app
    • tslint
    • stylelint
    • pritter
  • Learned modern style of implementation in React
    • FC, Hooks, Redux, React Query, Suspense, Concurrent

体系的に学ぶ 安全な Web アプリケーションの作り方

  • Good
    • well organized
  • Bad
    • too monotonous
    • tools used in this book are old
      • PHP, Perl
  • Learned basic valnerabilities and attacks, and measures against them

Programming in Haskell

About this book

  • Many examples of implementation
  • Detail of procedure to make recursive functions step by step

About Haskell

  • プログラムを読むことが式展開と同じ
    • 構文解析機みたい,シンタクティック
  • 命令型に比べて考えるべき場所が少ない
    • 命令型
      • それぞれの変数の値,値の変わるタイミングに注意する必要がある
        • 配列のインデックスとそこの値とか
    • 宣言型
      • 演繹的
      • 式展開なのでとっ散らからない
        • 再帰関数を理解しやすい
      • less bugs

e.g. insertion sort in Haskell

insert :: Ord a => a -> [a] -> [a]
insert x [] = [x]
insert x (y:ys)
| x <= y = x:y:ys
| otherwise = y:insert x ys

isort :: Ord a => [a] -> [a]
isort [] = []
isort (x:xs) = insert x (isort xs)


isort [3, 2, 1, 4]
= insert 3 (insert 2 (insert 1 (insert 4 [])))
= insert 3 (insert 2 (insert 1 [4]))
= insert 3 (insert 2 [1, 4])
= insert 3 [1, 2, 4]
= [1, 2, 3, 4]
  • クイックソートに感動
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = qsort smaller ++ [x] ++ qsort larger
where
smaller = [a | a <- xs, a <= x]
larger = [b | b <- xs, b > x]
  • It's better to read curried functions without replacement with lambda expressions if you understood a notation of curried functions is syntactic sugar of lambda expressions
    • consider the syntax of curried functions is default to define functions with multi args so you can get a partial applied function from any multi args function
add :: Int -> Int -> Int
add x y = x + y

-- means

add :: Int -> (Int -> Int)
add = \x -> (\y -> x + y)
  • Type declarations and Data declarations are similar with ones of TypeScript
-- Haskell
data Bool = False | True
// TypeScript
type Bool = true | false
  • Applicative and Monad
    • Applicative is too complex to understand it and to use it without considering
    • I feel that Monad is useful a bit, but I cannot found how to use Applicative
  • Reasoning
    • induction is used to reason about recursive types or recursive functions
    • we can confirm if the logic of a function is correct

e.g.

replicate :: Int -> a -> [a]
replicate 0 _ = []
replicate n x = x : replicate (n - 1) x
-- Base case:
length (replicate 0 x)
= { applying replicate }
length []
= { applying length }
0

-- Inductive case:
length (replicate (n + 1) x)
= { applying replicate }
length (x : replicate n x)
= { applying length }
1 + length (replicate n x)
= { induction hypothesis }
1 + n
= { commutativity of + }
n + 1

Music

  • In Flames
  • Sithu Aye

Log: 202011

· One min read

成果

  • 蟻本 Chapter 3 (p.127 ~ p.236)
    • しゃくとり法 (Two pointers)
    • Segment tree
    • DP
    • Flow network
    • 計算幾何
  • AtCoder
    • リアルタイム
      • ABC 181 ~ 184
      • ARC 109
      • 解けたのだいたい半分くらい
      • Rating: 390 (ギリ茶色いけず)
      • パフォーマンス: 617 ~ 1099
    • 過去問
      • ABC 171 ~ 180
  • 数理基礎論講義 - 論理・集合・位相 - / 金子 晃 / サイエンス社
    • 読了
  • 現代数学入門 / 遠山 啓 / ちくま学芸文庫
    • 半分ちょい

感想とか

  • 競プロ楽しい
    • コード読むの速くなった,実装の語彙が増えた
    • ABC いっぱい解けた
    • DP にまだ慣れない
    • 確率苦手.勉強し直せ
  • 数学楽しい