download and install Solr from http://lucene.apache.org/solr/.
you can access Solr admin from your browser: http://localhost:8983/solr/
use the port number used in installation.
package module1.exercise.discount; | |
import java.util.List; | |
public class Basket { | |
private double amount; | |
private List<Item> items; | |
public Basket(List<Item> itemss) { |
//Thanks stackoverflow | |
//http://stackoverflow.com/questions/3745666/how-to-convert-from-hex-to-ascii-in-javascript | |
function a2hex(str) { | |
var arr = []; | |
for (var i = 0, l = str.length; i < l; i ++) { | |
var hex = Number(str.charCodeAt(i)).toString(16); | |
arr.push(hex); | |
} | |
return arr.join(''); |
<?php | |
$db_con = mysqli_connect("localhost", "username", "password", "database"); | |
$result = $db_con->query('SELECT * FROM some_table'); | |
if (!$result) die('Couldn\'t fetch records'); | |
$num_fields = mysqli_num_fields($result); | |
$headers = array(); | |
while ($fieldinfo = mysqli_fetch_field($result)) { | |
$headers[] = $fieldinfo->name; | |
} | |
$fp = fopen('php://output', 'w'); |
#user nobody; | |
#Defines which Linux system user will own and run the Nginx server | |
worker_processes 1; | |
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores. | |
#error_log logs/error.log; #error_log logs/error.log notice; | |
#Specifies the file where server logs. |
<input type="date" ng-model="reportCtrl.formCtrl.travelFrom" required min="{{ minFromDate | date:'yyyy-MM-dd' }}"> | |
<input type="date" ng-model="reportCtrl.formCtrl.travelTo" required min="{{ reportCtrl.formCtrl.travelFrom | date:'yyyy-MM-dd' }}"> | |
$scope.minFromDate = new Date(); |
download and install Solr from http://lucene.apache.org/solr/.
you can access Solr admin from your browser: http://localhost:8983/solr/
use the port number used in installation.
module.exports.sockets = { | |
// Node.js (and consequently Sails.js) apps scale horizontally. | |
// It's a powerful, efficient approach, but it involves a tiny bit of planning. | |
// At scale, you'll want to be able to copy your app onto multiple Sails.js servers | |
// and throw them behind a load balancer. | |
// | |
// One of the big challenges of scaling an application is that these sorts of clustered | |
// deployments cannot share memory, since they are on physically different machines. | |
// On top of that, there is no guarantee that a user will "stick" with the same server between | |
// requests (whether HTTP or sockets), since the load balancer will route each request to the |
var Q = require("q"); | |
//var mongoClient = require("mongodb").MongoClient; | |
//var ObjectID = require("mongodb").ObjectID; | |
//var schema = require('validate'); | |
function SmartCollection (mongoDb, collectionName, schema, indexes) { | |
this._mongoDb = mongoDb; | |
this._collectionName = collectionName; | |
this._collection = mongoDb.collection(collectionName); |
var obj = {b: 3, c: 2, a: 1}; | |
_.sortKeysBy(obj); | |
// {a: 1, b: 3, c: 2} | |
_.sortKeysBy(obj, function (value, key) { | |
return value; | |
}); | |
// {a: 1, c: 2, b: 3} |
/** | |
* Locations.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/#!documentation/models | |
*/ | |
module.exports = { | |
seedData:[ |