Author: Chris Lattner
| Code from PyCon India 2019 Keynote Talk | |
| David Beazley (https://www.dabeaz.com) | |
| ====================================== | |
| This code is presented "as is" and represents what was live-coded | |
| during my closing keynote presentation at PyCon India, Chennai, | |
| October 13, 2009. I have made no changes to the files. | |
| Requires: Python 3.6+, numpy, pygame |
| let cache = new Map(); | |
| let pending = new Map(); | |
| function fetchTextSync(url) { | |
| if (cache.has(url)) { | |
| return cache.get(url); | |
| } | |
| if (pending.has(url)) { | |
| throw pending.get(url); | |
| } |
- Proposal: SE-XXXX
- Authors: Chris Lattner, Joe Groff
Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.
This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.
| /* ----------------------------------------- * | |
| Lazy List Implementation | |
| * ----------------------------------------- */ | |
| // Haskell-like infinite List, implemented with es6 generators | |
| // Lazyness lets you do crazy stuff like | |
| List.range(0, Infinity) | |
| .drop(1000) | |
| .map(n => -n) |
| var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
| 'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
| 'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
| ': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
| try { | |
| eval(str); | |
| } catch(e) { | |
| alert('Your browser does not support ES6!') | |
| } |
| #lang racket | |
| ;; and the end of : https://yinwang0.wordpress.com/2012/04/09/reinvent-y/ | |
| ;; Exercise: The Y combinator derived from this tutorial only works for direct recursion, | |
| ;; try to derive the Y combinator for mutual recursive functions, for example the following two functions even and odd. | |
| (define even | |
| (lambda (x) | |
| (cond | |
| [(zero? x) #t] |
How to use matrix.org and vector.im as an IRC client
Join the room #freenode_<#channel>:matrix.org, replacing <#channel> with the name of the IRC channel. For example, in order to join the #prometheus IRC channel, join the room #freenode_#prometheus:matrix.org on matrix.org.
In vector.im, rooms can be joined with the directory symbol on the bottom left.
This document has been modified from its [original format][m1], which was written by Ning Shang ([email protected]). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].
When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes