Skip to content

Instantly share code, notes, and snippets.

@Oipo
Oipo / js
Created April 10, 2016 17:37
'use strict';
const prompt = require('prompt');
prompt.start();
let accepted = false;
while(!accepted) {
prompt.get([{
name: 'host',
@Oipo
Oipo / test.js
Last active June 10, 2016 21:36
const dropAllTables = async () => {
const tables = requireDir('./database/tables');
const sortedTables = _.sortBy(tables, table => -table[0].order);
_.forEach(sortedTables, async table => {
await bookshelf.knex.schema.dropTableIfExists(table[0].name);
console.log(`dropping ${table[0].name}`);
});
};
dropAllTables();
console.log('done dropping');
import { Component } from '@angular/core';
@Component({
selector: 'login-form',
templateUrl: 'app/login-form.html'
})
export class LoginFormComponent {
submitted = false;
error = '';
model = {
src/main.rs:1:1: 1:1 error: type name `Citext` is undefined or not in scope [E0412]
src/main.rs:1 #![feature(custom_derive, custom_attribute, plugin)]
^
<diesel macros>:5:1: 5:71 note: in this expansion of table_body! (defined in <diesel macros>)
src/database/schema.rs:1:1: 1:40 note: in this expansion of table! (defined in <diesel macros>)
src/database/schema.rs:1:1: 1:40 note: in this expansion of infer_schema! (defined in src/main.rs)
src/main.rs:1:1: 1:1 help: run `rustc --explain E0412` to see a detailed explanation
src/main.rs:1:1: 1:1 help: no candidates by the name of `Citext` found in your project; maybe you misspelled the name or forgot to import an external crate?
src/main.rs:1:1: 1:1 error: type name `Citext` is undefined or not in scope [E0412]
src/main.rs:1 #![feature(custom_derive, custom_attribute, plugin)]
vertexData = {
x, y, 0.0f, 0.0f,
x+w, y, 1.0f, 0.0f,
x, y+h, 0.0f, 1.0f,
x+y, y+h, 1.0f, 1.0f
};
LOG(INFO) << "[sprite] " << x << " " << y << " " << w << " " << h << endl;
// example: [sprite] 288 288 32 32
@Oipo
Oipo / GLD.SerializerBenchmark.txt
Last active January 25, 2018 15:39
GLD.SerializerBenchmark output
Tests performed 100 times for each TestData + Serializer pair
################################################################################
Test Data: Person
Serializer: Ops/sec Avg: Ser Deser Ser+Deser Size: Avg
===============================================================================
MessageShark Stream 354.808 373.007 181.495 642
NetSerializer Stream 344.589 352.864 173.695 647
ProtoBuf Stream 316.466 227.366 131.948 687
NetSerializer string 300.554 219.123 126.668 864
@Oipo
Oipo / output.txt
Created April 7, 2017 12:54
Simple benchmark comparing cereal json vs rapidjson included in cereal.
99999
199999
299999
399999
499999
599999
699999
799999
899999
999999
average xs = div (fromInteger (sum xs)) (fromInteger (length xs))
Couldn't match expected type ‘Integer’ with actual type ‘Int’
In the first argument of ‘fromInteger’, namely ‘(length xs)’
In the second argument of ‘div’, namely ‘(fromInteger (length xs))’
Failed, modules loaded: none.
average xs = div (fromInteger (sum xs)) ((length xs))
board schrodingerscat {
ownable card {
type enum alive | dead | empty | heisenberg
}
global gamble {
integer count_normal 0
integer count_empty 0
type enum alive | dead | empty
}
import itertools
from multiprocessing import Queue, Value
import MainConfig
from Tasks.ITask import ITask
from typing import List, Iterator, Tuple
from BenchmarkConfig import Benchmark, Task
from Tasks.RunSingleSimulationTask import RunSingleSimulationTask