This document describes how to configure Spring Security for authentication and authorization in a web application. It defines a WebSecurityConfig class that configures HTTP security with roles like OWNER and MANAGER for access control. It also defines a UserDetailsManager service for loading users and a User entity class implementing UserDetails. Tests are shown for security configuration, login, access control and more using Spring Security's test utilities.
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
Domain Modeling Made Functional (DevTernity 2022)Scott Wlaschin
(video at https://fsharpforfunandprofit.com/ddd/)
Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers. Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time. In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Domain Modeling Made Functional (DevTernity 2022)Scott Wlaschin
(video at https://fsharpforfunandprofit.com/ddd/)
Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers. Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time. In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
20170721 future of reactive architecturesJamie Allen
Some knowledge will be difficult to scale across an entire team. How do we build applications that are reactive while still delivering business value quickly?
Deep Learning with GPUs in Production - AI By the BayAdam Gibson
This document discusses deep learning with GPUs in production environments. It describes different types of GPU clusters for research, cloud, and enterprise production. It also outlines the key considerations for running deep learning jobs on a GPU cluster, including memory management, throughput, resource provisioning, and runtime. Finally, it presents Deeplearning4j as a tool that addresses these challenges by allowing models to be trained on Spark and deployed in Java/Scala applications, with an integrated workflow for data scientists and data engineers.
The document discusses using the Raspberry Pi GPU for deep neural network prediction on end devices. It provides an overview of the Raspberry Pi GPU architecture and benchmarks convolutional neural network models like GoogLeNet, ResNet50, and YOLO on the Raspberry Pi 3 and Zero. Optimization techniques discussed include specialized convolution implementations, instruction golfing to reduce operations, removing wasteful computations, and improving data locality.
9. 関数
Scala の関数
Scala の関数はファーストクラス。
変数に代入したり、他の関数の引数に渡したり出来る。
val inc = (i: Int) => i + 1
val cl: String => Int => String =
(msg: String) => (rep: Int) => msg * rep
Scala では、変数/定数定義で型パラメータをとるような値は定義出来ない。メソッ
ド定義で代用するので、便宜上def を用いた定義も関数と呼ぶこととする。
def show[A]: A => String = (a: A) => a.toString
9 / 59
10. 関数
Scala の関数
関数を引数にとったり、返り値として返したりする関数を高階関数と呼ぶ。
val calc: (Int => Int => Int) => Int => Int => Int =
(f: Int => Int => Int) => (i: Int) => (j: Int) => f(i)(j)
val add: Int => Int => Int =
(i: Int) => (j: Int) => i + j
val multi: Int => Int => Int =
(i: Int) => (j: Int) => i * j
scala> calc(add)(1)(2)
res15: Int = 3
scala> calc(multi)(1)(2)
res16: Int = 2
10 / 59
45. あれもこれも型クラス
for 式再説
Scala のfor 式は糖衣構文。
val fooOpt: Option[Int] = ...
val barOpt: Option[Int] = ...
for {
foo <- fooOpt
bar <- barOpt
} yield foo + bar
以下のように展開される。
fooOpt.flatMap(foo =>
barOpt.map(bar =>
foo + bar
)
)
45 / 59
46. あれもこれも型クラス
for 式再説
for 式の展開には他にもルールがある。compiler の型付け前に展開されるので、
必ず全ての展開対象メソッドを実装している必要はない。
abstract class C[A] {
def map[B](f: A => B): C[B]
def flatMap[B](f: A => C[B]): C[B]
def withFilter([: A => Boolean): C[A]
def foreach(b: A => Unit): Unit
}
46 / 59