Scala is a general purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles. Its key features are: statically typed; advanced ...
0
votes
0answers
6 views
How to achieve MVP or MVC in Scala-Swing?
Does anybody know some well-written sample projects showing how to achieve MVP or MVC architecture in Scala+Swing?
1
vote
0answers
25 views
Generate Scala code from Antlr
I used to use Antlr4, and hence the grammar generates the Lexer and Parser and all the classes in Java.
How can I make my ANTLR grammar generate Scala code instead of Java code !?
1
vote
0answers
6 views
Scala MongoDB Chaining Methods
i'd like to ask for your help about beautifying client code.
Let's say I have some basic methods for MongoDB retrieval:
def find(dbo:DBObject):MongoCursor =
mongoColl.find(dbo)
def ...
0
votes
0answers
18 views
Methods containing bang doesn't work in REPL
I am running Scala 2.9.2 REPL and if I copy&paste following method:
def isPrime(num: Int): Boolean = {
val ceiling = math.sqrt(num.toDouble).toInt
(2 to ceiling) forall (x => num % x ...
0
votes
0answers
17 views
Odd behaviour reading an entire collection using Reactivemongo in Play Framework 2
I have the following code:
def all: String = {
val query = BSONDocument("name" -> BSONDocument("$ne" -> "allDocs"))
val cursor = carsCollection.find(query).cursor[BSONDocument]
...
0
votes
0answers
6 views
Facing problems with Play2.x and the new newRelic javaagent
Tried the newrelic javaagent for Play2.x with versions 2.1.1 and 2.1.2 with scala
When I deploy my application with the newrelic javaagent my app gradually slows down and becomes unresponsive after a ...
5
votes
1answer
141 views
Is it posible to create per-instance mixins in C++11?
Is it posible to create mixins in C++ (C++11) - I want to create behavior per instance, not per class.
In Scala I'd do this with anonymous classes
val dylan = new Person with Singer
0
votes
0answers
12 views
How to deal with a large number (20+) of SettingKeys related to a TaskKey?
I'm currently in the process of finishing the SBT plugin for Flyway.
Flyway has 6 basic commands which will map to 6 TaskKeys.
These can be configured by a large number of setters (20+) on the ...
1
vote
1answer
32 views
why a class name is given before a code block in scala?
I am new to scala, went through some tutorials and in one sample i came across
object DataController extends SomeOtherController with Controller {
...
def testPage = SomeOtherAction { implicit ...
1
vote
3answers
43 views
Using a variable in finally block
Here is code in Scala:
def write() = {
try {
val out = new PrintWriter(new BufferedWriter(new FileWriter(fileName, true)))
out.println("123")
out.close
} catch {
case ...
0
votes
1answer
13 views
Used Scala with Lift-Json working fine but why performance is varying?
I used Scala with Lift-Json and working fine.
when i am testing with Dummy Data for Performance check, i am getting different figures means not comparable.
here goes my performance check
Data in ...
0
votes
0answers
52 views
Java vs Scala for multi-threaded app server [on hold]
I have to implement a higly multi-threaded application server.
I have worked as a Java back-end engineer for a year, but still have no experience of multi-threading in an actual product, so I need ...
1
vote
2answers
28 views
How is the synchronized method on AnyRef implemented?
In Scala, there's a synchronized method on AnyRef which lets you synchronize on any object that extends AnyRef. However, it's abstract on AnyRef, and I couldn't figure out how it worked from grepping ...
0
votes
1answer
27 views
Using Scala's Play & Slick with two form (validation & insertion)
This is what I got:
Controller
val form = Form(
mapping(
"id" -> optional(number),
"name" -> optional(nonEmptyText),
"supID" -> number,
"price" -> ...
0
votes
1answer
5 views
Slick table Query: Trouble with recognizing values
Can anyone tell me why in this case:
Query(Users) foreach {case (userId, userName) =>
println(userId + ", " + userName) }
Scala recognizes userId, but in this case:
val l = ...