What is double exclamation marks in Javascript?

March 7th, 2010

In some Javascript code, you might see the use of a double exclamation marks such as …

myAnswer = !! myVariable;

What does the double exclamation mark mean?  Is there even such an operator in Javascript?

Actually, it is two operators right next to each other.  Think of it as …

myAnswer = ! ( ! myVariable)

Now you can see that it is two “not” operators.  The “not” operator returns a boolean.

So effectively, the double exclamation converts objects into boolean.

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

How to Get the Website Code for Google Analytics

February 28th, 2010

After creating a Google Analytics account, you will be presented with a Google Analytics code to copy and paste to your website when you create a new website profile.

If in the future you need this Google Analytics code again, you can see this code from your Google Analytics account.  However, the link to get this code is not obvious.

1.  You log into Google Analytics

2.  Click the “Edit” link of your website profile that you want the Google Analytics code for.

3.  On the Profile Settings page, click the Check Status link.

4. This will display the code that you should copy and paste to your webiste.

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

How to Track More Than One Site in Google Analytics

February 28th, 2010

Your Google Analytics account can track more than one website.  You do not need to create another account.

1. Just log into Google Analytics, scroll to the bottom and find the link “Add Website Profile”.

2. In the “Create New Website Profile” page, choose “Add a Profile for a new domain”.

3. Type in the domain name of your second site and click “Finish”

4.  That should give you a new Google Analytics code for the second site.

5.  Click “Save and Finish” button at the bottom.

Each website should have its own unique Google Analytics code often identified by its “Web Property ID”

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

HTML 5 is not ready yet

February 20th, 2010

As of this writing in February 2010, HTML 5 is not ready for prime time use.  Most web designers and developers are still using HTML 4.  This is because they need to build websites based on the browsers that the majority of the audience is using.  And that means building websites that run on Internet Explorer 8, Internet Explorer 7, and sometime even Internet Explorer 6 and for Firefox 2 and Firefox 3.  And all these browser does not support the new HTML tags that are in HTML 5.

HTML 5 is a major revision of the HTML spec and add many new tags (including the often mentioned “video” tag).  But as of this point in time, the HTML 5 is still is draft and is still constantly changing.   Hence, even the latest browser like Internet Explorer 8 and Firefox 3 do not completely support HTML 5.

When will HTML 5 be ready?   We don’t know.  But the website IsHTML5ReadyYet.com gives an humorous answer.

But to get a head start on learning HTML, take a look at diveintohtml5.org.

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

Google’s version of … (everything)

February 14th, 2010

Google is not just about search. It can be used as a calculator, currency converter, translator, clock, dictionary, unit converter, and weather forecaster.  You can even find movie time, sports scores, track packages, and even flight arrivals.

Google’s core business is in search engine marketing with is Google AdWords and it internet advertisements with Google AdSense.  And to aid web developers in this area, Google has provided tools such as Google Analytics, Google Keyword Tool, and Google Webmaster Tools.

But even more than all those, Google in fact has its tentacles into almost all areas of our lives.

Here is a list of Google’s version of — well, just about everything …

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

Three Ways to Find Creative Commons Photos

February 11th, 2010

If you simply do an image search using a search engine and grab a photo to use for you blog or website, you are most likely violating copyright laws.  That is because all photos are copyrighted by default, unless they are licensed otherwise.  One such license is the Creative Commons license.  For photos that are marked with the Creative Commons license, you can use the photo as long as you abide by the conditions stipulated on the license.  And there are various forms of the Creative Commons license with various stipulations.  Most licenses will have the “Attribution” stipulation.  That means that at the location where you are using the photo, you have to put a photo credits line next to the photo.

So how do we go about finding these Creative Commons photos?  Here are three ways …

1.  Creative Commons on Flickr

a.  Click Explore on the front page of Flickr.com

b. Click “Creative Commons” link at the bottom of the page.

c. You now see a page with photos grouped by the type of Creative Commons licenses.  In each group, you will find a link that says “See more”.  Click that link and you will get a search box enabling you to search Flickr for photos of that license type.

2. Google Image Search by license type.

a. Go to Google Image Search.

b. Click the “Advanced Image Search” link.

c. In the Usage Rights selection, you can filter your search results by the license type that you are interested in. Here is more information about the Usage Right filter.

3. Search EveryStockPhoto.com

a. Go to EveryStockPhoto.com.  It is a search engine for free photos.

b. Search for photos

c. Click to the photo details page and then click the “License” tab to see what license is attached to that photo.  Most of the finds are from Flickr or Stock Exchange.

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

First Video on YouTube

February 8th, 2010

The very first YouTube video was uploaded at 8:37pm on Saturday April 23rd, 2005.  It is titled “Me at the Zoo” — referring to the one of the original YouTube founders, Jawed Karim, at the San Diego Zoo standing in front of the elephants.

He was saying …

“Alright here we are in front of the elephants.  The cool thing about these guys is that they have really, really, really long umh trunks.  And that’s cool.  And that’s pretty much all there is to say.”

The video is only 19 seconds long.  It didn’t get its first comment until 2008.  Now in the beginning of 2010, it has over 12,877 comments and had been watched over 1,586,425 times.   Not surprisingly, most of the recent comments was about how this video is being one of YouTube’s first video.

YouTube was founded by Chad Hurley, Steve Chen and Jawed Karim, all of whom where PayPal employees.

This fact is according to Wikipedia.

And it was mentioned by Randall Stross on page 116 of his book Planet Google: One Company’s Audacious Plan to Organize Everything We Know:

“The historic first YouTube video was an eighteen-second segment of Karim standing in front of a pen of elephants at a zoo, explaining with a self-mocking wink how elephants have “really, really, really long trunks.”  This would not do, they knew.  So they asked their friends to contribute videos too.”

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

Electronic Signatures are Legally Binding

January 26th, 2010

Electronic signature can be a typed name in a digital document, an inital of a letter, a mark, or checkmark in a checkbox, or even a click of a button next to words such as “I agree” or something similar.

U.S. Public Law 106-229 dated June 30, 2000 defines electronic signature as “an electronic sound, symbol, or process, attached to or logically associated with a contract or other record and executed or adopted by a person with the intent to sign the record.”

These electronic signatures are legally binding in many countries due to various government acts.  They have the same weight as pen and ink signatures.

In the United States there is the “Electronic Signatures in Global and National Commerce Act” and the Uniform Electronic Transactions Act 1999.

For laws regarding other countries, see Wikipedia’s entry on digital signature and law.

References:

Electronic Signature – Wikipedia

Electronic Signature – EchoSign

Electronic Signatures – They’re legally binding

Electronic Signatures are legally binding – RocketLawyer.com

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

How to Participate in Web Forums

January 26th, 2010

A web forum is a website community where you can post messages and questions and other people can respond with comments or answers.  It is essentially a web community. There are many different web forums sites on the Internet catering to different topic or subject of discussions.

Each forum, depending on the software they are using, will have different menu systems and methods of registration and participation.    The rules for each web community will be different as they will be defined by the forum administrators.   So it is important to read the rules particular to each forum that you plan to participate.

In this tutorial, we will go through some user scenarios in interacting with a mock forum so that you can gain the general concepts behind forum participation.  This forum happens to be running the open-source phpBB forum software.

On the home page of a forum site such as our example …

Web forum

you will see a login link and a register link.

Although you can usually browse through the contents of the forum without registering or logging in.  Most forums will require you to “login” before you are able to make any posts.  And before you are able to “login”, you need to go through an one-time “registration”.

The login link is for people who have already registered on the forum or have participated in the forum before.

Registration

Since we are new to this forum, we want to click the register link.

Most forums will have a set of terms that you need to agree to…

registration page on web forums

You will get to a registration screen that looks like …

Web forum registration screen

Come up with an arbitrary creative username for yourself.  This will be the name in which people will know you as on the forum.  If the name that you have chosen is already taken, an error message will be displayed asking you to pick another one.

Then enter your email address.  And come up with an arbitrary password for your forum login.  Usually, there will also be an image validation to ensure that you are a real person instead of a software robot trying to register.

Click the “Register” button at the bottom of the screen.

To complete the registration, some forums will send you an email with a link that you need to click.  This confirms that the email address that you had supplied is correct.

web forums registration

Click the link in the email in order to complete the registration process.

Login

Now that you have registered, you can click the login link at the home page of the forum to login …

Web forum login process

Enter the username and password that you had created during registration.   Sometimes there will be a checkmark for “auto login”.  If you checkmark this, the forum will place a cookie on your computer to remember your login credentials so that if you do not need to login again if you come back to the site later on the same computer.  This is not recommended if you are on a public computer or if you are sharing a computer.  But if you are the only person using the computer, then it might be convenient to do so.

Click the Login button, to login to your forum account.

Setting Up Your Profile

You can tell that you are logged in because it shows your username and you see link to “User Control Panel”…

User control panel in web forum
Since this is your first time logging in, you should first set up your profile by clicking the “User Control Panel” link.  Your profile contains public information that other can see.  All the information is optional, so put only what you want others to see…

setting profile setting in web forum

Some forums may allow you to have a “signature”.  A signature is a snippet of text and possibly links or images that is placed at the bottom of each of your message posts.  Some people put a link to their website or blog in their signature.  But each forum has its own restrictions on what you can place in your signature.  So you have to read their rules.

Setting signature for web forums
Some forums may also let you upload your own picture known as your “avatar“.

There are various other settings in the user control panel that you can explore.  One that I would recommend that you find is the email notification of replies.

Setting email replies in web forums
Set it so that you get an email reply whenever other people responds back to your post.

Most forum also allow members to send direct messages to other members.  This can be turned on and off …

direct message settings in web forums

If you turn it on, it is recommended that you set email notification upon receiving a private message as well.

Posting

After logging in and navigating to a topic of interest.  You can reply to a post by clicking the reply button…

replying to post on web forum

and then type your reply…

posting a forum reply

Since we had checkmarked “notify me when a reply is posted“, we have essentially subscribed to a forum thread.  Therefore, the next time you log in, you can see a list of your “subscriptions” …

subscribed threads in forum

Sending Private Messages

You can send a private message to another member if he/she has enabled this option.  Just click on their username.  In this example, we’ll send a private message to “admin”….

sending a private message in forum

and that will take you to their profile page.  Usually there is a link there to send them a private message …

sending private message in forum

Then you see an editor interface similar to the following…

private message inbox in forums

You also see the section in your control panel similar to an inbox where you can see your private messages.

When you are done, there will be a logout link to log out of the forum.  Be sure to remember to do this if you are on a public or shared computer.

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark

How to Set Up a Buy Now Button in PayPal

January 24th, 2010

A “Buy Now” button is a button that you can place on your website where if the user clicks on it, the user will be directed to a PayPal hosted page where the user can submit their payment via credit card or funds in their PayPal account.

In this tutorial, we will show you how to set up a “Buy Now” button.

1.  Log into your PayPal account at PayPal.com

2.  Click on the blue tab “Merchant Services”.

3.  Click on the link “Buy Now Buttons”.

4.  You should arrive at the “Create PayPal payment button” page (also known as the “Button Wizard” or “Button Designer”) which consists of three steps.

Step 1 for Buy Now button in PayPal

5.  In step 1, select the drop list and choose what you are accepting payments for. Common choice would be “Products” or “Services”.

6.  Then in the radio button, select the second option of “Create a Buy Now” button.

7.  Enter an “item name” such as what product is being purchased.

8.  For shipping, you can enter $0 if there is no shipping cost (such as when a customer is purchasing a service).  Or you can enter a flat shipping rate.  Or you can setup shipping to be based on weight.

9.  Enter a tax rate that you want to charge your customer.  Consult your tax advisor as to the correct rate to charge.  Or if it is a service, you can put zero for the tax rate.

10.  Under “Transaction notification”, it is recommended that you select “use my secure merchant account id”.  This id is a way to associate this button with your PayPal account.  This prevents your PayPal email address from being exposed in the button code.

11.  Step 2 and 3 of the button wizard usually do not need to be adjusted.  But you can expand step 2 to see what settings they have set by default.

Buy Now button step 2

Note the “Save Button to PayPal” is checkmarked.  This is fine.

12.  If you expand step 3 …

Buy Now button step 3

you see that it has the options to redirect the user to a particular URL when user either finishes paying or cancel.

13.  Click the orange “Create Button” button to create the button.

14.  Paypal will now provide you with a snippet of HTML code known as the “button code”.

PayPal buy now button code15.  Click the “Select Code” button and copy that code to the HTML page of your website.  Now you should have a “Buy Now” button on your website.

16.  This button is also saved in PayPal (as noted in step 2 during the button creation process).  In case you need to edit this button, you can to go to your saved buttons by “Merchant Services -> Buy Now Buttons -> Go to My Saved buttons”.

  • Twitter
  • Delicious
  • Digg
  • Facebook
  • Google Reader
  • Share/Bookmark