This file contains hidden or 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
| > db.dishes.create({ | |
| ... _id: ObjectId("56eedb8b839b02cc2b7954d5"), | |
| ... name: 'Uthapizza', | |
| ... description: 'Test', | |
| ... comments: [ | |
| ... { | |
| ... rating: 3, | |
| ... comment: 'This is insane', | |
| ... author: 'Matt Daemon' | |
| ... } |
This file contains hidden or 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
| { | |
| "name": "node-express", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "dishRouter.js", | |
| "directories": { | |
| "test": "test" | |
| }, | |
| "scripts": { | |
| "test": "./node_modules/.bin/mocha", |
This file contains hidden or 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
| from mrjob.job import MRJob | |
| import mrjob.protocol | |
| from decimal import Decimal | |
| class MRCustomerTotalExpenses(MRJob): | |
| INTERNAL_PROTOCOL = mrjob.protocol.PickleProtocol | |
| OUTPUT_PROTOCOL = mrjob.protocol.ReprProtocol | |
| def mapper(self, key, line): |
This file contains hidden or 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
| #!/bin/bash | |
| DISPLAY=:15 | |
| X=0 | |
| Y=0 | |
| shopt -s extglob | |
| while [ ! -z "$1" ] | |
| do |
This file contains hidden or 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
| all: pts grantpt ptsname unlockpt | |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| # A quick-and-dirty script modeling the recruiting process. | |
| # by Sylvain Leroux | |
| # Each candidat as a set of skills | |
| # and a "personal fit" with the job offer. | |
| # The skill level is known by the recruiter if >= 0.5 | |
| # The "personal fit" in [0,1) range is not know | |
| # All skill values are in the range (0-1] |
This file contains hidden or 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 getQueryVariable(variable) { | |
| var query = window.location.search.substring(1); | |
| var vars = query.split('&'); | |
| for (var i = 0; i < vars.length; i++) { | |
| var pair = vars[i].split('='); | |
| if (decodeURIComponent(pair[0]) == variable) { | |
| return decodeURIComponent(pair[1].replace(/\+/g, '%20')); | |
| } | |
| } | |
This file contains hidden or 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
| package demo; | |
| import java.util.ArrayList; | |
| public class OccupancyComparer { | |
| static int S = 1000; | |
| static double[][] array_of_double; | |
| static Double[][] array_of_double_obj; | |
| static ArrayList<Double> array_list_of_double_obj; |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| from random import randint | |
| from collections import defaultdict | |
| for i in range(10, 10100, 100): | |
| nEdges = 50 | |
| # Build i random pair of nodes | |
| edges = set() # ensure uniqueness of each edge in the graph | |
| while len(edges) < nEdges: |
This file contains hidden or 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'; | |
| module.exports = function (grunt) { | |
| // Time how long tasks take. Can help when optimizing build times | |
| require('time-grunt')(grunt); | |
| // Automatically load required Grunt tasks | |
| require('jit-grunt')(grunt, { | |
| useminPrepare: 'grunt-usemin' | |
| }); |