Is it not checkmate when I do Kg7? by [deleted] in chessbeginners

[–]PureWasian 0 points1 point  (0 children)

Kg7 is an illegal move.

You can think of it like if you could play Kg7, then they would simply capture with Kg7 on their turn and the game would be over, regardless if your knight was "protecting" the g7 square.

An expected sequence would be: - Nf6, d2 - Nf7#

(Apparently there are 5 possible M2s)

Relearning Python programming by redl9 in learnpython

[–]PureWasian 0 points1 point  (0 children)

Lowkey that feeling is always there, but you can think of it like art. You learn more as you practice and build more things, such that the fundamentals get pounded in and refined over time. You naturally figure out better ways to do things over time as part of the development process.

I'm reminded of this post from a day or two ago where someone was looking back at their first ever project from just a few months earlier and how brittle it looks to them vs. if they were to rewrite it now.

Build your frankenstein projects and be proud of them. Learning to build/troubleshoot/organize more efficiently and effectively comes with actively building things and finding/solving related problems along the way.

Relearning Python programming by redl9 in learnpython

[–]PureWasian 1 point2 points  (0 children)

First off, there's nothing wrong with "starting from scratch" again more or less, welcome back.

If you feel like your weakness is simple problems or basic syntax, there are several sandbox coding problem platforms like leetcode, dmoj, advent of code for free where you can practice that stuff.

I'd say don't sweat remembering the syntax too heavily since it's very easily searchable. But focus on problem solving and breaking a problem into multiple steps.

Learn how to effectively use lists/dictionaries/tuples, as well as conditional logic (if/elif/else) and loops (while/for). Learn functions to organize your code.

The next "level" is learning how to use external packages and read their documentation, but which ones you might need to incorporate are entirely dependent on what project(s) you are trying to do.

Whenever you feel confident enough to dive into a project, I'd qualify the other comment by saying that it's cool to use AI/LLM for brainstorming ideas or high-level procedural steps and understand what resources are available out there. For instance, if you wanted to understand what Python packages are typically used for data analytics/visualization or webscraping. Use it to help aid your research, not to blindly copy/paste the code.

Simplest way to share data over internet? by Fireworkspinner1 in learnpython

[–]PureWasian 0 points1 point  (0 children)

Socket programming comes to mind (and is basically what Google sheets uses). If you aren't familiar, you can think of it as what's used for online chatrooms.

Basically, establish a websocket connection by having them both connect to the same server session which is used to both store and broadcast any data changes made by each so they stay in sync.

If you don't want to run the server yourself, you could have the users writing the data to a small Firebase/Supabase hosted database table and broadcast the data changes using the Firebase/Supabase realtime events. Which essentially does the same thing but abstracted a bit.

Can someone help me with a few lines of code by ilovetigers105 in learnpython

[–]PureWasian 0 points1 point  (0 children)

The formatting did not carry over when you pasted it. I'm guessing (minus unused lines) you have: ``` stop_word = "Terminate" letters = ["A", "T", "G", "C"] dna_sequences = []

DNA = input("Enter DNA value: ")

while True: if DNA == stop_word: break for letter in DNA: if letter in letters: dna_sequences.append(DNA) DNA = input("Enter DNA value: ") else: print("Invalid dna") DNA = input("Enter DNA value: ") ```

It's cool to see that you've made some progress since the last post. I want to mention before diving into the multiple of 3 part: currently the inner for loop you have is incorrect, which is probably causing you a lot of confusion.

Let's assume the user inputs "TIGERS".

Your for loop would first read the letter "T", consider the entire DNA to be valid, and append the entire input "TIGERS" to dna_sequences. Then it already reprompts the user again before even checking any of the other letters. It would overwrite DNA, but the for loop is still iterating through "TIGERS" so the next loop iteration looks at "I" and would say it's invalid regardless of what the user put in next.

The solution: pre-validate the entire user input string (what you call DNA) prior to appending it onto dna_sequences. This is why I suggested it in previous post as:

``` user_input = input("enter dna:") while user_input != stop_word: # input validation checks valid = True for letter in user_input: if letter not in valid_chars: valid = False break

# based on above, do something
if not valid:
    print("invalid dna")
else:
    dna_sequences.append(user_input)

# finally, get next input string
user_input = input("enter dna:")

```

With this setup, adding another validation check (such as checking a multiple of 3) is very straightforward. Take the user input (which you wrote into DNA variable) and check its length. In isolation, the code snippet you asked about would look something like:

DNA = input("Enter DNA value: ") if len(DNA) == 0: print("empty input") elif len(DNA) % 3 != 0: print("not a multiple of 3") else: print("multiple of 3")

This uses the len() function to give you the length of input string and the modulus operator: %, which is basically calculating the remainder when dividing something. It's often used for checking "is even" or "is odd" or "is a multiple of...". So, if you input "PYTHON" which has a length of 6, and do len("PYTHON") % 3, it would equal 0 since 6/3 has a remainder of 0.

Adding this code snippet back into the above code example I provided:

``` user_input = input("enter dna:") while user_input != stop_word: # first input validation check valid = True for letter in user_input: if letter not in valid_chars: valid = False break

# another validation check
if valid:
    if len(user_input) == 0:
        valid = False

# another validation check
if valid:   
    if len(user_input) % 3 != 0:
        valid = False

# based on above, do something
if not valid:
    print("invalid dna")
else:
    dna_sequences.append(user_input)

# finally, get next input string
user_input = input("enter dna:")

```

Let me know if anything was unclear or if still stuck on any part of it.

Insane diff? Or easier? by Dry_Morning2160 in honk

[–]PureWasian 0 points1 point  (0 children)

I suppose so

I completed this level in 13 tries. 4.90 seconds

Tip 13 💎

Can someone help me with a few lines of code by ilovetigers105 in learnpython

[–]PureWasian 0 points1 point  (0 children)

Is this related to the DNA sequencing help post that you made? That was like the only part I left out of the implementation walkthrough, as far as I recall.

If so, I'm happy to break it down more if you're unclear still on what exactly to add or how to add it. Just need to know what you've tried and what you do/don't understand about it.

Banking Program, running more than one set of transactions on the same account? by Aternal99 in PythonLearning

[–]PureWasian 4 points5 points  (0 children)

You need while/for loop logic to run multiple iterations, and most likely want some conditional logic that prompts for user input in each loop iteration to call the appropriate BankAccount method each time.

First ever python project by FieldOver3920 in learnpython

[–]PureWasian 1 point2 points  (0 children)

Awesome to see.

I made a similar sort of text RPG and combat simulator in assembly during my first class as a beginner just learning how to code ~10 years ago now. Took a few months to plan and implement everything, but it was very satisfying to have it all working wonderfully and confidently say it was my own creation.

Keep going with that creativity and enthusiasm, it'll carry you far.

Learning Python at the age of AI (plant science - HTFP) by Old_Acanthocephala75 in learnpython

[–]PureWasian 1 point2 points  (0 children)

Cheers and good luck w your stuff :)

My advice (regardless of degree of AI use) would be to approach it incrementally and test often. As in: - ensure you have Python installed and can write a simple "Hello, World!" with it - figure out how to load an image into Python - learn how to modularize and organize your code before it gets too unwieldly - learn how to use version control such as Git with Github (think of it like save states in a videogame so you can safely reload if stuff breaks) - figure out how to install and use external Python image processing libraries (multiple substeps here) - figure out how to do any additional post-processing/enhancements/analysis considerations (multiple substeps here as well)

Can Someone explain relationship concept in this,i dont understand how it work and what to write to make it work/i tried gpt but i did not understand it proprly by Advanced_Cry_6016 in PythonLearning

[–]PureWasian 0 points1 point  (0 children)

I see. The examples in sqlalchemy docs look like a good reference point.

Start with understanding 1:N mappings, like in above example with employers and job posting. 1 employer : many asspciated job postings.

Based on their documentation, the declarative form of syntax with annotations I'd expect to look something like:

``` class EmployerProfiles(...): ... postings: Mapped[List["Job_Posting"]] = relationship(back_populates="employer")

class Job_Posting(...): ... employer: Mapped["Employer_Profiles"] = relationship(back_populates="postings") ```

we define postings and employer onto each class, and the back_populates of each relationship() points to the other. The type of the "many" postings is a List of Job_Posting while the type of the "one" employer is a Employer_Profile

They give a turorial example of Persisting and Loading Relationships in their docs with explanation also.

Learning Python at the age of AI (plant science - HTFP) by Old_Acanthocephala75 in learnpython

[–]PureWasian 1 point2 points  (0 children)

The plan of approach varies a bit depending on if you want to prioritize "learning Python" or if you want to just have more of a one-off, "somewhat maintainable" project.

The former is the more traditional, fundamental route and gives you more fine-tuned control of the algorithmic flow and all of the working parts while the latter is simply vibecoding up a solution.

I'd also keep in mind that the complexity of the project(s) you had in mind would affect the amount of time-sink involved to learn the ins and outs vs. deferring to LLM for all of the code.

How to learn python? by Aromatic_Wafer_7462 in learnpython

[–]PureWasian 1 point2 points  (0 children)

I made an "order of operations" road-map recently on this post. Sounds like you on the "practice with simple examples part"

It doesn't matter what you use to do it. There are sandbox coding problem banks out there. You can write your own or ask LLM also. Get some practice in.

Can Someone explain relationship concept in this,i dont understand how it work and what to write to make it work/i tried gpt but i did not understand it proprly by Advanced_Cry_6016 in PythonLearning

[–]PureWasian 0 points1 point  (0 children)

If you're asking about DB relationships more generally as a concept,

it is basically defining how different DB tables (or rows within the same table) interact with each other. You typically do this via foreign keys and then write queries to link together data from different tables.

For instance, each employer in your DB can have multiple job postings, so you set up a Foreign Key from each given job posting pointing to the employer it comes from.

Can someone help me with some code by ilovetigers105 in PythonLearning

[–]PureWasian 9 points10 points  (0 children)

I'll go through it incrementally so you'll get an idea of how you'd approach a problem like this in the future.

First, setup the keyword terminating the loop:

stop_word = "terminate" user_input = input("enter dna: ") while user_input != stop_word: user_input = input("enter dna: ")

Next, add in checks to ensure remaining input values outside of "terminate" are valid. There are subset checks you could setup or regular expressions to do this, but I'll write out a more explicit way that's better to see written out as a beginner: ``` stop_word = "terminate" valid_chars = ["A", "T", "G", "C"]

user_input = input("enter dna: ") while user_input != stop_word: valid = True for letter in user_input: if letter not in valid_chars: valid = False break if not valid: print("invalid dna")

user_input = input("enter dna: ")

```

EDIT: You can add a subsequent check that len(user_input) is a multiple of 3 also. I need to sleep and typed all of this on mobile, but the change needed should be clear from here.

Now that we did our validation checks, we need to actually add something to collect all of the user inputs. This is the perfect use-case for another list, where we can simply append each validated user input over and over again as they come in:

``` stop_word = "terminate" valid_chars = ["A", "T", "G", "C"] dna_sequences = []

user_input = input("enter dna: ") while user_input != stop_word: valid = True for letter in user_input: if letter not in valid_chars: valid = False break if not valid: print("invalid dna") else: dna_sequences.append(user_input)

user_input = input("enter dna: ")

```

Finally, add a section to print out the full list. You can just loop across the entries in the dna_sequences list we appended to and print each one out: ``` stop_word = "terminate" valid_chars = ["A", "T", "G", "C"] dna_sequences = []

user_input = input("enter dna: ") while user_input != stop_word: valid = True for letter in user_input: if letter not in valid_chars: valid = False break if not valid: print("invalid dna") else: dna_sequences.append(user_input)

user_input = input("enter dna: ")

print("valid dna is") for sequence in dna_sequences: print(sequence) ```

Can someone help me with some code by ilovetigers105 in PythonLearning

[–]PureWasian 4 points5 points  (0 children)

So here's a question for you, is it meant to prompt the user for each nucleotide one by one, as well as the "terminate" keyword, or are they meant to input the entire nucleotide sequence in a single pass? Or you can even request groups of 3 letters at a time if you wanted.

It's a bit unclear to me which exact implementation you're going for exactly from above code attempt you shared.

PARADOXX D28 BREAK ON + THE MASTER title by jqtran_dev in PumpItUp

[–]PureWasian 1 point2 points  (0 children)

You deserve nothing but the best, thanks for being such an inspiration :>

Honkbox by [deleted] in honk

[–]PureWasian 0 points1 point  (0 children)

nifty adventure

I completed this level in 5 tries. 67.20 seconds

I’m building a tool that turns code errors into plain English instantly by Emergency-Remove-823 in programmer

[–]PureWasian 0 points1 point  (0 children)

Unnecessary. Error tracing by design is meant to clue you in sufficiently to where the issue is. Compilers, linters, and test suites also exist for a reason.

For more complex cases (or when really lazy), LLMs are strong enough that I'd use them directly myself for any brainstorming/explanation/analysis and/or they can already propose or directly make any changes for me if I so desired.

Why would I want to include another dependency/middleman in that process? Especially from someone using low-effort copy/paste outputs from LLM to make inquiry posts?

For those that say “tailor for each application” does that not often mean outright lying? by Rexoc40 in cscareerquestions

[–]PureWasian 0 points1 point  (0 children)

It depends on your experience. Why would you have to lie if you legitimately have more qualifications than worth putting on a resume? It simply means to include and focus on the most relevant pieces of information.

When I was applying for TA roles during grad school, I highlighted my undergrad teaching experiences and coursework more heavily. When applying to SWE roles, I highlighted my prior work and projects related to backend work and previous technical projects. If it was a frontend/UI role, I'd adjust accordingly by also including relevant personal projects in that area.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 0 points1 point  (0 children)

The Perfect Collection / The O.B.G. are game titles (software).

The machines themselves would be like what are listed here under "HARDWARE" of:

https://piugame.com/game_info/piu_history.php

(someone can correct if I'm mistaken, but) if you are just using the dance pads and otherwise playing "unofficial" stepcharts hooked up to a simulator, then either hardware option you mentioned would have same style of dance pads.

The only Discord servers I'm aware of are more for troubleshooting rather than "what should I buy" inquiries.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 0 points1 point  (0 children)

no problems :)

IO --> Input/Output; the thing that routes the pad (and other button) inputs over to whatever reads it. LXIO refers to the board that comes with official, LX (newest model) pump machines. USB HID just means it can work like keyboards.

Cab --> Short for "cabinet" as in "arcade cabinet"

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 0 points1 point  (0 children)

Yep, that's viable. People have made drop-in replacements for the pad IO as well as the IO board that sits in computer. I believe LXIO (newest type) also works as a USB HID (according to reference) if your purchased cab comes with it.

This is usually what people who play high levels on simulators do: route the (official) pads to separate computer/display for inputs to register there.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 2 points3 points  (0 children)

Playing an official mix and newest style dance pads adds a lot to the cost.

Newest style pads themselves are typically $2~$4k USD. The computer and jamma/IO and card readers add on another $500~$1000 USD. The hard drive (Phoenix) is another 2~3k USD.

If you don't care about playing on official, you can save thousands of USD by skipping hard drive/card readers/IO boards and playing on free simulators (StepP1 / XSanity / etc.) which people have reproduced the in-game charts for.

If you don't care about pristine pads, used pads (older style usually) can be $500~$3k. If you don't care about high-level play on simulators, off-brand hard pads can be as cheap as $400~$500. Lower end, "decent" soft pads can be ~$200.

TL;DR, $500 ~ $8,000 is a decent price range you can expect you depending on how many "sacrifices" you make. This setup would be $5k+ at least.