count

How to access Perfmon info?

I would like to get some NCache info as Perfmon sees in (eg: Count) but directly using C#. Does anyone have any code for this, please? ...

deallocated memory in tableview: message sent to deallocated instance

I tried looking up other issues but couldn't find anything to match so here goes: I'm trying to display text in the table view so I use this bit of code: // StockData is an object I created and it pulls information from Yahoo APIs based on // a stock ticker stored in NSString *heading NSArray* tickerValues = [heading componentsS...

How to perform COUNT() or COUNT(*)

I have a list of tags in a database. Ex: villan hero spiderman superman superman I wanted to obtain a sorted list of the tag names in ascending order and the number of times the unique tag appeared in the database. I wrote this code: Ex: SELECT hashtag.tag_name , COUNT( * ) AS number FROM hashtag GROUP BY hashtag.tag_...

LINQ-to-SQL - Join, Count

I have following query: var result = ( from role in db.Roles join user in db.Users on role.RoleID equals user.RoleID where user.CreatedByUserID == userID orderby user.FirstName ascending select new User...

cakePHP and GROUP BY

I am trying to solve a hopefully simple problem here is the query I am trying produce: SELECT `categories`.*, COUNT(`entities`.id) FROM `categories` LEFT JOIN `entities` ON (`categories`.`id` = `entities`.`category_id`) GROUP BY `categories`.`id` I am really struggling to do this is in cakePHP 1.2 How would/should I go about doing t...

MYSQL COUNT and only show results above X

Hey All Is it possible to count all reservations for users and only get results where users have had more than X reservations. Here is my code to just count all user's reservations SELECT u.firstname, u.lastname u.email, COUNT(r.reservation_id) as orders FROM users AS u LEFT OUTER JOIN reservation AS r USING (user_id) GRO...

Beginner SQL question: arithmetic with multiple COUNT(*) results

Continuing with the spirit of using the Stack Exchange Data Explorer to learn SQL, (see: Can we become our own “Northwind” for teaching SQL / databases?), I've decided to try to write a query to answer a simple question (on meta): What % of stackoverflow users have over 10,000 rep?. Here's what I've done: Query#1 SELECT COUNT(*) FROM ...

Check for a unique value within a count, but get all results

I'm trying to create a single query which, similar to stack overflow, will give me the number of votes, but also make sure that the currently viewing user can't upvote again if they've already upvoted. my query currently looks like SELECT cid, text, COUNT(votes.parentid) FROM comments LEFT JOIN votes ON comments.cid=votes.parentid AND...

Can I get facebook unique share count?

Hi, I can get the page's share (click) number in the link-stat table using FQL. What I want to know is the unique share number, in other words can I get the number of users who share (group by Uid) the page. Thanks in advance, Onder ...

Counting number of values between interval

Is there any efficient way in python to count the times an array of numbers is between certain intervals? the number of intervals i will be using may get quite large like: mylist = [4,4,1,18,2,15,6,14,2,16,2,17,12,3,12,4,15,5,17] some function(mylist, startpoints): # startpoints = [0,10,20] count values in range [0,9] count v...

Count number of lines in CSV with Javascript

I'm trying to think of a way to count the number of lines in a .csv file using Javascript, any useful tips or resources someone can direct me to? ...

Django call function when an object gets added

Hay, i have a simple model class Manufacturer(models.Model): name = models.CharField() car_count = models.IntegerField() class Car(models.Model): maker = ForeignKey(Manufacturer) I want to update the car_count field when a car is added to a manufacturer, I'm aware i could just count the Manufacturer.car_set() to get the v...

Update count every second causing massive memory problems

Just on my local machine, trying the run the following script causes my computer to crash... What am I doing wrong? (function($) { var count = '6824756980'; while (count > 0) { setInterval(function() { $('#showcount').html(Math.floor(count-1)); c...

XSLT 1.0 count element with the same value in an attribute, and show it

I have a variable containing: <col p1="Newman" p2="Paul"/> ... <col p1="Newman" p2="Paolo"/> <col p1="Newman" p2="Paul"/> i wold in output a table with in the first column the value of p2 and in the second the number of time it appear. For each value of p2 should i have only a row. <table> <tr><td>p2</td><td>num</td></tr> <tr><td>Pau...

jquery outerwidth submenu items

i'm looking for a way to calculate the total width of de level 2 items and put it in the ul. I have looked at some jquery thinks like outerWidth and .lengt but can't figure it out. thanks in advance $('#menu li:has(ul) ul').each(function() <ul> <li>level 1</li> <li> <ul style="widht:??;"> <li>level 2</li> <li>level 2</l...

How to get the number of rows in a table in a Datastore?

Hi, In many cases, it could be useful to know the number of rows in a table (a kind) in a datastore using Google Application Engine. There is not clear and fast solution . At least I have not found one.. Have you? ...

How to get the number of unread gmail mails (on android)

I've been trying to get the number of unread gmail mails with no luck. I've read Gmail.java and gmail4j both links taken out of this site from this question: Android - How can I find out how many unread email the user has? But still after having read all of that and a couple of other sites that talked about this particular subject my q...

Top 10 unless count is zero

This is probably easy, but eludes me. SQL server2005 I want to show top 100 but if there are not 100 only want to show those and not include zero counts in the result SELECT TOP (100) UserName, FullName_Company, FullName, (SELECT COUNT(*) FROM dbo.Member_Ref ...

Oracle - Count distinct values of a column

Hi I have this table: Reason|Area_Code|Id x dig 1 x dig 2 y dig 3 h util 4 x dig 5 I'm trying for a SQL that returns: Reason|Amount of distinct Reason|Area_code x 3 dig y 1 dig h 1 uti...

What algorithm can I use to determine points within a semi-circle?

How can I do this on a grid with several "centers", and therefore, having coincident points that I want to count only once? What is the most efficient way to do this? ...