Skip to content

Instantly share code, notes, and snippets.

@phucnh
phucnh / pyreactor.py
Last active August 29, 2015 14:07 — forked from ejconlon/pyreactor.py
#!/usr/bin/env python
"""
Translated from the example in
Deprecating the Observer Pattern (Maier, Rompf, Odersky)
http://lamp.epfl.ch/~imaier/pub/DeprecatingObserversTR2010.pdf
Their Scala example:
Reactor.once { self =>
// step 1:
def sayHello(any: Any): Try[String] = {
Try {
any match {
case x: String => "Hello"
case _ => throw new Exception("Huh!")
}
}
} //> sayHello: (any: Any)scala.util.Try[String]
def letMeSayHello = {
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Jeu 13 Juin 2013 à 07:19
-- Version du serveur: 5.5.24-log
-- Version de PHP: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)