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
// Change | |
status = xhr.status; | |
responseHeaders = xhr.getAllResponseHeaders(); | |
responses = {}; | |
xml = xhr.responseXML; | |
// Construct response list | |
if ( xml && xml.documentElement /* #4958 */ ) { | |
responses.xml = xml; |
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
while outer_condition() | |
while inner_condition() | |
[a, b] = pick2() | |
delta = swap a, b | |
if delta < 0 or Math.random() < Math.exp(-(delta + 1) / T) | |
cost += delta | |
else | |
swap a, b # revert | |
T *= C |
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
{ header: { reserved: 0, type: 0, imageCount: 1, padding: [ 0, 1, 0 ] }, | |
images: | |
[ { width: 16, | |
height: 16, | |
paletteCount: 16, | |
reserved: 0, | |
colorPlanes: 1, | |
bitsPerPixel: 4, | |
size: 296, | |
offset: 22, |
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 (c) 2011 Christopher Chedeau, http://blog.vjeux.com/ | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |
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
(self.scene.global.H / 2 - y + Math.random() - 0.5) / upscale) |
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
callback() | |
) # f | |
], callback # waterfall | |
), callback # while | |
) # f | |
), callback # paralell | |
) # f | |
], callback # waterfall | |
), callback # while | |
) # f |
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
// Input | |
var message = "I'm starting to get turned on."; | |
await { | |
for (var i = 0; i < 10; i++) { | |
setTimeout (defer (), 10); | |
setTimeout (defer (), 100); | |
} | |
} | |
console.log (message); |
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 f(a) { | |
var b = yield 'A'; | |
var c = yield 'B'; | |
} | |
gen = f('a'); | |
var A = gen.next(); | |
var B = gen.send('b'); | |
gen.send('c'); |
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
Scrap = require '../src/scrap.js' | |
match = require 'match' | |
# Create a new Scrap with the base for all the following requests | |
wikipedia = new Scrap | |
path: 'http://en.wikipedia.org/' | |
# Download the front page as string | |
wikipedia.get '/', (page) -> |
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
Scrap = require '../src/scrap.js' | |
match = require 'match' | |
# Create a new Scrap with the base for all the following requests | |
wikipedia = new Scrap | |
path: 'http://en.wikipedia.org/' | |
# Download the front page as string | |
wikipedia.get '/', (page) -> |