php

Using the Correct Ruler

Sometimes, the guys controlling the synapses are asleep at the switch, and things I've always known are momentarily gone. It's one thing when I know that to be the case — knowing what I don't know — such as seeing an actress on the screen and being asked who it is. I knew until I was asked. It's not knowing that I don't know that's the bigger problem...not realizing that I've forgotten, because the switchman hasn't fallen asleep, he's thrown the wrong switch.

Tags: 

The Secret to drupal_add_js

drupal_add_js() doesn't add javascript or jquery to your Drupal page? Let's take a look at why, and how to fix it.

Why PHP?

Whenever I sit down to design the architecture of a new application, I sit back and ponder. For the past few years, my decision continues to be: php.

I have read many blog entries on the merits of choosing php, ruby or java, and theories on why programmers make choices in opposition to the blogger's. It's my turn to weigh in, for what it's worth.

When A Leap Year Really Isn't

In the previous blog entry, 3. Are You Odd?, I referred to determining a leap year still being a manual programming process in many cases. There are certainly umpteen library functions out there to do it, but it's simple to do and a nice programming exercise for function writing.

How does one determine if a given year is a leap year? It's a common belief that if the year is evenly divisible by 4, that it is a leap year. That is true most of the time, but not always.

Are You Odd?

Occasionally the needs arises to determine if a number is odd or even. Why would you need to do this? One example is the 'striping' of output, where information is presented in rows, and alternating rows have a different background color, like this:

Row1
Row2
Row3



You would think that languages would all have a function for this by now, but just as determining whether a year is a leap year is often still up to the programmer, so too is whether a number is odd or even.

Pages

Subscribe to RSS - php
©2005-2017 Ayen Designs. Underlying theme by Kiwi Themes.