This file contains 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
private static final char[] digits = new char[] { '零', '一', '二', '三', '四', '五', '六', '七', '八', '九' }; | |
private static final Character[] little = new Character[] { null, '十', '百', '千' }; | |
private static final Character[] big = new Character[] { null, '萬', '億', '兆', '京' }; | |
private static void out(Character c) { | |
if (c == null) | |
return; | |
System.out.println(c); | |
} | |
private static void chineseNumbers(long n) { |
This file contains 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 class Foo { | |
private int i = 3; | |
{ | |
System.out.println("{}1: i: " + i); | |
i = 4; | |
} | |
public Foo() { | |
System.out.println("Foo(): " + i); | |
i = 5; | |
} |
This file contains 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
<html> | |
<head> | |
<title>braille ruby</title> | |
</head> | |
<body> | |
<script> | |
function toBraille(c) { | |
// http://en.wikipedia.org/wiki/Braille_ASCII | |
var s = " A1B'K2L@CIF/MSP\"E3H9O6R^DJG>NTQ,*5<-U8V.%[$+X!&;:4\\0Z7(_?W]#Y)="; | |
var i = s.indexOf(c.toUpperCase()); |
This file contains 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 java.io.OutputStream; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import android.media.AudioFormat; | |
import android.media.AudioRecord; | |
import android.media.MediaRecorder; | |
import android.os.Handler; | |
import android.util.Log; | |
public class MyAudioRecord { |
This file contains 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
final FileOutputStream fos = new FileOutputStream(tempFile); | |
ar = new MyAudioRecord(fos, MAX_MILLIS, new Handler(), new Runnable() { | |
@Override | |
public void run() { | |
try { | |
fos.close(); | |
// 看是因為確定還是取消而結束的 | |
if (shouldSave) { | |
AndroidUtility.playString(R.string.save_recording); | |
This file contains 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
var http = require("http"); | |
function f() { | |
var s = Math.random(); | |
for (i = 0; i < 100000; i++) | |
s += i; | |
return s; | |
} | |
function g() { | |
var s = Math.random(); |
This file contains 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
sub r { int(rand(49)) } | |
$n1 = r(); | |
do { $n2 = r(); } until ($n2 != $n1); | |
do { $n3 = r(); } until ($n3 != $n1 && $n3 != $n2); | |
do { $n4 = r(); } until ($n4 != $n1 && $n4 != $n2 && $n4 != $n3); | |
do { $n5 = r(); } until ($n5 != $n1 && $n5 != $n2 && $n5 != $n3 && $n5 != $n4); | |
do { $n6 = r(); } until ($n6 != $n1 && $n6 != $n2 && $n6 != $n3 && $n6 != $n4 && $n6 != $n5); | |
do { $n7 = r(); } until ($n7 != $n1 && $n7 != $n2 && $n7 != $n3 && $n7 != $n4 && $n7 != $n5 && $n7 != $n6); | |
print "$n1 $n2 $n3 $n4 $n5 $n6 $n7\n"; |
This file contains 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
sub r { int(rand(49)) } | |
$n1 = r(); | |
do { $n2 = r(); } until ($n2 != $n1); | |
do { $n3 = r(); } until ($n3 != $n1 && $n3 != $n2); | |
do { $n4 = r(); } until ($n4 != $n1 && $n4 != $n2 && $n4 != $n3); | |
do { $n5 = r(); } until ($n5 != $n1 && $n5 != $n2 && $n5 != $n3 && $n5 != $n4); | |
do { $n6 = r(); } until ($n6 != $n1 && $n6 != $n2 && $n6 != $n3 && $n6 != $n4 && $n6 != $n5); | |
do { $n7 = r(); } until ($n7 != $n1 && $n7 != $n2 && $n7 != $n3 && $n7 != $n4 && $n7 != $n5 && $n7 != $n6); | |
print "$n1 $n2 $n3 $n4 $n5 $n6 $n7\n"; |
This file contains 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 random | |
def check(n): | |
for x in range(7): | |
for y in range(x + 1, 7): | |
if (int(n / 49 ** x % 49) == int(n / 49 ** y % 49)): | |
return False | |
return True | |
while True: |
This file contains 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
$_ = 'h' x 49 . '4' x 7; | |
while (/4/) { | |
$h = int(rand(49)); | |
print $h + s/4//, "\n" if (s/(?<=^.{$h})h/./); | |
} |
OlderNewer