Search Discussions
-
After looking at dozens and dozens of example of Scala code all over the net, I have noticed that most people have a STRONG aversion to publishing complete and/or tested code examples. In particular, ...
Eric Kolotyluk
Jun 3, 2015 at 9:13 pm
Jun 11, 2015 at 6:47 pm -
I'm trying to use Scala's new reflection mechanism. (I've experience using Java's reflection.) There's an example in the documentation that goes like this: def getType[T: TypeTag](obj: T) = typeOf[T] ...
Michel Charpentier
Jun 1, 2015 at 8:44 pm
Jun 4, 2015 at 10:34 pm -
Hi all, Let's say I have a List[Item] where each Item has an Id (which has a length). I have code that creates a Map[Id, Item]: def createIdToItemMap(items : List[Item]) : Map[Id, Item] = { ( for { ...
Hilco Wijbenga
Jun 15, 2015 at 1:27 am
Jun 16, 2015 at 5:09 pm -
I have an fairly complex immutable object - let's call it a Plan Now I wish to query my plan with an expensive to compute operation - let's call it: lazy val summary : Summary where Summary is itself ...
Tim P
Jun 23, 2015 at 1:25 pm
Jun 24, 2015 at 7:23 am -
Hello All I am learning Scala and as recommended working on S99 problem set. I wanted to get a quick code review done for problem *P03 <http://aperiodic.net/phil/scala/s-99/p03.scala (*) Find the Kth ...
Harit Himanshu
Jun 7, 2015 at 5:16 am
Jun 7, 2015 at 8:10 pm -
I tried to define an *Either* that was invariant in its type parameters: scala trait Maybe[A, B] defined trait Maybe scala case class MyRight[A](x: A) extends Maybe[Nothing, A] defined class MyRight ...
Kevin Meredith
Jun 10, 2015 at 1:47 pm
Jun 12, 2015 at 8:17 am -
7
[scala-user] Does "extends AnyVal" on extension-method implicit classes actually help? Benchmarks?
Hi, Are there any performance benchmarks available for adding "extends AnyVal" to "extension method" implicit classes? The docs appear to recommend this approach, see ...Richard Bradley
Jun 29, 2015 at 2:22 pm
Jun 30, 2015 at 9:00 pm -
Hi all, I’ve published version 0.1.0 of subscala <https://github.com/fsist/subscala , a macro which restricts the methods that can be called by the code passed to it, and the syntactic features the ...
Daniel Armak
Jun 28, 2015 at 11:27 am
Jun 29, 2015 at 7:00 pm -
Can the Scala XML library produce html or xml with attributes without equals sign like <div bar foo id="test" <div Thanks -- You received this message because you are subscribed to the Google Groups ...
DoomPirate
Jun 22, 2015 at 1:30 am
Jun 23, 2015 at 7:20 am -
Hello, What's the best way to convert a java.net.InetSocketAddress to a java.net.URL? Thanks! Best, Oliver -- Oliver Ruebenacker Solutions Architect at Altisource Labs <http://www.altisourcelabs.com/ ...
Oliver Ruebenacker
Jun 5, 2015 at 8:59 pm
Jun 7, 2015 at 1:06 pm -
In their blog post <http://www.cakesolutions.net/teamblogs/2012/09/03/existential-types on the subject, Cake Solutions presents the following snipped as an example of existential types in action ...
Josh Hagins
Jun 29, 2015 at 7:42 pm
Jun 30, 2015 at 12:29 am -
What is the recommended style for an Enumeration with many values? For example, which of the following is preferred: object ErrorCode extends Enumeration { val WRONG_PASSWORD, ...
Josh Hagins
Jun 24, 2015 at 4:11 pm
Jun 25, 2015 at 8:19 pm -
Hello I am writing a passing around values as implicit arguments. These arguments are set when I enter my code, and contain things like database sessions, authentication and configurations. Pretty ...
Peter Wolf
Jun 12, 2015 at 3:42 pm
Jun 12, 2015 at 8:47 pm -
Hello The method signature looks like def f(num:Int,arr:List[Int]):List[Int] = so my solution(which works) looks like def f(num:Int,arr:List[Int]):List[Int] = arr flatMap(e = for(i <- 1 to num) yield ...
Harit Himanshu
Jun 9, 2015 at 4:15 am
Jun 9, 2015 at 2:50 pm -
6
[scala-user] Is it possible to consider deprecation warnings not fatal when -Xfatal-warnings is on?
Hello. We are building our project with -Xfatal-warnings and -deprecation:false flags. Scala version is 2.11.6. It would be nice to see deprecation warnings, but in this case project would not ...Eax Melanhovich
Jun 8, 2015 at 9:29 am
Jun 8, 2015 at 8:53 pm -
Hello, I am a beginner in Scala.I installed Scala Eclipse IDE, created simple program and trying to run it. But when I click Run As it doesn't show "run as Scala app", how can I fix it? I attach ...
Alex
Jun 22, 2015 at 9:47 am
Jun 23, 2015 at 11:54 am -
I have a simple function : def find ( n : Int ) : Int = if ( n <= 2 ) 0 else n - 2 + find ( n - 1 ) It is throwing StackOverflowError for n = 10^4. Can't we use Scala for these type of problems or am ...
Sunil Rathee
Jun 16, 2015 at 5:31 pm
Jun 18, 2015 at 9:57 am -
Hi all; I'm having a look at Regular Expression in scala - and wondering if I'm missing what the equivalent of 'modifiers' (from PHP or Java) are? From https://regex101.com/#pcre ...
Brent Gracey
Jun 16, 2015 at 3:49 pm
Jun 17, 2015 at 3:09 pm -
Hi everyone, I wrote a fairly big macro using macro annotations and would like to write tests for it. Unit tests as well as Tests where I check the generated AST would be nice. For Unit tests I would ...
Felix Dietze
Jun 1, 2015 at 12:48 am
Jul 11, 2015 at 12:37 pm -
Hello, I have the following code, which compiles: trait Transcode[A, B] { def transcode(value: A): B } trait A trait B trait C trait D trait E trait PrimitiveTranscode[A, B] extends Transcode[A, B] ...
John Ky
Jun 29, 2015 at 3:33 am
Jul 2, 2015 at 9:17 am -
Hi, I have some methods which I need to do branching logic based on the fact whether the incoming object is a java class or a scala class. for example: ( the java class might be from 3rd party jars ...
Leon Ma
Jun 22, 2015 at 5:18 am
Jun 23, 2015 at 7:43 am -
Hello everyone. I played with typesafe.config:1.3.0 in repl scala -classpath config-1.3.0.jar Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). Type in expressions ...
Serge
Jun 16, 2015 at 2:58 pm
Jun 17, 2015 at 12:24 am -
Hello, I've noticed that clearing an Array builder (created via `Array.newBuilder`) using `clear()` does not necessarily guarantee that the Array generated by the `result()` method will be unique ...
David Montoya
Jun 11, 2015 at 11:32 am
Jun 11, 2015 at 5:09 pm -
I'd like to force SBT triggered commands (at my case it is ~stage) to ignore some files by mask (at my case ones are Emacs' #auto-save# and, probably, bacup~ files)? How to? -- You received this ...
Andrew Gaydenko
Jun 5, 2015 at 5:04 pm
Jun 10, 2015 at 8:44 pm -
Hi all, I need to override a method of a java class in a derived class. Its signature is Int = Class<? . I can't write such a wildcard in Scala. I've tried Class[_], Class[Any] and the compiler's ...
Steven Dobay
Jun 1, 2015 at 3:08 pm
Jun 1, 2015 at 5:33 pm -
Hi, I have a trait like this trait Create[R, C] { def create(command: C, id: = Id)(implicit clock: Clock, account: Account ): R } And two classes: abstract class AbstractCreate[R, C] extends ...
Olaf Tomczak
Jun 10, 2015 at 7:58 pm
Jul 6, 2015 at 4:57 pm -
Hi, I'm writing a simple proof system. You tell a model some facts, and then you can ask the model to derive proofs for other statements. Usually you just want to test for the existence of a proof, ...
Matthew Pocock
Jun 30, 2015 at 11:31 am
Jun 30, 2015 at 5:31 pm -
Hi, Are there any tools for debugging implicits? Other than getting the compiler to dump out gigabytes of logs? I want a 'debug implicits' console session were it lets me recursively explore what ...
Matthew Pocock
Jun 29, 2015 at 6:47 pm
Jun 30, 2015 at 5:28 pm -
How do you avoid such error? error.scala:7: error: type arguments [_$1] do not conform to trait ModelSchema's type parameter bounds *[M <: this.Model[M]]* s - s.toString ^ one error found in ...
Etam
Jun 29, 2015 at 10:02 pm
Jun 30, 2015 at 1:45 am -
Hi, Let's say I got a String like "a,b,c,,", How should I split it into Array like Array(a, b, c, , ) in Scala? String.split would eliminate all the empty Fields which result in Array(a, b, c) ...
Larry Guan
Jun 24, 2015 at 3:35 am
Jun 24, 2015 at 4:31 am -
Hi all, I've created this blog : http://scalavsjdk8.blogspot.co.uk/2015/05/why-i-still-prefer-scala-after-java-8.html Certainly it still misses a lot of reasons why I prefer scala over java, but will ...
Kostas kougios
Jun 21, 2015 at 9:54 am
Jun 22, 2015 at 8:42 am -
I was reading List API <http://www.scala-lang.org/api/2.11.6/#scala.collection.immutable.List and saw the following statement *Space:* List implements *structural sharing* of the tail list. This ...
Harit Himanshu
Jun 7, 2015 at 9:38 pm
Jun 14, 2015 at 5:38 am -
I am trying to define a type for a* heterogeneous* collection of values that can be JSON-encoded. Is there a straightforward way to express this type in Scala's type system using the existing Play ...
Antony Courtney
Jun 1, 2015 at 6:24 pm
Jun 6, 2015 at 2:05 pm -
Hello As part of learning, I also want to read some well written codebases to learn and find out the best practices. Can someone point me to some of them? Thanks -- You received this message because ...
Harit Himanshu
Jun 2, 2015 at 2:36 pm
Jun 5, 2015 at 7:21 pm -
Hi I have an object that looks like object MyProcessor { def run: Unit = LogReader.main(Array()) } As you could see that the idea is that when I call MyProcessor.run, it should execute ...
Harit Himanshu
Jun 2, 2015 at 10:08 pm
Jun 2, 2015 at 10:53 pm -
Hello, We might want to add a warning to the docs: scala 1.getClass res0: Class[Int] = int scala def f[T](x:T) = x.getClass f: [T](x: T)Class[_ <: T] scala f(1) res1: Class[_ <: Int] = class ...
Oliver Ruebenacker
Jun 2, 2015 at 5:18 pm
Jun 2, 2015 at 6:07 pm -
I have a program that is parsing some text data, into values of different types (dates, ints, strings, etc). There is a configuration that tells the program how the data is formatted and what the ...
Donald McLean
Jun 30, 2015 at 9:11 pm
Jul 1, 2015 at 7:55 pm -
Hi Scala Users! I figured many of you in this group would care about my new video series: "Category Theory: The Beginner's Introduction". http://is.gd/ixB72J I have just completed Lesson 1 (8 videos ...
M.J.M. Codrington
Jun 25, 2015 at 11:41 pm
Jun 29, 2015 at 8:01 pm -
Hello, I lately found this code snippet in some sample code somewhere on the Internet: val result1 = Future(1) I really like this code as it makes dealing with callbacks so much easier. Now what I'm ...
Haddock
Jun 26, 2015 at 8:04 am
Jun 27, 2015 at 1:42 am -
Hello, I am writing some Scala to talk to the Google AdWords API ServiceInterface is some Google Java class. I need to something like this def getService(clientID: String): ServiceInterface = ...
Peter Wolf
Jun 26, 2015 at 7:27 pm
Jun 26, 2015 at 9:51 pm -
I've inherited some legacy Scala code that is built with Ant, but it is no longer building. [scalac] /home/hypuser/hyperion/src/ornl/hyperion/rewriter/mpl/elision/ EAtomAdapter.scala:33: error: ']' ...
Tetricyclone
Jun 19, 2015 at 4:30 am
Jun 19, 2015 at 2:36 pm -
Hi all. I'm seeing a strange (for me) compile-error. This compiles fine: import net.liftweb.common.StringOrNodeSeq import scala.xml.NodeSeq object DoesCompile { def f(selectedText: () = ...
Andreas Joseph Krogh
Jun 18, 2015 at 10:04 pm
Jun 19, 2015 at 8:59 am -
Hello, I'm working on a project about scala compiler AST. I want to access this data structure from java. I have experimented that I can call a scala class and set its member variables from java. I ...
Mihawk20100
Jun 13, 2015 at 10:15 am
Jun 18, 2015 at 4:02 am -
Hi, I'd like to do something like: def doSomething(input : AnyRef) = { if(input is a case class) do1 else if( input is a plain java bean) do2 else do3 } Is it doable? Thanks Leon -- You received this ...
Leon Ma
Jun 17, 2015 at 8:20 am
Jun 18, 2015 at 3:34 am -
Consider Option#getOrElse <http://www.scala-lang.org/api/current/index.html#scala.Option 's signature: final def getOrElse[B : A](default: = B): B Why does this method return a *B, *i.e. a super-type ...
Kevin Meredith
Jun 15, 2015 at 3:06 am
Jun 15, 2015 at 7:19 am -
Hi! I have the below code: var f = false collection foreach { item = { if ( ... ) { f = true } ... ... ... }} if (f) { ... ... } Is it possible to make it more functional way? Should I refactor it? ...
Maks Atygaev
Jun 15, 2015 at 6:23 am
Jun 15, 2015 at 7:15 am -
Hi all, I've started to develop this <https://github.com/stevendobay/pocket-sql and if there will be any interest in it I'll enhance it and make a release in the future. I'm asking you for feedback ...
Steven Dobay
Jun 8, 2015 at 7:34 pm
Jun 13, 2015 at 1:26 pm -
Hi all, I've just started my first real Scala program and I'm running into a design issue that I would like some help with/comments on. Let me give a very simple example: 1 package ...
Hilco Wijbenga
Jun 12, 2015 at 5:53 am
Jun 12, 2015 at 2:17 pm -
i work for a software vendor who delivers solutions within a web container (tomcat) and our customers are used to get a package delivery including : - war files - tomcat binaries (provided as ...
Eric Le Goff
Jun 11, 2015 at 11:32 am
Jun 11, 2015 at 2:04 pm -
This is again in spirit of learning Scala and solving S99 problems. The problem statement looks like *P05 <http://aperiodic.net/phil/scala/s-99/p05.scala (*) Reverse a list.* Example: scala ...
Harit Himanshu
Jun 7, 2015 at 8:47 pm
Jun 8, 2015 at 4:56 am
Group Overview
group | scala-user |
categories | scala |
discussions | 95 |
posts | 380 |
users | 133 |
website | scala-lang.org |
irc | #scala |
133 users for June 2015
Archives
- June 2016 (88)
- May 2016 (164)
- April 2016 (268)
- March 2016 (197)
- February 2016 (159)
- January 2016 (260)
- December 2015 (273)
- November 2015 (202)
- October 2015 (309)
- September 2015 (302)
- August 2015 (305)
- July 2015 (229)
- June 2015 (380)
- May 2015 (392)
- April 2015 (442)
- March 2015 (404)
- February 2015 (346)
- January 2015 (502)
- December 2014 (374)
- November 2014 (424)
- October 2014 (348)
- September 2014 (387)
- August 2014 (399)
- July 2014 (483)
- June 2014 (49)
- May 2014 (304)
- April 2014 (562)
- March 2014 (564)
- February 2014 (1,052)
- January 2014 (971)
- December 2013 (531)
- November 2013 (487)
- October 2013 (550)
- September 2013 (448)
- August 2013 (414)
- July 2013 (573)
- June 2013 (633)
- May 2013 (783)
- April 2013 (773)
- March 2013 (846)
- February 2013 (1,006)
- January 2013 (774)
- December 2012 (692)
- November 2012 (910)
- October 2012 (853)
- September 2012 (1,161)
- August 2012 (736)
- July 2012 (684)
- June 2012 (354)