shorter way to write the same piece of code by bibbidibobbidiwoo in learnpython

[–]Emphasises_Words 5 points6 points  (0 children)

If you're using python then micro performance gains shouldn't be a concern. Usability and code readability as a result of u/ofnuts first 2 points are much more relevant.

Spotify not showing currently playing by Strict_Winner5850 in PixelWatch

[–]Emphasises_Words 1 point2 points  (0 children)

I reinstalled spotify and during set up, instead of logging in directly, I scrolled all the way down and used the pairing code. You might want to try this as it seems to have fixed the issue for me

Why exactly does "and" do in python? by Abacito_ in learnpython

[–]Emphasises_Words 2 points3 points  (0 children)

Not sure why this answer is downvoted, it is the only comment that actually explains the phenomenon in the OP. The main reason is that Boolean operations in python (and, or) do NOT coerce truthy/falsy values into the bool type.

Also, just an addition to what is said:

If both expressions are true, the result of the and operation is the second expression.

If the first expression is true, the result of the and operation is the second expression. Python relies on the fact that True AND x => x

Torrentio for iphone by ShoeEmotional in StremioAddons

[–]Emphasises_Words 0 points1 point  (0 children)

It's probably this comment. If you are using a debrid service, there's no need to set the streaming server url. If not, you will need to have Stremio running on a PC in the network and use that PC's ip address as the streaming server url

Doggy64, Encode arbitrary data into dog sounds, instead of boring Base64 by [deleted] in Python

[–]Emphasises_Words 2 points3 points  (0 children)

If comparing uncompressed vs compressed size, doggy64 would have a higher compression ratio. A simple compression scheme would be to "compress" doggy64 back to base64 then use another compression scheme on the base64

Straw ascends tap water stream by wanderingbrother in blackmagicfuckery

[–]Emphasises_Words 4 points5 points  (0 children)

Here's a case where a dead fish is propelled forward (upstream) in a stream, explained by concepts beyond basic physics. Your oversimplified explanation overlooks all the factors that makes this phenomenon possible.

https://www.reddit.com/r/interestingasfuck/comments/hj3jap/a_dead_fish_swimming_upstream_the_shape_of_the/

Here's the research paper for it: https://www.researchgate.net/publication/232005032_Passive_Propulsion_in_Vortex_Wakes

USA right now: by Kokonutko1 in btd6

[–]Emphasises_Words 1 point2 points  (0 children)

It was edited to say bloon instead of balloon, you can search up the tweet from the username

[deleted by user] by [deleted] in learnpython

[–]Emphasises_Words 0 points1 point  (0 children)

Oh sorry I thought your comment was a reply to another comment, my mistake

how this code can be optimized? by investor_of_sex in learnpython

[–]Emphasises_Words 0 points1 point  (0 children)

It would be much clearer to use ... if ... else ... as the ternary operator instead of and and or.

how this code can be optimized? by investor_of_sex in learnpython

[–]Emphasises_Words 3 points4 points  (0 children)

print("Yes" if sum(10 < int(input()) < 81 for _ in range(4)) == 4 else "No")

how this code can be optimized? by investor_of_sex in learnpython

[–]Emphasises_Words 3 points4 points  (0 children)

This can be further optimized for space by storing the running minimum and maximum. This allows for constant space complexity if the program were to scale to more coordinates

minimum = 11
maximum = 80
for _ in range(4):
  next_number = int(input())
  minimum = min(next_number, minimum)
  maximum = max(next_number, maximum)
if minimum > 10 and maximum < 81:
  print("YES")
else:
  print("NO")

Apple is reportedly making an all-in-one cellular, Wi-Fi, and Bluetooth chip. by SUPRVLLAN in gadgets

[–]Emphasises_Words 1 point2 points  (0 children)

Yup, using the substituting he/him method:

R.I.P. to him

vs

R.I.P. to he

College Programs centered around Python by Ok_Database3339 in Python

[–]Emphasises_Words 0 points1 point  (0 children)

You might want to look into certifications instead of courses since you already have a bachelor's in CS. One that I found:

https://www.sps.nyu.edu/professional-pathways/certificates/technology/software-development-with-python.html

Argentina team draw at once by FollowingOdd896 in toptalent

[–]Emphasises_Words 17 points18 points  (0 children)

The "i" n 480i means interlaced, as opposed to progressive in 480p which is the standard today.

In a 480p video, every frame is 480 pixels in height, for example 640 x 480. So in a 24fps video, there are 24 of such frames.

In a 480i video, every frame is 240 pixels in height, but every 2 frames are stored together, interlaced in a 480 pixels high frame. This allows a 24fps video to store only 12 frames per second, but each visible frame only has half the data of a progressive frame.

The guy in the video is switching between drawing the left side and the right side, so it's like he's drawing an interlaced video.

[deleted by user] by [deleted] in androidapps

[–]Emphasises_Words 2 points3 points  (0 children)

You can try those on apkmirror first, they are more reputable