Implicit Evaluation with PHP

Implicit Evaluation with PHP Archives: January 2007

·

30 January 2007

PHP as a Lambda Language

PHP is an imperative language which supports object-oriented programming. However, it supports a number of paradigms closer to what you would expect Lisp or Scheme to allow. I’ve discussed parts of this before, but its time to put together a definitive primer. You’ll learn ways to create entire functions at run time, as well as applying them to entire arrays in a single pass. PHP will seem more LISP-like than it ever has before.

continue reading... » 7 Comments

23 January 2007

What is $_REQUEST, or the difference between $_REQUEST, $_GET and $_POST

PHP provides you a number of “super-global” variables. These include $_GET, $_POST, $_COOKIE, $_SESSION, $_SERVER, $_ENV, $_FILES and $_REQUEST. Most of these are fairly self-explainatory. $_GET are the variables passed by forms with a GET method or after the end of the path such as example.com/search.php?GETARG1=GETVAL1&foo=bar. $_POST is any variable submitted by a form with […]

continue reading... » One Comment

21 January 2007

iPod Alarm Clock with Red Numbers

There are a number of alarm clocks with iPod integration on the market today, however none have the conventional red numbering of other alarm clocks. I much prefer red to the blue these seem to favor as blue is very distracting in an otherwise dark room. Does a red-numbered iPod alarm clock exist?

continue reading... » 0 Comments

18 January 2007

Use your mouse in a terminal application in OSX

In OSX’s Terminal, you can position the text caret using your mouse. Open Terminal: Window Settings, click on Emulation in the drop-down list and check “Option Click to position cursor”. Now, when using terminal, you can hold alt/option and click with your mouse, and the cursor will relocate there. I believe Terminal determines the appropriate […]

continue reading... » 0 Comments

18 January 2007

Loops in PHP

PHP gives programmers many varieties of loops to work with. Despite an overwhelming selection, each is tailored, really, to just one scenario.

continue reading... » One Comment

2 January 2007

Is Apple a Monopoly?

Apple Faces Federal Monopoly Suit
This kind of lawsuit drives me crazy. Is iPod the dominating force in portable music players? Yes. Is there anything wrong with that? No.. What has Apple not allowed? Opening the security that makes its service legal in the first place. The detractors will cry that since iPod is the dominant […]

continue reading... » 0 Comments

1 January 2007

Recursive Data Structures in PHP

Welcome to the Jungle
Today, I was helping a friend implement a recursive category model. There is a top level category and each category contains items and sub-categories.
It’s easy to illustrate on the web:

Top Level Category

Item 1.1
Item 1.2
Subcategory 1.3

Item 3.1
Item 3.2

Subcategory 1.4

Subcategory 4.1

Subcategory 4.1.1

Item 4.1.1.1
Item 4.1.1.2

Item 4.1.2

Somehow, your web browser can take a piece of text […]

continue reading... » 0 Comments

·