Instalasi Apache PHP MySQL di Mac OS X

Sebagai pengguna baru Mac yang terbiasa dengan Windows, instalasi Apache PHP MySQL di Mac OS X bisa dibilang sangat dimudahkan oleh Apple, alasannya Apache dan PHP sudah built-in di MAC OS X, sehingga yang perlu di download tinggal instalasi MySQL nya saja.

Bagi yang biasa di Windows tidak pernah memakai password untuk login Windows, maka lebih baik set password dulu di Mac OS X nya, karena di Mac OS X kita akan diminta password saat setting PHP dan MySQL

Buka aplikasi “System Preferences” –> Klik icon “Users & Group” –> Klik “Change Password” –> Masukkan password baru di “New Password” dan “Verify” –> Lalu klik tombol “Change Password”

ganti password

OK, klo kita sudah punya password, kita lanjut ke step-step berikut:

Read more of this post

Declaring static, dynamic JavaScript associative and multi-dimensional array

Javascript doesn’t have associative or multi-dimensional array. It only have object that might form like “associative” or “multi dimensional” array.

Example of associative array
Statement like founder[“microsoft”] expecting result like bill gates

Example of multi-dimensional array
Statement like products[“microsoft”] expecting array values like windows, office, xbox

These codes below provides how we can achieved associative and multi-dimensional array in javascript

Read more of this post

Hide scrollbar, but still scrollable (using CSS)

I made post about this topic by using javascript onmousewheel event, then by calculating delta status we can trigger function that perform scroll up/down via window.scrollTo object.

Actually it’s good technique, I use it since 2007, but the challenges are:
– different delta calculation for different browser
– need decent function to performs good/realistic mouse scroll up/down response.

I found somewhere in internet the other technique, using CSS. Less codes, cross browser, and use native mouse scrolling feature, here’s the codes

Read more of this post

Programming By Using iOS Device

Most people problem is thinking closed platform like iOS is limiting their user access. I don’t agree. I believe iPhone, iPod or iPad provide smart solutions for end-user. Smart solution mean by use of eye-blink activation/gesture, Siri-voice assistant, etc. This is 2012 bro! End-user should not type command line to run photo slideshow animation. WTF!

If the problem is coders prefer to typing codes rather than playing angry birds, there are two apps for that. No Jailbreak required. Offline. Both are free.
Read more of this post

Spoofing JavaScript User Agent Navigator

Most programming languages offer access to make custom HTTP User Agent value. We often did this to fool server side page (PHP, ASP, JSP, etc). But spoofing only HTTP request header is not working on JavaScript since navigator.userAgent don’t read your HTTP request. JavaScript rely on their own runtime to recognize browser HTTP User Agent. Thanks God JavaScript it self is able to change/rewrite navigator.userAgent value, here’s the code Read more of this post

MySQL multiple count in single table with different where clause

Sometimes we want to do multiple count task on specific table.

Here’s the worst we could do, we doubling the job, pathetic

$q1 = mysql_query( "select count(column) from table where column = 'x' ");
    echo( mysql_result( $q1, 0 ) );
$q2 = mysql_query( "select count(column) from table where column = 'y' ");
    echo( mysql_result( $q2, 0 ) );

Then we thought this could be better, using subquery

select
    (select count(column) from table where column = 'x') as count1,
    (select count(column) from table where column = 'y') as count2
from table

that’s also pretty stupid and wasting.
but there’s another idea..

Read more of this post

CMD/CLI Shutdown MySQL

some how we need to start and shutdown mysql in secrecy, without password. To start Mysql without user password we could type

\path\mysqld-opt.exe --defaults-file=/path/my.cnf

and this is how we stop MySql without password in command line Read more of this post

Hide Mouse Cursor in Opera Browser

many ways to hide cursor in web browser, and i believe the reason is only to use for specified device/pc
– by using css (cursor none, cursor url blank transparent 1px image file )
– by using javascript (augmented by image)
– by using opera ini file setting

too bad none of those are work. I guess opera dev guys let this happen so they can have advantage from custom opera license (just my thought).
The last hope to hide opera cursor is to replace OS cursor, but this is rise more trouble for other program that need mouse visibility.

The wise solution is Read more of this post

Get Top Visible Line & Last Visible Line in HTML

I remember VB have great API to get reference of textbox first/top visible line position. I mostly use that to generate line number for my own text editor. Top visible line position is great reference and we can afford it in web development by using JavaScript.

I created this code in single line ternary, here it is: Read more of this post

Remove Yahoo Messenger Ad by edit Hosts file

I love to use my Yahoo Messenger 8.1., since the avatar are small, plain simple UI. But I don’t like the ad:
– it’s distracted
– i worried it’s a vehicle for chat virus

So i own new windows 7 and some ad-remove tweaks from internet doesn’t work. If you also run a localhost on your PC, you could follow this trick to remove the ad. Read more of this post