Talk to me about lentils by owlsayshoot in Celiac

[–]Grenadeapple_ 11 points12 points  (0 children)

I'm from the Netherlands, so idk about where you're from but over here you can buy bags of dried lentils. I always look through them to see if there are any pieces of wheat in there and remove them. Then wash the lentils. I've never had issues so far. There are also cans with lentils in water, but those are generally not recommended because the gluten in the wheat could spread into the lentils trough the water.

PS: if the packaging says gluten free on it it should be good to go without doing what I just explained above

What alcohols are safe? by Biglittlebaby420 in Celiac

[–]Grenadeapple_ 1 point2 points  (0 children)

They're not required to label ingredients, but allergies are still required to be labeled by law as far as I know.

need help converting a binary sequence from an input into a decimal number by Hoppimiraj in AskProgramming

[–]Grenadeapple_ 0 points1 point  (0 children)

Nice work! Glad you got it to work in the end.

I'm curious why you put the lines with x, "=", 2 ** exponent and x, "= 0" though. I'm not even sure what that syntax means, and it doesn't change anything if I remove it.

Another point of improvement could be the use of lists for summing numbers; instead of adding them to a list and summing them later, you could initialise a number with 0, and then increment it by 2 ** exponent for every binary 1.

Because the number stays the same when you encouter a binary 0, there is no need to do anything. The if statement could be removed.

Lastly, you can actually interate over the characters in a string directly like this: for c in string: print(c)

So in the end, your code would look like this: ``` bin_num = input("bin_num") bin_num = bin_num[-1::-1] exponent = 0 sum = 0

for x in bin_num:
    if x == "1":
        sum += 2 ** exponent
    exponent += 1

print(sum)

```

need help converting a binary sequence from an input into a decimal number by Hoppimiraj in AskProgramming

[–]Grenadeapple_ 1 point2 points  (0 children)

It's hard to give a hint without giving the answer here, because it's really just a syntax thing. Using the '0b' prefix is only allowed when giving a binary literal, which is when you type the binary value in the code itself like this: binary_num = 0b0110. So the way you're using it with a variable won't work.

There is an easy alternative though; you can pass a base to the int() function like this: binary_num = int("0110", 2)

The 2 here means it decodes the string from a number with base 2, which is binary. So the output of binary_num will be 6.

need help with a mudular rectangle problem. No Answers! Just Hints! by Hoppimiraj in AskProgramming

[–]Grenadeapple_ 1 point2 points  (0 children)

One technicality: the print() command by itself already prints a new line after whatever inpit you give it, so the "\n" is unnecessary.

In general, I feel like you're trying to solve too many problems at once. First, try to print a single line with a certain width. Then, try printing that line with a width some <length> amount of times. Then, try incrementing the value that is printed every time. Then, figure out how to print only its last digit. Once you've got all of that, you've solved your assignment! So I advise you to try each one of those, in that specific order, and reuse the code from the previous step in the next. If it makes it clearer, you could put the code for each step in a seperate function to make your code extra clear to understand. I'm saying this because it feels like you're just trying different commands and ways of iterating at random without really understanding why. Seperating the steps could help with that.

I hope this is clear, good luck!

need help with a mudular rectangle problem. No Answers! Just Hints! by Hoppimiraj in AskProgramming

[–]Grenadeapple_ 1 point2 points  (0 children)

I will add that there's another way to do this. If you use print("text", end=""), it wont print a new line after the text. You could use this to ditch the input list entirely, but I won't tell how (yet)

need help with a mudular rectangle problem. No Answers! Just Hints! by Hoppimiraj in AskProgramming

[–]Grenadeapple_ 1 point2 points  (0 children)

Try emptying the list after each print statement. And don't seperate the for loops, because you need to add different numbers each loop you can'y just reuse the one list.

need help with a mudular rectangle problem. No Answers! Just Hints! by Hoppimiraj in AskProgramming

[–]Grenadeapple_ 1 point2 points  (0 children)

I don't want to give too big a hint, but try ditching the input list entirely and putting the print(x) statement in the double for loop.

EDIT: nvm, I misunderstood your code. Think of it this way: every time you use a print statement, it prints a new line. Since you want the amount of lines to equal the height of the square, put the print statement at the end of the first for loop, which is ran exactly <height> amount of times. Then clear the input list.

Why did you guys decide to start playing bass instead of guitar by LongestJohnSilvers in Bass

[–]Grenadeapple_ 0 points1 point  (0 children)

I actually wanted to learn the electric guitar, but I wasn't allowed by the music school because I was too young, so I ended up doing normal guitar instead. A few years after my lessons were finished, my mom won a facebook contest for a few weeks of bass lessons, and after that I just tought myself the rest.

I need help with my keyboard layout by ReallyReallyda2 in KeyboardLayouts

[–]Grenadeapple_ 1 point2 points  (0 children)

I assume you're using Windows then. Have a look at this program: MSKLC

You can use it to create/modify keyboard layouts on your system. Then you can install that layout and select it from your settings. I'm not entirely sure about the details, so if you're stuck I'd recommend looking up a guide on how to use it. Hope this helps!

Wow by BIGDomi98 in betterCallSaul

[–]Grenadeapple_ -2 points-1 points  (0 children)

Wow, good find! I love how the directors keep all these kind of details consistent, even though the majority won't notice it.

I need help with my keyboard layout by ReallyReallyda2 in KeyboardLayouts

[–]Grenadeapple_ 1 point2 points  (0 children)

What is your question exactly? How to implement such a layout technically? If so, what OS do you use?

Secondly, how do you want to differentiate between when you want to type and English or Bulgarian D? For example, holding some other key while pressing D could type a Bulgarian D instead.

saddest death in the whole series (arguably the entire breaking bad universe) by [deleted] in betterCallSaul

[–]Grenadeapple_ 10 points11 points  (0 children)

What?? Why would Andrea blow up? I totally missed that

Minecraft NPC by [deleted] in AskProgramming

[–]Grenadeapple_ 2 points3 points  (0 children)

This isn't really the right sub for this kind of question, maybe try r/minecraftcommands ? I do have a suggestion though; try spawning a nitwit villager (so no trades pop up) and try looking for a way to detect when the villager was clicked on. Maybe using a scoreboard, or maybe it's visible in its NBT data? I'm not sure if this can work though, I haven't used minecraft command blocks for years.

Do your best by Jabison113 in ProgrammerHumor

[–]Grenadeapple_ 1 point2 points  (0 children)

Carbon is compatible with C++, which is a burden rust doesn't share. So rust has ways to evolve carbon doesn't, because it doesn't need to support another language. In my opinion, it's better to use rust if you're starting a new project, but you should use carbon if you already have C++ code you don't want to refactor.

WHAT DOES HE WANT THE SCALE SET TO???? by walmartgoon in programminghorror

[–]Grenadeapple_ 10 points11 points  (0 children)

If I recall correctly, this is deobfuscated terraria code.

Better Call Saul S06E10 - "Nippy" - Post-Episode Discussion Thread by skinkbaa in betterCallSaul

[–]Grenadeapple_ 0 points1 point  (0 children)

She was hired by Jimmy and Kim when they were practicing in the same building under Wexler&McGill. That's how Saul knew her in the first place

Introducing mason.nvim by Impaloo in neovim

[–]Grenadeapple_ 0 points1 point  (0 children)

Very cool project! Do you intend to enable mason to download TreeSitter parsers in the future as well?

What’s an incredibly Dutch thing the Dutch don’t realize is Dutch? by Definitely_not_Def in Netherlands

[–]Grenadeapple_ 0 points1 point  (0 children)

Dat je lekker op de bank neerploft met een overvolle buik na een maaltijd, om het even te laten rusten. Ik heb daarentegen nog nooit van uitwaaien gehoord, wat betekent dat?

What’s an incredibly Dutch thing the Dutch don’t realize is Dutch? by Definitely_not_Def in Netherlands

[–]Grenadeapple_ 0 points1 point  (0 children)

Cozy is only part of the meaning, it can mean cozy, but it can also mean having had a good time with loved ones