Map [1]
Operation | Time Complexity |
---|---|
Access | O(log n) |
Search | O(log n) |
Insertion | O(n) for < 32 elements, O(log n) for >= 32 elements [2] |
Deletion | O(n) for < 32 elements, O(log n) for >= 32 elements |
import {Observer} from 'rxjs/Observer'; | |
import {BehaviorSubject} from 'rxjs/BehaviorSubject'; | |
interface IFilter { | |
name: string, | |
tags: CollectionMatcher | |
} | |
export class FilterService { | |
private _filters = new BehaviorSubject<IFilter>({ |
defmodule TrelloBurndown.SprintController do | |
use TrelloBurndown.Web, :controller | |
alias TrelloBurndown.Sprint | |
def index(conn, _params) do | |
sprints = Repo.all(from s in Sprint, preload: [:team]) | |
render(conn, "index.json", sprints: sprints) | |
end |
### Original Code | |
gulp.task('jade', function() { | |
gulp.src('app/**/*.jade') | |
.pipe(jade({pretty: true})) | |
.pipe(gulp.dest('.tmp')) | |
}) | |
gulp.task('inject', function() { | |
bComp = removeScss(bower) | |
gulp.src('.tmp/index.html') | |
.pipe(inject(gulp.src(bComp, {read: false}))) |
// Built from Mohit Cheppudira's sine wave generator - http://0xfe.blogspot.com | |
// Modified by Murat Ayfer - http://muratayfer.com | |
// Modified by Mika Kalathil | |
var ON = 450; | |
var OFF = 550; | |
var soundWave = function(context) { | |
// xs is a list of x (time) values, one per wave. | |
// time is not represented as synchronized clicks or milliseconds, its passing is freq dependent | |
// so that's why we keep a value per each wave. |
// Built from Mohit Cheppudira's sine wave generator - http://0xfe.blogspot.com | |
// Modified by Murat Ayfer - http://muratayfer.com | |
// Modified by Mika Kalathil | |
var ON = 450; | |
var OFF = 550; | |
var soundWave = function(context) { | |
// xs is a list of x (time) values, one per wave. | |
// time is not represented as synchronized clicks or milliseconds, its passing is freq dependent | |
// so that's why we keep a value per each wave. |
# get current branch in git repo | |
parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\e[32m\]\u\[\e[m\]\[\e[32m\]:\[\e[m\]\[\e[36m\]\W\[\e[m\] \[\e[35m\]\`parse_git_branch\`\[\e[m\]\[\e[33m\]\\$\[\e[m\] " | |
# some more ls aliases | |
alias ls='ls -F' | |
alias ll='ls -alF' | |
alias la='ls -A' |
class TeachersImporter | |
def initialize(filename=File.dirname(__FILE__) + "/../db/data/students.csv") | |
@filename = filename | |
end | |
def import | |
field_names = ['name', 'email', 'address', 'phone_number'] | |
print "Importing students from #{@filename}: " |
DROP TABLE | |
IF EXISTS contacts; | |
CREATE TABLE contacts ( | |
id serial NOT NULL PRIMARY KEY, | |
firstname varchar(40) NOT NULL, | |
lastname varchar(40) NOT NULL, | |
email varchar(40) NOT NULL | |
); |