grouping

HTML Checkbox grouping

Hello, Normally HTML check boxes are grouped based on name. Is it possible to group check box other than name? Thank You! ...

Javascript Regex multiple group matches in pattern

I have a question for a Javascript regex ninja: How could I simplify my variable creation from a string using regex grouping? I currently have it working without using any grouping, but I would love to see a better way! The string is: var url = 'resources/css/main.css?detect=#information{width:300px;}'; The code that works is: var s...

XSLT 1.0 grouping to reformat element defined by date into element defined by task

Hi folks, I have a tricky XSLT transformation and I'd like your advise My xml is formatted as below: <Person> <name>John</name> <date>June12</date> <workTime taskID=1>34</workTime> <workTime taskID=2>12</workTime> </Person> <Person> <name>John</name> <date>June12</date> <workTime taskID=1>21</workTime> <workTime taskID=2>11</workTime> ...

How do you create a nested LINQ Grouping / Lookups for a Collection of Objects

Given a list of objects with a date and decimal, I would like to index these objects by the year, month, dayofweek and hour of the date. In .NET 2.0, I would have created this graph using a set of nested dictionaries and a list as the leaf node. I am interested in how this could be done with LINQ. ...

How do I add totals/subtotals to a set of results without grouping the row data?

I'm constructing a SQL query for a business report. I need to have both subtotals (grouped by file number) and grand totals on the report. I'm entering unknown SQL territory, so this is a bit of a first attempt. The query I made is almost working. The only problem is that the entries are being grouped -- I need them separated in the rep...

How can I tell if a set of parens in Perl code will act as grouping parens or form a list?

In perl, parentheses are used for overriding precedence (as in most programming languages) as well as for creating lists. How can I tell if a particular pair of parens will be treated as a grouping construct or a one-element list? For example, I'm pretty sure this is a scalar and not a one-element list: (1 + 1) But what about more compl...

mysql first record retrieval

While very easy to do in Perl or PHP, I cannot figure how to use mysql only to extract the first unique occurence of a record. For example, given the following table: Name Date Time Sale John 2010-09-12 10:22:22 500 Bill 2010-08-12 09:22:37 2000 John 2010-09-13 10:22:22 500 Sue 2010-09-0...

How to group rules in jquery

Hi I've got a simple question. I've this code below, i use ajax three times in very similiar ways the only things that change are the data passed and the id of the target. Is there a way to group these instructions in a simple one? Thx D. $('#fld_email').focusout(function() { var request_email = $(this).val(); ...

How do I select and group by a portion of a string?

Given I have data like the following, how can I select and group by portions of a string? Version Users 1.1.1 1 1.1.23 3 1.1.45 1 2.1.24 3 2.1.12 1 2.1.45 3 3.1.10 1 3.1.23 3 What I want is to sum up the users using version 1.1.x and 2.2.x and 3.3.x etc, but I'm not sure how I can group on a partial string in a selec...

intersection regular expression with groups, how to derive the intersection of the grouped bit?

I'm currently trying to solve a problem that's similar to http://stackoverflow.com/questions/2338716/testing-intersection-of-two-regular-languages with the exception that I know how to do the intersection, but have an additional requirement. The intersection logic I intend to use is the Dragon Book's algorithm for converting an NFA to a...

"Invalid Column Name" error thrown by Access Reports?

I am attempting to sum over a detail grouping on a specific field in Microsoft Access, and assign that sum to a field in the general grouping. When I try to run the report, I get an "Invalid Column Name" error with the detail field getting the error. Has anyone previously encountered this? If so, any ideas what might be causing it or how...

XSLT: generate multiple object by incrementing attribute and value

Hi, I have a xml as below that I'd like to copy n times while incrementing one of its element and one of its attribute. XML input: <Person position=1> <name>John</name> <number>1</number> <number>1</number> </Person> and I'd like something like below with the number of increment to be a variable. XML output: <Person position=1> <na...

How to allow users to select their own grouping for a .NET TreeView control

I am using a treeview to display projects, tasks, time entries, and the people who are working on a project. I would like to allow the user to define a custom grouping (ie. Project->Task->Time Entries or Project->Date (of time entry)->Task->TimeEntry). The relevant groups would be Project, Task, Time Entry, and Person, with some meta...

XSLT: copy object xml multiple times while incrementing attribute and value

Hi, I have a xml as below that I'd like to copy n times while incrementing one of its element and one of its attribute. XML input: <?xml version="1.0"?> <header xmlns="http://test.com" > <Batch> <test document="dump" > <Person position=1> <properties> <name>John</name> <number>1</number> </properties> </Person>...

An algorithm for sorting & grouping a list of weighted objects

I have a number of chunks of data. For arguments sake we'll say they are File 1 - 150Kb File 2 - 50Kb File 3 - 70Kb File 4 - 60Kb File 5 - 70Kb File 6 - 100Kb File 7 - 90Kb For transmission, I can package these up into a max payload of 300Kb. If you just iterate through them in order you'd get TRANS1: 150Kb + 50Kb + 70Kb = 270...

Linq to sum on groups based on two columns

Hi, I have a class as below: Class Financial { string Debit; string Credit; decimal Amount; } And I have a list with objects of this class, with multiple records. All I need is to perform a groupped sum, something like in sql Select debit, Credit, sum(amount) group by Debit, Credit I tried with a statement as below: f...

LINQ aggregate across more than one table

I want to replicate this query in LINQ to SQL but am too unfamiliar with how to do it. SELECT A.Recruiter, SUM(O.SaleAmount * I.Commission) --This sum from fields in two different tables is what I don't know how to replicate FROM Orders AS O INNER JOIN Affiliate A ON O.AffiliateID = A.AffiliateID INNER JOIN Items AS I ON O.ItemID = I.I...

How can I collapse Silverlight DataGrid Groups using MVVM?

I'm using MVVM in a Silverlight application. So I use a PagedCollectionView as property of my View Model to bind it to a DataGrid ItemSource. But I have this requirement: "all groups in the Grid should be collapse when the user control is loaded.". As I'm using a Page collection View I used this code: this.PinesView = new PagedColl...

SQL Server 2005 Reporting Services: How to count rows that are not null? Any hints for calculating totals?

Using Reporting Services in SQL Server 2005: Is there a way to count only records that are not null; similar to "COUNTA" in Excel? I would think this would be very simple process, but nothing I have tried has worked. For example, I have tried using the following expression for "Completed", which is one column I am trying to count: =count...

LINQ. Grouping by days. How to do this easily?

I can't seem to find any god reference on this. I have alot of data in SQL with dates. So I wanted to make a line chart to show this data over time. If I want to show it over a perioud of days then I need to group by days.. But the LOGDATE is the full date.. not the DAY.. So I have this below.. but LINQ doesnt know what 'DayOfYear' pro...