Skip to content

Instantly share code, notes, and snippets.

View oliverjumpertz's full-sized avatar
🏠
Working from home

Oliver Jumpertz oliverjumpertz

🏠
Working from home
View GitHub Profile
@oliverjumpertz
oliverjumpertz / readStdIn.js
Last active May 9, 2020 17:38
readStdIn is an awaitable naive function which reads all input from stdin as a single, new-line preserved string,
import readline from 'readline';
async function readStdIn() {
return new Promise((resolve, reject) => {
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
let input = '';
rl.on('line', (line) => {
input += line;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>aGroupId</groupId>
<artifactId>test-jar-resources</artifactId>
<version>1.0-SNAPSHOT</version>
package de.oliver;
import javaslang.collection.List;
public class SquareOfNumberCalculator {
public static void main(String[] args) {
final List<Integer> myList = List.range(1, 6);
final List<Integer> squaredNumbers = myList.map(i -> i * i);
System.out.println("Printing original numbers");
myList.forEach(i -> System.out.println(" i --> " + i));