In this slide, I described how I love prolog, very very cute language. I'm very wonder why many people loves functional programing languages (lisp, haskell and ocaml), but no one knows about logical programming language, so I tried to introduce the charm points of Prolog.
In this slide, I described how I love prolog, very very cute language. I'm very wonder why many people loves functional programing languages (lisp, haskell and ocaml), but no one knows about logical programming language, so I tried to introduce the charm points of Prolog.
1. Null was used as an exception to point out issues.
2. Null used three sentences to summarize the key details.
3. Null's summary highlighted the object, option, exception handling, and Kotlin programming language.
IoT Devices Compliant with JC-STAR Using Linux as a Container OSTomohiro Saneyoshi
?
Security requirements for IoT devices are becoming more defined, as seen with the EU Cyber Resilience Act and Japan’s JC-STAR.
It's common for IoT devices to run Linux as their operating system. However, adopting general-purpose Linux distributions like Ubuntu or Debian, or Yocto-based Linux, presents certain difficulties. This article outlines those difficulties.
It also, it highlights the security benefits of using a Linux-based container OS and explains how to adopt it with JC-STAR, using the "Armadillo Base OS" as an example.
Feb.25.2025@JAWS-UG IoT
47. リスト内包表记とは?
Javaで書くと、こんなイメージ
for (int x : xs) {
if (x % 2 == 0) {
for (int y : ys) {
if (y % 2 == 1) {
ret.add(x * y);
}
}
}
}
System.out.println(ret);
48. リスト内包表记とは?
Scalaでは、for式をリスト内包表記として
使える
scala> for (x <- 0 to 4 if x % 2 == 0;
y <- 0 to 4 if y % 2 == 1) yield x * y
res3: scala.collection.immutable.IndexedSeq[Int] =
Vector(0, 0, 2, 6, 4, 12)
74. ラムダとは?
Haskell
> let f = n -> n * n
> :type f
f :: Integer -> Integer
> f(10)
100
Scala
scala> val f = (n:Int) => n * n
f: Int => Int = <function1>
scala> f(10)
res0: Int = 100
75. ラムダとは?
Java8
public static interface Func<T, R> {
public R eval(T p);
}
public static void main(String[] args) {
Func<Integer, Integer> f = (Integer n) -> n * n;
System.out.println(f.eval(10));
}
> java Lambda
100
76. ラムダとは?
SAM(Single Abstract Method) type
SAM(Single Abstract Method) type
Java8
public static interface Func<T, R> {
public R eval(T p);
}
public static void main(String[] args) {
Func<Integer, Integer> f = (Integer n) -> n * n;
System.out.println(f.eval(10));
}
インターフェース実装の
インターフェース実装の
> java Lambda シンタックスシュガー
シンタックスシュガー
100
80. 高阶関数とは?
Haskell
myIf :: Bool -> a -> a -> a
myIf cond t f = case cond of
True -> t
False -> f
実行結果
> let a = myIf (1==1) (n -> n+n) (n -> n*n)
> :type a
a :: Integer -> Integer
> a 10
20
81. 高阶関数とは?
Scala
def myIf[T] (cond: Boolean, t: => T, f: => T):T =
cond match {
case true => t
case false => f
}
val a = myIf(1 == 1, (n:Int) => n + n, (n:Int) => n * n)
println(a(10))
実行結果
> scala MyIf
20
82. 高阶関数とは?
Java8
public static <T, R> Func<T, R> myIf(boolean cond,
Func<T, R> t, Func<T, R> f) {
return cond ? t : f;
}
public static void main(String[] args) {
Func<Integer, Integer> a =
myIf(1==1,(Integer n) -> n + n, (Integer n) -> n * n);
System.out.println(a.eval(10));
}
実行結果
> java MyIf
20