Sunday, March 31, 2019

Language hot keys are gone after sleep/restart (Windows 10)

I set up some language hot keys in Windows 10. For example: Ctrl+Shift+1 is for Japanese keyboard, Ctrl+1 is for English keyboard.

Whenever the computer goes to sleep, the hot keys are gone and I have to set them up again.
These are the steps to prevent Windows 10 from removing the hot keys:

  1. Go to "Region & Language Settings".
  2. Choose "Administrative language settings".
  3. Click "Copy settings" button in the Administrative tab.
  4. There are 2 check boxes at the bottom, check both of them and click OK.
  5. DONE.

Source:
https://superuser.com/questions/1031736/language-hotkeys-removed-by-itself-in-windows-10

Sunday, May 17, 2015

Header inside a paragraph

I was doing some practice on CSS descendant topic.

Here's the html:
<div id="sample">
 <p>
  <h2>Header</h2>
 </p>
</div>
And here's the CSS
#sample p h2{ color: blue;}

I was trying to change the header's color to blue, but it wasn't working.
Why? Because the browser implicitly terminate the p element when they encounter a heading.
According to the standard, a paragraph can not contain other block elements.

The browser changed the html to this:
<div id="sample">
 <p></p>
 <h2>Header</h2>
</div>

I use Google Chrome browser. To check what the browser changed, open the Developer Tools (Ctrl + Shift + J), then click the Elements tab on the left top.

Source:
http://stackoverflow.com/questions/15656785/should-a-heading-be-inside-or-outside-a-p




Thursday, October 9, 2014

Turn off PHP magic quotes on shared hosting

I have a simple html form containing textarea and submit button. When I submit the form, PHP automatically escape all single quote. The problem happens only on shared hosting.

This problem caused by PHP's magic quotes. It's automatically turn on in my shared hosting.
So, how to turn it off?

Firstly, open the File Manager on your web hosting, and go to the root folder.
In my case, I go to the root folder for the subdomain.
Example: if the subdomain is guitar.example.com, then I go to public_html/chord folder.

Now, let's create "php.ini" file in this folder, then add this line
magic_quotes_gpc = Off

Then saves the file. That's all, magic quotes is off.

By the way, what is gpc? It stands for Get Post Cookie. So, it turns off magic quotes for Get, Post, Cookie variables.

Wednesday, September 17, 2014

Changing default timezone in WAMP

I use WampServer on Windows 7. I tried to display the default time using PHP, but the wrong time was displayed.

Well, the default timezone was incorrect. How to change it?
First, click the WAMP icon, then go to PHP, then open php.ini.

Now, search for "date.timezone", then change the value from UTC to anything you want.
In my case, I changed it to Australia/Sydney.

You can find the list of supported timezones here:





Wednesday, February 26, 2014

Install ruby's mysql gem on Windows 7

I have mysql database on my computer. I would like to use Ruby to access it.

First step is to install mysql gem. Run this at command prompt:
gem install mysql

Next step is to download the libmysql.dll
Here's the link to download the dll
http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
Extract the downloaded file, and go to the 'lib' directory and copy 'libmysql.dll'.

Now go to your ruby installation folder, open the "bin" folder, then paste the "libmysql.dll".

That's all.

How to test it? Create a ruby file, and type
require 'mysql'

Then run it. You won't see any error if the installation was successful.

Sunday, February 23, 2014

Install Chrome for all users in Windows 7

I created a new user account in Windows 7. When I logged in using the new account, I could not find Chrome browser.

How to solve this problem?

  1. Log in using administrator account
  2. Uninstall Chrome (https://support.google.com/chrome/answer/95319?hl=en)
  3. Download this alternate Chrome installer: https://www.google.com/intl/en_uk/chrome/browser/index.html?system=true&standalone=1#eula
  4. Done
The alternate Chrome version will install Chrome for all user accounts (https://support.google.com/chrome/answer/118663?hl=en).

However, there's a problem with the Chrome for administrative account. There's an error saying "Your profile cannot be used because it is from newer version of Google Chrome".

To fix it, go to this folder:
C:\Users\YOURUSERNAME\AppData\Local\Google\Chrome\User Data\Default

(Note: if you can't see the AppData folder, you have to activate the "Show hidden files" option in the folder option)

Then delete the "Web data" file.

Then I tried to open the Chrome but nothing happened.
So, I log out from Windows, then log in again.
Now everything's allright.

Wednesday, February 19, 2014

Can't start CyberLink YouCam on Windows 7

CyberLink YouCam 3 can't be open on my Windows 7 laptop. There's nothing happen when I tried to open it.

I found 2 solutions for this problem.

Solution 1: Run it as administrator. Just right click on the program link, then choose "Run as administrator".

Solution 2: Right click on the program link, then choose "Troubleshoot compatibility".
Choose "Try recommended settings", then choose "Start the program". If YouCam is started, then you can just click "Next" and choose "Yes, save these settings for this program".