Skip to content

Instantly share code, notes, and snippets.

Avatar

Naoya naoyashiga

View GitHub Profile
@cburgdorf
cburgdorf / xor_keras.py
Last active Nov 18, 2020
Comparing XOR between tensorflow and keras
View xor_keras.py
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation, Dense
training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32")
target_data = np.array([[0],[1],[1],[0]], "float32")
model = Sequential()
model.add(Dense(32, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
@cobalamin
cobalamin / UIViewKeyframeAnimationOptionsExtension.swift
Created Jun 24, 2015
Using all UIViewAnimationOptions as UIViewKeyframeAnimationOptions
View UIViewKeyframeAnimationOptionsExtension.swift
// This enables using all available UIViewAnimationOptions enum values as UIViewAnimationOptions in a Swifty way,
// by brute-force bridging all values with an explicit extension to UIViewKeyframeAnimationOptions.
//
// Thus, code like
//
// let o1 : UIViewKeyframeAnimationOptions = .CalculationModeLinear
// let o2 : UIViewAnimationOptions = .CurveLinear
// let os : UIViewKeyframeAnimationOptions = [o1, UIViewKeyframeAnimationOptions(o2.rawValue)]
//
// becomes:
@cocopon
cocopon / Easing.pde
Last active May 29, 2022
A class that brings Robert Penner's easing functions into Processing
View Easing.pde
/*
* Easing.pde - brings Robert Penner's easing functions into Processing
* (c) 2015 cocopon.
*
* See the following to learn more about these famous functions:
* http://www.robertpenner.com/easing/
*
* License:
* http://www.robertpenner.com/easing_terms_of_use.html
*/
@haranicle
haranicle / AppStoreScreenShotMaker.sh
Last active Jun 21, 2020
A shell script to create AppStore screen shots.
View AppStoreScreenShotMaker.sh
#!/bin/sh
# settings ==========
# src file name
fileNamePrefix="ScreenShotFileNameFor5.5inch"
offsetFor3_5=20
# dest directory name
@y-yu
y-yu / inherit.md
Created Aug 9, 2012
JavaScriptの継承について
View inherit.md

JavaScriptの継承について

全然理解出来てなかったので調べてみた。

経緯

function f () {
	// Class
}