Things to look at

I still need to settle on a PHP orm.  I’ll have to re-research.  What I really need though is the base framework that allows things like logging, unit tests, functional tests, sessions, db connections, object caching, actions, roles, etc.

Simple PHP I think for unit tests, vs. phpunit.

SimpleXML was fun, but it looks like once you start using it you want a DOM.  Maybe on the client — AJAX.

I’ll stick with PEAR:Log until I need to look again for performance reasons.  Adding “global $logger” to every function or class is a pain though.  That needs a framework.

I might try to extend Ambivalence again for MVC.   It’s ancient by now.

I’ll re-research ORM.  I’ve never been happy with anything out there though.  Maybe propel, or model.  Or the new Zend one. Model transfer objects and a ORM library that uses a DB abstraction later may be the answer, but what about caching?

Yeah right.  Caching in PHP.  The only answer is “save your interpreted parse trees to memory” and Zend  hires everyone who develops one of those.

If I could have caching, messaging, and access to the Apache stack (a la mod_perl) I might be happy with PHP, though my NIH gene means I’d be happy with PHP if I wrote all the rest.

Mystery revealed

the PHP remedial basics entry wasn’t loading after publishing, why?  Because I changed the time format in WordPress to UTC -7.  Apparently I’ll have to change it to -8 when DST kicks out.

PHP remedial basics

Every few months it seems I’m doing some remedial research. I often take pages of notes and do hours of evaluation only to forget it. Luckily my webserver is up and running, php is installed (the last time I went through this was with magickwand — which I still haven’t used yet to create a gallery upload app for kelsey and for don lee. Time again.)

This time, I’m rebuilding the basics of my php dev framework, what logger to use, db api, orm, form validation, etc.

It was relatively painless (1/2 hour) to get pear installed, so I installed PEAR::Log. I thought I’d give DB_Dataobjects a try, but that’s complaining about a dependency for Validate that I can’t resolve.

So anyway, one of the reasons for this blog was to note things like this.

steps to install PEAR:
1. go to http://go-pear.org
2. save the page as go-pear.php (what a dumb way to do it)
3. type php go-pear.php
The following line is added to php.ini
include_path=”.;C:\PHP\pear”
4. when that’s done, type pear install Log
Log.php and Log folder are created under C:\PHP\pear
I don’t see how Log.php references the Log folder.

5. In your file, add lines similar to:

require(“Log.php”);
$file = &Log::factory(‘file’, ‘file.log’, ‘TEST’);
$file->log(‘Logging to file.log.’);

I don’t want to be a leader of mice

I don’t want to excel at something mediocre. Some may be lulled by the realization, upon looking around at their peers, and deciding (for the sake of this argument, we’ll say “correctly”) that they are made of better stuff than those around them.

It is tempting to say to yourself, I could do that.  But if it’s not what you want, then why do it?

It’s like if I turned out to be a better soccer player than average, would I play soccer?  No, I wouldn’t.  I’d rather be a second string football player because I prefer that game.  And let’s be honest, the better athletes play football.  If you don’t believe me look at the salaries.

But metastatizing, it might be more accurate to say that “being the best” isn’t what I want.  Some people could fairly make a choice and decide that though they love football, their love of celebrity (or playing in general) is greater than their love of the individual sport.  (NOTE:  Don’t go into soccer for celebrity unless it’s only a very minor celebrity you crave.  David Beckham is 90% famous for having his name in the title of a small production film about a teenage girl from India.)  But supposing it were two equally popular sports, like say soccer and tennis (see, I am giving soccer some credit.)

If you could be Pele (Who? cry all the Beckham fans — go rent a Bollywood flick) or … (the name of a minor tennis celebrity escapes me), which would you choose?  For some people they’d rather be the Jordan of whatever it is.  For others, the question depends more on how much they prefer tennis to soccer.  Both fair answers.  But that’s a false dichotomy.

The real question is closer to:  if you were Robert Horry, would you rather play in the CBL, and feel like a star in Ibiza or pass the ball to Hakim and get a gold ring?

But that’s still not quite it.

More fuel comments

Of course, the reason the oil companies are posting such huge profits is because they aren’t paying NYMEX prices for crude.  I don’t know the exact number, but I’m sure Exxon has deals with the Saudi government (and BP has deals with the USA) that allows them to buy crude on long term contracts that are probably in the $25-30/barrel range.  That’s why no one would buy Hugo Chavez’s tar sands at $50/barrel (especially when you only get about 2/5 gas from it and it costs more to refine.)

The NYMEX price is the “Spot Price” on petroleum.  That’s the excess that none of the oil companies wanted.  Of course, as supply goes up, the excess demand goes down.  Think of the California Energy Crisis of a few years ago.  Normally, you buy electricity at $0.05-$0.10/KWH, but if you don’t have the contract, you have to buy the excess, which at that time was $0.35/KWH.  California governor Grey Davis decided to lock in the state of California at that rate.  He blinked, and Edison with media support watched Enron crumble and the spot market on electricity dwindle.

No one wants locked into oil at $60/bbl, so they’re waiting it out.  Depending on the length of the contracts, NYMEX oil prices will have to go down, or else the unbought suppy will flood the commodities market.  I imagine the oil corporations have been slowly buying up discount contracts to keep them ahead of the curve, and may be paying as much as $40/bbl for recent contracts, but just like stocks, you don’t play to beat averages, you play to keep up with them.  They’d rather pay $50 for a contract than have you compete on the open market with them.  Thanks to their war chests getting larger, the oligopoly can afford to use monopoly pricing to keep competition out until it breaks.

Only the OPEC states are a third player, and they are in a game of chicken with the oil companies over who will blink first, because they know they will need to buy eventually or face competition.

Fuel Price Formula

I saw a presentation that gave me a breakdown on prices per gallon of gasoline.

The numbers aren’t the thing, but here’s the formula:

#getting price per gallon of gasoline

brent.price(per_barrel) = $62
gallons_per_barrel = 42
cracking = 3/5 *

base_price_per_gallon = brent.price(per_barrel) / gallons_per_barrel * cracking
= $2.36/gallon

#nominally fixed costs per gallon**:
distribution_marketing = $0.18
refining = $0.33

total_fixed_costs_per_gallon = distribution_marketing + refining
= $0.51

# taxes
federal_tax = $ 0.18
state_tax(washington) = $0.34 ***

total_tax_per_gallon = federal_tax + state_tax
= $0.52

# formula
base_price_per_gallon + fixed_costs + tax = price_before_profit
= $3.39

* Light Sweet Crude refines about 60% into gasoline. We’ll assume that the remaining 40 percent is wasted. It’s actually turned into heating oil, chemical products, etc. The profit for the remainder could be considered a (generous) balance for pollution.

** These fixed costs were taken from the presentation. The specific numbers could be different. Transportation cost is not included, considered part of the price per barrel. Feel free to change them to what you think is more accurate.

*** Washington state tax on gasoline will be raise to $0.36 / gallon on July 1, 2007 and to $0.38 / gallon on July 1, 2008 unless there is a change (increase) before then.

**** There may also be some incidental costs that are not included such as ethanol and detergent mixing.

Refining costs have gone up quite a bit in the last few years because hurricanes (esp. Katrina, Rita in 2005) and inefficiencies due to aging refining capacity.
Taxes on gasoline (at least in Washington) have also skyrocketed, raising $0.02 per gallon every year from 2005-2008 and 7 cents per gallon in 2003.

So if I wanted to compete with Exxon-Mobile-Texaco-Shell-Chevron, BP-Amoco-Unocal-Union76, Phillips-Conoco (insert your conglomerate here, they’re all intermixed the same way as media (e.g. a cable channel being jointly owned by ABC-Disney, NBC-GE, CBS-MTV, Comcast, Cox, etc.), I could buy gas at $3.39, remarkably close to the price at the pump — if I owned my own refinery and gas station, but the government would never let me because of “environmental” reasons.

Wedding website

A while ago, Kelsey created a website just for fun. She’s updated it and I guess it’s our official wedding headquarters.

http://mywedding.com/kelseyandaaron

I’m still a little sad that she took West Marine and Boater’s World off the gift registry list. But you can still buy me a GPS, SSB Radio, RIB tender (with 9.9HP 2 stroke outboard), fenders, chartplotter software and digital or paper charts, 1/2″ galvanized chain, a 50# CQR or 40# Danforth Anchor, sail repair kits, spare parts for a marine toilet, a gold plated manual bilge pump handle, any tools that I can use restoring an old boat, gallons of west system epoxy, teak decking, fishing gear, or a floating keychain.

Honeymoon in Greece

Kelsey booked tickets to Paris and Athens this morning. Her dad is treating us to a honeymoon in Greece, with three days in Paris. We leave June 20th and return July 3rd. I’m excited, grateful, unbelieving.

Of course I want to sail, but it’s probably too much stress for Kelsey on her honeymoon. She’d never sleep easy on an anchor in unknown waters, at least not yet. I like the idea of privacy and freedom to explore and avoid crowds, and it would actually probably cost less, but comfort and security win out.

Maybe we can do one or two nights. I hope she’ll at least let me hang out at marinas and maybe do a little shopping around for next time.


Welcome

To whom? I don’t know. But this is my first post on a new blog, may it quickly fall by the wayside.

I started travel web logs on blogger at http://fijiaaron.blogspt.com for when I went to Fiji and Ecuador.

I’d like to make notes on my business plans, observations and predictions about boring things like politics and the economy, comments on life in general, a record of my travels and thoughts, and provide links and brainstorming on the work I do.

If I actually do end up using this regularly, I might want to break it up or edit it, since that’s a pretty wide spectrum and while I can envision someone finding interest in some of it (e.g., family looking at travel photos or a potential employer looking at my thoughts on software testing) there’s probably a lot that no one wants to see (including myself) and probably parts I don’t want others to see (such as a client reading a political rambling, or potential investor reading some of my more hare-brained business ideas.)

Anyway, we’ll let that sort itself out later and rely on the anonymity of the internet for now. Chances are no one will ever look at it and I’ll stop posting before long.