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
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.concurrent.ConcurrentHashMap; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.ThreadLocalRandom; | |
| import java.util.concurrent.locks.ReadWriteLock; | |
| import java.util.concurrent.locks.ReentrantReadWriteLock; | |
| import java.util.stream.IntStream; |
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
| class LRUCache { | |
| /* | |
| Our internal definition of a doubly linked list | |
| node, put in this class for convenience since | |
| this is submitted in one file on Leetcode | |
| */ | |
| private class DNode { | |
| int key; | |
| int value; |
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
| $rootScope.nodeId = $stateParams.studynodeRef; | |
| // $scope.id = '"' + $rootScope.nodeId + '"'; | |
| Studies.all().then(function(payload){ $scope.studies = payload; | |
| $scope.study = $filter('filter')(payload, function (d) { | |
| $scope.id = '"' + $rootScope.nodeId + '"'; | |
| return d.nodeRef === $scope.id ;})[0]; | |
| }); |
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
| var app = angular.module('starter.services', []) | |
| .factory('Studies',function($http,$filter){ | |
| var studies = []; | |
| $http.get("studies.json").success( | |
| function(data){ | |
| //studies = data; | |
| angular.copy(data, studies); | |
| } |
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
| //index.js | |
| var express = require('express'), | |
| app = module.exports = express.createServer(), | |
| mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost/nodeAuth'); | |
| //configure app | |
| app.configure(function() { | |
| app.set('views', __dirname + '/views'); |