count

jquery count elements with attribute

Can I count the number of elements with a specific attribute? For example all the images with the src attribute test.gif ...

Flex - How to count colors in .SWF vector file

Suppose I've converted a vector image file (.AI/.SVG) to .SWF for ease of importing dynamically as the source of an Image in Flex. To count colors now, I have to create a "new BitMap", then ".draw()" and iterate over all pixels and use ".getPixel()" to retrieve the color. Unfortunately, because of anti-aliasing, this seems to return se...

How to count each digit in a range of integers?

Imagine you sell those metallic digits used to number houses, locker doors, hotel rooms, etc. You need to find how many of each digit to ship when your customer needs to number doors/houses: 1 to 100 51 to 300 1 to 2,000 with zeros to the left The obvious solution is to do a loop from the first to the last number, convert the counter...

ListView Running total

Hi, I have a listview and would like to calculate a running total of values. every dataitem that I have bound to my listview, has an "amount". on ListView1_ItemDataBound, I would like to get the data item's "amount" value, but I cannot find how to access the item. This is kind of similar, i think, except I want a running total, not a t...

Exclude records from one table based on count in joined table

I have two tables: Coupons and Responses. The Coupons table includes fields such as: VendorID [key] CouponID [key] CouponDescription The Responses table includes fields such as: RespondentID [key] CouponID [key] (VendorID not repeated in this table.) Accepted [true/false] Rejected [true/false] Rating [1 to 5] When someone accept...

sql : How to count two rows with the same DATE and TIME as 1 row

ID | Date | Status | Physician ID 44397479 10/13/2009 17:40 NOSHOW 44397480 10/13/2009 16:40 CHECKED OUT 108 44397481 10/13/2009 14:32 CHECKED OUT 108 44397482 10/14/2009 10:44 RESCHEDULED 108 44397483 8/26/2009 12:35 RESCHEDULED ...

Linq with group by having count

Hi, how do I write this query in linq (vb.net)? select B.Name from Company B group by B.Name having COUNT(1) > 1 ...

SQL WHEREing on a different table's COUNT

So, I want to apply a WHERE condition to a field assigned by a COUNT() AS clause. My query currently looks like this: SELECT new_tags.tag_id , new_tags.tag_name , new_tags.tag_description , COUNT(DISTINCT new_tags_entries.entry_id) AS entry_count FROM (new_tags) JOIN new_tags_entries ON new_tags_entries.tag_id = n...

selecting COUNT(*) sometimes returns 0, and sometimes returns nothing

I am trying to find the number of different things in my database, using SELECT COUNT(*). The problem is when there are zero -- For example, SELECT COUNT(*) FROM `images` WHERE `approved` = '1' If there are no results, I will still get a 0 back and can check $result['COUNT(*)']. But with this query, SELECT COUNT(*) , `first_name` ,...

(How) can I count the items in an enum?

This question came to my mind, when I had something like enum Folders {FA, FB, FC}; and wanted to create an array of containers for each folder: ContainerClass*m_containers[3]; .... m_containers[FA] = ...; // etc. (Using maps it's much more elegant to use: std::map<Folders, ContainerClass*> m_containers;) But to come back to my or...

count file rows C#

i want to know how much lines i have in my file, how can i do it in a simple way( i mean, not to go through on all over the file and count each line) is there a command for that? ...

iPhone COUNT going up in increments of 3

I've managed to get my app to count the number of actions on an IBAction button, and then perform a different task once the number of clicks exceeds 10. Unfortunately, the Count seems to be increasing by 3 at a time, instead of 1. Any ideas what I've done wrong here? - (IBAction) do_button_press:(id)sender { static int count = 0; ...

How can I count overlapping substrings in Perl?

i need to implement a program to count the occurrence of a substring in a string in perl. i have implemented it as follows sub countnmstr { $count =0; $count++ while $_[0] =~ /$_[1]/g; return $count; } $count = countnmstr("aaa","aa"); print "$count\n"; now this is what i would normally do. however, in the implementation above ...

MYSQL count child table with other modifiers - help please!

I have a ticket purchasing database and want to collect all of the orders that meet certain criteria, and then also grab the total number of tickets each order has by counting the rows in the 'orders_tickets' table that match the orderID. If I make the SQL a simple call, this SQL works: SQL A: SELECT o . * , COUNT( ot.OrderTicketID )...

Batch file: store lines of command's output without writing to a file?

Windows XP My batch file runs a command that has several lines of output. How can I count (and store in a variable) the lines of output without ever writing to the disk? ...

Excel Help: Sum or Count until?

Ok, so here's my problem... and I'll preface this by saying that I'm pretty well-versed in Excel; however, I've very little knowledge about the INDIRECT function (so if it's something obvious with the INDIRECT function, please excuse my newb-ness). I'm trying to make my Compliance Worksheet a bit more efficient. I have a list of contro...

Show Only Pings (Pingbacks+Trackbacks) Number on Wordpress

Is there a way to display just ping counts (number) on Wordpress? Actually there are comments_number function but that showing total count of comments, pingbacks and trackbacks. ...

Zend Framework. The best solution to calculate rows in the table.

Hi, guys! I'm newbie in ZF and have some stupid question: What's the best solution to calculate rows in the table if I work with inherited object of Zend_Db_Table_Abstract class? For my first web application I use QuickStart tutorial (link text) so if I want to calculate count of rows in the table in controller the simplest solution ...

SQL View. Select count... Where...

I am most confused with this one, so i d better ask the experts! These are the rows returned by a custom query of mine. Col1 Col2 Result Font Bold a Font Bold b Font Bold a Font Italic a Is there any way of using selecting count in the above (table) results in order getting this one? Col1 Col2 ResultA ResultB ...

SQL count many-to-many values or have it counted every time new row is added?

I am using MySQL (MyISAM) 5.0.41 and I have this query: SELECT `x`.`items`.id, `x`.`items`.name, COUNT(*) AS count FROM `x`.`items` INNER JOIN `x`.`user_items` ON `x`.`items`.id = `x`.`user_items`.item_id GROUP BY name HAVING count > 2 ORDER BY count DESC I have about 36,000 users, 175,000 user_items and 60,000 items which...