Skip to content

Instantly share code, notes, and snippets.

View RadianSmile's full-sized avatar

Radian RadianSmile

  • Innova Solutions Taiwan, LTD
  • Taipei, Taiwan
  • 11:55 (UTC +08:00)
View GitHub Profile
@RadianSmile
RadianSmile / Flame.pde
Last active December 23, 2016 14:19
火焰!
// 請下載空白作業 4 檔開始。
PImage[] flames = new PImage[5];
int[] flameFrameCount = new int[5]; // 這個火焰經過幾次系統影格了 -> 被 draw 了幾次 -> 便可透過 frameRate 來轉換成畫了幾秒。
int[] flameX = new int[5] ;
int[] flameY = new int[5] ;
int boomIndex = 0 ; // 現在要用哪一來儲存爆炸狀態 -> 同時也代表,我要去用 array 的第幾格存。
int yourFrameRate ;
@RadianSmile
RadianSmile / README.md
Created November 30, 2016 15:03 — forked from imkevinxu/README.md
Time Spent on Page

Javascript code that calculates how much active time is spent on a tab and takes into account changing tabs, switching windows, or leaving the page.

Demo here http://bl.ocks.org/d/4393523/

  1. 宣告一個裝 int 的 array ,有 5 格

  2. 格子依序填進 1 ~ 5

  3. 把每一個格子都 + 1

  1. 宣告一個 car class 的做法:
class Car {  

  // property
  float speed ; 

  // Construct Method  
  Car (int initSpeed){  
 speed = initSpeed ;
@RadianSmile
RadianSmile / min.md
Last active November 26, 2016 16:04

練習:用暴力的方式,找出最小值

  1. a 跟 b 比,找出最小值 ?
  2. a 跟 b 跟 c 比,找出最小值
  3. a 跟 b 跟 c 跟 d 比,找出最小值?
  4. a 跟 b 跟 c 跟 d 跟 e 比,找出最小值?

解答:

1.虛擬碼實作技巧

1.把需求拆解成狀態跟動作

  • 狀態:按空白鍵
  • 動作:發射子彈

2.把狀態跟動作結構化

  • IF 按空白鍵 THEN 發射子彈

3.轉換成電腦能懂的中文

@RadianSmile
RadianSmile / minim.radian.js
Created July 8, 2016 16:26
pjs minim radian modified
/**
* Minim-emulation code by Daniel Hodgin
*/
// wrap the P5 Minim sound library classes
function Minim() {
this.loadFile = function (str) {
return new AudioPlayer(str);
}
}
@RadianSmile
RadianSmile / index.html
Last active June 2, 2016 06:12
新鮮會議 bootstrap-sass
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
@RadianSmile
RadianSmile / gist:8d791803d488d817ddcf
Created February 13, 2016 01:42 — forked from mhawksey/gist:1276293
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@RadianSmile
RadianSmile / HTML 5 Microphone Visualizer.markdown
Created January 6, 2016 15:59
HTML 5 Microphone Visualizer