Skip to content

Instantly share code, notes, and snippets.

View chunrapeepat's full-sized avatar
🏠
Working from home

Chun Rapeepat chunrapeepat

🏠
Working from home
View GitHub Profile
@chunrapeepat
chunrapeepat / something.py
Created July 1, 2017 12:21
Linear Regression Example
# -*- coding: utf-8 -*-
from numpy import *
def compute_error_function(dataset, current_m, current_c):
error = 0
for i in range(0, len(dataset)):
x = dataset[i, 0]
y = dataset[i, 1]
error += (y - (current_m * x + current_c)) ** 2
return (error / float(len(dataset))) * 0.5
@chunrapeepat
chunrapeepat / dataset.csv
Created July 1, 2017 12:22
Linear Regression Example
32.502345269453031 31.70700584656992
53.426804033275019 68.77759598163891
61.530358025636438 62.562382297945803
47.475639634786098 71.546632233567777
59.813207869512318 87.230925133687393
55.142188413943821 78.211518270799232
52.211796692214001 79.64197304980874
39.299566694317065 59.171489321869508
48.10504169176825 75.331242297063056
52.550014442733818 71.300879886850353
@chunrapeepat
chunrapeepat / cardat.js
Created September 10, 2017 13:15
ywc15
function cardAt(n) {
const a = ['C', 'D', 'H', 'S'],
b = [2, 3, 4, 5, 6, 7, 8, 9, 0, 'J', 'Q', 'K', 'A']
const c = Math.floor(n / b.length),
d = n - (b.length * c)
return b[d] + a[c]
}
@chunrapeepat
chunrapeepat / intro-comp-sci-sitemap.md
Last active September 23, 2017 08:51
Introduction to computer science sitemap

Introduction to computer science sitemap

[1] Introduction

  • Turing model (Note: Mathematical model of computation)
  • Data Processor (Note: Like a function)
  • Programmable Data Processor
  • The universal turing machine
  • The Von Neumann Model
    • concept: program state stored in memory, program stored as binary patterns
  • 4 subsystems: Memory, Arithmatic logic unit, control unit, I/O
@chunrapeepat
chunrapeepat / finalcrisis_digi.md
Last active December 5, 2017 11:58
Digital Computer Logic

Digital Computer Logic

  • Logic Gates Diagram
  • Demorgans and others
  • Boolean Algebra Equation
  • Kanaugh Map
    • Sum of product simplification
    • Product of sum simplification
  • Binary Adder Circuit
  • What the fuck is timing diagram
@chunrapeepat
chunrapeepat / csP1T2.md
Created January 3, 2018 07:29 — forked from peacher5/csP1T2.md
CS Schedule

วิชาทั้งหมด

วิชาหลัก

  • 01417112 : Cal2 [3]
  • 01418113 : ComPro [1 (Lec), 11 (Lab)]
  • 01418132 : FunCom [1]

วิชาทั่วไป

  • 01255101 : ManSea [1]
  • 01999043 : Creativity [1]
@chunrapeepat
chunrapeepat / ywc-works.md
Last active July 13, 2018 15:35
all services of Young webmaster camp

BEFORE CAMP

  • Coming soon (Static Site)
  • Landing Page (Static Site + Firebase + Google Drive)
    • Candidate Annoucement
    • Homework Upload
    • Payment Verify
  • Interview Queue (Static Site)
  • Registration (Static Site) => Make it reuse next time
  • Grading System (Static Site) => Maybe Reuse
  • Backend Service for Regis & Grading (NodeJS, Mongo) => Maybe Reuse
@chunrapeepat
chunrapeepat / data-structure-midterm.md
Last active September 28, 2018 17:26
Review data structure for midterm @Kasetsart

[x] Primitive Type

  • Basic Data Type
    • Primitive Data Type (e.g. char, int, float)
    • Structure Data Type (e.g. array, struct)
    • Pointer
  • Abstract Data Type
    • Linear Data Structure (e.g. linked list)
    • Non-linear Data Structure (e.g. tree)
  • Integer (Number System)
  • Signed magnitude representation
@chunrapeepat
chunrapeepat / skript.sk
Created January 19, 2019 02:55
Create Minecraft Plugin - CodePlearn
# Trigger, Events & String (Hello World)
on click:
the clicked block is a bedrock
message "§aHello World, I'm §l%player%"
# Custom Command (/car - Riding a horse)
command /car:
executable by: players
trigger:
spawn a horse at player