The document discusses multithreading in Java, outlining the concept of threads and their relation to processes and multitasking. It explains the benefits of multithreading, such as efficiency and independence of threads, and describes the lifecycle of a thread, including its different states. Additionally, it covers methods to create threads, thread priorities, and synchronization techniques for managing shared resources among threads.
Packages in Java provide three main benefits: reusability, allowing classes with the same name in different packages, and hiding classes to prevent other packages from accessing them. Packages are organized hierarchically, so sub-packages can be created within packages. Classes within a package are accessible to other classes in the same package, and classes declared public in one package are accessible to another package.
The document discusses the flyweight pattern, which uses sharing to efficiently support large numbers of fine-grained objects. An application may use many objects, but most objects' state can be made extrinsic. By removing extrinsic state and replacing groups of objects with relatively few shared objects, storage costs can be reduced. The flyweight pattern defines an interface for flyweights to receive extrinsic state, with concrete flyweights implementing storage for intrinsic state. A flyweight factory manages the shared flyweight objects.
The Proxy design pattern provides a surrogate or placeholder for another object to control access to it. A proxy can act as a placeholder for complex, expensive objects that should not be initialized until needed. This delays the creation of these objects until they are actually required. Proxies can also protect the real component from undue complexity or provide extra functionality. Some common uses of proxies include remote proxies for objects in a different address space, virtual proxies that create objects on demand, and protection proxies that control access to the original object.
The document discusses reflection in C# and .NET. Reflection allows a program to obtain metadata about types defined in assemblies to access type information at runtime. It enables examining assemblies, modules, types and their members. The System.Reflection namespace contains classes like Type and Assembly that provide metadata about types, assemblies and members. Reflection allows dynamically loading assemblies, late binding without compile-time type knowledge, and examining/invoking members by name.
Polymorphism refers to the ability of an object to take on multiple forms. In Java, polymorphism occurs when a reference variable can refer to objects of different subclasses. This allows methods to behave differently depending on the actual object being referred to. There are three main forms of polymorphism in Java: method overriding, abstract method implementation, and interface implementation. Polymorphism provides benefits like simplicity and extensibility by allowing code to interact generically with base types and subclasses without needing specific type details.
This document discusses the observer design pattern. It defines the observer pattern as establishing a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. It provides examples of when to use the observer pattern, such as with a stock market notifying individual stocks of changes. The document outlines the structure of the observer pattern, provides class and sequence diagrams, and includes a code demo of implementing the observer pattern with products and subscribers.
The document provides an overview of different types of classes in programming, including concrete, abstract, partial, sealed, static, and nested classes. It defines a class as a blueprint for custom types and details the characteristics and use cases for each class type, such as the inability to instantiate an abstract class or the fact that a static class cannot be instantiated. Examples are provided to illustrate the implementation and usage of these class types.
Tour of Apache PredictionIO in 10 Minuteschibochibo
?
The document provides an overview of the Apache PredictionIO framework for building machine learning applications. It describes PredictionIO as an open source machine learning framework for building end-to-end machine learning platforms. It outlines the basic process for using PredictionIO, which involves cloning a template, collecting training data, building, training and deploying a predictive model, and making queries to the model. It also briefly describes the train and predict algorithms and notes that community support is available via email and the PredictionIO website.
Tour of Apache PredictionIO in 10 Minuteschibochibo
?
The document provides an overview of the Apache PredictionIO framework for building machine learning applications. It describes PredictionIO as an open source machine learning framework for building end-to-end machine learning platforms. It outlines the basic process for using PredictionIO, which involves cloning a template, collecting training data, building, training and deploying a predictive model, and making queries to the model. It also briefly describes the train and predict algorithms and notes that community support is available via email and the PredictionIO website.
Deadly Code! (seriously) Blocking & Hyper Context Switching Patternchibochibo
?
The document discusses the issues faced when using blocking and hyper context switching patterns in Scala applications, particularly regarding database access and execution context management. It highlights the inefficiencies caused by unnecessary switching and blocking, which can lead to degraded response times even with a small number of users. The presentation concludes with a summary emphasizing the importance of avoiding blocking operations in asynchronous frameworks and the proper handling of execution contexts.
The document discusses the improvements made in the Doobie library version 0.4.0, particularly around dynamic SQL query construction using composable statement fragments. It highlights how to set up imports, define SQL literals, and use various combinators for more complex queries. The conclusion expresses optimism about the ability to write dynamic SQL while noting some uncertainty around specific features.
Is spark streaming based on reactive streams?chibochibo
?
What is Reactive Streams? What if a subscriber was very slow in asynchronous stream processing? In this talk we will briefly introduce you to the basics of Reactive Streams and the importance of back-pressure and then explain the architecture (implementations) of Spark Streaming back-pressure.
The document discusses Scala macros, highlighting their definition as code that generates code and their ease of use despite the complexity of development. It provides practical examples of using macros in logging and matcher generation, as well as distinctions between blackbox and whitebox macro implementations. Additionally, it mentions the upcoming Scala.meta API aimed at simplifying metaprogramming and enhancing macro capabilities.
13. 13
基本的なCRUD
// 全件取得
val users: Seq[UserRow] = User.list
// 登録
val res: Int = User insert UserRow(1, "なまえ")
// 更新
val res: Int = User.filter(_.id is id.bind).update(
UserRow(1, "なまえ変更"))
// 削除
val res: Int = User.filter(_.id is id.bind).delete
14. 14
基本的なCRUD
// 全件取得
val users: Seq[UserRow] = User.list
// 登録
val res: Int = User insert UserRow(1, "なまえ")
// 更新
val res: Int = User.filter(_.id is id.bind).update(
UserRow(1, "なまえ変更"))
// 削除
val res: Int = User.filter(_.id is id.bind).delete
bindを呼ぶと
バインド変数になる
15. 15
バインド変数になるbind
? bindなし
? bindあり
val name = "ta'kako"
User.filter(_.name is name).firstOption
??? from USER x1 where x1.NAME = 'ta''kako'
SQLのイメージ
User.filter(_.name is name.bind).firstOption
??? from USER x1 where x1.NAME = ?
SQLのイメージ