Just when you think you saw everything… I ended up on a Japanese website that, in contradiction to most of them, for once doesn’t sell some weird cartoon porn. It’s quite possible that the people who invent those Japanese toys and products have too much time on their hands.

So here it comes! Protect your usb wires.. oldskool! With this slick combination lock, it will for sure take the criminal trying to use your precious mouse at least 5 or 10 minutes! Don’t wait any longer, get in touch with Thanko today and order your personal USB lock! *eek*
http://thanko.jp/usblock/

A function I’ve put togheter for a work-related project to get date of monday, sunday, last monday & last sunday.. Might add in next monday and sunday later.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
/**
* Get Mondays and Sundays
*
* Get monday, sunday, last monday & last sunday
* Example usage:
*
* // to retreive the dates using today as starting point
* $mondaysAndSundays = getMondaysAndSundays();
* // to retreive the dates using a custom date as starting point
* $mondaysAndSundays = getMondaysAndSundays('1987-04-14');
*
*
* @param date $offset Provide a date from where to calculate from in strtotime() translatable format. If none is given, today’s date will be used.
*
* @return array
*
*/
function getMondaysAndSundays($offset=false)
{
if(!$offset) $offset = strtotime(date(’Y-m-d’));
else $offset = strtotime($offset);
// this week
if(date(’w',$offset) == 1)
{
$mas['monday'] = date(’Y-m-d’,$offset);
}
else
{
$mas['monday'] = date(’Y-m-d’,strtotime(”last Monday”,$offset));
}
if(date(’w',$offset) == 6)
{
$mas['sunday'] = date(’Y-m-d’,$offset);
}
else
{
$mas['sunday'] = date(’Y-m-d’,strtotime(”next Sunday”,$offset));
}
// last week
if(date(’w',$offset) == 1)
{
$mas['lastmonday'] = date(’Y-m-d’,strtotime(’-1 week’,$offset));
}
else
{
$mas['lastmonday'] = date(’Y-m-d’,strtotime(’-1 week’, strtotime(date(’Y-m-d’,strtotime(”last Monday”,$offset)))));
}
if(date(’w') == 6)
{
$mas['lastsunday'] = date(’Y-m-d’,strtotime(’-1 week’,$offset));
}
else
{
$mas['lastsunday'] = date(’Y-m-d’,strtotime(”last Sunday”,$offset));
}
return $mas;
}
|
When you’re applying for a job, especially if it is in the IT sector, it’s getting quite common for an employer to look for you on any search engine. But shouldn’t we start Googling our (blind?) dates? Who knows, he might just be that old dirty guy from around the corner!

After plowing through tons of code from both vTiger and ADOdb and pushing Google search to the max, I finally found a forum topic on vtiger.com covering the problem we were having with vTiger. The problem was that the popup to select an account or a product had load times averaging 60seconds. That’s a huge usability issue (read: waste of time) when you are creating invoices or filling out your calendar.
Anyway, all the more reason to place it on my blog, with the all right keywords!
And now, for the solution:
Quoting onwealdandy
However, I fixed the performance issue with a work around that doesn’t make much sense, but worked. I read this forum post a few days ago, but couldn’t see how commenting out debug print lines would speed things up. But, that did the trick. However, I did narrow it down to the exact variable causing the ruckus ($list_result) , so I only had to comment out just a few lines in ListViewUtils.php. (any debug log lines with $list_result)
Even with logging set to FATAL, the slowness would occur. When you did set logging to DEBUG, one instance would show the correct information in the debug log for the debug log lines .. basically what you would expect when printing $list_result (which is a recordset object) .. the object id … “Object id #40″ … however on the slow machine it would actually print the 2000+ records which were returned by the query.
There must be a bug in php or apache or mysql ( no idea) that returns the entire result set to $list_result when its evaluated for printing. My guess is that the libmysql.dll must have a default _tostring method in there in some versions. BE CAREFUL .. since there its not documented which versions do this … for the record, my troubled instance was running php5.2.5, apache 2.2.6, and mysql 5.0.45
You can find the original vTiger topic here: http://forums.vtiger.com/viewtopic.php?p=64335

If you are a real developer, there should be a huge smile appearing on your face. Thanks to coding horror! Get the bumper sticker version of it while they’re hot!