Skip to content

Instantly share code, notes, and snippets.

@MasWag
MasWag / .gitignore
Last active December 16, 2015 09:09
JavaScriptの練習
*~
@MasWag
MasWag / rand.tcl
Last active December 16, 2015 12:28
tcl/tkによる簡単な乱数生成スクリプト
proc intRand {b e} {
return [ expr int (rand() * ($e - $b +1) + $b) ]
}
proc makeResultWin {} {
global mi
global ma
label .l3 -text 結果
label .l4 -text [ intRand $mi $ma ]
button .b2 -text 終了 -command exit
@MasWag
MasWag / sample_vector.c
Last active December 17, 2015 12:29
test program of vector struct
#include <math.h>
typedef struct {
double x;
double y;
} vector;
vector make_vector(double x,double y);
vector plus_vector(vector a,vector b);
vector minus_vector(vector a,vector b);
@MasWag
MasWag / login_utroam.rb
Last active December 29, 2015 16:49
utroamにloginするscript
#!/usr/bin/ruby
require 'rubygems'
require 'mechanize'
require 'kconv'
require "pit"
username , password = ARGV
if (config = Pit.get("utroam-password")) == {} then
@MasWag
MasWag / Makefile
Created December 17, 2013 08:55
flymakeのみ行う簡単なMakefile simple Makefile only runs flymake
CC = gcc
check-syntax:
$(CC) -fsyntax-only $(CHK_SOURCES)
@MasWag
MasWag / .gitignore
Last active January 2, 2016 05:09
mikoラジのスクリプト
*~
cache
#!/bin/sh
pandoc -t latex $1 | perl -pe 's/section{/section*{/g;s/\n\n/\par\n/g' | cat head - tail | platex
@MasWag
MasWag / 10-21.md
Created October 20, 2014 12:45
CPU実験5班10-21日のスライド

% Rice班(5班)進捗報告 % % 2014/10/20

先週からの仕様変更

  • 浮動小数点即値
  • serial通信
  • など
@MasWag
MasWag / run.sh
Created November 20, 2014 03:48
simple test launcher.
#!/bin/sh
# please change this variable when test target is changed
tests="fadd_isim i2f_isim"
ERROR_MES="User(VHDL) Code Called Simulation Stop"
NUM=$(echo $tests | wc -w)
PASSED="0"
FAILED="0"
@MasWag
MasWag / cmp_test.vhd
Created December 15, 2014 08:28
比較でnumeric_stdを使うと便利
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity cmp_test is
port (
Q0 : out std_logic;
Q1 : out std_logic);
end entity cmp_test;