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
REF=8680bb9 | |
# The following work as well | |
# REF=master | |
# REF=V8.x-staging | |
# REF=V8.9.1 | |
wget https://github.com/nodejs/node/archive/$REF.tar.gz | |
mkdir -p $REF | |
tar zxvf $REF.tar.gz -C $REF --strip-components=1 | |
cd $REF |
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> | |
<style> | |
.axis .domain { | |
display: none; | |
} | |
</style> | |
<svg width="1200" height="500"></svg> | |
<script src="https://d3js.org/d3.v4.min.js"></script> |
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
.issue_text { | |
font-family: "CamingoCode", "Fira Mono", menlo, monaco, consolas, monospace; | |
margin-left: 10px; | |
} | |
a:link, | |
a:focus { | |
color: #1281c9; | |
} | |
a:visited { | |
color: #673ab7; |
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 reverse(seq) { | |
if (seq.length > 1) | |
return seq.slice(-1).concat(reverse(seq.slice(0, -1))); | |
else | |
return seq; | |
} |
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
// compile me with `gcc -std=c99` or `gcc -std=gnu99` | |
#include <stdio.h> | |
int sum(int n_col; int arr[][n_col], int n_row, int n_col) { | |
int i, j, total = 0; | |
for (i = 0; i < n_row; ++i) { | |
for (j = 0; j < n_col; ++j) { | |
total += arr[i][j]; | |
} |
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 reverseChild(pare) { | |
if (!pare.children || pare.children.length < 2) return; | |
var emptyParent = document.createElement(pare.nodeName); | |
var detachedParent = pare.parentNode.replaceChild(emptyParent, pare); | |
var emptyLeft = document.createElement(detachedParent.children[0].nodeName); | |
var emptyRight = document.createElement(detachedParent.children[0].nodeName); | |
for (var i = 0, len = detachedParent.children.length; i < Math.floor(len/2); i++) { | |
var left = detachedParent.replaceChild(emptyLeft, detachedParent.children[i]); |
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
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
char msg[100]; | |
char *in = "%99[^\n]%*c"; | |
scanf(in, msg); | |
printf("%s\n", msg); | |
return 0; | |
} |
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
import math | |
data = list() | |
f = open("data") | |
for line in f: | |
data.append(float(line)) | |
T = len(data) - 1 |
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
#include <stdio.h> | |
#include <string.h> | |
int main(void) { | |
char line[30000]; | |
char str[30000]; | |
FILE * pFile = fopen ("myfile.txt" , "r"); | |
/* Avoid buffer overflow by using fgets() */ |
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(window, undefined) { | |
/** | |
* some utitlity to help handling compatibility issues | |
*/ | |
var util = { | |
/** | |
* Cross-browser event handler support. | |
* @param {Object} elem the event target | |
* @param {Object} type event object | |
* @param {Function} fn event handler |