Why does Iterator have a contains method but Iterable does not, in Scala 2.8?
I would like to call 'contains' on my Iterables :-) ...
I would like to call 'contains' on my Iterables :-) ...
Is there a design document for Scala 2.8 Actors, like it is for 2.7? Scala Actors: Unifying Thread-based and Event-based Programming Is there one for Akka? The "Scala Improvement Documents Library" doesn't mention Actors. ...
Now that I know how to parse xml in scala as a stream I need help understanding a non-trivial example. I'd like to parse the following xml as a stream and send a message (print to console for this example) whenever I've parsed out a full message. I understand that stream based parsing in scala uses case classes to handle the different ...
Yo dawgs, I got some problems with the java. Check it out. sebastian@sebastian-desktop:~/scaaaaaaaaala$ java -cp /home/sebastian/.m2/repository/org/scala-lang/scala-library/2.8.0.RC3/scala-library-2.8.0.RC3.jar:target/scaaaaaaaaala-1.0.jar scaaalaaa.App Hello World! That's cool, right, but how bout this: sebastian@sebastian-desktop:~...
In chapter 10, on page 198 of "Programming in Scala", the definition of Element defines a function/method "above" that returns a new ArrayElement. But ArrayElement extends Element. In trying type in the examples, I actually get what I expected... a complaint about the circular dependency of these definitions. What am I missing? ...
I'm an ex-Googler building a Scala / GWT based web app and need three contract engineers for three months to help out. Where can I find top Scala / GWT talent? ...
At just after 2:40 in ShadowofCatron's Scala Tutorial 3 video, it's pointed out that the parentheses following the name of a thunk are optional. "Buh?" said my functional programming brain, since the value of a function and the value it evaluates to when applied are completely different things. So I wrote the following to try this out....
I'm missing some fairly simple syntax I gather. I'm trying to rewrite an element label to something else and keep everything else intact. object htmlRule extends RewriteRule { override def transform(n: Node): Seq[Node] = n match { case Elem(prefix, "document", attribs, scope, child@_*) => Elem(prefix, "html", attribs, scope...
In Chapter 3 of Programming Scala, the author gives two examples of for loops / for comprehensions, but switches between using ()'s and {}'s. Why is this the case, as these inherently look like they're doing the same thing? Is there a reason breed <- dogBreeds is on the 2nd line in example #2? // #1 ()'s for (breed <- dogBreeds if b...
Hi, Now i know that this one is actually not a very technical question but one that has been bothering me for some time. Actually we are using a lot of C++ and PHP at our company and some of our developers are really hoping for a new and modern language to come by to help us getting more productive. I have been talking about what scala ...
Could anyone help me telling me how to use scala's ObservableSet trait? Thank you very much in advance ...
I am in charge of a rebuilding a website that gets about 250,000 visitors a day. We'd like to use Scala, but it does not work very well with Spring (in some minor cases) and Hibernate (there is a major and very annoying mismatch here if you want to use scala collections, which we do). The application itself is going to have about 40-50 ...
For a while I have been struggling to integrate scala with java methods that might return null. I came up with the following utility which helps a lot: // produce an Option, nulls become None object Maybe { def apply[T](t:T) = if (t==null) None else Some(t) } Maybe(javaClass.getResultCouldBeNull()).map( result => doSomeWork(resul...
I'm trying to write a script to make generating Lift projects quicker but I believe i'm running into a white space issue. val strLiftGen = "mvn archetype:generate -U\-DarchetypeGroupId=net.liftweb\ -DarchetypeArtifactId=lift-archetype-blank\ -DarchetypeVersion=1.0\ -DremoteRepositories=http://scala-tools.org/repo-releases\-DgroupId="...
I like spring mvc's functionality, but i'd like to not use annotations and use a more functional style... something with currying and closures rather than method names and annotations. Would this be easily doable? ...
When I evaluate a for in Scala, I get an immutable IndexedSeq (a collection with array-like performance characteristics, such as efficient random access): scala> val s = for (i <- 0 to 9) yield math.random + i s: scala.collection.immutable.IndexedSeq[Double] = Vector(0.6127056766832756, 1.7137598183155291, ... Does a for with a yield ...
I'm using Java's DataInputStream with scala to parse some simple binary file (which is very bad exprerience due to the lack of unsigned types, even in scala, but that's a different story). However I find myself forced to use mutable data structure, since Java's streams are inherently state preserving entities. What's a good design to w...
I want to have class that can be instantiated with list, array, seq, set, stack, queue etc. In my opinion class A class B(elems:A*) should handle such stuff. This is my solution: class A class B(elems:Iterable[A]){ def this(elem:A) = this(Seq(elem)) } Can you suggest any improvements? ...
I'm building a Yammer client for Android in Scala and have encountered the following issue. When two AsyncTasks try to parse an XML response (not the same, each task has it's own InputStream) from the Yammer API the underlying stream throws a IOException with the message "null SSL pointer", as seen below: Uncaught handler: thread AsyncT...
I need some code samples (and I also really curious about them) of Scala and Java code which show that Scala code is more simple and concise then code written in Java (of course both samples should solve the same problem). If there is only Scala sample with comment like "this is abstract factory in Scala, in Java it will look much more ...