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 }

Create a WordPress Child Theme

by Yang Yang on June 26, 2012

WordPress amazes by making things possible in the simplest and most intuitive way. Child themes are the intended and correct way for customizing a third-party theme and you should always create a child theme to do the customizations so that the original theme stays intact thus ready for upgrade. And this is how you can do it with a file that’s just a few lines.

Follow the steps. Create the child theme folder and its style.css.

How to create a WordPress child theme?

  1. Create a folder in /wp-content/themes and name it however you like as this would be your child theme directory. For instance, you are creating a child theme from Twenty Eleven, and you may name it twentyeleven_one, twentyeleven_two, or something.
  2. Create a style.css file in the new directory and put in the following lines in it:
    /*
    Theme Name:     Twenty Eleven Child One
    Template:       twentyeleven
    */
    
    @import url("../twentyeleven/style.css");
    
  3. That’s it. Now head to Appearances -> Themes and refresh the page to see the new theme that you can activate.

The bold part of the above code is the folder name of the parent theme, so this child theme knows which parent theme it is inheriting from.

Activating Child Theme & Customizations

After you have activated the child theme, everything will be the same as if you have activated the parent theme. And you can overrule the same file in the parent theme by creating an identically named file in the child theme, including .php, .css, .js, .jpg, etc. Note however, you can’t overrule files in a sub-folder of the parent theme.

For example, you can now write some CSS styles in the style.css you just created and it will be overwriting existing styles in style.css in the parent theme directory.

Any customizations to the theme files will be only in the child theme so the parent theme will be free and ready to be upgraded thus preserving your changes.

{ Comments on this entry are closed }

Software to Convert PDF to MS Word Format

by Yang Yang on June 24, 2012

PDFZillaOne of my friends has created a very useful piece of software to do PDF to Word conversions. I find his product a breeze to use so I’m recommending it to my fellow readers. Hopefully it would be of some use to you guys.

Differences between PDF and Word

PDF (.pdf) and MS Word (.docx, .doc) are probably two of the most popular digital file formats for readable documents that are intended for humans. The major difference between the two is that MS Word can be easily edited while PDF is a finalized container of postscript data that are essentially non-editable vector information. Although you can read text in a PDF document, they are actually vector graphics rather than plain text such as those in a MS Word document.

This difference explains why people would want to convert a PDF document to a Word one as they can then make changes to the content and make further use of it. A lot of online tools and desktop applications exist for this purpose, such as PDFZilla, which provides easy procedures to imitate an OCR process to scan and analyze the supplied PDF document and convert it into high quality editable Word, in just 3 clicks. A batch mode is also available for people who want to convert a large number of PDF documents.

How to convert PDF to Word?

This is as simple as 3 clicks. Here are the steps:

  1. Head to http://www.pdfzilla.com and download the latest version of the PDF to Word software.
  2. Run PDFZilla.
  3. Add a PDF file by clicking the big green plus / add button.
  4. Choose the destination format as Word Files (*.doc).
  5. Click “Start Converting Now” button.

Okay, that’s like 8 clicks, but you got have some clicks…😉

Selling PDFZilla for 75% Commission

Lots of my readers are webmasters, so I’m also thinking this might be a good chance to earn some bucks by promoting this software as it’s rather generous of my friend’s offer – 75% affiliate commission. It’s very rare to come by a product of such usability yet of such high commission rate. Definitely much better than those ClickBank hit and run. Think about it.

{ Comments on this entry are closed }

Drop Cap ExampleWhile CSS3 can target the first letter of text inside an element, it’s still not universally supported across major browsers AND it doesn’t work well for elements that have child elements inside. The bullet proof way to target the first letter of a WordPress post would be to capture the content of the post in WordPress theme and match it by regular expression functions in PHP, such as preg_match().

And here’s the code I’ve come up for this job:

ob_start();
the_content();
$content = ob_get_clean();
$content = preg_replace('@<p>\s*((?:<[^<>]+>\s*)*)([^<>\s])@'
, '<p>$1<span class="drop_cap">$2</span>'
, $content
, 1);

echo $content;

Obviously, this code should reside in single.php of your WordPress theme where the content of the posts is being output. Just replace any “the_content()” function in the post area with this snippet.

The key is the regular expressions:

@<p>\s*((?:<[^<>]+>\s*)*)([^<>\s])@

And:

<p>$1<span class="drop_cap">$2</span>

That finds the 1st non-whitespace, printable character (a letter, a numeral, etc.) of a post and adds a surrounding <span> tag with class “drop_cap” to it.

Now you will add some drop cap styles to style.css as class .drop_cap, and the first letter of your posts will have a nice drop cap style. See this blog Mosso Reviews for example.

{ Comments on this entry are closed }

WooThemes.com Discount Coupon Code for 20% Off

by Yang Yang on June 7, 2012

For people who have read my review of WooThemes and wants to sign up a membership with WooThemes.com, don’t forget you can further sweeten the deal by using a Discount Coupon at checkout. Just click to copy and activate this coupon code:

WOO2011
Click To Open/Copy

And you will get $25 off standard membership and $40 off developer membership.

This code is valid as of June, 2012.

{ Comments on this entry are closed }

My WooThemes Review

by Yang Yang on June 7, 2012

WooThemesAs WordPress becomes the de facto standard of web publishing, the need for quality WordPress themes have soared. There are lots of themes vendors across the web but I finally made up my mind to go with WooThemes and signed up a $125 membership with them a few months back. I never looked back. Here are the things I like or don’t like about them off the top of my head.

Good things

  1. Some of the themes look so fantastic and unique! Their themes are much more than just blogs.
  2. They retire old themes that went out of fashion. This means they are very picky of what they offer. When I first signed up, it’s about 125 themes in their repository but recently it has been downsized to 100.
  3. They UPDATE. I log back in my account at WooThemes.com every a few days and the version numbers of the themes change very frequently. Many old themes have been regularly updated and patched since being released more than 2 years ago.
  4. They release new themes every month. While it’s not as exactly as 2 themes per month as they promise, it’s approximately in that pace. And the latest ones are the best.
  5. They have very sophisticated yet easy to use backend configuration panels for every theme. Each of them comes with hundreds of different options regarding a variety of aspects. The administration is quite enjoyable.
    WOOTHEMES CONTROL PANEL
  6. They reply to EVERY THREAD in their member community with usable advice and sensible solutions in less than 24 hours. Sometimes it takes longer for advanced questions that would be assigned to a senior support staff. I asked a total of 16 questions at their community forum and all of them got resolved in less than 48 hours with clear, detailed and professional answers. I actually become better with WordPress (know many useful plugins that make my life easier writing for the web) since I started participating in their forums.
  7. As an intermediate web programmer myself, from viewing their code base and from the answers to my questions, I can tell they have designed their products (themes, theme framework and WooCommerce) well. It’s not a novice-work that’s pieced together and then duplicated over and over again. What they make is a well-formed ecosystem that’s capable of forgiving and extending. It’s both robustly functioning and beautifully usable.
  8. Very great value for money. With this coupon code:

    $25 OFF STANDARD MEMBERSHIP OR $40 OFF DEVELOPER MEMBERSHIP
    WOO2011
    Click To Open/Copy

    You would only need to pay $100 (with $25 OFF, or $40 OFF for developer membership) for a standard membership that instantly enables you to download ALL of their current themes for a month. And subsequent subscription is just $20 per month that you can choose to deactivate or re-activate any time you want without any additional charges.

Not so good things

  1. About 1/2 of the themes don’t look that good, especially old ones. This is probably because they have designed their website so beautiful that I have high expectations from their products and become too easy to be disappointed by their themes.
  2. I tried to think of things I don’t like about them for the last hour…….and I couldn’t think of any, except one time I asked a question about the product image resizing issue for one of their WooCommerce themes and got replies that insisted it was my problem rather than theirs. They turned out to be right. It was my problem because I was not familiar with the WooCommerce options. But still. If a user can be blamed for incompetence to use the software, it’s a developer fail without excuses.

Conclusion

To sum up, I give 4.8 / 5 to WooThemes. Go with them, if WordPress is your core publishing platform. Period. With WooCommerce and their e-Commerce themes, WordPress can be a very powerful online store as well. Being a member of them would make sure you stay on the decisive edge of web design trends for your web projects.

{ Comments on this entry are closed }