Skip to content

Instantly share code, notes, and snippets.

View stmtk1's full-sized avatar

Motoki saito stmtk1

View GitHub Profile
@stmtk1
stmtk1 / crawl.rb
Last active October 8, 2015 01:14
require "watir-webdriver"
require "nokogiri"
ff = Watir::Browser.new :ff # variable ff is firefox
ff.goto "https://twitter.com"
# login with your account
ff.button(:type => "submit").click
ff.text_field(:id => "signin-email").set "" # スクリーンネーム
ff.text_field(:id => "signin-password").set "" # パスワード
<!DOCTYPE html>
<html>
<head>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=x-sjis">
<title>学習院ひろば</title>
</head>
<frameset cols="25%,75%">
<frame src="./handle.html" name="handle">
<frameset rows="12%,88%">
<frame src="./menu.html" name="menu">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
</head>
<body id='body'>
<button id="red">red</button>
<button id="green">green</button>
<button id="blue">blue</button>
<script>
@stmtk1
stmtk1 / prime.c
Last active December 14, 2015 08:41
/* This program is whether a number is prime number.
*
* usage
* - The number of argument of main function is 1.
* - The argument is The number you want to check.
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv){
int num=atoi(argv[1]), i, j, index = 2, primes[1000], flag;
@stmtk1
stmtk1 / a.html
Created December 2, 2015 07:56
ajax test
a.html
@stmtk1
stmtk1 / mykihu.txt
Last active January 17, 2016 13:43
開始日時:2016/01/17 22:24:35
棋戦:R対局(15分)
手合割:平手
先手:
後手:heavymajinga(177)
手数----指手---------消費時間--
1 7六歩(77) ( 0:03/00:00:03)
2 3二金(41) ( 0:03/00:00:03)
3 7五歩(76) ( 0:05/00:00:08)
4 5二金(61) ( 0:04/00:00:07)
#include <stdio.h>
int main(){
int m, a, pow;
printf("法を入力");
scanf("%d", &m);
printf("位数を求めたい数を入力");
scanf("%d", &a);
pow = a;
for(int i = 2;i < m;i++){
pow = (a * pow) % m;
def input_str
ret = []
ret.concat(("a".."z").to_a)
ret.concat(("A".."Z").to_a)
ret.concat(("0".."9").to_a)
return ret
end
INPUT = input_str()
def write_pass(input)
hash = {'A' => 'hello', 'st' => 'come on'}
puts hash['A']
puts hash['st']
puts "\n"
for i in [0, 2, 5, 100]
puts i
end
for i in hash # ここではhashという変数は[["A", "hello"], ["st", "come on"]]としてみなされている
puts i[0]
<!DOCTYPE html>
<html>
<body>
<canvas id="draw"></canvas>
<script>
var canvas = document.getElementById("draw");
var ctx = canvas.getContext("2d");
canvas.width = 300;
canvas.height = 300;