Spark SQL Group By Consecutive Sequence of Integers

Scala
So I have a table which I want to create events from it. My user is watching a video which is defined as a list of sub_parts, with bytes downloaded fo...
11 months ago

How to aggregate data in Spark using Scala?

Scala
I have a data set test1.txt. It contain data like below 2::1::3 1::1::2 1::2::2 2::1::5 2::1::4 3::1::2 3::1::1 3::2::2 I have created data-frame u...
11 months ago

Idiomatic way of If none return false?

Scala
The java library I am dealing with, returns null on errors. Is there an Idiomatic way of saying: val x:Option[T] if(x.isEmpty) false else x.get.is...
11 months ago

Map over CompactBuffer in an rdd

Scala
I have an RDD which was groupByKey as below, (1, CompactBuffer(2.0, 3.0, 4.0)), (2, CompactBuffer(1.0, -1.0, -2.0)) And I wish to mapValues into (1...
11 months ago

Spark SQL fails because "Constant pool has grown past JVM limit of 0xFFFF"

Scala
I am running this code on EMR 4.6.0 + Spark 1.6.1 : val sqlContext = SQLContext.getOrCreate(sc) val inputRDD = sqlContext.read.json(input) try { ...
11 months ago

Blocking a REST API response until another API is called

reST (reStructuredText)
I have following scenario: There are two API calls in an application: api1 and api2. api1 is invoked multiple times from multiple users. I want to b...
11 months ago

Compress a Given Text of String in Scala

Scala
I have been trying to compress a String. Given a String like this: AAABBCAADEEFF, I would need to compress it like 3A2B1C2A1D2E2F I was able to come...
11 months ago

Angular 1.0.7: Https api call in $resource

reST (reStructuredText)
I have an Angular1.0.7 webapp that is making calls to an rails API listening in an specific port. We want to migrate to HTTPS protocol for security re...
11 months ago

How to Sum a part of a list in RDD

Scala
I have an RDD, and I would like to sum a part of the list. (key, element2 + element3) (1, List(2.0, 3.0, 4.0, 5.0)), (2, List(1.0, -1.0, -2.0, -3.0)...
11 months ago

Spring MVC - How can I use different timeouts for my resttemplates?

reST (reStructuredText)
I am using Spring MVC with Spring 3.1. I have a web application that uses many REST services. One of these REST services takes up to an hour to resp...
11 months ago

Is there any concise way to convert the type from `Int` to `Double` after applying `splitAt` to a `List`?

Scala
My input is like this: 1 1 1 1 1 44 33 and the result I would like to get is like this: val listA = List(1, 1, 1, 1, 1) val listB = List(44.0, 33....
11 months ago

My POST request on TIdHttpServer contains strange characters, json string

reST (reStructuredText)
I have an issue with the JSON string I get when receiving a POST request. Currently this is the way I'm reading it: procedure TForm1.IdHTTPServer1Co...
11 months ago

issue while creating an endpoint in Flask using Python

reST (reStructuredText)
I'm trying to write a microservice for a RESTful web service. I've a database created in 'Postgresql' and currently using Flask and psycopg2 (for conv...
11 months ago

Why do I need to make deploy of restful web service to get the latest updates from the database

reST (reStructuredText)
I am developing a java restful webservice using netbeans and jersey api. when I update data in database the findall method didn't get the latest chang...
11 months ago

How does pass-by-reference work?

Pascal
Pass-by-reference is easy to visualize with languages that use pointers mostly. But in Pascal, I can hardly see how the pointers pass around subroutin...
11 months ago

Hybris Create Web Service with Intellij

reST (reStructuredText)
I'm really new in Hybris. I have Hybris commerce 6.4 and im working with Intellij. Can anybody tell me how to create a web service rest? I need th...
11 months ago

Swift 4 URLsession with Authentication API Key

reST (reStructuredText)
I am trying to make a POST Request for the Shippo REST API in Swift, but since it needs an API Authentication key I cannot figure out how to implement...
11 months ago

R: "label" a row based on conditions from another data.table

R
I have a data.table (A) that is over 100,000 rows long. There are 3 columns. chrom start end 1: chr1 6484847 6484896 ...
11 months ago

Show foreign key in DJANGO REST

reST (reStructuredText)
My first question here. Glad to be part of this community. My question: I'm using python3 and the django rest framework to create an API. I have the ...
11 months ago

R data scraping / crawling with dynamic/multiple URLs

R
I try to get all decrees of the Federal Supreme Court of Switzerland available at: https://www.bger.ch/ext/eurospider/live/de/php/aza/http/index.php?l...
11 months ago

Probabilities of events grouped by their outcome

R
Say there are $n$ independent events. Each has a probability $p_n$ and an associated loss $l_n$. My goal is to produce a list of all possible loss amo...
11 months ago

Does my Retrofit/ReactiveX method actually retrieve data asynchronously?

reST (reStructuredText)
swipeRefreshLayout.setOnRefreshListener(() -> { swipeRefreshLayout.setRefreshing(true); retrieveData(mCardAdapter, db); }); For some reason the...
11 months ago

Error when predicting with DirichletReg package in R

R
I am trying to make predictions on a test set using the DirichReg function from the DirichletReg package. When I run the model with only a few predict...
11 months ago

What is the correct REST method for performing server side validation?

reST (reStructuredText)
If I don't want to update a resource, but I just want to check if something is valid (in my case, a SQL query), what's the correct REST method? I'm n...
11 months ago

For loop returns last result

R
I have a small number of csv files, each containing two columns with numeric values. I want to write a for loop that reads the files, sums the columns...
11 months ago