0
votes
0answers
39 views

Call a REST API of a module controller in a play application

i'm writing a Play 2.3.2 application. I've the main application written in Java, and a module used by the main application written in Scala. My module application provides some REST API that get the ...
2
votes
1answer
34 views
+150

Starting a WebAppContext in isolation

I am trying to start a Jetty server with a web context. The web.xml that I am passing contains a custom class that is (for different reasons) on the classpath of the code executing the code below. I ...
0
votes
1answer
56 views

Error using Spring, Play Framework, Hibernate and MySql

I'm a long time trying to turn the architecture play-spring-hibernate but everytime I try the the following error: I've tried reset and reconfigure often. Is it that I am missing some dependency? ...
1
vote
4answers
191 views

High performing set like data structure for array of ints for java

I'm looking for a high performing data structure that behaves like a set and where the elements will always be an array of ints. The data structure only needs to fulfill this interface: trait SetX { ...
0
votes
2answers
16 views

Constraints on core libraries in sbt

Is there any way to create constraints on core libraries in sbt? for example: I don't want anyone to use the Java Date Class, is there a way to create compilation errors/warnings for all direct ...
0
votes
0answers
46 views

I work with Java, however I have heard that many companies adapting and now using Scala for web services - why is it being used for web services? [on hold]

I work with Java, however I have heard that many companies adapting and now using Scala for web services. Why is Scala being used and in which use cases? If I wanted to use Scala within a simple Java ...
0
votes
1answer
41 views

Convert java.math.BigDecimal to scala.math.BigDecimal?

I am trying to convert a java.math.BigDecimal to a scala.math.BigDecimal, and I can't find a method to do it. I've tried to convert a List[BigDecimal] in the following way, ...
-2
votes
0answers
22 views

Play2 Framework Many To Many in Template

In time I'm trying to create a Many to Many relation. Here's my Code: The Models At first the model for an Order @Entity public class Order extends Model { @Id @Constraints.Required ...
1
vote
0answers
54 views

Explain Kinesis Shard Iterator - AWS Java SDK

OK, I'll start with an elaborated use-case and will explain my question: I use a 3rd party web analytics platform which utilizes AWS Kinesis streams in order to pass data from the client into the ...
4
votes
2answers
5k views

Play! framework: define a variable in template?

I'm passing to a template an Event object and what I need to do is checking @event.getSeverity value. if the value is positive, I want to color a specific <div> in green. if the value is ...
6
votes
2answers
295 views

Which languages support Lenses or similar way to update immutable nested structures?

While immutability praised by many, I found it hard to maintain in mainstream programming. In my experience, programmers sooner than later will make fields mutable again to avoid refactoring large ...
0
votes
1answer
23 views

NodeSq does not conform to expected type integer

I cannot resolve scala xml value to integer. How to fix it? Error: NodeSq does not conform to expected type integer Code: import scala.io._ import scala.xml._ object Weather { def main(args: ...
17
votes
0answers
2k views

Markdown to HTML with Java/Scala [closed]

I am aware of following projects (mostly from http://www.w3.org/community/markdown/wiki/MarkdownImplementations): implemented in Java: txtmark http://github.com/rjeschke/txtmark (claims to be ...
3
votes
1answer
130 views

Akka Design Principals

Whilst working on a fairly large Akka application, I have come across a very simple structure when working with normal methods and non Akka classes but which are actually quite difficult to nail when ...
0
votes
1answer
49 views

How to generate a PDF output from a template PDF using something other than iText?

I'm working on a small Scala/Java prototype where I have several PDF templates i.e. they have text and image placeholders and the placeholders should be replaced with some content. Some sections are ...
-1
votes
0answers
46 views

Generating simple graphs with arrows in SVG [on hold]

I am looking for a library that allows me to generate simple dependency graphs such as the following in the SVG file format (alternatively, also PNG): As I want to embed the generation in a Scala ...
1
vote
2answers
92 views

Port scanning in Scala: Application hangs for a closed port on the remote host

I've been trying to create an application which needs to scan open ports on a network (mostly LAN) as fast as possible. I searched around and one great method that I found uses the following code: ...
10
votes
2answers
13k views

Byte array to String and back.. issues with -127

In the following: scala> (new String(Array[Byte](1, 2, 3, -1, -2, -127))).getBytes res12: Array[Byte] = Array(1, 2, 3, -1, -2, 63) why is -127 converted to 63? and how do I get it back as -127 ...
1
vote
4answers
165 views

Java Play: bindFromRequest() not working

I'm experimenting with Java Play and I've hit an immediate roadblock. The situation is quite straightforward and the setup, simple. I have a model class called Person that is very simple and looks ...
0
votes
1answer
68 views

Generating a Random Type 1 UUID from a Unix Timestamp for use with Cassandra

Is it possible to generate a Type 1 UUID in Scala/Java (for use in Cassandra) from a particular Unix timestamp such that it could be used to obtain range slices of records, and individual records from ...
0
votes
1answer
39 views

Creating a scala object from java: The constructor is undefined

I'm a novice in scala, so, sorry for a newby question :) When I was trying to create a scala object in a Java class: MyScalaObj mySo = new MyScalaObj(); I got error The constructor MyScalaObj() is ...
1
vote
1answer
72 views

Advantage of asynchronous libraries

I was going through the twitter finagle library which is an asynchronous service framework in scala and I have some question regarding asynchronous libraries in general. So as I understand, the ...
0
votes
1answer
35 views

Integrate R in java web application

I know there are multiple questions resembling this one but most of them are >2 years old and actually not that related. What I need to do is fully integrate the R environment in an existing java ...
-3
votes
1answer
47 views

Creating a dynamic website for kids (shape patterns, math, science, etc) [closed]

Can I build it in Java or Scala? I had been learning Java for about a year and I will like to use this project to show future employers. Any suggestions perhaps frameworks,IDE's, libraries, design, or ...
97
votes
26answers
157k views

Calculating the Difference Between Two Java Date Instances

I'm using Java's java.util.date class in Scala and want to compare a date object and the current time. I know I can calculate the delta by using getTime(): (new java.util.Date()).getTime() - ...
0
votes
1answer
49 views

ClassNotFoundException: HelloStageDemo

The code I'm running is from the homepage of http://www.scalafx.org. There are no compiler warnings but when it runs I get the exception. I first tried using jdk 1.7 with Scala 2.11 and ScalaFX ...
0
votes
0answers
10 views

Java/Scala library to load font file and generate draw commands

Is there a java or scala library which can load a font file (ttf, otf, etc) and provide enough information to actually draw the font, including things like kerning? It should also provide information ...
0
votes
1answer
49 views

Message not being sent when Akka actor is killed using DeathWatch

I'm attempting to send a message when an actor is killed. This is based on Akka deathwatch documentation : http://doc.akka.io/docs/akka/2.3.6/java/untyped-actors.html#deathwatch-java In ...
8
votes
4answers
5k views

Is there a nice, safe, quick way to write an InputStream to a File in Scala?

Specifically, I'm saving a file upload to local file in a Lift web app.
6
votes
1answer
111 views

Does Akka's event bus guarantee message order?

I would like to keep the order the events entered the bus. For example if event1 then event2 where entered to the bus then a subscribed actor would get them in that order. The question is if such ...
0
votes
1answer
48 views

What is a standard location for Typesafe Config file in a project directory structure?

I'm a newbie to Scala and the JVM. I've created a project via Typesafe Activator, and I'm adding configuration to it using Typesafe Config. The documentation for Typesafe Config says that I can put ...
6
votes
4answers
2k views

Perfomance of scala for android

I just started learning scala, and i'm having the time of my life. Today i also just heard about scala for android, i'm totally hooked. However, considering that scala is kind of like a super set of ...
0
votes
1answer
37 views

Quickest, easiest way to acces (English) 'dictionary' in a Java/Scala-based app, using PostgreSQL, in Linux?

I have a Scala-based application (which thus has access to standard Java stuff), leveraging a PostgreSQL database, running on Linux. I mention the database and OS because, I know Postgres has some ...
2
votes
1answer
61 views

“Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar” when starting the Scala interpreter

When running the Scala interpreter in Ubuntu 14.04, I get the following message printed as the first line: Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar Followed by the ...
0
votes
1answer
24 views

error while loading CharSequence, AnnotatedElement from Java 1.8 and Scala 2.11

I tried to play with tmt from stanford NLP lab. After I installed scala and ran the script, it showed: error: error while loading CharSequence, class file ...
0
votes
2answers
47 views

Is there anything like “Java shared libraries” for minimizing disk footprint of deployed applications?

Let's imagine, I created a bunch of command line utilities, written in Scala and/or Java, and I'm using SBT to build them. They all use a couple of libraries, some of them pretty big, and in case of ...
0
votes
0answers
19 views

Find filename from local repository with sbt

In SBT, I would like to add a task to start a JVM with AspectJ agent weaver. I would like to declare a dependency libraryDependencies ++= Seq("org.aspectj" % "aspectjweaver" % aspectjVersion.value % ...
0
votes
1answer
45 views

sbt 0.13.1 multi-project module not found when I change the sbt default scala library to scala 2.11.2

I use the sbt 0.13.1 create the two modules, and I create project/MyBuild.scala to compile this two modules. MyBuild.scala: import sbt._ import Keys._ object MyBuild extends ...
0
votes
1answer
29 views

How to set amount of Spark executors?

How could I configure from Java (or Scala) code amount of executors having SparkConfig and SparkContext? I see constantly 2 executors. Looks like spark.default.parallelism does not work and is about ...
21
votes
3answers
955 views

Java 8 parallel sorting vs Scala parallel sorting

So I was just learning new Java 8, specially lambdas and date and time api. I was comparing it with scala. My basic idea was to find the execution time difference between imperative, Stream and ...
0
votes
1answer
21 views

DeploymentException with WebSockets, TyrusServer

set 26, 2014 5:13:00 PM org.glassfish.tyrus.core.AnnotatedEndpoint callMethod INFO: Exception thrown from onError method public void ...
6
votes
2answers
204 views

Memory leak in Scala and processes

I have a system in Scala, with a lot of simultaneous threads and system calls. This system has some problem, because memory usage is increasing over time. The image bellow shows the memory usage for ...
1
vote
1answer
74 views

PHP vs Scala / Akka for high performance & scaling [closed]

I really need some help with this. I'm currently developing a web application that needs to be server scalable , fast and cpu intensive (generating reports from million of rows in Riak DB) Can PHP ...
0
votes
1answer
50 views

Mixed Scala/Java will not compile, error: cannot access

I have a problem with a mixed scala/java project and getting everything to compile. I am using both the scala-maven-plugin and the maven-compiler-plugin as suggested on many sites like ...
15
votes
4answers
4k views

Enforcing Java version for Scala project in sbt?

My scala application will only run with Java 7 as it depends on libraries that only appeared in that version of the JDK. How do I enforce that in sbt, so that the correct error message is shown ...
1
vote
3answers
102 views

Is there an equivalent of Scala's Either in Java 8?

Just like java.util.Optional<T> in Java 8 is (somewhat) equivalent to Scala's Option[T] type, is there an equivalent to Scala's Either[L, R]?
1
vote
0answers
45 views

Play Framework 2.3: using scala action composition in java controller

For reasons stemming from this question I need to write a custom action composition in scala that can be then used in java controller, something like this: LogAction.scala (Scala Custom Action ...
0
votes
1answer
49 views

Limit number of active threads/cores a JVM can use [duplicate]

I have a piece of code in Scala (using Java execution context) that spawns many threads. Also I have an 8 core CPU. When the process runs it uses up all the juice my computer has and I cannot do ...
1
vote
2answers
69 views

Wait for an actor response indefinitely in a future akka java

I have a non-actor-based piece of code which delegates some operations to an akka actor and I would like to wait this actor response indefinitely, I mean, until this actor returns a response whatever ...
1
vote
2answers
326 views

Convert Scala Any to Java Object

I've a problem using Java Reflection from Scala. My Code: case class MyClass(id: String, value: Double) def create(values: Map[String, Any]): MyClass = { val constructor = ...