maintainability

Doing calculations in MySQL vs PHP

南楼画角 提交于 2019-11-26 16:03:45
Context: We have a PHP/MySQL application. Some portions of the calculations are done in SQL directly. eg: All users created in the last 24 hours would be returned via an SQL query ( NOW() – 1 day) There's a debate going on between a fellow developer and me where I'm having the opinion that we should: A. Keep all calculations / code / logic in PHP and treat MySQL as a 'dumb' repository of information His opinion: B. Do a mix and match depending on whats easier / faster. http://www.onextrapixel.com/2010/06/23/mysql-has-functions-part-5-php-vs-mysql-performance/ I'm looking at maintainability

What should we do to prepare for 2038?

我是研究僧i 提交于 2019-11-26 09:08:34
问题 I would like to think that some of the software I\'m writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970. #include <stdio.h> #include <time.h> #include <limits.h> void print(time_t rt) { struct tm * t = gmtime(&rt); puts(asctime(t)); } int main() { print(0); print(time(0)); print(LONG_MAX); print(LONG_MAX+1); } Execution results in: Thu Jan 1 00:00:00 1970 Sat Aug 30 18:37:08 2008

Doing calculations in MySQL vs PHP

与世无争的帅哥 提交于 2019-11-26 04:41:01
问题 Context: We have a PHP/MySQL application. Some portions of the calculations are done in SQL directly. eg: All users created in the last 24 hours would be returned via an SQL query ( NOW() – 1 day) There\'s a debate going on between a fellow developer and me where I\'m having the opinion that we should: A. Keep all calculations / code / logic in PHP and treat MySQL as a \'dumb\' repository of information His opinion: B. Do a mix and match depending on whats easier / faster. http://www