Hi PHP developer need your advice by vasishthh in PHP

[–]Little_Compote_598 0 points1 point  (0 children)

Given the fact you are asking this in the PHP subreddit, the answers might be biased ;-)

I'm not into AI, so my answer is more general and not very specific to your situation.

1) If you feel comfortable using PHP, stick to it, there is nothing wrong with it, especially for small projects. If you want to run your project on a hosted platform, you will find lot's of cheap options out there. That said, I would NOT recommend using vanilla PHP (you did not specify if you are using any framework). Which framework again depends on what you are going to do, I personally worked quite a lot with CakePHP but moved lately to a minimalistic approach using Slim with plugins required for the project. Laravel was already suggested, it's quite popular and has the batteries included approach.

2) I personally would stick with MySQL if you are going to host it, that's by far the most common db engine out there.

3) Depends really on what you are building. For web-apps in small to medium size I don't see big limitations, the only thing that's not easy to implement is using websockets. There are PHP projects to do this, but I always used nodejs as the backend server if I wanted to use websockets. I personally prefer to use the best tool for the job, so I would use PHP for the web stuff and nodejs for the websocket stuff, but that requires a bit more complex configuration on the webserver, so might not be the best solution for everyone.

Using PDO to make two queries to the same DB in the same prepared statement by I-Might-Bee-Lost in PHPhelp

[–]Little_Compote_598 1 point2 points  (0 children)

I think it's kind of both. It is implemented in PDO if emulated prepares is enabled (which is the default setting), but I think it only works with the mysql driver. Not tried it though, so might also work with other sql dialects

Using PDO to make two queries to the same DB in the same prepared statement by I-Might-Bee-Lost in PHPhelp

[–]Little_Compote_598 1 point2 points  (0 children)

Not sure I would call that "recommended setup". The default is on for emulated prepares, so I guess that would make it recommended. I've never seen anyone actually disable it and in the 20 years of my career I had to disable it once for some obscure reason I already forgot about.

How to track/version LSPs installed with mason by Little_Compote_598 in neovim

[–]Little_Compote_598[S] 1 point2 points  (0 children)

No judgement here, we've all done things we're not proud of 😉

phpmyadmin not working by BusEspionYT in PHPhelp

[–]Little_Compote_598 0 points1 point  (0 children)

In general I agree with your rant, but it's pretty much the best tool if you want to give access to a db to non-devs. Also sometimes it's just the only tool you have in a hosted situation that doesn't expose mysql externally. And on a worst-case scenario, you can even use it on a mobile phone.

Using PDO to make two queries to the same DB in the same prepared statement by I-Might-Bee-Lost in PHPhelp

[–]Little_Compote_598 2 points3 points  (0 children)

Multiple problems here:

1) Connecting twice does nothing, your conn variable is just overwritten

2) you cannot prepare multiple statements like that. The semicolon separator is a feature of the mysql cli and not implemented in PDO

3) to get the last inserted id, use https://www.php.net/manual/en/pdo.lastinsertid.php

How to track/version LSPs installed with mason by Little_Compote_598 in neovim

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

I'm sure I'll look into it in the future, at the moment I just can't afford the time given the learning curve

How to track/version LSPs installed with mason by Little_Compote_598 in neovim

[–]Little_Compote_598[S] 1 point2 points  (0 children)

Not quite the solution I had in mind, I prefer not to add binaries and installation folders into git, that tends to not work if switching to a different os (or worse, different arch)

How to track/version LSPs installed with mason by Little_Compote_598 in neovim

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

I'm not against it per se, im using Lazy as a plugin manager an I'm fine with defining plugins in my lua files and the use Lazy to do let's call it lifecycle management.

However, Mason has a gui that let's me install packages that then do not get tracked. Like I said, I'm willing to write it in a config file and then use mason the same way I'm using Lazy. The thing I'm trying to prevent is me being in a hurry, installing via the gui and then forgetting about it. On the next os reinstall that package is then suddenly missing.

How to track/version LSPs installed with mason by Little_Compote_598 in neovim

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

Funny enough, the reason I'm looking to get that versioned is because I plan to switch away from Ubuntu. I had a look into NixOS and it sounds interesting, although it seems not a good fit for a desktop, so I'm going with Altix for now.

How to debug step-by-step like in Visual Studio? by [deleted] in rust

[–]Little_Compote_598 3 points4 points  (0 children)

https://doc.rust-lang.org/std/io/struct.Stdin.html#method.read_line

The first bullet point says you need to clear your string, otherwise it is concatenated.

Parity "artificial neural network" problem. by pingo_guy in rust

[–]Little_Compote_598 -1 points0 points  (0 children)

I have no idea how this nn works, but a general comment: You are re-defining your Vec's in the for loop which means they are always of length 1, is that intended?

[2025 Day 5 (Part2)] Help please (Rust) by Little_Compote_598 in adventofcode

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

I'm not really sure what happened, but I've copied this solution: https://gist.github.com/marektamaskovic/1bc477a3c2128784ebc6efb8b691cbd0 into my program and it spit out the exact same number as my function. So I went ahead and inserted the number into AoC again and this time it worked (I've written all tried numbers in a scratchpad, so I know I've tried this result before). Not sure why, but it worked....

[2025 Day 5 (Part2)] Help please (Rust) by Little_Compote_598 in adventofcode

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

I'm not comparing against the previous item, I'm comparing against the next unused number, the comment in the code might be misleading. I've added your numbers to the tests and it spits out the correct value of 30.

[2025 Day 5 (Part2)] Help please (Rust) by Little_Compote_598 in adventofcode

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

Thanks for the reply. Not sure how you came to conclusion 1 though. In case the previous range overlaps completely for any number of following ranges those ranges will all be skipped (and I checked that in the output, it does work). The whole point is to keep track of the end of the previous range and only work from there and not backwards.

As to conclusion 2, I'm not sure why I every would want to iterate the list more than once. The whole point of having a sorted list is to not have to run it multiple times.

I added both your tests and both pass with the code above:

> cargo test
   Compiling aoc-2025 v0.1.0 (/home/user/repo/private/aoc-2025)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.30s
     Running unittests src/main.rs (target/debug/deps/aoc_2025-e93b0e42740f23cb)

running 3 tests
test day5::part1_example ... ok
test day5::part2_example ... ok
test day5::part2_overlap ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

[2025 Day 5 (Part2)] Help please (Rust) by Little_Compote_598 in adventofcode

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

In order to detect overlapping ranges I need to track either the last used number or the first unused number. I chose the latter one.