aggregate

mvn exec:java on aggregate pom

Hi. Does anyone know whether it is possible to run mvn exec:java on mvn aggregate POM? Currently I get: 2009-09-24 02:24:14.404 :bash: karolrvn@karolrvn-laptop : ~/adfadf/programming/verknowsys/codadris/ide_projects $ mvn exec:java -e -Dexec.mainClass=codadris.coviob2.App_Coviob2 + Error stacktraces are turned on. [INFO] Scanning for...

opposite of Previous aggregate function in Report Builder

I'm trying to show a tablix of data where the result of a sum changes in each row. I have the rows grouped by date and sorted in descending order such that the most recent date is first. What I want to do is compare each row's sum with the sum of the previous row, e.g. Date Sum PrevValue ---------- --- -------------- 2009-09...

SQL query find max row from the aggregated averages

Supposed I have the following tables: Sailor(sid, sname, age) Boat(bid, sid) Each boat can have many sailors, and each individual sailor can serve on many boats. What I want to do is to find the boat with the highest average age of sailors. I can find the average age of the sailor on each boat with this subquery: SELECT b.bid, A...

Django ORM: Chaining aggregated querysets into one

Can I chain these two querysets into one? qs1 = OrderTicket.objects.filter(date__gt=datetime.date(2009, 1, 1), date__lt=datetime.date(2009, 1, 30)).values('order_type').annotate(value_1 = Sum('gbp_value')).order_by('order_type'), qs2 = OrderTicket.objects.filter(date__gt=datetime.date(2009, 2, 1), date__lt=datetime.date(2009, 2, 30)).va...

Initializing temporary aggregate object using curly braces.

Let's say I have a class: class Aggregate { public: int x; int y; }; I know how to initialize an object using curly braces: Aggregate a1 = { 1500, 2900 }; But I can't find a proper syntax to create temporary object and pass it as an argument to some method, for example: void frobnicate(const Aggregate& arg) { // do...

Factory method signature for aggregate root

I want to write a factory method to instantiate an entity that is an aggregate root. Should the method accept the aggregated child entities and values as instantiated objects, or should it accept only primitive types? For example, if I had an entity Computer composed of a Processor and a Memory object, should the factory method take th...

using aggregate function with more than two columns

I have two tables, stats and stat_log. The stat log is like this: user_id,stat_id,value,registered and It logs the value of the stats for the given times. I need every last value from every stat for a given user. So i want something like this, but with values: select stat,max(registered) from stat_log where uid = 1 group by stat; ...

how to calculate count in sql?

I have the following table: memberid 2 2 3 4 3 ...and I want the following result: memberid count 2 2 3 1 ---Edit by gbn: do you mean 2? 4 1 I was attempting to use: SELECT MemberID, COUNT(MemberID) FROM YourTable GROUP BY MemberID ...but now I want find which record which ...

Looking For Best Practices On Building Feed Reader / Aggregator on a Cron

I have a social networking site which is beginning to gain some momentum and has an expanding user-base. We currently allow the users to import their blog, flickr and twitter feeds. We use the php library simplepie to read the feeds and then we check the DB to make sure we do not have a duplicate entry for each found feed item. If the fe...

Domain Objects containing lots of Data

Our Domain has a need to deal with large amounts (possibly more than 1000 records worth) of objects as domain concepts. This is largely historical data that Domain business logic needs do use. Normally this kind of processing depends on a Stored Procedure or some other service to do this kind of work, but since it is all intimately Domai...

Perform Data Analysis on Sql Server or in .Net?

I have some data analysis that needs to perform. On average, it would involve somewhere in between 50K-150K rows. From these rows I need to extract the summation of Sum(X) as well as Count(X) based on five different criteria. There are two ways of going about it: Write 10 different queries, each one designed to aggregate the data from ...

Can I create an anonymous, brace-initialized aggregate in C++?

One can create an anonymous object that is initialized through constructor parameters, such as in the return statement, below. struct S { S(int i_, int j_) : i(i_), j(j_) { } int i, j; }; S f() { return S(52, 100); } int main() { cout << f().i << endl; return 0; } However, can one similarly create an anonymous aggregate th...

SQL use GROUP BY such that it results in the original SELECT

I have a SQL query that is something like SELECT SUM(price) FROM budget GROUP BY {{PLACEHOLDER}} where {{PLACEHOLDER}} will be replaced in the code. Is it possible to replace it by something that will result in the same output as the following statement? SELECT price FROM budget ...

SQL Server : SUM() of multiple rows including where clauses.

I have a table that looks something like the following : PropertyID Amount Type EndDate -------------------------------------------- 1 100 RENT null 1 50 WATER null 1 60 ELEC null 1 10 ...

When using Aggregate objects do you use custom collections for the associations or not ?

For example is it better to have: public class Case : EntityIdentifiable { public Jobs Jobs { get; set; } public Vehicles Vehicles { get; set; } public Locations Locations {get;set;} public IDistances Distances { get; set; } } or public class Case : EntityIdentifiable { public Dictionary<string,Job> { get; set; ...

DataRow[] Aggregate Functions C#

I have an array of DataRow objects in my C# project which I would like to Sum various fields from. Instead of running through each row and totalling my own sums I noticed the DataRow[].Sum<> function but I am struggling to find any resources on the net on how to use it. Any pointers in the right direction would be very helpful :) Re...

Domain Driven Design - Repositories and aggregate roots

I have a domain model that contains a forum. I have forum, thread and post entities. The forum is a standalone entity. Ie it does not contain thread as part of an aggregate. This is because threads are not owned by a particular forum (you can move a thread to a different forum). I don't know if I should model posts as part of a threa...

Design Aggregate Root Properly

I have some problems designing the aggregate root. Here is how I see it in my mind :) Store (the aggregate root) -> Sales - A store create a sale every day -> Zones - A store is divided into zones -> Styles - A zone has x number of styles --> Colors - A style has x number of colors etc.. Now based on this my aggregate ...

Creating an aggregate blog?

I'd like to create a blog similar in style to http://tastespotting.com where the site aggregates content from other blogs and displays them in a thumbnail post which on clicking goes to the specific blog. I'm not sure where to start with this and was wondering if anyone could point me in the right direction. I'm familiar with Wordpres...

use linq aggregate function to build xml string?

I've used this in the past to build comma seperated lists: var list = new List<int>{1,2,3}; var retVal = list.Select(i=>i.ToString()).Aggregate((a,b) => a+", "+b); Works great. I'm trying to do the same sort of thing to 'wrap' each element as an xml node. Something like: Aggregate((a, b) => string.Format("<ID>{0}</ID><ID>{1}</ID>",...