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 <iostream> | |
#include <sstream> | |
#include <string> | |
#include <tuple> | |
template <size_t First, size_t Last> | |
struct ReadAux { | |
template <typename Tuple> | |
static auto& Exec(std::istream& os, Tuple&& args) { | |
os >> std::get<First>(args); |
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
#!/usr/bin/env python | |
def main(): | |
years_remain = int(raw_input('Years remain: ')) | |
rental_price = int(raw_input('Rental price (month): ')) | |
construction_value = (rental_price * 12) / (1.0 / years_remain) | |
print 'Construction value: {:,}'.format(construction_value) | |
land_quota = float(raw_input('Land quota (m^2): ')) | |
land_announced_value = int(raw_input('Land anno. valuation (/m^2): ')) | |
land_value = (land_announced_value / 0.9) * land_quota |
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
<html> | |
<style> | |
body { | |
display: flex; | |
flex-flow: row wrap; | |
} | |
.container { | |
width: 30%; | |
height: 400px; |
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 <iostream> | |
#include <list> | |
#include <unordered_map> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
template<typename T> | |
struct lru { |
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
struct profiler { | |
profiler() : m_start{chrono::high_resolution_clock::now()} { | |
} | |
size_t til_now() const { | |
return chrono::duration_cast<chrono::milliseconds>( | |
chrono::high_resolution_clock::now() - m_start).count(); | |
} | |
chrono::high_resolution_clock::time_point m_start; |
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 <vector> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
struct obs { | |
obs() : m_mv(0), m_cp(0) { m_regs.insert(this); } | |
obs(obs const &cp) { m_regs.insert(this); m_cp++; m_total_cp++;} | |
obs(obs &&mv) { m_regs.insert(this); m_mv++; m_total_mv++;} |
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 <iostream> | |
#include <string> | |
using namespace std; | |
uint32_t to_unicode(size_t *bytes, char const *utf8) | |
{ | |
if (!utf8 || !*utf8) { | |
*bytes = 0; | |
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 json | |
import requests | |
import functools | |
""" | |
Example: | |
cli = jsonrpc('http://rpcserver.com:6666') | |
try: | |
resp = cli.echo(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
function sortable(table_dom, column_types, default_ordering) { | |
var rows = $(table_dom).find('tbody tr') | |
var dataset = []; | |
for (var i = 0; i < rows.length; ++i) { | |
var vals = $(rows[i]).find('td').toArray().map(function(v){ | |
// console.log(arguments); | |
return v.innerText; | |
}); | |
dataset.push(vals); |
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 "impl.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
struct obj_impl | |
{ | |
int a; | |
}; |
NewerOlder