Archive

Posts Tagged ‘ipad’

Google new chart API

September 28, 2011 Leave a comment

Hi All,

 

A new API from Google that generates information charts in a dynamic way. its usage is quite straightforward: you link to an image in the form of a parameterized URL, such as http://chart.apis.google.com/chart?cht=p3&chd=t:90,49&chs=400×200&chl=data|bling.

“cht=p3? is the chart type, in this case, a pie chart.

 

“chd=t:90,49? are the chart values, text-encoded, and separated by a comma.

“chs=400×200? is the custom chart size, 400 by 200 pixels.

“chl=Data|Bling” are the different labels for the pie chart sections, separated via the pipe character.

chart types include: line charts, bar charts, pie charts, Venn diagrams & scatterplots.

View Demo

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Advertisements
Categories: Androide developer, CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance Programmer India, freelance web designer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, iphone application developer, iphone developer, iphone website designer, JavaScript, jquery, mysql, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, PHP Programmer India, Php programming, tips & trics, url rewriting, web design india, web designer, web designer india, Web Developement Company USA, web developer ahemdabad india, web developer india, Web development India, Word Press Reserch, wordpress, Wordpress Blog Developer, Wordpress Customization Services, Wordpress Developer, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india, x-cart Tags: , , , , , , , , , , , , , , , , , , , , ,

Optimizing PHP Through Habits

September 23, 2011 Leave a comment

What has been a long interest of mine in writing simple, maintainable and secure (a.k.a. Good[tm]) code, has forked off the offspring of optimization.

There are nummerous discussions in the blogosphere about whether to use echo versus print, iffor() is faster than while(), etc. and though the gains are usually very small, I desided to add my thoughts to the debate.

I found an article on optimization through coding habits in Ilia Alshanetsky’s zend performance slides and decided to test some of the claims. My test machine is my MacBook Pro 1.83GHz w. 2GB RAM, MacOS X 10.4.9, Apache 1.3 and PHP 5.2 (with Xdebug 2.0). I also have lots of applications running.

  • Peter Bowyer claims that require_once() is 3-4 times slower than require(). Ilia also says they are bad. My testing reveals the exact opposite with an empty include file. Callingrequire_once() 10000 times in a for() loop with an empty file is 4x faster.
  • Ilia advises against using magic functions like __autoload() and __get(), but the advantage of __autoload() in particular is obvious in any large project and is used by many phpframeworks. My primitive testing, however, shows inverse results. With a simply autoload requiring a class and 10000 loops of new Foo() versus require_once('foo.php'); new Foo() shows that __autoload() is ~3.7 times faster. I saw no difference between real methods and __get(), although the logic inside __get() will add some overhead.
  • If a class method can be static, declare it static. Speed improvement is by a factor of 4. I get a 50% speed increase (614ms vs. 414ms with 100000 iterations).
  • Avoid function calls within for() loop control blocks. In for( $i=0; $i<count($x); $i++ )the count($x) is called at every iteration.
  • Always, always quote array keys. $row['id'] is way faster than $row[id]. Ilia says 700%, I say about 200%.
  • Avoid regex if possible. Use ctype_digit($foo); rather than preg_match("![0-9]+!", $foo);.
  • Get rid of ‘harmless’ error messages – they take time to generate and output. The error supression operator @ is slow, so avoid when possible. With error_reporting set to E_ALL | E_STRICT on my machine, doing echo $rows[id] 10000 times instead of echo $rows['id]takes 38 times longer.

     

    UPDATE: To summarize, this slow code runs in 500ms (although this time will vary a great deal depending on your error_reporting level):

     

     

     

     

    $rows = array_fill(0, 10000, array('id'=>0));
    require_once('foo.php');
    for( $i=0; $i < count($rows); $i++) {
        foo::notdeclaredstatic();
    
        $rows[$i][id] = 0;
    }
    
    
    
    
    By using the techniques above, it can be made to complete in 68ms:
    
    $rows = array_fill(0, 10000, array('id'=>0));
    function __autoload($classname) { require_once( 'foo.php'); }
    $size = count($rows);
    for( $i=0; $i < $size; $i++) {
        foo::declaredstatic();
    
        $rows[$i]['id'] = 0;
    }
    
    
    10000 iterations is a lot for one request to a page. Using the techniques, the code became roughly 7 times faster.
    
    I am not out to prove Ilia wrong - he knows PHP better than most - and 
    for all I know, they could have optimized those very functions in PHP 5.2. I am, however, 
    interested in seeing what can be done to optimize PHP performance simply by doing things differently,
    by tweaking one's coding style. It would appear that there are improvements, albeit small, to achieve 
    from minimal effort. Plus I was surprised by the discrepancies I found compared to Ilia's recommendations.
    
    

     

Timezones in MySQL and PHP

September 22, 2011 Leave a comment

Timezones in web applications are often dealt with the same way as character sets. Either incorrectly or ignored. The case of unicode is improving slowly as developers discover the need for international language support.
The problem with not handling timezones correctly is not apparent in the usual case of the webserver and the database server being in the same timezone. A lot of PHP code passes the task of timestamps on to MySQL, e.g. by calling NOW() on inserting or updating records. It is nessesary to know in what timezone the timestamps are stored to process them correctly.

Often a specific timezone is assumed for displaying date and time. This could very well be incorrect for a large number of visitors. If the database server is in yet another timezone, things begin to get out of sync.

MySQL’s handling of timezones is – obviously – separate from that of PHP. Along with the fact that the MySQL timezone can only be changed by users with SUPER privileges, this means that MySQL cannot be relied on for creation of timestamps in correct timezone. In other words, the usual call toNOW() is not an option.

PHP 5.1 introduced the date_default_timezone_set() method for setting the timezone PHP will use for functions like date() (or alternatively the date.timezone php.ini directive). This allows for a flexible and consistent way of creating timestamps in the correct timezone form within PHP. One user in London might start a thread while a response comes from New York. To handle this consistently and make sure both users see local time and the correct timespan between the posts, use date_default_timezone_set() to create the timestamps from PHP in a fixed timezone like GMT.

Time for an example to illustrate the practical use of this. I created a simple class Timer for dealing with these operations. The methods will be called statically as there is no need to instantiate the class.


class Timer 
{   
    static function DatetimeInGMT() {
        return date("Y-m-d H:i:s", time()-date("Z",time()));
    }

    static function GMTDatetimeToLocal($datetime) {
        $time = strtotime($datetime);
        return date("Y-m-d H:i:s", $time+date("Z",$time));
    }
}


Timer::DatetimeInGMT() produces a timestamp in GMT. I use it instead of MySQL’s NOW()because it calculates the time relative to the timezone set in PHP rather than that of MySQL.

When reading the timestamp back in to PHP, another function call is needed to convert it back to whatever timezone PHP is in at that time (it might be a different user viewing with another timezone setting). That’s the job of Timer::GMTDatetimeToLocal($datetime).

These two very simple functions and a correct setting of PHP’s timezone will ensure that dates are stored in a consistent way and displayed correctly.

 

 

Hire PHPBB Developer for Robust Web Forum Development

September 21, 2011 Leave a comment

In the online business, businessmen suppose to be using various web techniques to promote the business on the web. The more interaction with the related entities can open the more avenues for the business and one of the best modes of interaction and sharing information on the web is forums.Internet forums with business websites can do amazing business promotional work. Developing web forum involves a fair programming work that is complex for novice businessmen. One of the popular & unique PHPBB (PHP Bulletin Board) systems for developing robust internet forums to business websites is available in the web development. PHPBB softwareis based on PHP programming language. However, web forums can be developed using various other computer programming languages such as Perl, Java and ASP. Internet forum development for websites is complex and costly process. Businessman can hire PHPBB developer / programmerfor making it cost-effective & customize to use with business website.

Internet forums are efficient tool to use with business as they incredibly great source to reach and converse with people. Designing, developing and hosting of internet forums is costly process and small businessman or online business company suppose to seek affordable alternative. As PHP is an open source scripting language and hire dedicated PHPBB developer is the best option that can save precious money. He can specially build or performPHPBB development, customize it and host cost – effectively. Anyone in the online business can hire PHPBB Developer from PHP Web Development Company. The concept of hiring dedicated developer is popular in the present times, which is very helpful in technical terms as well as in the matter of affordability. Customized designing, development and hosting all three can be derived from one professional. Moreover, a hiredPHPBB Developer can provide the benefits or implement the features of all updated versions such as PHPBB2 & PHPBB3 into business.

Categories: .htaccess, CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, freelance web, freelance web designer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, Hire Web Developer India, india web development, Indian Freelancer, iphone 4, iphone application developer, iphone developer, JavaScript, joomla customization india, Joomla Developer, joomla developer india, jquery, mysql, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, Php programming, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, web developer india, wordpress, Wordpress Blog Developer, Wordpress Customization Services, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india, x-cart Tags: , , , , , , , , , , , , , , , , , , ,

Speed up Page Load by reducing HTTP requests with PHP

September 20, 2011 Leave a comment

A nice technique to speed up your page loading times is to try to reduce the amount of calls your browsers has to make to the server. This will be every image, every css and every JavaScript file included in the webpage. Each time you want to load in one of these elements you will be sending a request to the server which will return the requested object known as a HTTP request.

Reduce Page Loading Time With PHP

Each one of these uses up time on your page loading, so to reduce page load all you have to do is reduce the amount of calls being made. But what if you want to organise you JavaScript files, jquery file, general file, application file and page file. There could be upto 4 requests for some javascript for the page.

It is possible in PHP to combine these JavaScript files together and trick the browser into thinking they are just one JavaScript file, therefore reducing the amount of calls being made to the server. This is done by reading the JavaScript with PHP then changing the header to JavaScript like the example below.

Create a PHP file and use the readfile function to bring in your Javascript files then change the header to Javascript and the server will treat this page as Javascript.

 
readfile(jquery.js');
readfile(general.js');
readfile(jquery-ui.js');
readfile(page.js');
header('Content-type: text/javascript');


The above technique can also be used with CSS files or a combination of them both.

Ouch! I’ve Been Banned By Google!

September 19, 2011 Leave a comment

 

This question has become very common these days. Waking up to find out that your site has disappeared from the rankings of Google is shocking and nothing can be worse than for someone who runs an  business that this. There are certain times when the website does not rank for its own name. These are very clear signs that your site has been banned by .

 

Google does not offer any warnings before it bans your site. You will only be able to find out when the visitors to your site drops considerably. This will be followed by the sales reducing by a high margin. A high percentage of site owners may be left without an understanding of what actually transpired thus scratching their heads and spending sleepless nights about how to get back.

 

Your site cannot be banned without a reason.

 

There are certain Google’s rules which when violated, will make your website banned from the search engines.

 

The possible reasons that may make your site get banned include:

 

  • Meta Tags and Robots: Looking at your robots and Meta tags may be the best way forward since it may be possible that your robots have been set in a way to exclude Google spiders from indexing your site. If your site has a robot .txt file, it would make sense if you look at it. Your Meta tags should never show something like this: < Meta name=”ROBOTS”=cont=”NOINDEX”>
  • When this appears on your site, Google will definitely be prevented from ranking to your site. Your choice of a robot code may also lead to your site not being ranked by Google. Ensure that your choice of robot codes is set to allow the  visit all your web pages.
  • Cloaking: You must have heard about cloaking, right? This is a term used to describe a site that sends web pages that have been altered to search engines that crawl the sites. You will note that when different content is returned to the users than what is returned to the search engines with the aim of causing some distortion in search engine rankings. This is one of the malpractices that can have your site banned from Google rankings. Google tries as much as possible to ensure that the quality of the search results is not only consistent but also of high quality. Any site which is involved in cloaking may be banned by Google permanently.
  • So when your website displays different information for a real person and for search engine spiders, your site is said to be cloaking. The cloaked pages are keyword-packed with the intention of displaying different information, which will make it get ranked highly. If you have a site and have included such manipulations, it is high time that you stop. Failure to do this will have your site banned by Google.
  • Duplicate websites and content: Creating content for websites is not an easy task. A site that has duplicate content is penalized by Google. You may have your site banned when someone copies your content, which was original. It is thus important to monitor your content and make sure that noother site is using them. This can be done by carrying out a Google search by using a few of your quotation marks around the content/ (“). If you find out that someone has copied your content; you will find it necessary to visit http://www.google.com/dmca.html where you’ll be able to learn more about infringement of copyrights. If your content has been copied without your knowledge, it may be necessary that you check http://www.copyscape.com.
  • Presence of hidden links or texts: There are many ways that you can have a text hidden. Some of the methods that are used are sneakier than others. When a link or a text is not visible to a human being but only to a , it is considered to be hidden. Texts can be hidden by using white and text colors on a white background or making use of cascading style sheets to hide the texts. When this is done, it’s just a matter of time, and you will have your site banned by Google.
  • Spamming or stuffing of keywords: Google allows up to a maximum of 5 percent of keyword density in the content that appears on your site. There are certain web pages that have been stuffed by keywords unnecessarily. It is important that you use your keywords the right way.
  • Buying links: Buying links will deal a huge blow to your Google rankings. It may not get your site banned, but you will drop down in your Google rankings. Your investment in getting links faster will be a waste. To move up the Google rankings, you may consider staying away from buying links.
  • Creating doorway redirects: Sites that have created sneaky redirects risk getting banned by Google. When its spiders locate such mistakes in your site, it will definitely get banned.

 

How to get back into Google rankings

 

Google states that site owners should not make use of sneaky redirects, hidden links or texts and also avoid loading your web pages with words that are irrelevant. Sending automated messages to Google from your website is not acceptable. Furthermore, doorway pages that have been created for the search engines and not for website users should not be part of your site.

 

To get back into the ranking list, you should ensure that you have checked your sites for the above ethical malpractices and make the necessary modifications. You will need to do this since, even if you resubmit the site for consideration, chances of being rejected are higher.

 

If you would like to resubmit your site for re-inclusion ion Google rankings, you will need to log into the Google’s Sitemaps which will take you to the bottom of your account page. You will see “Submit a re-inclusion request”. This will direct you to this link:https://www.google.com/webmasters/sitemaps/reinclusion?hl=en

 

What does this mean?

 

Well,you will have to register your website to be considered for reinclusion. After you’ve done this, you will check boxes that will not only you agree to being guilty of the mistakes you committed but also agree to making modifications also a box to promise that you will not commit the mistake again.

 

There is a box that will allow you to explain yourself. In this space, you will need to include everything that you believe will get your site ranked.

 

After you have gone through this procedure, Google will send its spiders to your site again to check if your site has been cleaned. It may take a few months to get indexed and during this waiting period, you should not tamper with your site not unless it is very necessary.

 

After you have done the above, it does not hurt sending Google an email. It is not necessary but it may help get things done faster.

 

Got comments? had similar experience? please comment and share your knowledge!
 
Contact me :
bhavinrana07[@]gmail.com


Categories: .htaccess, Androide developer, CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, freelance web, freelance web designer, get a freelancer, Google, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, Hire Web Developer India, Indian Freelancer, iphone application developer, iphone developer, iphone website designer, JavaScript, joomla customization india, Joomla Developer, joomla developer india, jquery, mysql, oscommerce Customization, oscommerce developer, php, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, Php programming, Programming Facts Blog, web developer ahemdabad india, web developer india, Web development India, Word Press Reserch, Wordpress Customization Services, Wordpress Developer, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Apple Confirms iCloud Web Apps for Mail, Contacts, Calendar, and Find My iPhone

September 14, 2011 Leave a comment

Web access to iCloud Mail, Contacts, Calendar, and Find My iPhone will be available at icloud.com this fall.Apple also confirms that the existing iWeb publishing, Gallery, and iDisk services from MobileMe will not be making the transition to iCloud. Some of these functionalities will, however, be replaced and/or enhanced with the already-announced photo and cloud services in iCloud.

All existing MobileMe services will continue to be available through June 30, 2012, although some such as syncing of Mac Dashboard widgets, keychains, Dock items, and System Preferences will become unavailable if users transfer their existing MobileMe accounts to iCloud before that deadline. Other MobileMe services not transitioning to iCloud such as iWeb publishing, Gallery, and iDisk will continue to be available until June 30, 2012 regardless of whether users maintain their existing MobileMe accounts or transition them to iCloud.

Contact Me:

bhavinrana07[@]gmail.com

%d bloggers like this: