{{ message }}

Instantly share code, notes, and snippets.

# Yoshio HANAWAhnw

Last active Aug 29, 2015
View 数独ソルバ
 import Data.List import Data.List.Split -- 数独を解く solveSudoku matrix | matrix /= solved = solveSudoku solved | solved /= backtracked = solveSudoku backtracked | otherwise = matrix where solved = solveSudokuDirectly matrix
Created Jun 5, 2014
View android-4.4-syscall.txt
Last active Aug 29, 2015
Pell's equation solver
View pell.hs
 import Data.List -- ペル方程式 x^2 - d * y^2 = ±1について、 -- 指定されたdに対して最小の解(x,y)を返す -- 参考：http://www004.upp.so-net.ne.jp/s_honma/pell/pell.htm minSolutionForPellEquation d | even n = ((x_m0^2+d*y_m0^2) `div` h_m, (2*x_m0*y_m0) `div` h_m) | otherwise = ((x_m0*x_m1+d*y_m0*y_m1) `div` h_m, (x_m0*y_m1+x_m1*y_m0) `div` h_m)
Created Sep 18, 2014
View prob17.hs
 last50digits = 55723761467908866712060720593684978725896677308273 findCandidates xs = filter ((lastDigits==).(`mod` m).(^101).read) candidates where candidates = [c:x | c<-['0'..'9'], x<-xs] len = length \$ head candidates m = 10^len lastDigits = last50digits `mod` m main = print . take 50 \$ iterate findCandidates [""]
Created Nov 2, 2014
View php-5.6.2-new-mm-patch.txt
 diff -c -r php-5.6.2-orig/Zend/zend.h php-5.6.2/Zend/zend.h *** php-5.6.2-orig/Zend/zend.h 2014-10-15 21:59:32.000000000 +0900 --- php-5.6.2/Zend/zend.h 2014-11-02 13:26:51.000000000 +0900 *************** *** 291,298 **** --- 291,300 ---- #define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, return_value_ptr, this_ptr, return_value_used TSRMLS_CC #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__) + # define ZEND_NORETURN __attribute__((noreturn))
Created Nov 20, 2014
View equal-test.php

Created Dec 8, 2014
Created Jan 2, 2015
View phalanger_install_3.0.sh
 #!/bin/bash -e #Check mono version s=`mono --version`; a=( \$s ); mono_version=`echo \${a[4]}`; mono_version_major=`echo \$mono_version | awk -F"." '{print \$1}'` mono_version_minor=`echo \$mono_version | awk -F"." '{print \$2}'` mono_version_build=`echo \$mono_version | awk -F"." '{print \$3}'`
Created Jan 10, 2015