Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • \$\begingroup\$ I get James_pic.scala:42: error: ')' expected but string literal found. output.write(s"$a $b $t\n$c $d $u\n") ^ one error found. This is on Scala compiler version 2.9.2 \$\endgroup\$ Commented May 8, 2014 at 16:39
  • 1
    \$\begingroup\$ I got it to work with 2.10.3. It's a very nice solution although my poor computer is more or less unusable for a minute or so afterwards as it tries to deallocate 6GB of RAM. \$\endgroup\$ Commented May 8, 2014 at 18:36
  • \$\begingroup\$ Yes, sorry. I figured you might have that issue. Ubuntu still ships with Scala 2.9, and string interpolation needs 2.10 or higher. I suspect it'll be faster still under Java 8, but Ubuntu only ships with 7, and that's a world of pain that you don't need! \$\endgroup\$ Commented May 9, 2014 at 8:03
  • \$\begingroup\$ Re input: I don't always use StringTokenizer, but when I do, I parse millions of strings. \$\endgroup\$ Commented May 9, 2014 at 14:22
  • \$\begingroup\$ @Geobits Yeah, String.split is currently a bottleneck, but StringTokenizer isn't much better right now - allocating in a tight inner loop is hurting my already strained GC. I'm working on an FSM which seems to have promise (whilst being complete overkill) \$\endgroup\$ Commented May 9, 2014 at 14:50