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
{- | |
van der Pol Equation | |
http://mathworld.wolfram.com/vanderPolEquation.html | |
dx/dt = y | |
dy/dt = m(1-x^2)y - x | |
-} | |
type R2 = (Double, Double) --(x, y) |
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
import Data.Complex | |
type R = Double | |
type C = Complex R | |
-- 反復合成の定義 | |
(^:) :: (C -> C) -> Int -> C -> C | |
(^:) f n = (flip (!!) n).(iterate f) | |
-- 計算する矩形領域 |
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
import Data.List | |
import System.IO | |
import System.Random | |
type Cluster = Int | |
type Point = (Double, Double) -- Point in R^2 | |
type CPoint = (Cluster, Point) -- Classified Point | |
---- Euclid Distance between Two Points | |
dist :: Point -> Point -> Double |
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
package main | |
import ( | |
"fmt" | |
"math/cmplx" | |
"image" | |
"image/png" | |
"os" | |
) |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"math/cmplx" | |
"math/rand" | |
) | |
// 試行回数 |
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
import types | |
import math | |
# Supporting Functions | |
def prod(l): | |
temp = 1. | |
for i in xrange(len(l)): | |
temp *= l[i] | |
return temp |
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
#!/bin/bash | |
# How to use | |
# $makeRetinaImages.sh folder_name | |
# The folder name should end by '/'. | |
# | |
for file in `ls $1`; do | |
if expr "$file" : ".*\.png" >/dev/null; then | |
file2x=`echo $file|sed 's/\(.*\)\(\.png\)/\1\@2x\2/'` | |
mv $1$file $1$file2x | |
convert -geometry 50% $1$file2x $1$file |