Tried to use the search engine to ask about "how to pronounce #"
but the search engine treated "#" as a comment and it tried to be "smart" and is telling me how to pronounce the word "to" instead.
I also tried "how to pronounce the # symbol", "the # sign", but it just tells me how to pronounce "symbol" or "sign"
Yes, for semi-tones. And that's why the programming language has this name. I'm not much of a musician myself but I know about C# from the early days of my career. And since I'm also not a native speaker, that's the first English name for the symbol I had heard.
are there best practices regarding #concurrency in #Go? I have something like an in-memory database that gets accessed by multiple clients in parallel. The RWMutexes drive me crazy. #golang
The short answer is "use channels and goroutines instead of synchronization primitives". It's usually also called "don't communicate by sharing, share by communicating":
For the long answer, there are lots of books, talks, and tutorials. In particular, I found the book "Concurrency in Go" quite useful, even if a bit dated in some parts:
You mean, internally? Performance. The answer is performance. Low-level synchronization primitives are generally faster, and for the stdlib every nanosecond matters. In your own code, you mostly have different priorities.
Here‘s another interesting #julialang, #python, #rstats comparison: „count the number of vowels in a string“. #julia uses an anonymous function as an argument to count(), #python iterates over the string using list comprehension, #rstats does the same but in a vectorized way
I use ProtonMail for 4 years now. I pay for it but I think I could just as well stay on a free version. I just checked and I've used only 249 Mb of storage. And that's considering that I never removed any messages. So, I think 500 Mb should last for a few years if not forever, depending on your usage.
AMZN are deploying this "Vega" OS and apparently its party trick is to let people write apps in React ("tell me you hate programmers without telling me you hate programmers")
We really missed an opportunity to curse the web with procedural languages like C.
I wonder if there's a correlation between attitudes about programming safety and the distance you were allowed to travel on your own from your house as a kid.
For example, we used to ride our bikes for hours at a time--usually to go play on the train tracks. And well, maybe I should just leave it at that...
Wearing a bike helmet, using extra strong condoms, looking both sides when crossing the road, pressing "eject" in Windows before ejecting a USB device, putting on the wrist strap when playing VR, saving every minute in PC games, saving every minute when editing a text file, wearing protective glasses when sawing, turning off all home electricity before a long trip, washing hands after eating bananas, and locking the front door.
Today I got some time to find out why my #zsh takes a noticeably long time to start. The offender was #nvm. As I removed it, the time got down from 450ms to 60ms.
To time startup of zsh vs bash:
$ for i in $(seq 1 10); do /usr/bin/time bash -i -c exit; done
$ for i in $(seq 1 10); do /usr/bin/time zsh -i -c exit; done
To find how long each plugin takes at startup, add zmodload zsh/zprof at the top of ~/.zshrc and zprof at the bottom.
#python friends: I would like to #test examples in my README.md -- doctest is great for this. But examples modify resources so some setup/teardown is needed and would prefer not to show that for each example. Anyway to have "hidden" setup/teardown that isn't shown in README but gets run by pytest? @brianokken#pytest#testing
With Twitter and Mastodon, I feel like what accounts I follow never seem to be in Home (timeline) while what I don't want to see is deemed interesting for me. #microblogging
This makes module fetching unnecessarily slow, in particular when large repositories are involved, which need to be cloned via git when using GOPROXY=direct :-/
@filippo The legend himself! I just wanted to thank you for all the work you've done for Go and making the world a bit more secure. I like the stuff you do, even if I don't understand half of it :)
As someone who recently attempted to write a small coherent book on Python, it was neat to meet Doug Crockford ("JavaScript: The Good Parts") at yesterday's RacketCon. We then had a conversation about async/await...
Most languages opt for async/await because it can be added into an existing language without affecting the regular runtime and all the existing code. If Python suddenly started to run everything, including the main thread, in a scheduler, like you do in Go, I assume that would cause lots of stuff to break.
Rust has a different reason. It uses async/await because then you can build smaller and faster binaries if you don't need scheduler and async runtime.
How much code do you have that needs rewriting? I think you can write a rewrite rule on semgrep. Or you can install Python 3.10 on raspberry, it's not that hard.
TL;DR if a file exists in your current directory that has the same name as a package that pipx, or the installed package you're trying to run depends on, that file will be:
By default, #Python adds into the import paths (sys.path) the current directory you're in. That means, your modules in the current directory will have precedence over third-party modules, which is generally good. Since Python 3.11, you can change this behavior by setting PYTHONSAFEPATH=yes environment variable.
As described in the link in my previous message, the -P flag and PYTHONSAFEPATH are two ways to do the same thing. Choose the one that works for you the best. I find the env var more descriptive.
Okay I remember there was some talk about this earlier but can't recall the answers....
In #python packages, what was it again about these classifiers for supported Python releases? Should we maintain them or can we just remove them in favor of python_requires?
✅ pip uses only python_requires for resolving packages.
✅ PyPi displays the information of python_requires
😖 PyPi also displays the classifies (tropes) so in this case maintaining/not maintaining meta data creates work/noise.
Trove classifier categories that you specify for a package were never used by pypi, pip, or any other tool I know for anything. Poetry automatically adds some categories for you (python versions, license) but again, doesn't use them.
The only purpose of the classifier is to categorize projects on pypi. However, considering how many projects there are now, I doubt anyone searches projects this way. I personally use github topics to find projects on a subject.
@benjaoming That's exactly what I mean! These are classifiers, they classify projects on pypi so that you, in theory, can use pypi as a catalog of Python projects.
The one-liner that my every Python file has. Makes type annotations lazy so that I can use forward-references, latest annotations syntax, and other cool things without affecting the runtime.
In addition to using #mypy , can anyone share any guidance, tooling, or blogs that may help steer a #python application towards the "TypeState" pattern? I'm also curious if there are references comparing the "State" pattern to the "TypeState" pattern (Rust).
I suppose I'm looking specifically for Python comparisons with #rust, e.g. if there were a part 2 for the article here:
Is there a privacy-friendly alternative to TripAdvisor, Yelp, Google Maps, and alike? Specifically, for restaurant reviews.
I want to go on my next trip ungoogled. And while @organicmaps fully covers my needs for how to get to where I want to go, it's not enough for picking where to eat.
that I'd rather learn C properly than try to pick up any of these "modern" languages that can't even Hello World without ninja or an internet connection says... something, I'm sure
I haven't seen yet a language that would require internet connection for anything but package manager. I often program in Rust, Go, Python, and Elixir from the train. If you install packages in advance, all of them work fine offline.
And I haven't seen ninjas. Only Jinja, if that counts.
@gregorni I think I like that when I run "pip install something", try that something, and see that it sucks, I can get the same command, add "un" before "install" and undo my mistakes. In other words, install+uninstall saves me a bit of typing compared to install+remove.