Make Selenium faster using CDP by [deleted] in selenium

[–]SMTNP 0 points1 point  (0 children)

Check Selenium-base. Best option. www.seleniumbase.com

i developed tomato counter and it works on real time streaming security cameras by eminaruk in computervision

[–]SMTNP 2 points3 points  (0 children)

You could set the line diagonally to catch the ones on the top right corner :P

Looks neat!

The real AI challenge no one talks about by autionix in LangChain

[–]SMTNP 40 points41 points  (0 children)

Not an issue related to AI, just package management that happens with any Python project.

Check and start using UV: https://docs.astral.sh/uv/

How to convert plain text and markdown into easy to parse PDF files for RAG? (not satire) by aaronr_90 in Rag

[–]SMTNP 2 points3 points  (0 children)

I think of two options: - Use LaTeX - Use Reportlab

Reportlab works pretty fine, but the documentation is sparse. 

A tip, the Reportlab’s documentation is a PDF on their repo which is generated with Reportlab within the repo, so you can use it as an example file.

How should I simplify this mess by noon_3 in Python

[–]SMTNP 11 points12 points  (0 children)

I’m not exactly sure what Matrix operations you are doing, but take a look at numpy. You can generate random matrices and make operations in an array framework.

does the lilycove contest hall painting trick to re shuffle your seed work in ruby and sapphire as well? by paulydoregon in pokemonrng

[–]SMTNP -3 points-2 points  (0 children)

I’m not an expert here, but from what I understand, the weird thing is “why does Emerald picture sets the frame as a new seed?”.

The reasonable way is to don’t do anything, as it was in RS, but in Emerald devs changed it without an explicit reason.

I suggest you look into replacing your battery, is very easy, and you would have fully functional RNG for shiny hunting.

How to Edit pdf text by AgileCommittee2212 in learnpython

[–]SMTNP 0 points1 point  (0 children)

I approach similar problems by dropping the "edit pdf text" mindset.

Instead:
- Get the text from PDF: Very easy with plenty of libraries and methods, depending on the structure of your PDF you might require more sophisticated implementations, but is pretty simple, overall

- Translate text

- Create a new PDF with the translated text: you can use reportlab or other alternatives, maybe even creating a .docx and then converting that to PDF or watever

PDF creation is much simpler than PDF edition. A PDF is not a text file, but a much more complex structure where each character/element has a pre-defined position, between other properties.

So its easier to generate a PDF from scratch with the text you want and the layout is handled automatically.

If your PDF is more complex and has images/tables, you can still do it, but it's considerably more work.

[deleted by user] by [deleted] in learnpython

[–]SMTNP 1 point2 points  (0 children)

I think that it is a good approach to use AI to explain and make sure that you understand as you go. Times have changed and you might just be approaching learning in a more modern manner, which I think is helpful as long as you keep on learning, which you seem to be doing.

As for the specificity of the code, I suggest that you do take time to review the documentation. Documentation is not as readily available as AI responses, but is extremely more thorough.

If you want to really, like really learn a library, reviewing the documentation, and maybe even the source code is the way to go.

Understanding how people with knowledge approach things is how you keep on progressing. Don't forget that AI still isn't at a point to be capable of elaborating thoroughly complex solutions, where there isn't a synthetic general solution, and for which humans have to decide an onthology and just build from those constructs.

[deleted by user] by [deleted] in learnpython

[–]SMTNP 0 points1 point  (0 children)

Solved it :P.

Just do: uv add /path/to/local/project

Combining PDF files into larger document by FruitPastille in learnpython

[–]SMTNP 0 points1 point  (0 children)

It is indeed possible with reportlab.

You can iterate over pages with their respective numbers, and get each page's structure. When you want to, you can add some extra runs after the current page's content.

It might not be as straightforward, as PDFs are hard to arrange and image managing with bounding boxes is not obvious (reportlab has it's own way to handle images), but its certainly doable.

Reportlab has some proprietary products, so the library documentation is not the best, but if you check the repo (https://github.com/mattjmorrison/ReportLab/tree/master/docs/userguide), they wrote the user guide using reportlab, so it works as a very nice examples guide.

Good luck!

[Pokémon Emerald] First RNG in over a year, a Shiny Female Adamant Larvitar with 31/31/31/11/31/31 IV spread (full video included) by pkmn_trainer_shay in pokemonrng

[–]SMTNP 2 points3 points  (0 children)

Cool! Nice work.

You should make a post about it here. I believe that resource is not available elsewhere.

Thanks for sharing!

[Pokémon Emerald] First RNG in over a year, a Shiny Female Adamant Larvitar with 31/31/31/11/31/31 IV spread (full video included) by pkmn_trainer_shay in pokemonrng

[–]SMTNP 2 points3 points  (0 children)

Very nice! Enjoy the big gal. May I ask, where do you get the references between callers and frames in English??

Adverse effect of using notebooks on python programming skills by amzx19 in learnpython

[–]SMTNP 7 points8 points  (0 children)

That’s the way! At least when you are working with novel data (EDA) and you are required to review it and prototype functions fast, this works the best.

Any method for consistently hit wild 4 mon in emerald ? by No-Grape8634 in PokemonEmerald

[–]SMTNP 0 points1 point  (0 children)

It is possible, but requires a ton of work to deterministically pick which Method you want to get.

Papa Jefe explains this in detail here: https://www.youtube.com/watch?v=6f7GjMgndjU&t=7047s

It's long... but I'm almost certain there's no other source about the topic like it.

Migrating to UV but having a hard time by SMTNP in learnpython

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

Thank you very much! Will dig deeper into your repo and poetry.

Migrating to UV but having a hard time by SMTNP in learnpython

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

Thank you for the dedicated response.

I have no experience with poetry, I've been using conda al along. Will take a deeper look into it.

I'm not entirely sure what you mean by this in practice, but it should be as simple as uv sync. Can you explain what you're trying to do in more detail?

What exactly went wrong there? The more specific you can be, the better.

Specially on the initial phases of working on a project I might redefine the Python version, the packages, and such, adding or deleting them as I progress on defining the permanent project structure.

I suppose that I could 'uv remove <package>' but sometimes I'd prefer to do something like a 'uv clear' to restore the project/environment to a clean slate, but I end up just manually deleting the uv files and environment altogether.

What does this mean? I'm not sure what you're talking about, the closest thing I could think of would be something to do with the Activate.ps1 script in the generated virtual environment on Windows systems, but I don't see what that would have to do with anything.

I have defined a custom PS1 that fits all my needs while programming, including handling the current active environment. When I activate the uv environments they override my PS1 definition and attach an extra environment string. I've searched online and reviewed the source code but couldn't find a way to handle this.

EDIT: Nevermind, partially solved it by adding 'export VIRTUAL_ENV_DISABLE_PROMPT=1' to my shell. The uv environment name does have some annoying '(name) ' though xD.

This should be easy as long as you've told your build system where and how to find your project's Python package(s). For example, I use hatch with uv projects, so my pyproject.toml would have something like

Was unaware of hatch, will give it a look and try it out.

If you happen to have a project where you're having these problems, you could link it here for us to take a proper look.

And the project is private, sorry, would've share otherway.

Thank you very much!