2็จฎ้ก่ใใใใ
- IOๅค้ๅ(epoll/kqueue/etc..)
read(2)/write(2)ใ้ๅๆ
| module randomforest; | |
| import std.random : uniform; | |
| import std.math : log, sqrt; | |
| import std.typecons; | |
| import std.algorithm : swap; | |
| import std.conv : to; | |
| import std.stdio; |
| import std.socket; | |
| import core.thread; | |
| import core.time; | |
| import core.sync.mutex; | |
| class Resolver { | |
| private Mutex m; | |
| Address[][string] cache; |
| import std.stdio; | |
| import std.concurrency; | |
| void fib() { | |
| auto msg = receiveOnly!(Tid, long)(); | |
| auto n = msg[1]; | |
| switch (n) { | |
| case 0L: { |
| import std.stdio, std.file; | |
| uint MAX_PROG_LEN = 30000; | |
| void main(string[] args) { | |
| auto program = cast(string) read(args[1], MAX_PROG_LEN); | |
| // prepare VM |
| $ cat ~/.bash_history | sed "s|sudo ||g" | cut -d " " -f 1 | sort | uniq -c | sort -n | tail -n 10 | |
| 37 top | |
| 39 dmd | |
| 39 ruby | |
| 46 make | |
| 51 rake | |
| 59 rackup | |
| 225 ls | |
| 268 gem | |
| 311 cd |
| #ifndef SIMPLE_QUEUE_H | |
| #define SIMPLE_QUEUE_H | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <inttypes.h> | |
| typedef struct { | |
| void *val; |
| #!/usr/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'socket' | |
| class DNSQuery | |
| attr_reader :domain_io | |
| def initialize data | |
| @data = data | |
| @domain_io = '' |
| import std.stdio; | |
| class BinaryIndexedTree { | |
| int size; | |
| int[] bits; | |
| this(int l){ | |
| size = l; | |
| bits.length = l+1; | |
| } |