In general, I find that if something is hard to describe in plain language, it's hard to code. Reducers are a bit clunky to talk about, which could make them harder to reason about, too.
127 karma · joined February 29, 2016
In general, I find that if something is hard to describe in plain language, it's hard to code. Reducers are a bit clunky to talk about, which could make them harder to reason about, too.
array.reduce(
(accumulator, currentItem) => {...},
initialValue,
)
In .filter(), The current item is the 1st argument and the intermediate/accumulated value comes later: filter((currentItem, index, intermediateArray)) => ...)I use .filter() more often, so that argument ordering where currentItem is right next to the array is more intuitive for me
@media (prefers-reduced-motion: no-preference) {
body > header {
view-transition-name: header;
}
@view-transition {
navigation: auto;
}
::view-transition-old(root) {
animation: fade-out 0.3s ease;
}
::view-transition-new(root) {
animation: fade-in 0.3s ease;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fade-out {
from { opacity: 1; }
to { opacity: 0; }
}
}If you have some other tips, I'd be happy to hear them!
Generally I'll write a post when I try to do something that's difficult to find an example of online. I don't get a _ton_ of traffic, but writing prose is a nice change from writing code.
Your point stands that governments/courts decide what is illegal and that they have the power to freeze bank accounts when those accounts are used to fund illegal activities.
https://www.cbc.ca/news/politics/emergency-bank-measures-fin...
I picked up Pipenv when a point-point release of a dependency broke a production deployment. Pipenv's dependency locking meant that I wouldn't get surprised like that again.
Part of why this topic comes up so much is the desire to run with a language before learning to walk with it, perhaps. I'm a big fan of Poetry, but I like it because I know what it gives me compared to vanilla pip and a setup.py file.
Installing dependencies at the OS level will get you far as a beginner. And when the time comes that you need a virtual environment, you'll probably know.
One is that because Python has been around for so long, it's easy to find outdated or conflicting advice about how to manage Python packages.
I think it's important to stress that pyenv isn't strictly a dependency manager, too, and depending on your OS, isn't necessary. (Supported Python versions are in the AUR[0].)
A lot of pain from Python 2 -> 3 is that many operating systems were so slow to switch their default Python version to 3. Unless something has changed in the last month or so, Mac OS _still_ uses Python 2 as the default.
It's a shame to see Python take a beating for OS-level decisions.
I've been meaning to take another look at Pipenv, but the huge pause without a release makes me nervous that it could happen again.
[0] https://johnfraney.ca/posts/2019/11/19/pipenv-poetry-benchma...
I'm not sure how awesome it is, but I like to write about a particular problem that I came across and solved recently or an experiment that I tried, like writing a Vue app using a Python-to-JavaScript transpiler. I mostly write about Python and Vue, sometimes veering into CSS, Markdown, and TypeScript. Instead of just giving the solution, I try to walk through the problem and give background and bad jokes along the way.
I wrote this post[0] that compares Poetry and Pipenv if you're interested and talks about some of their differences. Poetry has both add and install commands, whereas Pipenv only has an install command, for instance.
[0] https://johnfraney.ca/posts/2019/03/06/pipenv-poetry-benchma...
I did a quick comparison here[0], and I'm planning to do an update with the latest version of Poetry.
[0] https://johnfraney.ca/posts/2019/03/06/pipenv-poetry-benchma...
LRT linking to commuter rail lines, subway lines, and bus stops is something the author didn't really mention, but it certainly seems to be the strategy for that line in Toronto.
The author is against cutting funding for bus routes, which is reasonable. I guess I just don't see how that is also an argument against using LRT for arterial transportation into downtown cores. If the retort to that is "budgets", then we need increased funding for public transportation, not fewer trains.
- 22-minute drive (or 1h in rushour)
- 1.25-hour bus ride
- 13-minute LRT ride
LRT (light rail transit) really is an excellent way to get into the downtown core from distances and in time frames that were previously only manageable by car.
I found it more straightforward than using setup.py and twine, which I used for other packages.
How are you publishing to PyPI these days?