Hi,
I am developing a iPhone application that uses Facebook APIs.
Which API should I use for incrementing the like count of a Facebook page?
Thanks and regards,
Deepa
I have a table with the below structure.
ID VALUE
1 3.2
2 NULL
4 NULL
5 NULL
7 NULL
10 1.8
11 NULL
12 3.2
15 4.7
17 NULL
22 NULL
24 NULL
25 NULL
27 NULL
28 7
I would like to get the max count of consecutive null values in the table.
Any help would be greatly appreciated.
THanks
Ashutosh
Supposing we have the following records in an SQL Server table.
Date
19/5/2009 12:00:00 pm
19/5/2009 12:15:22 pm
20/5/2009 11:38:00 am
What is the SQL syntax for getting something like this one?
Date Count
19/5/2009 2
20/5/2009 1
Hi there .
I have a A=set of strings and a B=seperate string. I want to count the number of occurences in from B in A.
Example :
A:
10001
10011
11000
10010
10101
B:
10001
result would be 3.(10001 is a subset of 10001,10011,10101)
So i need a function that takes a set and string and returns an int.
int myfunc(set<string> , string){
int result;
// My Brain is melting
return result ;
}
Hello Guys!
I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories.
Category
Id : bigint (PK)
Name : nvarchar(255)
AcceptQuestions : bit
IdParent : bigint (FK)
Question
Id : bigint (PK)
Title : nvarchar(255)
...
IdCategory : bigint (FK)
How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(
this is follow up of this question. count number of foreign keys
i am using doctrine 1.2 and i want to count the number of business that belongs to subcategory.
following are the mysql tables.
1.fi_category
+----+-----------------+-----------------+
| id | name | slug |
+----+-----------------+-----------------+
2.fi_subcategory
+----+-----------------+-----------------+-------------+
| id | name | slug | category_id |
+----+-----------------+-----------------+-------------+
3.fi_business_subcategory
+----+-------------+----------------+
| id | business_id | subcategory_id |
+----+-------------+----------------+
i am using this DQL.
$q = Doctrine_Query::create()
->select('c.name, c.slug, sc.name, sc.slug')
->from('Model_Category c')
->leftJoin('c.Subcategory sc')
->leftJoin('sc.BusinessSubcategory bsc');
which gives me something like this.
Array
(
[0] => Array
(
[id] => 1
[name] => Entertainment & Lifestyle
[slug] => entertainment-lifestyle
[Subcategory] => Array
(
[0] => Array
(
[id] => 1
[name] => Arts and Crafts
[slug] => arts-and-crafts
)
[1] => Array
(
[id] => 2
[name] => Family
[slug] => family
)
[2] => Array
(
[id] => 3
[name] => Fashion
[slug] => fashion
)
)
)
)
i am looking to fetch the number of business, i.e the returned result should be something like this depending on the business it belongs.
Array
(
[0] => Array
(
[id] => 1
[name] => Entertainment & Lifestyle
[slug] => entertainment-lifestyle
[Subcategory] => Array
(
[0] => Array
(
[id] => 1
[name] => Arts and Crafts
[slug] => arts-and-crafts
[business_count] => 35
)
[1] => Array
(
[id] => 2
[name] => Family
[slug] => family
[business_count] => 10
)
[2] => Array
(
[id] => 3
[name] => Fashion
[slug] => fashion
[business_count] => 27
)
)
)
)
tried various ways using DQL, but nothing seems to work out. any idea how should i go with what i want?
Are there any ways to get count of current unfinished tasks at Google Appengine development server? I need it for making my integration test.
I found a way to get this when running it local (just in mem), as described at appengine docs.
But when i'm running it as a standalone server, from maven, this doesn't work. Just because library appengine-testing conflicts with Appengine SDK classes, and i can't use those classes together, when running sdk dev server.
Well,I m trying to list the number of files created today and the count the number of lines in those files.I have to do it in unix.Please suggest how to write script for this.
Hello Guys!
I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories.
Category
Id : bigint (PK)
Name : nvarchar(255)
AcceptQuestions : bit
IdParent : bigint (FK)
Question
Id : bigint (PK)
Title : nvarchar(255)
...
IdCategory : bigint (FK)
How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(
Im tring to make something like a textbox for a console application,
how to limit the Console.Out to only write a defined count of characters from user inputs ?
I have stored resumes in my database and i have retrive it from asp.net web page by creating linkbutton...i can view ,download the resumes which i stored in my database.My issuse is when i view one resume example (domnic resume)then no of visitor for domnic resume should be count .if again i view that resume no of visitor should be 2...how can i do that in asp.net?
When I have a JavaScript array like this:
var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
How to count objects in this array?!I mean how to get a counting result 3, because there're only 3 objects inside: mother, father, brother?!
I'm struggling with an interview question. 3 dimension tables (Product, Store and Date) and 1 fact table (Sales). The question asks for a T-SQL solution that will return the count of products not sold, per store, per day over the past month.
At this point, my answer is futile but I've spent significant time trying to back into a solution, to no avail, and would like to close the loop. Any guidance is greatly appreciated.
How do I find out the most commonly or popularly used count down timer in jquery. I have been looking into this (http://plugins.jquery.com/project/countdown2) but not sure if this is well supported. Is there a some kind of a ranking system for the jquery plugins
I have two tables, one called calendars and one called events. There can be multiple calendars, and multiple events in a calendar. I want to select every calendar, also getting the number of events in the calendar.
Right now I have :
SELECT C.*, COUNT(*) AS events FROM `calendars` AS C
LEFT JOIN `events` E ON C.ID=E.calendar
GROUP BY C.ID
But that doesn't work. Items with no events still return 1. Any ideas?
We put our website advertisement in 2 other websites. We need to count the hits we are getting form those advertisement and like to store it in my database. Please give me an idea to do that.
Approach #1:
DECLARE @count int
SET @count = 2000
DECLARE @rowcount int
SET @rowcount = @count
WHILE @rowcount = @count BEGIN
DELETE TOP (@count) FROM ProductOrderInfo
WHERE ProductId = @product_id
AND bCopied = 1 AND FileNameCRC = @localNameCrc
SELECT @rowcount = @@ROWCOUNT
WAITFOR DELAY '000:00:00.400'
Approach #2:
DECLARE @count int
SET @count = 2000
DECLARE @rowcount int
SET @rowcount = @count
WHILE @rowcount = @count BEGIN
DELETE FROM ProductOrderInfo
WHERE ProductId = @product_id AND FileNameCRC IN
(
SELECT TOP(@count) FileNameCRC
FROM ProductOrderInfo WITH (NOLOCK)
WHERE bCopied = 1 AND FileNameCRC = @localNameCrc
)
SELECT @rowcount = @@ROWCOUNT
WAITFOR DELAY '000:00:00.400'
END
I'm trying to make something like a textbox for a console application,
how to limit the Console.In to only read a defined count of characters from user inputs ?
I am trying to figure out how to create a timer for my C8051F020 MCU. The following code uses the value passed to init_Timer2() with the following formula:
65535-(0.1 / (12/2000000)=48868.
I set up the timer to count every time it executes and for every 10 counts, count one second. This is based on the above formula. 48868 when passed to init_Timer2 will produce a 0.1 second delay. It would take ten of them per second. However, when I test the timer it is a little fast. At ten seconds the timer reports 11 seconds, at 20 seconds the timer reports 22 seconds. I would like to get as close to a perfect second as I can.
Here is my code:
#include <compiler_defs.h>
#include <C8051F020_defs.h>
void init_Clock(void);
void init_Watchdog(void);
void init_Ports(void);
void init_Timer2(unsigned int counts);
void start_Timer2(void);
void timer2_ISR(void);
unsigned int timer2_Count;
unsigned int seconds;
unsigned int minutes;
int main(void)
{
init_Clock();
init_Watchdog();
init_Ports();
start_Timer2();
P5 &= 0xFF;
while (1);
}
//=============================================================
//Functions
//=============================================================
void init_Clock(void)
{
OSCICN = 0x04; //2Mhz
//OSCICN = 0x07; //16Mhz
}
void init_Watchdog(void)
{
//Disable watchdog timer
WDTCN = 0xDE;
WDTCN = 0xAD;
}
void init_Ports(void)
{
XBR0 = 0x00;
XBR1 = 0x00;
XBR2 = 0x40;
P0 = 0x00;
P0MDOUT = 0x00;
P5 = 0x00; //Set P5 to 1111
P74OUT = 0x08; //Set P5 4 - 7 (LEDs) to push pull (Output)
}
void init_Timer2(unsigned int counts)
{
CKCON = 0x00; //Set all timers to system clock divided by 12
T2CON = 0x00; //Set timer 2 to timer mode
RCAP2 = counts;
T2 = 0xFFFF; //655535
IE |= 0x20; //Enable timer 2
T2CON |= 0x04; //Start timer 2
}
void start_Timer2(void)
{
EA = 0;
init_Timer2(48868);
EA = 1;
}
void timer2_ISR(void) interrupt 5
{
T2CON &= ~(0x80);
P5 ^= 0xF0;
timer2_Count++;
if(timer2_Count % 10 == 0)
{
seconds++;
}
if(seconds % 60 == 0 && seconds != 0)
{
minutes++;
}
}
I would like to understand how exactly does sql count work. Is it a whole table scan that happens or is it some property of the table that is read. However I feel a table scan would be an overhead in case of huge tables with lots of records.
Hello,
I wanna count the words and spaces from a Word document and insert then in a header (or footer).. as numbers. I know i can SEE these statistics (from Tools menu), but how can i insert them in a header?
Thanks
I'm having issues with the maximum nametable char count quota, I followed a couple of answers here and it solved the problem for a while, but now I'm having the same issue.
My Server side config is as follows:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="GenericBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="1000000" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="REMWCF.RemWCFSvc">
<endpoint address="" binding="netTcpBinding" contract="REMWCF.IRemWCFSvc" bindingConfiguration="GenericBinding" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9081/RemWCFSvc" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
I also have the same tcp binding on the devenv configuration.
Have I reached the limit of contracts supported? Is there a way to turn off that quota?
EDIT
Error Message:
Error: Cannot obtain Metadata from
net.tcp://localhost:9081/RemWCFSvc/mex If this is a Windows (R)
Communication Foundation service to which you have access, please
check that you have enabled metadata publishing at the specified
address. For help enabling metadata publishing, please refer to the
MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange
Error URI: net.tcp://localhost:9081/RemWCFSvc/mex Metadata
contains a reference that cannot be resolved:
'net.tcp://localhost:9081/RemWCFSvc/mex'. There is an error in the
XML document. The maximum nametable character count quota (16384)
has been exceeded while reading XML data. The nametable is a data
structure used to store strings encountered during XML processing -
long XML documents with non-repeating element names, attribute names
and attribute values may trigger this quota. This quota may be
increased by changing the MaxNameTableCharCount property on the
XmlDictionaryReaderQuotas object used when creating the XML reader.
I'm getting that error when trying to run the WCF (which is hosted in a windows service app).
Our Flash widget is quite popular on the web.
There is a link to our web-site embedded inside the widget.
Does Google count this link as a back link to the site?
I'm currently doing this query to find the guy who makes the most calls:
SELECT `commenter_name`, COUNT(*) AS `calls` FROM `comments` GROUP BY `commenter_name` ORDER BY `calls` LIMIT 1
What I want now is to be able to find out how many total unique callers. I tried using DISTINCT but I didn't get anywhere.