This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
selected_date | |
from | |
(select | |
adddate('2014-02-10', t4.i * 10000 + t3.i * 1000 + t2.i * 100 + t1.i * 10 + t0.i) selected_date | |
from | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0, (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1, (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2, (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3, (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v | |
where | |
selected_date between '2014-02-10' and '2014-02-15' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateDateList(from, to) { | |
var getDate = function(date) {//Mysql Format | |
var m = 1 + date.getMonth(), d = date.getDate(); | |
return date.getFullYear() + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d); | |
} | |
var fs = from.split('-'), startDate = new Date(fs[0], parseInt(fs[1]) - 1, fs[2]), result = [getDate(startDate)], start = startDate.getTime(), ts, end; | |
if ( typeof to == 'undefined') { | |
end = new Date().getTime(); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var _ = require('underscore'); | |
function sortMonths(months) { | |
return _.intersection(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], months); | |
} | |
console.log(sortMonths(['March', 'January'])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Waruna Oshan Wisumperuma | |
* @contact warunaoshan@gmail.com | |
* Friday, October 03 2014 16:32:36 | |
* | |
*/ | |
"use strict"; | |
var PaginCollection, ReportModel, paginTotal = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var o = {}, a = this.$('#contactForm').serializeArray(); | |
$j.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); | |
} else { | |
o[this.name] = this.value || ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sortMonths : function(months) { | |
return _.intersection(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], months); | |
} | |
getUniqPluck : function(arg, useCache) { | |
if (useCache) { | |
return this[arg] = this[arg] || _.uniq(_.pluck(this.List, arg)).sort(); | |
} else { | |
return _.uniq(_.pluck(this.List, arg)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert(([][[]]+[])[!+[]+!![]+!![]+!![]]+([] | |
[[]]+[])[+[]]+(!![]+[])[+[]]+([][[]]+[]) | |
[+[]]+([]+{})[!+[]+!![]]+([][[]]+[])[! | |
+[]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!! | |
[]]+([][[]]+[])[!+[]+!![]+!![]]+([][[]]+[]) | |
[!+[]+!![]+!![]]+(!![]+[])[+[]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THE OPEN UNIVERSITY OF SRI LANKA | |
DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING | |
Assignment 2 | |
ECI5266 – Advanced Database systems | |
The answers to the assignment should be sent under registered post on or before the due date to the following address or should be placed in the relevant box provided at block No. 12 of Colombo Regional Centre. | |
The Course Coordinator – ECI5266 | |
Department of Electrical and Computer Engineering | |
Faculty of Engineering Technology |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adapted from Tom Cunningham's 'Data Warehousing with MySql' (www.meansandends.com/mysql-data-warehouse) */ | |
###### small-numbers table | |
DROP TABLE IF EXISTS numbers_small; | |
CREATE TABLE numbers_small (number INT); | |
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | |
###### main numbers table | |
DROP TABLE IF EXISTS numbers; | |
CREATE TABLE numbers (number BIGINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace H57\Util; | |
class Serializor { | |
/** | |
* Converts the Doctrine Entity into a JSON Representation | |
* | |
* @param object $object The Object (Typically a Doctrine Entity) to convert to an array |