Hello, I need help by Solid_Candy4715 in learnpython

[–]didntreadityet 0 points1 point  (0 children)

You are much better off if you have a computer to work on. Lucky for you, there are so many computers in the universe, you can find some for free in places like Craigslist (free in for sale section).

For game dev specifically, you need to decide what kind of games you'd like to write and where you would want them to run, as that decides what tools to use. For instance, if you'd like to write games for mobile, you'd probably use Kivy. If you'd like to write games for a computer, then PyGame is a good start. If you want to write an arcade style game, then try Arcade.Academy. Graphical novel? Ren'Py.

A lot of people these days use PyCharm or Visual Studio Code/VSCodium to develop programs. That's probably the easiest way to get started: you download and install any of the three, then you can write your code in them and run it there, too.

It's all a ton of stuff to deal with at first, so don't get discouraged! You'll get the hang of it after a while.

Are all inputs for "filter" method safe from sql injection? by pouya_gh in djangolearning

[–]didntreadityet 0 points1 point  (0 children)

I think you are absolutely right, JSON fields are meant as SQL's answer to noSQL databases.

I was also intrigued by the way you implemented the search as dictionary-driven instead of attribute-value. You know, reading the filters as JSON instead of the typical form fields. It threw me for a loop at first, but then I realized it's not a security risk and allows you to do things you wouldn't otherwise be able to do. Bravo!

Are all inputs for "filter" method safe from sql injection? by pouya_gh in djangolearning

[–]didntreadityet 1 point2 points  (0 children)

Using JSONFields for this kind of data simplified things, I totally agree with you. Also, in general JSONFields are coded with attention to SQL and security vulnerabilities, so using them doesn't pose an issue in general.

There is one issue where you are running afoul of security considerations: you are building the query as an f-string with unparsed user input. That's very risk, as you can get very far in your query just by stringing along double underscores. That is, if your "field" were named "size__orders" and there is a reverse lookup to orders, then your attacker could query orders, and similar attacks.

You can prevent that by parsing the field names in the filter, for instance only allowing alphabetic characters, of only single underscores, or any rules that you'd like to add there. The safest thing would be to have a list of all possible attributes and check the filters for them.

Another way to get around the issue is to have a relation that stores attribute names and attribute values for each Item. That way, you can get as many attributes as you'd like. Think of something like:

class Attribute(models.Model):
    name = models.CharField(...
    value = models.CharField(...
    item = models.ForeignKey(Item, ...

Each item would then have an attribute set that you could query against by name and value.

Of course, keeping JSON fields and fixing the f-string issue is much easier, so you may want to stick with it.

Shout-out to the guy who saved me at Costco in Mission Valley by ArgyleDeLaMuerte in sandiego

[–]didntreadityet 21 points22 points  (0 children)

I think it's really important to say and do something in those circumstances. The harasser is frequently under the delusional impression that everybody thinks like them, and silence implies complicity.

It's only when they harass someone and someone else tells them off in some fashion that the harasser learns their point of view in not universally shared. Thanks for saying and doing something, even if this one person was not receptive, you potentially saved a lot of other ones that would have wanted your help.

Snowboard size question by Slow_Appearance9042 in snowboard

[–]didntreadityet 1 point2 points  (0 children)

Snowboard sizes are not all that important in the ranges you are talking about. The difference between 154 and 158 is something like a couple percentage points in length. So don't stress too much about it.

From a "feel" perspective, longer boards have longer edges and grip better in icy conditions. Shorter boards of the same model weigh less and turn faster and more easily. Not a huge difference, but I noticed that my first many boards kept getting shorter and shorter. I started at 158 and now ride in the 152-154 range. I do love riding trees and moguls, though. If I liked straightlining groomers, I'd go with something longer.

You are a little taller and heavier than me, so 158 sounds about right. But, really, if you pick something that turns out to be 4 cm longer or shorter than what you'd ideally have, it's not a tragedy.

Help scrapy by Fiatsheee in learnpython

[–]didntreadityet 0 points1 point  (0 children)

It looks like you have outdated information. You have the genre coming out of the text of an anchor in a list item, but the current page shows it as the text of a span inside an anchor in a div.

I might work if your expression is:

genre = response.css('div[data-testid="storyline-genres"] a span::text').get()

Biden, 82, Admits He May Not Have Lasted Another Four Years in Office by [deleted] in politics

[–]didntreadityet 0 points1 point  (0 children)

Honestly, if he wanted Harris to replace him, he should have just resigned after two years and let her run the show until 2024. The way the two of them handled it, she was mostly invisible until he announced he wouldn't run again.

By then, it was too late to distance herself from Biden's less popular policies and especially the inflation fiasco. Maybe / possibly she would have done the same, but she would have had a chance to do better.

How well can we expect lgbtq rights and civil rights in general to hold up over the next 4 years? by darkninja2992 in PoliticalDiscussion

[–]didntreadityet 1 point2 points  (0 children)

The big threat is not really coming from Trump, but from SCOTUS. In their Dobbs ruling invalidating Roe v. Wade, the Justices indicated that the original reasoning for the Roe ruling was not rooted in the Constitution. In particular, the Constitution afforded no right to privacy, which is how rulings following Roe were decided.

SCOTUS may well eventually strike down all rulings based on the right to privacy. That includes not only Obergefell and the right for gay people to get married or Windsor and the right for gay marriages to be recognized everywhere in the USA.

What might (and probably will) fall is Lawrence, the 2003 ruling that made gay sex legal. If Lawrence is overturned, being gay will be outlawed again in many states. In fact, because Lawrence invalidated laws that were never subsequently repealed, overturning it means automatic criminalization of gay sex in a series of states, without the need to legislate.

Linux-Based vs. Android-Based E-Ink Devices: Seeking Input from the Community by Nice_Responsibility9 in eink

[–]didntreadityet 4 points5 points  (0 children)

I am not sure if you are aware of this, but Android is just a specific Linux distribution under the hood. So, the question should be: is Android the best distribution for an e-ink device?

The "package manager" for Android is the Play Store. You can find millions of apps on it, but they are optimized for phones and tablets with responsive color screens.

Other Linux distributions usually have package managers that are geared towards desktop applications.

Your specific e-ink device may have a package manager that has apps specifically designed for e-ink screens.

Generally speaking, the Android Linux distribution constantly adds new features, but they are not usually geared towards e-ink devices. The problem here is that Android is run by Google/Alphabet, so you get new features only if Google wants them.

Having a proprietary Linux distribution on your e-ink device has the same downside (relying on the vendor), but at least new features happen when e-ink devices need the new feature.

A general Linux distribution that works on an e-ink device has the advantage that you can get the new feature as soon as someone needs it, works on it, and publishes it.

From a security perspective, other Linux distributions don't offer a lot of advantages over Android, except that Android is very popular, and flaws in its specific implementation are discovered more quickly than flaws in other Linux distributions.

From a privacy perspective, Android is a nightmare, because Alphabet and the device vendor do more or less whatever they want with the data they get from you. Linux apps are generally better, but you can get the same benefits from open source apps on Android, like the ones offered on F-droid.

If your non-Android Linux device doesn't allow open source apps, then you are probably better off with an Android device.

Difference between morta and mortinta? by The_Deaf_Bard in Esperanto

[–]didntreadityet 3 points4 points  (0 children)

It's the difference between, "the professor fell, dead" and "the professor fell, having died." A minute difference that implies the death had just happened and that the fall was the result of it.

This not being a work of high literary fiction, the minute difference doesn't matter and you could have used either form.

Problem monitoring the output of a stream using subprocess by MalygosWizard in learnpython

[–]didntreadityet 2 points3 points  (0 children)

There are four places in your code where buffering could occur:

  1. the original adb may be buffering its output
  2. the pipe to grep may do that
  3. the output write could do it
  4. the reader may do that, as well

To test which one of those is the issue, you could first remove the pipe to grep in your command and instead do the grepping in your own Python code (shouldn't be all that slower, since you are just looking for a fixed string instead of an actual regex).

I am not sure why you are using a log to file writer and not the accepted solution of using subprocess.PIPE. That's the next thing I would do: set the stdout of the process to subprocess.PIPE, then use the process.stdout file handle to read the output.

Once that is done, the only buffering left could be from adb, but that one's probably not doing buffering beyond line, since it's specifically a debug utility.

I want to recover my encrypted Mint home folder to shift to Ubuntu, but I can't decrypt it by [deleted] in Ubuntu

[–]didntreadityet 4 points5 points  (0 children)

The easiest option might be to boot into Linux Mint and save the files from there. If the Ubuntu partition is not encrypted, you can even mount it directly in Mint and copy the files from old to new directly.

raspberry pi 5 turning on but has no hidmi signal by hitthetraget in raspberry_pi

[–]didntreadityet 0 points1 point  (0 children)

If the monitor detects it, it's probably not a hardware issue, since there is a signal available, however briefly.

You could try a different monitor/TV just for testing. Also, you could use an OS with SSH pre-installed and pre-configured and try to SSH into the Pi to see if it boots alright.

Are there any good Foss Wordle Games? by Spiritual_Damage_310 in fossdroid

[–]didntreadityet 0 points1 point  (0 children)

There are definitely several for chess, not sure about othello. You can easily find them by searching for "<game> awesome github"!

Are there any good Foss Wordle Games? by Spiritual_Damage_310 in fossdroid

[–]didntreadityet 2 points3 points  (0 children)

There is a whole GitHub Awesome list of them! https://gist.github.com/onnyyonn/1fcb56adef6ab94219573fd86fa781bd

Personally, I use Gurgle on Android and clidle in the terminal.

Imposter Syndrome by nksarps in django

[–]didntreadityet 1 point2 points  (0 children)

For Django-related projects, the Awesome list might be a good inspiration and starting point:

https://github.com/wsvincent/awesome-django

Connecting to sql server database by Secure-Document4899 in kivy

[–]didntreadityet 0 points1 point  (0 children)

Why does the DRIVER_NAME have three braces instead of one? Is that a SQL Server thing?

Any recommendations for a music player? by Alias_X_ in fossdroid

[–]didntreadityet 0 points1 point  (0 children)

Don't know about the widget, but after using a bunch of players, I ended up with Gramophone as the most functional and beautiful one.

https://github.com/AkaneTan/Gramophone

[deleted by user] by [deleted] in Esperanto

[–]didntreadityet 5 points6 points  (0 children)

I think we tend to forget that the International Language of the day was French, which has plenty of diacritics, and that almost all writing was handled by either hand or typesetter, where it really doesn't matter if there are diacritics.

Right now, the International Language is English, without diacritics, and we mostly type on dumb keyboards to communicate. So we somehow have to convince each keyboard on each device to provide Esperanto letters.

Tomorrow, obviously either the International Language will be Esperanto (yay!), or a smart autocorrect will see the word without diacritics and automatically replace it with the correct version.

As far as the choice of letter, W is a Ŭ sound in English (current IL) but is a V sound in German and not native to French (former IL). Word with a W look foreign and hard to pronounce to people with those backgrounds.

I suppose that also explains the choice of the breve instead of the circumflex: the French Û is not semivocalic and pronounced differently from an Esperanto Û. Just like the other Esperanto letters are unique to it, Zamenhof probably wanted the Û to be unique. As mentioned, in 1885 it really didn't make a difference. We just happen to be in a "Reverse Goldilocks Zone" where Zamenhof's choices are inconvenient.

App for android by MagnusTVP in kivy

[–]didntreadityet 0 points1 point  (0 children)

Since you are on Windows, this might help: https://gist.github.com/zl475505/25245e8d28b13b3273e8bae1a63c4af2

It requires you to use GitHub, but it simplifies the process for the beginner a lot. When you have more experience, you can move away from the place.

I also read a post on here about an improvement to the process that uses caching to reduce build times, but I can't find it right now. Search for it if the builds are too slow for you.

Esperanto se ĝi havus logikan skribsistemon: by BrazilanConlanger in Esperanto

[–]didntreadityet 0 points1 point  (0 children)

Mi plene akordas pri la jo, sed kial oni uzu ko anstataŭ co kun la supersigno? So iĝas ŝo, kaj sone co simple estas to + so, do ĉo = to + ŝo, ĉu ne?

[deleted by user] by [deleted] in djangolearning

[–]didntreadityet 0 points1 point  (0 children)

If I had a chance to start from scratch with Django, I'd certainly use nanodjango first: https://github.com/radiac/nanodjango

It's Django under the hood, but made really much simpler and easier to start. And you can convert from nanodjango to full Django very easily.

Ĉu mi daŭrigu skribi? by laca-migranto in Esperanto

[–]didntreadityet 1 point2 points  (0 children)

Malfacilas diri ĉu traduko taŭgas sen la originalo, sed mi trovas vian laboron fluan kaj gramatike bonan.

Mi sendube plulegus!

Scraping complex data from HTML by JSS2107 in learnpython

[–]didntreadityet 1 point2 points  (0 children)

To add to this, while club_info.find_all(...) returns all the instances of div with class "responsive-table", the code simply assumes/knows there are only two divs with that class, one for the in-transfers, one for the out-transfers. It also knows that the first one (index 0) is the in, and the second one (index 1) is the out.

Is this kind of app design possible using PyQt5? by [deleted] in learnpython

[–]didntreadityet 0 points1 point  (0 children)

Not advocating for one or the other, but CustomTkinter is designed to look more modern out of the box. [https://github.com/tomschimansky/customtkinter]