By default browsers such as Firefox sends the Referer information to the target URL in the HTTP header, as defined by HTTP protocol, so the destination URL / website knows where you have come from. For instance, when you click this link to one of my friends’ sites, it would know you have arrived at Princessly from this page:

http://www.kavoir.com/2012/08/make-firefox-to-not-send-http-referer-or-on-a-per-site-basis.html

Because Firefox sends this information in the HTTP header.

While this is very valuable data to many parties, such as the website owners (who can analyze traffic sources) and market analysts (who wants to know people’s interests and habits so as to sell well), it can be bad for our privacy because it is disclosing our browsing information to the websites we are visiting. You may want to disable Firefox from sending the referrer.

How to disable Firefox to send HTTP referrer?

Just type:

about:config

In your Firefox address bar and click “I’ll be careful, I promise!”.

In search, type:

referer

And an entry reading “network.http.sendRefererHeader” would come out with a value that’s 2 by default. Right click on the entry and click “Modify”. Input 0 and click OK.

Restart your Firefox, and now it should not send any referer information any more. And no website would ever know where you were before coming to them.

Not Send Referer on a Per-Site Basis in Firefox?

However, sometimes this may break something as legitimate sites are also using referer information to better serve you. There must be some sites that you don’t quite trust and wanted to disable referer for them.

Simple. Just use the RefControl add-on for Firefox.

After installation, you should see a tiny button on the Add-on Bar, at the bottom of the Firefox window. When you are at the website, click on the button and select “RefControl Options for This Site” and you will have this dialog box:

block referer in Firefox

Just select your intended option for this particular site. If you do not want to send any referer information to this site, just select “Block – send no referrer” and click OK.

That’s it. Now Firefox will send no HTTP referer information to this particular site but will keep sending it to all other sites.

{ Comments on this entry are closed }

When I encounter the incorrect key file for table error, it’s almost certainly because the disk is full and MySQL can’t write to the tmpdir. The solution is simple, just move tmpdir to another partition with enough disk space.

Open my.ini and change tmpdir to another directory with enough disk space. Restart MySQL and that should do it.

However on Windows, such as for WAMP, you need to make sure you use slashes (/) rather than backslashes (\) in the path for tmpdir in my.ini, or it would be this error and mysqld would simply refuse to start:

InnoDB: Error: unable to create temporary file; errno: 2

{ Comments on this entry are closed }

By default, phpMyAdmin shows an estimated number of records for InnoDB tables that have more than 20,000 rows. It can vary by every fresh as much as 50% or even more. Makes it hard to get an exact number of records for the tables as we have to explicitly run an SQL query to do that:

SELECT COUNT(*) FROM table_name

While it would make it a bit slower for phpMyAdmin to open up the database tables list page because it has to count the exact total number of records of each table in the database by this query, it’s worth it for some of us as we want to know the exact number of rows the InnoDB table currently has. phpMyAdmin does it for MyISAM tables, and we want it to do the same with InnoDB tables.

So how can we make phpMyAdmin show exact number of records for InnoDB tables?

Simple. Just open the config.inc.php in your phpMyAdmin installation directory and add this line:

$cfg['MaxExactCount'] = 2000000;

This configuration parameter sets the threshold that phpMyAdmin executes COUNT(*) against the table.

In this case, if the total number of recrods in this InnoDB table is larger than 2,000,000, the Rows count will be estimated, starting with a wave sign, ~; on the other hand, if the total number of records in this InnoDB table is smaller than 2,000,000, phpMyAdmin will run COUNT(*) against the table so an exact Rows count is displayed.

You get the idea.

To make phpMyAdmin show exact number of rows on all InnoDB tables, simply make the parameter $cfg[‘MaxExactCount’] large enough.

{ Comments on this entry are closed }

Today, most of our online data transmissions pass through fiber-optic cables. And as most of us know, fiber-optic cables are simply long, thin strands of glass which allow light to bounce and refract from one-end to the other without leaving the cable. It’s a bit like shining a flashlight down a long, mirrored tube.

One of the great benefits of fiber-optic cabling is that it can transmit multiple signals at the same time by combining different colors. (Photons with different wavelengths) Because of this, the number of simultaneous signals which can pass through a fiber optic cable is theoretically limited only by the accuracy and precision of the hardware. Compare this with a copper wire, which can only send one signal at a time.

But few people really appreciate how much incredible science goes into fiber optic networking, or the fascinating principles which govern this technology that has such a profound impact on our daily lives.

One of these principles is what’s often called the “Lifeguard Principle”, also referred to as the “principle of minimal action” or “principle of least action”.

Now I’m not a scientist, and I may slightly over-generalize in certain areas. But I’ll attempt to present these principles in the most accurate way that I can in laymen’s terms.

We all know that the shortest path from point A to point B is a straight line. But what about the FASTEST distance?

How to get from A to B?

For example, let’s assume that you’re a lifeguard that sees a drowning swimmer off in the distance. The shortest route to that swimmer would be to follow a straight line towards the swimmer through land and water.

From A to B in shortest path

But in a life-or-death situation, every second counts. The running portion of this trajectory may be very fast, but the swimming portion will be very slow. If you waste too much time swimming, the person you’re trying to save might drown.

From A to B in potentially shortest time (fasted path)

Another approach might be to run along the beach until you reach the point which offers the shortest swimming distance. Although this may take care of the swimming problem, now you’ve spent too much time running. Yes, this route may be faster than the “straight line” approach, but it’s still possible to shave off a few more precious life-saving seconds.

Somewhere in between these 2 strategies, there is a sweet spot where the combination of swimming and running time is reduced to the absolute minimum.

From A to B in shortest time (fasted path)

It’s possible to calculate this optimal trajectory using complex calculus, but I won’t bore you with that for this article.

Now let’s take this principle and apply it to a photon of light instead of a lifeguard.

If you’re standing in a boat and you point a laser at a fish in the water, what will happen?

Photons automatically travel in fasted path

Of course, we all know that the light beam will bend when it hits the surface. But how does the beam “decide” which angle to bend at?

Scientists have been able to calculate the speed at which light travels through different substances such as air and water. And when you combine the speed of light through air and the speed of light through water, you can make an interesting observation.

If you add up the time it takes for the light to go from the laser to the water and the time it takes for the light to travel from the water’s surface to the fish, it turns out that the trajectory which is taken by those photons is the shortest possible route for a photon of that wavelength.

In other words:

If the photon was a lifeguard and the fish was a drowning swimmer, the light would always pick the route which requires the least amount of time to reach the swimmer. And it’s this principle which dictates how the light decides to refract when it reaches the water’s surface.

To an untrained layman, this seems almost miraculous. It’s almost as if the photon could see into the future and plot a path to its final destination before it ever left the laser. And it’s almost as if the photon was able to perform the difficult calculus required to find the shortest possible path.

Of course, it’s not quite that simple. But it’s a clear demonstration of how beautiful science can be.

This least-action principle is also critical to optical networking technology. When you send a message through a fiber optic cable, it truly does take the fastest possible route to its final destination. And if it wasn’t for the principle described above, Internet connectivity would not be possible.

There are many other implications which result from this phenomenon, but they are simply beyond my understanding so I couldn’t speak to those issues.

About The Author: Patrick Jobin is a technical writer with Storagepipe Solutions, a leader in serious server online backup services for datacenters and corporate networks.

{ Comments on this entry are closed }

I bought 2 extensions from Iceberg Commerce for my dresses and gowns store Princessly over a year ago to enhance the URLs of the tags with regards to SEO:

  1. Magento tags SEO URLs
  2. Admin can add tags to products in editor

They were both very easy to install and use. Only I needed a few modifications to the SEO-friendly tags extension so I reached out to Raman who has created them. This is something Raman didn’t have to do for me because it’s beyond what the product was designed for. I thought he’d ignore my message and he had every right to do so. However, Raman turned out to be an extremely nice person and helped me all the way through to get my custom requirements done.

That was over 1 year ago.

Just yesterday I again asked him for help regarding a minor error the extension is spitting out and he’s doing everything he could to get my problem solved. After exchanging 20 or so email messages, he got it again.

I just thought someone like him, avidly supporting an ordinary customer (I only spent about $70), over 1 year after the sale, deserves a dedicated post here.

{ Comments on this entry are closed }

Windows 7 is a beast in consuming hard drive disk spaces, especially the system drive, C, which is constantly being filled up. After a while it will keep annoying you with low disk space warnings because C drive is running out of space and almost full. So how can I safely free up all the disk spaces in C drive in Windows 7 and reduce its disk storage?

The methodology is to find the fattest folders in C drive, move as many of them to another drive (such as D, E, etc.) as possible, and make symbolic links (by mklink) from C drive to the folders in other drives.

Step 1 – Find culprit folders that occupy the most disk space!

There are so many ways to do this but what I did was to look at the size stats for each of the major folders in my C drive. After 10 minutes, I was able to pinpoint these folders that are consuming large chunks of the disk volume:

  • C:\Windows\winsxs – very high-profile system folder that are not easily reduced / moved, which I’ll leave alone.
  • C:\Windows\Installer – Over 3GB, program installers that can be moved safely and easily.
  • C:\Users\Administrator\AppData\Google – About 0.8GB, Google products data such as those by Chrome.
  • C:\Users\Administrator\AppData\Mozilla – About 1.6GB, Firefox profiles and browser data.
  • Some folders in C:\Program Files – I wish I could move this entire folder but I couldn’t. I could only move some of the folders such as “Microsoft Games”.
  • Some folders in C:\Program Files (x86) – Same as above.

This is just my case. You may as well find totally different folders that need to be moved. After you have found something, proceed to step 2 to duplicate them elsewhere.

Step 2 – Copy these folders to another drive that is much more spacious!

This one is easy. Just perform the omnipotent Ctrl+C and Ctrl+V combination to copy these folders to another drive. In this example, we’ll copy these folders to their new destination – D:\C_DRIVE:

  • C:\Windows\Installer –> D:\C_DRIVE\Windows\Installer
  • C:\Users\Administrator\AppData\Google –> D:\C_DRIVE\Users\Administrator\AppData\Google
  • C:\Users\Administrator\AppData\Mozilla –> D:\C_DRIVE\Users\Administrator\AppData\Mozilla

After the duplications, proceed to step 3.

Step 3 – Delete original folders and create the symbolic links

Now we need to delete the original folders in drive C. Some files and folders in Windows 7 are owned by TrustedInstaller while some by SYSTEM that cannot be easily deleted by Administrator. To delete them, you have to acquire SYSTEM privileges to do this, because the most privileged account in a Windows 7 computer is SYSTEM, not Administrator.

To do this, just create a file named syscmd.bat and put in the following commands:

sc Create SysCMD binPath="cmd /K start" type=own type=interact
sc start SysCMD

Double click to run the file syscmd.bat and you will be prompted by a dialog with 2 buttons, click the top one to view the interactive message.

And you will enter a command line interactive mode with SYSTEM privileges which basically grant you full rights to the computer – you can do whatever you want now.

Run these commands one by one – line by line, you type in the command and hit enter:

rmdir /s /q C:\Windows\Installer
rmdir /s /q C:\Users\Administrator\AppData\Google
rmdir /s /q C:\Users\Administrator\AppData\Mozilla

Now that the original folders are deleted, we’ll make symbolic links in the same name so that any requests for these folders are correctly diverted to those on the D drive:

mklink /D C:\Windows\Installer D:\C_DRIVE\Windows\Installer
mklink /D C:\Users\Administrator\AppData\Google D:\C_DRIVE\Users\Administrator\AppData\Google
mklink /D C:\Users\Administrator\AppData\Mozilla D:\C_DRIVE\Users\Administrator\AppData\Mozilla

That’s it.

After these 3 steps, my C drive is successfully reduced in size by 5.4GB. I can move more folders to further enlarge / extend the free space but for now, it’s good enough for me.

Feel free to leave any comment about how you are doing with this approach.

{ Comments on this entry are closed }

New LHC Data Hints Strongly at Higgs Boson

by Yang Yang on July 4, 2012

What gives matter mass?

This seemingly simple question has had physicists around the world working to detect and identify the Higgs boson, known in popular media as the “God particle,” the physical constituent that has long been thought to interact with other forms of matter, giving it mass. The search has lasted since 1964, the year that physicist Peter Higgs and his colleagues presented the scientific community with a fully fleshed-out theory on the mass-giving particle; more than 45 years later, the search may be over.

Scientists working in Switzerland’s CERN-owned Large Hadron Collider announced yesterday that years of study have culminated in observations of a new particle, thought widely to be the Higgs boson due to its intrinsic properties. While some of the particle’s properties have yet to be analyzed, it was found in the the mass region around 125-126 GeV, the energetic area expected to produce the “God particle.”

I congratulate the thousands of scientists around the globe for their outstanding work in searching for the Higgs boson. Today’s announcement on the latest results of this search shows the benefits of sustained investments in basic science by governments around the world. Scientists have been looking for the Higgs particle for more than two decades; these results help validate the Standard Model used by scientists to explain the nature of matter.

– Steven Chu, U.S. Secretary of Energy

The announcement is being hailed by scientists from every part of the globe as a major success story in the long search for one of the most important fundamental particles in the universe (not to mention its popularity with those in design fields given scientists’ use of the widely-loathed Comic Sans font in their presentation materials), as the $6 billion LHC particle accelerator continues to analyze new detail in the hopes of offering indisputable evidence of the new particle next year.

Absolute surety or not, July 3, 2012 will be remembered throughout scientific history as the day that humankind’s ingenuity lead us to to solve one of the most subtle mysteries of the physical universe.

Source: Fermilab Today

{ Comments on this entry are closed }

Update: After some communications with Register.com, I was able to acquire the transfer authorization code via their live chat support.

For people who are considering Register.com, I’ve got something new. Well probably not new but I just found it out myself the hard way how Register.com is a SCAM.

Sneaky Pricing at Register.com

I registered a .com with them a couple months ago at a bargain price of $2.95 (or so) and when I learned that the renewal price for the next year was like $38 / year, I said to myself, woahh, what an idiot must had I been registering this name with them in the first place?!

38 dollar  per year renewal price at Register.com

For people who are new to domains, you can get a .com name at almost any other registrars at no more than $10 / year (new registration or renewal), with much better control panel and functionalities.

The next thing I found myself doing was trying to get an authorization code so I could transfer it to another registrar. It wasn’t easy – I clicked around for about 5 minutes to find the tiny link at the bottom of the page where they would allow me to retrieve the auth code and guess what. After I clicked the link, they offered me a totally different price for renewing – $10 / year:

different renewal price for people who want to transfer away

What a douche.

And stupid.

Worst business practice ever.

Who else is offended by this moronic trick that they thought would do good to their sales?

It actually punishes loyal customers who take good faith in them in the first place yet rewards disloyal ones who are looking to get away from them.

What kind of business does that??!!

Apparently, I clicked “Continue Transfer” and requested the auth code.

Register.com Takes 7 Days to Review Your Request for an Auth Code

Turned out I couldn’t get my auth code at once. Unlike all (probably) other registrars that instantly sends you the transfer auth code upon request, Register.com sends it 7 days after request. And they only promised to review the request! They may end up NOT sending you the auth code at all at their discretion.

It was lucky of me who had found about this delay policy long before the renewal due date, otherwise I’d probably have to take one of the offers and renew another year with them should I want to keep the domain from dropping.

However, this isn’t the best part.

They declined my request for the auth code.

Yep. And this is their message addressed to me regarding my request for the auth code. Seemed I had some suspicious activity in my account and now I have to do a phone call to their customer service consultants at 1.888.734.4783 to get the auth code I need for my domain.

Dear Yang Yang,

You recently requested an auth code to transfer your “xxxxxxx.com” domain name.
Your request has been processed and at this time it has been declined due to recent suspicious activity in your account.

Register.com is committed to providing the most secure and reliable domain services for our customers. We have implemented specific security measures to help prevent unauthorized transfer of domains to another registrar.

The type of suspicious activity that could have caused your request to be declined includes:
–       Multiple failed attempts to login to customer’s account
–       Recent changes to the account holder’s name, email address, or login ID
–       Attempts to access the account over the phone without authorization
–       Recent changes to the accounts password
–       Domain name lock not removed
–       Recent changes to billing or credit card information

To receive your auth code, please call one of our customer service consultants at 1.888.734.4783.  They will confirm you to the account and then fulfill your request.

Thank You,

Sandy Ross
EVP, Customer Service
Register.com

Lucky of me again, this one domain with them wasn’t so very big a deal to me. I think I’ll just leave it un-renewed. It was well worth $3 bucks for finding out a thug registrar this way.

Register.com is now on my blacklist for all my future domain needs.

Now to the appalling part – I’m UNABLE to turn off the auto-renewal.

Obviously, I would want to turn off the auto-renewal of my domain or at the end of the registration cycle Register.com would bill my credit card again which is the last thing I want. I would rather delete or drop the domain than to be forced to continue paying them.

unable to turn off auto-renew at Register.com

There’s essentially no ‘No’ option for “Automatic SafeRenew Enabled” and the “Update” button is basically unclickable.

A credit card charge-back seems to be inevitable.

More Horror Stories with Register.com

Just Google for “Register.com Review” or “Register.com Scam” to see for yourself.

  1. http://www.hostingkids.com/host/register.com/
  2. http://www.dnforum.com/f557/register-com-scam-thread-18490.html
  3. http://www.webhostingstuff.com/review/Registercom.html
  4. http://www.whoishostingthis.com/hosting-reviews/register-com/
  5. http://www.ripoffreport.com/directory/register-com.aspx
  6. http://www.webhostingtalk.com/showthread.php?t=1163283

{ Comments on this entry are closed }

Convert Object to Array in PHP

by Yang Yang on June 26, 2012

There are quite a few ways to do this and each of them has its strengths and weaknesses. Find out if one suits your needs by trying one of the approaches below.

Casting with (array)

$array = (array) $obj;

Problem is this doesn’t convert complex / multi-dimensional objects well.

get_object_vars()

$array = get_object_vars( $obj );

$array would then be an array of properties and values from $obj that are accessible in the current scope.

Custom function for complex objects

function objectToArray( $object )
    {
        if( !is_object( $object ) && !is_array( $object ) )
        {
            return $object;
        }
        if( is_object( $object ) )
        {
            $object = get_object_vars( $object );
        }
        return array_map( 'objectToArray', $object );
    }

$array = objectToArray( $obj );

This function is conjured by PHPRO.ORG.

JSON – json_encode(), json_decode()

$json  = json_encode($object);
$array = json_decode($json, true);

This is probably the coolest approach delivered by Andy.

{ Comments on this entry are closed }

Most WordPress themes such as those released by WooThemes come with ready to use widget areas only in sidebar and footer. They are missing out the most important areas of a blog for readership attention and actionable conversions. They are the areas immediately before single post content and immediately after it.

For example, a paragraph naturally flowing at the end of the post as if it’s part of the content would definitely grab the attention of your readers:

immediately after single post content

So How do We Create These 2 New Widget Areas?

Open functions.php and put in the follow snippet:

// This registers the widget area immediately before single post content
register_sidebar(array(
    'id' => 'before-single-post',
    'name' => 'Before Single Post',
    'description' => 'Widget area immediately before single post content',
    'before_widget' => '<div id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>'
));

// This registers the widget area immediately after single post content
register_sidebar(array(
    'id' => 'after-single-post',
    'name' => 'After Single Post',
    'description' => 'Widget area immediately after single post content',
    'before_widget' => '<div id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>'
));

And then open single.php or content-single.php or whatever it is that is the single post template file of your theme. Find the_content() and put before and after it the dynamic_sidebar() function so the widget content is displayed. You will very probably have something like this in the end:

<div id="before-single-post">
	<?php dynamic_sidebar('before-single-post'); ?>
</div>

<?php the_content(); ?>

<div id="after-single-post">
	<?php dynamic_sidebar('after-single-post'); ?>
</div>

Done.

Only 2 files (functions.php to register the widget area and one other file where you intend the widget content to be displayed) that need to be edited and updated to add new widget areas.

Adding Stuff to the Widget Areas

Now if you go to Appearance –> Widgets in the WordPress backend console, you would see 2 extra widgetized areas:

widget areas created

Try adding a widget there (probably the text widget) and see how it looks so you can style it for better attention attraction.

{ Comments on this entry are closed }