386 karma · joined Jul 12, 2020 (6y ago) · 175 submissions
comment 2mo ago · link · parent
But for unioning a bunch of spark dataframes together i think
df = reduce(DataFrame.union, list_of_dfs)
is much nicer than df, *rest = list_of_dfs
for other in rest:
df = df.union(other)
People just get a bit funny, especially now you have to import it from functoolscomment 7mo ago · link · parent
I can't find the motivation to do anything at the moment. But if reddit or facebook get opened up i'll just scroll. It's almost like i've replace doing things with watching other people do things and that somehow makes me less likely to work on my hobbies because i'm not as good or far along.
AI has added to this, almost like, why bother bettering myself when I could probably shit out my idea in a handful of prompts? I need a dopamine fast or something. Might try staring at a wall
5.
Ask HN: What electrical engineering textbooks would you recommend?
1 points · by el_oni · 9mo ago · discuss
comment 1y ago · link · parent
Will take a look when i get to my laptop!
comment 1y ago · link · parent
comment 1y ago · link · parent
The specialty dark roast will have notes of cookies, chocolate, nuts. Lots of brown roasty flavour.
Starbucks tastes bitter. With very little nuance. (Unless you cold brew it, then you can leave most of the bitter behind)
comment 2y ago · link · parent
hell i do this if our tester hasn't managed to go over some aspect of our release. That way i get in writing from the product owner that he has OKd it, and if he sends me a teams message i ask him to email me confirmation.
comment 2y ago · link · parent
Sure. Writing C++ that utilises your resources effectively then writing bindings so you can use that in python is great. But with elixir, if I've got 8 cores and 8 processes, those 8 processes run in parallel.
If I want raw cpu speed I can write something in rust, c, cpp or zig and then call it still using elixir semantics.
Not to mention that with Nx you can write elixir code that compiles to run on the GPU. Without writing any bindings.
comment 2y ago · link · parent
But python doesn't vertically scale very well. A language like Elixir can grow to fit the size of the box it is on, making use of all the cores, and then without too much additional ceremony scale horizontally aswell with distributed elixir/erlang.
Elixir getting a good story around webdev (phoenix and liveview) and more recently the a good story around ML is going to increase it's adoption, but it's not going to happen overnight. But maybe tomorrows CTOs will take the leap.
comment 2y ago · link · parent
If you are going to iterate through some of the resulting thing but not all of it then the generator means you aren't throwing away a bunch of the work that you've done.
It can also be more cache friendly. It doesn't need to allocate a whole new lists worth of memory.
One of the downsides of it being lazy is that if list x is mutated between when you create the generator and when you consume it then those changes are reflected in the generator.
I've done some micro benchmarks and it really depends on what you are doing. Profiling it with cProfile, Pyspy or using %timeit in an Ipython shell will tell you if it makes a difference.
comment 2y ago · link · parent
Multiple stages, conversations with team members,tech tests, psychology and aptitude tests. The only reason I turned the offer down is because they took several months to get me a contract and I didn't stop interviewing in that time
comment 2y ago · link · parent
When i was a scientist, speed was getting the code written during my break, and if it took all afternoon to run that's fine because i was in the lab anyway.
Even as i moved more into the software engineer direction, and started profiling code more, most of the bottlenecks come from things like "creating objects on every incovation rather than pooling them", "blocking IO", "using a bad algorithm" or "using the wrong datasctructure for the task". problems that exist in every language, though "bad algorithm" or "using the wrong datasctructure" might matter less in a faster language you're still leaving performance on the table.
> "Python is so slow that we have to write any important code in C. And this is somehow a good thing."
The good thing is that python has a very vibrant ecosystem filled with great libraries, so we don't have to write it in C, because somebody else has. We can just benefit from that when the situation calls for it
comment 2y ago · link · parent
There has been a lot of competition to make browsers fast. Nowadays there are 3 main JS engines, V8 backed by google, JavaScriptCore backed by apple, and spidermonkey backed by mozilla.
If python had been the language embedded into web browsers, then maybe we would see 3 competing python engines with crazy performance.
The alternative interpreters for python have always been a bit more niche than Cpython, but now that Guido works at microsoft there has been a bit more of a push to make it faster
comment 2y ago · link · parent
He dicusses techniques for this. one of which is a "migration" approach, similar to database migrations. Where, for example, you have a version number in your struct. and a function for migrating from an old version to a new version. I don't think he implements it in that video though.