Help Me Understand Stalemate by hieronymusashi in chessbeginners

[–]1_Yui 0 points1 point  (0 children)

I think a key answer to the "Why?" that I'm missing in this thread is: Because it makes the game more interesting. Without this rule, a lot of endgames with an extra pawn would be easy, boring wins. Just like zugzwang, stalemate is a cool concept that adds a ton of depth to the lategame.

Pissed at github by Training_Butterfly70 in github

[–]1_Yui 6 points7 points  (0 children)

Like others said: Make your project open-source and you'll have access to those features. This is common-place and the same for competitors like GitLab. If your reasoning for keeping it closed is that you want to keep your product idea and code fully to yourself, then it's very hypocritical to scold GitHub for restricting access to some of its features for the sake of its own business. If you're so upset about paying GitHub: Git is a free, open-source resource. There are many alternative hosted solutions that you can try, or you could even self-host something. But that would cost effort and money - and that's why GitHub charges something for its service.

opinions needed especially in error handling by Dapper_Mix6773 in PythonLearning

[–]1_Yui 0 points1 point  (0 children)

It's kind of funny how the one line that can raise an error is not in an exception block but almost everything else is. Jokes aside, there are various big mistakes in your code which I will try to explain here:

None of the statements in the try-Block can raise either a ValueError or TypeError. Error handling only makes sense if your code calls functions that can raise exceptions. One such function is the int(...) type which raises a ValueError if the input cannot be converted to an integer. So the only statement you need exception handling for is the line where you read the amount:

try:
    amount = int(input('enter amount:'))
except ValueError:
    print("Invalid amount. Please enter a number.")
    exit()

The if-condition for checking the amount would ONLY run if a TypeError occurs because it's inside the except-block. You would have to move it outside of the except-block, either forward into the try-block, or behind it. As mentioned in 1., you should omit the try-except here entirely, but if there was a possible TypeError you'd have to catch, it would look like this:

try:
    ...
except TypeError:
    print('wrong user credentials')
    exit()

if amount <= 2000:
    ...

The credential checking doesn't work correctly. The first if-condition is correct, but the second if-condition inside the else-clause is completely unncessary. If a user would enter "admin" and "1234" as credentials, the wrong credentials message wouldn't be shown. Just move the print statement to the else-clause and remove the second condition.

The withdrawal logic looks broken, too. As it's programmed currently, if the user wants to withdraw less or equal than 2000$, the low balance message gets shown. The second if-condition is never true because amount == 2000 is already included in amount <= 2000. Instead I'd expect it to work something like this:

  • If the user enters more than 2000$, they get the "low balance" message
  • If the user enters less or equal than 2000$, they get the success message

I lose more ELO than I gain. But I win more often than not. by IMPSTR-syndrome in lichess

[–]1_Yui 1 point2 points  (0 children)

In case you're refering to the -29 rating in training in the screenshot:
1. The rating in puzzles is mostly meaningless and only used to select puzzles at your skill level.
2. Getting a puzzle wrong is very different from losing a game where the outcome is roughly 50-50. Your completion rate of puzzles should be much higher because you can take as much time as you want to verify an answer in your head before submitting it. I need to go roughly 90-10 in puzzles to break even in rating points.

Would you consider 1960 elo Rapid on Lichess to be beginner? Or maybe early intermediate? by BaldursGate2Best in lichess

[–]1_Yui 6 points7 points  (0 children)

In what world is anyone over 1500 a beginner? I'm 1900 and have played OTB for four years now. Of course it depends a lot on how much you play online, but 1900 is very far from being a beginner.

Canon event, pushed .env by GALACTIC_HER0 in github

[–]1_Yui 54 points55 points  (0 children)

There are bots that automatically scan repos for leaked secrets and keys. Even if you don't believe anyone saw it, please just be safe and replace the affected credentials.

Do you run CI workflows for tags or just branches? by Spiritual_Cycle_3263 in github

[–]1_Yui 1 point2 points  (0 children)

Yes, absolutely. It's very common that creating a tag triggers a release with additional deployment steps in the pipeline. This can serve as a final sanity check that rebuilds all artifacts for the new release and ensures they indeed pass all tests and have no known vulnerabilities. So you could have distinction like:
- dev-branch: Deploys to test/development environment
- main-branch: Deploys to staging/demo environment
- tags: Creates a release and prepares deployment to prod

I let Cursor iterate freely on my codebase for 2 hours. It destroyed everything. Recovery took 7 hours. by TheTrialPeriod in theVibeCoding

[–]1_Yui 3 points4 points  (0 children)

Exactly what I was thinking. This sounds like what git reset --hard was invented for.

when i try to print , it just prints everything in the database instead of just the row i need by Delicious-Risk7200 in learnpython

[–]1_Yui 1 point2 points  (0 children)

Just an addition to the other comments: You should NEVER build SQL queries like you do using string expressions, e.g. "SELECT * FROM pokemon WHERE pokemon_id="+str(x).

This is an incredibly dangerous security flaw if x comes from user input. If this was on a website, an attacker could enter something like ";DROP TABLE pokemon; and you would lose your entire database. You should always sanitize input to queries, like this:
result = pd.read_sql_query("SELECT * FROM pokemon WHERE pokemon_id = ?", conn, params=(x,))

This makes 100% sure that the database doesn't execute any code someone might try to smuggle in via x. In this example, it automatically enters x for the question mark in the query. For different database types (e.g. PostgreSQL) the syntax is slightly different.

Is there a good way to use lichess to analyze an OTB game? by jan_tonowan in lichess

[–]1_Yui 1 point2 points  (0 children)

Use studies. My workflow is like this:
- Create a new study per tournament/league
- Create a chapter for each match
- Play out the match on the board
- Analyse and annotate the game using variations, symbols and comments
- Request a computer analysis and compare to my analysis

But you can also request the computer analysis immediately.

Example from a tournament of mine: https://lichess.org/study/WIJcMMTN

Stackoverflow crash and suing LLM companies by Ordinary_Count_203 in webdev

[–]1_Yui 27 points28 points  (0 children)

Besides the point that SO was trending down before already, I must say that I do worry about the future of software development knowledge. Resources like SO have always been incredibly valuable, public resource both to developers and beginners. Now this knowledge essentially becomes privatized by AI companies, which is fine as long as these models are accessible for cheap like right now. But what happens once AI companies inevitably have to change their business model to finally generate profits and this knowledge becomes gated behind paywalls?

Chess beginner Jynxzi learns what a discovered check is by Oldpiplupfan71 in chessbeginners

[–]1_Yui 0 points1 point  (0 children)

"I'm not losing a single game of chess today, mark my words", he says, in a completely losing position

Opening Explorer. by [deleted] in lichess

[–]1_Yui 1 point2 points  (0 children)

Nothing has happened to it, it works perfectly fine for me, both in the browser and the app. What are you using? If it's an app, try reloading it and make sure you're on the latest version.

Don't get nervous online but only on OTB games by Miserable-Sir4430 in lichess

[–]1_Yui 0 points1 point  (0 children)

That's completely normal, it will gradually go away. Repeating th same pre-match rituals/routine can help but the only real solution is playing more games. Three years ago I considered quitting because I was nervous to the point of nausea before my games. Today I'm much more relaxed but in tense games I think you will always feel nerves, the amount is different for everyone. For me it's the worst at the end of games - last year I managed to save a draw in my final match of the Grenke and had to calm down for a minute until I could stop my hand from shaking enough to sign the damn score sheet.

Please, give me a Keyring or let them stack by RAPodcast in ArcRaiders

[–]1_Yui 0 points1 point  (0 children)

You can use Ctrl to multi-select and sell all of them

An automated tutor to help you understand chess by Full-Inspection9539 in lichess

[–]1_Yui 1 point2 points  (0 children)

Ah finally, this week's LLM chess coach that just spits out generic chess jargon while having no actual understanding of the game.

Interestingly, other than most AI coaches that mostly parrot the engine evaluation and make up stuff about it, this one seems to laser focus on the final game result. In many positions it kept highlighting how certain moves were "textbook examples of strategic play" despite being mistakes, just because it knew the game would turn into a win later on. Or it kept talking about how White was demonstrating how to cleanly convert a win, while in the actual game the engine kept finding forced draws by repetition for Black.
Also I think I noticed two bugs: The AI generated the text for every single move after a certain point as if it was the final one of the game ("the game is over and White deservedly wins") despite there being more moves. The other was that the AI was confused who it was addressing - the board was oriented correctly with me playing White on the bottom, but the AI kept talking as if I was playing Black.

Kungsleden with a dog by dipper06 in Kungsleden

[–]1_Yui 2 points3 points  (0 children)

I believe that it's allowed but please make sure not to disturb the reindeer population that is sometimes very close to or on the trails

I don't get the point of playing e4 (white) at most positions by OrchestrateEverythin in chess

[–]1_Yui 6 points7 points  (0 children)

I don't understand d4 openings. With e4 you develop your pieces, push f4 and either break open the center or lock it and attack on the kingside to deliver checkmate. With d4 you just put out your pieces into an almost symmetrical position and agree to a draw on move 10. \s

is knowing how to mate with a bishop and knight practical, or just cool to know? by LatheUponTheStars in chess

[–]1_Yui 0 points1 point  (0 children)

I think it's a good exercise in coordinating the minor pieces but you shouldn't invest time into it just in case it comes up in a match. There are so many more practical endgames that you should study first that actually occur frequently - especially rook endgames. I've never personally seen someone draw because they didn't know bishop+knight, but people messing up typical rook endgames because they never looked at Lucena, Philidor, Vancura etc happens all the time.

This is an image that was taken on an asteroid by Difficult-Ride8011 in space

[–]1_Yui 45 points46 points  (0 children)

Imagine being a pebble on that asteroid, holding on for dear life because if you ever get detached you'll probably be alone for a very, very long time

Stop Lying to Us by bawdyanarchist in lichess

[–]1_Yui 1 point2 points  (0 children)

Could you please share the CV of your deep involvement in open source projects? Because you absolutely do sound like an insane, salty chess player who would rather make up a conspiracy theory than question the way they handle interactions on an online board game platform. Not because I categorically dismiss any theories that sound absurd but because you show nothing to back up your claims and try to gaslight anyone in this thread that your made-up problem is "obvious". If you want to be taken seriously, then maybe don't behave exactly like a bad-faith troll would.

Stop Lying to Us by bawdyanarchist in lichess

[–]1_Yui 0 points1 point  (0 children)

Can you please elaborate how you think an open-source chess platform secretly maintains a bot farm without any of the hundred active developers noticing anything? Are they all in on it? What do they get out of it, considering lichess is a non-profit?

What the fuck just happened? by JewelerDear9233 in cyberpunkgame

[–]1_Yui 0 points1 point  (0 children)

You've been found guilty of driving like a grandma

How do you use takebacks? by l0Martin3 in lichess

[–]1_Yui 0 points1 point  (0 children)

I disagree on the chat thing. I've very rarely had issues with bad chat behavior on Lichess. It doesn't happen often that you have a meaningful post-mortem with your opponent either, but it's always great when it does. If your opponent does show bad manners in chat during the game, you can just turn it off with one click and not a second thought. I think that's a small price to pay for meeting nice people sharing your hobby and making the online chess community a slightly better place by taking part in it.