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
#[derive(Debug)] | |
struct Foo { | |
n: u32, | |
} | |
fn overwrite<T: Copy>(input: &mut T, new: &mut T) { | |
// FORBIDDEN: you will copy the pointer pointing to a future freed memory | |
// *input = *new; | |
} |
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 async = require('async') | |
function downloadSentinel(promObj) { | |
return new Promise((resolve, reject) => { | |
function makeRequest(url, i, callback) { | |
var sys = require('util'), | |
exec = require('child_process').exec, | |
child; |
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
class MyMap { | |
[key: string]: string; | |
} | |
let map: MyMap = new MyMap() | |
map["key"] = "value" | |
console.log(map["key"]) |
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) 2015 Attilio Dona' | |
* | |
* This file is subject to the terms and conditions of the GNU Lesser | |
* General Public License v2.1. See the file LICENSE in the top level | |
* directory for more details. | |
* | |
* @author Attilio Dona' | |
* | |
*/ |