Encyclopedia of Programming Languages
http://progopedia.com/
Snippets and thoughts from a passionate software developer interested in all things DevOps, Continuous Delivery, Functional Programming, Distributed Systems. Also on Twitter as @mcallana.
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
Friday, June 10, 2011
Dan Pink: Team motivation
http://blog.agilegamedevelopment.com/2011/03/team-motivation.html
1. Money does not incentivise better work (except in monkey work).
2. If-then rewards often destroy productivity
3. The secret to high-performance is unseen intrinsic drive to do things because they matter
4. We already know this, the science confirms this, business ignores it
Building blocks for a new way of working:
Autonomy - The urge to direct our own lives
Mastery - The desire to get better at something that matters
Purpose - The yearning to do what we do in service of something larger than ourselves
Intinsic motivation
ROWE - Results Oriented Work Environment
No schedules - show up when you want
Just have to get their work done. How, when, where up to them.
1. Money does not incentivise better work (except in monkey work).
2. If-then rewards often destroy productivity
3. The secret to high-performance is unseen intrinsic drive to do things because they matter
4. We already know this, the science confirms this, business ignores it
Building blocks for a new way of working:
Autonomy - The urge to direct our own lives
Mastery - The desire to get better at something that matters
Purpose - The yearning to do what we do in service of something larger than ourselves
Intinsic motivation
ROWE - Results Oriented Work Environment
No schedules - show up when you want
Just have to get their work done. How, when, where up to them.
Wednesday, May 25, 2011
Haskell Syntax
(.) Function Composition
($) Application Operator - This operator is redundant, since ordinary application
($) :: (a -> b) -> a -> b
Monad functions
(>>=) Bind
(<-)
read - is sort of the opposite typeclass of Show. The read function takes a string and returns a type which is a member of Read.
read :: (Read a) => String -> a
If type can not be inferred, can use a type annotation:
let x = read "5" :: Int
::
Type annotations are a way of explicitly saying what the type of an expression should be. We do that by adding :: at the end of the expression and then specifying a type.
(since Haskell is a statically typed language, it has to know all the types before the code is compiled (or in the case of GHCI, evaluated).)
Enum, succ, pred
ghci> ['a'..'e']
"abcde"
ghci> succ 5
6
Bounded, minBound, maxBound
ghci> minBound :: Int
-2147483648
Num, Integral, Floating
fromIntegral :: (Integral a, Num b) => a -> b
data = typeclass
deriving = make type instance of typeclass
type = type synonym - doesn't make anything new just a synonym for existing type
class =
instance =
Lambda = closure
Basically anonymous functions that are used because we need some functions only once
We write \ because it looks like greek letter lambda) and then parameters separated by spaces, then -> then the function body.
Lambdas vs implicit currying (and partial application)
Both (+3) and (\x -> x + 3) are functions that take a number and add 3 to it
These two are the same:
addThree x y z = x + y + z
addThree = \x -> \y -> \z -> x + y + z
and:
flip' f = \x y -> f y x
flip' f x y = f y x
(:) cons
Put something at the beginning of a list
foldl applies a binary function to a list from the left starting with an accumulator value and the left-most value of the list
foldr applies a binary function to a list from the right starting with an accumulator value and the right-most value of the list
(the ++ function is much more expensive than : so we usually use right folds when we're building up new lists from a list.)
The foldl1 and foldr1 functions work much like foldl and foldr, only you don't need to provide them with an explicit starting value. They assume the first (or last) element of the list to be the starting value and then start the fold with the element next to it
sum = foldl1 (+)
The following are the same:
foldl (flip (:)) [] (words "hello world")
foldl (\acc x -> x : acc) [] (words "hello world")
scanl and scanr are like foldl and foldr except they show all the intermediate values in a list
Prelude> scanl (+) 0 [1,2,3,4]
[0,1,3,6,10]
Prelude> scanr (+) 0 [1,2,3,4]
[10,9,7,4,0]
(.) :: (b -> c) -> (a -> b) -> a -> c
negate . (* 3) returns a function that takes a number, multiplies it by 3 and then negates it:t negate . (* 3)
negate . (* 3) :: Num c => c -> c
negate . (* 3) :: Num c => c -> c
> let neg = negate . (* 3)
> neg 4
-12($) Application Operator - This operator is redundant, since ordinary application
(f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; ($) :: (a -> b) -> a -> b
Monad functions
(>>=) Bind
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
(>>) Then
(>>) Then
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
Inject a value into the monadic type.
Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a
do expression. (<-)
read - is sort of the opposite typeclass of Show. The read function takes a string and returns a type which is a member of Read.
read :: (Read a) => String -> a
If type can not be inferred, can use a type annotation:
let x = read "5" :: Int
::
Type annotations are a way of explicitly saying what the type of an expression should be. We do that by adding :: at the end of the expression and then specifying a type.
(since Haskell is a statically typed language, it has to know all the types before the code is compiled (or in the case of GHCI, evaluated).)
Enum, succ, pred
ghci> ['a'..'e']
"abcde"
ghci> succ 5
6
Bounded, minBound, maxBound
ghci> minBound :: Int
-2147483648
Num, Integral, Floating
fromIntegral :: (Integral a, Num b) => a -> b
data = typeclass
deriving = make type instance of typeclass
type = type synonym - doesn't make anything new just a synonym for existing type
class =
instance =
Lambda = closure
Basically anonymous functions that are used because we need some functions only once
We write \ because it looks like greek letter lambda) and then parameters separated by spaces, then -> then the function body.
Lambdas vs implicit currying (and partial application)
Both (+3) and (\x -> x + 3) are functions that take a number and add 3 to it
These two are the same:
addThree x y z = x + y + z
addThree = \x -> \y -> \z -> x + y + z
and:
flip' f = \x y -> f y x
flip' f x y = f y x
(:) cons
Put something at the beginning of a list
foldl applies a binary function to a list from the left starting with an accumulator value and the left-most value of the list
foldr applies a binary function to a list from the right starting with an accumulator value and the right-most value of the list
(the ++ function is much more expensive than : so we usually use right folds when we're building up new lists from a list.)
The foldl1 and foldr1 functions work much like foldl and foldr, only you don't need to provide them with an explicit starting value. They assume the first (or last) element of the list to be the starting value and then start the fold with the element next to it
sum = foldl1 (+)
The following are the same:
foldl (flip (:)) [] (words "hello world")
foldl (\acc x -> x : acc) [] (words "hello world")
scanl and scanr are like foldl and foldr except they show all the intermediate values in a list
Prelude> scanl (+) 0 [1,2,3,4]
[0,1,3,6,10]
Prelude> scanr (+) 0 [1,2,3,4]
[10,9,7,4,0]
Monday, May 23, 2011
Subscribe to:
Posts (Atom)