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 store | |
type Query struct { | |
mongo bson.M | |
} | |
func NewQuery() *Query { | |
return &Query{ | |
mongo: make(bson.M), | |
} |
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 ( | |
"io" | |
"fmt" | |
"gopkg.in/mgo.v2" | |
) | |
type Article struct { |
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
// Example Usage: | |
// | |
// type SomeWork struct { | |
// Value int | |
// Result chan int | |
// } | |
// | |
// func (w *SomeWork) Do() { | |
// w.Value += 10000 | |
// |
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 url = require('url'); | |
var cheerio = require('cheerio'); | |
var request = require('request'); | |
var cache = []; | |
crawl(new Page('http://nodejs.org')); | |
function crawl(page) { | |
request(page.origin, function(err, res, body) { |
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 com.satisfeet.core; | |
import java.io.Serializable; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.Id; | |
import javax.persistence.OneToOne; | |
@Entity |
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
import util | |
import matplotlib.pylab as pylab | |
f = util.Person("Friday") | |
f.learn("meat", 0.20) | |
f.learn("fish", 0.20) | |
r = util.Person("Robinson") | |
r.learn("meat", 1.00) | |
r.learn("fish", 0.25) |
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
using JuMP | |
m = Model() | |
@defVar(m, x1) | |
@defVar(m, x2) | |
@defVar(m, x3 >= 0) | |
@defVar(m, x4 >= 0) | |
@setObjective(m, Min, 3x1 - 2x2 + 1x3 -4x4) |
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
f = lambda x: ord(x) - 96 | |
g = lambda x: (x + 3) % 26 | |
h = lambda x: chr(x + 96) | |
cesar = lambda x: ''.join([h(g(f(y))) for y in x]) | |
print(cesar('matrix')) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
class Opencv < Formula | |
homepage "http://opencv.org/" | |
head "https://github.com/Itseez/opencv.git" | |
stable do | |
url "https://github.com/Itseez/opencv/archive/2.4.11.tar.gz" | |
sha256 "b5331ea85a709b0fe871b1ce92e631afcd5ae822423863da6b559dd2cb7845bc" | |
# Avoid explicit links to a Python framework | |
# https://github.com/Itseez/opencv/pull/3865 |