Jul/091
MySQL – Excellent performance with good planning
This is nothing new to add to the world of comparisons, but I felt it worth clarifying a few points that I – someone who’s not a complete pro, yet not a novice — I’d say intermediate developer – have learned about working with MySQL in terms of when to use what and improving efficiency based on an average of all information researched, and the results I achieved.
Normally, most of my work has been with small low traffic websites for various small businesses where efficiency planning was mostly too time consuming for the cost. Recently have been working on higher traffic applications and after running into a “too many connections” issue during peak hours tried many initial steps at alleviating the problem, such as increasing efficiency in my database abstraction class (starting with lazy loading), and releasing result sets asap among a few others. Each step added a performance gain, but not until all matters were taken into account did it make a difference.
These changes quickly formed into my personal list of best practices and good habits to get into.
A few rules of thumb that have served me well:
Jul/090
Brandie’s Baby Shower and New Orleans with Devin & Chad
To recap with the bad first, during my trip through Houston, Baton Rouge and New Orleans, I accumulated two speeding tickets worth $450 total. Everything else was great! Would also mark my meeting of Chad, Devin’s new flame.
After spending a good amount of time at Bush Intercontinental figuring out which rental place was best suited to our rental situation, we left with a Pontiac G6 with terrible alignment. Car was decent, steering on acceleration, however, was dangerous.
We drove into Baton Rouge from Houston around 4am without having researched much in the way of lodging. Ended up at the Ramada Inn on Airline Hwy. Not a very impressive stay but for the price and timing, it had to do.
We got the keycard to our room. Much to our shock on walking in sleepy heads popped up in alarm. NOT vacant. For this error, we got two rooms for the price of one. Didn’t really matter the rooms were pretty dingy – namely the bathrooms – Sleep is sleep [as long as no strangers walk in to startle you].
Jun/090
__PHP_Incomplete_Class as array
Regarding something to which I found no straight answer in 8 pages of google results:
“Fatal error: Cannot use object of type __PHP_Incomplete_Class as array in”
The offending line was the first instance of a session variable with a certain key name:
if (!isset($_SESSION['user'][0])) { $_SESSION['user'][0] = 0; }
On the development server there were no problems, but put on the demo shared server over which I have no control, the error appeared. I scoured the internet for the solution but it seems anyone who has this problem never really gets a straight answer – and it seems to come up a fair bit. Incidentally, it seems to be related usually to login/user/session management scripts since certain keywords are fairly common in those situations.
Frustrated, as a last ditch attempt I changed it to:
if (!isset($_SESSION['usrinf'][0])) { $_SESSION['usrinf'][0] = 0; }
The problem was solved instantly.
Turns out it was the key “user” which was the problem in the hosting environment.
So if anyone has this issue, do a find/replace of all instances of the session variable key located in the line indicated by the error to something more unique .
May/090
The audacity!
I usually could care less about any politics but this really made my blood boil for a moment.
In regards to President Obama fulfilling a pre-election promise to take wife to broadway show in New York:
“Republicans characterised the trip as insensitive and wasteful against the backdrop of US car giant General Motors preparing for an expected bankruptcy.
White House aides and media accompanied the first couple on their private date.
The president and first lady travelled to New York in a smaller plane than the regular Air Force One 747.” - BBC News
—
“The White House declined to say how much the trip was costing taxpayers, and even before the smaller jet left Washington, the there-and-back trip drew criticism from the Republican National Committee. The RNC issued a news release that chastised Obama for saying he understands American’s troubles, but then hopping up to New York for “a night on the town.”
Noting that General Motors is expected to file for Chapter 11 protection on Monday, the news release said: ‘Putting on a show: Obamas wing into the city for an evening out while another iconic American company prepares for bankruptcy.’”- Washington Post
—
“While the Obamas’ visit to New York was considered private, there was some very public criticism of the trip. In a press release that was issued on Saturday afternoon with the headline “Putting on a Show,” the Republican National Committee suggested that the outing was inappropriate and that Mr. Obama was out of touch, especially given the looming bankruptcy of General Motors.” - NY Times
Quite frankly, I’m appalled yet not very impressed with the hypocrisy. Those republicans never really seem to have something worth talking about unless it’s profitable — It wasn’t even a private date! Nor did they take the big plane!