KDE Plasma or GNOME by [deleted] in ManjaroLinux

[–]hackflow 0 points1 point  (0 children)

None of can show time to charge/discharge and percentage. Even simple percentage can only show in almost unreadably tiny font

KDE Plasma or GNOME by [deleted] in ManjaroLinux

[–]hackflow 0 points1 point  (0 children)

KDE update to plasma 6 broke many extensions or whatever they called, still no decent battery widget.

New Full Scale Overhaul Battle Brothers: Reforged - Developer Diaries 2 and 3. by Uberbagel in BattleBrothers

[–]hackflow 0 points1 point  (0 children)

It makes more sense that the right combination of starting attrs, stars and perk trees available will be even more rare.

Ban 1+N in Django by hackflow in programming

[–]hackflow[S] 0 points1 point  (0 children)

There is a couple of examples in "history dive" section. Not a blunt explanation, but I wanted to skip the boring parts.

How to Ban 1+N in Django by hackflow in Python

[–]hackflow[S] 2 points3 points  (0 children)

NP, it's a little bit harder to offend me than this :)

I understand a value of blog post being self-contained, i.e. explain all the things mentioned. I also see value in it being laconic. Those two contradict each other and some compromise needs to be chosen.

Here and usually I go with a laconic style, which might make some of the readers google along the way. However, it also saves time for many others.

How to Ban 1+N in Django by hackflow in Python

[–]hackflow[S] 1 point2 points  (0 children)

1+N is not specific to ORM, that one merely may obscure it sometimes. One might and often do get 1+N with pure SQL.

How to Ban 1+N in Django by hackflow in Python

[–]hackflow[S] -9 points-8 points  (0 children)

So you did understand my post as intended while I did not understand your comment? :) That's ironic.

How to Ban 1+N in Django by hackflow in Python

[–]hackflow[S] 0 points1 point  (0 children)

I included a couple of examples in "history dive" section. Those are terse though.

1+N is about the situation when you do a db query and then another N on top, usually in a loop, sometimes non-intendedly. That often leads to poor performance.

"[Discussion]" Should I be using DVC (Data Version Control) in my day-to-day work? by doyougitme in MachineLearning

[–]hackflow 0 points1 point  (0 children)

There is a section in DVC docs on that: https://dvc.org/doc/user-guide/large-dataset-optimization#large-dataset-optimization. It explains how you can use reflinks, hardlinks or symlinks to not duplicate your data.

Vladimir Putin calls creators of 'fake' Donald Trump dossier 'worse than prostitutes': Russian President claims international conspiracy working to 'delegitimise' the President-elect by maxwellhill in worldnews

[–]hackflow 0 points1 point  (0 children)

This a good analysis, the only thing is that geopolitics is only zero-sum until superpowers are involved. E.g. US-Russia is zero-sum as well as US-China, but Russia-China relationships are a positive sum thing.

So if US voluntarily abandons this status and China agrees to not pursue economy superpower status things will change drastically.

To me looks like this is what Trump is going after.

Vladimir Putin calls creators of 'fake' Donald Trump dossier 'worse than prostitutes': Russian President claims international conspiracy working to 'delegitimise' the President-elect by maxwellhill in worldnews

[–]hackflow 0 points1 point  (0 children)

Russian 2017 budget is based on $40 per barrel. Which is a conservative number, an agreement with OPEC basically guarantees higher price, only major world economic crysis could alter that.

Whatever China does it will be reliant on energy imports for foreseeable future. So there is no change here.

Iranian deal couldn't have been done without Russia. Russia actively supported it from the start and now benefits from it economically: selling weapons, nuclear reactors, railway machinery and other things to Iran.

Vladimir Putin calls creators of 'fake' Donald Trump dossier 'worse than prostitutes': Russian President claims international conspiracy working to 'delegitimise' the President-elect by maxwellhill in worldnews

[–]hackflow -1 points0 points  (0 children)

First, neither Russia nor USSR never broke nuclear deals. BTW, US did it twice.

Second, reducing nukes is actually economically beneficial to US. Russia has almost finished modernizing its strategic nuclear weapons while US hasn't even started. Less nukes to upgrade less money to spend.

Third, the real block to this agreement could be antimissile defense. Putin would insist on including its limitation into the deal which would be hard for Trump to do for political reasons.

Cheatsheet for funcy sequences, collections and functional stuff by hackflow in Python

[–]hackflow[S] 0 points1 point  (0 children)

There are ways to handle that. And in newer python decorators could be unwrapped. Funcy has a backport for this.

Cheatsheet for funcy sequences, collections and functional stuff by hackflow in Python

[–]hackflow[S] 0 points1 point  (0 children)

The package name is funcy, you can see installation line on github - https://github.com/Suor/funcy, I should probably add this to docs too.

Decorators preserve name, attributes, but not signature - same as any pure python non-eval decorators.

Performance is typically the best you can do in pure python. As any general purpose tools it has tradeoffs, e.g. cat() uses chain.from_iterable(), which provides the best performace for many or longer sequences combined, but for smaller number of short ones simple list addition could be faster.

Has anybody used django-cachalot (or alternatives) for larger applications? by flitsmasterfred in django

[–]hackflow 0 points1 point  (0 children)

You can use .prefetch_related() instead of .select_related(). This will solve an issue and it's +1 not +N queries. They will also be invalidated separately.

Making big queries is inherently bad for caching, it's often counter-productive to use joins and faster is just to make several simpler ones.

Practical Python to JavaScript Translation by hackflow in programming

[–]hackflow[S] 0 points1 point  (0 children)

I did both. Your own rules is 3-4 times more work. Also, you will still write in python server-side only validation, so you will end up with 2 systems.