Skip to content

Instantly share code, notes, and snippets.

View luabida's full-sized avatar
🌙
路安

Luã B. Vacaro luabida

🌙
路安
  • FGV Rio
  • Brazil
  • 05:37 (UTC -03:00)
View GitHub Profile
@luabida
luabida / generic_retangle.rs
Created February 18, 2024 09:48
[rs] Generic Types // Retangle
use std::marker::Copy;
fn main() {
let r1 = Retangle {
width: 50,
height: 30.5,
};
println!("{:?}", r1.get_area())
}
@luabida
luabida / rust_frameworks.md
Created February 19, 2024 01:09
Rust Frameworks

Debugging

  • color_eyre
@luabida
luabida / age.py
Last active May 21, 2024 19:50
Calculate age
from datetime import datetime as dt
calculate_age = (
lambda bd: (
(td := dt.today()) and (td.year - bd.year - ((td.month, td.day) < (bd.month, bd.day)))
))
print(f"{calculate_age(dt(1990, 5, 21))}yo")
df_true:
id dates year epiweek ... train_1 train_2 target_1 target_2
0 3614204 2022-06-12 2022 202224 ... True True False False
0 3617405 2022-06-19 2022 202225 ... True True False False
0 3625692 2022-06-26 2022 202226 ... True True False False
0 3628534 2022-07-03 2022 202227 ... True True False False
0 3636802 2022-07-10 2022 202228 ... True True False False
.. ... ... ... ... ... ... ... ... ...
0 3586758 2022-05-08 2022 202219 ... True True False False
0 3592058 2022-05-15 2022 202220 ... True True False False