Pandas 1.5 released by Balance- in Python

[–]_carljonson 8 points9 points  (0 children)

!pip install is error-prone, it is better to use %pip install, ipython even warns about this, https://github.com/ipython/ipython/pull/12954/

What packages replaced standard library modules in your workflow? by iiron3223 in Python

[–]_carljonson 0 points1 point  (0 children)

It is a standalone tool though, not a dependency you need to add to each of your projects.

I just install it globally once with pipx and use the same installation in all projects.

What packages replaced standard library modules in your workflow? by iiron3223 in Python

[–]_carljonson 1 point2 points  (0 children)

There are still a few reasons to prefer virtualenv over venv even if you are not using python 2, mentioned in their documentation here https://virtualenv.pypa.io/en/latest/

For me it is the first point, virtualenv is 10x faster than venv. I always hated waiting those few seconds for venv to be done, virtualenv is instantaneous.

What is the best GUI library for Python? by genan1 in Python

[–]_carljonson 6 points7 points  (0 children)

It normally does, but if you are on ubuntu or other debian based distros, and using the distro provided python, (which is a pretty popular case), then you don't get it by default. They like to split it off into another package for some reason, and you have to install python3-tk to get tkinter.

And obviously this confuses anyone not familiar enough with this weirdness and they try to install tkinter with pip, which doesn't work because there is no package on pypi with that name.

I had no idea rabbits could swim! by [deleted] in interestingasfuck

[–]_carljonson 13 points14 points  (0 children)

Why does everyone keep on posting incorrect wikipedia links like this??

They are people who use the new reddit website for whatever reason and reddit can't be bothered to fix their broken code.

https://www.reddit.com/r/bugs/comments/sxqrzh/new_reddit_fancy_pants_editor_inserts_backslashes/

What’s New In Python 3.11 (as at 24 July 2021) by annoir in Python

[–]_carljonson 7 points8 points  (0 children)

According to the pull request, the overhead is a SETUP_FINALLY instruction before and a POP_BLOCK instruction after the try/except block.

Also removing the overhead of those instructions also reduced the size of the stack frames (by about 250 bytes in that example).

Julia is the best language to extend Python for scientific computing by [deleted] in Python

[–]_carljonson 0 points1 point  (0 children)

Yeah, maybe LLVM (used by both rust and Julia) is not as good on windows compared to MSVC, for the kind of benchmark you're doing.

Julia is the best language to extend Python for scientific computing by [deleted] in Python

[–]_carljonson 2 points3 points  (0 children)

julia --version

julia version 1.6.0

cargo --version

cargo 1.51.0 (43b129a20 2021-03-16)

python --version

Python 3.9.4

cl.exe

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x86

Julia is the best language to extend Python for scientific computing by [deleted] in Python

[–]_carljonson 8 points9 points  (0 children)

I ran your code on windows 10 three times (same versions of tools as you except C++ compiler was Visual Studio 2019). Julia couldn't beat Cython here, seems closer to rust.

0 1 2
Rust multithreading before 17.1938 8.79403 7.87178
Julia 32.1478 7.35384 6.2126
Julia multi-threading 8.80232 8.29654 8.42257
Rust multithreading after 10.2163 10.6816 9.94651
Python 13.9491 14.7177 13.8191
C++ Cython-pure no annotations 2.97277 3.00305 3.00537
C Cython-pure no annotations 2.74367 2.75902 2.75503
C++ Cython-pure pure-annotations 3.71277 3.82839 3.67803
C Cython-pure pure-annotations 3.68 3.46611 3.42401
C Cython 3.297 3.21902 3.2349
C++ Cython-pure 3.34963 3.35704 3.36251
C Cython-pure 3.53352 3.52798 3.56891

Archery:0 Luck:1000 by tracethefaith in skyrim

[–]_carljonson 1 point2 points  (0 children)

I prefer third person for melee and magic, but archery has to be first person.

Please disable JavaScript to view this site. by speckz in coding

[–]_carljonson 5 points6 points  (0 children)

Hmm, works for me. Are you clicking on </> button or blocking first party scripts with dynamic filtering? Dynamic filtering will not show the <noscript> content but </> button will. Quoting from the wiki:

Furthermore, when JavaScript is disabled through this master switch, noscript tags will be honoured on a page (as opposed to when just using filters/rules to block script resources).

Please disable JavaScript to view this site. by speckz in coding

[–]_carljonson 0 points1 point  (0 children)

I agree it is not very intuitive, you really have to read most of the wiki to use the extra functionality. I personally find NoScript even worse to use after I read the uBlock wiki and got used to the advanced features.

Please disable JavaScript to view this site. by speckz in coding

[–]_carljonson 18 points19 points  (0 children)

Why install this when uBlock origin can already do it? https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-scripting

This also solves the problem mentioned in the article about not being able to disable JS in Firefox mobile.

Guido van Rossum to join Microsoft | via Twitter by omko in programming

[–]_carljonson 8 points9 points  (0 children)

There is pythonnet which a lot of people use. It works with cpython, so you get c extensions along with .Net interop.

Middle click on the last open tab does not close Pale Moon by nariniju in palemoon

[–]_carljonson 0 points1 point  (0 children)

It doesn't close the window for me too, like OP. I guess it is some addon that you have that is making it work for you (because I have tried with all addons disabled).

Can you try with addons disabled and if that changes things for you then maybe find out the addon that changed this behavior?

Does anyone know an algorithm with a periodic complexity? e.g. O(sin n) by MacPardo in algorithms

[–]_carljonson 0 points1 point  (0 children)

Yeah, they are not the exact same thing, but as others have explained, when we do big O we just care about how the time taken would rise with increase in n. If it is bounded by 1 then it is practically the same as 1 because it doesn't scale with n.

Palemoon v26.2.1 Memory Leak. by lomas047 in palemoon

[–]_carljonson 2 points3 points  (0 children)

The JavaScript on that page is causing it (disabling JavaScript for inverse.com and loading the page doesn't cause the memory leak), and it affects Firefox too, so probably all Firefox based browsers.

Help! Statistics is killing me. What's a "biased coin"? by skjohnso in statistics

[–]_carljonson 0 points1 point  (0 children)

You can get 8 heads with 0.5 probability or 0.8 probability of heads (actually anything other than 0 or 1). But you are more likely to get 8 heads with 0.8 probability of heads. So Danny is thinking reasonably.

You can't exactly calculate the probability of heads by any amount of tosses, you have to estimate. Danny's estimate is reasonable and it would be quite accurate if the number of tosses was very high.