Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="zh-Hant-TW">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- D3, jquery -->
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" charset="utf-8"></script>
void rotation2(GLfloat angle, GLdouble x, GLdouble y, GLdouble z) {
GLfloat radius = angle * PI / 180;
double mahnitude = sqrt(x * x + y * y + z * z);
if (mahnitude == 0) throw "Error";
float u = x / mahnitude, v = y / mahnitude, w = z / mahnitude;
rotMatrix[0] = cos(radius) + (u * u) * (1 - cos(radius)); rotMatrix[4] = u * v * (1 - cos(radius)) - w * sin(radius); rotMatrix[8] = u * w * (1 - cos(radius)) + v * sin(radius); rotMatrix[12] = 0;
rotMatrix[1] = u * v * (1 - cos(radius)) + w * sin(radius); rotMatrix[5] = cos(radius) + v * v * (1 - cos(radius)); rotMatrix[9] = v * w * (1 - cos(radius)) - u * sin(radius); rotMatrix[13] = 0;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<style>
input[type='file'] {
import * as THREE from './../threejs/build/three.module.js';
import { VolumeRenderShader1 } from './VolumeShader.js';
import { OrbitControls } from './../threejs/examples/jsm/controls/OrbitControls.js';
class threejsViewer {
constructor(domElement) {
let width = domElement.clientWidth;
let height = domElement.clientHeight;
// Renderer
@changken
changken / README.txt
Created May 31, 2021 08:38
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@changken
changken / README.txt
Created May 25, 2021 03:13
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@changken
changken / README.txt
Created May 24, 2021 09:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@changken
changken / ListActivity.java
Created June 7, 2019 11:41
listView範例
package org.changken.tutorialsample;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@changken
changken / WalletController.php
Last active March 20, 2018 13:53
AJAX範例2
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use App\User;
use App\Wallet;
use App\WalletCode;
use App\WalletLog;
@extends('tpl.main')
@section('title', '儲值')
@section('head')
<script>
$(function () {
$('#submit').click( function () {
if($('#key').val() == "")
{