Skip to content

Instantly share code, notes, and snippets.

View tmyymmt's full-sized avatar

Tomoya Yamamoto tmyymmt

View GitHub Profile
@tmyymmt
tmyymmt / HexBytesUtil.scala
Created September 14, 2012 09:58
hex2bytes and bytes2hex
object HexBytesUtil {
def hex2bytes(hex: String): Array[Byte] = {
if(hex.contains(" ")){
hex.split(" ").map(Integer.parseInt(_, 16).toByte)
} else if(hex.contains("-")){
hex.split("-").map(Integer.parseInt(_, 16).toByte)
} else {
hex.sliding(2,2).toArray.map(Integer.parseInt(_, 16).toByte)
}
@tmyymmt
tmyymmt / main.xml
Created April 3, 2012 01:36
res/layout/main.xml
<nu.mine.tmyymmt.android.widget.RetractiveHorizontalScrollView>
<LinearLayout>
<TextView />
<TextView android:id="@+id/child_content" />
<TextView />
</LinearLayout>
</nu.mine.tmyymmt.android.widget.RetractiveHorizontalScrollView>