Arrow

Posts on this site are never sponsored.

Volunteers needed for Delta government committees and appointments (including Environment Advisory Committee)

So I found this ad in the local Delta paper talking about volunteers needed for local government committees (well, they call them areas). The six areas advertised are:

  • Advisory Design Panel
  • Boundary Bay Airport Advisory Committee
  • Environment Advisory Committee
  • Heritage Advisory Commission
  • Parks, Recreation & Culture Commission
  • Traffic and Safety Advisory Committee

This Environment Advisory Committee caught my eye, and I know there are some qualified and interested people in the community that might never have even heard about this. Here’s your chance to take action if you are passionate about such issues!

  • Environment Advisory Committee, providing advice to Council on climate change and environmental considerations. (Meets monthly on the second Thursday at 7:00pm) (4 vacancies)

See the entire scan of the Delta Committee and Appointments ad for full information on all six areas. The application deadline is January 19th.

Recycle your household batteries!

So I made this pledge on changeeverything.ca to spread awareness about different types of recycling. It seems like the site has worked on me, because now I feel like I have to come through! This post isn’t much, but it’s a start.

So, batteries. Non-rechargeable batteries from your household items can (and should) be recycled! The same goes for rechargeable batteries that have lost their power after multiple charges (such as lithium, Ni-Cd, Ni-MH) from things such as cordless phones. Just keep an ongoing collection and drop it off once in a while. Here are some drop spots or sites to find drop spots in the Vancouver / Lower Mainland area.

-IKEA, near the exits!

-Call2Recycle, where you can search the database for places to drop off rechargeable batteries. London Drugs and The Source by Circuit City are the bigger chains in the database. And who better to be your “mascot” (well, he’s not really a spokesperson) then Al Borland :D

Future Shop (thanks to Dee for the tip)

Alternative disposal locations from the City of Vancouver, where you’ll find a list that includes many other items, such as propane tanks, tires, and computer equipment. For some items you have to pay to have them recycled (a government subsidy would be nice).

– If you’re in Delta, you can drop off your batteries at all recreation and leisure centres. More details here. Thanks to Robert for the tip.

Know of any other places in the Lower Mainland that will recycle batteries? Let me know!

Previously I made a post talking about using custom Google maps for useful community-based implementations. So… who’s going to use that to map out places to recycle batteries?

Simple PHP form validation with ctype_alnum

The key to form security is (as I’m learning) to validate, validate, validate. If you are having users input data for processing by the server, hackers are adept at writing all sorts of code into the form fields that will… do all sorts of mean things.

Here’s a really handy way to validate simple form variables where you only want to allow certain characters. For example, for user names on a registration form you might only want to allow letters, numbers, and underscores.

ctype_alnum is a nice little function built into PHP that will check that only letters and numbers exist in a given variable. With the help of str_replace, you can allow any extra characters you want.

JavaScript (which I won’t talk about here) is also handy as it will give users pop-up warnings before a form is processed, but hackers can simply disable JavaScript in their browsers. Thus, you need a solution to validate a form field after it’s been submitted.

You would place the following PHP code into the file that processes the form variables:

// get the variable, as usual
// if you#039;re allowing apostrophes or quotation marks, you might have to use stripslashes here
$yourvariable = $_POST[#039;yourvariable#039;];

// define here what extra characters you want to allow, all separated by commas
// in this example, we are allowing dashes, underscores, and exclamation marks
$extra = array(#039;-#039;, #039;_#039;, #039;!#039;);

// if $yourvariable has characters other than letters, numbers, and those defined in $extra, don#039;t allow the form to process any further
// that 'p' character can actually be any letter or number
if(!ctype_alnum(str_replace($extra, #039;p#039;, $yourvariable))) {
die ("Sorry, you entered some invalid characters. Please remove them before submitting again.");
}

eZ Components Graph: knocks the socks off Excel

Say goodbye to the ugly Excel graphs and never look back!

There’s a package of open source PHP mini-apps / libraries called eZ Components, and the “Component” that caught my eye was Graph. So I quickly mixed some code from the tutorial to create my very own catchy pie graph:

My example chart generated with eZ Components Graph

Now, I realized I’ve only scratched the surface with line graphs, bar charts, and all sorts of crazy, fancy variations also available…

Oh, and the lesson from that graph is, of course, not to waste so much water making your grass green!

December 31st, 2006 update: because I love pie charts so much, I’ve created a generator that makes pie charts based on the style in the chart above. Remember that this is only a small part of what eZ Components can do!

How to open blister packs / clamshell plastic packaging

Stories such as this one are far too common. But, while some plastic packages are near impossible to open without bringing out heavy duty scissors, first consider your cutting technique. I used to cut straight across the packaging and then try to rip it open like so:

The bad technique for opening plastic packaging

However, try cutting around the perimeter of the packaging, just inside of where the plastic is sealed together at the edges. If you’re right-handed, start on the right… the image below is best for left-handed people:

The better technique for opening plastic packaging

Now, this won’t solve all of the problems of the packaging, but if you are like me and were using the technique illustrated in the first picture, then you might benefit from this! Oh, and see if your municipality recycles the plastic for when you’ve succesfully opened the package without any injuries.