Author: ccornutt

Things I learned at the Oracle talk

It’s not complete notes from the session, but here’s a few interesting things I caught during Christopher Jones’ talk:

  • Oracle is introducing connection pooling for Oracle->PHP scripts (to be included with version 11g) – database resident connection pooling
  • you don’t need to redo the entire prepare/reparse of the oracle statement just because you change a value of a bind variable. You can just oci_execute and move on…
  • You get better performance if the table statistics are up to date
  • Check the oci8.statement_cache_size php.ini setting to tweak your fetching performance
  • Use oci_set_prefetch function (PHP5) to get a bit permance increase
  • ‘set autotrace on explain’ can give you more stats on your query and how it’s performing
  • Look into using TKPROF and STATSPACK (admin)

Looks like a bright future ahead for Oracle and PHP – especially with the new connection pooling. I can’t wait to give it a shot…

San Jose Dining Guide (PDF)

Not that it’s hidden out there (it’s on the main city site), but I still thought this might help some others out there headed to the Zend/PHP Conference next week.

Downtown San Jose Dining Guide [pdf]

Oh, and if there’s anyone out there that hasn’t mentioned to me already that you want one of the t-shirts, either leave a note here or email me at enygma at phpdeveloper dot org and let me know. I’m going to have them with me at least one or two days so I can get them to everyone.

See ya there…

The T-Shirt Press Check Images

Well, the time has officially come and they’ve sent me images of the press check of the t-shirts! It’s always odd to see something you designed on an actual shirt 🙂 So, without further ado, here they are:

It looks like there might be a little bleed on the lettering on the back, but it still looks good. Oh, and no, that’s not me wearing the shirt 😉

A Single-function JSON Freakshow

Want to see something scary and hacky? Check this out – it takes in a PHP array and makes a JSON message out of it:

[php]
function build($arr,&$str,$lvl=0,$in_arr=”){
$lvl++;
foreach($arr as $key => $value){
if(is_array($value)){
$str.=(($in_arr==1)?'{‘:”).'”‘.$key.'”: ‘;;

if(count($value)>1){ $str.='[‘;
}elseif(count($value)==1){ $str.=”;
}else{ $str.='{‘; }

build($value,$str,$lvl,1);

if(count($value)>1){ $str.=’]’;
}elseif(count($value)==1){ $str.=”;
}else{ $str.=’}’; }

$str.=($in_arr==1) ? ‘}’ : ”;
$str.=(next($arr)) ? ‘,’ : ”;
}else{
$str.=($lvl>1) ? ‘{‘ : ”;
$str.='”‘.$key.'”:”‘.$value.'”‘;
$str.=($lvl>1) ? ‘}’ : ”;
$str.=(next($arr)) ? ‘,’ : ”;
}
}
}
[/php]

And, of course, a sample of how to use it:

[php]
$my_data=array(
“foo”=>”1”,
“bar”=>”2”,
“baz”=>array(
“one”=>”1”,
“two”=>”2”
),
“test”=>array(
“my_test”=>array(
“one_more”=>”1″,”three_more”=>”test”
),
“your_test”=>array(
“two_more”=>”2”
),
“nest1″=>array(
“nest2″=>array(
“nest”=>”test”
)
)
),
“meedle”=>”squeedle”
);

$str=”;
build($my_data,$str);
echo ‘{‘.$str.’}’;
[/php]

Be afraid. Be very afraid 🙂

My New Addiction

My wife and I visited England (up by York and Manchester) and much fun was had by all.

Too bad I came back with an addiction. It’s taken hold of me and is constantly with me. I can’t stop thinking about it and I wonder when I can get my next fix. I feel the constant need to spend lots of money to feed my habit (and with the exchange rate right now, that’s not a good thing), and I just can’t get the stuff I need over here.

That’s right, I’m an addict.
I’m addicted to Tom Holt books (not quite what you were expecting, eh?)

Yes, I casually picked up one of his books (“Falling Sideways“) in a shop while we were over there and finished it in about two days. I have to say, I haven’t read anything so delightfully light-hearted and funny in a long time (we’ll, that wasn’t something I’d read a million times over).

Alas, my probem still remains – the Amazon.com US store doesn’t carry them all (only like 10 or so) and ordering them from overseas is a bit expensive right now for us U.S-ers. I’ve ordered “Omnibus 5: Tall Stories” and “The Portable Door” from Amazon, and I’m counting the days.

It’s always fun to discover a writer you really enjoy, especially when you find out that that writer has loads of books for you to catch up on 🙂

Here’s to the unsung programmers….

A community is not about the members that get the most noteriety.

A community is not about the programmers that do the cool things or the bleeding edge stuff.

A community is not a select few.

A community is a group of people, centered around a cause, looking to do the best that they can to belong and to find thier place in the rankings that the community imposes.

See, the PHP community is like any other. There are those out there that are the notables, the ones that get mentioned in press releases or in lots of news postings (yes, guilty, I know). But for each of the ones that gets creadit for the advancements in the languge, there are tens or hundreds more behind them pushing and helpong to get things done.

Here’s to the unsung heroes of the PHP community – those developers that remain nameless, but contribute their 110% to the language or to developing their applications. They work thing fingers to the bone (well, okay, so maybe not quite that much) trying to further the cause of PHP. There are countless developers looking to forge their own path through the PHP wilderness without getting the recongition they deserve.

Yes, I’m guilty of focusing on a “chosen few” that have proven themselves in the past and have made a name for themselves in the community, but there are tons more out there, woorking on their own projects, making their own ways that aren’t acknowledged and that aren’t brought into the public spectrum.

So, here’s to you the unsung programmers out there – thank you for all that you do to help the PHP community become what it is.

If you’re at the ZendCon 2006 this year, find me and I’ll buy you a drink.

Re: Reading Tech Books

Following in Lig’s lead on the number of books she’s reading, I thought I’d take stock of what kinds of books I’ve been reading on lately. Now, whether I’ll make it finishing them by the end of the year – that’s another story, but at least I’ll have a better idea of where I lie.

These aren’t in an order either other than my own train of thought as I write this:

  • php|architect’s Guide to PHP Design Patterns
  • Theo’s book, Scalable Internet Architectures
  • Ajax in Action
  • Creating Web Pages with Ajax

And, I dont know if it counts, but I also read over 205 feeds worth of information each day to grab the content for PHPDeveloper. Of course, those are all quick reads (well, most of them – some of you bloggers out there get a bit long winded at times – hehe).

Oh, and as far as fiction – I’m rereading the Hitchhiker’s Guide to the Galaxy for the umpteenth time, but it’s always a good, light read.

Talkin’ T-Shirts

So, remember the t-shirt idea I mentioned before for the conference? Well, I’ve thrown something together for it and wanted to get some feed back on it from all of you lovely readers out there. Here’s the thumbnails.

I wanted to keep in mind both promoting the site (woo!) and the community too (yay!), so I kept the front simple with the PHP opening tag and my domain on the front and on the back….drum roll please….a tag cloud of the people/projects/companies that help make the PHP community what it is today. The different terms are different sizes, but that’s more for stylistic reasons than any kind of reference. There’s no way I could ever figure out how much each of them has contributed to the community and rank them, so I just went with picking at random.

So then, two questions for you all:

  • First off, do you like the design? Would you wear it and enjoy it?
  • And, secondly, would you buy one? Really what I’m getting at here is asking how big of a first run I would need to do. I’m going to have them at this year’s Zend Con but I didn’t know what the demand would be for them outside of that.

So, let me know on the above points – I’d appreciate any kind of feedback you can give!