manfred dreese
Software Craftsman, Clean Coder, Senior Developer, Photographer and Cyclist << Personal Blog
Let the code speak for itself. Java 8 public class Application { public static void main(String[] args) throws IOException { Map wordCounts = Files.lines(new File("samples.txt").toPath()) .parallel() .flatMap(Pattern.compile("\\W")::splitAsStream) .filter(word -> word.length() > 6) .map(String::toUpperCase) .collect(Collectors.toConcurrentMap(w -> w, w -> 1, Integer::sum)); wordCounts.entrySet().stream() .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) .limit(20) .forEach(System.out::println); } } Golang type WordOccourences struct { word string occourcenres int } func main() { expression := regexp.MustCompile("[^a-zA-ZüäößÜÄÖ]") data, error := os.Open("samples.txt") defer data.Close() if error == nil { var wordCounts = make(map[string]int) scanner := bufio.
Continue ReadingWhile I was preparing the deployment of a private pet project, I got the impression that my approach had significant room for improvement in the front-facing reverse-proxy department. The project consists of a scalable set of microservices serving several tasks in the backend, tied together with a message bus protocol. While the backend was perfectly capable of handling its own environmental adaptions and even supports multitarget deployment perfectly, either to a Kubernetes Cluster or docker-compose on my little VPS, the situation was much worse on the frontend.
Continue ReadingMy company gave away a couple of abandoned spare devices previously used for evaluation purposes. So, I got hands on a dreamplug, a socket-plugin sized mini computer (ARM based) with decent power, low energy consumption, integrated dual Ethernet, WiFi, Bluetooth and, most important, an optical audio output - in other words: a Raspberry PI with a housing and the IO I was missing. The digital output was the primary reason for using it as an addon to my stereo.
Continue ReadingAlexa Skill development and testing with Java As the mayority of the Alexa Skill developer tutorials are focusing on Node or Python, I would like to highlight the Java way and point out some things that I missed in the official trainings and some things that I would personally have solved differently. For demonstration purposes, I wrote a simple fun application which finds crew members on the enterprise spaceship. A user could ask Alexa questions like “Where is captain Picard” or “Ask Enterprise where Captain Picard is” - so this application makes perfectly no sense, but it demonstrates everything a developer has to know to implement own basic skills.
Continue ReadingAfter various encounters and two projects which employed MQTT, I thought it was a good idea to write a summary about my experiences and my point of view. As my new job is very close to the IoT and Industry 4.0 sector, it did not take much time to encounter the hype. Once upon a time MQTT is, like AMQP, a messaging protocol for distributed systems, meaning that a node can pass a message to one or multiple other nodes.
Continue Reading