Hacker Newsnew | past | comments | ask | show | jobs | submit | Kyro38's commentslogin

We also had them in Grenoble, south of France.


You might want to play with https://jsdate.wtf/

One can't fathom how weird JS Date can be.


Guessed 2 of the first 3 questions.

Got to question 4 and gave up:

    new Date("not a date")
    1) Invalid Date
    2) undefined
    3) Throws an error
    4) null
There's literally no way of guessing this crap. It's all random.


I think you got it backwards. The only way is guessing, it's all random.

It's the internal inconsistencies that get me. Like, OK, I understand that there might be some quirks, maybe due to some weird backwards compatibility or technical limitation, but there are multiple incompatible quirks _inside_ this single interface! It's terrible, and things like this are a huge part of the reason JS was long considered (and sometimes still is) a Not So Good language.


I had no idea we even had an `Invalid Date` object, that's legitimately insane. Some other fun ones:

    new Date(Math.E)
    new Date(-1)
are both valid dates lol.


the new Date() constructor is an amalgamation of like 5 different specs, and unless the input matches one of them, which one kicks in is up to the implementer's choice


The choice here is really surprising. I was half-expecting NaN, that you omitted.

Is there any other instance of the standard JS library returning an error object instead of throwing one? I can't think of any.


I think NaN itself is a bit of an error object, especially in how it's passed through subsequent math functions, which is a different choice than throwing up.

But besides that I think you're right, Invalid Date is pretty weird and I somehow never ran into it.

One consequence is you can still call Date methods on the invalid date object and then you get NaN from the numeric results.


The fun trick is that Invalid Date is still a Date:

    > let invalid = new Date('not a date')
    > invalid
    Invalid Date
    > invalid instanceof Date
    true
You were half-correct on expecting NaN, it's the low level storage of Invalid Date:

    > invalid.getTime()
    NaN
Invalid Date is just a Date with the "Unix epoch timestamp" of NaN. It also follows NaN comparison logic:

    > invalid === new Date(NaN)
    false
It's an interesting curio directly related to NaN.


> Invalid Date is just a Date with the "Unix epoch timestamp" of NaN. It also follows NaN comparison logic: > > > invalid === new Date(NaN) > false

This is just because a JS Date is an object and have nothing to do with the inner representation.

    > new Date(0) === new Date(0)
    false


The issue has been fixed on Chrome: https://issues.chromium.org/issues/391788835

But ligature is indeed still visible on Google search.


https://chromium-review.googlesource.com/c/chromium/src/+/62...

Gotta love that the patch isn't fixing the font, but adding a rule for domain names which contains a substring similar to the ligature name...


fixing the font does not help those that downloaded the font and won't get the new version. it also does not prevent malicious code from replacing the font on your machine with a version that has the ligature.

in fact this could be a novel attack vector. replace fonts on victims devices to hide the true address of a website. the fix then would have to be to not display any ligatures at all in website addresses, which in my opinion would be a smart change.


Disabling ligature rendering in the omnibox seems significantly more sane and safe than this (why wouldn't you do that already?! URLs need to be displayed clearly - not be "aesthetically pleasing").


> fixing the font does not help those that downloaded the font and won't get the new version. it also does not prevent malicious code from replacing the font on your machine with a version that has the ligature.

Fixing the code doesn't help users that downloaded code and don't get the new version either.

Malicious code that can replace a font can replace a lot more too.


right, but a replacing a font is much easier than replacing a browser.


I can imagine a group of excited guys coming up with that idea as something cool, and then the whole thing slowly evolving into a yet another branding tool.


Guess I'll have to come up with a different domain name for my new business MakeLogoLigatures :(


Neat to see how impressed the Google team was at how novel this issue was.


I imagine the overlap between number of people who know about google_logo and that the Omnibar is set it Google Sans is quite small.


And look, a working bug bounty program!

“$10,000 for report of high-quality && high-impact security UI issue + $5,000 bonus for unique, novel cool bug -- this was a very neat discovery!”


OS-dependent? I don't see it on OS X.


You're just describing the swiss old single level carriages.


I wonder if grandfather post means the Einheitswagen IV (https://youtu.be/u3unRLu2BXM?t=90) or if they were already impressed with the IC2000 (https://youtu.be/T1IdUgrIjR8?t=63).

Although the LED lighting in the newer IC2000 is too cold for my liking.


I think it was the Einheitswagen that I liked. The IC2000 seems pretty spacious compared to the DB's RB trains, though maybe I'm not comparing apples to apples


There's also this interior of the Einheitswagen IV, which feels cosier than the one in the 1st video I posted: https://de.wikipedia.org/wiki/Einheitswagen_%28Schweiz,_Norm...


European SUVs aren't the same as the american ones. Lot of what are considered SUVs are much smaller (You can't compare a Peugeot 2008 to a F1500).


How much of those 75min are due to @typescript-eslint ?

Requiring the TS AST adds a massive overhead.


several years ago my iPhone 8 focus was broken after like 10K KM of riding.


Coal burning has increased in Germany, even more since the russian gas crisis (resulting from the Ukraine War).



This is actually not true (or was only very briefly true) [1] Germany has added a lot of renewables over the last couple years. And more than compensated their nuclear plants, which only played a minor role in Germany's electricity production at that point anyway. Of course Germany could have reduced the CO2 output even more if the nuclear plants hadn't been turned off. However, when the discussion heated up again last year it was basically already a moot point. Planning to decommission the plants was already too advanced. There was no personal, no company that wanted to operate the plants, no fuel, etc.

[1] https://www.energy-charts.info/charts/power/chart.htm?l=de&c...


Indeed, but this "too late to change course" just emphasizes Germany's poor (and fear/emotional based) long term energy strategy.


> And more than compensated their nuclear plants

The moment they shut down their last nuclear plant they had several quiet nice in a row. The total output of renewables was about 4% of the installed capacity.

So Germany had to burn copious amount of coal, and gas, and buy energy from France


For those downvoting:

Right now, as I write this, in Germany:

- Wind: 66.5 GW installed capacity. Generation: 1.82 GW, or 2.74% of that

- Solar: 69.1 GW of installed capacity. Generation: 0.38 GW, or 0.55% of that

- Hydro: 9.78 GW of installed capacity. Generation: 3.09 GW, or 31% of that

So Germany is busy burning gas (generation: 7.6 GW), coal (generation: 14.2 GW), and "bio fuels" (generation: 5 GW), and importing electricity from as far away as Norway


> IMHO typescript could just cut loose from its javascript compatibility. Why not compile it to wasm instead of transpiling it to javascript

In browsers the Wasm runtime doesn't have access to the DOM APIs. So that's wishful thinking ATM.


The author has an interesting game about "trust": https://ncase.me/trust/


Echoing all the others that this Trust game is great, I noticed something else that struck me in some of the "play with the dials" stages.

The game showed us that when you decrease the reward for Cooperate/Cooperate from +2 to +1, the Always-Cheats take over. But I tried increasing the reward for above the default of +2 to +3 or +4 and an interesting thing happened: The naïve Always-Cooperates actually took over!

It made me think about how a lot of cynical people -- of both sides of the political divide -- play the 'game' as 'cutthroatly' as possible. I think if you asked these people how they see the world, they'd tell you that "the system is rigged anyway" such that there's barely any benefit to cooperating. "So why shouldn't I exploit everything I can to get mine?" And in a world where there's arguably not enough reward for cooperating, I can see how people arrive at a cynical conclusion and become Always-Cheaters. This is why people who work for minimum wage generally don't want to work hard and provide great customer service. And it's why companies who employ them don't want to pay them a living wage and benefits. Both sides would tell you that the rewards of doing that aren't worth the risks or the cost.

If we could somehow bring about greater rewards for good-faith participation (working hard → a very high likelihood of affording a moderately nice lifestyle), I think a lot of cynicism would be outcompeted by more cooperative attitudes. Obviously I'd already be President of the World if I knew how to just make that happen, though.


That’s why the US was higher trust when uneducated people could get well paying factory jobs


Makes me wonder how you could apply this to social media.

What if you had a social media site where you could only see the same set of people? (Say, 150 people - Dunbar's number)

This isn't perfect by any means, but how would you fix it from there? Would you make it mix the population every few months? Maybe just comments/reactions are restricted to your cohort but you can see all posts? Would you mix the population based on some kind of score? Could that score be multi-dimensional?


It probably wouldn't work, because social media is voluntary. People can just reduce participation, or just leave, and find alternative ways to get whatever value they were getting from the social media site. Users stay because it's fun, or because their friends are staying (network effect); your proposed interventions would both frustrate the users and weaken or destroy the "glue" that keeps them coming back.

In contrast, those natural social networks of yore - tribes, villages - were all-encompassing, and you were stuck with them. The modern social networks that are strong - school, university, work - also have this strong "like it or not, I'm stuck here with this people" component. Sure, it's easier to change a job than a tribe, but it's still costly.


Adding a comment so this stands out. It's the game of Nicky's I come back to the most. A very interesting look into the game theory of trust.


Also liked the Parable of the Polygons about the shape of society: https://ncase.me/polygons

Hell, they are all great!


She has a bunch of really though provoking web mini games.

I always remember "parable of the polygons"

https://ncase.me/projects/

Everything seems fresh, though this door one was 2015.


I also really like "We Are What We Behold"[0], Nicky's projects are always clever and thought-provoking.

[0] https://ncase.itch.io/wbwwb


I love this game and think it is one of the most important things on the internet, but I hate the consequence. The intended message is great: cooperate and forgive so that you can live in a great society. The corollary is absolutely awful... If you let defectors win, you are responsible for creating the defection.


Indeed! It's awful, but all-too-true. Those who enable the bullies can be as bad for the group as the bullies themselves. Cultivating, protecting, and maintaining a peaceful and trustful society is an active effort, not a passive one.

“First they came for the Communists

And I did not speak out

Because I was not a Communist

Then they came for the Socialists

And I did not speak out

Because I was not a Socialist

Then they came for the trade unionists

And I did not speak out

Because I was not a trade unionist

Then they came for the Jews

And I did not speak out

Because I was not a Jew

Then they came for me

And there was no one left

To speak out for me”

—Martin Niemöller


I think game theory is really cool and all, but I'm not sure it actually has much relevance for analyzing human behavior. It is always taught in that way, to simplify it for undergrads, but the mathematical concepts, I think, are significantly more important than the "ethical" questions.


This one reminded me that this is a well-studied problem. It turns out cooperation is nearly optimal [1]

[1] https://en.wikipedia.org/wiki/The_Evolution_of_Cooperation


I liked playing this game! The art style, animations, and overall messages were a really good experience! I look forward to sharing this with my friends later.


Thanks so much for sharing this, deeply impactful.


All of the games made by them are really awesome I highly recommend


More about the prisoners dilemma it seems.


This was awesome, thank you for linking.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: