Raincole, Lai | 22 May 2013 07:10
Picon
Gravatar

My first try at scala - a 60-Second Science crawler

Hello, I'm a beginner of Scala. Recently I wanted to download some good podcasts(and their transcripts) to hear/read on my phone when I have no Internet. My first attempt, was a 60-Second Science crawler in Scala.


I feel Scala... interesting. It utilizes Java artifacts almost seamlessly(I crawl webpages and output PDFs with libraries written in Java), and it brings me the productivity close to what scripting language does. Though the first time I used sbt, I got very confused, but now I think it's much better than Maven.

There are some gotchas of course. The Option/Some/None pattern is a little tedious for scripting(though I'm sure that it will bring benefit in larger program). The compiling is much slower than I expected. And the file APIs are just Java, but I though such a language like Scala would have file API in its own style.

To conclude, I would keep using Scala and try it in bigger project.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Joe Barnes | 22 May 2013 04:40
Picon
Gravatar

Any interest in an SNMP DSL?

I'm in the telecom industry, and I've not yet found a great way to utilize SNMP.  As a result, I've been inspired to write my own SNMP DSL.  I have it hosted here on github.  I'm looking for folks interested in using it or helping develop it.  Ping me if you're interested.


Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Sandro Gržičić | 22 May 2013 00:29
Picon
Gravatar

Re: SBT plugin released for Google Protocol Buffers support

I'd say the latest stable version is 0.2 and the latest snapshot is 0.3-SNAPSHOT.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Raincole, Lai | 21 May 2013 18:21
Picon
Gravatar

how could Simply Scala be secure?

I found there is an interesting site I can submit Scala code and run it on their server. (http://www.simplyscala.com/)


But how could it be secure? I mean, for example, what if a random stranger use it as a proxy to attack other sites?

Is there something like 'Scala Sandbox' to run untrusted code?

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Ziad Hatahet | 21 May 2013 15:51
Picon

Polymorphic return type implementation

Hi all,

I have been learning more about Scala, and functional programming in general. It has been very exciting and a breath of fresh air coming from an imperative background.

In some FP/FP-like languages, it is possible to implement functions that are polymorphic in their return type. For instance, you could have (in equivalent Scala syntax):

val b: Boolean = Random.nextValue(); // Returns either 'true' or 'false'.
val b: Byte = Random.nextValue(); // Returns value between -128 and 127.
val i: Int = Random.nextValue(); // Returns value between Int.MinValue and Int.MaxValue.

Note how the same function/method is called, but the returned value depends on the type of the variable it is going to be stored in.

Is it possible to implement this sort of behavior in Scala?

Thanks

--
Ziad

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Scala Mailing Lists | 21 May 2013 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-user

Welcome to the "Scala-user" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-user" mailing list:

This list is the main forum for Scala programmers. Topics of
this list are:

 * questions about programming in Scala (including beginners)
 * how to use the libraries, APIs, code snippets
 * discussions about possible compiler/libraries bugs
 * interoperability with external tools, libraries, languages
 * assistance when writing your code

Long threads that become off-topic for this list, but are
still Scala-related, should continue on "scala-debate".

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
the list that is closer to your topic and post in that list only.
In any case, never cross-post replies.

If you ever want to unsubscribe from this list, just visit this
page: http://groups.google.com/group/scala-user/subscribe
or send an email to scala-user+unsubscribe@...

Thank you!
The Scala Team

--

-- 
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@...
For more options, visit https://groups.google.com/groups/opt_out.

Vlad Patryshev | 21 May 2013 03:02
Picon
Gravatar

hmm, exceptions...

Seems like scala people use to look down at exceptions... but see. The difference between an error message and an exception is that an exception tells you where the error happened. I actually use it in pretty unusual places, like this:

def jsREPL(implicit prompt:String = "type your js") {
  val here = Thread.currentThread.getStackTrace()(3)
  println(s"$prompt [${here.getFileName}:${here.getLineNumber}]: ")
  Source.fromInputStream(System.in).getLines.takeWhile(!_.isEmpty) foreach {
    s => println(tryOr(runJS(s), (_:Exception).getMessage))
  }


What I want to say: if we, in Scala, had a habit of passing around exceptions, instead of plain text (in Failure or Left), it would be pretty helpful. 

What do you think?

Thanks,
-Vlad

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Ryan LeCompte | 21 May 2013 01:59
Picon
Gravatar

2.9.x type inference bug workaround

The following breaks on Scala 2.9.x, but works on 2.10+:

scala> def foo[A, C <: Traversable[A]](c: C) { println(c) }

scala> foo(Map.empty[String, Int])
<console>:9: error: inferred type arguments [Nothing,scala.collection.immutable.Map[String,Int]] do not conform to method foo's type parameter bounds [A,C <: Traversable[A]]
              foo(Map.empty[String, Int])

Someone told me about the following workaround, which works on Scala 2.9.x:

scala> def foo[A, C <: Traversable[A]](c: C with Traversable[A]) { println(c) }

scala> foo(Map.empty[String, Int])
Map()

It also seems to work for other types such as strings, BitSets, etc. Is there a type that will not work with this 2.9.x workaround? I know that IsTraversableLike/etc fixes this issue in 2.10+.

Thanks,
Ryan

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Michael Schmitz | 21 May 2013 01:35
Gravatar

Collection operators

I know collection operators have been discussed at length, but this is an unfortunate problem in a "typesafe" language.

scala> Set("foo") ++ Set("bar") + "baz"
res2: scala.collection.immutable.Set[java.lang.String] = Set(foo, bar, baz)

scala> Seq("foo") ++ Seq("bar") + "baz"
res3: java.lang.String = List(foo, bar)baz

Of course, it's even worse when you have variables and the collection type is not explicit on this line.

Peace.  Michael

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Andrew Gaydenko | 20 May 2013 23:02
Picon

Future and nondeterministic dataflow

From Future#isCompleted scaladoc:

   Note: using this method yields nondeterministic dataflow programs.

What does it exactly - in terms of a code  - mean?

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Functional Jobs | 20 May 2013 08:00
Favicon

New Functional Programming Job Opportunities

Here are some functional programming job opportunities that were posted

recently:

Test Engineer at Klarna

http://functionaljobs.com/jobs/146-test-engineer-at-klarna

Cheers,

Sean Murphy

FunctionalJobs.com

--

-- 
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@...
For more options, visit https://groups.google.com/groups/opt_out.


Gmane