This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
x_org = [1,2,3] | |
x = np.array( x_org) | |
y = x + 2*x | |
print y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%cython | |
import numpy as np | |
cimport numpy as np | |
from libc.math cimport sqrt | |
cimport cython | |
ctypedef double (*mertric_ptr)(np.ndarray, np.ndarray) | |
cdef double euclidean_distance( np.ndarray[double, ndim=1, mode='c'] x1): | |
N = x1.shape[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/kivy | |
import kivy | |
#kivy.require('1.0.6') | |
from kivy.app import App | |
from kivy.uix.floatlayout import FloatLayout | |
from kivy.uix.label import Label | |
from kivy.graphics import Color, Rectangle, Point, GraphicException | |
from kivy.clock import Clock | |
from kivy.logger import Logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class String2 | |
{ | |
public static void main(String[] args) | |
{ | |
String hw = "String of Hello world!"; | |
String hwAll[] = {"00", "11", "22"}; | |
String hwAll2[][] = {{"00", "zero"},{"11", "one"}, {"22", "two"}}; | |
System.out.println( hw); | |
// this is used for displaying one dimensional array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use C library, which is log() in math.h | |
cdef extern from "math.h": | |
double log(double x) | |
def kmc( float x): | |
cdef float t | |
t = log( x) | |
return t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
# input is 1, 0 | |
def NNEQ( x1, x2, w1, w2): | |
y = x1 * w1 + x2 * w2 | |
return y | |
def NNEQ_bias( x1, x2, w1, w2, w_bias): | |
y = x1 * w1 + x2 * w2 + w_bias | |
return y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 예제 프로그램 : | |
// 뱀 경기에서 화면관리를 위해 사용되는 절차를 정의한다. | |
// 화면을 80*60(가로*세로)단위로 관리한다. | |
뱀화면 단원 . | |
사용 뱀입력 . | |
사용 단말기 . | |
절차 시작점 ( ) . | |
절차 마무리 ( ) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
파이썬3로 얼마 만큼 한글 코딩이 가능한지 알아본다. | |
""" | |
import random | |
무작위정수 = random.randint | |
쓰다 = print | |
범위 = range | |
지역변수들 = locals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tolerence = 1e-10 | |
M = rand(2, 2) | |
#w0 = [1., 1] | |
#w = copy( w0) | |
w_org = [1, 1] / norm( [1, 1]) | |
w_full = rand(2, 1) | |
w = w_full / norm( w_full) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is for extension of DataFrames. | |
# By the extension, fingerprint can be loaded via string. | |
# Each fingerprint is a set of the binary integers in python. | |
# However, it can be not be loaded directly in Julia, which directly | |
# trainslate a binary integer string to big interger. It is automatic even if | |
# quoto mark is aded. Hence, "Julia" is added on a binary string as a prefix. | |
# By doing that, Julia can read them as a character string rather than a big integer value. | |
# bs2ba() transform binary string to binary array. |
OlderNewer