Vastermonster is Paul Thrasher's personal blog. This is my space to write and post whatever I'm into at the moment. I will mostly post about php code, design, strange videos, internet chaos, simplicity and cleverness -- fairly in-often.

Archive of February 2008


2270326584d7e953c8a8o.gif

Originally uploaded by The Core-Man
I’m actually looking forward to the Microsoft buy out. Bring it on!

February 23rd, 2008 / Tags: MSFT, YHOO, screenshot / Trackback

SF PHP Meetup Mar 2008 - Zend Framework 1.5--Latest Features

In this talk, ZF’s development manager (Wil Sinclair) and Zend chief evangelist (Bradford Cottel) will present the new features and benefits of this free & open-source web framework for PHP programmers and tell you enough to get you started if you’re new to it or to answer some of your questions if you’re already using it. BTW, it’s the only PHP framework to have been selected as a finalist for the Jolt Award for Libraries, Frameworks, and Components. In future meetings, we may be able to get Brad and/or Wil to come back and talk about Zend’s other development tools too and how they work with ZF.

What
SF PHP Meetup Mar 2008 - Zend Framework 1.5--Latest Features
Where
CNET
When
Thu, March 6 2008 at 7PM11PM Download ICS File
More info
php.meetup.com/139/calendar/7147178/
February 20th, 2008 / Tags: event, php, code / Trackback

  • thrashr888: so you're not going to " NASA Space Program Presents: The Role of Connective Tissue and Tensegrity in Enabling a Hybrid Distributed/Centralized Control Scheme for Complex Coordinated Human Motion"
  • lucid594: haha
  • lucid594: i went last year
  • thrashr888: how was it?
  • lucid594: it was too NEWBIE for me
  • thrashr888: yeah, those NASA dudes are stuck in the sixties
February 20th, 2008 / Tags: tech, events, chat / Trackback

Stock Portfolio Update

Apparently, it’s best to show your hand while working with the stock market. In the interest of transparency, here’s my stock portfolio:

Company Ticker Shares Avg. Price
Apple Inc. AAPL 5.00 157.732
Google Inc. GOOG 2.00 547.46
Research In Motion Limited (USA) RIMM 2.00 88.14
Goldman Sachs Group, Inc. GS 1.00 231.48
MercadoLibre, Inc. MELI 2.00 68.76
JA Solar Holdings Co., Ltd… JASO 6.00 24.17

I’ve cut back to about half of my past holdings. Things aren’t going so well in this market, but I’m holding on and just not making any buys. I’m very much looking forward to the end of this bear market.

February 18th, 2008 / Tags: stocks, portfolio, AAPL, GOOG, RIMM, GS, MELI, JASO / Trackback

Find all the values of a key in an array

This is a recursive PHP function that searches all of the keys in an array and pulls out their values.

<pre id="geshi_code">function multi_array_key_search($needle,$haystack,$keys_found=array()){
	if(is_array($haystack)){
		foreach($haystack as $key=&gt;$val){
			if(is_array($val)){
				$keys_found = multi_array_key_search($needle,$val,$keys_found);
			}else{
				if($key==$needle){
					$keys_found[] = $val;
				}
			}
		}
		return $keys_found;
	}
	return false;
}

February 15th, 2008 / Tags: code, php / Trackback

Alternating background colors

I just wrote some pretty quick code for the age-old problem of alternating colors in a table. I don’t know how this could get any simpler. Sweet!

<pre id="geshi_code">&lt;? foreach($posts as $post){?&gt;
	&lt;div class=&quot;&lt;?=($c++%2==1)?'odd':NULL?&gt;&quot;&gt;
		&lt;?=$post?&gt;
	&lt;/div&gt;
&lt;? }?&gt;
&lt;style&gt;
	.odd{background-color:red;}
&lt;/style&gt;

February 15th, 2008 / Tags: code, php / Trackback

Forcing a floated line-wrap in PHP

For every 4 floated elements, wrap to the next line:

<?=($b++%4==0)?’<br class="clr" />’:NULL?>

February 15th, 2008 / Tags: code, php / Trackback
Next → ← Previous