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 ( | |
"fmt" | |
) | |
func main() { | |
num := 1000000 | |
tots := 0 | |
bg_chan := make(chan int, num) | |
fg_chan := make(chan int, num) |
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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; |
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
<!-- Notice that the quoatation marks are not consistent. They should all be | |
" but some are “ Note, this last one is slanted. I'm not even sure how that | |
one got in, but I noticed some students had those slanty quotes! That's not | |
valid HTML! --> | |
<form method=“get" action=“/save-user”> | |
<div class="form_div personal"> | |
<label>Name<br><input type=“text” name=“userName” required="required"></label> | |
</div> | |
</form> |
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
// A single mixin per file allows file-scoped variables | |
@mixin theme-blue { | |
// File-scoped variables | |
$main-bg: white; | |
$main-fg: #333; | |
$accent-bg: #00B4EF; | |
$accent-fg: white; | |
$content-width: 700px; | |
$gutter-width: 1rem; |
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
Select | |
FromUserId, | |
Count(case when AwardType = 0 then 1 end) as silver, | |
Count(case when AwardType = 1 then 1 end) as gold, | |
Count(case when AwardType = 2 then 1 end) as plat, | |
Count(distinct ToUserId) as [unique], | |
Count(*) as total | |
From | |
Awards | |
Group By FromUserId; |
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
function map() { | |
var val = { | |
silver: 0, | |
gold: 0, | |
platinum: 0, | |
total: 1, | |
email: this.From.Email, | |
unique: { }, | |
uniqueCount: [this.To._id] | |
}; |
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
function map() { | |
var val = { | |
silver: 0, | |
gold: 0, | |
platinum: 0, | |
total: 1, | |
email: this.From.Email, | |
unique: { }, | |
uniqueCount: [this.To._id] | |
}; |
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 query = Query.And( | |
Query.EQ("_id", post.Id), | |
Query.NE("Comments._id", comment.Id)); | |
var options = new MongoUpdateOptions { | |
Flags = UpdateFlags.Upsert, | |
SafeMode = SafeMode.False | |
}; | |
var update = Update.AddToSetWrapped("Comments", comment) |
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 'addressable/uri' | |
module MyApp | |
# This rack-filter gets run before any urls are processed by the routing | |
# subsystem, enabling us to extract the app_id query parameter and cache it for | |
# the duration of the current request thread. | |
class ClientIdManager | |
def initialize(app) | |
@app = app | |
end |
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
// This is what your gulp task should look like | |
gulp.task('qunit', function(done) { | |
var files = glob.sync('./test/**/*.html'); | |
runAllQunits(files); | |
}); | |
// Runs through each qunit file (one at a time, though this could be relatively easily parallelized) | |
function runAllQunits(testFiles) { | |
var browser = new Zombie(); |
OlderNewer