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
vbell off | |
autodetach on | |
startup_message off | |
defscrollback 1000 | |
term xterm-256color | |
escape ^La | |
defbce on | |
hardstatus alwayslastline "[%02c] %`%-w%{=b bw}%n %t%{-}%+w" |
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
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
export PATH="/usr/local/bin:$PATH" | |
#export PS1='\033k\033\\[\u@\h \W]\$ ' |
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
autoload colors | |
colors | |
setopt auto_pushd | |
setopt noautoremoveslash | |
bindkey -e | |
autoload -U compinit | |
compinit | |
PROMPT='%39<...<%/%% ' | |
PROMPT2="%_%% " | |
SPROMPT="%r is correct? [n,y,a,e]: " |
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
public function toRGB(h:Number, s:Number, v:Number):uint { | |
var hi:Number = Math.floor(h / 60) % 6; | |
var f:Number = h / 60 - hi; | |
var p:Number = v * ( 1.0 - s); | |
var q:Number = v * ( 1.0 - f * s); | |
var t:Number = v * ( 1.0 - (1.0 - f) * s); | |
var r:Number; | |
var g:Number; | |
var b:Number; | |
switch(hi) { |
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
function complete(data) { | |
var result = true; | |
var sum; | |
for ( var i = 0; i < 9; i++ ) { | |
sum = 0; | |
for ( var j = 0; j < 9; j++ ) { | |
sum += data[i * 9 + j]; | |
} | |
if ( sum != 45 ) { |
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
int numofbits5(long bits) { | |
bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555); | |
bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333); | |
bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f); | |
bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff); | |
return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff); | |
} |
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" /> | |
<title>Sudoku Solver</title> | |
<style type="text/css"> | |
#content-table { | |
border: solid 1px #ccc; | |
border-collapse: collapse; | |
empty-cells: show; |
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="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Reversi Assistant</title> | |
<style type="text/css"> | |
#content-table { | |
border: solid 1px #ccc; | |
border-collapse: collapse; | |
empty-cells: show; |
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
//http://mathworld.wolfram.com/TotientFunction.html | |
//use (13) and (14) | |
int totient(int n) { | |
int ret = 1; | |
for ( int i = 2; n != 1; i++ ) { | |
if ( n % i == 0 ) { | |
int pow = 1; | |
while ( n % i == 0 ) { | |
n = n / i; | |
pow *= i; |
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
//a^b mod m | |
long long modpow(long long a, long long b, long long m) { | |
long long ret = 1; | |
long long mul = a; | |
for ( ; b > 0; b = b >> 1) { | |
if ( b&1 ) { | |
ret = (ret * mul) % m; | |
} | |
mul = (mul * mul) % m; | |
} |
OlderNewer