grouping

put stockprices into groups when they are within 0.5% of each other

Hi: Thanks for the answers, I have not used StackOverflow before so I was suprised by the number of answers and the speed of them - its fantastic. I have not been through the answers properly yet, but thought I should add some information to the problem specification. See the image below. I can't post an image in this because i don't ...

returns Zeros for Dates that dont exist MYSQL GROUP BY

SELECT AVG(data) AS data, dateReg FROM table GROUP BY YEAR(dateReg), MONTH(dateReg), DAY(dateReg) ORDER BY dateReg the Above Data Returns 1.75, 21 Jan 2010 9.45, 22 Jan 2010 3.96, 23 Jan 2010 2.68, 30 Jan 2010 Its missing dates from the 24th to 29th, Can we do it so the return value is: 1.75, 21 Jan 2010 9.45, 22 Jan 2010 3.96, 2...

how to apply group by on xslt elements

Hello All, I need to group the value based on some attribute and populate it. below mentioned is i/p xml and if you see there are 4 rows for Users and for id 2,4 Division is same i.e. HR while generating actual o/p I need to group by Division ... Any help ??? I/P XML <Users> <User id="2" name="ABC" Division="HR"/> <User id="3" n...

WPF - Binding to current item from within group header style

Hi, I'm something of a WPF noob so please take it easy on me ;-) I am trying to create a grouped DataGrid (WPF toolkit version). I have successfully created the data source, the DataGrid itself, the required CollectionViewSource and the Style for the group header (which uses an expander). I want to group by a property called 'Assign...

looking for efficient way to group data on output in PHP

I have a table that holds products, another that holds variations and a third that hold product variations (many products can have many variations..both ways). I want to display (group by) each product and show the variations. what i've read is just looping thru and comparing id's to see which record you are on, if a new one then adjus...

Formtastic select with grouping

Now with Formtastic I have plain select: = f.input :category, :as => :select, :include_blank => false, :collection => subcategories Here I show only children categories. I use acts_as_tree plugin for parent-child relationship. I would like to show parent categories as well. Formtastic generated select should look like this one: <sel...

Problem with auto page break in iReport

Hi... I'm using iReport 3.7. I have a report with two subreports (order details and some selling statistics), and a grouping by seller. One subreport is located in the Detail band of the group, and the other one is in the group footer. What's really odd is that no matter how long the report is, when I export it to PDF it's always one ...

grouping strings by similarity

I have an array of strings, not many (maybe a few hundreds) but often long (a few hundred chars). Those string are, generally, nonsense and different one from the other.. but in a group of those string, maybe 5 out of 300, there's a great similarity. In fact they are the same string, what differs is formatting, punctuation and a few wor...

Flex - Grouping Field on XML With Multiple Child Nodes

Hi, I have a Flex AdvancedDataGrid which is fed XML like this: <documents> <document> <name>Jake</name> <skills> <skill>Flex</skill> <skill>Domino</skill> <skill>ASP.NET</skill> </skills> <document> <document> <name>Trevor</name> <skills> <skill>Flex</skill> <skill>C++</skill> <skill>ASP.NET</sk...

Silverlight 3 DataGrid (w/ PagedCollectionView) RowGroupHeaderStyles not reapplied on sort

I am trying to use a DataGrid with hidden group row headers (so that there is a sort boundary). My style simply sets the visibility to collapsed (and I also am setting the SublevelIndent to 0 during the LoadingGroup event). Initial display is exactly what I want, but the data grid is sorted the appearance is unstyled, and the default ...

Need help with XSLT 1.0 and grouping

I have the following XML file: <Promotions> <Promotion> <Category>Arts &amp; Entertainment</Category> <Client>Client Five</Client> <Title>Get your Free 2</Title> </Promotion> <Promotion> <Category>Arts &amp; Entertainment</Category> <Client>Client 5</Client> <Title>Get your Free 4</Title> </Promotion> <...

Grouping several groups in XSLT 2

I'm trying to add hierarchy to some grotty extruded typesetting XML. I can't seem to manage grouping several kinds of groups in the same parent element at once. What I have (simplified, obviously): <article> <h1>A section title here</h1> <p>A paragraph.</p> <p>Another paragraph.</p> <bl>Bulleted list item.</bl> <bl>Another bu...

Possible to fix/disable member groups FAIL when using Doxygen?

I develop an open-source Objective-C framework, and I use Doxygen to generate the documentation (http://dysart.cs.byu.edu/CHDataStructures). Overall, Doxygen does a nice job, but I have a perennial annoyance that I can't figure out for the life of me. I use the \name command and Member Groups to group methods by task (these Apple docs s...

Using grouping to pull together text and then test it

So in this grotty extruded typesetting product, I sometimes see links and email addresses that have been split apart. Example: <p>Here is some random text with an email address <Link>example</Link><Link>@example.com</Link> and here is more random text with a url <Link>http://www.&lt;/Link&gt;&lt;Link&gt;example.com&lt;/Link&gt; near ...

How to select N records for M group in MySQL?

This article elaborates how to select N records each group: http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/ The best solution for this kind of job is: set @num := 0, @type := ''; select type, variety, price, @num := if(@type = type, @num + 1, 1) as row_number, @type := type as du...

Yield multiple objects at a time from an iterable object?

How can I yield multiple items at a time from an iterable object? For example, with a sequence of arbitrary length, how can I iterate through the items in the sequence, in groups of X consecutive items per iteration? (Question inspired by an answer which used this technique.) ...

Display sum of grouped items in ListView

I'm creating a WPF TimeCard app using the MVVM design pattern, and I'm trying to display the sum (total) hours the user has clocked in grouped by each day. I have a ListView with all of the TimeCard data broken into groups using the following XAML: <ListView.GroupStyle> <GroupStyle ContainerStyle="{StaticResource GroupItemStyle}"> ...

How can I hierarchically group data using LINQ?

I have some data that has various attributes and I want to hierarchically group that data. For example: public class Data { public string A { get; set; } public string B { get; set; } public string C { get; set; } } I would want this grouped as: A1 - B1 - C1 - C2 - C3 - ... - B2 - ... A2 - B1 - ......

Select only newest records from table and make this FAST, how?

Good day, I have a question I'm struggling with a lot, hope somebody already found a clever solution to this (I use MySQL). I have table like this: Table `log` ---------- id inserted message user_id My goal is to select last inserted record for user and make this fast. Log table is huge (around 900k records), so my first approach was...

How to extract the most common YEAR from an array of DateTime objects using LINQ

Hi, im trying to extract the most common YEAR from an array of DateTime objects using LINQ. can someone help me? With the following its telling me i need to implement IComparable.. DateTime modeDate = (from c in dates group c by c.Year into g select g).Max(...