發表文章

目前顯示的是有「programming」標籤的文章

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

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 ]()

[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' , ...