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
#!/usr/bin/ruby | |
require 'net/http' | |
def router_online | |
puts "router_online" | |
uri = URI('http://192.168.0.1/hgi-bin/Setup/main_index.cgi') | |
req = Net::HTTP::Post.new(uri) | |
req.basic_auth('admin', 'qtnetbbiq') | |
req.set_form_data({ | |
'o' => 'online', |
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
;; プリム法による迷路作成。 | |
(defparameter *w* 10) ; 頂点グリッドの幅。 | |
(defparameter *h* 10) ; 頂点グリッドの高さ。 | |
(defparameter *adj* (make-array (* *w* *h*) :initial-element '())) ; 隣接配列。 | |
(defparameter *cost* (make-array (* *w* *h*) :initial-element nil)) | |
;; 印刷に使う文字。 | |
(defconstant +floor-char+ #\・) | |
(defconstant +wall-char+ #\鬱) |
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
;; クラスカル法による迷路作成。 | |
(defparameter *w* 10) ; 頂点グリッドの幅。 | |
(defparameter *h* 10) ; 頂点グリッドの高さ。 | |
(defparameter *edges* '()) ; 辺のリスト。 | |
;; 印刷に使う文字。 | |
(defconstant +floor-char+ #\・) | |
(defconstant +wall-char+ #\鬱) | |
;; 印刷する内容。 |
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
;; 逆削除法による迷路作成。 | |
(defparameter *w* 10) ; 頂点グリッドの幅。 | |
(defparameter *h* 10) ; 頂点グリッドの高さ。 | |
(defparameter *adj* (make-array (* *w* *h*) :initial-element '())) ; 隣接配列。 | |
(defparameter *edges* '()) ; 辺のリスト。 | |
;; 印刷に使う文字。 | |
(defconstant +floor-char+ #\・) | |
(defconstant +wall-char+ #\田) |
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
<!doctype html> | |
<html lang=ja> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>ペントミノパズルソルバー</title> | |
<style> | |
table { border-spacing: 0; border-collapse: separate } | |
table.board-table { margin-bottom: 32px; } | |
table.board-table td { width: 32px; height: 32px; border: 3px solid #ccc; text-align: center; font-family: monospace } |
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
#!/usr/bin/ruby | |
require 'colorize' | |
COLOR_SCHEME = { | |
'F' => [:light_yellow, :light_black], | |
'I' => [:blue, :light_white], | |
'L' => [:yellow, :light_white], | |
'N' => [:light_yellow, :light_black], | |
'P' => [:cyan, :light_white], |
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> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <netdb.h> |
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
require 'spreadsheet' | |
year, filename = ARGV | |
if year | |
year = year.to_i | |
else | |
year = Time.now.year | |
end | |
unless filename | |
filename = "out.xls" |
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 <stdlib.h> | |
#include "drcssixel.c" | |
static void pua_to_utf8(unsigned char *dst, unsigned int *src, unsigned int len) { | |
unsigned int i; | |
for(i = 0; i < len; i++) { | |
unsigned int code = src[i]; | |
*(dst++) = ((code >> 18) & 0x07) | 0xf0; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#define LAYER_H 0 | |
#define LAYER_K 1 | |
/* 6*10 */ | |
const char* htbl[6][10] = { | |
{ "あ","い","う","え","お","は","ひ","ふ","へ","ほ" }, |
NewerOlder