Notes





No Fluff Just Stuff - 2013

Complexity isn't always bad, but 'complicated' is. So, how do we manage complexity to minimize the degree of complication? This idea is the axis around which my notes are organized and the context my mind lived in this year at the NFJS conference. - Must be courageous to be simple. - It is tempting to be clever and sophisticated to impress or for enjoyment, but this is bad behavior. - Don't be clever. Clever solutions aren't simple and maintainable. We need simple, understandable solutions that do their work as directly and comprehensively as possible. - Think about subtractive development. Simplify and minimize. - Everything should be as simple as possible, but not simpler - Discreet math counts the finite world, continuous math counts the infinite. - RSA: The math behind it, based on the great difficulty of large prime factorization. Why prime numbers are so important and valuable. - Extended Euclidean algorithm - used to derive RSA private exponent when given the public key - Eulers totient - counts the positive integers less than or equal to a number 'n' that are relatively prime to 'n' * plays a key role in the definition of the RSA encryption system since it counts relative primes of a number. Want to build an RSA system whereas the totient is 1 (relative primality is good since it makes solving the system more difficult). - Bézout's identity - an identity for polynomials --> gcd{a,b}=d=ua+vb. * primarily used when finding solutions to linear Diophantine equations, but also to find solutions via Euclidean Division Algorithm. This talk revolved around the 'plumbing' under the top level Git commands, and focused on those who knew Git and were looking for a more profound understanding. The content was audience driven as we selected the features of Git that we needed a deeper understanding of. This is just a collection of commands and tools I wrote down. Look them up if you aren't familiar with one of them: refs and reflog git 'tree' Head -- current commit, parent of your next commit Git hash object Git cat-file Commit --amend Git lol Interactive rebase : git rebase -i Git show filter branch merge branch --squashGit reset --hard head. ^ (With carrot) - undoes previous commit stash -a See teach.github.com for a 'Git' learning experience. www.gradle.org - Gradle as a successor to Maven. Simpler, more terse, more expressive. Has excellent documentation. - Good to use when converting from ANT - Build-by-convention support for Java, Groovy, OSGi, Web and Scala projects - Gradle rated as 'Adopt' on Thoughtworks Technology Radar, Maven is 'Hold' - Declarative build system - powerful flexibility - Support for multi-project build is unparalleled - Gradle's build scripts are written in Groovy, not XML. Not as verbose and *very* easy to do things like conditionals that might require MOJOS in the Maven world - Spock - a useful tool for Gradle used as a testing framework - Manning Publications: Coupon code: makingjava42 - 'Gradle in Action' - Power law distribution describes useful relationships in software. (80% of everything is crap, only a small portion of tools/people are *very* useful) - Too much utilization leads to criticality. Think of overloaded servers. - Context switching is expensive, but helpful for learning. Find a balance. - REST in practice. RESTful systems allow us to build loosely coupled, simpler resources, that are more organic to the web. RESTful, done right, can greatly reduce complexity. - Class structure is like a rice pile. Dropping a grain will have a chain effect on other grains. * Power Law says that rarely this chain reaction will be large when one class evolves. - Complex systems should emphasize maintainability. - When implementation doesn't match the architecture you have a dangerous divergence - Architect leaves the project, leads to project degradation, the original vision fades - Lines of code double every 7 years - focus on making code easy to understand and maintain. - In addition to adding features and piling on complexity, we also need to realize the value of subtraction and simplifying - Software must evolve to survive. Refactoring is a must. - Who needs a architect? Software is not limited by physics,it is limited by imagination, by design, by organization. In short, it is limited by properties of people. Everyone can help architect a system by contributing their creativity and ingenuity. - Prove you can do it with a test =) - The source code is the design, and should be self explanatory - refactor for simplicity - A difference exists between 'Trusted' and 'trustworthy'. An entity must be trustworthy in order to become trusted. - Principal of least privilege: Only give entities the minimum privilege necessary to accomplish goal. - Amateurs attack machines, professionals attack people. Social Engineering is the key to a professional hack. The more complex the systems become the less secure they are. * Complex systems expose more loopholes * Complex systems are more difficult for the creators to discover security gaps - SOAP less secure than REST, in part due to REST's simple design - Buy, rent, or grow developers - Valet key model in web system - Only give user a specific authority to accomplish a specific task - OpenID: tool for standardizing authentication across many sites - OAuth: open standards for authorization, provides flow of authorization, complements OpenID There is no 'next' language, or platform. There is a collection of platforms and tools that are expedient for specific tasks. Learn continually to master a variety of tools and languages. Experts stressed the importance of the mobile platform and community of users. To ignore this trend to mobility means losing relevance.


LambdaConf - 2015

Abandon your strengths, explore your weaknesses
Explore the the fear of reaching out, having difficult conversations, and willingly extending ourselves to others looking to truly connect
Delivering a difficult message is like throwing a hand-grenade, coated with sugar, it will still do damage.
Choosing not to deliver a difficult message is like hanging on to a hand grenade once you've pulled the pin
Dealing constructively with tough topics strengthens and adds meaning to a relationship fold ~ replaces each 'thing' with a function
book: functional programming with bananas and barbed wire
maximum segment sum problem - Solve with functional, monadic bits of computation - instead of multiple map operations, compose mappings using 'fold-fusion', combining the map ops of one map into another whereas: foldr f z . map g is equivalent to foldr (f . g) z
monoids: carrier functions for list homomorphisms
functor: a type of mapping between categories, which is applied in category theory. Functors can be thought of as homomorphisms between categories.
monad: a structure that represents operations either nested or chained on a specific type.
Bird Meertens Formalism - a calculus for deriving programs from specifications data types in haskell are algebraic: a set of operations over some domain
Functions in Haskell are unary..a function accepting multiple args is actually multiple functions curried
Haskell function purity...same input -> same result
The more constrained your types the less constrained the functionality
Haskell IO uses IO interface, can see computations with side effects easily
Composition of functions is associative
Functional programming is all about transformations on immutable data Cipher: An algorithm for encoding/decoding some message
ROT13, a special case of the Caesar cipher, implemented in Cryptol:
caesar : {n} ([8], String n) -> String n caesar (s, msg) = [ shift x | x <- msg ] where map = [’A’ .. ’Z’] <<< s shift c = map @ (c - ’A’) How do we make the Ouroboros spit out his own tail, or, disrupt the endless perpetuation of mistakes of the past
Compatibility means deliberately repeating other peoples' mistakes
Scala intentionally repeats javas mistakes
Immutable files - lazily computed - safe for concurrent access
Pervasive file virtualization
Critical that data is lazier than metadata
Files recomputed automatically on demand - reactive files - continuous consistency

A var is a house for a bug
A thread is a house for a deadlock
And its a safe bet, that your technical debt
Has the nicest house on the whole block
2.9
Application -> App (trait can be used to quickly turn objects into executable programs)
Using Application (legacy): 7seconds (not threadsafe)
Using App: 7milliseconds (also threadsafe)
Parallel collections...par method...4 cored machine...program runs neaarly 4x as fast using 'par'
Use Try.get (even thought Option.get is bad)
Implicit classes
Value classes: Used to avoid object allocation at runtime. Type safety of custom data types without runtime overhead.
Extension methods: allocation free
String interpolation --json and sql custom interpolations
2.10
Future...parallel, non-blocking, and async. Call back order is not deterministic
Start futures outside 'for comprehension'...collect results in 'fo'-comprehension;.
Future is read only placeholder for a result
Promise is a writable conatiner which completes a future
Modularization
Reflection, Macros(throw runtime errors at compiletime), and Quasiquotes ..Reified scala expressions
Predef.??? - for methods not implemented
2.11
Case classes with > 22 params
Colors in the REPL! Use: scala -Dcolors=true
2.12
Support java 8
Spores - Distributable, portable code closures. Send distributable, closures to the data. Dont match on options
Treat Option as a collection or Monad
Instead of: opt match { case Some(a) => a case None => "blah" } Use: opt.getOrElse("blah")
forall...returns true for none
Dont pattern match on boolean and single case
The most idiomatic way to use Option is to treat it as a collection or monad and use map, flatMap, filter, or foreach. A less-idiomatic way to use Option is via pattern matching
Dont throw exceptions, return them as programmable errors. Thrown exceptions can’t be returned through the stack or cross thread boundaries
Use Try rather than Either to return exceptions. Enhanced functional coding for Scala
Functor: Something that can be mapped over
Scalaz defines Functor instances for Tuples. (1, 2, 3) map {_ + 1} outputs: (Int, Int, Int) = (1,2,4)
Use Scalaz Monads to make IO ops pure and lazy
Make IO pure by not doing any IO (until you run the code). Such as: object Pure { def println(msg: String) = () => Predef.println(msg) }
Free monad is all about separating the structure of the computation from the interpreter that gives it meaning
Scalaz Either is: \/ , which is a disjunction. Left is -\/ Right is \/-
Validation, applicatve operator to combine results - Validation keeps going and reports back all failures - Not a monad, but an applicative functor -
Instead of chaining the result from first event to the next, Validation validates all events Compositional lib for stream processing -- r/w incrementally using constant memory - zip and merge I/O streams
Nondeterministic and concurrent processing: A computation may read from multiple input streams simultaneously, using whichever result comes back first, and a pipeline of transformation can allow for nondeterminism and queueing at each stage.
A topic is like a queue. but when you subscribe, you only get messages from that point forward

Cool New Tools

Scalacheck - automated property-based testing for Scala apps
Https4s - minimal, idiomatic Scala interface for HTTP - http://http4s.org/
Scodec - combinator library for working with binary data
Spire - number types and numeric abstractions for Scala
axle - an embedded domain specific language in Scala for scientific computing
Doobie - a pure-functional database library for Scala
REPLesent - Presentations using Scala REPL
Cats - a simpler Scalaz - Lightweight, modular, and extensible library for functional coding