ハッカー入門 公開鍵で学ぶ、ものごとの裏側を考える技術 (Qiita Conference 2022登壇資料).pdfYuichiro Smith
QiitaConference 2022 の登壇資料です。
ハッカー入門:公開鍵で学ぶ、ものごとの裏側を考える技術
プログラムを書く人にとって誰もが憧れる「ハッカー」という響き。かの有名な How to become a hacker? のページにも、「ハッカー」とは自ら名乗るものではなく、他の人によって認められるものだ、というような記述がありますが、その本質を突き詰めていくと、「ハッカー」とは、普段使いでは意識しない、ものごとの裏側に気を配れる能力を持つ人のことだ、という持論を自分は持っています。このセッションでは、普段何気なく使っている(もしかしたら使っている認識すらないかもしれない)公開鍵の中身を徹底解剖することで「ハッカー」とは何かの一端をみんなで体験できる時間を創り上げたいと思います!
Event : Visual Studio Users Community Japan #1
Date : 2019/09/14
ソフトウェア/サービス開発において最も後回しにされるものの代表が「パフォーマンスの向上」です。C#/.NET の最大の武器は開発生産性ですが、C# 7.0 以降はパフォーマンス向上のための機能追加が多数行われています。いくつかのポイントを押さえることで実装時からより高速なコードを書くことができるようになります。
このドキュメントでは、そんなポイントとなる箇所をふんだんにお届けします。
ハッカー入門 公開鍵で学ぶ、ものごとの裏側を考える技術 (Qiita Conference 2022登壇資料).pdfYuichiro Smith
QiitaConference 2022 の登壇資料です。
ハッカー入門:公開鍵で学ぶ、ものごとの裏側を考える技術
プログラムを書く人にとって誰もが憧れる「ハッカー」という響き。かの有名な How to become a hacker? のページにも、「ハッカー」とは自ら名乗るものではなく、他の人によって認められるものだ、というような記述がありますが、その本質を突き詰めていくと、「ハッカー」とは、普段使いでは意識しない、ものごとの裏側に気を配れる能力を持つ人のことだ、という持論を自分は持っています。このセッションでは、普段何気なく使っている(もしかしたら使っている認識すらないかもしれない)公開鍵の中身を徹底解剖することで「ハッカー」とは何かの一端をみんなで体験できる時間を創り上げたいと思います!
Event : Visual Studio Users Community Japan #1
Date : 2019/09/14
ソフトウェア/サービス開発において最も後回しにされるものの代表が「パフォーマンスの向上」です。C#/.NET の最大の武器は開発生産性ですが、C# 7.0 以降はパフォーマンス向上のための機能追加が多数行われています。いくつかのポイントを押さえることで実装時からより高速なコードを書くことができるようになります。
このドキュメントでは、そんなポイントとなる箇所をふんだんにお届けします。
Metasepi team meeting #19: ATS application on ArduinoKiwamu Okabe
* [0] ATS application demo
* [1] What is Metasepi?
* [2] How to create Metasepi?
* [3] What is ATS language?
* [4] Let's read the demo code
* [5] Japan ATS User Group
Metasepi team meeting #16: Safety on ATS language + MCUKiwamu Okabe
* [1] What is Metasepi?
* [2] How to create Metasepi?
* [3] Demo using ATS language
* [4] What is ATS language?
* [5] Why ATS language is safe?
* [6] ATS programming on MCU
This Presentation for start_printf#6 at 2014/03/29.
It describes some kernel walk throw guide of system call request from userland with source code of NetBSD6.0.1.
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matchingharmonylab
公開URL:https://arxiv.org/pdf/2404.19174
出典:Guilherme Potje, Felipe Cadar, Andre Araujo, Renato Martins, Erickson R. ascimento: XFeat: Accelerated Features for Lightweight Image Matching, Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2023)
概要:リソース効率に優れた特徴点マッチングのための軽量なアーキテクチャ「XFeat(Accelerated Features)」を提案します。手法は、局所的な特徴点の検出、抽出、マッチングのための畳み込みニューラルネットワークの基本的な設計を再検討します。特に、リソースが限られたデバイス向けに迅速かつ堅牢なアルゴリズムが必要とされるため、解像度を可能な限り高く保ちながら、ネットワークのチャネル数を制限します。さらに、スパース下でのマッチングを選択できる設計となっており、ナビゲーションやARなどのアプリケーションに適しています。XFeatは、高速かつ同等以上の精度を実現し、一般的なラップトップのCPU上でリアルタイムで動作します。
セル生産方式におけるロボットの活用には様々な問題があるが,その一つとして 3 体以上の物体の組み立てが挙げられる.一般に,複数物体を同時に組み立てる際は,対象の部品をそれぞれロボットアームまたは治具でそれぞれ独立に保持することで組み立てを遂行すると考えられる.ただし,この方法ではロボットアームや治具を部品数と同じ数だけ必要とし,部品数が多いほどコスト面や設置スペースの関係で無駄が多くなる.この課題に対して音𣷓らは組み立て対象物に働く接触力等の解析により,治具等で固定されていない対象物が組み立て作業中に運動しにくい状態となる条件を求めた.すなわち,環境中の非把持対象物のロバスト性を考慮して,組み立て作業条件を検討している.本研究ではこの方策に基づいて,複数物体の組み立て作業を単腕マニピュレータで実行することを目的とする.このとき,対象物のロバスト性を考慮することで,仮組状態の複数物体を同時に扱う手法を提案する.作業対象としてパイプジョイントの組み立てを挙げ,簡易な道具を用いることで単腕マニピュレータで複数物体を同時に把持できることを示す.さらに,作業成功率の向上のために RGB-D カメラを用いた物体の位置検出に基づくロボット制御及び動作計画を実装する.
This paper discusses assembly operations using a single manipulator and a parallel gripper to simultaneously
grasp multiple objects and hold the group of temporarily assembled objects. Multiple robots and jigs generally operate
assembly tasks by constraining the target objects mechanically or geometrically to prevent them from moving. It is
necessary to analyze the physical interaction between the objects for such constraints to achieve the tasks with a single
gripper. In this paper, we focus on assembling pipe joints as an example and discuss constraining the motion of the
objects. Our demonstration shows that a simple tool can facilitate holding multiple objects with a single gripper.
12. 真偽値真偽値真偽値真偽値真偽値
trueとfalseが真偽値です。trueとfalseが真偽値です。trueとfalseが真偽値です。trueとfalseが真偽値です。trueとfalseが真偽値です。
$ vi bool_op.dats
#include "share/atspre_staload.hats"
val () = println! (true && false)
val () = println! (not (false || not false && not false))
val () = println! (2 < 3)
val () = println! (2 < 3 && 2.0 >= 3.0)
val () = println! (2 < 3 || 2.0 = 3.0)
val () = println! (not (3 < 2))
implement main0 () = ()
$ patscc bool_op.dats
$ ./a.out
false
false
true
false
true
true
$ vi bool_op.dats
#include "share/atspre_staload.hats"
val () = println! (true && false)
val () = println! (not (false || not false && not false))
val () = println! (2 < 3)
val () = println! (2 < 3 && 2.0 >= 3.0)
val () = println! (2 < 3 || 2.0 = 3.0)
val () = println! (not (3 < 2))
implement main0 () = ()
$ patscc bool_op.dats
$ ./a.out
false
false
true
false
true
true
$ vi bool_op.dats
#include "share/atspre_staload.hats"
val () = println! (true && false)
val () = println! (not (false || not false && not false))
val () = println! (2 < 3)
val () = println! (2 < 3 && 2.0 >= 3.0)
val () = println! (2 < 3 || 2.0 = 3.0)
val () = println! (not (3 < 2))
implement main0 () = ()
$ patscc bool_op.dats
$ ./a.out
false
false
true
false
true
true
$ vi bool_op.dats
#include "share/atspre_staload.hats"
val () = println! (true && false)
val () = println! (not (false || not false && not false))
val () = println! (2 < 3)
val () = println! (2 < 3 && 2.0 >= 3.0)
val () = println! (2 < 3 || 2.0 = 3.0)
val () = println! (not (3 < 2))
implement main0 () = ()
$ patscc bool_op.dats
$ ./a.out
false
false
true
false
true
true
$ vi bool_op.dats
#include "share/atspre_staload.hats"
val () = println! (true && false)
val () = println! (not (false || not false && not false))
val () = println! (2 < 3)
val () = println! (2 < 3 && 2.0 >= 3.0)
val () = println! (2 < 3 || 2.0 = 3.0)
val () = println! (not (3 < 2))
implement main0 () = ()
$ patscc bool_op.dats
$ ./a.out
false
false
true
false
true
true
13. 定数定義定数定義定数定義定数定義定数定義
valキーワードを使って定数を定義できます。valキーワードを使って定数を定義できます。valキーワードを使って定数を定義できます。valキーワードを使って定数を定義できます。valキーワードを使って定数を定義できます。
$ vi val_overwrite.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = 1
val b = a
val () = println! a
val () = println! b
val a = 2
val () = println! a
val () = println! b
}
$ patscc val_overwrite.dats
$ ./a.out
1
1
2
1
$ vi val_overwrite.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = 1
val b = a
val () = println! a
val () = println! b
val a = 2
val () = println! a
val () = println! b
}
$ patscc val_overwrite.dats
$ ./a.out
1
1
2
1
$ vi val_overwrite.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = 1
val b = a
val () = println! a
val () = println! b
val a = 2
val () = println! a
val () = println! b
}
$ patscc val_overwrite.dats
$ ./a.out
1
1
2
1
$ vi val_overwrite.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = 1
val b = a
val () = println! a
val () = println! b
val a = 2
val () = println! a
val () = println! b
}
$ patscc val_overwrite.dats
$ ./a.out
1
1
2
1
$ vi val_overwrite.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = 1
val b = a
val () = println! a
val () = println! b
val a = 2
val () = println! a
val () = println! b
}
$ patscc val_overwrite.dats
$ ./a.out
1
1
2
1
14. 関数定義関数定義関数定義関数定義関数定義
funキーワードを使って関数を定義できます。funキーワードを使って関数を定義できます。funキーワードを使って関数を定義できます。funキーワードを使って関数を定義できます。funキーワードを使って関数を定義できます。
$ vi two_arguments.dats
#include "share/atspre_staload.hats"
fun g (x:int, y:int): int = x * x + y * y - 4
implement main0 () = println! (g (3, 2))
$ patscc two_arguments.dats
$ ./a.out
9
$ vi two_arguments.dats
#include "share/atspre_staload.hats"
fun g (x:int, y:int): int = x * x + y * y - 4
implement main0 () = println! (g (3, 2))
$ patscc two_arguments.dats
$ ./a.out
9
$ vi two_arguments.dats
#include "share/atspre_staload.hats"
fun g (x:int, y:int): int = x * x + y * y - 4
implement main0 () = println! (g (3, 2))
$ patscc two_arguments.dats
$ ./a.out
9
$ vi two_arguments.dats
#include "share/atspre_staload.hats"
fun g (x:int, y:int): int = x * x + y * y - 4
implement main0 () = println! (g (3, 2))
$ patscc two_arguments.dats
$ ./a.out
9
$ vi two_arguments.dats
#include "share/atspre_staload.hats"
fun g (x:int, y:int): int = x * x + y * y - 4
implement main0 () = println! (g (3, 2))
$ patscc two_arguments.dats
$ ./a.out
9
15. 型検査型検査型検査型検査型検査
$ vi f_takes_double.dats
#include "share/atspre_staload.hats"
fun f (x:int): int = 3 * x
implement main0 () = {
val r = f 4.0
val () = println! r
}
$ patscc f_takes_double.dats
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): the dynamic expression cannot be
assigned the type [S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))].
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): mismatch of static terms (tyleq):
The actual term is: S2Eapp(S2Ecst(g0float_t0ype); S2Ecst
(double_kind))
The needed term is: S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))
$ vi f_takes_double.dats
#include "share/atspre_staload.hats"
fun f (x:int): int = 3 * x
implement main0 () = {
val r = f 4.0
val () = println! r
}
$ patscc f_takes_double.dats
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): the dynamic expression cannot be
assigned the type [S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))].
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): mismatch of static terms (tyleq):
The actual term is: S2Eapp(S2Ecst(g0float_t0ype); S2Ecst
(double_kind))
The needed term is: S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))
$ vi f_takes_double.dats
#include "share/atspre_staload.hats"
fun f (x:int): int = 3 * x
implement main0 () = {
val r = f 4.0
val () = println! r
}
$ patscc f_takes_double.dats
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): the dynamic expression cannot be
assigned the type [S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))].
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): mismatch of static terms (tyleq):
The actual term is: S2Eapp(S2Ecst(g0float_t0ype); S2Ecst
(double_kind))
The needed term is: S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))
$ vi f_takes_double.dats
#include "share/atspre_staload.hats"
fun f (x:int): int = 3 * x
implement main0 () = {
val r = f 4.0
val () = println! r
}
$ patscc f_takes_double.dats
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): the dynamic expression cannot be
assigned the type [S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))].
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): mismatch of static terms (tyleq):
The actual term is: S2Eapp(S2Ecst(g0float_t0ype); S2Ecst
(double_kind))
The needed term is: S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))
$ vi f_takes_double.dats
#include "share/atspre_staload.hats"
fun f (x:int): int = 3 * x
implement main0 () = {
val r = f 4.0
val () = println! r
}
$ patscc f_takes_double.dats
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): the dynamic expression cannot be
assigned the type [S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))].
/home/kiwamu/tmp/tmp/f_takes_double.dats: 103(line=6, offs=14) --
106(line=6, offs=17): error(3): mismatch of static terms (tyleq):
The actual term is: S2Eapp(S2Ecst(g0float_t0ype); S2Ecst
(double_kind))
The needed term is: S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))
関数 "f" はint型の値を取るべきでした。関数 "f" はint型の値を取るべきでした。関数 "f" はint型の値を取るべきでした。関数 "f" はint型の値を取るべきでした。関数 "f" はint型の値を取るべきでした。
16. 条件分岐条件分岐条件分岐条件分岐条件分岐
if then elseキーワードが使えます。if then elseキーワードが使えます。if then elseキーワードが使えます。if then elseキーワードが使えます。if then elseキーワードが使えます。
$ vi if_then_else.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = if 1 < 2 then 3 else 4
val () = println! (a:int)
}
$ patscc if_then_else.dats
$ ./a.out
3
$ vi if_then_else.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = if 1 < 2 then 3 else 4
val () = println! (a:int)
}
$ patscc if_then_else.dats
$ ./a.out
3
$ vi if_then_else.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = if 1 < 2 then 3 else 4
val () = println! (a:int)
}
$ patscc if_then_else.dats
$ ./a.out
3
$ vi if_then_else.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = if 1 < 2 then 3 else 4
val () = println! (a:int)
}
$ patscc if_then_else.dats
$ ./a.out
3
$ vi if_then_else.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val a = if 1 < 2 then 3 else 4
val () = println! (a:int)
}
$ patscc if_then_else.dats
$ ./a.out
3
17. else節は省略できますelse節は省略できますelse節は省略できますelse節は省略できますelse節は省略できます
else節の型がvoidであれば省略できます。else節の型がvoidであれば省略できます。else節の型がvoidであれば省略できます。else節の型がvoidであれば省略できます。else節の型がvoidであれば省略できます。
$ vi println_expr.dats
#include "share/atspre_staload.hats"
implement main0 () = if 7 > 5 then println! "It's true."
$ patscc println_expr.dats
$ ./a.out
It's true.
$ vi println_expr.dats
#include "share/atspre_staload.hats"
implement main0 () = if 7 > 5 then println! "It's true."
$ patscc println_expr.dats
$ ./a.out
It's true.
$ vi println_expr.dats
#include "share/atspre_staload.hats"
implement main0 () = if 7 > 5 then println! "It's true."
$ patscc println_expr.dats
$ ./a.out
It's true.
$ vi println_expr.dats
#include "share/atspre_staload.hats"
implement main0 () = if 7 > 5 then println! "It's true."
$ patscc println_expr.dats
$ ./a.out
It's true.
$ vi println_expr.dats
#include "share/atspre_staload.hats"
implement main0 () = if 7 > 5 then println! "It's true."
$ patscc println_expr.dats
$ ./a.out
It's true.
20. 可変の文字列を使ってみよう可変の文字列を使ってみよう可変の文字列を使ってみよう可変の文字列を使ってみよう可変の文字列を使ってみよう
2つの不変の文字列を連結してみましょう。2つの不変の文字列を連結してみましょう。2つの不変の文字列を連結してみましょう。2つの不変の文字列を連結してみましょう。2つの不変の文字列を連結してみましょう。
$ vi try_string_append.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val s3 = string_append ("Yokohama", "Station")
val () = println! s3
}
$ patscc try_string_append.dats
/home/kiwamu/tmp/try_string_append.dats: 60(line=3, offs=22) -- 135
(line=6, offs=2): error(3): the linear dynamic variable [s3$3509
(-1)] needs to be consumed but it is preserved with the type
[S2Eapp(S2Ecst(strptr_addr_vtype); S2EVar(4175))] instead.
patsopt(TRANS3): there are [1] errors in total.
exit(ATS): uncaught exception:
_2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalE
rrorExn(1025)
$ vi try_string_append.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val s3 = string_append ("Yokohama", "Station")
val () = println! s3
}
$ patscc try_string_append.dats
/home/kiwamu/tmp/try_string_append.dats: 60(line=3, offs=22) -- 135
(line=6, offs=2): error(3): the linear dynamic variable [s3$3509
(-1)] needs to be consumed but it is preserved with the type
[S2Eapp(S2Ecst(strptr_addr_vtype); S2EVar(4175))] instead.
patsopt(TRANS3): there are [1] errors in total.
exit(ATS): uncaught exception:
_2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalE
rrorExn(1025)
$ vi try_string_append.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val s3 = string_append ("Yokohama", "Station")
val () = println! s3
}
$ patscc try_string_append.dats
/home/kiwamu/tmp/try_string_append.dats: 60(line=3, offs=22) -- 135
(line=6, offs=2): error(3): the linear dynamic variable [s3$3509
(-1)] needs to be consumed but it is preserved with the type
[S2Eapp(S2Ecst(strptr_addr_vtype); S2EVar(4175))] instead.
patsopt(TRANS3): there are [1] errors in total.
exit(ATS): uncaught exception:
_2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalE
rrorExn(1025)
$ vi try_string_append.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val s3 = string_append ("Yokohama", "Station")
val () = println! s3
}
$ patscc try_string_append.dats
/home/kiwamu/tmp/try_string_append.dats: 60(line=3, offs=22) -- 135
(line=6, offs=2): error(3): the linear dynamic variable [s3$3509
(-1)] needs to be consumed but it is preserved with the type
[S2Eapp(S2Ecst(strptr_addr_vtype); S2EVar(4175))] instead.
patsopt(TRANS3): there are [1] errors in total.
exit(ATS): uncaught exception:
_2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalE
rrorExn(1025)
$ vi try_string_append.dats
#include "share/atspre_staload.hats"
implement main0 () = {
val s3 = string_append ("Yokohama", "Station")
val () = println! s3
}
$ patscc try_string_append.dats
/home/kiwamu/tmp/try_string_append.dats: 60(line=3, offs=22) -- 135
(line=6, offs=2): error(3): the linear dynamic variable [s3$3509
(-1)] needs to be consumed but it is preserved with the type
[S2Eapp(S2Ecst(strptr_addr_vtype); S2EVar(4175))] instead.
patsopt(TRANS3): there are [1] errors in total.
exit(ATS): uncaught exception:
_2home_2kiwamu_2src_2ATS_2dPostiats_2src_2pats_error_2esats__FatalE
rrorExn(1025)
なぜエラーになったのでしょうか?なぜエラーになったのでしょうか?なぜエラーになったのでしょうか?なぜエラーになったのでしょうか?なぜエラーになったのでしょうか?