Let's play around with persistent volumes on GKE.
$ gcloud init
<output_omitted>
If you are playing around with Kafka you, probably, would prefer to use containers. But, for some reason, you may want to use VMs instead. With this Vagrant script you can get a cluster installed and configured locally with a few steps.
Note that this script doesn't use the most recent version of Kafka. But you can change the version by changing the lines 12
and 13
of the script. Check the Confluent Platform and Apache Kafka Compatibilty table for details.
Install Virtual Box https://www.virtualbox.org/
Install Vagrant >= 1.6.4 http://www.vagrantup.com/
The task we want to accomplish in this example is, given a URL and a file system path, download the document content and save it in the file system.
Let's begin our example by using the modules request
and fs
to perform the task directly:
const request = require('request')
const fs = require('fs')
package com.todevornot.hncounter | |
import com.rometools.rome.io.SyndFeedInput | |
import com.rometools.rome.io.XmlReader | |
import java.net.URL | |
val HN_URL = URL("https://news.ycombinator.com/bigrss") | |
fun main(args: Array<String>) { |
buildscript { | |
ext { | |
versions = [ | |
gradle : '3.2.1', | |
springBoot : '1.4.3.RELEASE', | |
springfox : '2.6.1', | |
lombok : '1.16.10', | |
lombok_plugin : '1.6', | |
commons_io : '2.5', | |
commons_lang : '3.4', |
Integer[] array = {1, 1, 1, 2, 2, 2, 4, 4, 1, 1, 2, 5, 5,}; | |
Map<Integer, Long> collect = | |
Arrays.stream(array).collect( | |
Collectors.groupingBy(Function.identity(), Collectors.counting())); |
double fixedCost = 0.1; | |
double variableCost = 0.7; | |
double totalCost = fixedCost + variableCost; | |
System.out.println(totalCost); | |
//output: 0.7999999999999999 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import feedparser, operator | |
import re | |
from stop_words import get_stop_words | |
from time import gmtime, strftime | |
stop_words = get_stop_words('en') | |
OUTPUT_FOLDER = 'out/' |
package br.com.soeirosantos; | |
import java.util.LinkedList; | |
import java.util.Queue; | |
import java.util.Stack; | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println(isAlmostPalindrome("abcddcba", 0)); |
#!/bin/bash | |
#Title : wildfly-install.sh | |
#Description : Script to install Wildfly 8.x on CentOS 7 | |
#Original script: http://sukharevd.net/wildfly-8-installation.html | |
# This version is the only variable to change when running the script | |
WILDFLY_VERSION=8.2.1.Final | |
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION | |
WILDFLY_ARCHIVE_NAME=$WILDFLY_FILENAME.tar.gz |