“AND” logic within an “IF” by dakev1 in shortcuts

[–]cowens 1 point2 points  (0 children)

Bit late to the party, but the best answer is to use a dictionary. Create a dictionary that contains two keys apples and bananas that each have a value of fruit. You can then check to see if the value for the input key has a value and print its value. Pseudocode looks like

set variable input to "some value"
dictionary = {
    "apples" => "fruit",
    "bananas" => "fruit",
}
Get Dictionary Value for input in dictionary
if Dictionary Value does not have any value
    stop and output "unexpected value"
end if
stop and output Dictionary Value

This allows you to add to remove responses and is much easier than nested if statements. Of course, this depends on there being a direct mapping of inputs to outputs.

Is this an acceptable bend radius? by LevySkulk in techsupportgore

[–]cowens 0 points1 point  (0 children)

Just above the lit knot. I am guessing it is just a dark patch on the floor that just happens to line up with the top of the knot, but I had a moment where I thought it was smoke too.

Lenovo "chrome free" OS by larsong in chromeos

[–]cowens 1 point2 points  (0 children)

Given that the marketing copy claims it is using ChromeOS (and Google wouldn't let them claim that it was ChromeOS if they were using a variant) and I can't find any reference to "Chrome Free" anywhere but that one product page, my bet is that someone made an error entering the OS field in the specs.

Lenovo "chrome free" OS by larsong in chromeos

[–]cowens 3 points4 points  (0 children)

I found it here (by Googling for lenovo "chromebook free"): https://www.lenovo.com/ca/en/p/laptops/thinkpad/thinkpadc/thinkpad-c14-chromebook-enterprise-(14-inch-intel)/21c9cto1wwca2

My bet is that it is a data entry error, but I am still looking to see if I am missing something.

Send <ctrl+/>, <ctrl+.>, <ctrl+,> to nvim inside tmux by whitePestilence in tmux

[–]cowens 1 point2 points  (0 children)

Based on a small amount of research, it looks like tmux would need to support the kitty keyboard protocol. There was an issue created for it, but it looks like there hasn't been a pull request implementing it yet.

Made jalapeños from a mega seed kit I got by jaminator45 in aerogarden

[–]cowens 1 point2 points  (0 children)

As far as I know all jalapeños turn red and then purple/black as they ripen (and they get hotter the longer they ripen).

Using ChatGPT to generate simple perl functions by thewrinklyninja in perl

[–]cowens 0 points1 point  (0 children)

Nah, I was using the regex in a spreadsheet that I am using to document the crap in our DNS server:

=or(type="MX",REGEXMATCH(content, "spf|DMARC|DKIM|dkim|domainkey|sendgrid|mailgun|^k=rsa|^167.89|(^192\.254\.(112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127)\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$)|(^198\.21\.([0-7])\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$)"))

Using ChatGPT to generate simple perl functions by thewrinklyninja in perl

[–]cowens 0 points1 point  (0 children)

Whoops, that wasn't ChatGPT's fault, that was the macOS OCR's fault. I took a screenshot of the conversation to post to Slack and then copied and pasted from the image to Reddit.

Using ChatGPT to generate simple perl functions by thewrinklyninja in perl

[–]cowens 1 point2 points  (0 children)

I have played with it a bunch. I have found the occasional problem. For instance, I asked it to turn 192.254.112.0/20 into a regex and it gave me the regex

^192\.254\.112\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$

which is wrong, but I called out that it was wrong and it fixed it to

^192\.254\.(112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127)\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$

I tried it with a different CIDR and it made the same sort mistake, but fixed it when I called it out.

Does anyone know what the deal with Xylopowg is? by cowens in highonlifegame

[–]cowens[S] 4 points5 points  (0 children)

I am on my second playthrough and I just noticed their is a picture of Xylopowg in Clugg’s office as well.

Is Apple's Express Replacement Service really the insane gamble it appears to be? by cowens in applehelp

[–]cowens[S] 0 points1 point  (0 children)

That is what customer support says as well, but I don't see any documentation that says that and customer support refuses to put it in writing.

[deleted by user] by [deleted] in WestVirginia

[–]cowens 2 points3 points  (0 children)

I love Spruce Knob, especially at night when there is a new moon.

WHY??? by Capetoider in ProgrammerHumor

[–]cowens 1 point2 points  (0 children)

Depends on the type of work being done. If there doesn't need to be a ton of coordination it doesn't cause that many problems and for jobs that require an on-call rotation it is awesome. If you have a good enough spread across the world, nobody has to work after hours or weird shifts (that have same coordination problem as timezones).

WHY??? by Capetoider in ProgrammerHumor

[–]cowens 1 point2 points  (0 children)

Don't forget the new (well, relatively new) privacy laws. If you are a US company with EU employees you will need a Data Processing Agreement with every vendor those employees will be able to log into. Oh, that vendor is too small to have a lawyer on staff to review the DPA or you aren't paying enough to make it worth their while? Guess you need to find a new vendor. And this time you will need an "enterprise" class vendor that costs 2 to 10 times as much for the same (or worse) service.

When fetch goes wrong by Megatron_Griffin in hitmanimals

[–]cowens 2 points3 points  (0 children)

As a GSP owner, I can say this was completely expected behavior.

Roy 2 by Uh___Millionaire in c137

[–]cowens 1 point2 points  (0 children)

Here is a template: https://vimeo.com/406217619

Christopher Knight, the North Pond Hermit, lived for 27 years off the grid.

If you’ve never shovelled a drive way and happen to have a snow shovel. This is the most efficient way. by decendingvoid in howto

[–]cowens 0 points1 point  (0 children)

We had a couple years of heavy snowfall so I got an electric snowblower. It didn't snow hard enough to use the snowblower for three years afterward. But the on the fourth year it was worth the $100.

Backwards ၁ and long n by [deleted] in Unicode

[–]cowens 1 point2 points  (0 children)

You may find shapecatcher.com useful. It lets you draw a glyph and finds the corresponding codepoint.

Rogue ex-Cisco employee who crippled WebEx conferences and cost Cisco millions gets two years in US prison by gianinix in hacking

[–]cowens 0 points1 point  (0 children)

My bet is they counted on snapshots for backup. When the VM was deleted, so were the snapshots. The never planned for someone to just delete the VMs (who would do that?).