- probe device: Olimex ARM-USB-OCD-H
- target device: Raspberry Pi 2
- host machine: Ubuntu 15.04
openocd-0.9.0
as debugger host:- probe device driver:
libftd2xx1.1.12
- probe device driver:
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
// scala>:load <thisfile> | |
// stop by <Ctrl-C> | |
import com.twitter.finagle.stream._ | |
import com.twitter.finagle.Service | |
import com.twitter.concurrent._ | |
import com.twitter.finagle.builder.{ClientBuilder, ServerBuilder} | |
import org.jboss.netty.handler.codec.http.{HttpMethod, HttpVersion, DefaultHttpRequest, HttpRequest} | |
import org.jboss.netty.buffer.{ChannelBuffers, ChannelBuffer} |
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
type ¬[A] = A => Nothing | |
type ∨[T, U] = ¬[¬[T] with ¬[U]] | |
type ¬¬[A] = ¬[¬[A]] | |
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) } | |
class FoldUnion[T](t: T) { | |
def boxClass(x: java.lang.Class[_]): java.lang.Class[_] = x.toString match { | |
case "byte" => manifest[java.lang.Byte].erasure | |
case "char" => manifest[java.lang.Character].erasure | |
case "short" => manifest[java.lang.Short].erasure |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from mechanize import Browser | |
from urllib import quote | |
import re | |
def fetch_sf_csv(report_id): | |
login_uri = "https://login.salesforce.com/" | |
username = "example@salesforce.com" | |
password = "<your-password>" |
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
// Brainf*ck decorder | |
// usage: | |
// $ scala <thisfile> | |
object BrainfuckDecorder extends util.parsing.combinator.RegexParsers { | |
val memory = collection.mutable.Map.empty[Int, Int].withDefaultValue(0) | |
var pointer = 0 | |
def read = memory(pointer) | |
def write(x: Int) = memory(pointer) = x | |
override val whiteSpace = """[^><+-.,\[\]]+""".r |
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 Data.Maybe | |
import Control.Applicative | |
import Control.Monad | |
import Data.Char (isSpace, digitToInt) | |
import Debug.Trace | |
main :: IO () | |
main = print . runParser $ "(1+2-3*4)*2" | |
runParser :: String -> Maybe Int |
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 Control.Applicative | |
import Data.Array (Array,array,assocs,(//),(!)) | |
import Data.Maybe (isJust,listToMaybe) | |
import Data.List (sortBy,transpose,nub,(\\)) | |
import Data.Ord (comparing) | |
import Debug.Trace | |
type Loc = (Int, Int) | |
type Mesh = Array Loc (Maybe Int) |
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
module SuggestFormlet | |
// [References] | |
// - msdn.microsoft.com/ja-jp/magazine/cc967279.aspx | |
// - www.websharper.com/question/74314/None/4/redirecting-from-websharper-formlets | |
open IntelliFactory.WebSharper | |
module Server = | |
type Suggests = (string * string) list |
-
tap
はself
を返す。nil
でなければ値を返す。Object#tap {|x| ... } -> self
nil
ならばnil
を返す。NilClass#tap {|x| ...} -> nil
-
tap
ブロックで行った処理は副作用を伴う- 同じオブジェクトに連続的に破壊的代入を行うメソッドチェーンとして利用可能。
P = Struct.new(:name)
OlderNewer