Skip to content

Instantly share code, notes, and snippets.

View qryxip's full-sized avatar

Ryo Yamashita qryxip

  • Japan
  • 19:17 (UTC +09:00)
View GitHub Profile
@qryxip
qryxip / Cargo.lock
Last active February 3, 2023 13:30
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "Inflector"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
@qryxip
qryxip / atcoder-2023.rs
Created January 29, 2023 07:48
AtCoder 2023/1 Language Update用の情報を生成する
#!/usr/bin/env rust-script
//! ```cargo
//! [package]
//! edition = "2021"
//! license = "CC0-1.0"
//!
//! [dependencies]
//! camino = "1.1.2"
//! cargo_metadata = "0.15.2"
//! clap = { version = "4.1.4", features = ["derive"] }
use std::{
cell::Cell,
num::Wrapping,
ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Rem, Sub},
};
fn main() {
// 1D
let mut arr = vec![Wrapping(1); 2];
let cells = d1(&mut arr);

AtCoderのDropboxの全ファイル名を次のスクリプトで調べた。

dropbox-shared-link-contents.py - Gist

  • パターン1。大体はこれ。

    ├── in
    │   ├── 01.txt
    │   └── 02.txt
    
@qryxip
qryxip / dropbox-shared-link-contents.py
Created December 26, 2020 08:46
List files and folders from a shared link in Dropbox
//! ```cargo
//! [package]
//! name = "invesigate-dropbox"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! publish = false
//!
//! [dependencies]
//! anyhow = "1.0.32"
use anyhow::{ensure, Context as _};
use byteorder::{BigEndian, ReadBytesExt as _};
use easy_ext::ext;
use itertools::Itertools as _;
use ress::tokens::{IdentExt as _, StringLitExt as _};
use scraper::{Html, Selector};
fn main() -> anyhow::Result<()> {
let client = reqwest::blocking::Client::new();
@qryxip
qryxip / longlong.rs
Last active January 23, 2022 22:33
Flexible integer type
//! This code is licensed under the [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/legalcode).
//!
//! ```cargo
//! [package]
//! name = "longlong"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! publish = false
//! license = "CC0-1.0"
@qryxip
qryxip / min-max-monoid.rs
Created April 16, 2020 01:08
`alga::general::AbstractMonoid` for `min` and `max`
//! ```cargo
//! [package]
//! name = "min-max-monoid"
//! version = "0.0.0"
//! authors = ["Ryo Yamashita <qryxip@gmail.com>"]
//! edition = "2018"
//! publish = false
//!
//! [dependencies]
//! alga = "0.9.3"