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
<nu.mine.tmyymmt.android.widget.RetractiveHorizontalScrollView> | |
<LinearLayout> | |
<TextView /> | |
<TextView android:id="@+id/child_content" /> | |
<TextView /> | |
</LinearLayout> | |
</nu.mine.tmyymmt.android.widget.RetractiveHorizontalScrollView> |
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
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) | |
} |
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
object HexBytesUtil { | |
def hex2bytes(hex: String): Array[Byte] = { | |
hex.replaceAll("[^0-9A-Fa-f]", "").sliding(2, 2).toArray.map(Integer.parseInt(_, 16).toByte) | |
} | |
def bytes2hex(bytes: Array[Byte], sep: Option[String] = None): String = { | |
sep match { | |
case None => bytes.map("%02x".format(_)).mkString | |
case _ => bytes.map("%02x".format(_)).mkString(sep.get) |
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
// see https://gist.github.com/2382341 | |
// scalaz for only solution3 | |
import scalaz._ | |
import Scalaz._ | |
object SolutionForMultiNestedMatchforMyStudy { | |
def f(num: Int): Option[Int] = { | |
num match { |
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
if (foo != null) { | |
Bar bar = foo.getBar(); | |
if (bar != null) { | |
Baz baz = bar.getBaz(); | |
if (baz != null) | |
return baz.compute(); | |
else | |
return null; | |
} | |
else |
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
for { | |
foo <- maybeFoo | |
bar <- foo.bar | |
baz <- bar.baz | |
} yield baz.compute |
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
def compute1(maybeFoo: Option[Foo]): Option[Int] = | |
for { | |
foo <- maybeFoo | |
bar <- foo.bar | |
baz <- bar.baz | |
} yield baz.compute | |
// for compute2 | |
import scalaz._ | |
import Scalaz._ |
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
; Grep description of specs2 unit specification in selected buffer on xyzzy | |
; Please copy & paste following code at your .xyzzy | |
; Usage: M-x grep-specs2-unit-selected-buffer | |
(defun grep-specs2-unit-selected-buffer () | |
(interactive) | |
(grep " should \\| in " (selected-buffer))) |
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
; css-mode | |
(defun coding-style-css () | |
(setq css-indent-offset 2)) | |
(add-hook 'css-mode-hook 'coding-style-css) | |
; | |
(setq truncate-lines t) | |
(setq truncate-partial-width-windows t) |
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
bind -r ^ resize-pane -R 5 | |
bind -r C-^ resize-pane -L 5 | |
bind 0 kill-pane | |
bind 2 split-window -v | |
bind 3 split-window -h |
OlderNewer