Skip to content

Instantly share code, notes, and snippets.

View taichi's full-sized avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexpSample {
/** 英数字の1文字以上5文字以下 */
private static final String REGEX = "[0-9a-z]{1,5}";
/**
* 正規表現を満たすかどうかの判定メソッド
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class EscapeHtmlTest {
/**
* 引数で与えられた文字列にHTMLエスケープを行った結果文字列を返す
*
* @param str
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class SesFixaGuardFirstServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
import static org.junit.Assert.assertNotSame;
import java.security.MessageDigest;
import org.junit.Test;
public class P327Test {
/** ハッシュアルゴリズム */
private static final String ALG = "SHA-256";
@taichi
taichi / ch7_1.js
Last active December 16, 2015 02:39 — forked from torazuka/ch7_1.js
var exports = {};
// parse URI
exports.parse_url = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/;
exports.names = ['url', 'scheme', 'slash', 'host', 'port', 'path', 'query', 'hash'];
exports.blanks = '@';
// parse number
exports.parse_number = /^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Urabe, Shyouhei
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
オリジナルは力武さんの投稿 http://erlang-users.jp/ml/erlang/index.cgi?0::166
アキュムレータ accumulator
アノテーション annotation
アリティ arity
ー致条件 match specification
入れ子リスト deep list
インターフェイス interface
エクスポート export

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

package de.am.gc.benchmarks;
import java.util.ArrayList;
import java.util.List;
/**
* GC benchmark producing a mix of lifetime=0 and lifetime>0 objects which are kept in randomly updated lists.
*
* @author jsound
*/
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# -lt 1 ]; then
echo 'Usage: apt-rdepends-tree [-r] <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi