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
| def square op,len | |
| s = (len**(0.5)).to_i | |
| t = (s<8)? "+"*s : square("+",s) | |
| m = len - (s**2) | |
| m = (m< 8) ? op * m : square( op,m) | |
| ">"+t+"[<"+op*s+">-]<"+m | |
| end | |
| def encode ch,point |
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
| let fizzbuzz n = match n mod 3, n mod 5 with | |
| | 0,0 -> print_string "fizzbuzz\n" | |
| | 0,_ -> print_string "fizz\n" | |
| | _,0 -> print_string "buzz\n" | |
| | _,_ -> print_int n; | |
| print_string "\n";; | |
| let rec loop x = match x with | |
| | 100 -> fizzbuzz(x) |
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 <iostream> | |
| #include <vector> | |
| #include <string> | |
| using namespace std; | |
| //split() | |
| void split(string str,string delim,vector<string> *v){ | |
| int i=0; | |
| while((i = str.find_first_of(delim)) != string::npos){ |
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/env bash | |
| for i in {0..99};\ | |
| do \ | |
| num=`expr $i % 8 + 1`\ | |
| cat /dev/urandom | tr -c -d "[:digit:]" | head -c $num |sed -e 's/^00*/1/g';\ | |
| echo '';\ | |
| done; |
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/env bash | |
| num=`ps aux|grep emacs\ -nw\ --daemon|wc -l` | |
| if [ $num = 1 ] | |
| then | |
| TERM=xterm-256color emacs -nw --daemon | |
| else | |
| echo 'Emacs is already running.' | |
| fi |
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
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| if ( ! function_exists('h')) | |
| { | |
| function h($str) | |
| { | |
| return htmlspecialchars($str,ENT_QUOTES,"UTF-8"); | |
| } | |
| } |
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
| <?php | |
| function f(){ | |
| $i=0; | |
| return function() use(&$i){ | |
| return $i++; | |
| }; | |
| }; | |
| $c = f(); | |
| foreach(range(0,10) as $a){ | |
| echo $c(),"\n"; |
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
| let rec fibo n = if n < 2 | |
| then 1 | |
| else fibo(n-1)+fibo(n-2);; | |
| print_int(fibo(36));; | |
| print_string("\n");; |
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/env ruby | |
| require 'open-uri' | |
| require 'nokogiri' | |
| dict = Nokogiri::HTML(open("http://ejje.weblio.jp/content/#{ARGV[0].downcase}")).search("div.Kejje") | |
| dict.search("script").remove | |
| dict.search("div.level0").each{|node| puts node.text.delete("\r")} |
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
| 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 | |
| ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 | |
| 192.168.59.150 totsuka | |
| 192.168.59.151 ofuna | |
| 192.168.59.160 fujisawa |
OlderNewer