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
Undefined symbols for architecture x86_64: | |
"boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)", referenced from: | |
boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<ch |
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> | |
i = 1; | |
main() | |
{ | |
(i % 3 || printf("fizz")) && | |
(i % 5 || printf("buzz")) && | |
(!(i % 3 && i % 5) || printf("%d", i)) && | |
printf("\n") && | |
(++i > 100 || main()); | |
} |
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 <iostream> | |
#include <iomanip> | |
#include <type_traits> | |
constexpr int N = 10; | |
constexpr int max_k = 100; | |
double dp[N][max_k+1]; | |
#ifdef DEBUG | |
template<class T> |
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
WITH RECURSIVE _fib(a, b) AS ( | |
SELECT 1,0 | |
UNION ALL | |
SELECT b, a+b FROM _fib | |
), fib AS ( | |
SELECT b FROM _fib | |
) | |
SELECT * FROM fib LIMIT 100; |
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
csize = `stty size`.scan(/\d+/).map(&:to_i) | |
puts "\033[2J" | |
x = 0 | |
Train = "\xf0\x9f\x9a\x83 " | |
TLength = 10 | |
speed = 1 | |
loop{ | |
print "\033[2J" | |
print "\033[#{csize[0]};#{x}H#{Train*TLength}\033[0;0H" | |
x += speed |
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 <iostream> | |
#include <regex> | |
#include <string> | |
int main(int argc, char const* argv[]) | |
{ | |
using namespace std; | |
regex r("hoge:(abc)"); | |
smatch res; | |
string input = "hoge:abc"; |
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
import java.util.Optional; | |
import java.util.function.Consumer; | |
public class Application1 { | |
public static void main (String[] args) { | |
let(new ArrayWrapper<String>(args), a ->{ | |
System.out.println(fullName(a.get(0), a.get(1)).orElse("Failure")); | |
}); | |
} |
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
import java.util.function.*; | |
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
public class WrapFunc{ | |
public static void main (String[] args) { | |
Arrays.stream(args).map(Integer::parseInt).map(Throwables.ignore(WrapFunc::fib)) | |
.forEach(Throwables.ignore(WrapFunc::myPrint)); | |
} | |
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
import java.util.concurrent.*; | |
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
public class StreamEtude{ | |
public static void main (String[] args) { | |
ExecutorService exe = Executors.newFixedThreadPool(4); | |
Arrays.stream(args) | |
.map(Integer::parseInt) | |
.map( arg -> exe.submit(() -> fib(arg)) ).collect(Collectors.toList()).stream() |
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
class MyMeta(type): | |
def __new__(meta_cls, name, bases, dic): | |
print '__new__(meta_cls=%s, name=%s, bases=%s, dic=%s)' % (meta_cls, name, bases, dic) | |
return type.__new__(meta_cls, name, bases, dic) | |
def __init__(cls, name, bases, dic): | |
from inspect import isfunction | |
print '__init__(cls=%s, name=%s, bases=%s, dic=%s)' % (cls, name, bases, dic) | |
type.__init__(cls, name, bases, dic) | |
for k, v in cls.__dict__.iteritems(): |