This document is the introduction to "The Little Book of Semaphores" by Allen B. Downey. It provides an overview of the book, which uses examples and puzzles to teach synchronization concepts and patterns. The book aims to give students more practice with these challenging concepts than a typical operating systems course allows. It also discusses the book's licensing as free and open source documentation.
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
?
This document discusses alternative concurrency paradigms for the Java Virtual Machine (JVM). It begins with an agenda and discusses how Moore's Law no longer solves concurrency problems as processors are becoming multi-core. It then discusses the problems with shared-state concurrency and how separating identity and value can help. The document introduces software transactional memory, message passing concurrency using actors, and dataflow concurrency as alternative paradigms. It uses examples of bank account transfers to demonstrate how these paradigms can be implemented and discusses their advantages over shared-state concurrency.
This document is the introduction to "The Little Book of Semaphores" by Allen B. Downey. It provides an overview of the book, which uses examples and puzzles to teach synchronization concepts and patterns. The book aims to give students more practice with these challenging concepts than a typical operating systems course allows. It also discusses the book's licensing as free and open source documentation.
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
?
This document discusses alternative concurrency paradigms for the Java Virtual Machine (JVM). It begins with an agenda and discusses how Moore's Law no longer solves concurrency problems as processors are becoming multi-core. It then discusses the problems with shared-state concurrency and how separating identity and value can help. The document introduces software transactional memory, message passing concurrency using actors, and dataflow concurrency as alternative paradigms. It uses examples of bank account transfers to demonstrate how these paradigms can be implemented and discusses their advantages over shared-state concurrency.
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
?
This document summarizes a presentation on Paxos and gen_paxos. It introduces Paxos as a distributed consensus algorithm that is robust to network failures and allows data replication across multiple nodes. It then describes the gen_paxos Erlang implementation of Paxos, including its data model, state machine approach, and messaging between nodes. Key aspects of Paxos like the prepare and propose phases are explained through examples. The document also provides context on applications of Paxos and references for further reading.
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
?
This document summarizes an Erlang meeting held on July 3, 2009 in Tokyo. It discusses the gen_paxos Erlang module, which implements the Paxos consensus algorithm. Paxos is needed to solve problems like split-brains where data could become inconsistent without coordination between nodes. The document explains the key aspects of Paxos like its phases, data model in gen_paxos, and how nodes communicate through message passing in Erlang. It also provides references to related works and papers about Paxos.
This document provides style guidelines for Scala developers at Twitter. It outlines recommendations for imports, implicit usage, reflection, comments, whitespace, logging, project layout, variable naming conventions, and ends by thanking people for attending.
Martin Odersky outlines the growth and adoption of Scala over the past 6 years and discusses Scala's future direction over the next 5 years. Key points include:
- Scala has grown from its first classroom use in 2003 to filling a full day of talks at JavaOne in 2009 and developing a large user community.
- Scala 2.8 will include new collections, package objects, named/default parameters, and improved tool support.
- Over the next 5 years, Scala will focus on concurrency and parallelism features at all levels from primitives to tools.
- Other areas of focus include extended libraries, performance improvements, and standardized compiler plugin architecture.
This document introduces developing a Scala DSL for Apache Camel. It discusses using Scala features like implicit conversions, passing functions as parameters, and by-name parameters to build a DSL. It provides examples of simple routes in the Scala DSL and compares them to Java. It also covers tooling for Scala in Maven and Eclipse and caveats like interacting with Java generics. The goal is to learn basic Scala concepts and syntax for building a Scala DSL, using Camel as an example.
The article discusses the Guardian's Datastore project, which makes data of public interest freely available online for reuse. Some key points:
- The Datastore contains datasets on topics like MPs' expenses, carbon emissions, and public opinion polls. This data was previously hard to access but the web now allows easy access to billions of statistics.
- Making this data open and machine-readable supports the Guardian's tradition of fact-checking and transparency. It also encourages others to analyze and build upon the data in new ways.
- An early example involved crowdsourcing the review of 500,000 pages of MPs' expenses, revealing new insights. Other Guardian datasets like music recommendations and university rankings are now available for others
This document is the introduction to The Little Book of Semaphores by Allen B. Downey. It provides an overview of the book, which teaches synchronization patterns and solutions to classic concurrency problems using semaphores. The introduction discusses the book's goal of helping students deeply understand synchronization through practice solving puzzles over time. It describes how the book was tested on students and improved based on their feedback. The second edition features Python-like pseudocode and new problems contributed by students.
This document describes PNUTS, a massively parallel and geographically distributed database system used by Yahoo for its web applications. PNUTS provides scalable data storage and low-latency access for large numbers of concurrent requests and updates across different continents. It uses a consistency model that allows for relaxed guarantees to improve performance, offering applications transactional features without requiring full serializability. The first version of PNUTS is currently serving Yahoo's production systems.
Lamport's algorithm for mutual exclusion uses timestamping of messages and request queues to provide a total ordering of requests for shared resources. Each process maintains a request queue and follows 5 rules: (1) the initiator sends a timestamped request to all processes, (2) other processes add the request to their queue and reply, (3) the initiator is allowed access when its request is at the front of all queues and it has received all replies, (4) the initiator releases the resource by sending a release message, and (5) processes remove the request from their queue upon receiving the release. The algorithm guarantees only one process can access the resource at a time and is deadlock-free due to the timestamp ordering.
The document provides the schedule for a conference on September 14-16. It lists the morning and afternoon sessions for each day, including the topics to be discussed and presenters. Some of the topics included are semantics, parsing, sentiment analysis, word sense disambiguation, and named entity recognition. The keynote speakers are Ricardo Baeza-Yates, Kevin Bretonnel Cohen, Mirella Lapata, Shalom Lappin, and Walter Daelemans. There will also be poster presentations on September 14 and 15.
The document discusses trends and challenges facing information technology, including building a civic semantic web and waiving rights over linked data. It also discusses whether semantic technologies could permit meaningful brand relationships. The document contains a chart showing government department spending in the UK, with the Department of Health spending ?105.7 billion, followed by local and regional government spending ?34.3 billion, and the NHS spending ?90.7 billion.
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
?
The document discusses alternative concurrency paradigms to shared-state concurrency for the JVM, including software transactional memory which allows transactions over shared memory, message passing concurrency using the actor model where actors communicate asynchronously via message passing, and dataflow concurrency where variables can only be assigned once. It provides examples of how these paradigms can be used to implement solutions like transferring funds between bank accounts more elegantly than with shared-state concurrency and locks.
This document discusses event driven architecture (EDA) and domain driven design. It begins with an introduction to the speaker and an overview of EDA basics. It then describes problems with traditional SOA implementations, where domain logic gets split across many systems. The document proposes that exposing domain events on a shared event bus allows isolating cross-cutting functions to separate systems while keeping domain logic together. It provides examples of how this approach improves scalability and decouples systems. Finally, it outlines potential business benefits of using EDA like enabling complex event processing, business process management, and business activity monitoring on top of the domain events.
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
?
The document discusses Scala and functional programming concepts. It provides examples of building a chat application in 30 lines of code using Lift, defining case classes and actors for messages. It summarizes that Scala is a pragmatically oriented, statically typed language that runs on the JVM and has a unique blend of object-oriented and functional programming. Functional programming concepts like immutable data structures, functions as first-class values, and for-comprehensions are demonstrated with examples in Scala.
This document discusses using TCP/IP for high performance computing (HPC) applications. It finds that while TCP/IP can achieve bandwidth of 1 Gbps over short distances with low latency, the bandwidth degrades significantly over wide area networks with higher latency. It investigates tuning TCP parameters like socket buffer sizes to improve performance over high latency networks.
This document contains the schedule for a conference with sessions on various topics in natural language processing and computational linguistics. The conference will take place from September 14-16. Each day consists of morning and afternoon sessions split into parallel tracks (1a and 1b). Sessions cover areas like semantics, parsing, sentiment analysis, and more. Keynote speakers include Ricardo Baeza-Yates, Kevin Bretonnel Cohen, Mirella Lapata, Shalom Lappin, and Massimo Poesio. Presentations are 20 minutes each with coffee breaks in the mornings and poster sessions in the afternoons.
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
?
The document discusses Scala and functional programming concepts. It provides examples of building a chat application in 30 lines of code using Lift, defining messages as case classes, and implementing a chat server and comet component. It then summarizes that Scala is a pragmatically-oriented, statically typed language that runs on the JVM and provides a unique blend of object-oriented and functional programming. Traits allow for static and dynamic mixin-based composition. Functional programming concepts like immutable data structures, higher-order functions, and for-comprehensions are discussed.
This document provides style guidelines for Scala projects at Twitter. It outlines recommendations for imports, implicit usage, reflection, comments, whitespace, logging, project layout, variable naming conventions, and more. The document encourages placing all imports at the top of files, avoiding implicits and reflection when possible, writing Scaladoc comments for all classes and non-trivial methods, using 2 space indentation with no tabs, and following Maven directory conventions.
This document introduces developing a domain specific language (DSL) in Scala for Apache Camel. It discusses using Scala features like implicit conversions, passing functions as parameters, and by-name parameters to build a DSL. It provides examples of simple routes in Java and Scala DSL and shows how concepts like filtering and content-based routing can be implemented. The document also covers Scala tooling integration with Maven and Eclipse and some caveats when mixing Java and Scala.
The document discusses trends and challenges facing information technology, including building a civic semantic web and waiving rights over linked data. It also discusses whether semantic technologies could permit meaningful brand relationships. The document contains a chart showing government department spending in the UK, with the Department of Health spending ?105.7 billion, followed by local and regional government spending ?34.3 billion, and the NHS spending ?90.7 billion.
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
?
This document summarizes an Erlang meeting held on July 3, 2009 in Tokyo. It discusses the gen_paxos Erlang module, which implements the Paxos consensus algorithm. Paxos is explained as solving the split brain problem in distributed systems through coordination between nodes. The implementation details in gen_paxos are covered, including how it uses finite state machines. The document also discusses where Paxos gets its name and includes references for further reading.
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
?
This document discusses Scala and its features. It provides an example of building a chat application in 30 lines of code using Lift framework. It also demonstrates pattern matching, functional data structures like lists and tuples, for comprehensions, and common Scala tools and frameworks. The document promotes Scala as a pragmatic and scalable language that blends object-oriented and functional programming. It encourages learning more about Scala.
6. 変数の宣言(varとval)
var x = 1 // ≒ var x :Int = 1
var y = 2 // ≒ var y :Int = 2
val z = x + y // ≒ val z :Int = x + y
println(z)
? varで変数(変更可能)を宣言
? Javaの通常の変数と同じ
? 変数の型は省略可能(右辺の型から推論される)
? valで変数(変更不能)を宣言
? Javaのfinalな変数
? 変数の型は省略可能
10. whileによる繰り返し
var sum = 0
var i = 0
while(i < args.length) {
sum += args(i).toInt
i += 1
}
println(sum)
? コマンドライン引数の合計値を計算
? forよりも冗長だが、forよりも高速
? 性能をチューニングしたいときに使う
21. パターンマッチング(1)
println(args(0) match {
case "apple" => "りんご"
case "grape" => "ぶどう"
case "peach" => "桃"
case _ => "その他"
})
? 式 match { case パターン => ... }
? switch(式) { case 定数: ... }に相当
? _はdefault相当
? 値を返すことができる
? switch文をより強力にしたようなもの
22. パターンマッチング(2)
println(args match {
case Array("foo","bar") => "FooBar"
case Array("bar","foo") => "BarFoo"
case Array(name) => name
case _ => "default"
})
? パターンにマッチした値を変数に束縛可能
? 1要素の配列について、要素をnameに束縛
? 構造を持ったデータをパターンマッチに使える
? コレクションなど
23. Case Class
abstract class Exp
case class Add(l :Exp, r :Exp) extends Exp
case class Num(v :Int) extends Exp
def eval(exp :Exp) :Int = exp match {
case Add(l, r) => eval(l) + eval(r)
case Num(v) => v
}
println(eval(Add(Num(1), Num(2)))) // 3
? caseをclassの前に付加して定義
? 名前(...)でインスタンスが生成可能
? パターンマッチに使える