Web application with date and time sensitive information are tricky sometimes when you have users coming from different timezones. The easiest solution I’ve found is to save whatever date and time into database (oracle, sql server, mysql, whatever) as GMT and convert it back to the user’s timezone when fetching it from the database to display to the user. Using PHP and MySQL, here’s how you do it.
[Read more…]
Top 10 Creative Uses of Cloud Storage
Cloud storage is everywhere these days. Cloud Backup has become somewhat of a fad. But the good news is that cloud storage is actually useful. You can save a lot of time and money by utilizing cloud storage for both business and personal use. But there are plenty of ways to use cloud backup services in addition to simply storing data in the cloud. Let's take a look at 10 ways you can use virtual backup services creatively.
[Read more…]
Eclipse Collapse & Expand All Keyboard Shortcut Key
Here’s the shortcut keys to collapse all and expand all code folds in eclipse.
Collapse All: CTRL + SHIFT + NUM_PAD_DIVIDE (/)
Expand All: CTRL + SHIFT + NUM_PAD_MULTIPLE (*)
Note that both uses the divide(/) and multiply(*).
They are not the same as “the / which share the same key with ?” and “the * which you can get with shift+8
MySQL Replace Syntax
The MySQL replace syntax is pretty simple to use. For example, let’s say using wordpress and you would like to replace all post titles with 2013-2014 to 2014-2015, you can simply use the following SQL syntax:
UPDATE wp_posts SET post_title = REPLACE(post_title,’2013-2014′,’2014-2015′)
More examples, such as searching and replacing text in the post_content column
UPDATE wp_posts SET post_content = REPLACE(post_content,”width:500px; height:500px;”,”width:740px; height:900px;”)
UPDATE wp_posts SET post_content = REPLACE(post_content,’text\’>www.’,’text\’>http://www.’)
Note that the REPLACE function performs a case-sensitive match when searching.
So let’s say post_title is “OLD POST title” and we would like to update that to “new post title”
This won’t work as there’s no exact match of “old post”
UPDATE wp_posts SET post_title = REPLACE(post_title,’old post’,’new post’)
Do this instead
UPDATE wp_posts SET post_title = REPLACE(post_title,’OLD POST’,’new post’)
Paypal IPN eCommerce Payment Transaction Integration Notes
1. You need either a business or premier account to use IPN. (sourceforge)
2. Enable Auto Return (in Paypal > Profile > My Seller Tools > Website Preferences > Auto Reply > On) to redirect users back to your site after making a payment.
[Read more…]
Magento Encryption Key Location
You are given an encryption key after Magento is installed successfully. This key is just a text string and stored in a xml file called local.xml in your magento installation folder.
[Read more…]
Perl MP3::Tag Module Software Error Writing of ID3v2.4 is not fully supported (prohibited now via `write_v24′) Solution
While working on a project to read and write mp3 id3 tags using Perl’s MP3 Tag module, I found out that I was getting this error:
Software error:
Writing of ID3v2.4 is not fully supported (prohibited now via `write_v24′).
For help, please send mail to the webmaster, giving this error message and the time and date of the error.
Getting Netbeans 7.0.1 To Work With SVN 1.7 Solution
Upgraded to TortoiseSVN 1.7 and found out that Netbeans 7.0.1 doesn’t recognize some of the checked-out source code using TortoiseSVN 1.6. Here’s how you can get Netbeans to work with SVN 1.7.
[Read more…]
CakePHP Warning 512 Cache Not Configured Properly Solution
While working out how to do caching for my CakePHP app with some builtin ACL permissions goodies, I came across this error message:
Warning (512): Cache not configured properly. Please check Cache::config(); in APP/config/core.php [CORE/cake/libs/configure.php, line 408]
I’ll cut the long story short and tell you what I did wrong so you don’t repeat the same mistake.
[Read more…]
XAMPP + Flash Builder for PHP Project Settings
I just got started with Flash Builder for PHP yesterday, read some tutorials, built a demo and it looks like it’s something that I’ll be investing some time into moving forward.
[Read more…]