April 11, 2008
A colleague came across this one the other day at work. Working on a revised homepage design there was an issue with a z-index opacity layer overlaying some pretty Flash we’d done. Mac/FF : The damn Flash kept disappearing. After some research she found this solution, it ended up being rather simple but could have had us banging heads on desks for hours.
http://opensoul.org/2007/4/26/firefox-mac-flash-css-opacity-peek-a-boo
You simply create a transparent PNG of your required color/opacity and create a repeating CSS background. Then you need to provide a hack for IE ( surprise surprise ) because IE doesn’t support transparent PNG’s prior to IE7. Voila !
April 8, 2008
That’s the great thing about code, there is always something new to learn. I came across this one the other day.
The humble tilde (~) In some articles I read that it’s often used in Propositional Logic, in others it’s a reference to a home directory. In PHP though it’s a ‘Bitwise Operator’.
“…it’s usually used with flag values, where each bit represents an option that is on or off. You have a bunch of constants defined as the individual bit values, like say E_DEBUG, then ~E_DEBUG means “turn on everything except E_DEBUG”. Often used as a mask to turn a particular bit off, as in $flags &= ~E_DEBUG which turns off E_DEBUG while leaving the other bits in $flag unchanged.” - Mark J. Reed, php.general - NNTP Newsgroup (news.php.net)
Here’s some other strange syntax in PHP :
@ - The ‘at’ symbol suppress any errors returned from an expression
http://us2.php.net/manual/en/language.operators.errorcontrol.php
$$ - Is a variable variable
http://us.php.net/manual/en/language.variables.variable.php
% - Is the remainder (Arithmetic Operator)
http://us2.php.net/manual/en/language.operators.errorcontrol.php
&$ - Is a referenced variable
~ - Bitwise Operator ( ^ is also a Bitwise Operator )
http://hu.php.net/manual/en/language.operators.bitwise.php
March 1, 2008
You learn something everyday. I’ve been asked to create a distributor feature of satinsmooth.com and was beginning to wonder where on earth you would start. I wanted to tie it in with the Google Maps API and do some fancy Web2.0 UI stuff. Well after a bit of searching I started to read about the Haversine formula on the Wiki.
Now I’ll admit I’m not the greatest at maths, but it lead me onto some more searches and eventually this article on Google. Brilliant, this is an excellent starting point ! Having never created a store locator before I’m going to append notes to this article based on my findings so anyone else happening across this on the internet will know what to do !