Readit News logoReadit News
tyilo commented on SIMD programming in pure Rust   kerkour.com/introduction-... · Posted by u/randomint64
ChadNauseam · 21 days ago
Didn't know about this. Thanks!

Not related, but I often want to see the next or previous element when I'm iterating. When that happens, I always have to switch to an index-based loop. Is there a function that returns Iter<Item=(T, Option<T>)> where the second element is a lookahead?

tyilo · 21 days ago
You probably just want to use `.peekable()`: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.htm...

Loading parent story...

Loading comment...

tyilo commented on YesNotice   infinitedigits.co/docs/so... · Posted by u/surprisetalk
tyilo · 2 months ago
I got a 403 Forbidden error when trying to register a user.
tyilo commented on Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)   ericpony.github.io/z3py-t... · Posted by u/amit-bansil
tyilo · 3 months ago
I have created a Python library called "z4-solver" that adds some nice utility functions on top of z3: https://github.com/Tyilo/z4

I always use that instead of the z3-solver directly.

tyilo commented on Breaking "provably correct" Leftpad   lukeplant.me.uk/blog/post... · Posted by u/birdculture
tyilo · 4 months ago
What is the expected output of padding "﷽"? It is only one code point but very wide.
tyilo commented on Updating Desktop Rust   tritium.legal/blog/update... · Posted by u/piker
tyilo · 4 months ago
I use the `self_replace` crate for this: https://docs.rs/self-replace/latest/self_replace/
tyilo commented on Offline card payments should be possible no later than 1 July 2026   riksbank.se/en-gb/press-a... · Posted by u/sebiw
koliber · 4 months ago
We've come full circle.

Credit cards were offline-only in the beginning. When have we lost this ability?

See https://www.google.com/search?num=10&sca_esv=5e043526353aa70...

tyilo · 4 months ago
Only half circle?
tyilo commented on macOS dotfiles should not go in –/Library/Application Support   becca.ooo/blog/macos-dotf... · Posted by u/zdw
orlp · 6 months ago
I and others have brought this up with the dirs Rust crate maintainer but they refuse to see it this way: https://codeberg.org/dirs/dirs-rs/issues/64. It's very frustrating.

I now use a combination of xdg + known-folders manually:

    [target.'cfg(windows)'.dependencies]
    known-folders = "1.2.0"

    [target.'cfg(not(windows))'.dependencies]
    xdg = "2.5.2"
to get the config directory:

    use anyhow::{Context, Result};

    #[cfg(windows)]
    fn get_config_base_dir() -> Result<PathBuf> {
        use known_folders::{KnownFolder, get_known_folder_path};
        get_known_folder_path(KnownFolder::RoamingAppData).context("unable to get config dir")
    }

    #[cfg(not(windows))]
    fn get_config_base_dir() -> Result<PathBuf> {
        let base_dirs = xdg::BaseDirectories::new().context("unable to get config dir")?;
        Ok(base_dirs.get_config_home())
    }

tyilo · 6 months ago
It seems like `etcetera` has better defaults: https://docs.rs/etcetera/latest/etcetera/#native-strategy

> `choose_base_strategy()` and `choose_app_strategy()` will use the XDG strategy on Linux & macOS, and the Windows strategy on Windows. This is used by most CLI tools & some GUI tools on each platform.

tyilo commented on Shader Academy: Learn computer graphics by solving challenges   shaderacademy.com/... · Posted by u/pykello
tyilo · 6 months ago
I can't get https://shaderacademy.com/challenge/intro_1 to work on Firefox 142.0b5. Even with the provided answer the output is just a red rectangle.
tyilo commented on "Email is Easy" email address quiz   e-mail.wtf... · Posted by u/samwho
tyilo · 6 months ago
Last week I created a script for finding which TLD's have MX records. Result:

    cf: ["mail.intnet.cf."]
    gp: ["ns1.nic.gp."]
    gt: ["aspmx.l.google.com.", "alt1.aspmx.l.google.com.", "alt2.aspmx.l.google.com.", "aspmx2.googlemail.com.", "aspmx4.googlemail.com.", "aspmx5.googlemail.com."]
    hr: ["alpha.carnet.hr."]
    km: ["mail1.comorestelecom.km."]
    mq: ["mx1-mq.mediaserv.net."]
    mr: ["mail.nic.mr."]
    tt: ["ASPMX.L.GOOGLE.COM.", "ALT1.ASPMX.L.GOOGLE.COM."]
    ua: ["mr.kolo.net."]
    ws: ["mail.worldsite.ws."]
    موريتانيا: ["mail.nic.mr."]
    عرب: ["your-dns-needs-immediate-attention.عرب."]
PS: Only http://uz/ seems to have a "working" HTTP server, returning the 500 status code.

u/tyilo

KarmaCake day303June 25, 2012View Original