/etc/security/limits.conf
elasticsearch hard memlock 100000
/etc/default/elasticsearch
Problem: Given intervals with finish and end times, partition the intervals into labels with minimum amount of labels so that no two intervals in any label overlap. | |
Algorithm: | |
* Sort Intervals w.r.t. starting time, breaking tries arbitrarily. | |
* Let them be I1, I2, ... , In | |
* For j = 1:n | |
* For each (i<j && Ii,Ij overlap) | |
* Exclude the label of Ii from considering for Ij | |
* EndFor |
var restify = require('restify'); | |
// Authentication | |
var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; | |
var sessions = require("client-sessions"); | |
var server = restify.createServer(); | |
server.use(restify.queryParser()); | |
server.use(restify.bodyParser()); |
[ | |
[ | |
[ | |
"Βασίλειος", | |
"Βασίλης", | |
"Βάσος", | |
"Βασίλας", | |
"Βασιλάκης", | |
"Μπίλλης", | |
"Μπίλης", |
/////////////////////////////////////// | |
// RFID PRINTER COMMAND LINE UTILITY // | |
/////////////////////////////////////// | |
// REQUIRES: node-printer by tojocky | |
// USAGE: node zebra.js <printer> <start> <end> <file.csv> <print/null> | |
// | |
// RANGE EXAMPLE prints range to screen only: | |
// C:> node zebra zebra 1 100 | |
// | |
// RANGE EXAMPLE prints range: |
//Knapsack algorithm | |
//================== | |
// wikipedia: [Knapsack (0/1)](http://en.wikipedia.org/wiki/Knapsack_problem#0.2F1_Knapsack_Problem) | |
// Given a set `[{weight:Number, benefit:Number}]` and a capacity, | |
// find the maximum value possible while keeping the weight below | |
// or equal to the capacity | |
// **params**: | |
// `capacity` : Number, | |
// `items` : [{w:Number, b:Number}] | |
// **returns**: |
/** | |
* Load scripts in parallel keeping execution order. | |
* @param {array} An array of script urls. They will parsed in the order of the array. | |
* @returns {$.Deferred} | |
*/ | |
function getScripts(scripts) { | |
var xhrs = scripts.map(function(url) { | |
return $.ajax({ | |
url: url, | |
dataType: 'text', |
public $gmail = array( | |
'host' => 'ssl://smtp.gmail.com', | |
'port' => 465, | |
'username' => '[email protected]', | |
'password' => 'motdepasse', | |
'transport' => 'Smtp', | |
'timeout' => 30 | |
); | |
$email = new CakeEmail('gmail'); |
<?php | |
/** | |
* Presumes you've installed Composer in the directory according to http://getcomposer.org/doc/01-basic-usage.md | |
*/ | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneNumberUtil.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."CountryCodeToRegionCodeMap.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneNumber.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."data" . DS . "PhoneNumberMetadata_GB.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneMetadata.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneNumberDesc.php"); |
/* | |
* | |
* Originally inspired by: http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery | |
* | |
* Original source by https://gist.github.com/highrockmedia/3710930 | |
* | |
* My contribution: I re-wrote some code it to fire as one function, so you're only editing values in one place. | |
* | |
*/ |