SleveMcDichael

joined 1 year ago
[–] SleveMcDichael@programming.dev 3 points 1 month ago* (last edited 1 month ago)

There are valid criticism to be made about cosmic desktop, like

*Lists two positives*

If that's the best example of criticism to be had about COSMIC, then it's practically flawless. Except of course, though, it isn't. Aside from the general lack of polish, I'd argue that there's not enough customization. E.g. things that should really be a slider or spin control (or better yet multiple sliders/spin controls) like corner radii are multiple choice button things (not to mention that the 'square' style is anything but.) Some of the sliders that do exist (particularly the size ones) have very few set points that make them essentially disguised drop downs. I could probably find dozens more things to criticize if I cared to sit down and nitpick everything.

[–] SleveMcDichael@programming.dev 9 points 4 months ago (3 children)

C++ is pretty alright, IMO, but the syntax is kinda clunky though, I think probably because of some historical baggage.

[–] SleveMcDichael@programming.dev 11 points 4 months ago (7 children)

As much as I sympathise with developers over headaches caused by themeing, I believe users (myself included) would be less up-in-arms about it if applications were less ugly by default. And boy howdy is libadwaita ugly as sin.

I'd be perfectly willing to tolerate a mismatched system, if the individual components looked at least okay. Like I'm not going to get e.g. steam or discord to match an e.g. Windows 9x theme, and I'm mostly okay with that because they aren't horrible to look at. But, say, File Roller? Absolutely not. Horribly ugly.

[–] SleveMcDichael@programming.dev 7 points 5 months ago

A program that I use often uses an embedded MPV window for video playing, and Wayland doesn't support that, and apparently won't: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/74

So until something changes with that program, MPV, or Wayland, or I decide to rewrite the program myself, I'm stuck with X11.

[–] SleveMcDichael@programming.dev 6 points 1 year ago (2 children)

Tabs let you define how big you want each indent to be, and spaces do not.

Spaces can too: Simply use more or less of them, to taste.

I have ADHD. Two spaces per indent makes it damn near impossible for me to scan code.

Then use four, or six, or eight, or 20. Hell, most code I've seen uses four spaces per indent anyway.

[Re: braille]

Surely there's an editor out there that will automatically display indent spaces as a tab character. Or failing that it seems like it would be rather trivial create a program to convert n spaces to tabs, and vice versa.

A bit late to the party but here's a Rust solution that is probably maybe correct: https://pastebin.com/Eaes7hU9

[–] SleveMcDichael@programming.dev 2 points 1 year ago (1 children)

Rust: https://pastebin.com/frYcgdxh

Like last time, a brute force solution: checking if every substring is a set of well formed brackets, and, if so, recording it if its the longest seen so far.

[–] SleveMcDichael@programming.dev 3 points 1 year ago* (last edited 1 year ago)

Rust:

A super simple brute force attempt: https://pastebin.com/qbYQNQ7h

Also super slow. Took me a bit more than a minute for n=10.

edit: An updated version: https://pastebin.com/wVhxLmt9

Added some simple constraints to reduce the number of unfiltered entries that need to be generated, bringing the n=10 time down to 10ish seconds. EDIT: if any of the test cases are n=12 or greater, probably best to fail this without testing. It's super inefficient memory wise.

[–] SleveMcDichael@programming.dev 2 points 1 year ago* (last edited 1 year ago) (2 children)

Time: 4.472s

Ough. Those must be some hefty test cases, even the deepest ones I tested (250 loops) completed in less than a tenth of a second. If its possible I may try to find a faster solution and resubmit later...

[–] SleveMcDichael@programming.dev 4 points 1 year ago* (last edited 1 year ago) (4 children)

Here's an entry in Rust, though it feels quite a bit like cheating:

fn main() {
    let mut a = std::env::args().skip(1).next().unwrap();
    println!("{}", f(&mut a));
}


fn f(a: &mut String) -> String {
    let mut b = String::new();

    while *a != b {
        b = a.clone();
        *a = a.replace("{}", "").replace("()", "").replace("[]", "");
    }

    return b;
}

edit: added main function to take cli input.

edit2: a rust based stack implementation: https://pastebin.com/FgfuxxRV

view more: next ›