News for hackers. Stuff that matters.

mivade

cibuildwheel (https://cibuildwheel.readthedocs.io/en/stable/) makes this fairly straightforward.
Re:Python 3 Types in the Wild on Friday March 18, 2022 @10:46AM (#30722947)
Correct. Keys must be immutable and hashable.
Re:DC Circuit Water Analogy (1998) on Monday January 24, 2022 @11:43AM (#30060095)
No analogy is perfect. They are intended to help illustrate a concept to gain insight. Ideally when using an analogy its limits should also be described. Luckily the very first link after the analogy is explained does just that: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/watcir3.....
Re:Square is now called Block on Wednesday December 01, 2021 @06:04PM (#29410292)
Makes me think of Fakeblock.
Re:Wikivoyage has disappeared from DuckDuckGo on Tuesday October 26, 2021 @06:59PM (#29007474)
The bang syntax works though: `!wv malta` sends me to the Wikivoyage page on Malta.
Re:Time to retire the CSV? on Wednesday August 18, 2021 @05:19PM (#28227321)
Re:Amazon acquires MGM for $8.5B on Wednesday May 26, 2021 @09:53AM (#27290514)
The difference is simple: NBC was (and still is) free to watch if you have a television and an antenna.
My understanding was that if you write a regular function (`def` rather than `async def`) then FastAPI (or really Starlette which it uses under the hood) executes the function in a thread pool so that no blocking of the main event loop should occur.
Re:Pyston v2: Faster Python on Wednesday October 28, 2020 @03:00PM (#24922760)
They compare PyPy and CPython in their benchmarks.
Re:Pytest 3.2.0 released on Wednesday August 09, 2017 @08:17AM (#14967801)
If for no other reason, pytest requires a lot less boilerplate.

Pytest fixtures are also quite a bit more flexible than unittest's setUp and tearDown methods, although they take a little while to really understand (at least they did for me) since they use some magic.

Re:Why Dentistry Is Separate from Medicine on Friday March 10, 2017 @08:02AM (#13838240)
> think of all the years of unnecessary education they'd pile on to dentistry and the bottle necks they would put up to raise the wages to MD level.

That seems more an indictment of the medical education system than the insurance system. There are already parallel medical education systems in the US (MD vs. DO, although there is little practical difference). Seeing either type of physician is treated equally by health insurance. Why can't health insurance also cover DDS visits as well?

Matplotlib's main API is pretty terrible. But it's just fine for the simple plots that scientists and engineers are often needing (e.g., just plot y vs. x). It's also pretty straightforward to get publication-quality plots. Bokeh can handle simple plotting and more complex visualizations, but it is aimed mostly at interactive visualizations rather than plotting for publication. For now, matplolib is the only real option for that in the Python world.

Matplotlib inherits most of its baggage from originally being meant to mimic Matlab plotting that many were then familiar with. As an aside, I find the pandas interface to plotting with matplotlib to generally be much easier to work with.

Re:Is PostgreSQL good enough? on Tuesday February 14, 2017 @08:27AM (#13643321)
This looks pretty cool.
Re:Using tmux properly on Saturday February 04, 2017 @05:28PM (#13569484)
> Don't the screen developers ever need to go to the beginning of a line in the shell or editor?

C-a a. Using emacs with screen for many years, this is almost automatic for me.

Re:Tower for Windows on Monday October 10, 2016 @12:52PM (#12678266)
TortoiseHg is completely different than TortoiseGit, despite the similar names (and logos). While the latter is an assortment of context menus and dialogs, THG has this plus a great "workbench" which combines everything into one. It's easily possible to use THG alone without ever touching the command line which is a rather nice feature when trying to convince non-programmers to use version control. If there was a git equivalent, I'd happily use it.
Re:Python by the C side on Sunday September 25, 2016 @06:11AM (#12574661)
Cython is intended for making Python extension modules. So if the end goal is to make something that you interact with only from Python, then Cython is a good choice. You can still use it to simply wrap some existing library, but ctypes or cffi might then be a bit simpler since it they don't require an added compilation step.
Re:Gnuplotting – Create scientific plots using gnuplot on Friday September 23, 2016 @02:19AM (#12562685)
I was a loyal Gnuplot user for many years until I got fed up with a bug where tick labels wouldn't be centered with ticks in LaTeX output without some manual hacks. I can see from one of the posts that this issue still exists.

Plus it was easier to just do everything in Python and not have to use a separate process to plot in the end.

Nevertheless, I still find it useful. Nothing else seems as easy to quickly plot an analytical function: `gnuplot -p -e "sin(x)"`

I don't know, and I find this rather frustrating. I write a lot of tools to monitor devices in the lab via a web interface and often want to see updates every 10-100 ms. The only library I have found that seems to be up to the task is [Flot](http://www.flotcharts.org/) (and I've looked into a lot of options). My main complaints about it are its reliance on jQuery (which I am not otherwise using) and its lack of recent development (although it seems fairly feature-complete).
Re:Why You Should Try tmux Instead of screen on Sunday July 03, 2016 @01:36PM (#12026853)
I was using tmux for a while after years of using screen. At least for my use case, the main thing I liked better about tmux was that windows (or whatever the proper term is) get their names updated based on the command running. In screen, I would have to manually change the name (maybe there is a way around this but I was always too lazy to find out).

Why I switched back to screen:

1. It's more commonly installed. Not a big deal these days, but still.

2. It's really easy to resize a window to fit whatever terminal window I'm using: C-a F. As far as I could find, there is no way to do this with tmux.

Re:More awful IoT stuff on Wednesday June 22, 2016 @02:31PM (#11955970)
Thanks for this. I had somehow never heard of this chip before. Link for the lazy: http://esp8266.net/
And yet we keep measuring what our models predict to extremely high levels of precision. We know there is something missing (gravity not playing nicely with quantum theory being the most obvious example), but it has worked remarkably well whether you like it or not.