count

Retain Count after function call. should i worry?

i usually dont check the retain count untill the program leaks. But today (i donno y) i checked the retain count and now i am confused. NSString *strErrorMessage; strErrorMessage= [NSString stringWithFormat:@"Email and Password are mandatory"]; NSLog(@"%d", [strErrorMessage retainCount]); // retain count 1 [objAppD...

MySQL field type to count bytes filesize

Morning, I'm storing documents informations (Word, excel, ...) in a MySQL database. I have a column "size" where i store the filesize in bytes like 582656, 136260, 383266... But when i order by size, results are a little bit disorder. What type of mysql field should i use ? I've tried VARCHAR and INT, same result. Regards, Emmanuel ...

Django count RawQuerySet

Hay, I'm using django 1.2 and i want to know how to count rows from a raw queryset(RawQuerySet). The traditional .count() method doesn't work. Heres my query query = "SELECT *, ((ACOS(SIN(%s * PI() / 180) * SIN(lat * PI() / 180) + COS(%s * PI() / 180) * COS(lat * PI() / 180) * COS((%s - lon) * PI() / 180)) * 180 / PI()) * 60 * 1.1515)...

Selecting from two tables, with different columns, where one needs a count

I have two tables, TableA and TableB. I need to select one count value from TableA, based on a where condition. I need to select two values from TableB. I'd like all the values in one result set. There will never be more than one row in the result set. Here's what I have now: SELECT count(id) FROM TableA WHERE ($some_where_statement)...

Select item from many-to-many table that has all these details... proper solution?

(PHP/MySQL) Let me preface by saying that this works, and that I'm wondering if there's a cleaner way. This seems a bit... brutish? And I'm not known for my efficient coding. :-/ TABLE (many-to-many) scenid mapid AA 01 AA 02 AA 04 BB 01 BB 04 CC 02 CC 03 CC 05 DD 01 DD ...

Shorten and compact this small SQL snippet (Count and most recent date)

What would be the best way to shorten the following SQL Snippet: SELECT a.ViewCount, b.DateCreated FROM (SELECT COUNT(*) AS ViewCount FROM UserViewHistory uvh1 WHERE (UserID = @UserID) AND (ViewedByUserID = @RequestingUserID)) AS a, (SELECT TOP (1) DateCreated ...

jquery count div that has a display:none attribute

I want to count the div that has a class name "items" and has an attribute "style=display:none". <div id="skills"> <div class="items" style="display:none">1</div> <div class="items">2</div> <div class="items">3</div> <div class="items" style="display:none">4</div> <div class="items" style="display:none">5</div></div> the output should...

[mysql] where query count result > 0

Hi all, I need to do a query like this: SELECT wposts.ID FROM posts wposts WHERE ( SELECT COUNT(ID) FROM surveys WHERE POST_ID = wposts.ID) > 0 but need it to be working ? ...

Count and group non-empty values in MySQL

I need to count the non-empty (by which I mean a string containing at least 1 character) rows grouped by a particular ID. Eg. my data might look like this: form_id mapping 1 'value_1' 1 '' 1 'value_2' 2 '' 2 NULL 3 'value_3' and I want to count the non-empty values for each form, so I ...

C#: Is <Collection>.Count Expensive to Use?

I'm writing a cache-eject method that essentially looks like this: while ( myHashSet.Count > MAX_ALLOWED_CACHE_MEMBERS ) { EjectOldestItem( myHashSet ); } My question is about how Count is determined: is it just an internal int, or is it calculated by counting the elements each time its called? ...

Matlab Bwareaopen equivalent function in OpenCV

hi! Im trying to find similar or equivalent funtion of Matlabs "Bwareaopen" function in OpenCV? In MatLab Bwareaopen(image,P) removes from a binary image all connected components (objects) that have fewer than P pixels. In my 1 channel image i want to simply remove small regions that are not part of bigger ones? Is there any trivial w...

Count what number that appears the most. In VBScript

Hello I got this comma separated file with a bunch of numbers The only thing that I need to be able to do is to find what number that appears the most time Ex: 817;9;516;11;817;408;9;817 then the result will be 817 I hope you understand what I am trying to do. ...

jquery table count rows always returns value of 1

For some reason every time I try to count the number of rows in a table it always returns 1. I am dynamically adding and removing rows to the table, so I'm starting to think it is just counting the number of rows initially configured in the table. here is the code I'm using. $(".elementDelRowButton").live ('click', function (event) { ...

MySQL count total number of rows

I have a complicated MySQL query which takes a lot of time, selecting from a table with more than 150k rows and several JOINS and subqueries. I am limiting the amount of results, but I need to know the total amount of rows. Is there a way not to repeat the query with COUNT(*) as the field to get them? (repeating the query almost doubles...

SQL Query to return 24 hour, hourly count even when no values exist?

I've written a query that groups the number of rows per hour, based on a given date range. SELECT CONVERT(VARCHAR(8),TransactionTime,101) + ' ' + CONVERT(VARCHAR(2),TransactionTime,108) as TDate, COUNT(TransactionID) AS TotalHourlyTransactions FROM MyTransactions WITH (NOLOCK) WHERE TransactionTime BETWEEN CAST(@StartDate A...

Counting how many columns and rows in table of html file.

How can we find how many columns and rows are there in the html file ? How can we count that how many td tags are there in the html file ? ...

Counting Duplicates Integers in Python

How do I find the total number of duplicates in a string? i.e., if it was j= [1,1,1,2,2,2] it would find 4 duplicates? I've only been able to find counting which shows how many times each individual number occurred. ...

How do I use XPath to count the number of nodes with a certain attribute

I can't seem to get an XPath expression to work for my scenario. I want to find all the "Device" nodes that have the type "EndDevice". I'm able to count all the "Device" nodes, and I'm also able to find all "Device" nodes with the "EndDevice" attribute. However, I can't seem to combine them! count(//Device) //works //Device[@xsi:type='E...

NSMutableArray not working properly...(count shouldn't be returning zero!)

NSMutableArray count is returning zero after adding objects to it, its been an hour of hacking away trying to figure out why, and I'm still stuck, so that brings me here. Any ideas based off the following code, what the problem is? the object 'search' is a custom class defined in the header set as a pointer, with retain, nonatomic attr...

Timer Events, Increments, and Resets in C#

A timer is being used in my C# application to determine if an expected event has occured in a timely fassion. This is how I am currently attempting to do this: // At some point in the application where the triggering event has just occured. // Now, the expected event should happen within the next second. timeout = false; timer...