This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.technologyconversations.java8exercises.streams; | |
import java.util.*; | |
import static java.util.stream.Collectors.*; | |
public class Partitioning { | |
public static Map<Boolean, List<Person>> partitionAdults7(List<Person> people) { | |
Map<Boolean, List<Person>> map = new HashMap<>(); | |
map.put(true, new ArrayList<>()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.technologyconversations.java8exercises.streams; | |
import org.junit.Test; | |
import java.util.List; | |
import java.util.Map; | |
import static com.technologyconversations.java8exercises.streams.Grouping.*; | |
import static java.util.Arrays.asList; | |
import static org.assertj.core.api.Assertions.assertThat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.technologyconversations.java8exercises.streams; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import static java.util.stream.Collectors.*; | |
public class Grouping { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.technologyconversations.java8exercises.streams; | |
import org.junit.Test; | |
import java.util.List; | |
import static com.technologyconversations.java8exercises.streams.Joining.namesToString; | |
import static java.util.Arrays.asList; | |
import static org.assertj.core.api.Assertions.assertThat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.technologyconversations.java8exercises.streams; | |
import java.util.List; | |
import static java.util.stream.Collectors.joining; | |
public class Joining { | |
public static String namesToString7(List<Person> people) { | |
String label = "Names: "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
remote_user: vagrant | |
sudo: yes | |
roles: | |
- etcd | |
- confd | |
- docker | |
- nginx | |
- bdd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Docker is present | |
apt: name=docker.io state=present | |
tags: [docker] | |
- name: Python-pip is present | |
apt: name=python-pip state=present | |
tags: [docker] | |
- name: Docker-py is present | |
pip: name=docker-py version=0.4.0 state=present | |
tags: [docker] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: TOML is present | |
copy: | |
src=bdd.toml | |
dest=/etc/confd/conf.d/bdd.toml | |
tags: [bdd] | |
- name: Config template is present | |
copy: | |
src=bdd.conf.tmpl | |
dest=/etc/confd/templates/bdd.conf.tmpl | |
tags: [bdd] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BLUE_PORT=9001 | |
GREEN_PORT=9002 | |
CURRENT_COLOR=$(etcdctl get /bdd/color) | |
if [ "$CURRENT_COLOR" = "" ]; then | |
CURRENT_COLOR="green" | |
fi | |
if [ "$CURRENT_COLOR" = "blue" ]; then | |
PORT=$GREEN_PORT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.synced_folder ".", "/vagrant" | |
config.vm.provider "virtualbox" do |v| | |
v.name = "books-service" |