Skip to content

Instantly share code, notes, and snippets.

View hayatoito's full-sized avatar

Hayato Ito hayatoito

View GitHub Profile
@hayatoito
hayatoito / tsp.rs
Created June 28, 2018 11:59
TSP in Rust
extern crate csv;
#[macro_use]
extern crate log;
extern crate loggerv;
extern crate ordered_float;
extern crate rand;
extern crate rayon;
extern crate serde;
#[macro_use]
extern crate serde_derive;
@hayatoito
hayatoito / tsp.rs
Created July 14, 2017 09:50
TSP.rs
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_derive;
extern crate clap;
extern crate csv;
extern crate loggerv;
extern crate ordered_float;
extern crate rand;
extern crate rayon;
@hayatoito
hayatoito / calc.rs
Last active June 19, 2017 03:24
Calc
mod calc {
use combine::*;
use combine::char::{digit, spaces};
use std;
enum Expr {
Add(Box<Expr>, Box<Expr>),
Sub(Box<Expr>, Box<Expr>),
Mul(Box<Expr>, Box<Expr>),
@hayatoito
hayatoito / my-step-tsp-4m.rs
Created July 8, 2016 04:56
For challenge 7 (multi threaded)
#[macro_use]
extern crate log;
extern crate crossbeam;
extern crate csv;
extern crate env_logger;
extern crate num_cpus;
extern crate ordered_float;
extern crate rustc_serialize;
use std::collections::HashSet;
@hayatoito
hayatoito / my-step-tsp-speed.rs
Created July 8, 2016 04:53
For speed challenge (single thread)
#[macro_use]
extern crate log;
extern crate csv;
extern crate env_logger;
extern crate ordered_float;
extern crate rustc_serialize;
use std::collections::HashSet;
use ordered_float::OrderedFloat;
@hayatoito
hayatoito / speechserver.py
Last active December 21, 2015 04:09
Speech Server.
#!/usr/bin/env python3
import html
from http.server import (HTTPServer, SimpleHTTPRequestHandler)
import subprocess
import urllib.parse
def speech_server(port=8080):
class SpeechHandler(SimpleHTTPRequestHandler):
@hayatoito
hayatoito / wakame.py
Created October 2, 2012 13:10
わかめ化
#!/usr/bin/env python
# encoding: utf-8
import binascii
import sys
table = {'0': 'WA', '1': 'KA', '2': 'ME', '3': u'♡',
'4': 'wa', '5': 'ka', '6': 'me', '7': u'☆',
'8': 'Wa', '9': 'Ka', 'a': 'Me', 'b': u'♪',
'c': 'wA', 'd': 'kA', 'e': 'mE', 'f': u'♫'}
@hayatoito
hayatoito / icfp2012.Main.scala
Created July 16, 2012 15:46
hayato @ ICFP Programming Contest 2012
package icfp2012
import scala.io.Source
import scala.collection.mutable
import my.util.logging.Logger
import sun.misc.Signal
import sun.misc.SignalHandler
object Main extends App {
@hayatoito
hayatoito / gist:f2df8e10cb8cc551f80c
Created April 22, 2015 19:48
"<shadow> as function" as "slots"
<!-- For base combo-box class -->
<template>
<style>… styles go here …</style>
<div id="topPortion">
<content select=".slot-inputElement">
<input type="text">
</content>
<button id="dropdownButton">
<content select=".slot-icon">
<img src="downArrow.png">