- Scoped
-
Generally declaring a name inside of curly braces limits scope to inside the braces.
-
Not so for C++98 style enums.
-
Names belong to scope containing the enum
-
Nothing else in that scope can have the same name
enum Color { black, white, red }; // black, etc in the same scope as color
-
This file contains 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
/* Copyright 2014 10gen Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
This file contains 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
///////////////////////////////////////////////////////////////////// | |
/// find | |
///////////////////////////////////////////////////////////////////// | |
// Coersion from document::view into model::find | |
auto cursor = coll.find(doc_view); | |
// Explicit creation of model::find | |
auto cursor = coll.find(model::find(doc_view).limit(10)); |
This file contains 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 st = new ShardingTest({ | |
shards:1, | |
mongos:1, | |
other: { | |
rs: true, | |
numReplicas: 2, | |
separateConfig: true | |
} | |
}) |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am TylerBrock on github. | |
* I am tyler (https://keybase.io/tyler) on keybase. | |
* I have a public key whose fingerprint is D683 1F3B 3C62 7B38 E5FD 62D2 F10D 2721 439F 26D5 | |
To claim this, I am signing this object: |
This file contains 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
require 'httparty' | |
require 'logger' | |
require 'json' | |
BASE_PATH = '/crowd/rest/usermanagement/' | |
API_VERSION = 1 | |
AUTH_PATH = '/authentication' | |
SESSION_PATH = '/session' | |
USER_PATH = '/user' |
This file contains 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 main | |
import "log" | |
import "bytes" | |
import "bufio" | |
import "os" | |
import "sync" | |
import "runtime" | |
import "io/ioutil" |
This file contains 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/python | |
""" | |
Tyler Brock for Five Stars - 2011 | |
Write function f in python, that given a list of numbers | |
L returns i, j such that L[i:j] has maximal sum. | |
For example, if L = [1, -2, 3, 4, 5, -1] then f(L) should return (2, 5). | |
""" |
This file contains 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 piston.handler import AnonymousBaseHandler | |
from django.http import HttpResponse, HttpResponseBadRequest | |
from django.db.models import Count | |
from decorators import status_response, json_data | |
from exceptions import JSONException | |
from utils import * | |
from userutils import * | |
from authentication.token import * | |
from settings import BASE_URL | |
from django.forms.models import model_to_dict |
This file contains 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.logs.remove() | |
db.logs.insert( | |
{"name":"James Carr", | |
"log" : [ | |
{ | |
"comment" : "", | |
"time" : ISODate("2011-11-01T21:37:44.897Z"), | |
"user" : "Brad ************", | |
"action" : "Call", |