scala Questions

8

Solved

Scala has direct support for using hex and octal numbers: scala> 01267 + 0100 res1: Int = 759 scala> 0x12AF + 0x100 res2: Int = 5039 but how do you do express an integer as a binary numbe...
Georgianngeorgianna asked 25/8, 2011 at 21:1

2

Solved

Suppose that I have some typeclass trait FooBar[X] and an instance of FooBar[Int]: given intIsFooBar: FooBar[Int] = new FooBar {} Now, suppose that I have an interface Intf that has some member t...
Virgil asked 21/3, 2023 at 21:31

5

Solved

In Akka, is there a way to restrict messages to actors to be of a specific static type other than using the "Typed Actor" APIs that use an RPC style programming model? Can I use the message passin...
Taft asked 5/4, 2011 at 6:15

2

Solved

I'm having some trouble encoding data when some columns that are of type Option[Seq[String]] are missing from our data source. Ideally I would like the missing column data to be filled with None. ...
Dutra asked 3/1, 2017 at 23:50

3

Is there any way to get the number of records written when using spark to save records? While I know it isn't in the spec currently, I'd like to be able to do something like: val count = df.write....
Ulita asked 12/5, 2017 at 9:30

13

Solved

Below the steps I did to get this issue : Launch ZooKeeper Launch Kafka : .\bin\windows\kafka-server-start.bat .\config\server.properties And at the second step the error happens : ERROR F...
Melda asked 25/12, 2019 at 21:10

5

Solved

I have evolution problem Unknown data type: "JSONB" when running tests in playframework using playframework v2.6.6 for scala play-slick v3.0.2 play-slick-evolutions v3.0.2 postgresql - 42.0.0 h2...
Floorman asked 21/12, 2017 at 11:53

4

Solved

I need a Support Vector Machine library for Scala. I guess that I should have a look at both Scala and Java implementations, do you recommend me to use any of them in particular?
Billetdoux asked 21/9, 2012 at 18:59

1

I am trying to use spark cassandra connector to fetch values from the table. The load() yields the IncompatibleClassChangeError. My development environment is defined as follows, Intellij : 2019.3....

2

I need to know the fileName for the input file that is streamed from the input dir. Below is the spark FileStreaming code in scala programming object FileStreamExample { def main(args: Array[St...
Chairborne asked 13/10, 2019 at 9:42

4

Solved

I have a dataframe df with the following schema: root |-- city_name: string (nullable = true) |-- person: struct (nullable = true) | |-- age: long (nullable = true) | |-- name: string (nullabl...
Villainage asked 1/3, 2018 at 9:49

3

Solved

I'm getting the error message java.lang.IllegalArgumentException: Schema must be specified when creating a streaming source DataFrame. If some files already exist in the directory, then depending o...
Postfree asked 17/10, 2021 at 19:56

4

Solved

contains like functionality for play.api.libs.json.Json val data=Map("id" -> "240190", "password" -> "password","email" -> "[email protected]") data.contains("email")//true val in...
Emeldaemelen asked 23/7, 2014 at 7:35

4

I am writing my own simple javax.sql.DataSource implementation, the only method of it I need to work is getConnection: Connection, but the interface inherits many other methods (which I don't need)...
Sartorial asked 8/4, 2012 at 19:53

2

Solved

I would like to chain http request using akka-http-client as Stream. Each http request in a chain depends on a success/response of a previous requests and uses it to construct a new request. If a r...
Anschauung asked 11/9, 2016 at 15:31

4

Solved

Does anyone know how to show a custom failure message in ScalaTest? For example: NumberOfElements() should equal (5) Shows the following message when it fails: 10 did not equal 5 But i wan...
Emotionalism asked 23/6, 2011 at 8:51

11

I want to create on DataFrame with a specified schema in Scala. I have tried to use JSON read (I mean reading empty file) but I don't think that's the best practice.
Bathyal asked 17/7, 2015 at 13:58

4

Solved

I wonder how to get a class object for an object type in Scala. Ok, that is a mouth full because of the double meaning for object. So here an example which will fail: object Main { private [this]...
Radices asked 9/3, 2012 at 14:21

8

Solved

I'm a newbie to scala, I'm just writing a simple function to reverse a given string: def reverse(s: String) : String for(i <- s.length - 1 to 0) yield s(i) the yield gives back a scala.colle...
Hornbeam asked 8/10, 2011 at 23:20

4

Solved

What is the suitable way to compute hashCode of an Array that depends on its content? Array.hashCode is for the array instance: val h = a.hashCode println(h == Array(1,2).hashCode) // false a(0)...
Cicelycicenia asked 18/11, 2016 at 13:59

2

Solved

I found myself lately using sliding(n,n) when I need to iterate collections in groups of n elements without re-processing any of them. I was wondering if it would be more correct to iterate those c...
Meadors asked 30/9, 2015 at 19:47

7

I am trying to compile Scala project which contains scalatest. It compiles normal on sbt sbt > compile > test:compile , but when I am trying to build it with IDEA, it shows the following ...
Calceiform asked 1/10, 2016 at 22:27

4

Solved

Why and how specifically is a Scala Future not a Monad; and would someone please compare it to something that is a Monad, like an Option? The reason I'm asking is Daniel Westheide's The Neophyte's...
Irresolute asked 13/12, 2014 at 2:9

4

I'm trying to call the Selenium Java libraries from Scala. I'm using Scala IDE (Eclipse), and Scala 2.10.2. What is causing this compiler error? error while loading Function, class file '/Dev/sele...
Brahma asked 3/9, 2013 at 19:15

4

Solved

I'm trying to generate a UUID with all zeros: java.util.UUID fromString "00000000-00000000-00000000-00000000" The error is java.lang.IllegalArgumentException: Invalid UUID string: 00000000-000...
Karlynkarma asked 30/12, 2013 at 13:9

© 2022 - 2024 — McMap. All rights reserved.