Skip to content

Instantly share code, notes, and snippets.

View dtinth's full-sized avatar
🎶
𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪

Thai Pangsakulyanont dtinth

🎶
𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪
  • @bemusic                 @creatorsgarten                 @eventpop                 @showdownspace                 @spacetme                @wonderfulsoftware                
  • Krungthepmahanakhonamonrattanakosinmahintharayutthayamahadilokphopnoppharatratchathaniburiromudomratchaniwetmahasathanamonphimanawatansathitsakkathattiyawitsanukamprasit (Bangkok), Thailand
  • YouTube @dtinth
View GitHub Profile
@dtinth
dtinth / adapter.md
Created November 6, 2012 13:22
An Adapter Analogy

An Adapter Analogy

Suppose that you have a very old keyboard, which uses a PS/2 port. It is a really good keyboard for gaming but unfortunately, it isn't being manufactured anymore, and you love it very much.

Now also suppose that your favorite PC has died, and you bought a new laptop just to notice that it does not have a PS/2 port anymore. Instead, your laptop has several USB ports.

function checkGood(good) { return good; }
function checkBad(good) { return !good; }
function checkAlways(good) { return true; }
function defer() {
var result = null
var finish = false
var good
var handlers = []
@dtinth
dtinth / clauses.md
Created December 9, 2012 16:33
Clauses

Finding Clauses

The teacher emphasized using "keywords" to find clauses, such as "that", "when", "how", "what", "which", "who", "if", and so on. The problem is that those keywords don't always appear.

Usually, the word "that" could be taken out from the sentence.

  • He said (that) it worked.
  • Pick any color (that) you want!
  • You may say (that) I'm a dreamer.
@dtinth
dtinth / fnr.md
Created December 11, 2012 07:41
Functions and Relations

$$ \newcommand{\NOT}{{\sim}} \newcommand{\R}{\textbf{ R }} $$

  • (f) is one-to-one ( \Leftrightarrow ) ( \forall a,b \in X, f(a) = f(b) \rightarrow a = b )
  • (f) is onto ( \Leftrightarrow ) ( \forall y \in Y, \exists x \in X \text{ such that } f(x) = y )
  • (f) has one-to-one correspondence ( \Leftrightarrow ) (f) is both one-to-one AND onto.
  • (f^{-1}(x)) is the inverse of (f(x)) ( \Leftrightarrow ) ( \forall x \in X, f^{-1}(f(x)) = x )
@dtinth
dtinth / css.css
Last active October 14, 2015 01:37
Pagist
.conversion { width: 100%; margin-bottom: 1em; }
.conversion th { text-align: left; white-space: nowrap; width: 8em; vertical-align: top; }
.conversion tr.site th,
.conversion tr.site td { vertical-align: bottom; }
.conversion .site strong { font-size: 1.5em; }
.conversion ul { margin: 0; }
@dtinth
dtinth / WtfWtf.java
Created December 19, 2012 05:06
Design Patterns Example
import java.util.Date;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class WtfWtf {
// concrete logger but uses different interface
class UiLogger {
@dtinth
dtinth / checkstyle.xml
Last active December 11, 2015 08:59
checkstyle.xml for OOP
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
<module name="Checker">
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
<module name="MissingOverride"/>
@dtinth
dtinth / CallLogTest.java
Created February 4, 2013 06:51
Call Log Test
import static org.junit.Assert.*;
import org.junit.Test;
public class CallLogTest {
private CallLog log = new CallLog();
@Test
import java.util.HashMap;
public class AddressBook {
private HashMap<String, String> map = new HashMap<String, String>();
public void record(String name, String tel) {
map.put(name, tel);
}
@dtinth
dtinth / 1.md
Last active December 13, 2015 19:09
เล่นกับ CLIPS