SQL Server 2005 query pivot over variable number of schedules

I am working on a routing system for a transportation type similar to a bus routing system like below. I have a view that gives me the output. I need to pivot over schedules where the number of...

Get first day of week in SQL Server

I am trying to group records by week, storing the aggregated date as the first day of the week. However, the standard technique I use for rounding off dates does not appear to work correctly with...

Aggregating and uglifying JavaScript in a Git pre-commit hook

I'm using ready.js to aggregate JavaScript files into an all.js file (without Google's Closure Compiler) and am then using uglify-js to minify and obfuscate the code. I'd like to do all of this in...

Why is my Git pre-commit hook not executable by default?

If you see the accepted answer in: https://stackoverflow.com/questions/8598246/aggregating-and-uglifying-javascript-in-a-git-pre-commit-hook, you'll see that I had to do a chmod +x on my...

Java Async Http clients comparisons

I am evaluating an HTTP client libraries for my application. This is a web application which calls various web services, aggregates content and then sends it to Ajax client. I think I need an...

How to turn off parallel execution of tests for multi-project builds?

I have a multi-project build with tests in sub-projects and in a parent project. The build is aggregated so that the parent project runs all tests in child projects. I configured it so that...

MongoDB Aggregation: Compute Running Totals from sum of previous rows

Sample Documents: { time: ISODate("2013-10-10T20:55:36Z"), value: 1 } { time: ISODate("2013-10-10T22:43:16Z"), value: 2 } { time: ISODate("2013-10-11T19:12:66Z"), value: 3 } { time:...

MongoDB distinct aggregation

I'm working on a query to find cities with most zips for each state: db.zips.distinct("state", db.zips.aggregate([ { $group: { _id: { state: "$state", city:...

MongoDB's Aggregation Framework: project only matching element of an array

I have a "class" document as: { className: "AAA", students: [ {name:"An", age:"13"}, {name:"Hao", age:"13"}, {name:"John", age:"14"}, {name:"Hung", age:"12"} ] } And i want to get...

How to calculate the running total using aggregate?

I'm developing a simple financial app for keeping track of incomes and outcomes. For the sake of simplicity, let's suppose these are some of my documents: { description: "test1", amount: 100,...

Renaming columns for PySpark DataFrame aggregates

I am analysing some data with PySpark DataFrames. Suppose I have a DataFrame df that I am aggregating: (df.groupBy("group") .agg({"money":"sum"}) .show(100)) This will give me: group ...

Add some kind of row number to a mongodb aggregate command / pipeline

The idea is to return a kind of row number to a mongodb aggregate command/ pipeline. Similar to what we've in an RDBM. It should be a unique number, not important if it matches exactly to a...

Workaround for preserveNullAndEmptyArrays in MongoDB 2.6

I am using a Python script to query a MongoDB collection. The collection contains embedded documents with varying structures. I am trying to simply "$unwind" an array contained in several...

Spark DataFrame: does groupBy after orderBy maintain that order?

I have a Spark 2.0 dataframe example with the following structure: id, hour, count id1, 0, 12 id1, 1, 55 .. id1, 23, 44 id2, 0, 12 id2, 1, 89 .. id2, 23, 34 etc. It contains 24 entries for each...

How to aggregate a dataframe by week?

Consider the following example library(tidyverse) library(lubridate) time <- seq(from =ymd("2014-02-24"),to= ymd("2014-03-20"), by="days") set.seed(123) values <- sample(seq(from = 20, to = 50,...

Duplicate key error when trying to write an $group aggregation to mongodb from Spark using scala

Edit: This edit may change the course of this issue. A mongodb aggregation (specifically with $group) run on spark is creating duplicate _id records when writing back to the collection. As a...

Sorting and ranking documents based on key values?

I am trying to pull out documents with highest mark for a student in a collection and formed a query below: { name: "Person1", marks: 20 } { name: "Person2", marks: 20 } { name: "Person1",...

graphite - last few datapoints are null when aggregating

if I fetch a render of previous 1h (cache disabled), I get all the datapoints right up to current time. unaggregated here, showing 1 update per second....

org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.springframework.data.mongodb.core.query.GeoCommand

I am using aggregation as following : final List<AggregationOperation> aggregations = new ArrayList<>(); Polygon polygon = new Polygon(new Point(-26.28125, 42.19231862526141), new...

Pyspark: reshape data without aggregation

I want to reshape my data from 4x3 to 2x2 in pyspark without aggregating. My current output is the following: columns = ['FAULTY', 'value_HIGH', 'count'] vals = [ (1, 0, 141), (0, 0,...

flink AggregateFunction accumulator slow

i'm using flink for data agg code like .keyby() .timewidow() .aggregate(new AggCount(), new AggWindow()) class AggCountNew() extends AggregateFunction[((String, String, Int), Message),...

decision_function and precidt_proba yield different ROC graphs in sklearn

I'm following the ROC graph example given in sklearn docs here (you can download a Jupyter notebook from here). It generates a ROC graph for the multi-class problem over the Iris dataset. In the...

Return aggregate for all unique in a group

The trouble is this. Lets say we have a pandas df that can be generated using the following: month=['dec','dec','dec','jan','feb','feb','mar','mar'] category...

Multiple indexing with multiple idxmin() and idmax() in one aggregate in pandas

In R data.table it is possible and easy to aggregate on multiple columns using argmin or argmax functions in one aggregate. For example for DT: > DT = data.table(id=c(1,1,1,2,2,2,2,3,3,3),...

I cannot see data displayed in my spring boot/spark application after calling show method on spark dataframe

This is my pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"...

How can I aggregate on 2 dimensions in Google Data Studio?

I have data in 2 dimensions (let's say, time and region) counting the number of visitors on a website for a given day and region, as per the following: time region visitors ...

Read big JSON payload all at once with Reactor Netty client, and not in chunks for keep-alive long lived persistent connection

To describe the use case I am trying to solve/implement, we integrate with the 3rd party service, and this service sends a continuous stream of data (JSON) over HTTP/1.1 long-living/persistent...

How to display the table Total in grouped column chart

I need to show the total at the bottom of a data table in a grouped column chart in Power BI, that is, this total which is found here at the bottom of the table: I want to show it as a value in a...

can't run flutter project on iOS simulator

I have been developing e-commerce app for about 3 months, I switched to MacOs recently. I have a problem when I run my code in iOS Simulator every time I run it I get this message. CocoaPods'...

Dataflow - State persitence database

We are considering using Beam/Dataflow for stateful processing with long-running sessions. We understand that states persistence is managed by Windmill/Persistent Disks [1], but we'd like to have...