This file contains hidden or 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
var reporequest = new XMLHttpRequest(); | |
var repodef = http_promise("GET", "json", "https://api.github.com/repos/" + OWNER + "/" + REPO, reporequest, function(response) | |
{ | |
def.repodef = response; | |
console.log(def.repodef); | |
}); | |
def.repolst = new Array(); | |
var reporequest = new XMLHttpRequest(); |
This file contains hidden or 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 data_a_interpolate(data, alpha, width, height, red, green, blue) | |
{ | |
var m = 0; | |
for(var n = 0; n < width * height * 4; n += 4, m++) | |
{ | |
data[n + 0] = Math.linear_interpolate(alpha, red, data[n + 0]); | |
data[n + 1] = Math.linear_interpolate(alpha, green, data[n + 1]); | |
data[n + 2] = Math.linear_interpolate(alpha, blue, data[n + 2]); | |
data[n + 3] = 0xff; | |
} |
This file contains hidden or 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
<script type="text/javascript" src="ext/underscore/underscore-min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script type="text/javascript" src="ext/gh3/gh3.js"></script> | |
function load_github() | |
{ | |
var gh = new Gh3.User("reportbase"); | |
var ghr = new Gh3.Repository("scripts", gh); | |
ghr.fetch(function (err, res) | |
{ |
This file contains hidden or 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 bouncing_ball2(cnv) | |
{ | |
var ball = new createjs.Shape(); | |
ball.graphics.setStrokeStyle(5, 'round', 'round'); | |
ball.graphics.beginStroke(('#000000')); | |
ball.graphics.beginFill("#FF0000").drawCircle(0, 0, 50); | |
ball.graphics.endStroke(); | |
ball.graphics.endFill(); | |
ball.graphics.setStrokeStyle(1, 'round', 'round'); | |
ball.graphics.beginStroke(('#000000')); |
This file contains hidden or 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
template <typename node_t> inline | |
void reverse(node_t** head) | |
{ | |
node_t* prev = 0; | |
while(*head) | |
{ | |
node_t* next = (*head)->next; | |
(*head)->next = prev; | |
prev = *head; | |
*head = next; |
This file contains hidden or 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 a subfunction of HSLtoRGB | |
inline void HSLtoRGB_Subfunction(unsigned int& c, const float& temp1, const float& temp2, const float& temp3) | |
{ | |
if((temp3 * 6) < 1) | |
c = (unsigned int)((temp2 + (temp1 - temp2) * 6 * temp3) * 100); | |
else if((temp3 * 2) < 1) | |
c = (unsigned int)(temp1 * 100); | |
else if((temp3 * 3) < 2) | |
c = (unsigned int)((temp2 + (temp1 - temp2) * (.66666 - temp3) * 6) * 100); |
This file contains hidden or 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
inline void binary_split(int* arr, int size, int split) | |
{ | |
if(size <= split) | |
return; | |
arr[size - 1] = true; | |
int n = (int)ceil(size / 2.0); | |
binary_split(arr, n, split); | |
binary_split(arr + n, size - n, split); | |
} |
This file contains hidden or 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
market marketlst [] = | |
{ | |
{"AMEX", "American Stock Exchange", "www.nyse.com", "www.nyse.com"}, | |
{"AMS", "Euronext Amsterdam", "www.aex.nl", "www.aex.nl"}, | |
{"ASX", "Australian Stock Exchange", "www.asx.com.au", "www.asx.com.au"}, | |
{"BRU", "Euronext Brussels", "www.euronext.com", "www.euronext.com"}, | |
{"BSE", "Bombay Stock Exchange", "www.bseindia.com", "www.bseindia.com"}, | |
{"CBOT", "Chicago Board of Trade", "www.cmegroup.com", "www.cmegroup.com"}, | |
{"CFE", "Chicago Futures Exchange", "cfe.cboe.com", "cfe.cboe.com"}, | |
{"CME", "Chicago Merchantile Exchange", "www.cmegroup.com", "www.cmegroup.com"}, |
This file contains hidden or 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
inline void extentsplit(float* e, int size, int width) | |
{ | |
int empty_slots = 0; | |
int awidth = 0; | |
for(int n = 0; n < size; ++n) | |
{ | |
if(e[n] < 1) | |
e[n] = width * std::abs(e[n]); | |
awidth += e[n]; | |
empty_slots += e[n] == 0 ? 1 : 0; |
This file contains hidden or 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
inline int is_bit_set(unsigned int val, int n) | |
{ | |
static unsigned int mask[] = | |
{ | |
1, //0x1 << 0 | |
2, //0x1 << 1 | |
4, //0x1 << 2 | |
8, //0x1 << 3 | |
16, //0x1 << 4 | |
32, //0x1 << 5 |