storereporttools
rss

Archive

Archive for March, 2010

PHP: Validate an IP Address

March 13th, 2010 2 comments

So you need to check if some string is a valid IP address. You could simply test it against a regular expression:

1
2
3
4
5
6
7
function is_valid_ipv4($ip)
{
    return preg_match('/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
        '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
        '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
        '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/', $ip) !== 0;
}

Regular Expression obtained here

This will actually work for most situations, but it's lacking in a few ways. Suppose you want to exclude private or reserved IP addresses. Maybe you want to validate IPv6 addresses too; not just IPv4.

Enter PHP's Data Filtering Extension. It just works, and you don't have to worry about maintaining (or properly applying) complex regular expressions.

Read more...

service

Nancy Pelosi is a liar, and I can prove it (stop the health care bill)

March 12th, 2010 1 comment

Nancy PelosiSpeaker of the House, Nancy Pelosi, has been at the center of this very heated controversy about health care. She has relentlessly pushed this legislation trying to "make history."

For those that don't know the history of this bill, I'll break it down for you:

  • November 7, 2009 - The House - under enormous pressure from Pelosi - passed The Affordable Health Care for America Act H.R. 3962
    • This included the Stupak-Pitts amendment which enforced long-standing law banning federal funding of abortion except in cases of rape, incest, or danger to the life of the mother.
  • December 24, 2009 - The Senate passes their version of the bill - The Patient Protection and Affordable Care Act H.R.3590
    • This did not include the Nelson-Hatch amendment which contained the same language as the Stupak-Pitts amendment.
  • February 25, 2010 - President Obama holds his "Health Care Summit" in which nothing is really accomplished. Well... almost. More on that later.
  • The current strategy is to pass the Senate version of the bill through the House, which is supposed to happen in a vote on March 18, 2010

Nancy Pelosi is - of course - putting huge pressure on pro-life Democrats that voted for the Stupak-Pitts amendment to now support the Senate bill without the anti-abortion language included.

Now it starts to get ridiculous. The one thing that was accomplished at the Health Care Summit? The country got to see first-hand just how corruptly this entire proceeding has been handled.

At the Health Care Summit, Pelosi had this to say:
Read more...

e-mail
forum
report