By BoLOBOSE payday loan

Google’s Plus 1 Button Integration And Options

Google has recently changed it’s theme, search method, oh and it has created a social networking site that will rival that of Facebook. The software giant has also rolled out the +1 button (plus 1 button) which is in direct competition with the Facebook like button. The plus 1 button has not only already been integrated into a lot of personal sites and blogs but it has been put into Google’s search results which is going to change the way we find content on the web and how this content is shared with friends, family and co-workers.

The Plus 1 Button Code

The button is also just as simple as the Facebook option when it comes to developer integration. The button only requires two lines of code, one in the header or body and the other where you would like the button to be placed.

1
2
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<g:plusone></g:plusone>

Plus 1 Button Size Options

There some options as far as customization of the button goes. The first thing to take into consideration is the size and how it will appear. You can choose between small(height: 15px), medium(height: 20px), tall(height: 60px) and leaving it blank. If you leave it blank it will appear to look the same as the medium option but it will be 24px rather than the 20px that medium is.

1
2
<!-- example of a small plus 1 button -->
<g:plusone size="small"></g:plusone>

Force A URL Through The Plus 1 Button

You can also force a URL into the button that the plus one will be applied to. This is simply done with an href tag and then the url.

1
2
<!-- example of fixed url being set -->
<g:plusone href="http://codewithdesign.com"></g:plusone>

URL Authentication – A New Approach

It is time for web developers and software engineers to make a new approach when checking the validity of URLs and emails that are provided by users. Icann has decided that it is going to allow new suffix’ and the ability to host a website on a domain that has no suffix ie: ‘http://codewithdesign/index.php’. With this change in URLs means that all regular expressions are going to have to not force a suffix or that last decimal as a root URL.

How Will The New Domains Affect Me?

The new domain scheme is going to change how your website validates proper emails and URLs which can be a rather large change on websites that do not have formatting called from one place. Because of this change you will have to overhaul your website/blog/app to support new URLs and emails.

How Should I Go About Making The Change

If you haven’t done so already it is a good idea to make sure that your formatting and checking is coming from one place and will be able to handle the errors accordingly. The first thing that is required is either a functions file or a class file that will support multiple formats of input. This way when something like this changes you only need to update the code once.

Ways To Check URLs And Emails

When working with a URL you can change your regular expression to just check for proper characters and the presence of ‘http://’ or ‘https://’, but there is a much more fun way to check for the new format as well. You should still be using a filter or a regular expression but make sure that your version of PHP is high enough if you are going to use a filter.

Check For An Existing Email

Because of the new URL scheme we are going to need to handle the case that the user is from a website such as ‘http://bearattacksarenotgood/’ This will require us to check for an existing email without the checking of a proper suffix in the email since a user can have the email ‘calebjonasson@bearattacksarenotgood’.

We can easily check for an existing email by using a function called ‘checkdnsrr’ but first we need to split the email name from the URL which will give us ‘calebjonasson’ and ‘bearattacksarenotgood’ which we can accomplish by using the list function will will break apart a string by finding a character.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
//load a variable with an email.
$emailAddress = 'calebjonasson@bearattacksarenotgood';
//split the email by the user name and domain name
list($userName, $domainName) = split('@', $emailAddress);
//use checkdnsrr to validate the domain names existence.
if(checkdnsrr($domainName, 'MX'))
{
    //return value on success.
    return true;
}else{
    //return value on failure.
    return false;
}
 
?>

Pinging A Server

It is possible to ping a server through PHP and it is also possible to just use a cURL to request the page information and check and the response headers. The first thing I will show you is how to send a request which will allow you to check for ping of the data server in question.

My prefered method of doing so is to install net ping onto the server. This is the best solution that I have found on the web to this day and is very simple to use. Here is a tutorial from Code Diesel.

Zend Studio Shift Tab Fix

When switching over to Zend Studio at work I discovered that there was poor support for shift + tab. Whenever using this keyboard short-cut I could only go back as far as I had previously tabbed from which means that any imported code from another IDE would not shift back so many spaces.

The Fix

By going to ‘Window’ => ‘Preferences’ => ‘PHP’ => ‘Code Style’ => ‘Formatter’ you can create a new profile. In this profile you can keep everything as the default but rather than keeping the tab key set to tabbing you can change it to spaces and then select the amount of spacing that you would like. Now save your profile, make sure that it is selected and press ‘OK.’

Flex Data Service Debugging Software

I wanted to share an exceptional piece of software that I was recommended to use at work as an excellent debugging tool. The software is called Charles and comes with an excellent demo version that closes every thirty minutes and will give you a little window telling you that you are using a demo from time to time but aside from those two draw backs they haven’t left a whole lot out.

I needed some software after being unable to figure out why we were unable to connect to a data service with Flex. This software upon launch quickly showed us the response that we were not being displayed through Flex and allowed us to quickly sort out our gateway issues. Even though we used this software to help debug flex we have also been using for a lot of http requests and all other browser based debugging that involves sending and retrieving data.

If you aren’t convinced as to download the free copy yet I should probably mention that the software only costs about $30 for a full license and comes in better packages based on how many copies of the software you purchase. It also comes with the ability to throttle your own bandwidth and latency to test in slow conditions which is great when testing against a local server.  The software also allows you to change and resend requests to test back end services which is a huge benefit as a server guy.

The software package comes available and fully supported for Linux, Mac, and of course Windows.

I’m not a software review nor am I paid to voice my opinions but I would advise that any company that wants to save some serious time on debugging should buy this software. It is great for everything web.