Skip to content

Instantly share code, notes, and snippets.

View wufniks's full-sized avatar

신희제(Heejae Shin) wufniks

  • Seoul, Korea
View GitHub Profile
#!/usr/bin/env python3
import asyncio
async def waiter(event):
print('waiting for it ...')
await event.wait()
print('... got it!')
async def main():
struct Elem(u32);
struct Slotmap {
data: Vec<Elem>,
}
impl Slotmap {
fn get(&self) -> &Elem {
&self.data[0]
}
use std::collections::HashMap;
fn test1() {
let mut m = HashMap::new();
m.insert(1, "hello");
m.insert(2, "world");
let r1 = m.get(&1).unwrap();
let r2 = m.get_mut(&2).unwrap();
println!("1 : {:?}", r1);
println!("2 : {:?}", r2);
class MyClassA:
x = 10
class MyClassB:
def __init__(self):
self.x = 10