Code For Honor : Microsoft’s Solution Excellence Awards 2014

Microsoft  India Code For Honor Excellence Award
Microsoft India Code For Honor Excellence Award

Code for Honor is Microsoft’s award for solution excellence. Build outstanding software solutions in one of four specially chosen categories – Large Enterprises, MSME, Government Enablement, Citizen Services – and showcase your capabilities on the national stage.

Modern devices and cloud-based services have changed the way organizations and users operate. Organizations can now deliver comprehensive software solutions across devices on manageable, elastic, cloud-based IT architecture while users react, interact and purchase differently.

Register Now!

Deprecated Warning : Assigning the return value of new by reference is deprecated in * on line *

Hey there,

Did you get this Warning/Notice? :

Deprecated Warning : Assigning the return value of new by reference is deprecated in *  on line *

In PHP5 this notation is deprecated

$obj =& new Class();

That would generate the warning but ‘&’ is not required and can be removed.

$obj = new Class();

To see why this was used in PHP4, see  http://www.php.net/manual/en/oop4.newref.php

Cheers,

JENSon.




Google has blacklisted php.net website!

PHP Developer’s Home php.net has been blacklisted by Google. I think that’s probably happened ~ in between 23rd October 2013 11:15 PM IST and 24th October 2013 9:35 AM IST. Tha actual problem is that Google’s Safe Browsing technology is blocking access to PHP.net as a precaution, after apparently detecting that some of its pages were booby-trapped with links to malicious software. php.net is widley used by coders all around the globe. Google didn’t specify the types of Trojans associated with the apparent attack but it did state the domains they came from. Users visiting the PHP.net site using Google Chrome, Mozilla’s Firefox and or Apple Safari (Mozilla and Apple both license Safe Browsing from Google) were confronted by a warning firmly instructing them not to proceed any further.

PHP founder Rasmus Lerdorf on Twitter (@rasmus) tweeted :

“It appears Google has found a false positive and marked all of  http://php.net  as suspicious. pic.twitter.com/YDlHcUnCK6 “

But One Googler (http://goo.gl/8jyJRx) told in this post (http://goo.gl/Iw2Fx4) :

“What our systems found was definitely a compromised JS file, and others on this thread have posted something similar to what we saw. This is not a false positive.

We have detailed help for webmasters in this kind of situation:

http://www.google.com/webmasters/hacked/

One thing that I strongly suggest to any webmaster in this situation is to look for any server vulnerability that allowed this file to get compromised in the first place. We sometimes see webmasters simply fix the affected files without digging into security hole that allowed the hack, which leaves the server vulnerable for repeat attacks.”

Zend Co-Founder Zeev Suraski (@zeevs) replied to my tweet related to this issue:

zeev_tweet_jensons

Below are the screenshots links which shows malware warning :

Firefox Warning

Chrome Warning

Google Search for ‘php.net’

Whatever the problem my favorite website is blacklisted by Google!..:( Google will remove this warning soon (Hopefully) !

Cheers,

JENSon.

Import sql file from mysql command line by using PuTTY emulator

Hey there,

By Using phpMyAdmin, The sql file import operations for bigger files are very difficult. There is a chance that it’ll timeout during the operations and also, browser will be using heavy memory. So how to get rid of these issues?
No problems! Just try importing the sql file directly in mysql console (command line). I’m explaining the steps based on a web hosting context. (For eg. You’ve a hosting account (Shared or Dedicated) with GoDaddy, Bluehost, Hostgator etc)

Steps:

  • Login into your server using PuTTY
  • login into mysql console
mysql -uUsername -hHostname -pPassword

(This is the command for directly logging into the mysql server. Please note that there is no space after -u, -h, -p. Also Replace Username, Hostname & Password with your DB details)

  • Choose your database for import operation
use DBname;

Replace DBname with your own database name

  • Import operation
source /var/hroot/home/contents/07/2342341/fhtml/sql/yourSql.sql

The import operation initiates once you execute the above command. We used source command to specify the location of your sql file (You’ve to give correct path of the sql file). That’s it.

Cheers,

JENSon.


Disable/Enable Javascript Options in Firefox From Version 23.

Folks,

You might have noticed, In Firefox Version 23(+) there is no way to disable  JavaScript functionality from Tools->options-> Content (Tab). They say “In Firefox 23, as part of an effort to simplify the Firefox options set and protect users from unintentionally damaging their Firefox, the option to disable JavaScript was removed from the Firefox Options window.”

ff_js_miss

The option to disable JavaScript was not removed from Firefox entirely. You can still access it from about:config or by installing an add-on.

How to disable (& enable back) Javascript from Firefox ver. 23

about:config

  1. In the address bar, type “about:config” (with no quotes), and press Enter.
  2. Click “I’ll be careful, I promise”
  3. In the search bar, search for “javascript.enabled” (with no quotes).
  4. Right click the result named “javascript.enabled” and click “Toggle”. JavaScript is now disabled.


To Enable JavaScript back, repeat these steps.

Add-ons

You can alternatively install an add-on that lets you disable JavaScript, such as

  • No-Script (to disable JavaScript on a per page basis, as required)
  • QuickJava (to easily disable and enable JavaScript, automatic loading of images, and other content)

Hope this helps. ThankYou.

Cheers,

JENSon.

PHP : Removing Non-English Characters From String.

Hey Folks,

The below code will help you to remove non-english characters from your PHP variable string.

<?php
$string = "somAe7 სოფო_$ tഞാൻext"; 
$string = preg_replace('/[^a-z]/i', '', $string); 

echo $string; //Outputs somAetext
?>

If you want to include numbers & space from the above string, Use below code.

<?php
$string = "somAe7 სოფო_$ tഞാൻext"; 
$string = preg_replace('/[^a-z0-9_ ]/i', '', $string); 

echo $string; //Outputs somAe7 text
?>

Cheers,
JENSon.

 

 

PHP Warning: file_get_contents(): Unable to find the wrapper “https” – did you forget to enable it when you configured PHP?

Hey Folks,

Warning: file_get_contents(): Unable to find the wrapper “https” – did you forget to enable it when you configured PHP?

Got the above warning? No Problems. You can get rid of this warning by just enabling php_openssl.dll extension in your php.ini [For eg. xammp/php/php.ini] configuration file. [If you’re not seeing php_openssl.dll itself in your php.ini, just directly add the extension line to the php.ini configuration file]

Your php.ini file :

;extension=php_oci8_11g.dll
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll

You just need to uncomment the line extension=php_openssl.dll.

It should look like below :

;extension=php_oci8_11g.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll

If the extension itself does not exist, You have to add extension=php_openssl.dll to your php.ini file. (Provided you’ve the proper dll file bundled with your windows PHP environment (I’m using XAMPP & the dll extension is php_openssl.dll.)

Note : I’m using XAMPP for Windows

Cheers,
JENSon.

PHP : Deleting Duplicates From An Array

Hey Folks,

PHP’s array_unique function allows you to remove duplicate values from an array.

Syntax:

<?php
$arr = array("a" => "Ford", "Mercedes", "b" => "BMW", "Lotus", "Ford", "Renault");
$result = array_unique($arr);
echo "<pre>";
print_r($result);
echo "</pre>";

/* Output
Array
(
    [a] => Ford
    [0] => Mercedes
    [b] => BMW
    [1] => Lotus
    [3] => Renault
)
*/
?>

Note : The keys are preserved. array_unique() sorts the values treated as string at first, then will keep the first key encountered for every value, and ignore all following keys. It does not mean that the key of the first related value from the unsorted array will be kept.

Cheers,
JENSon.

 

 

Convert a string to an array using str_split PHP function.

Hey Folks,

In PHP, You can convert a string to an array using str_split function.

Syntax:

array str_split ( string $string [, int $split_length = 1 ] )

/* $string=The input string.
$split_length=Maximum length of the pieces. */

Example:

<?php

$str = "Awesome World";

$arr1 = str_split($str);
$arr2 = str_split($str, 3);

echo "<pre>";
print_r($arr1); 
print_r($arr2);
echo "</pre>";

/* This will output..

Array
(
    [0] => A
    [1] => w
    [2] => e
    [3] => s
    [4] => o
    [5] => m
    [6] => e
    [7] =>  
    [8] => w
    [9] => o
    [10] => r
    [11] => l
    [12] => d
)
Array
(
    [0] => Awe
    [1] => som
    [2] => e w
    [3] => orl
    [4] => d
)

*/
?>

Return Values:

If the optional split_length parameter is specified, the returned array will be broken down into pieces with each being split_length in length, otherwise each piece will be one character in length.

FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string, the entire string is returned as the first (& only) array element.

Cheers,
JENSon.