Items filtered by date: December 2014

Thursday, 13 September 2012 12:54

What MySQL Database Collation should I use?

There are a few things to go through to help you understand MySQL collations before you will understand what collation you should use.

The difference between utf8_general_ci and utf8_unicode_ci

To know the difference between utf8_general_ci and utf8_unicode_ci we need to break down the collation's name.

  1. UTF8 - this is the character set to be used. Computer using different languages reference characters with different ascii/binary references such as latin1. UTF8 is a character set which try to cover all characters in one set.
  2. This question should be "What is the difference between general_ci and unicode_ci?"
    The difference is the algorithm MySQL uses to search (and interact i think) with the database. general_ci is less resource intensive but not as good as unicode_ci. Because of the power of modern webservers performance is no longer a concern so unicode should be used.

So this means that:

  • utf8_general_ci collation uses the UTF8 character set with the general search algorithm with good performance and lower quality results
  • utf8_unicode_ci collation uses the UTF8 character set with the unicode search algorithm with lower performance and better quality results

Where possible select utf8_unicode_ci (see notes below)

The difference between UTF8MB4 and UTF8

The correct implementation of all UTF8 characters requires 4 bytes per character but for some reason PHP/MySQL implemented UTF8 using only 3 Bytes and they called this UTF8. It has taken until recent times for servers to fully support this and CMS platforms to catch up, they now call this UTF8MB4 and it is fully backwards compatible with UTF8.

Using UTF8MB4 allows you to use all UTF8 characters including emojis and some international characters and store these in the MySQL database.

So this means that:

  • utf8_unicode_ci collation uses the UTF8 character set with a 3 byte storage limiting the UTF8 characters that can be used
  • utf8mb4_unicode_ci collation uses the full UTF8MB4 with a 4 byte character allowing the full use of all UTF8 characters
  • UTF8 Tables and Databases can be upgraded to UTF8MB with no data loss. The reverse will cause data loss.
  • Better international language support because more characters can be used in one collation
  • Allows the use of native emoji characters
  • UTF8 and UT8MB4 are not language specific

Where are collations used?

We must know that there are several places to use a collation and they are all set seperately.

  1. Server Connection Collation - There connection between PHP and MySQL daemon
  2. Default Collation - The databases has a default collation
  3. Table Collation - Tables in the database can have a specific collation set which does not have to be the default collation.

Have you heard the expression "A chain is only as storng as its weakest link", the journey of data from PHP to a MySQL database is not different. So what do I mean? As you can see above there are several places where you can set collations, each of these collations need to be able to support the data you are sending it.

When a UT8MB4 character is sent to the database if any of the steps/collations in the chain are set to UTF8 only, the the character will be trunctacted (the last byte cut off) and a different character will be stored. If you send a UTF8 character down a chain that all supports UTF8MB4 then no data loss will occur because UTF8MB4 is backawards compatible with UTF8.

What Collation should I use?

So now if we take what we have learned and summarise here:

  • unicode_ci give better results that general_ci and performance is no longer an issue
  • UTF8 Databases and Tables can be upgraded to UTF8MB4 without data loss
  • UTF8MB4 is backwards compatible with UTF8
  • UTF8MB4 is a correct implementation of UTF8 and allows use of all UTF8 characters
  • Most webservers now fully support UTF8MB4
  • Most popular CMS are now pushing UTF8MB4
  • UTF8MB4 has better international language and allows you to use emoji
  • the whole data chain (PHP --> MySQL Database) needs to support the collation you are using

Which means you should ideally use the following:

  1. Server Connection Collation - utf8mb4_unicode_ci
  2. Default Collation - utf8mb4_unicode_ci
  3. Table Collation- utf8mb4_unicode_ci (when needed)

In Summary

You will be using the UTF8MB4 collation for the whole chain which fully supports all UTF8 characters (3 and 4 byte) and is backwards compatible with UTF8 (3 byte) allowing all languages to be used. The unicode_ci search algorithm is used for better results as the performance hit is not longer noticable.

Links

Published in MySQL
Thursday, 13 September 2012 12:28

Dead Laptop Diagnosis

Does not turn on or do anything when power button is pressed

  • this is most likely the power regulator has been blown, checked with multimeter to see if the power gets past the FETs and regualtor as per tutorial
  • see if the laptop powers on with the battery and/or the mains
  • clear bios sometimes works

when power button is pressed the fan powers up and lights turn on. they either follow a pattern of a laptop reseting or they stay on as you would expect normally and the hdd powers up but nothing on screen either internal or external

  • this is most likely a faulty graphics chip and the solution is to reflow. sometimes it can be the chipset chip but this is rare unless there is not dedicated graphics chip in which case it is the chipset chip
  • this can also be caused by a dodgy bios, clear bios
Published in Laptops
Thursday, 13 September 2012 11:59

'New Text Document' context menu item missing

I can't create an empty text document. I right-clicked on my desktop, pointed on New and then I can't see the 'New Text Document' option. I was able to make empty text documents a few weeks ago, but now I can't because the option is lost from the menu. I guess some software modified it.

This fault can be caused by different routes


The following links are from Windows 7 - 'New Text Document' missing?

Solution 1

Search on the thread for 'How repair a missing New Text Document in the Context Menu for Windows 7'

this is a post which basically gets you to install a registry file to restore the damaged section of the registry

Solution 2

I had the same problem with "Text Document" missing from the New menu. In my case, the Default value in HKEY_CLASSES_ROOT\.txt had been changed. All I had to do to fix the problem was to change the Default value back to txtfile

I know in XP that changing the file associations under HKEY_CURRENT_USER was optional, but I guess in Windows 7 it's mandatory.

The following link is from 'Windows 7 | Context Menu | new text file Missing?'

Solution 3

There is a registry file on this thread which might be the same as from seven forums


Related Articles

Published in Windows 7
Thursday, 13 September 2012 10:22

Error Installing SP1 in Vista - wdf01000.sys

I tried to install SP1 on a customer's Vista laptop today. It took about 2 hours then eventually a black screen appeared and it started working through 95,583 files until it reached 3790/95583 and stuck, where it remains now.

The white writing is as follows..

!! (4) !! 3790/95583 (wdf01000.sys)

The screen flickers as if trying to move on but can't get beyond this point.

I have tried restarting using last known good config but the same thing happens.

I have also tried the repair option of system restore but that ran for about 4 hours without anything happening.

Is there anything I can try or would it be easier to backup and reinstall from scratch?


I have fixed the problem by simply copying another copy of wdf01000.sys from the winxs folder to c:\windows\system32\drivers and the service pack installation carried on normally after that and Windows booted with everything working..

Published in Windows Vista

If you have access to phpMyAdmin, simply log in to the WHMCS database and run one the following commands using the SQL tab.

You need to replace www.yourdomain.com/whmcs/ with the correct URL to your installation, including trailing slash. You should then be able to access WHMCS again.

This is is to change url and disable SSL

UPDATE `tblconfiguration` SET value='http://www.yourdomain.com/whmcs/' WHERE setting='SystemURL';
UPDATE `tblconfiguration` SET value='' WHERE setting='SystemSSLURL';

This code changes both the nomal url and the SSL url

UPDATE `tblconfiguration` SET value='http://www.yourdomain.com/whmcs/' WHERE setting='SystemURL';
UPDATE `tblconfiguration` SET value='https://www.yourdomain.com/whmcs/' WHERE setting='SystemSSLURL'; 

 

Published in WHMCS
Wednesday, 12 September 2012 21:37

Fixing the Green Screen Flash Player Problem

Have you ever loaded a video on the Internet and, instead of the video playing, you got a weird, greenish-tinted screen that moved a bit but didn’t let you see the video? I had that problem for months, and finally solved it about a week ago. I’d been planning to write a post, but apparently now I don’t have to. Amit Agarwal, as he always does, explains how to solve the green screen problem:

If you refresh the web page, the ‘green screen’ problem might vanish temporarily but it is very likely to stage a comeback in your next browsing session. And this problem is not specific to YouTube but any video website that uses the Adobe Flash Player.


The fix is however simple. While you are on a video page, right click anywhere inside the Flash Player and choose settings. Now click the first tab that says Display (look for the monitor icon) and uncheck “Enable Hardware Acceleration.”

If that doesn’t make sense, watch the screencast in his post to see exactly how to do it.

Published in Applications
Wednesday, 12 September 2012 21:19

Manually remove SPTD driver


To remove SPTD you should do the next:
 

- Open Register Editor, navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\SPTD and change Start value to 4.
- Now do a reboot, navigate to this key again and change permissions on this node (key) - right click on the node, permissions and set Full Access to Everyone.
- Delete this key, do a reboot and install DAEMON Tools again.

and

If your system has some problems with SPTD installation you can do as follows:
 

If your OS is already running then go to step 2 directly.
If you cannot boot your PC at all then start from step 1.

1. Boot in safe mode and press ESC key when you see on bottom line of display:
"Press ESC to cancel loading SPTD.sys". This will abort loading of SPTD layer.

2. Open registry editor (run regedit) and browse to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\sptd
Change the value "Start" (DWORD) to 4 (i.e. disabled).
[To re-enable SPTD service change the "Start" value back to 0.]

3. Reboot again in normal mode and check if your issue is solved.


Are either of these procedures the answer I'm looking for? I'm new enough that, while I did locate the key, and "Start"(DWORD), I don't know *how* to change the value to 4.


To just disable the driver

1.Create a new Text Document (.txt) File.
2.Rename it as "SPTD.reg".
3. Right-Click the file and select "Edit"
It will open in notepad or wordpad.
4. Copy and Paste the following below in the "SPTD.reg" and save and Double-Click it to run and click yes when asked to and restart your computer and your SPTD Service is disabled.(Copy as is)

{code}Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\sptd] "Start"=dword:00000004 {/code}

Published in Applications

I recently installed Adobe Acrobat X on mac, and when I opened up firefox I noticed that I got a new addon titled "Adobe Acrobat - Create PDF 1.0." The uninstall and disable buttons are not greyed out, but when I try to uninstall the addon and restart firefox it's still there. I could not find a settings in adobe acrobat to disable this addon, but one peculiar point was in preferences under "internet" the "display pdf in browser using" option was checked and greyed out. However, I do not know whether this is pertinent to this problem. How do I get rid of the addon? Adobe acrobat x did not install any additional plugins. Any help would be appreciated.


The reason you can't remove it in the way you were expecting is because it loads via a plug-in instead of as an add-on extension.

There are a few methods of removing it from Firefox, depending on what degree of removal you want:

- Turn off the toolbar in Firefox.
1. Choose View > Toolbars.
2. Click to uncheck Adobe Acrobat - Create PDF.

- Disable the plug-in in Firefox.
1. Choose Tools > Add-Ons.
2. Click the Plugins tab/section.
3. Locate and then click on the Adobe Acrobat - Adobe PDF Plug-In For Firefox.
4. Click Disable. Restart Firefox for the change to take effect.

- Uninstall the plug-in.
1. Open the Add Or Remove Programs (Windows XP) or Programs And Features (Windows 7/Vista) item in the Control Panel.
2. Locate and then click on Acrobat X.
3. Click Change (or Uninstall/Change).
4. Click Next.
5. Click Modify.
6. In the list, expand Create Adobe PDF.
7. Expand Adobe PDFMaker.
8. Locate Mozilla Firefox.
9. Click the install options button to the left of Firefox and choose This Feature Will Not Be Available.
10. Click Next, and then click Update. Once the installer finishes, the plug-in should be removed.
Published in Firefox

im getting an when visiting my website or uploading something to a website, ie uploading a module zip file in joomla.

Bad Request Your browser sent a request that this server could not understand.
or
Size of a request header field exceeds server limit


This can be solved by one of 2 ways

  • Use another Browser
  • It's a cookie problem. Either clear your cache and delete your cookies, or go into the cookies folder and delete the cookies for that site manually.

 

Published in General
Page 61 of 96