I was always wondering if brains all these spiders and flies have the capability to reconstruct the surroundings in 3D like mammals do, or their sophisticated eyes are only light and motions sensors. Observing e.g. fly evading flyswatter which resembles random walk, it's likely the latter.
Their eyes are not going to have evolved past the point of providing any incremental benefit, and a fly is after all a simple critter who's main concern is finding a pile of shit to eat, and avoid being swatted by a cow's tail. I'd guess their eyes (& visual system) are perhaps better regarded as crude visual sensor rather than anything much like the visual system of an animal that benefits from recognizing whether that shitty ass belongs to a cow vs a tiger.
In general it may be the latter. Portia spiders in particular, though, will observe a target, observe their surroundings, then navigate a complex path around and through structures that block their vision of the target to reach a destination that will allow them to attack it. Suggesting very much that they form some kind of model of their surroundings, plan a path through it, and remember that path.
> The app also “triggers a text message (in real-time) to the registered owner of the vehicle, warning them that they had been found in violation of the mandatory hijab laws,
Honestly every time I worked on TypeScript codebase and the type definition "any" started popping out more and more often, I felt I'm starring into the abyss.
Sure, there's many other ways to type it, but none adds any kind of additional safety or strictness over Record<any, any> which was my point that `any` is the correct type in many cases, except when it widens a type.
But in my case it's not widening anything, in Record<A, B>, B can already be `any`thing.
People tend to see it as an unsafe escape hatch (which is how it is abused), but it's just a set of all possible types.
I know it's not equivalent, it was just an example to show what `any` does (and that it's more than "just a set of all possible types").
The `T extends Record<any, any>` on line 11 is a type parameter constraint though. Are you referring to something else when you say "constraining the type"?
'any' has always been intended as an escape hatch, so no abuse here [1]. The type representing the set of all possible values (the top type in the type lattice) is 'unknown'.
The widest possible function type is `(...args: never) => unknown`. This is because parameters are contravariant, and `never` is the bottom type. Using that type works in the author's example[0].
I've got an issue open about TypeScript's provided `ReturnType` type which is somewhat related to this[1].
That was the tipping point in transition from "we are serious and use static typing instead of lame JavaScript" into "ok we lost control over this thing".
People generally just give up after a while with the type system. I consider myself decent with TypeScript and you end up spending a good chuck of your time satisfying the compiler for something which is literally a one liner in plain JavaScript.
Well I failed one interview because to calculate number of days in between I suggested substracting Unix timestamps and dividing the difference by 86400.
I understand the interviewer wanted to approach the problem as non decimal number of months in a year and variable number of days in a month. One day as the most granular entity. I didn't even wanted to argue over leap years and why the year 1900 wasn't one. It was consecutive meeting in a row and I was too tired for his shit.
The lithium AA/AAA/CR batteries don't seem to leak. They're not widely available though. I use them for devices which mostly sit in a drawer and their lifetime can reach 5-6 years.
Primary lithium batteries absolutely do leak, given enough time. Often the victim is an old Mac motherboard, search for "mac pram battery ruined motherboard" on an image search engine of your choice.
Haha, you just reminded me about replacing motherboard CR battery. Recently I was fixing over five years old computer, noticed the battery and thought "What does it do, I wonder if it works, perhaps I should replace it?".
Tracking weather balloons. They use lithium AAs for power, and the mission only uses a fraction of their capacity. When the balloon pops and the payload lands, there's a good pair of AA's laying in some farmer's field, stuck in a tree, or otherwise sitting around waiting for you to clean 'em up.
I just watched a video with the battery replacement in Macbook Air. There is no way the laptop will switch on after I do it by myself for the first time.
Inconsistent style. Once global functions (that's so 2000), once prototypes (that's so 2010). No lazy loading, no modularization, no state management. Mixing variable declarations with initializations, one "var" declaration in the code. He probably haven't heard about TypeScript, transpilation, and doesn't understand static typing. Fells like a show off. That guy is an absolute no-no.
Was going to ignore this comment until the last 2 sentences. I rarely come across sites / articles that do this good of a job at explaining something I think calling it a "show off" and saying the author is an "absolute no-no" is a bit rude and I don't agree with it either. If anything I appreciate the code as it is, it's very readable at least to me.
My comment was /s of course. JavaScript from 2000-2010 era can do wonders especially if you leverage modern APIs and enormous performance of modern browsers, instead of silting it up with transpilation, frameworks, and layers of modules. Unfortunately simplicity is signalling a beginner and amateur in enterprise working environment.
reply