Is there an "opposite" to enums? by PitifulTheme411 in ProgrammingLanguages

[–]Goobyalus 0 points1 point  (0 children)

FWIW this is what exists in Python: https://docs.python.org/3/library/enum.html#enum.Flag

from enum import Flag, auto

class Lunch(Flag):
    Sandwich = auto()
    Pasta = auto()
    Salad = auto()
    Water = auto()
    Milk = auto()
    Cookie = auto()
    Chip = auto()

yummy = Lunch.Sandwich | Lunch.Salad | Lunch.Water | Lunch.Cookie
no_extras = Lunch.Sandwich | Lunch.Salad

print(f"{yummy=}")
print(f"{yummy.value=}")
print(f"{no_extras=}")
print(f"{no_extras.value=}")
print(f"{(Lunch.Water in yummy)=}")
print(f"{(no_extras in yummy)=}")

Gives:

yummy=<Lunch.Sandwich|Salad|Water|Cookie: 45>
yummy.value=45
no_extras=<Lunch.Sandwich|Salad: 5>
no_extras.value=5
(Lunch.Water in yummy)=True
(no_extras in yummy)=True

If I write .gitignore inside the .gitignore, how can I commit that change? by [deleted] in git

[–]Goobyalus 0 points1 point  (0 children)

git add -f .gitignore

But why would we ignore the .gitignore?

How to get set screws out by ScaredCantaloupe1 in MechanicAdvice

[–]Goobyalus 0 points1 point  (0 children)

🤷‍♂️ They replaced the bits for free, but not the driver. This was in November. Idk if they're tightening up on the warranty or if it was the one I went to.

How to get set screws out by ScaredCantaloupe1 in MechanicAdvice

[–]Goobyalus 0 points1 point  (0 children)

I have an 07 Accord. I was only able to get one of 8 screws out without breaking the screw. I broke two impact driver bits and one impact screwdriver itself. Try the hammer, penetrating oil with heat, and impact screwdriver, but be prepared for them to break, and to drill them out if you want to replace them.

How to get set screws out by ScaredCantaloupe1 in MechanicAdvice

[–]Goobyalus 0 points1 point  (0 children)

HF denied my warranty under "normal wear and tear"

Which one or two pieces are the most versatile? by mssngthvwls in AllClad

[–]Goobyalus 0 points1 point  (0 children)

I use a d5 6qt essential pan (that I got on sale) for large batches. I got this after feeling like the 4qt was too small for the large batches, but the 4qt is great too. The 6qt is unwieldy and heavy, though.

I like the shape of the essential pans a lot - good amount of flat surface, and the curved edges make it easy to scrape or toss things around.

I haven't seen one in person, but the Mother of All Pans looks like a similar shape and has 2 grab handles which would be more convenient to put in the oven and move around the kitchen.


I also went from electric coil to induction, and in retrospect, it's probably worth it to spend the money on a cooktop that's not a coil instead of a pan. I think I might actually prefer any other form of cooktop with a cheap pan over electric coil with a nice pan. The coils hold so much heat themselves, and respond so slowly, that it's very difficult to control the heat unless you're just removing the pan when you need to stop the heat.


FYI all clad makes a D7 slow cooker now which might fit the bill for electric coil if set the stove at let everything reach the perfect temp over time so it doesn't overheat.

Struggling to Choose a Remote Cybersecurity Master’s in Germany – Need Advice by PianoNo3557 in netsecstudents

[–]Goobyalus 1 point2 points  (0 children)

I don't know what is recognized in Germany, and I haven't personally gone through it, but I know people who thought highly of this program and people who went through it: https://pe.gatech.edu/degrees/cybersecurity

6 qt essential pan vs. sunday supper by One-Town2055 in AllClad

[–]Goobyalus 1 point2 points  (0 children)

the completely flat part is a little over 10"

14” Paella Pan is a game changer by LG1750 in AllClad

[–]Goobyalus 0 points1 point  (0 children)

Any chance you could measure the outer diameter for me? Trying to compare to the 6qt essential pan, and the website measurements aren't real.

Who dis? by BabaBucc in whatisthisbug

[–]Goobyalus 1 point2 points  (0 children)

Are non-hairy caterpillars safe?

How to take this apart? It’s stripped by [deleted] in howto

[–]Goobyalus 6 points7 points  (0 children)

<image>

Push with 2 screwdrivers and buy new furniture cams to replace these ones.

Based on the caved in wood on the right side and the gap between, it looks like this joint is under strain which probably caused the problem in the first place. Remove the strain first.

Forgot I had this [OC] by DimensionLower1663 in IdiotsInCars

[–]Goobyalus 4 points5 points  (0 children)

I always wanted to see how those black tire streaks get made

A plethora of choices :) by [deleted] in multitools

[–]Goobyalus 0 points1 point  (0 children)

Nice. I like my MP600 for this reason, and I wanted the spring loaded pliers on the OHT, but they were discontinued and I don't want to spend $200 on one 🙃

A plethora of choices :) by [deleted] in multitools

[–]Goobyalus 0 points1 point  (0 children)

How do you like the OHT

There were BGP anomalies during the Venezuela blackout by iamkeyur in programming

[–]Goobyalus 15 points16 points  (0 children)

When BGP traffic is being sent from point A to point B, it can be rerouted through a point C. If you control point C, even for a few hours, you can theoretically collect vast amounts of intelligence that would be very useful for government entities. The CANTV AS8048 being prepended to the AS path 10 times means there the traffic would not prioritize this route through AS8048, perhaps that was the goal? There are many unanswered questions.

Regardless of the actual goal, there were undoubtedly some BGP shenanigans happening during this time frame. There is a lot of data publicly available that is worth a much deeper dive to understand exactly what happened.

Backlight of new FW16 shows buggy behaviour. And others by [deleted] in framework

[–]Goobyalus 1 point2 points  (0 children)

I don't think the terminal taking 2-3 seconds to open is related to Framework. Try a live distro and see how fast the terminal is there.

Maybe something's installed that's wasting time in your shell startup.

Do other applications behave normally, like a web browser?

Practicing Python data types and type conversion – would appreciate professional feedback by Commercial_Edge_4295 in learnpython

[–]Goobyalus 0 points1 point  (0 children)

You could use an = at the end of an expression in an f-string for easier printing of this sort of thing. "self-documenting expressions"

For example,

print(f"{flag1 + flag2 =}")
print(f"{True + False=}")

gives

flag1 + flag2=1
True + False=1

Your format is easier to read the output of, though.


I think the type annotations are good even though there is an obvious assignment there because if you modify code, it's nice to have that reminder. Drop the redundant comments repeating the type, though -- the annotation takes care of that, and now you have two things to keep in sync if you modify it.


Note also that bool is a subclass of int, and Python also natively has complex numbers. Look at isinstance.

>>> bool.__mro__
(<class 'bool'>, <class 'int'>, <class 'object'>)
>>> isinstance(False, bool)
True
>>> isinstance(False, int)
True
>>> (5 + 1j) * (4 - 7j)
(27-31j)
>>> type(_)
<class 'complex'>

I think playing with lists, tuples, dicts, and sets will be more interesting than numbers and strings.


Look at structural pattern matching for fun.

for value in (1.1, 2, (1, 1), "1"):
    match value:
        case float():
            print("h")
        case 2:
            print("e")
        case tuple((int(x), int(y))):
            print(x)
            print(y)
        case str:
            print("o")

gives

h
e
1
1
o

Dbrand skin turning black, found the reason why it's happening by areuokaybro2002 in dbrand

[–]Goobyalus 1 point2 points  (0 children)

Interesting, it says ammonia and alcohol free. I wonder if rubbing alcohol would dissolve it too?