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/ruby1.9.1 -Kw | |
# -*- coding: utf-8 -*- | |
class Edge | |
attr_accessor :src, :dst, :length | |
def initialize(src, dst, length = 1) | |
@src = src | |
@dst = dst | |
@length = length |
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 ruby | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2013 Yuichi Araki | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice | |
device = MonkeyRunner.waitForConnection() | |
while 1: | |
device.touch(540, 1560, MonkeyDevice.DOWN_AND_UP) | |
MonkeyRunner.sleep(1.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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func fact(n float64) float64 { | |
r := float64(1) | |
for 1 < n { |
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
(defun fact (n) | |
(let ((r 1)) | |
(loop | |
for i from 2 to n | |
do (setf r (* i r)) | |
finally (return r)))) | |
(defun calc-pi-1 (max) | |
(/ 1 | |
(* (/ (* 2 (sqrt 2.0d0)) (expt 99 2)) |
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 main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
const doors = 3 | |
const trials = 10000 | |
const seed = 15 |
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 yaraki.dialogdemo.app; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.DialogInterface; | |
import android.support.v4.app.DialogFragment; | |
import android.support.v4.app.Fragment; | |
import android.support.v7.app.ActionBarActivity; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; |
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
35.6611302 | 139.7286663 | ハートランド | |
---|---|---|---|
35.6615196 | 139.7295036 | メトロハット | |
35.6623 | 139.729618 | サイゼ | |
35.6608595 | 139.728279 | マクドナルド | |
36.951095 | 140.853685 | いわきCC | |
36.951344 | 140.854934 | 泉神社 | |
36.9526041 | 140.8543881 | 郵便局 | |
36.950052 | 140.852266 | 幼稚園 | |
38.259210 | 140.893322 | NAViS | |
38.431639 | 141.309444 | 石巻道場 |
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> | |
namespace ya { | |
void each_token(std::istream& input, void (*proc)(const std::string& token)) | |
{ | |
std::stringstream buffer; | |
auto send = [&buffer, &proc]() { | |
if (0 < buffer.tellp()) { |
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 <stdio.h> | |
#include <string.h> | |
#include <dirent.h> | |
void list(const char *path) | |
{ | |
DIR *dir; | |
struct dirent *entry; | |
char entry_path[PATH_MAX]; | |
char *entry_name = entry_path; |
OlderNewer