Skip to content

Instantly share code, notes, and snippets.

View therne's full-sized avatar
🎯
Focusing

Jun Kim therne

🎯
Focusing
View GitHub Profile
@therne
therne / gist:6177138
Last active December 20, 2015 18:39
MoonlightDriver API Documentation

Codename 'MoonlightDriver' REST API Documentation


1. Summary

메인서버는 Google Web Toolkit (GWT)을 사용하며, Java EE로 작성되었다. 메인서버에 부속된 푸시서버는 Google Cloud Messaging(GCM) 기술을 사용하며, PHP로 작성되었다.

클라이언트단에서 서버로의 모든 호출은 비동기식으로 이루어지며(Asynchronize), 서버단에서 서블릿은 그 요청을 처리해 JSON 형태의 결과값을 HTTP Response로 반환한다.

@therne
therne / README.md
Last active December 30, 2015 22:49
Clutch API Documentation

Clutch Application Server

클러치 서비스의 어플리케이션 서버이다.

서버 언어로는 Node.js를 사용하며, ExpressJs 및 ejs를 사용하여 API와 웹 백엔드를 구축한다. 데이터베이스 엔진으로는 MongoDB, 드라이버로는 mongoose를 사용한다.

클라이언트단에서 서버로의 모든 호출은 비동기식으로 이루어지며(Asynchronize), 서버는 그 요청을 처리해 JSON 형태의 결과값을 HTTP 응답 형태(application/json)로 반환한다.

@therne
therne / gist:9013755
Created February 15, 2014 02:35
Rubbish XML Data...
<xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<!-- This is an title area -->
<LinearLayout android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal">
<TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center"
android:text="Google" android:textSize="18sp" android:textColor="#FFFFFF"
android:layout_marginLeft="8dp" android:layout_marginRight="16dp" />
<EditText android:layout_width="match_parent" android:layout_height="match_parent"
android:id="@+id/searchField" android:hint="Search Google" android:layout_weight="1.0" />
@therne
therne / Starter.java
Created January 31, 2015 09:10
The super, gorgeous and compatible Entrypoint class for Vert.x Gradle
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
/**
* Starter - Entry point of the Vert.x gradle module.
* @author vista
/**
* Glide (이미지 로딩 라이브러리)를 초기화한다.
*/
void initGlide() {
Glide.setup(new GlideBuilder(this)
.setDiskCache(DiskLruCacheWrapper.get(Glide.getPhotoCacheDir(this), DISK_CACHE_SIZE))
.setDecodeFormat(DecodeFormat.PREFER_RGB_565)
);
Glide.get(this).register(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(new OkHttpClient()));
@therne
therne / ISP.java
Last active August 29, 2015 14:21
SOLID : Interface Segregation Principle Example
/**
* ClientDataReceiver
* 클라이언트로부터 데이터가 수신될 때 호출되는 리시버이다.
*/
interface ClientDataReceiver {
public void onLoginDataReceive(User user);
public void onGamePlayDataReceive(PlayData data);
}
/**
@therne
therne / GeneratorFunctionBuilder.js
Last active August 29, 2015 14:26
GeneratorFunctionBuilder - Builds new generator function with code.
'use strict';
var util = require('util');
var GeneratorFunction = (function*(){}).constructor;
module.exports = GeneratorFunctionBuilder;
/**
* Builds new generator function with code.
*/
@therne
therne / kNN.md
Last active March 18, 2016 02:02

k-NN Algorithm

k-NN (k-Nearest Neighbors) 알고리즘은 지도 학습 알고리즘의 일종으로, 이미 특정한 항목 (라벨)로 분류되어 있는 데이터들을 가지고 아직 분류되지 않은 새로운 데이터를 자동으로 분류하는 알고리즘이다.

Regression ? Classification?

이 알고리즘은 회귀 (Regression)보다는 분류 (Classification)라고 볼 수 있다. 회귀의 경우에는 연속된 데이터에 관해서 다음 데이터의 값을 예측하고, 따라서 예측 결과는 연속변수 (continuous variable)이 될 것이다. 하지만 이 경우에는 불연속적인 데이터들의 집합에 대해서 분류를 수행하고, 예측 결과는 카테고리 라벨이 될 것이므로 분류가 적합하다.

(허나 회귀 알고리즘과 분류 알고리즘은 완전히 용도가 구별된 것이 아니다. 예를 들어 선형회귀를 이용해 경계면을 만드는 방식으로 분류를 할 수도 있고, k-NN을 이용해 회귀를 할 수도 있다.)

간단한 이론적 원리

@therne
therne / 1. Type Checking.md
Last active March 23, 2018 06:56
20160313 언어론 스터디 자료 (Lecture 4-2)

Type and Type Checking

오늘의 PPT 자료 링크

Type

정의 : 어떠한 항 (Term)에 대해서, 그 항은 타입을 가지고 있고 그 항의 입력과 결과는 그 타입으로 제한된다.
표기 M : A 는, M이 A라는 타입을 가지고 있다는 의미이다.

예를 들어, Integer List라는 타입은 다음과 같이 귀납적으로 정의할 수 있다 : type IntList = Empty | Int ** IntList.

@therne
therne / dataset.py
Created July 9, 2016 13:31
Batch data loader for minibatch training
import copy
import numpy as np
class DataSet:
def __init__(self, data, batch_size=1, shuffle=True, name="dataset"):
assert batch_size <= len(data), "batch size cannot be greater than data size."
self.name = name
self.data = data
self.batch_size = batch_size
self.shuffle = shuffle