Best practice for parsing HTML in PHP? Use DOM




function cfriend_get_href_links($html) {

// Create a new DOM Document to hold our webpage structure
$xml = new DOMDocument();

// Load the url’s contents into the DOM

// Empty array to hold all links to return
$links = array();

//Loop through each <a> tag in the dom and add it to the link array
foreach($xml->getElementsByTagName(‘a’) as $link) {
$links[] = array(‘url’ => $link->getAttribute(‘href’), ‘text’ => $link->nodeValue);

//Return the links
return $links;

facebooktwittergoogle plus


Best practice mysql NULL or not ?




I Personally use NULL for more powerful results..


By using NULL you can distinguish between “put no data” and “put empty data”.

Some more differences:

A LENGTH of NULL is NULL, a LENGTH of an empty string is 0.

NULLs are sorted before the empty strings.

COUNT(message) will count empty strings but not NULLs

You can search for an empty string using a bound variable but not for a NULL. This query:

FROM mytable
WHERE mytext = ?
will never match a NULL in mytext, whatever value you pass from the client. To match NULLs, you’ll have to use other query:

FROM mytable

facebooktwittergoogle plus


How to store and deal with Mysql currency money value data?

Since money needs an exact representation don’t use data types that are only approximate like float. You can use a fixed-point numeric data type for that like

15 is the precision (total length of value including decimal places)
2 is the number of digits after decimal point
See MySQL Numeric Types:

These types are used when it is important to preserve exact precision, for example with monetary data.


I personally use numeric(19,4) for financial records that gives you a better hand to play and adopt new requests easily.

facebooktwittergoogle plus


Which stage to create a restore backup for Windows for a Music DAW setup? Symlink to save space or decide what files to bring out or stay home

Right now, important to be problem-free, virus free.

So we install ALL drivers, ALL Cubase and default softwares ONLY – maschine, remote sl… skip komplete and opther stuffs

For the non-defaults, i.e. trillian,stylus etc,  try to install them and ALL plugins to another directory outside of SYSTEM directory, By system we mean C:\program files , anywhere that will be backed up and restored. A good location would be ANOTHER DRIVE \ Musicdata\ Vstplugins

+ automap, remote SL

+ maschine


Remember to point Cubase to use the right VST folder in MUSICDATA, to scan in Plugin Manager.




Configure power energy settings for your OS.



Finally use Macrium Reflect on Windows 10:


– VSS failure image backup ? : http://windowssecrets.com/forums/showthread.php/172081-Best-of-breed-Win10-s-hybrid-backup-system?p=1026251&viewfull=1#post1026251

  • Use Windows 7 on Macbook pro to do it.


MUSICDATA folder of plugins and samples can be symbolic linked to an external drive and behave like it’s LOCAL to cubase, maschine and other softwares:



  • Copy MUSICDATA from local to external drive i.e. J:\
    – Pick J:\MUSICDATA as ‘PICK LINK SOURCE’ on right click menu in File Explorer
    – Then on local C:\ (lacie) drop as ‘SYMBOLIC LINK’
    – that’s it!
facebooktwittergoogle plus


Song: Hero Color

Stage 2:

Building the percussions and FX.

Rise Rising Sweep 1:

  • Using Omni road runner, turned off Churchbells, and replaced A instrument with White noise, then automated cubase EQ sweep HP.
  • Some kick and snare (sidestick)
  • bounced to rough_stage2_bounce


Stage 3:

  • Building another set of kick and snare chorus use.
  • Building hi-speed hihat for R&B style repeats.
    •  Nexus > Arp > play with settings
    • Speed 1/64 or 1/64T
    • Adjust ‘gate’ for length of each repeats
    • And you can select the notes.
  • Sweeps: Omni Danish noiz and White avalanche hit
  • Downlifter Sweep Hit: Omni (Falling modular laser) replace sound with ‘Anguished Cries’ – can use any sound
  • Found a dark hit: Just a friendly reminder in Omni
  • Bounce
  • Unload



Stage 4:

  • Creating the instruments to use the above beats
  • Creating instrument also means we can perform live in the future!
  • Snare, Kick, sidestick, crash1, crash2, hihats, rises, uplifter, downlifter, hit


Stage 5:

  • Consider adding Hello cover effects and sounds.
  • Arrangement upgrade
  • sound effect list find: nexus – drum singles – dr fx 5 – underwater sonar c4
  • sound effect list find: nexus – drum singles – dr fx 6 – heartbeat, lightning, gunshot for cowboy song


Stage 6:

  • Upgrade main drums
  • Added
  • Done.
  • Bounce Addictive drums multi:
    • Turn on all channel outputs on Add Drums from Instruments window list.
    • Output every instrument on the ADD drums interface .. down arrow icon.
    • Bounce and select multiple channel export and select all of them, input PREtitle.


Stage 7:

  • Simple mix and noises


Stage 8 : vocals

  • Recorded, mixed, eqed.
  • recording CHINESE version later, use this project
  • Read and research: rihanna vocal mix  http://www.soundonsound.com/sos/feb07/articles/insidetrack_0207.htm
  • Used Monodelay FX channel, and Ronin Damage on the exported vocal track for our DELAY track



Stage 7: Add inspiration PADs? Panning instruments?



  • Front part, too many empty dead space .. need pad, white noise or  surrounding ambience.
  • Mix bring out high pass .. for all instruments except drums  and vocals a lil.


facebooktwittergoogle plus