journal
all all entries rss SoML excited dreams runes YRUU ultimate KTRU skate sleepy nihongo
Rob is 20,117 days old today.
prev day next day printable version

Entries this day: Work late

Work

10:51pm JST Sunday 22 November 2009 (day 14487)

Worked late today (Sunday) and yesterday (Saturday) after sleeping a bit late (cause I downloaded and watched half of 2012 last night), and waking up early (to attend yoga lessons with Paola starting at 8:45am Saturday), respectively. In both cases, I got to work at around noon thirty. Alfonzo was on a similar schedule both days; we're pushing hard to get the site done before its release on the first.

Helpful in that regard, our possible new Cow-Go student Takayuki did not respond to my offer of Saturday 7pm for a lesson with Mark. I canceled the meeting with Mark and kept on working.

Today I finished retooling all the finish_time variables.. We had had a checkbox "finished" and later added a timestamp "finish_time," but then realized they are ripe for conflict, so removed the boolean "finished" from the DB tables and I retooled the code that displayed those values.

The coolest bits of code keeps the timestamp at (most recent) five minute intervals. Basically:

	timestamp = (floor(NOW / 5 mins) * 5 mins)

In PHP I essentially wrote

	$time_without_minute = Date("Y-m-d H:");
	$nearest_five_minute = floor(Date("i") / 5) * 5;		// most recent 5 minute
	$record['finish_time'] = $time_without_minute . ":" . $nearest_five_minute;

In javascript I essentially wrote

	var currentTime = new Date();
	var moon = currentTime.getMonth() + 1;
	var date = currentTime.getDate();
	var year = currentTime.getFullYear();
	var hour = currentTime.getHours();
	var five = Math.floor(currentTime.getMinutes() / 5) * 5;
	$("finish_time").set("value",year+"-"+moon+"-"+date+" "+hour+":"+five);     // requires mootools

And in MySQL (via PHP), I essentially wrote

	$rounder = 5 * 60;  // to nearest five minutes
	$db->do("UPDATE " . $table . " SET `finish_time` = FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP() /
		(" . $rounder . ")) * (" . $rounder . ")) WHERE `id` = ". $id);
permalink

late

11:39pm JST Sunday 22 November 2009 (day 14487)

I think I have Chez Soness to myself again tonight. I think Anna said she'd be back on Monday, and she said she thought Soness said something about not coming home on Sunday. I'll find out in about 20 minutes!

If I have the place to myself, I'll finish the rest of 2012 and go to sleeeeep. If they're there, then I'll probably install Wordpress on unwim.com. Or maybe install a wiki. Or maybe a forum, or trac or all the above. Man I can tell I'm getting tired and a bit silly.

permalink
prev day next day