Testing totalMercury
June 10th, 2010totalMercury is a test word to determine how long until it appears in google. it took 3 minutes after i published it, go go Caffeine.
totalMercury is a test word to determine how long until it appears in google. it took 3 minutes after i published it, go go Caffeine.
The FreeBSD ports tree switched from PHP 5.2.x to PHP 5.3.x earlier this month. As a result, I decided ensure compatibility with the new functionality in PHP 5.3. I used MDB2 as my database abstraction layer previously. A *lot* of code used this functionality. MDB2 hasn’t been updated in a while so I decided to switch to PDO. In order to maintain compatibility with the MDB2 interface I wrote this ‘incomplete’ wrapper for the functions I use. I thought I’d share in case someone else is running into a similar situation:
< ?php
/*
Extends PDO to ensure compatibility with some used functionality
from PEAR::MDB2
*/
class PDOStatementCommon {
private $pdoStatement;
public function __construct($obj)
{
$this->pdoStatement = $obj;
}
/* wrapper for MDB2 */
public function numRows()
{
return $this->pdoStatement->rowCount();
}
public function fetch() {
return $this->pdoStatement->fetch();
}
/* wrapper for MDB2 */
public function fetchRow() {
$row = $this->pdoStatement->fetch();
return $row;
}
}
class PDOCommon extends PDO {
private $limit = 0;
public function query($str)
{
// check if limit has been specified. if so, modify the query
if (!empty($this->limit)) {
$str .= " LIMIT ".$this->limit;
}
$obj_pdoStatement = parent::query($str);
$obj_pdoStatementCommon = new PDOStatementCommon($obj_pdoStatement);
return $obj_pdoStatementCommon;
}
/* wrapper for MDB2 */
public function queryOne($str)
{
$result = $this->query($str);
$row = $result->fetch();
return $row[0];
}
/* wrapper for MDB2 */
public function queryRow($str)
{
$obj_pdoStatement = parent::query($str);
$row = $obj_pdoStatement->fetch();
return $row;
}
/* wrapper for MDB2 */
public function setLimit($limit)
{
$this->limit = $limit;
}
/* wrapper for MDB2 */
public function escape($str)
{
return $this->quote($str);
}
}
?>
This started out as a FreeBSD 6.1 install but 6.2 is now out.
Notes for the installation of FreeBSD 6.2 on a Dell M90.
Configuration:
T2600 (Core Duo 2.16GHz)
Broadcom Gigabit network card
Dell Wireless 1490 802.11a/g Dual-band Mini-Card / Bluetooth
7200RPM 100GB SATA HD
17″ UXGA 1920×1200 screen
TODO:
soundcard – Sigmatel 9200 (not supported/working)
bluetooth
suspend on lid close
automount
Working:
patched wifi driver
NVIDIA TWINVIEW 1920×1200 x 2 displays + Beryl
Parse tcpdump output of a ParaChat session in order to extract conversations.
#!/bin/sh tcpdump -s 0 -A -r $1 | \ grep '#N"' | \ sed -e 's/\.*#N\$[\.[:space:]]*/|(/g' \ -e 's/#N"[\.]*/V:V/g' \ -e 's/#N&.*//g' \ -e 's/.*|(//g' \ -e 's/PC\.*#N.*//g' \ -e 's/V:V/ : /g' \ | grep -v '[HI@L].*PC\.\..*+.*'
I recently purchased a Canon 85mm 1.2/F L Lens and I loved the pictures it captured. While using it in a shoot for one of my macro shots, I noticed a flaw (tiny, but a flaw nonetheless) in one of the interior lenses. That meant repair time! I've had no problems with Canon products in the past. I judge many companies by their Service Departments so I was hoping Canon wouldn't let me down. I went to their website, found the number, called, obtained the appropriate information, shipped my lens to NJ for repair via UPS (I'm starting to like them too). I received an email from Canon letting me know my lens was going to be serviced and I would have it within 7 days. Three days later, I received an email letting me know my lens had been shipped back. Thats what I call efficiency. Kudos to Canon. Hopefully I won't need to deal with that part of their business in the future but its nice to know if I do, it will be pleasant.
The early bird also catches a closed highway, copious traffic, and the slowest train known to mankind. The lesson: hurried patience.
Leaves swirl a dance,
wind clears the blue road,
clenching to a moment of strength,
eyes open to the dark plates of love.
Family surrounds the core of creation.
A smile forms and a laugh breathes. Was, is, will be… Now!
We don’t live in the dark ages people (that would be circa 1910. Lets pick a standard and live with it. Ok, there is a standard, its UTC. I’m setting my watch to UTC starting today.
UPDATE: Problem resolved in MySQL 5.0.37
Update: Bug report created:
I recently upgraded our production servers to MySQL 5.0.33 after using it in development for a while. I started receiving the following errors:
Lost connection to MySQL server during query
and
MySQL server has gone away
I traced the problem to one query that when performed in the mysql client was causing:
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect…
after each execution:
Below is a sample database and query that will reproduce the bug:
DROP DATABASE IF EXISTS Bug;
CREATE DATABASE Bug;
USE Bug;
CREATE TABLE `A` (
`aID` int(10) unsigned NOT NULL auto_increment,
`aData` varchar(15) NOT NULL default ”,
`aPhase` tinyint(3) NOT NULL default ’0′,
PRIMARY KEY (`aID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `B` (
`bID` int(10) unsigned NOT NULL auto_increment,
`baID` int(10) unsigned NOT NULL default ’0′,
PRIMARY KEY (`bID`),
KEY `baID` (`baID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `A` VALUES (306863,’01133935022′,-10),(306864,”,-10);
INSERT INTO `B` VALUES (1532595,306863),(1532597,306864);
/* Run this multiple times to drop connections to server */
SELECT
(SELECT SUM(aID) FROM B WHERE baID = aID),
COUNT(DISTINCT(bID))
FROM A c
LEFT JOIN B ON aID = baID
WHERE
aPhase = -10
AND
(SELECT COUNT(*) FROM A dup
WHERE dup.aPhase = -10
AND c.aData = dup.aData) > 0
GROUP BY aID
ORDER BY aData, aID;
I accidentally broke my eyeglass frame yesterday and decided it was finally time to see what my new prescription is.
My prescription as of 2006.12.14
| Sphere | Cylinder | Axis | |
|---|---|---|---|
| OD (right eye) | Pl (0) | -2.75 | 180 |
| OS (left eye) | +0.25 | -2.25 | 005 |
The prescription I was using while attempting to improve my vision is:
| Sphere | Cylinder | Axis | |
|---|---|---|---|
| OD (right eye) | -0.25 | -1.75 | 180 |
| OS (left eye) | Pl (0) | -1.25 | 005 |
My old prescription is:
| Sphere | Cylinder | Axis | |
|---|---|---|---|
| OD (right eye) | -0.25 | -2.75 | 180 |
| OS (left eye) | Pl (0) | -2.25 | 005 |
The spheres changed, the rest stayed the same. I look forward to looking at the really tiny font on my computer monitors when the new glasses arrive