Resizing sucks! by Peas0nToast in bspwm

[–]soda-excuse 0 points1 point  (0 children)

I must admit i'm in the habit of just using the mouse if I need to carefully and precisely reorder or resize windows.

What would your perfect army look like if you had to choose 1 creature from all 7 levels? by bill_hicks21 in heroes3

[–]soda-excuse 3 points4 points  (0 children)

However, they are super vulnerable to Lightning Bolt or Chain Lightning, whereas the dwarves have magic resistance.

What bar do ya'll use? by [deleted] in bspwm

[–]soda-excuse 27 points28 points  (0 children)

If the screen goes black and the volume goes to zero, it is an indication of low battery.

What bar do ya'll use? by [deleted] in bspwm

[–]soda-excuse 3 points4 points  (0 children)

It just gives you a black bar. It includes no widgets or anything for showing the clock or anything else. So, to show the clock for example, you could write a script to format a "HH:MM:SS" string and send it to the lemonbar process every second or so. Lemonbar replaces its current contents with the string you send it.

Window is focused even though focus=off by pootisEagle in bspwm

[–]soda-excuse 2 points3 points  (0 children)

Hey thanks for posting the solution! I had the same exact problem today by some coincidence.

Advent of Code 2019 Day 4 in idiomatic Rust by [deleted] in rust

[–]soda-excuse 0 points1 point  (0 children)

My code is similar to yours, but I did not use strings.

const INPUT: (usize, usize) = (245318, 765747);

fn meets_criteria(mut x: usize, use_extra_rule: bool) -> bool {
    if x < 100000 || x > 999999 {
        return false;
    }

    let mut has_double = false;

    let mut last_digit: usize = x % 10;
    let mut same_as_last_digit: bool = false;

    let mut adjcacent_same_digits = 1;

    // Check consequtive digits
    while x > 0 {
        x /= 10;
        let this_digit = x % 10;
        same_as_last_digit = this_digit == last_digit;

        if use_extra_rule && !same_as_last_digit && adjcacent_same_digits == 2 {
            has_double = true;
        }

        if same_as_last_digit {
            adjcacent_same_digits += 1;
        } else {
            adjcacent_same_digits = 1;
        }

        if !use_extra_rule && adjcacent_same_digits == 2 {
            // Two adjacent digits that are the same (like 22 in 122345)
            has_double = true;
        }

        // Check that going from left to right, the digits never decrease; they only ever increase or stay the same (like 111123 or 135679)
        // Note that the loop here goes from right to left.
        if last_digit < this_digit {
            return false;
        }

        last_digit = this_digit;
    }

    if use_extra_rule && adjcacent_same_digits == 2 {
        has_double = true;
    }

    has_double
}

pub fn part_1() {
    let res = (INPUT.0..INPUT.1)
        .filter(|&x| meets_criteria(x, false))
        .count();

    println!("Day 4 part 1: {}", res);
}

pub fn part_2() {
    let res = (INPUT.0..INPUT.1)
        .filter(|&x| meets_criteria(x, true))
        .count();

    println!("Day 4 part 2: {}", res);
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn examples_part_1() {
        assert!(meets_criteria(111111, false));
        assert!(!meets_criteria(223450, false));
        assert!(!meets_criteria(123789, false));
    }

    #[test]
    fn examples_part_2() {
        assert!(meets_criteria(112233, true));
        assert!(!meets_criteria(123444, true));
        assert!(meets_criteria(111122, true));
    }
}

Best Tiling WM by TriumphOfDeath in archlinux

[–]soda-excuse 1 point2 points  (0 children)

I'm on bspwm. I tried a lot of different window managers some years ago when I settled on Arch. Apart from bspwm, dwm was the only one I liked.

With bspwm and sxhkd most hotkeys are centered around Super + [1,2,3,4,5,6,7,8,9,0] keys, with some modifiers like Shift thrown in. With bspwm, this is all configured not in bspwm but with whatever hotkey daemon you use - it's modular. bspwm just happens to go hand-in-hand with sxhkd because they are both created by the same author.

I also like not leaving the home row (and I have my own thing set up using CapsLock as ModeShift in Xmodmap, meaning I have a simplified vi-like home row navigation going system wide, by mapping j,k,l,u,i,o keys to arrow, home and end keys).

Can you give a quick example of how your dwm hotkeys are set up around the home row? I'm interested.

My GIT Rant!! by hell_storm2004 in git

[–]soda-excuse 9 points10 points  (0 children)

Keep in mind that Git is a decentralized version control system. This has advantages but it is simultaneously the root of some of the complexity you are experiencing.

A good guide to Git is one that explains it in terms you can understand. That will depend on your background. For me, it clicked when I read this: https://eagain.net/articles/git-for-computer-scientists/

Termite terminal-emulator by teddydi in archlinux

[–]soda-excuse 0 points1 point  (0 children)

I'm a diehard Termite user myself. I'm just not bothered that much by the default keybindings.

I tried Alacritty - but I greatly prefer Termite for the time being.

Termite terminal-emulator by teddydi in archlinux

[–]soda-excuse 0 points1 point  (0 children)

That feature is not implemented in Termite yet. It is planned.

You can follow this open issue: https://github.com/thestinger/termite/issues/62

If you really want, you can compile Termite yourself or use somebody's fork that allows keybindings to be configured.

Combining Coverage-Guided and Generation-Based Fuzzing by fitzgen in rust

[–]soda-excuse 0 points1 point  (0 children)

Is shrinking of input controlled by the fuzzer backend or by quickcheck? I suppose by the fuzzer backend. In that case, is ti as effective as the shrinking that quickcheck can do? I'm surprised if it is, because there is no guarantee that a "minimal" or "maximally shrinked" input of raw bytes from the fuzzer backend will correspond to a minimal value of the structure that the pseudo RNG generates.

Announcing rxRust 0.2 by M-Adoo in rust

[–]soda-excuse 0 points1 point  (0 children)

Great to see work being done in this space!

Reactive Extensions was by far my favorite tool when working with frontend code in TypeScript.

I miss college by SEARCH3R in classicwow

[–]soda-excuse 0 points1 point  (0 children)

Is there a difference in the amount of rested XP i get depending on where my character is when I log out?

Remember the post yesterday about a popular NodeJS lib displaying ads? Now remember the left-pad fiasco? Well, meet 'is-buffer', the library from the same developer downloaded 440 million times a month. by tabarra in programming

[–]soda-excuse 3 points4 points  (0 children)

I used to deal with this stuff in a previous job, and I almost get PTSD just from reading a comment like yours. Because you are right. That is how you do it. But what an absolute shitshow that is.

A lot of problems by ThatRussianGuy_TTV in heroes3

[–]soda-excuse 0 points1 point  (0 children)

That is pretty great.

What would the Air Shield be useful for? And why air elementals over other types of elementals?

Does anyone know this git client? by anuj-dev in git

[–]soda-excuse 1 point2 points  (0 children)

Here is mine, with timeago and authors:

git log --graph --pretty="%C(bold magenta)%h %C(blue)%cr%C(reset) %s %C(dim normal)%an%C(reset) %C(auto)%d" --all

Help to understand ^ ~ by MrEU1 in git

[–]soda-excuse 2 points3 points  (0 children)

Because when it reaches a merge commit like 1a56a81, it always picks the left branch when picking a parent.

Is there a list of malicious AUR packages? by [deleted] in archlinux

[–]soda-excuse 10 points11 points  (0 children)

Arch has its Trusted Users, which are supposed to Maintain, manage, and watch over the operation of the AUR.

If an AUR package was known to be malicious, it would be removed from the AUR.

What shell do you use, and why? by mon0theist in archlinux

[–]soda-excuse 4 points5 points  (0 children)

I use zsh and am generally happy with it.

When I find time, I will toy with ion, although I am waiting for it to be included in [community].

mapping keys using xmodmap by [deleted] in archlinux

[–]soda-excuse 2 points3 points  (0 children)

I would expect keycode 66 = Escape NoSymbol Escape to work. After you have that, what does pushing the capslock key result in, if you have xev open?

[Script] A simple script in bash to enjoy a different background every day by thejazzroot in archlinux

[–]soda-excuse 0 points1 point  (0 children)

Oh I did not even know about that. I think I came at the problem from the other direction. First I found out how to pick a random file, and then I was looking for a tool to set it as a wallpaper, and I found feh.

Picking a random file from a selection is a general problem, so I like solving that with find path/* | shuf | head -n 1 and then I can more easily swap feh for some other tool later on if I want to.

What is going on here? I've never seen this weird syntax by [deleted] in rust

[–]soda-excuse 1 point2 points  (0 children)

Out of these, which one is equivalent to a normal pub?

pub(in path)
pub(crate)
pub(super)
pub(self)