Skip to content

Instantly share code, notes, and snippets.

View naoyashiga's full-sized avatar

Naoya naoyashiga

View GitHub Profile
@cburgdorf
cburgdorf / xor_keras.py
Last active November 18, 2020 11:23
Comparing XOR between tensorflow and keras
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 June 24, 2015 08:33
Using all UIViewAnimationOptions as UIViewKeyframeAnimationOptions
// 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 January 28, 2023 04:05
A class that brings Robert Penner's easing functions into Processing
/*
* 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 June 21, 2020 19:57
A shell script to create AppStore screen shots.
#!/bin/sh
# settings ==========
# src file name
fileNamePrefix="ScreenShotFileNameFor5.5inch"
offsetFor3_5=20
# dest directory name
@y-yu
y-yu / inherit.md
Created August 9, 2012 06:57
JavaScriptの継承について

JavaScriptの継承について

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

経緯

function f () {
	// Class
}