http://numa08.net
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
#!/bin/sh | |
if [ -z ${GOOGLE_CMD} ];then echo GOOGLE_CMD is not defined; echo 'let do(mac,bash) \"export GOOGLE_CMD=open\"'; exit 1; fi; query=""; for q in $*; do query=`echo ${query}"+"${q}`; done; ${GOOGLE_CMD} http://google.com/search?q=${query}; |
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
fun failedSuruyo() { | |
throw Exception("error") | |
} | |
fun main(args: Array<String>) { | |
val res : String | |
try { | |
res = "succedd" | |
failedSuruyo() |
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 InputFilter mEmojiFilter = (source, start, end, dest, dstart, dend) -> { | |
if (source.length() == 0) { | |
return source; | |
} | |
// 入力された1文字が2バイト以上の物について、絵文字かどうか判断をする。 | |
// UTF-8 の絵文字の文字コードについては、 Wikipedia を参照した | |
// https://en.wikipedia.org/wiki/Emoji#Unicode_blocks | |
final int codePoint = Character.codePointAt(source, 0); | |
if ( | |
(codePoint >= 0x1F300 && codePoint <= 0x1F5FF ) || |
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
implicit class View2Opt(val view : View) extends AnyVal{ | |
def asOpt[T <: View](implicit tag : ClassTag[T]) : Option[T] = { | |
view match { | |
case v : T => Some(v) | |
case _ => None | |
} | |
} | |
} | |
val title = Option(getArguments()).map(_.getInt("title")) |
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 org.scaloid.common._ | |
import scala.concurrent.future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.io.Source | |
import org.json4s._ | |
import org.json4s.native.JsonMethods._ | |
class HatenaFeed extends SActivity{ | |
onCreate{ |
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 scala.collection.mutable.ArrayBuffer | |
object Kawaiidsl extends App { | |
class Wepon(val name : String) { | |
var fromPart : String = _ | |
def from(part: String) : Wepon = { | |
fromPart = part | |
this |
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
wget -O chart.png $(printf "http://chart.apis.google.com/chart?cht=bvs&chs=100x50&chd=t:%s" $(git count ./ | awk -v ORS="" 'NR>1&&/^[a-zA-Z0-9]/{print $2","}') | awk '{sub(/.$/, "", $1); print $1}') |
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 enum FaceNameEye { | |
Mabataki("まばたき"), | |
Warai("笑い"), | |
Wink_L("ウインク"), | |
Wink_l2("ウインク2"), | |
final String name; | |
FaceNameEye(String name) { | |
this.name = name; |
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
# 各商品の合計値と設定価格の差を格納するクラス。 | |
# このオブジェクトのリストを生成し、差分の少ない | |
# 順にソートを行うことで、設定価格に最も近く最も大 | |
# きい値を求める | |
class Total | |
attr_reader :value, :difference | |
def initialize(value, difference) | |
@value = value | |
@difference = difference | |
end |