26 February 2010 ~ 1 Comment

Accessing Values by Referrence in a Foreach Loop

Here’s a fun little trick. When looping over an array, you can access the values by reference. Instead of:

foreach ($things as $i => $thing)
{
  $things[$i] = strtolower($thing);
}

You can reference the values of the array:

foreach ($things as &$thing)
{
  $thing = strtolower($thing);
}

It’s a small difference, but it comes in handy once in a while, especially when you’re doing more significant processing with each item.

Continue Reading

Tags:

11 January 2010 ~ 3 Comments

2009 – My Year in Review

This comes from an email I just wrote to an email pal from New Zealand. Here’s my update in multiple list form. I’m cross-posting this to Depression Common Sense since it mentions my depression situation.

Bad decisions:

  1. Continued serious relationship for 3 years – which turned out to be between 1 or 1 1/2 years too long.
  2. Moved to Tampa (3 1/2 hours away from kids) to make relationship work logistically.
  3. Bought a house, shopping club membership & timeshare with the woman.

Bad news:

  1. Relationship went into toilet – got worse and then worse.
  2. Was laid off from big $$$ job. [...]

Continue Reading

17 November 2009 ~ 0 Comments

I Keep Bleeding

Welcome to the ‘Sick Society’ category, wherein I attempt to make you think about things, become enraged by them, begin to change yourself at least – or change society at best.

It is no measure of health to be well adjusted to a sick society
Krisnamurti

[...]

Continue Reading

17 November 2009 ~ 0 Comments

More Facebook Musings

Change is the Only Constant

Quit complaining that Facebook changes things. Embrace the new. When web developers work hard all day on a new feature only to have the community poo-poo it – for a site that’s free to begin with – it feels crappy. I know from experience. You don’t like it? Fine. Go build a better one yourself. [...]

Continue Reading

Tags:

15 November 2009 ~ 1 Comment

How I Manage to Enjoy Facebook – 9 Tips

Facebook can be highly enjoyable, but also very annoying. Between app invites, mystery friends and requests, friends blabbering on your ‘Live News’ page, there’s a lot that can get in the way of having a pleasant experience. Here’s are nine ways I manage to keep the noise to a minimum so I can enjoy what I enjoy about it: my friends.


Updated! 17-Nov-2009

[...]

Continue Reading

Tags: