ArchiveJuly 2012

How to run cronjobs per second in php?

H

To run cronjob per second you have to execute crontab/cronjob per minute and then have to run task in cron file per second using PHP function time_sleep_until(). <?php $start = microtime(true); for($ii=0;$ii<60;$ii++) { //………………………. /// here is the tasks which need to run per second… //………………………. time_sleep_until($start + $ii + 1); } // end for if (!function_exists(‘time_sleep_until’)) {...

PHP Debug Log – Trace Errors

P

“Debug Log” is good sort of tool for monitoring programs. Trouble shooting is quite simple with Log Files. Log file can be used with analysis tools, it’s possible to get a good idea of where errors are coming from, how often errors return. Here you can see a simple PHP script to trace PHP programs… debugLog.php …………………. function debugLog($log, $text) { $log_dir = dirname($log); if( ...

Using URLFOR function in Apex Salesforce

U

While developing your Visualforce pages you may need to be able to obtain the URL of certain actions or your static resources. I found it personally a challenge since the documentation for “URLFOR” function is not included in “Visualforce Developer Guide” itself and instead included in the general help area of Salesforce. Generally you can use the “URLFOR”...

Image Download Function in C#.net

I

public Image DownloadImage(string _URL) { Image _tmpImage = null; try { // Open a connection System.Net.HttpWebRequest _HttpWebRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(_URL); _HttpWebRequest.AllowWriteStreamBuffering = true; // You can also specify additional header values like the user agent or the referer: (Optional) _HttpWebRequest.UserAgent = “Mozilla/5.0...

Web Services with SOAP in PHP

W

The SOAP and XML-RPC extensions are packaged with the PHP 5 installation. The SOAP extension and the XML-RPC extension are not enabled by default in a PHP installation. To enable the SOAP and XML-RPC extensions add the following extension directives in the php.ini configuration file. extension=php_xmlrpc.dll extension=php_soap.dll Restart the Apache server to activate the SOAP and XML-RPC...

Using component in Visualforce

U

Some Visualforce components, such as <apex:pageBlockTable> or <apex:dataTable>, allow you to display information from multiple records at a time by iterating over a collection of records. To illustrate this concept, the following page uses the <apex:pageBlockTable> component to list the available job positions: Visual Force Code: <apex:pageblocktable value=”{...

How to use inbuilt Facebook/Twitter API in iOS6.

H

You need to add Social.framework in your project. Add to your file following #import “Social/Social.h”  You can create 3 type of service: SLServiceTypeTwitter; SLServiceTypeFacebook; SLServiceTypeSinaWeibo; I have created service of Facebook. SLComposeViewController *fbController=[SLComposeViewControllercomposeViewControllerForServiceType:SLServiceTypeFacebook];...

Hello …. Monkey !!!

H

The main issue i used to struggle with while developing android applications was stress testing. As a beginner it was very hectic job to test the application from the naive users perspective. As we develop the application we know what things to do to get the result but to check whether the app responds properly even for wrong events like tapping wrong button etc. Android provided a tool Monkey...

Draw a line by touch On UIImageView in iPhone

D

Its much useful for drawing something on screen by touch. 1) Declare 4 objects in .h file CGPoint lastPoint; BOOL mouseSwiped; int mouseMoved; UIImageView *signImage; 2) First create a UIImageView object ie. a blank image in viewDidLoad signImage = [[UIImageView alloc ] initWithFrame:CGRectMake(15, 60, 290, 320)]; signImage.image = nil; signImage.tag = 1000; signImage.layer.borderWidth = 3.0;...

Category