Friday, June 24, 2011

Language Classifications

Strict (call-by-value)
Lazy (call-by-need)
Pure
Static
Dynamic
Duck-typed
Functional
Object-oriented













LanguagePureStrictNon-Strict (Lazy)
HaskellYesNoYes
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.html

Variables are variable:
# let p = 10 ;;
val p : int = 10
# let k x = (x, p, x+p) ;;
val k : int -> int * int * int =
# k p ;;
- : int * int * int = 10, 10, 20
# let p = 1000 ;;
val p : int = 1000
# k p ;;
- : 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: type suit = Spades | Hearts | Diamonds | Clubs ;; 
  Constructor with Args: type card = King of suit | Queen of suit | Knight of suit | Knave of suit | Minor_card of suit * int | Trump of int | Joker ;;
Recursive Types
Parameterised Types: type ('a, 'b) list2 =

Thursday, June 16, 2011

Hindley-Milner Type Inference

http://www.codecommit.com/blog/scala/what-is-hindley-milner-and-why-is-it-cool

http://dysphoria.net/2009/06/28/hindley-milner-type-inference-in-scala/

Scala not a functional programming language

http://enfranchisedmind.com/blog/posts/scala-not-functional/

Scala foldLeft and map

Scala foldLeft and map

http://stackoverflow.com/questions/2293592/functional-programming-scala-map-and-fold-left

Emulating structural pattern matching over algebraic data types in Java

http://apocalisp.wordpress.com/2009/08/21/structural-pattern-matching-in-java/

http://apocalisp.wordpress.com/category/programming/java/

FizzBuzz links

Scala: http://www.virtuousprogrammer.com/?p=153

http://en.wikipedia.org/wiki/Bizz_buzz

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?

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

  1. Checkbook commitment
    1. Unengaged – just do it
  2. Culture that doesn’t support change
    1. “Follow the plan”
    2. Need to change the metrics
    3. Best practices… good practices… emergent practices
    4. 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
  1. Ineffective use of retrospectives
    1. “This sucks” threshold  – if nothing’s gonna change, why bother?
    2. Should ask:
                                                               i.      What are we doing well?
                                                             ii.      What’s not serving us as a team?
                                                            iii.      What would we change to improve?
    1. No retrospective
    2. There is absolutely nothing wrong
    3. No action
  1. Stable environment?
  2. TANSTAAFL – There ain’t no such thing as a free lunch
    1. Will work for infrastructure
  3. Lack of full planning participation
    1. Waiting for decisions = waste
    2. Conversation
    3. Unavailable product owner
    4. Too many product owners
    5. Too busy for all the communicating
    6. Product owner = hardest role. What does product owner get out of it?
    7. Commitment with team
  4. Bad scrum masters
    1. Command and control
                                                               i.      Telling people what to do = Low morale and lower IQs
                                                             ii.      Cognitive abilities approve the more decisions we make
    1. Servant Leader
                                                               i.      Serve and facilitate
                                                             ii.      Remove impediments
  1. Not having an onsite evangelist
  2. Team lacking
    1. Red tape decisions
    2. Not forming, storming, norming, performing
  3. Testing not pulled forward
    1. Pushed to deliver
    2. Increased defects
    3. Failure-demand work vs value-demand work
    4. Piled up trash
    5. Stop the line
  4. Traditional performance appraisals
    1. Manager’s yearly evaluation
    2. Individual heroics rewarded – holds back agile success
    3. Frequent team evaluation
  5. Reverting to form
    1. Change is hard

“Drive” Daniel Pink

Saturday, June 11, 2011

Monads for Java Programmer

http://irekjozwiak.com/entry/2009/06/13/Monads-for-Java-C---programmers.html

(>>=) 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.

Wednesday, May 25, 2011

Haskell Syntax

(.) Function Composition
(.) :: (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
> 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

(>>=) :: forall a b. m a -> (a -> m b) -> m bSource
Sequentially compose two actions, passing any value produced by the first as an argument to the second.

(>>) Then
(>>) :: forall a b. m a -> m b -> m bSource
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

return :: a -> m aSource
Inject a value into the monadic type.

fail :: String -> m aSource
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]