count

Iphone NsMutableArray Count

I have a struct SystemStruct *sharedStruct = [SystemStruct sharedSystemStruct]; implemented as a singleton, to share 3 Arrays. the problem is that when i try to count the array's objects the system crash. es: This code Crash: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { SystemStruct *Sha...

Display number of retweets of a blog post

Hi, I was wondering if anyone has a link to any information regarding building in Twitter Mention functionality into a website like here, http://paul.boagworld.com/?page=2, where each post dispays the number of times it has been mentioned on twitter. Many thanks, C ...

Counting records in C# using LINQ

I have a simple SQL query: Select ID, COUNT(ID) as Selections, OptionName, SUM(Units) as Units FROM tbl_Results GROUP BY ID, OptionName The results I got were: '1' '4' 'Approved' '40' '2' '1' 'Rejected' '19' '3' '2' 'Not Decided' '12' I have to encrypt the data in the database, and as such am unable to sum the data in relati...

ASP.Net Count Download Clicks

Hello, I thought that this was easier… I have a asp:hyperlink control, with target=”_blank”, pointing to the file I want the user to download. My plan is to track the number of times, the users click on this link. I thought in placing it in ajax update panel, to catch the postback and avoid full page refresh. However, hyperlink does...

Need Help With Hibernate/SQL Query Count Logic

I have the following query: SELECT DISTINCT w.name, count(*) FROM widgets AS w JOIN w.entity AS e JOIN e.article AS a JOIN a.document AS d WHERE d.id IN (<document ids>) GROUP BY w.name The problem is that count(*) returns the number of widget-entity associations. Instead, what I'm looking for is the number of unique widget names, per...

Linq, double left join and double count

Hi! I'm looking to translate this SQL statement to a well working & performant LINQ command. I've managed to have the first count working using the grouping count and key members, but don't know how to get the second count. select main.title, count(details.id) as details, count(messages.id) as messages from main left outer join detail...

DB2 SQL count in join or where clause

This is probably an amateur question but I'm an amateur ! ;o) I have several tables: Account table, Officer table, Location table, Web table... The Officer table doesn't give me the number of officers per account. I need to retrieve only the accounts that have more than 20 officers. Should I use the COUNT ? If so, how ? Your help is...

Python: Count lines and differentiate between them

I'm using an application that gives a timed output based on how many times something is done in a minute, and I wish to manually take the output (copy paste) and have my program, and I wish to count how many times each minute it is done. An example output is this: 13:48 An event happened. 13:48 Another event happened. 13:49 A new ev...

count on LINQ union

I'm having this link statement: List<UserGroup> domains = UserRepository.Instance.UserIsAdminOf(currentUser.User_ID); query = (from doc in _db.Repository<Document>() join uug in _db.Repository<User_UserGroup>() on doc.DocumentFrom equals uug.User_ID where domains.Contains(uug.UserGroup) select doc) .Union(fro...

conditions on count in a select

Hi, i have a table like this: Table(MissioneID, Type) Type can be 1,2 or 3 i have to count missions by type value: ex. if table's content is: MissioneID Type 1,1 1,2 1,1 2,3 1,2 The result of query is MissioneID,Count1,Count2,Count3 1, 2,2,0 2,0,0,1 How can i do? thanks ...

NSMutableArray: count is a method or a property?

I want to verify if I'm in the last cell of the UITable. Should I use a NSInteger property in my controller and store the value of the count of the data (it's an NSMutableArray) that populates the table? I'm asking because I don't know if count iterates over all objects of the array to count or if it only gets me a value of a count prop...

SQL Count in View as column

I'm trying to get the result of a COUNT as a column in my view. Please see the below query for a demo of the kind of thing I want (this is just for demo purposes) SELECT ProductID, Name, Description, Price, (SELECT COUNT(*) FROM ord WHERE ord.ProductID = prod.ProductID) AS TotalNumberOfOrders FROM tblProducts p...

mysql join 3 tables and count

Please look at this image here is 3 tables , and out i want is uid from table1 industry from table 3 of same uid count of fid from table 2 of same uid like in the sample example output will be 2 records Thanks ...

MySQL count problem

I have 3 tables users(id,name),groups(id,name) and users_groups(user_id,group_id). users and groups have many to many relationship, so the third one is for storing users and groups relations. I would like to select all the data from groups with user count in each group. So far I came up with this: SELECT groups.*, COUNT(users_groups.use...

sql query - how to count values in a row separately?

I have a table that looks something like this: id | firstperson | secondperson 1 | jane doe | 2 | bob smith | margie smith 3 | master shifu | madame shifu 4 | max maxwell | I'm trying to count all of the firstpersons + all of the secondpersons, if the secondpersons field isn't blank... Is there a way to do that? ...

[Rails] I have a has_many relationships and I want to set custom limit and offset. as well as to count them.

Hy, My code: @profile.images and i would like to get only 10 images at time and with a 10 offset, like this @profile.images(:limit => 10, :offset => 10) and not like this has_many :images, :limit => 10, :offset => 10 Then I would like to count in someway all the images for that profile. @profile.count_images Thanks (: ...

MS-Access 2007 Time Online Report

I have the following data in my database: MemberID | DateTime ------------------------------------- 1 | 31/03/2010 3:45:49 PM 2 | 31/03/2010 3:55:29 PM 1 | 31/03/2010 4:45:49 PM Every time a user is authenticated or un-authenticated this log appears in the database. What I want to be able to do is total th...

getting count(*) using createSQLQuery in hibernate?

I have several sql queries that I simply want to fire at the database. I am using hibernate throughout the whole application, so i would prefer to use hibernate to call this sql queries. In the example below i want to get count + name, but cant figure out how to get that info when i use createSQLQuery(). I have seen workarounds where p...

Java : Count even values in a Binary Search Tree recursively

Hi, I need to find out how many even values are contained in a binary tree. this is my code. private int countEven(BSTNode root){ if ((root == null)|| (root.value%2==1)) return 0; return 1+ countEven(root.left) + countEven(root.right); } this i just coded as i do not have a way to test this out. I'm not able to test it out at th...

R counting the occurrences of similar rows of data frame

I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 ...