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 The Android Open Source Project | |
* | |
* 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 |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../paper-radio-group/paper-radio-group.html"> | |
<link rel="import" href="../paper-radio-button/paper-radio-button.html"> | |
<link rel="import" href="../paper-input/paper-input.html"> | |
<polymer-element name="my-element"> | |
<template> |
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 Linq = function (inner){ | |
var that = this; | |
this.toArray = function(){ | |
var result = []; | |
for(var item of inner()){ | |
result.push(item); | |
} | |
return result; | |
}; |
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 catchingGenerator = function *(){ | |
console.log('I will stop when you tell me about error'); | |
var error = null; | |
while(error === null){ | |
try { | |
var value = yield null; | |
console.log("Got value from you: %s", value); | |
}catch(e){ | |
error = e; | |
} |
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 throwing = function *(){ | |
console.log('Generator entered, yielding first value'); | |
yield 1; | |
console.log('Generator asked for second value - will go bum'); | |
throw new Error("You can only call this generator once, sorry!"); | |
console.log('Will never get here'); | |
yield 3; | |
}; | |
var throwingGenerator = throwing(); |
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 oracle = function *(){ | |
var question = yield "Hello"; | |
while(question != "Bye!"){ | |
var answer = Math.random(); | |
console.log(question, "oracle says: ", Math.random()); | |
question = yield answer; | |
} | |
console.log("Thank you!") | |
}; |
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 fibo = function *(){ | |
var a = 0, | |
b = 1; | |
yield a; | |
yield b; | |
while(true){ | |
var next = a + b; | |
yield next; | |
a = b; |
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 sequence = function *() { | |
yield 1; | |
yield 2; | |
}; | |
var sequenceGenerator = sequence(); | |
var current = null; | |
current = sequenceGenerator.next(); | |
console.log(current); | |
current = sequenceGenerator.next(); | |
console.log(current); |
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 net = require('net'), | |
http = require('http'), | |
Writable = require('stream').Writable, | |
parsers = http.parsers, | |
HTTPParser = process.binding('http_parser').HTTPParser, | |
util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
function freeParser(parser, req) { | |
if (parser) { |
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.Collections.Specialized; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Hosting; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace TestSamples.VirtualPath |