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
#include <iostream> | |
#include <mutex> | |
#include <future> | |
using namespace std; | |
int main() | |
{ | |
mutex 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
#include <algorithm> | |
#include <iostream> | |
#include <sstream> | |
#include <iterator> | |
#include <vector> | |
#include <memory> | |
#include <forward_list> | |
#include <typeinfo> | |
#include <thread> | |
#include <mutex> |
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
#include <algorithm> | |
#include <iostream> | |
#include <sstream> | |
#include <iterator> | |
#include <vector> | |
#include <memory> | |
#include <forward_list> | |
#include <typeinfo> | |
using namespace std; |
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
#include <iostream> | |
#include <typeinfo> | |
using namespace std; | |
struct Tag { | |
string name = "Test"; | |
}; | |
void check(Tag && t) { |
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 run(){ | |
for(var i=0; i<5; i++){ | |
setTimeout(function log(){ | |
console.log(i); | |
}, 100); | |
} | |
})(); |
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
const mul = x => y => z => x * y * z; |
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
let y = {a:1, b:2, c:3} | |
let {a:x,...r} = y |
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
[1,2,3,4,5].reduce( (r,x) => [...r,x], [7,8,9]) |
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
def accumulate(): | |
res = 0 | |
while True: | |
t = yield | |
if t == None: | |
return res | |
res += t | |
def tallies(ts): |
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
pong_c = None | |
ping_c = None | |
def ping(): | |
i = 0 | |
while True: | |
res = yield | |
print(res) | |
i += 1 | |
pong_c.send("ping") |