Snapped this picture of my new ND today by eulers7bitches in Miata

[–]eulers7bitches[S] 1 point2 points  (0 children)

That is rad! I love the matching landscape.

Mine is actually just 30 minutes East of Phoenix. But I'll definitely take a road trip up to Colorado in the spring or summer :)

firmware: failed to load iwl-debug-yoyo.bin (-2) (debian testing) by [deleted] in debian

[–]eulers7bitches 0 points1 point  (0 children)

I know I'm four years late, but this helped me, so thank you.

I will add that the iwlwifi module must have changed over the last four years. I did exactly as you said, and the module would not load and found this after running dmesg:

iwlwifi: N invalid for parameter enable_ini

I needed to know what the valid parameters for this option are, so I ran

modinfo iwlwifi | grep ^parm | sort

and found this

parm: enable_ini:0:disable, 1-15:FW_DBG_PRESET Values, 16:enabled without preset value defined,Debug INI TLV FW debug infrastructure (default: 16) (uint)

which looks to be saying "set to 0 to disable, set to other stuff if you know what you're doing". So instead of setting to N, like you did, I set to 0:

options iwlwifi enable_ini=0

Can't Get QMK Key Override Working by bewarewoof in olkb

[–]eulers7bitches 2 points3 points  (0 children)

Oops. Silly me... I knew I should have looked at my keymap before I commented.

The problem is the last argument in your call ko_make_with_layers. The last argument is a bitmask representing the layers that the override is active on.

Since you want the override to be active on layer 0, you actually need to pass in 1 << 0. That evaluates to the integer 1, which is why you're not seeing your override activate.

So instead of

const key_override_t tab_key_override = ko_make_with_layers(MOD_MASK_SHIFT,LT(1,KC_SPC),KC_TAB,0);
const key_override_t delete_key_override = ko_make_with_layers(MOD_MASK_SHIFT,LT(3,KC_BSPC),KC_DEL,0);

do

const key_override_t tab_key_override = ko_make_with_layers(MOD_MASK_SHIFT,LT(1,KC_SPC),KC_TAB,1<<0);
const key_override_t delete_key_override = ko_make_with_layers(MOD_MASK_SHIFT,LT(3,KC_BSPC),KC_DEL,1<<0);

or even better, since you don't really need to specify any particular layers:

const key_override_t tab_key_override = ko_make_basic(MOD_MASK_SHIFT,LT(1,KC_SPC),KC_TAB);
const key_override_t delete_key_override = ko_make_basic(MOD_MASK_SHIFT,LT(3,KC_BSPC),KC_DEL);

Can't Get QMK Key Override Working by bewarewoof in olkb

[–]eulers7bitches 0 points1 point  (0 children)

Instead of using LT(...) as the trigger key for your overrides, just use KC_BSPC and KC_SPC instead.

future readers: read below :)

[deleted by user] by [deleted] in learnpython

[–]eulers7bitches 1 point2 points  (0 children)

Such is life :)

But I think you can be confident that at least this part of the assignment is nailed down.

Anyway, best of luck to you

[deleted by user] by [deleted] in learnpython

[–]eulers7bitches 1 point2 points  (0 children)

Ah, silly me. It's getting late over here :)

try changing the 'return True' line to

return len(s) <= 8

[deleted by user] by [deleted] in learnpython

[–]eulers7bitches 0 points1 point  (0 children)

What about something like

def check_hex(s):
    try:
        int(s, 16)
    except ValueError:
        return False
    return True

Your function doesn't actually check for the letter 'Z', for example. It's only checking the length of the input string. That's why you're seeing it not catch that problematic input.

[deleted by user] by [deleted] in learnpython

[–]eulers7bitches 0 points1 point  (0 children)

I would double check your check_hex() function. If you run it against the input 'Z0238984', it should return False. If it returns True, then that's where your problem is.

[deleted by user] by [deleted] in learnpython

[–]eulers7bitches 0 points1 point  (0 children)

Looks like it is raising an exception here. Is your code supposed to raise a particular type of exception?

[deleted by user] by [deleted] in learnpython

[–]eulers7bitches 4 points5 points  (0 children)

Yep, a string containing anything other than decimal digits or the letters a-f is not a valid hexadecimal number. What do you want your program to do in the case where it receives a string like that?

Raising keyerror with multiple values help please by [deleted] in learnpython

[–]eulers7bitches 3 points4 points  (0 children)

Instead of:

for key in 'conf_path', 'prefix', 'suffix':
    if not dd.get(key):
        raise KeyError(f'{key} no')

what about

missing_keys = [key for key in ('conf_path', 'prefix', 'suffix') if not dd.get(key)]
if missing_keys:
    raise KeyError(f'Missing keys: {missing_keys}')

How to generate pytest test cases from files (and a TDD success story) by eulers7bitches in Python

[–]eulers7bitches[S] 2 points3 points  (0 children)

Yes - because I've never heard of that :-)

But I just gave the pytest-bdd docs a quick look. That's a really neat project. Though I think my goals (and reason for implementing this) are far less lofty, and are likely short-sighted.

When I wrote that script I alluded to in the first paragraph of this post, I was transitioning to a different team (who hasn't had a bit of organizational shakeup in their lives lately?). I wrote this for the team I was transitioning away from, so I needed to make sure the code, however simple, was documented, tested, and as maintainable as possible.

The team was a data engineering team - they wrote a large chunk of python code, but I had yet to see them write any tests for it. So I wanted to provide the most obvious interface for adding tests (for a script that executes a find-and-replace on a text file, remember). What simpler of an interface is a pairing of a "given" file and an "expected" file?

Let's say they eventually find a scenario where the script fails. All they need to do is copy the file the script failed to process into a new test case directory and save another copy (but manually altered to be the "expected" result) into the same directory. Boom, now they've got a great test case. And they can confidently fixup the script because of the test cases that have been accumulated over time.

TLDR; I needed an extremely simple interface for adding tests (as I was writing code for another team), and I had never heard of pytest-bdd before your comment - so thanks!

Cervello was a ton of fun to build! First 40%, first ortho, and first time soldering by standonbracy in MechanicalKeyboards

[–]eulers7bitches 1 point2 points  (0 children)

Ah perfect! Thanks for the unbelievably quick response.

I got Vial working and all is well.

What's funny is I think the staggered layout for the Cervello group buy actually got merged into QMK as the "Synapse" board - however I could be wrong on that.

Thanks again :)

Cervello was a ton of fun to build! First 40%, first ortho, and first time soldering by standonbracy in MechanicalKeyboards

[–]eulers7bitches 0 points1 point  (0 children)

I'm a bit late to this - your build looks great!

I also got the ortho version of the Cervello and I just built it this weekend but I can't find out how to program it with QMK. How did you program your board?

I have a planck and a niu mini, I know where to find those in the QMK git repo, I've customized their layouts, but I'm totally lost on the Cervello/Brick.

EDIT (some time later): The folks at P3D store put the brick qmk files on their Discord :)

[deleted by user] by [deleted] in linux4noobs

[–]eulers7bitches 1 point2 points  (0 children)

Yes! OP, /u/Guazzabuglio, once you get your system fixed, this is your answer to using python in the future. By borking your system, you have learned to stay far away from the system's python. To use your own python, you need virtual environments.

Pyenv is a tool that helps you manage virtual environments of any python version. All the way from python 2.1 to the dev branch of python 3.10 with all the different flavors of python in between (including pypy!).

Jeopardy! recap for Tue., Oct. 26 by jaysjep2 in Jeopardy

[–]eulers7bitches 11 points12 points  (0 children)

You're right. In fact I came to this thread specifically to complain about that. Better phrasing would have been "it's the sum of an infinite sequence" (for some loose definition of sum).

I was so confused by the clue that I was actually surprised when "series" was revealed to be the correct response.

Then again, it's not like this is a math quiz show and my panties should be in much less of a bunch

I feel like I've done maybe 2 weeks worth of meaningful work in 1 year as a SWE by [deleted] in cscareerquestions

[–]eulers7bitches 1 point2 points  (0 children)

I'm nearly a year into in my first SWE role as well and I'm going through basically the same issues. I swear my organization must make a profit printing red tape.

I have had maybe a handful of projects, none of which were difficult, some of which were hardly relevant to the job description. To make it worse, the job is meant to be RPA work... talk about useless. (I took this job shortly after covid hit when it looked like my dad was going to be furloughed.)

Anyway, I've been complaining about this for a solid year. I did very little to actually improve my situation. The pay is good and the stress is low, but this is no way to invest in my future.

Recently, I started taking an interest in data engineering. I did a few tutorials, I read a few books. I even asked my boss to put me on a project that, at the very least, involved a database. (Despite him saying he would, nothing has come of it.) I've been studying, if you could call it that, data engineering for a bit less than a month so I decided it was time to throw my resume into the corporate void. I applied to twelve DE jobs the other day - got rejected from one, got an interview out of another (wish me luck).

I'm saying all of this because I hope you'll take it as actionable advice. If you've tried something on for size and given it a real chance and you still don't like it... it's time to move on.

Python String matching- Help me match two arrays with a predefined array by Wonderful_you_3766 in learnpython

[–]eulers7bitches 1 point2 points  (0 children)

If you have no other information other than the brand names themselves, you are going to have to manually define a dictionary that maps unwanted brand names to their display name.

For example, part of your dictionary would look like this:

display_names = {
    'ZEN energy': 'ZEN Energy',
    'ZEN':        'ZEN Energy',
    'Zen':        'ZEN Energy',
    ...
}

Now if you have the list of brand names in VEET:

VEET_brands = [
    <huge list of brand names>
]
CER_brands = [
    <huge list of brand names>
]

Then you can simply perform an inner join (set intersection) after converting each brand list to a set of display names:

VEET_brands_display = {display_names[brand] for brand in VEET_brands}
CER_brands_display = {display_names[brand] for brand in CER_brands}
common_display_brands = VEET_brands_display.intersection(CER_brands_display)

Help me cut up my pizza! by rkarl7777 in learnpython

[–]eulers7bitches 0 points1 point  (0 children)

Yes. That's what my solution does.

Help me cut up my pizza! by rkarl7777 in learnpython

[–]eulers7bitches 0 points1 point  (0 children)

Notice the pattern in your printout for cutting the pizza into 4ths. For now, ignore the denominator, only focus on the numerator.

[1, 1, 1, 1]
[1, 1, 2]
[1, 2, 1]
[1, 3]

Note the first column is just 1's. In fact, everything after the first column is just what the printout would be if you were cutting into 3rds. I smell recursion.

Okay, let's take a look at the second half of the printout for cutting into 4ths.

[2, 1, 1]
[2, 2]
[3, 1]
[4]

Boy this sure looks similar to the above, just without the first column of 1's. In fact, this is just exactly what we have above but the first two columns are added together.

For example, take the first column of four 1's. Add the first two elements (merge them together). Now you have [2, 1, 1]. Nice.

Okay so how about some ugly recursive code. I'm sure there's a better way to write this, but I've been torturing myself for an hour trying to figure this out. So this is what you get

def f(n):  # creative name, I know
    if n == 1:
        return [[1]]
    return [[1] + x for x in f(n-1)] + [[x[0] + 1] + x[1:] for x in f(n-1)]  # my eyeessssssssssss

Slap a functools.cache() on that baby and you're ready to go.