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
package main | |
import ( | |
"fmt" | |
"reflect" | |
"unsafe" | |
) | |
// rtype representing reflect.rtype for noescape trick | |
type rtype struct{} |
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
```go | |
package main | |
import ( | |
"testing" | |
) | |
type Value struct { | |
uintValue uint | |
uint64Value uint64 |
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
use strict; | |
use warnings; | |
use Compiler::Lexer; | |
use Compiler::Parser; | |
use Data::Dumper; | |
my $script = do { local $/; <DATA> }; | |
my $tokens = Compiler::Lexer->new('-')->tokenize($script); | |
my $ast = Compiler::Parser->new->parse($tokens); | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
void render(int n) | |
{ | |
int i, j; | |
volatile int k = 0; | |
for (i = 0; i < n; i++) { | |
for (j = 0; j < n; j++) { | |
k++; | |
} |
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 render(n) | |
{ | |
var k = 0; | |
for (var i = 0; i < n; i++) { | |
for (var j = 0; j < n; j++) { | |
k++; | |
} | |
} | |
} | |
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 parseRow(columns, parser) { | |
var row = {}; | |
for (var i = 0; i < columns.length; i++) { | |
row[columns[i].name] = parser.readColumnValue(); | |
} | |
} |
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 code = 'return {\n'; | |
columns.forEach(function(column) { | |
code += '"' + column.name + '":' + 'parser.readColumnValue(),\n'; | |
}); | |
code += '};\n'; | |
var parseRow = new Function('columns', 'parser', code); |