Scala Logging
http://scala-programming-language.1934581.n4.nabble.com/verbose-logger-usage-td3084112.html
AOP:
<http://jonasboner.com/2008/02/06/aop-style-mixin-composition-stacks-in-scala.html>
<http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di.html>
<http://jonasboner.com/2008/12/09/real-world-scala-managing-cross-cutting-concerns-using-mixin-composition-and-aop/>
Snippets and thoughts from a passionate software developer interested in all things DevOps, Continuous Delivery, Functional Programming, Distributed Systems. Also on Twitter as @mcallana.
Wednesday, July 13, 2011
Tuesday, July 12, 2011
Pointfree
http://www.haskell.org/haskellwiki/Pointfree
it is clearer to write
than to write
The term originated in topology, a branch of mathematics which works with spaces composed of points, and functions between those spaces. So a 'points-free' definition of a function is one which does not explicitly mention the points (values) of the space on which the function acts. In Haskell, our 'space' is some type, and 'points' are values.
Pros
This style is particularly useful when deriving efficient programs by calculation and, in general, constitutes good discipline. It helps the writer (and reader) think about composing functions (high level), rather than shuffling data (low level).
It is a common experience when rewriting expressions in pointfree style to derive more compact, clearer versions of the code -- explicit points often obscure the underlying algorithm.
Cons
Point-free style can (clearly) lead to Obfuscation when used unwisely. As higher-order functions are chained together, it can become harder to mentally infer the types of expressions. The mental cues to an expression's type (explicit function arguments, and the number of arguments) go missing.
Point-free style often times leads to code which is difficult to modify. A function written in a pointfree style may have to be radically changed to make minor changes in functionality. This is because the function becomes more complicated than a composition of lambdas and other functions, and compositions must be changed to application for a pointful function.
Perhaps these are why pointfree style is sometimes (often?) referred to as pointless style.
it is clearer to write
let fn = f . g . h
let fn x = f (g (h x))
The term originated in topology, a branch of mathematics which works with spaces composed of points, and functions between those spaces. So a 'points-free' definition of a function is one which does not explicitly mention the points (values) of the space on which the function acts. In Haskell, our 'space' is some type, and 'points' are values.
Pros
This style is particularly useful when deriving efficient programs by calculation and, in general, constitutes good discipline. It helps the writer (and reader) think about composing functions (high level), rather than shuffling data (low level).
It is a common experience when rewriting expressions in pointfree style to derive more compact, clearer versions of the code -- explicit points often obscure the underlying algorithm.
Cons
Point-free style can (clearly) lead to Obfuscation when used unwisely. As higher-order functions are chained together, it can become harder to mentally infer the types of expressions. The mental cues to an expression's type (explicit function arguments, and the number of arguments) go missing.
Point-free style often times leads to code which is difficult to modify. A function written in a pointfree style may have to be radically changed to make minor changes in functionality. This is because the function becomes more complicated than a composition of lambdas and other functions, and compositions must be changed to application for a pointful function.
Perhaps these are why pointfree style is sometimes (often?) referred to as pointless style.
eta conversion
http://www.haskell.org/haskellwiki/Eta_expansion
eta conversion (also written η-conversion) is adding or dropping of abstraction over a function. For
example, the following two values are equivalent under η-conversion:
and
eta conversion (also written η-conversion) is adding or dropping of abstraction over a function. For
example, the following two values are equivalent under η-conversion:
\x -> abs x
absConverting from the first to the second would constitute an eta reduction, and moving from the second to the first would be an eta abstraction.
Thursday, June 30, 2011
Tuesday, June 28, 2011
Friday, June 24, 2011
Language Classifications
Strict (call-by-value)
Lazy (call-by-need)
Pure
Static
Dynamic
Duck-typed
Functional
Object-oriented
Lazy (call-by-need)
Pure
Static
Dynamic
Duck-typed
Functional
Object-oriented
| Language | Pure | Strict | Non-Strict (Lazy) |
|---|---|---|---|
| Haskell | Yes | No | Yes |
| ML | |||
| Erlang | |||
| Scheme | |||
| Java | |||
| C# | |||
| Scala | |||
| Ruby | |||
| F# | |||
| SQL | |||
| Regex |
OCaml notes
Functional core of Objective CAML:
http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora015.htmlVariables are variable:
# letp=10;;val p : int = 10
# letkx=(x,p,x+p);;val k : int -> int * int * int =
# kp;;- : int * int * int = 10, 10, 20
# letp=1000;;val p : int = 1000
# kp;;- : int * int * int = 1000, 10, 1010
http://caml.inria.fr/pub/docs/manual-ocaml/expr.html
Looping:while expr1 do expr2 done
for name = expr1 to expr2 do expr3 done
for name = expr1 downto expr2 do expr3 done
Exceptions: try ... with ... -> ...
Objects
Coercion (casting to superclass): subobject :> superclass
Message sending (calling method on object): object # method
Object duplication: Oo.copy
Recursive functions: rec
String concatenation: ^
Characters delimited by ` not ': `a`
http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora016.html#toc21
Tuples
Records
Sum Types
Constant Constructor: typesuit=Spades|Hearts|Diamonds|Clubs;;
Constructor with Args: typecard=Kingofsuit|Queenofsuit|Knightofsuit|Knaveofsuit|Minor_cardofsuit*int|Trumpofint|Joker;;
Recursive Types
Parameterised Types: type('a,'b)list2=
Thursday, June 16, 2011
Monday, June 13, 2011
Yow Night - Cloud
Cloud
8/6/2011
Tim Buntel – MS SQL Azure
www.windowsazurepass.com
Promocode: Azurecloud
Clayton Brown – SalesForce
IaaS, PaaS, Saas
Hardy – Ninefold
Iaas
5 key concerns
• Latency
• Self-service
• Data jurisdiction
• Solid financial backing
• Local support
XenServer or VMWare
CentOS, Open SUSE, Ubuntu, Windows 2003/08
Upload ISO
Don’t pay if don’t use
Starts from 2.2c/hr ($30/m) 1 CPU, 384Mb RAM, 80Gb HDD
James Durell – SpringSource Cloud Foundry
Open PaaS
github.com/cloudfoundry
Security?
Risk?
Insurance?
DR?
8/6/2011
Tim Buntel – MS SQL Azure
www.windowsazurepass.com
Promocode: Azurecloud
Clayton Brown – SalesForce
IaaS, PaaS, Saas
Hardy – Ninefold
Iaas
5 key concerns
• Latency
• Self-service
• Data jurisdiction
• Solid financial backing
• Local support
XenServer or VMWare
CentOS, Open SUSE, Ubuntu, Windows 2003/08
Upload ISO
Don’t pay if don’t use
Starts from 2.2c/hr ($30/m) 1 CPU, 384Mb RAM, 80Gb HDD
James Durell – SpringSource Cloud Foundry
Open PaaS
github.com/cloudfoundry
Security?
Risk?
Insurance?
DR?
Yow night – 12 Agile Adoption Failure Modes
Jean Tabaka
9/6/2011
Rally: Tim Miller, Ryan Martins
pm.stackexchange.com
Most orgs have suicidal tendencies
It’s about caring for your world
David Snowden sense making – failure stories are most powerful
Agile helps me be a better me/artist – create your own reality
- Checkbook commitment
- Unengaged – just do it
- Culture that doesn’t support change
- “Follow the plan”
- Need to change the metrics
- Best practices… good practices… emergent practices
- Standard of work enforced
i. Governance = conformance
ii. Standard of work is static
iii. Cross-org uniform
iv. Detailed documentation security blanket
v. PMO as enforcers
- Ineffective use of retrospectives
- “This sucks” threshold – if nothing’s gonna change, why bother?
- Should ask:
i. What are we doing well?
ii. What’s not serving us as a team?
iii. What would we change to improve?
- No retrospective
- There is absolutely nothing wrong
- No action
- Stable environment?
- TANSTAAFL – There ain’t no such thing as a free lunch
- Will work for infrastructure
- Lack of full planning participation
- Waiting for decisions = waste
- Conversation
- Unavailable product owner
- Too many product owners
- Too busy for all the communicating
- Product owner = hardest role. What does product owner get out of it?
- Commitment with team
- Bad scrum masters
- Command and control
i. Telling people what to do = Low morale and lower IQs
ii. Cognitive abilities approve the more decisions we make
- Servant Leader
i. Serve and facilitate
ii. Remove impediments
- Not having an onsite evangelist
- Team lacking
- Red tape decisions
- Not forming, storming, norming, performing
- Testing not pulled forward
- Pushed to deliver
- Increased defects
- Failure-demand work vs value-demand work
- Piled up trash
- Stop the line
- Traditional performance appraisals
- Manager’s yearly evaluation
- Individual heroics rewarded – holds back agile success
- Frequent team evaluation
- Reverting to form
- Change is hard
Saturday, June 11, 2011
Monads for Java Programmer
http://irekjozwiak.com/entry/2009/06/13/Monads-for-Java-C---programmers.html
(>>=) bind
(>>=) bind
a1 >>= a2 = join (fmap a2 a1)
fmap _ Nothing = Nothing
fmap someFunction (Just a) = Just (someFunction a)
> fmap (+ 2) (Just 4)
Just 6
> fmap (+ 2) (Nothing)
Nothing
join Nothing = Nothing
join (Just Nothing) = Nothing
join (Just (Just x)) = Just x
Subscribe to:
Posts (Atom)