8,487 karma · joined Feb 1, 2017 (9y ago) · 2,549 submissions
comment 5y ago · link · parent
So I don't know if on this alone it proves Copilot regurgitates too much. I think other signs are more troubling, however, such as its tendency to continue from a prompt vs generate novelty.
comment 5y ago · link · parent
But a few hundred bucks will still get you from either "potable but not great" to fairly pure, or brackish to potable. If you have effectively infinite seawater and power, you can still pump at lower pressure and get pure permeate, it's just less efficient per unit pump and filter lifetime. If you had a super reliable pressure system (low friction ceramic pumps for example, not cheap but last forever) and cheap first-pass filters, you can run it for quite some time. But you're spot on in that you get to a point of engineering-give-a-mouse-a-cookie and it just makes sense to optimize the whole stack.
comment 5y ago · link · parent
Free chlorine (technically assorted chlorine oxides like hypochlorite) attacks RO membranes, so now you have to deactivate your reactive species first. Usually UV lamps, you use sun, but now you need UV-clear tubing, not easy.
Reverse flow flushing can be done with the components you mention, that's another $20/50 plus sourcing logistics.
Yes, the theoretical expense in quality pumps is quality. There are tighter tolerances, beefier components, better polymers, and more QA. It all adds up.
It's still all fairly cheap by Western standards, but it's a tall ask for a lot of places that barely have potable water.
comment 5y ago · link · parent
Expect to pay around $300 minimum for a small RO solar plant, and a couple bucks a month for upkeep. And logistics. Granted that's USA prices (upstate NY, not SV) but that prices out a lot of developing regions.
comment 5y ago · link · parent
https://www.w3.org/2012/ldp/wiki/Proposal_for_HTTP_QUERY_Ver...
comment 5y ago · link · parent
Everyone knows docker runs as root, and therefore be careful using it, just as you would sudo. It seems this is a major fail in docs.
I kinda get why it's the default, but it needs to be made way better known that by default -p punches a hole through ufw.
comment 5y ago · link · parent
The whole point is to open source the batch record.
comment 5y ago · link · parent
So have your dynamic language functions you have to document (you do document your code right?), why not just use types instead? I'd far rather see
def frob(data: np.ndarray) -> float:
<code with no docstring>
than def frob(data):
"""takes an array and frobs it to give the frobitude score"""
Like, idk about you, but the former is way better at "self documenting" and you can do all kinds of automatic operations on it. If things are ill-defined and quickly shifting, I can mypy and flake my way to make sure the stack works without bricking something. If I have human docs, that's far more likely to drift out of date.comment 5y ago · link · parent
I wager much strain comes simply from individuals working in environments that force them to lean on their weaknesses.
I was absolutely floundering in one department simply because the senior devs loved bash and python2 and dynamic runtime everything and my brain couldn't keep up with the lack of structure.
comment 5y ago · link · parent
Me? Args in a dict, or worse, `**kwargs` chained through multiple functions, are awful to deal with.
I'm really curious about your stance. If anything, typing has gotten easier and better over 20 years. Types used to be verbose, you had to type out all characters, compiler messages were terrible. Now, type systems are better, inferred, flexible and structural subtyping is great. Type checkers are almost real-time. Autocomplete saves me keystrokes. Errors are helpful.
I used to hate types, 10 years ago, writing Java in Notepad++. Now I write python w/ mypy, go, and rust in Intellij, with lots of plugins to speed up autocomplete, and lint in real time.
comment 5y ago · link · parent
Opinion: This is actually a symptom of what is (imho) a pervasive problem lodged deep in the collective consciousness of software dev: OOP with fine-grained objects. I blame (early) Java in large part for exacerbating this mentality. Encapsulation of state with mutator methods in particular. It sprays state all over the application, encourages mutation in place over immutability, coupling, validating-not-parsing, and makes it nigh-well impossible to write good tests.
It's really hard to write objects that enforce all invariants under every mutation. And when you have state strewn everywhere, it's impossible to test every nook and cranny. The combinatorial space explodes.
Objects are helpful for encapsulating state when they are course-grained, mutations are atomic, coupling occurs in one place, state changes are auditable, and the entire state can be replayed/set at once, to enable mock tests and subsystem integration tests. AKA, things like databases, reactors, and persistent data structures.
comment 5y ago · link · parent
It's not zero consideration of data structures, it's mostly a focus on the main data type (arrays and data frames) and not really thinking about typed records, data models and such. The majority of types are float, str, dict, np.ndarray, pd.DataFrame. No dataclasses, minimal classes, and when classes are used, it's Java101 style "all the bad parts of OOP" programming. Sadly, I've spent years in this space before learning better.
comment 5y ago · link · parent
I don't deny it. Join the cult of Static Python. We have cookies! And lower stress levels!
I usually wrap that spiel with my caveat "this depends greatly on your neurotype, style, environment, and other things." I have ADHD and my brain struggles with keeping bits of state in memory, so having to remember the type of every variable without my IDE tracking it for me is a huge performance drain.
However, I would contend even if your neurotype supported that mental workflow... it isn't actually better. Humans on average can handle 7 +/- 2 "pieces" of information in focus. Why spend any of your precious half-dozen pieces of salient consciousness on something a machine is really good at doing?
comment 5y ago · link · parent
> There can be no equivalent to that in type-safe languages because when you mutate the dispatch table you lose type-safety.
That's exactly what I mean by escape hatches. Rust has unsafe. You can write a WTF FastInverseSqrt in Rust. You shouldn't 99% of the time. But you can.
Rust also has Box, Rc, Arc, and other tools. I'm not fluent enough in rust to know how to, but I'm quite confident and will eat my hat if you can't accomplish what is effectively a mutable vtable dispatch in Rust.
But also...why? Yeeting a function call into the void without any type knowledge seems way more bug-prone than interface/trait-based dispatch, to what benefit? Save developer time? I've spent countless dev-days of my life I won't get back debugging exactly this kind of dynamic-dispatched, json-dsl, frankly loosey-goosey untyped bullshit. There's so many better ways.
comment 5y ago · link · parent
I haven't used pydantic's ORM integration, but I don't hesitate to use pydantic models everywhere as business logic classes unless I need ludicrous speed.
That's all opinion, but I'd definitely give pydantic a swing.
comment 5y ago · link · parent
I disagree. I've started using types from the ground up and it helps almost equally at every stage of the game. Also I aggressively rely on autocomplete for methods. It's faster this way than usual "dynamic" or "pythonic" python.
Part of it might be exactly because writing my datatypes first helps me think about the right abstractions.
The big win with python is maybe 2-10% of functions, I just want to punt and use a dict. But I have shifted >80% of what used to be dicts to Models/dataclasses and it's so much faster to write and easier to debug.
comment 5y ago · link · parent
The development process is totally different when you write structured types first and then write your logic. 10/10 would recommend.
Usual caveat: this is what makes sense to me and my brain. Your experience may be different based on neurotype.
comment 5y ago · link · parent
Ha yeah nice catch, that's why I added that in there. In this case the dictionary is slightly wrong.
> The defining aspect of parsing, that makes it difficult and an interesting thing to study, is that you're starting with a list and ending with a tree.
Ah, I didn't know that! Great bit to learn.
In that case, I will say that the "increase a data structure's rules" is a bit ambiguous.
I think my statement is still correct in that "a symbol could be a data structure," right? Like you could take a list of dicts and emit a tree of dicts.
But wait, a list is a kind of tree, or rather, there is a parse tree of recursive head/tail branches. So I think you could still argue List->NotEmptyList is a Parse because NEL requires a nonzero "head" and zero or one NEL as "tail."
comment 5y ago · link · parent
Not to steal vvillena's thunder, but that's pretty much the dictionary definition of "parsing"
> analyze (a string or text) into logical syntactic components, typically in order to test conformability to a logical grammar.
Parsing is taking some collection of symbols, and emitting some other structure that obeys certain rules. Those symbols need not be text, they can be any abstract "thing". A symbol could be a full-blown data structure - you can parse a List into a NotEmptyList, where there's some associated grammar with the NEL that's a stricter version of the List grammar.
comment 5y ago · link · parent
At the end of parsing, you have a structure with a type. After validation, you may or may not have a structure with that type, depending on how you chose to validate.
But I think the big win is, parsers are usually much easier to compose (since they themselves are structured functions) and so if you start with the type first, you often get the "validation" behavior aspect of parsing for "free" (usually from a library). Maybe title should have been "Parse, don't manually validate."
But if your type doesn't catch all your invariants, yeah it does feel kinda just like validation.
comment 5y ago · link · parent
comment 5y ago · link · parent
And I explicitly said "escape hatch" meaning language feature. You don't need that much indirection to get routers in Haskell, Rust, Go, C, C++... like I fail to see how implementing routers are a barrier in strict type system languages.
Is it easier in python or js? Sure. can't? hardly.
E: here's some vtable dispatch (unless that doesn't count as "dynamic dispatch") in Rust. Looks really straightforward.
comment 5y ago · link · parent
Writing 2/3 python is harder than writing either 2 or 3. Porting 2 code to 2/3 is about as hard or slightly more work than just converting straight to 3. But at the end of it, the benefit is your code can run in both environments.
So let's say instead of pulling the plug, py leadership says "Python '2.8' will only run 2/3 code." How is that any different? You're gonna have the people who already ported, who have no need for 2.8 cause they can run 3, and the holdovers who have yet to port from 2.7.
That's what I mean by there's no shim.
> The entire issue with Python 3 was that there originally was not, the core team had to be dragged kicking and screaming into carving it out through backports and reintroductions because their original strategy was not workable.
Maybe I got into the game too late then, but I don't recall it being this much of a dust-up.
"six" was released on pypi as 0.9.0 on Jun 28, 2010. 1.0 was in Mar 2011. Even if the py core team was dragged kicking and screaming, that's still 4 + 5 years of people who could have been porting, and weren't.
Basically, my primary point is, it was a damn hard problem, and I doubt there's much the core team have done better at the time. All the porting tools in the world won't get people to upgrade if they are resistant for any reason.
E: py3 was released in Dec 2008. So I guess those first two years might have been tough. But to me that seems exactly like the ripe time to work on the translation infrastructure and things like six, where you have public release but no immediate pressure to switch.
comment 5y ago · link · parent
They're still constantly finding bits of code that break cause some customer decided to switch from "delta" to “Δ” in some machine learning log output.