Skip to content

Instantly share code, notes, and snippets.

@ytRino
ytRino / FormalLanguageTheory3.md
Created November 12, 2012 17:29
形式言語理論 3 認識問題 命題3.1

形式言語理論 3 認識問題

定義とか

  • Σ: アルファベット(有限集合)
  • Ω = Σ ∪ { [, ]}
  • Ω^* : Ω上の語全体からなる集合
  • L_p : Ω上の言語 (括弧言語)
    • 基底 : Σの元と空語λ
    • 帰納ステップ : u,vL_pの元ならば uv[u]L_pの元
public static long copyFileStream(FileInputStream is, FileOutputStream os)
throws IOException {
FileChannel srcChannel = null;
FileChannel destChannel = null;
try {
srcChannel = is.getChannel();
destChannel = os.getChannel();
return srcChannel.transferTo(0, srcChannel.size(), destChannel);
} finally {
@ytRino
ytRino / log
Created February 26, 2013 09:44
pulic static void logd(String format, Object... args) {
Log.d(TAG, String.format(Locale.getDefault(), format, args));
}
@ytRino
ytRino / RetrofitSingleSubscriber.java
Last active March 28, 2016 08:16
RetrofitSingleSubscriber
public abstract class RetrofitSingleSubscriber<T> extends SingleSubscriber<T> {
public abstract void onHttpError(HttpException e);
public abstract void onNonHttpError(Throwable e);
@Override public void onError(Throwable error) {
if (error instanceof HttpException) {
onHttpError((HttpException) error);
} else {
public void concatEager() {
final TestSubscriber<List<String>> testSubscriber = new TestSubscriber<>();
final long startTime = new Date().getTime();
System.out.println("Start.");
Observable.concatEager( //
asyncObservable("uno", 4), //
asyncObservable("dos", 3), //