Here's a valid Rust snippet:
fn main() {
let mut range = 0..5;
for num in &mut range {
if num == 2 {
break;
}
}
use std::ptr; | |
pub struct List<T> { | |
head: Link<T>, | |
tail: *mut Node<T>, // DANGER DANGER | |
} | |
type Link<T> = Option<Box<Node<T>>>; | |
struct Node<T> { |
fn main() { | |
let my_string = String::from("foo"); | |
let mut my_vec = Vec::<&String>::new(); | |
my_vec.push(&my_string); | |
// drop(my_string); | |
println!("{:?}", my_vec); | |
} |
#! /usr/bin/python | |
import asyncio | |
import os | |
@asyncio.coroutine | |
def do_writing(writer): | |
for i in range(1, 4): | |
writer.write(("stuff " + str(i)).encode()) |
fn foo<'left, 'right>(_: &mut &'left i32, _: &mut &'right i32) | |
where | |
'left: 'right, | |
{ | |
} | |
// fn foo<'both>(_: &mut &'both i32, _: &mut &'both i32) {} | |
fn main() { | |
let a = 42; |
#include <iostream> | |
struct Foo { | |
const int &x; | |
}; | |
struct ConvertedFoo { | |
const int &x; | |
// Foo is implicitly convertible to ConvertedFoo |
import time | |
from blake3 import blake3 | |
from hashlib import sha256, sha512, blake2s | |
input_bytes = b"hello world" | |
print(f"input bytes: {input_bytes}") | |
warmup_iterations = 1_000 | |
measure_iterations = 1_000_000 | |
Here's a valid Rust snippet:
fn main() {
let mut range = 0..5;
for num in &mut range {
if num == 2 {
break;
}
}
GCC 13.1.1 (Arch Linux) seems to mis-align __m512i
vectors on the stack when
-fsanitize=address
is enabled. repro.c
(below in this Gist) is a minimized
repro. Compile it like this:
gcc repro.c -g -mavx512f -fsanitize=address
When I execute it I get the following:
$ ./a.out
AddressSanitizer:DEADLYSIGNAL
EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663<pre>
tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but
Here's the canonical TOML example from the TOML README, and a YAML version of the same.
title = "TOML Example" |
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Squawker { | |
public: | |
Squawker(string name) : name(name) { | |
cout << "constructor " << name << "\n"; | |
} |