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 <map> | |
#include <functional> | |
#include <iostream> | |
template<typename R, typename... Args> | |
auto memorize(std::function<R(Args...)> &&f) { | |
using Func = std::function<R(Args...)>; | |
struct memory { |
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
package rainm.play | |
import scala.language.implicitConversions | |
object StrongQueryPlay { | |
trait Table { | |
def name: String | |
} |
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
bubble sort in asm |
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
// from http://codeproject.com/Articles/1209347/Designing-A-Generic-and-Modular-Cplusplus-Memoizer | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <tuple> | |
#include <map> | |
#include <mutex> | |
#include <unordered_map> |
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
def find_max_sum_of_sub_sequence(seq, start, end): | |
if end - start == 0: | |
return seq[start], start, end | |
else: | |
mid = (start + end) / 2 | |
left_max, left_start, left_end = find_max_sum_of_sub_sequence(seq, start, mid) | |
right_max, right_start, right_end = find_max_sum_of_sub_sequence(seq, mid + 1, end) | |
i = mid | |
mark_i = 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
#ifndef any_h | |
#define any_h | |
namespace utility { | |
class any { | |
struct impl_base { | |
virtual impl_base* clone() const = 0; | |
virtual ~impl_base() = default; | |
}; |
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
# -*- coding: utf-8 -*- | |
import os | |
import sqlite3 | |
from flask import Flask | |
from flask import redirect | |
from flask import request | |
from flask import session | |
from jinja2 import Template |
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 com.google.gson.Gson; | |
import java.lang.reflect.Proxy; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
/** | |
* Created by hackeris on 16/9/16. | |
*/ |