Wednesday, April 25, 2012

Notification Service for Blackberry OS 4.5 application

I am developing an application similar to email application.Whenever new message is received my notification service should indicate change to user by updating icon,also, the notification service should continuosly listen to server for incoming events.



I am developing in os version 4.5.





Facebook batch calls with JSONP

As of 10.04.2012,
There is a short paragraph in the Facebook developer document for 'batch request' entitled: Batch calls with JSONP, which reads:



"The Batch API supports JSONP, just like the rest of the Graph API - 
the JSONP callback function is specified using the 'callback' query string
or form post parameter."


I thought that meant you can also do a batch request using JSONP from Javascript (which will be a GET request, as JSONP works only as a GET request), so I tried that, with adding a 'batch' parameter (containing objects describing requests for batch as in the doc) to the query string.
Response from FB server was:



Only POST is allowed for batch requests


So, questions:

1. What did they mean in that paragraph?

2. Is there a way to do an asynchronous batch request from Javascript?





Looking for a WinForms control that can represent time values

I am looking for a third-party open source or commercial WinForms control that can represent the following values:



Total Duration of Task.

Time Elapsed.

Time Remaining.



Have not been able to find one.





When a subclass is instantiated, is only one object created?

Since many constructors also call the superclass constructor, it seems like one could think that both the subclass and the superclass are instantiated when a subclass is instantiated; i.e. more than one object is created.



Is still just one object created?



Thank you





C Program: newbie trying to pass 2D string array into a function

Programming in C ( with -std=C89), and running into errors trying to pass a character string array into a function.



In main(), I've declared the array as follows:



#define ROWS 501
#define COLS 101
void my_function( char **);
...
char my_array[ROWS][COLS];
...
my_function(my_array);


In my_function, I've declared the array as:



void my_function( char **my_array )
{
...
}


I'm getting this error:



warning: passing argument 1 of 'my_function' from incompatible pointer type,
note: expected 'char **' but argument is of type 'char (*)[101]





PHP echo $_SERVER['PHP_SELF'] with added variable?

Just want to do $_SERVER['PHP_SELF'] as a link with ?logout=1 appended to it.



<a href="<?php echo ''$_SERVER['PHP_SELF']'.logout=1' ?>" id="add"><input type="button" value="LOGOUT" /></a>


gives



Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in F:\export\srv\www\vhosts\main\htdocs\php\assign3\m_a2_functions.php on line 90




Redis monitoring info

I'm trying to figure out how to capture the following metrics in redis for monitoring the server. I looked at the INFO command but it does not provide such info.




  1. Operations / sec

  2. a breakdown of commands served, like history of commands served by redis...no of gets, sets, zincrby, zscore etc in the past hour?

  3. Reads per second

  4. writes per second