<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Scala on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/scala/</link>
    <description>Recent content in Scala on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #e9d956c0c0154a221ad83c925346a8fa0e72f866</copyright>
    <lastBuildDate>Fri, 06 May 2016 00:00:00 +0200</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/scala/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Load Testing Web Applications with Gatling and Maven</title>
      <link>https://www.hascode.com/load-testing-web-applications-with-gatling-and-maven/</link>
      <pubDate>Fri, 06 May 2016 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/load-testing-web-applications-with-gatling-and-maven/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;I have written about other performance testing tools for web applications before. Nevertheless I’d like to demonstrate a library for load testing web applications named Gatling in combination with the build tool Maven.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Gatling offers a nice Scala DSL, high performance using Akka, Netty and asynchronous IO and plug-ins for all modern build tools.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial I’m going to show how to record simulations using an HTTP proxy, rewriting simulations in Scala and running and reporting simulations with Maven.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Testing Asynchronous Applications with Java and Awaitility</title>
      <link>https://www.hascode.com/testing-asynchronous-applications-with-java-and-awaitility/</link>
      <pubDate>Sun, 23 Aug 2015 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/testing-asynchronous-applications-with-java-and-awaitility/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Writing tests for asynchronous applications has never been much fun as we’re always struggling with the problem how to determine state changes, handle process terminations, dealing with timeouts or failures and stuff like this.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Awaitility eases this process for us offering a nice DSL, rich support for languages like Scala or Groovy and an easy-to-use syntax that’s even more fun when using it with Java 8′s lambda expressions.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following short introduction I’d like to demonstrate writing some tests different scenarios.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Creating Grammar Parsers in Java and Scala with Parboiled</title>
      <link>https://www.hascode.com/creating-grammar-parsers-in-java-and-scala-with-parboiled/</link>
      <pubDate>Sun, 26 Jan 2014 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/creating-grammar-parsers-in-java-and-scala-with-parboiled/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Parboiled is a modern. lightweight and easy to use library to parse expression grammars in Java or Scala and in my humble opinion it is perfect for use cases where you need something between regular expressions and a complex parser generator like ANTLR.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial we’re going to create a simple grammar to specify a task list and write an implementation of a parser also as unit tests for each grammar rule in Java.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Using Apache Camel with Scala and the Camel Scala DSL</title>
      <link>https://www.hascode.com/using-apache-camel-with-scala-and-the-camel-scala-dsl/</link>
      <pubDate>Wed, 13 Feb 2013 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/using-apache-camel-with-scala-and-the-camel-scala-dsl/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Whenever I encounter a situation where I have to mix a blend of different services and endpoints and apply one or more of the traditional enterprise integration patterns then Apache Camel often is my weapon of choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;I simply love how easy it is to set up some datasources, add some routing magic, data transformers, load balancers, content enrichers and enjoy the result.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Another thing that I’m beginning to love is Scala and so this is the perfect time to write an article about using Scala and Apache Camel together.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>A short Introduction to ScalaTest</title>
      <link>https://www.hascode.com/a-short-introduction-to-scalatest/</link>
      <pubDate>Sun, 13 Jan 2013 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/a-short-introduction-to-scalatest/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;ScalaTest is an excellent framework to write concise, readable tests for your Scala or Java code with less effort.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In addition it integrates well with a variety of frameworks like JUnit, TestNG, Ant, Maven, sbt, ScalaCheck, JMock, EasyMock, Mockito, ScalaMock, Selenium, Eclipse, NetBeans, and IntelliJ.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following short tutorial we’re going to write some tests using ScalaTest exploring features like rich matchers, BDD syntax support or web tests using Selenium/Webdriver.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Aspects of Functional Programming in Java</title>
      <link>https://www.hascode.com/aspects-of-functional-programming-in-java/</link>
      <pubDate>Mon, 16 Jul 2012 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/aspects-of-functional-programming-in-java/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Functional programming is a trending topic these days and a lot of Java programmers are hot for the features that modern functional programming languages might offer.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Waiting for Java 8 and native closure support is a nice thing but for now we’re going to take a look at several Java frameworks that are trying to implement typical structures from those functional languages where possible using the capabilities of the Java language to emulate elements like higher-order-functions, closures, options and others …&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Snippet: Mixing Scala, Java in a Maven Project</title>
      <link>https://www.hascode.com/snippet-mixing-scala-java-in-a-maven-project/</link>
      <pubDate>Fri, 23 Mar 2012 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/snippet-mixing-scala-java-in-a-maven-project/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Having just returned from the Atlassian Camp 2012 I just toyed around with Java and Scala and wanted to share the following snippet that demonstrates how to mix code from both languages in a Maven project using the maven-scala-plugin.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_setting_up_the_maven_project&#34;&gt;Setting up the Maven Project&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;First create a new Maven project in your IDE or by running &lt;em&gt;mvn archetype:generate.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the next step, add the dependency for &lt;em&gt;scala-library&lt;/em&gt; and the scala maven repositories to your &lt;em&gt;pom.xml&lt;/em&gt; and hook the &lt;em&gt;maven-scala-plugin&lt;/em&gt; to Maven’s lifecycle. My &lt;em&gt;pom.xml&lt;/em&gt; finally looks like this one:&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Misc Snippets</title>
      <link>https://www.hascode.com/misc-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/misc-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_data_normalizing&#34;&gt;Data Normalizing&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Formula&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code&gt;newVal = (oldVal-min) / (max-min)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Ugly Scala Example&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-scala&#34; data-lang=&#34;scala&#34;&gt;package com.hascode
import scala.collection.mutable.LinkedList

object NormalizerExample extends App {
    val dataSet = LinkedList(1., 6.5, 3., 6.2, 20., 31.2, 50.2, 12., 0.24, 1.224, 2.2, 3.)
    for ((num, index) &amp;lt;- dataSet.zipWithIndex) {
        dataSet(index) = (num - dataSet.min) / (dataSet.max - dataSet.min)
    }
    println(&amp;#34;Normalized: &amp;#34; + dataSet)
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;Normalized: LinkedList(0.01521216973578863, 0.12921819759798853, 0.05947594797769014, 0.12324029048767723, 0.3982240175619966, 0.6213992163469515, 1.0, 1.0, 0.07531115879828326, 0.40498283261802576, 0.7319742489270387, 1.0)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Scala Snippets</title>
      <link>https://www.hascode.com/scala-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/scala-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_sbt_eclipse_plugin&#34;&gt;SBT – Eclipse Plugin&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Add to your &lt;code&gt;~/.sbt/plugins/plugins.sbt&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-scala&#34; data-lang=&#34;scala&#34;&gt;addSbtPlugin(&amp;#34;com.typesafe.sbteclipse&amp;#34; % &amp;#34;sbteclipse-plugin&amp;#34; % &amp;#34;2.1.1&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
