메인서버는 Google Web Toolkit (GWT)을 사용하며, Java EE로 작성되었다. 메인서버에 부속된 푸시서버는 Google Cloud Messaging(GCM) 기술을 사용하며, PHP로 작성되었다.
클라이언트단에서 서버로의 모든 호출은 비동기식으로 이루어지며(Asynchronize), 서버단에서 서블릿은 그 요청을 처리해 JSON 형태의 결과값을 HTTP Response로 반환한다.
<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" /> |
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())); |
/** | |
* ClientDataReceiver | |
* 클라이언트로부터 데이터가 수신될 때 호출되는 리시버이다. | |
*/ | |
interface ClientDataReceiver { | |
public void onLoginDataReceive(User user); | |
public void onGamePlayDataReceive(PlayData data); | |
} | |
/** |
'use strict'; | |
var util = require('util'); | |
var GeneratorFunction = (function*(){}).constructor; | |
module.exports = GeneratorFunctionBuilder; | |
/** | |
* Builds new generator function with code. | |
*/ |
k-NN (k-Nearest Neighbors) 알고리즘은 지도 학습 알고리즘의 일종으로, 이미 특정한 항목 (라벨)로 분류되어 있는 데이터들을 가지고 아직 분류되지 않은 새로운 데이터를 자동으로 분류하는 알고리즘이다.
이 알고리즘은 회귀 (Regression)보다는 분류 (Classification)라고 볼 수 있다. 회귀의 경우에는 연속된 데이터에 관해서 다음 데이터의 값을 예측하고, 따라서 예측 결과는 연속변수 (continuous variable)이 될 것이다. 하지만 이 경우에는 불연속적인 데이터들의 집합에 대해서 분류를 수행하고, 예측 결과는 카테고리 라벨이 될 것이므로 분류가 적합하다.
(허나 회귀 알고리즘과 분류 알고리즘은 완전히 용도가 구별된 것이 아니다. 예를 들어 선형회귀를 이용해 경계면을 만드는 방식으로 분류를 할 수도 있고, k-NN을 이용해 회귀를 할 수도 있다.)
정의 : 어떠한 항 (Term)에 대해서, 그 항은 타입을 가지고 있고 그 항의 입력과 결과는 그 타입으로 제한된다.
표기 M : A
는, M이 A라는 타입을 가지고 있다는 의미이다.
예를 들어, Integer List라는 타입은 다음과 같이 귀납적으로 정의할 수 있다 : type IntList = Empty | Int ** IntList
.
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 |