Better HN
topnewbestaskshowjobs
Log inSign up

sixbrx

1,118 karma · joined Nov 5, 2011 (15y ago) · 592 submissions

Submissions

comment 2y ago · link · parent

Better tell wikipedia: "The format indicates the first word starting with either case,'

https://en.wikipedia.org/wiki/Camel_case

comment 2y ago · link · parent

Thats not particular to postgres, that's the same in Oracle (or any other db following ISO case handling I believe), just with true (quoted) table name being all uppercase instead for the latter but with same error.

You can quote the table name in the create statement to get the camelcase table name. Just remember to quote in both creation and usage or neither, is a good rule of thumb

comment 2y ago · link · parent

Nah - camel's head can be tall just like the hump.

comment 2y ago · link · parent

Here's an example I constructed after reading the TS docs [1] about flow-based type inference and thinking "that can't be right...".

It yields no warnings or errors at compile stage but gives runtime error based on a wrong flow-based type inference. The crux of it is that something can be a Bird (with "fly" function) but can also have any other members, like "swim" because of structural typing (flying is the minimum expected of a Bird). The presence of a spurious "swim" member in the bird causes tsc to infer in a conditional that checks for a "swim" member that the animal must be a Fish or Human, when it is not (it's just a Bird with an unrelated, non-function "swim" member).

    type Fish = { swim: () => void };
    type Bird = { fly: () => void };
    type Human = { swim?: () => void; fly?: () => void };

    function move(animal: Fish | Bird | Human) {
      if ("swim" in animal) {
        // TSC infers wrongly here the presence of "swim" implies animal must be a Fish or Human
        onlyForFishAndHumans(animal); 
      } else {
        animal;
      }
    }

    function onlyForFishAndHumans(animal: Fish | Human) {
      if (animal.swim) {
        animal.swim(); // Error: attempt to call "not-callable".
      }
      // (receives bird which is not a Fish or Human)
    }

    const someObj = { fly: () => {}, swim: "not-callable" };
    const bird: Bird = someObj;

    move(bird);

    // runtime error: [ERR]: animal.swim is not a function
[1] https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...

comment 2y ago · link · parent

full time cleaners aren't cheap either

comment 2y ago · link · parent

I'm pretty sure the thunk would be tagged by the effects of the inner function, so couldn't be called from an external context not declaring those effects. That's what the effect tracking is for.

comment 2y ago · link · parent

invented the relational model rather

comment 2y ago · link · parent

i get triggered that the norm vars aren't ever really the norms but their squares

comment 2y ago · link · parent

Unison looks like a neat functional language. Do abilities subsume the role of type classes also (without any "effects")? If so, would there be a loss of efficiency for using pure abilities in this way (since a "handler" needs to interpret the ops)? Sorry I've only had a brief look so I'm not sure this makes sense.

Edit: Shorter: do you have type classes

comment 3y ago · link · parent

The vast majority of that time had neither modern humans nor anything like our civilization, so wouldn't really be relevant though. Hell at 600 million years ago there were just the first "complex" (not individually microscopic) life forms emerging.

Also the ups and downs in temperatures happened over a far longer period of time than what we're experiencing now, giving life more time to adapt.

comment 3y ago · link · parent

some databases such as Oracle do not support boolean literals or boolean at all as a user accessible type

comment 3y ago · link · parent

Great news!

comment 3y ago · link · parent

One advantage or Powershell though is that in it you can put something into the pipeline from anywhere in your code, even within imperative code like in the middle a loop, just by mentioning a bare value at nearly any spot. And traditional shells are the same way (though they only support byte streams output), where you can send stuff to stdout/err at any point.

But in nu, it's more like you're just dealing with collections as in most programming languages. If your collection isn't amenable to being generated by a simple expression like a map or fold, then you have to create a collection, prep the collection to be what you want it to be, then you return it.

In that sense it's really different from both Powershell and traditional shells, and more like just using a traditional programming language. So in Nu I miss being able to just "yield" a value from anywhere without staging into a temporary collection first.

comment 3y ago · link · parent

Yes I believe this is often used as part of Oracle's APEX (Application Expresss) tool which has similar goals to Omnigres. It's used to put together internal business CRUD and reporting apps very quickly for some orgs I've worked for.

comment 3y ago · link · parent

It's not the saturation at the peak absorbtion frequencies that is driving the warming, it's the widening of the curves which raises absorbtion levels in nearby frequencies. The "saturated" argument was one of the first objections when the science was poorly understood. Krauss's book Physics of Climate CHange has a good account of this history. Check IPCC summaries to see how many models from the literature predict flattening at 0.7C additional warming if we don't curb emissions (spoiler alert: slim to none with many positing 5C or more additional warming in the 2100's if emissions aren't curbed).

comment 3y ago · link · parent

Good article, but I wouldn't characterize MERGE as strictly better than the older "ON CONFLICT ..." for Postgres, because MERGE doesn't support any sort of RETURNING clause.

comment 3y ago · link · parent

I'd say it's JSX doing that because those attributes are clearly on the declarative/markup side of the divide, not the procedural/imperative dom manipulation side.

comment 3y ago · link · parent

It seems general programming is more in focus now, but for context, the "Programming in Lean" book was only completed recently as compared to the multiple theorem proving documents which have been around for a while. The Christiansen book looks worth waiting for though and I really hope Lean can gain popularity as a general purpose language.

comment 3y ago · link · parent

Powershell is good, but one downside is that you have to explicitly check the exit code of each external program called and stop the script yourself for non-zero exit codes if that's what you want to do. Ie. there's no "set -e".

You can make a helper function or commandlet of course, but it obfuscates the code and is a pain to distribute around always where needed. They argue that non-zero exit codes for errors in external programs is a convention that doesn't exist consistently where Powershell is used. OK, but all the programs I use do follow that convention and so I find that very painful.

comment 3y ago · link · parent

Similar thing noticed when visiting Korea as US natives. My wife was in a group that all headed off to the restroom at a restaurant just after getting a table, with a couple of in-laws who live there leaving their purses on the table. My wife exclaimed that they were forgetting their purses, to which they replied that it was on purpose and how else would they make sure somebody doesn't get their table!?

comment 3y ago · link · parent

That mirrors global average temperature in general for that time period. Apparently it was because we were pumping sulfates into the atmosphere at an amazing rate from the 1940's until the EPA was born. Sulfates block sunlight and so mask the overall warming, at the cost of polluting the atmosphere.

See for example: https://www.sciencenews.org/article/50-years-ago-scientists-...

comment 3y ago · link · parent

I hope they catch the pickup truck drivers who use their truck bed as a trash bin and then let the trash fly out randomly while they're driving (who could have known that would happen, right?). Probably not a problem in the UK but it drives me crazy how often I see it in the US.

comment 3y ago · link · parent

My wife and I had a recent bad experience on SouthWest, where we boarded the plane at Love Field in Dallas and then were made to wait 2.5 hours on the tarmac, because their IT system had a different passenger count than what the crew counted. After several attempts at counting again, they ended up having to go to each passenger row by row with a manifest in hand, and verify the passenger boarding pass and driver's license. I think aside from their IT system problems, this situation was made worse because as a passenger you don't have an assigned seat, so it's not obvious when someone is missing or a seat has two or more contending passengers.

comment 3y ago · link · parent

R's pretty serious about it, it's why for example length("abc") returns 1, which is a head-scratcher for people coming from Python.
12345
20