de9ce7d
M Teeish Mine, M Teetrader, A AiP-Bores, A 23shots - ddnet-mapsNVIDIA designs hardware to provide the fastest Vulkan performance for your games and applications. For example, NVIDIA GPUs perform up over 30 percent faster than the nearest competition on games such as Doom Eternal with advanced rendering techniques such as ray tracing.
(edited)MariaDB [teeworlds]> delete record_race from record_race inner join record_race b on record_race.Map = b.Map and record_race.Name = b.Name and record_race.Time = b.Time and record_race.Timestamp != b.Timestamp and DATE_SUB(b.Timestamp, INTERVAL 1 HOUR) = record_race.Timestamp and record_race.Timestamp >= "2022-12-10" and b.Timestamp >= "2022-12-10";
Query OK, 6977 rows affected (16.948 sec)
CMake Error at CMakeLists.txt:660 (message):
You must install Rust and Cargo to compile DDNet
What is cargo? how to download this?info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
714.2 KiB / 714.2 KiB (100 %) 607.4 KiB/s in 1s ETA: 0s
info: latest update on 2022-11-03, rust version 1.65.0 (897e37553 2022-11-02)
info: downloading component 'cargo'
4.0 MiB / 4.0 MiB (100 %) 284.8 KiB/s in 13s ETA: 0s
info: downloading component 'clippy'
2.0 MiB / 2.0 MiB (100 %) 320.7 KiB/s in 7s ETA: 0s
info: downloading component 'rust-docs'
14.8 MiB / 18.9 MiB ( 78 %) 166.4 KiB/s in 51s ETA: 25s
that's? (edited)rustup toolchain install stable-x86_64-pc-windows-gnu
BufRead
is a type of Read
er which has an internal buffer, allowing it to perform extra ways of reading.use std::io;
use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
fn main() -> io::Result<()> {
let inpfn = "../input";
let f = File::open(inpfn)?;
let mut reader = BufReader::new(f);
let mut buffer = String::new();
while reader.read_line(&mut buffer).expect("hehe") != 0 {
println!("{buffer}");
buffer.clear();
}
Ok(())
}
let mut input = String::new();
File::open(path)?.read_to_string(&mut input)?;
a string is usually more flexible to work with, and you read the entire file anyways.lines()
, which you can also just iterate over
for line in input.lines() {
println!("{line}");
}
line
is of the type &str
, so no further allocations are madeuse std::io;
use std::io::prelude::*;
use std::fs::File;
use std::str::FromStr;
fn main() -> io::Result<()> {
let mut elfn = 1;
let mut max = 0;
let mut cur = 0;
let inpfn = "../input";
let mut input = String::new();
File::open(inpfn)?.read_to_string(&mut input)?;
for line in input.lines() {
println!("{line}");
if line.is_empty() {
elfn += 1;
if cur > max {
println!("{cur} more than {max}");
max = cur;
}
cur = 0;
} else {
cur += i32::from_str(line).unwrap();
}
}
println!("{max}");
Ok(())
}
.lines()
, which you can also just iterate over
for line in input.lines() {
println!("{line}");
}
use std::io;
use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
fn main() -> io::Result<()> {
let inpfn = "../input";
let f = File::open(inpfn)?;
let mut reader = BufReader::new(f);
let mut buffer = String::new();
while reader.read_line(&mut buffer).expect("hehe") != 0 {
println!("{buffer}");
buffer.clear();
}
Ok(())
}
lines
instead of readline, but ig similar to Patiga's solut