Skip to content

Instantly share code, notes, and snippets.

View WSLでH8300のクロスコンパイル環境構築
sudo apt update
sudo apt upgrade
sudo apt install build-essential
sudo apt install libgmp-dev
sudo apt install libmpc-dev
sudo apt install libmpfr-dev
wget http://core.ring.gr.jp/pub/GNU/binutils/binutils-2.33.1.tar.gz
tar xvzf binutils-2.33.1.tar.gz
cd ./binutils-2.33.1
View MXErgo_HID_Descriptor.h
char ReportDescriptor[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
0xa1, 0x01, // COLLECTION (Application)
0x85, 0x02, // REPORT_ID (2)
0x09, 0x01, // USAGE (Pointer)
0xa1, 0x00, // COLLECTION (Physical)
0x95, 0x10, // REPORT_COUNT (16)
0x75, 0x01, // REPORT_SIZE (1)
View RealforceDescriptorCapture.txt
Frame 17: 93 bytes on wire (744 bits), 93 bytes captured (744 bits) on interface 0
USB URB
[Source: 3.15.0]
[Destination: host]
USBPcap pseudoheader length: 28
IRP ID: 0xffffd48c68507520
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_CONTROL_TRANSFER (0x0008)
IRP information: 0x01, Direction: PDO -> FDO
URB bus id: 3
@ogatatsu
ogatatsu / cloudSettings
Last active Aug 8, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-08-08T10:10:20.923Z","extensionVersion":"v3.4.3"}
View gist:7748108
def test(): Unit = {
for(i <- 1 to 10) {
println(i);
if(i == 5) return;
}
println("test"); //実行されたら気持ち悪い
}
@ogatatsu
ogatatsu / readme.md
Created Jun 27, 2012 — forked from j5ik2o/gist:2996293
リトライハンドラー 魔改造
View readme.md
object RetryUtil {
import scala.util.control.Exception.allCatch
case class RetryResult[T](e: Either[List[Throwable], T]) {
def `catch`(f: List[Throwable] => T): T = e match {
case Right(r) => r
case Left(l) => f(l)
}
}
@ogatatsu
ogatatsu / gist:1518754
Created Dec 25, 2011 — forked from j5ik2o/gist:1518723
こんな構文で階層型のログ出力をしたい
View gist:1518754
def connect = {
log("connect") { // connect start
// ... 何かの処理 ...
log("login") { // connect : login start
// ... 何かの処理 ...
} // connect : login end
// ... 何かの処理 ...
} // connect end
}
@ogatatsu
ogatatsu / joinRight
Created Dec 13, 2011
joinRightサンプル
View joinRight
scala> val a: Either[Exception, Either[Exception, Int]] = Right(Right(10))
a: Either[Exception,Either[Exception,Int]] = Right(Right(10))
scala> a.joinRight
res0: Either[Exception,Int] = Right(10)
scala> val b: Either[Exception, Either[Exception, Int]] = Right(Left(new Exception("a")))
b: Either[Exception,Either[Exception,Int]] = Right(Left(java.lang.Exception: a))
scala> b.joinRight
View ProxyT.scala
abstract class ProxyT[T <: ProxyT[T]](implicit cm: ClassManifest[T]) {
val underlying: Any
override def hashCode: Int = underlying.hashCode
override def equals(other: Any): Boolean = other match {
case that: T if(cm.erasure.isInstance(that)) => underlying.equals(that.underlying)
case _ => false
}
}
View RichEither.scala
class RichEither[A](e: Either[Throwable, A]) {
def success: A = e match {
case Right(r) => r
case Left(l) => throw l
}
}
implicit def eitherWrapper[A](e: Either[Throwable, A]) = new RichEither(e)
You can’t perform that action at this time.