The Holy Java

Building the right thing, building it right, fast

Archive for June, 2015

NDC Oslo 2015: Talk notes, recommended talks (security, FP, etc.)

Posted by Jakub Holý on June 19, 2015

A great conference. A good deal of good talks.

To (perhaps) check later

Wednesday

Thursday

Friday

Keynote Data and Goliath ☆☆☆☆

Read the rest of this entry »

Advertisements

Posted in General | Comments Off on NDC Oslo 2015: Talk notes, recommended talks (security, FP, etc.)

Notes from Troy Hunt’s Hack Yourself First workshop

Posted by Jakub Holý on June 17, 2015

Troy Hunt (@troyhunt, blog) had a great, very hands-on 2-day workshop about webapp security at NDC Oslo. Here are my notes.

Highlights – resources

Personal security and privacy

Site security

Breaches etc.

To follow

Read the rest of this entry »

Posted in General | Tagged: , | 1 Comment »

Example: Functional Reactive Programming decisively beats Imperative on simplicity, length

Posted by Jakub Holý on June 17, 2015

@theburningmonk Yan Cui has a nice example demonstrating how Functional Reactive Programming [slides 185 – 206] (with Elm’s Signals) yields a much shorter and easier to understand (one you know FRP) code than an imperative code with mutations spread all over the code base.

The game

Use the Up and Down keys to move the platforms and thus bounce the ball from left to right and back:

screenshot-game

The imperative solution

Read the rest of this entry »

Posted in Languages | Tagged: , | Comments Off on Example: Functional Reactive Programming decisively beats Imperative on simplicity, length

NDC: Async and Streaming JavaScript, We’re All Doing it Wrong! (Promises, Streams, Rx)

Posted by Jakub Holý on June 17, 2015

By Matthew Podwysocki

Events

Lot of work (setup, remove listeners …), not composable.

Promises

No way to abort promise in progress. (Me: has to remember to check for errors: then(onOk, onError).)

No try-catch-finally; only try-catch.

Streams

Node: Stream 1 were terrible (pause/resume unusable, data sent before ready, …).

Read the rest of this entry »

Posted in Uncategorized | Comments Off on NDC: Async and Streaming JavaScript, We’re All Doing it Wrong! (Promises, Streams, Rx)

Why do companies fail at adopting Functional Programming?

Posted by Jakub Holý on June 17, 2015

According to the NDC Oslo talk Lean and Functional Programming by Bryan Hunter, these are the reasons why companies fail to adopt FP:

  • They say “our developers aren’t smart enough” (to use F#, Erlang) [they should invest in their education!]
  • Culture of hiding problems => little incentive to adopt a paradigm that solves/prevents them if they’re invisible
  • Overburden => not time
  • Implementing changes (FP) without first proving them (PDCA) – blindly rewriting something in F#/… can fail; it’s better to have a value-proposition hypothesis and prove it with a limited experiment first
  • The prioritise short-term (e.g. fire-fighting) over long-term (removing the root causes of problems)

Tip for driving FP adoption: Find a pragmatist in pain – e.g. a business person experiencing problems that FP could have prevented.

Posted in Uncategorized | 1 Comment »

AWS API: Proper syntax for filtering by tag name and value (e.g. describeInstances)

Posted by Jakub Holý on June 11, 2015

It took me quite a while to figure out the right syntax for filtering instances by tag name and value in the AWS EC2 API’s describeInstances.

The documentation is not exactly crystal-clear to me:

  • tag:key=value – The key/value combination of a tag assigned to the resource, where tag:key is the tag’s key.

Anyway, here is the proper syntax, provided we are interested in the tag elasticbeanstalk:environment-name:

    var params = {
        Filters: [
            {
                Name: 'tag:elasticbeanstalk:environment-name',
                Values: ['mySuperApp']
            }
        ]
    };
    ec2.describeInstances(params);

So the name of the tag is embedded in the Name part and not, as I initially understood,
{ Name: 'tag', Values: ['elasticbeanstalk:environment-name=mySuperApp'] }

Credit: garnaat.

Posted in [Dev]Ops | Tagged: , | Comments Off on AWS API: Proper syntax for filtering by tag name and value (e.g. describeInstances)

Mounting an EBS volume to Docker on AWS Elastic Beanstal

Posted by Jakub Holý on June 2, 2015

Mounting an EBS volume to a Docker instance running on Amazon Elastic Beanstalk (EB) is surprisingly tricky. The good news is that it is possible.

I will describe how to automatically create and mount a new EBS volume (optionally based on a snapshot). If you would prefer to mount a specific, existing EBS volume, you should check out leg100’s docker-ebs-attach (using AWS API to mount the volume) that you can use either in a multi-container setup or just include the relevant parts in your own Dockerfile.

The problem with EBS volumes is that, if I am correct, a volume can only be mounted to a single EC2 instance – and thus doesn’t play well with EB’s autoscaling. That is why EB supports only creating and mounting a fresh volume for each instance.

Read the rest of this entry »

Posted in General | Tagged: , , , | Comments Off on Mounting an EBS volume to Docker on AWS Elastic Beanstal