27 10 / 2012

rem Toolkit JS
ReferencedLibs\ajaxmin -clobber ^
MyProject\Scripts\kendoui\js\jquery.min.js ^
MyProject\Scripts\kendoui\js\kendo.web.min.js ^
MyProject\Scripts\jquery.validate.min.js ^
MyProject\Scripts\jquery.validate.unobtrusive.js ^
MyProject\Scripts\jquery.unobtrusive-ajax.min.js ^
MyProject\Scripts\jqueryform\jquery.form.js ^
-o MyProject\Scripts\Toolkits.min.js

09 10 / 2012

Apple, Adobe, Facebook, Google, HP, Microsoft, Mozilla, Nokia и Opera объединились, чтобы создать “наиболее полный ресурс” для всех открытых веб-технологий webplatform.org.

We are an open community of developers building resources for a better web, regardless of brand, browser or platform. Anyone can contribute and each person who does makes us stronger. Together we can continue to drive innovation on the Web to serve the greater good. It starts here, with you

08 2 / 2012

Crypto-JS is a growing collection of standard and secure cryptographic algorithms implemented in JavaScript using best practices and patterns. They are fast, and they have a consistent and simple interface.

31 7 / 2011

23:59:59 is not the end of the day.

23:59:59 is not the end of the day.

No, really! How would you check whether some TIMESTAMP column falls within a given day, say July 26th, 2011?

This is a question I tend to ask students, and usually I get the same range of answers. Some are wrong; some cannot utilize an index, some are correct, and some are temporarily correct.

I wish to take a closer look at the last. Such an answer looks like this:

SELECT * FROM some_table WHERE timstamp_column BETWEEN ‘2011-07-26 00:00:00’ AND ‘2011-07-26 23:59:59’

Yikes! I get my allergies when I see this one. Technically this seems correct. And it seems to work so far for people. There are two things that disturb me: ’23:59:59′ refers to the beginning of the last second of the day. This means a full second is missing in concept.

No one would write such a code on a C, Java or PHP application: that would be a newbie’s mistake. But people feel at ease doing it with SQL Of course, this works when timestamps are in a one second resolution. Which leads me to: One second resolution is a temporary issue. Already MariaDB 5.3 presents with microsecond support for NOW() and TIMESTAMP, TIME and DATETIME columns. Sometime in the not-so-far future the standard MySQL distribution will have that, too. Soon people will start losing data, reporting wrong numbers, perform incorrect aggregations.

My advise: grep -iR “23:59:59” /path/to/application/code/* And get rid of it.

A good alternative would be:

SELECT * FROM some_table WHERE timstamp_column >= DATE(‘2011-07-26’) AND timestamp_column

Tags:

Permalink 39 notes