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
//-------- Rust extension configuration -------- | |
// The mode in which the extension will function | |
"rust.mode": "rls", | |
// Specifies path to Racer binary if it's not in PATH | |
"rust.racerPath": "C:\\Users\\tera\\.cargo\\bin\\racer.exe", | |
// Specifies path to Rustfmt binary if it's not in PATH | |
"rust.rustfmtPath": "C:\\Users\\tera\\.cargo\\bin\\rustfmt.exe", |
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
[print(*t) for terms, used in zip([input().split()], [set()]) for t in map(lambda x: (x, terms.count(x)), terms) if t not in used and (used.add(t) or True)] |
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
# -*- encoding: utf-8 -*- | |
def each_slice_2(f, iterator): | |
a = iterator.__iter__() | |
for i in a: | |
try: | |
j = a.__next__() | |
except: | |
j = 0 | |
yield f(i, j) |
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
#![feature(box_syntax)] | |
use std::rc::Rc; | |
#[derive(Debug)] | |
enum List<T: Clone> { | |
Empty, | |
Exist(Rc<Box<Node<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
def _to_snake_case(word): | |
final = '' | |
for item in word: | |
if item.isupper(): | |
final += "_" + item.lower() | |
else: | |
final += item | |
if final[0] == "_": | |
final = final[1:] | |
return final |
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
import sys | |
from . import music_importer | |
sys.meta_path.append(music_importer.MusicImporter) | |
# このモジュールでimport sysされているため、必ずsys.modulesにsysはある | |
sys.modules['sys'] = sys |
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)] | |
enum DataSize { | |
DWard, | |
Ward, | |
Byte | |
} | |
fn hoge(data: &[u8], offset: usize, data_size: DataSize) -> (&[u8], usize) { |
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
Compiling twefi v0.1.0 (file:///home/tera/repos/twefi) | |
Running `rustc --crate-name twefi src/lib.rs --crate-type dylib --emit=dep-info,link -C debuginfo=2 -C metadata=2a5d295b588c4ecc --out-dir /home/tera/repos/twefi/target/x86_64-pc-windows-gnu/debug/deps --target x86_64-pc-windows-gnu -C linker=/usr/bin/x86_64-w64-mingw32-gcc -L dependency=/home/tera/repos/twefi/target/x86_64-pc-windows-gnu/debug/deps -L dependency=/home/tera/repos/twefi/target/debug/deps -C link-arg=-Wl,--gc-sections` | |
error: language item required, but not found: `panic_fmt` | |
error: language item required, but not found: `eh_personality` | |
error: language item required, but not found: `eh_unwind_resume` | |
error: aborting due to 3 previous errors |
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
# -*-encoding:utf-8-*- | |
import sys | |
import wave | |
def bin2wav(filedata, filename, channels=2, sampwidth=2, framerate=14400, nframe=0, comptype='NONE', compname='not compressed'): | |
w = wave.Wave_write(filename) | |
p = (channels, sampwidth, framerate, nframe, comptype, compname) | |
w.setparams(p) |
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
use std::ascii::AsciiExt; | |
use std::cell::{Cell, RefCell}; | |
use std::error::Error; | |
use std::fmt; | |
#[derive(Debug)] | |
enum ParseError { | |
Parse, | |
} |
NewerOlder