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
// success callback when requesting audio input stream | |
function gotStream(stream) { | |
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
var audioContext = new AudioContext(); | |
var analyser = audioContext.createAnalyser();//x | |
// Create an AudioNode from the stream. | |
var mediaStreamSource = audioContext.createMediaStreamSource( stream ); | |
// Connect it to the destination to hear yourself (or any other node for processing!) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello World</title> | |
<script type="text/javascript" src="./socket.io/socket.io.js" ></script> | |
<script> | |
var socket = io('http://localhost'); | |
socket.on('connect',function(){ | |
console.log("Hello World"); |
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 is Official API Note, use mongojs! | |
*/ | |
var mongojs = require('mongojs'); | |
var db = mongojs('test',['table']); //test 是db的名稱,不需要create. table是集合的名稱 | |
/** | |
* Search All(Find()) | |
* @class |
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
<?php set_time_limit(0); ?> | |
<!DOCTYPE html> | |
<html lang="zh-tw"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>BigPipe Demo</title> | |
</head> | |
<body id="main"> | |
<div> | |
Hello world |
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
SELECT G.Home, G.Away, | |
C1.CountryName, C2.CountryName | |
FROM Game G | |
JOIN Country C1 ON C1.CountryID = G.Home | |
JOIN Country C2 ON C2.CountryID = G.Away; | |
--http://stackoverflow.com/questions/4267929/whats-the-best-way-to-join-on-the-same-table-twice |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Title</title> | |
<link href="stylesheets/main.css" rel="stylesheet" /> | |
</head> | |
<body> | |
<header> | |
<hgroup> |
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
function sum(number) { | |
return (1 + number) * number / 2; | |
} | |
sum(1000); |
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
Complete installation process: | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev | |
sudo apt-get update | |
sudo apt-get upgrade | |
cd ~ | |
mkdir git | |
cd ~/git |
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 static String bytesToHex(byte[] bytes) { | |
char[] hexChars = new char[bytes.length * 2]; | |
for ( int j = 0; j < bytes.length; j++ ) { | |
int v = bytes[j] & 0xFF; | |
hexChars[j * 2] = hexArray[v >>> 4]; | |
hexChars[j * 2 + 1] = hexArray[v & 0x0F]; | |
} | |
return new String(hexChars); | |
} |
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
function guessNumber(m,n) | |
%call guessNumber(m,n) to play the game | |
%example: | |
%guessNumber(1,10) to play the game in range 1 to 10 | |
% | |
r = randperm(n); | |
ans = r(m); | |
range_x = m; | |
range_y = n; |
OlderNewer