發表文章

Microsoft SQL vs Oracle vs MySQL

Microsoft SQL Oracle MySQL Pro's 1. Stored Procedures and triggers 2. Strong Relations management 3. Strong support on the software haven't found any 1. It's FREE! 2. Minimal learning curve 3. Small foot print 4. Reasonably fast with large storages (if queries are optimized) Con's 1. Expensive license costs 1. Costly 2. Lack of support 3. Hardware intensive 4. Steep learning curve 1. Weak relations management

web compare: PHP vs ASP.NET vs JAVA + JSP

Here are a few pro's and con's of the languages: PHP ASP.NET Java + JSP Pro's 1. User friendly, java/javascript type syntax 2. Minimal learning curve for small applications 3. Great array of functions predefined in the system 4. Loads of cheap hosting options 5. Loads of tutorials and pre-written scripts 1. OOP based environment. 2. Allows for rapid development inside the correct IDE's 3. Strongly Typed 4. Java/javascript type syntax 5. Strong graphics manipulation ability 1. OOP 2. Strongly typed 3. Strong Graphics Manipulation ability 4. Loads of API's 5. Open Source Con's 1. Code can get messy quickly if project is not managed properly. 2. Not strongly typed 3. Security depends on the knowledge of the developer 4. Configurations might change depending on host 1. Costly IDE's 2. Steep learning curve for beginner 1. Slow performing IDE's 2. Steep learning curve

Save data in Swift

String array Save array let array = [ "horse" , "cow" , "camel" , "sheep" , "goat" ] let defaults = NSUserDefaults . standardUserDefaults () defaults . setObject ( array , forKey : "SavedStringArray" ) Retrieve array let defaults = NSUserDefaults . standardUserDefaults () let array = defaults . objectForKey ( "SavedStringArray" ) as ? [ String ] ?? [ String ]() Int array Save array let array = [ 15 , 33 , 36 , 723 , 77 , 4 ] let defaults = NSUserDefaults . standardUserDefaults () defaults . setObject ( array , forKey : "SavedIntArray" ) Retrieve array let defaults = NSUserDefaults . standardUserDefaults () let array = defaults . objectForKey ( "SavedIntArray" ) as ? [ Int ] ?? [ Int ]()

Get URL Parameters using jQuery

Get URL Parameters using jQuery To implement this, I have created a function which returns value of any  parameters  variable. function GetURLParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } }​ And this is how you can use this function assuming the URL is,  " http://dummy.com/?technology=jquery&blog=jquerybyexample ".  var tech = GetURLParameter('technology'); var blog = GetURLParameter('blog'); So in above code variable " tech " will have " jquery " as value and " blog " variable's will be " jquerybyexample ". Source from: http://www.jquerybyexample.net/2012/06/get-url-parameters-using-jquery

converting CDR to ISO in MAC

Open Terminal and find the cdr file. and Type: "hdiutil makehybrid -iso -joliet -o  [NEW FILE NAME].iso [YOUR CDR FILE NAME].cdr" done

[PHP] get all URLs from text

Here is the way to get all URLs from text. 以下方法可以把全部連結拿出來. function findURLs($text){ $pattern = '/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?/i'; @preg_match_all($pattern, $text, $matches); if($matches[0]){ return $matches[0]; }else{ return false; } }

Magento skip shipping method on checkout page

** Magento : Skip Shipping Method from onepage checkout ** First override following files ( i . e . in local directory ) rather than changing the core : 1 ) app / code / core / Mage / Checkout / Block / Onepage / Onepage . php 2 ) app / code / core / mage / checkout / controller / Onepagecontrollers . php 3 ) app / code / core / Mage / Sales / Model / Service / Quote . php 4 ) app / design / frontend / base / default / template / checkout / onepage / progress . phtml 5 ) app / code / core / Mage / Sales / Model / Service / Quote . php Once done follow the below steps : ** Step 1 : app / code / local / Mage / Checkout / Block / Onepage . php ** Change the line : $stepCodes = array ( 'billing' , 'shipping' , 'shipping_method' , 'payment' , 'review' ); In Magento 1.7 + you will find $stepCodes in for each just replace with below code with : $stepCodes = array ( 'billing' , 'shipping' ,