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
[package] | |
name = "rust_de_zundoko" | |
version = "0.1.0" | |
[dependencies] | |
rand="0.3.0" |
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
[package] | |
name = "rust_de_tcpclient" | |
version = "0.1.0" | |
[dependencies] |
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::io; | |
use std::io::prelude::*; | |
use std::net::{IpAddr, TcpStream, SocketAddr}; | |
use std::env; | |
fn session(stream: &mut TcpStream){ | |
let _ = stream.write(b"ENTER\r\n"); | |
let mut banner = String::new(); | |
let _ = stream.read_to_string(&mut banner); | |
println!("{}", banner); |
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
[package] | |
name = "rustcp_server" | |
version = "0.1.0" | |
[dependencies] | |
lazy_static = "0.2.1" |
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::cell::Cell; | |
struct Source<'a> { | |
string: &'a str, | |
pos: Cell<usize>, | |
} | |
impl<'a> Source<'a> { | |
fn new(string: &str) -> Source{ | |
Source { |
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, | |
} |
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
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
// 構造体の初期化をマクロでウェイッってしたかった | |
#[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
import sys | |
from . import music_importer | |
sys.meta_path.append(music_importer.MusicImporter) | |
# このモジュールでimport sysされているため、必ずsys.modulesにsysはある | |
sys.modules['sys'] = sys |
OlderNewer