This document summarizes an agenda for a 2015 AV technology sharing session. It discusses Instaparse, a Clojure parser generator, EBNF grammar notation, defining functions with pattern matching using defun, and Cloud Query Language (CQL) for translating SQL-like queries to MongoDB queries. Examples are provided for parsing arithmetic expressions, defining recursive functions, pattern matching on collections, visualizing parses trees, and transforming parses queries to MongoDB queries. Performance of the CQL parser is discussed, noting it can achieve over 400 queries per second per node through caching.
This document provides recommendations for commonly used development tools on Mac, including recommendations for the terminal, command line tools, version control with Git, Java tools, Clojure tools, Mac apps, and Emacs configurations. It also asks the audience to provide additional tool recommendations.
Direct linking in Clojure 1.8 allows functions to make direct static method calls to other functions for improved performance, bypassing lookups through vars. It does this by compiling functions with direct calls instead of going through the var and Fn object. However, direct linking cannot see redefinitions and doesn't work with libraries like with-redefs that rely on redefining functions. Functions can be marked with ^:redef to prevent direct linking.
The document discusses CPU caches and cache coherence. It covers direct mapping and N-way mapping of CPU caches. It also discusses cache replacement policies like LRU and techniques like write-back. It introduces the MESI protocol for maintaining cache coherence across CPUs and cache line states like dirty valid. It provides examples of Java programs to demonstrate CPU cache misses and false sharing and ways to address it like using the @Contended annotation.
This document introduces Elixir, an open-source, functional, concurrent, and dynamic language that runs on the Erlang virtual machine. It discusses key features of Elixir like its Ruby-like syntax, support for distributed and fault-tolerant systems, actor model, macros, protocols, and tools. It also provides examples of functional programming, pattern matching, actors, GenServers, supervisors, macros, protocols, and sigils in Elixir.
This document summarizes Erlang processes and scheduling in Erlang. It discusses the process control block, stack and heap, message passing, the scheduler, workload balancing across schedulers, and garbage collection. The scheduler prioritizes ports, maximum, high and normal/low priority queues. It will consume all reductions for a process or pause it waiting for a message. The garbage collector uses copying collection for process heaps and reference counting for shared binaries.
Hystrix is a latency and fault tolerance library designed by Netflix to isolate points of access to remote systems and services. It stops failures from cascading and improves resilience. Hystrix uses concepts like thread pooling, timeouts, circuit breakers, and fallbacks to achieve reliability. It provides commands for synchronous and asynchronous access to remote resources, and can be configured using properties or code. Hystrix also includes a dashboard for monitoring metrics and failures.
Introduction to Basic Haskell Components (In Chinese)ChengHui Weng
?
In 2012, we had the first Chinese functional meetup about general functional programming techniques in Taipei. I gave this talk to introduce several classes in the famous Typeclassesopedia article.
16. 闭包 - 应用举例 排序: Java: class Product implements Comparator{ public int compare(Product other) return this.price-other.price … Collections.sort(products) Ruby: products.sort{|a,b| a.price-b.price}
17. 闭包 - 应用举例 Java7 引入的闭包语法: double log = { double x => Math.log(x) }.invoke(10); int sum = { int x, int y => x + y }.invoke(3, 4); // will return 7 String[] girls = { "Jane", "Eva", "Sarah", "Alice" }; Arrays.sort(girls, { String s1, String s2 => int r = s1.length() - s2.length(); r == 0 ? s1.compareTo(s2) : r });
18. 闭包应用举例 模拟对象, lua: function make_stack() ??????? local data = {}; ??????? local last = -1; ??????? local function push(e) ??????????? last = last + 1; ??????????? data[last] = e; ??????? end ??????? local function pop() ??????????? if last == -1 then ??????????????? return nil ??????????? end ??????????? last = last - 1 ??????????? return data[last+1] ??????? end ??????? return function (index) ??????????? local tb = {push=push, pop=pop} ??????????? return tb[index] ??????? end end s=make_stack() s("push")("test0") s("push")("test1") s("push")("test2") s("push")("test3") print(s("pop")()) print(s("pop")()) print(s("pop")())
33. Continuation amb 操作符 amb, 是 John McCarthy 在 1961 年提出的。 Amb 表达式 ( amb e1 e2 e3 e4 ...) 有歧义性地返回 n 个表达式中 ei 之一的值,例如: (list (amb 1 2 3) (amb 'a 'b)) 将有如下六个值: (1 a) (1 b) (2 a) (2 b) (3 a) (3 b) 注意: (amb) 永远是 fail 。 (define (require p) (if (not p) (amb)))