HN user

jrandm

170 karma
Posts2
Comments69
View on HN

might be easier [...] just working at a bank

Reminded me of this Key & Peele sketch: https://www.youtube.com/watch?v=jgYYOUC10aM

    Robber 2: So how do we get the money?
    Robber 1: That's the beauty of it, bro. They deposit the money into our bank accounts, week after week, month after month. They're not even gonna know they're being robbed! And then 20-30 years later, we walk out the front door like nothin' even happened.

My biggest pointer would be to remember that Java & JavaScript aren't named that way by coincidence. They're two different approaches to a similar problem. Java suffers from Enterprise Development (eg: Enterprise FizzBuzz[0]), JavaScript suffers from Ultimate Accessibility (eg: how many questions on Stack Overflow conflated jQuery and JS?).

How should exceptions be managed? [...] Has there been a debate about best practice? Where can I find it?

I suggest you handle the errors you can and otherwise let it crash.[1][2] Debates in NodeJS-land have steered towards more monadic/Result-like structures and working synchronous-looking try/catch onto async/await. NodeJS and its various components are open source, you'll have a lot of luck looking around on GH for issues & PRs related to a feature -- same for the language, ECMAScript[3] officially.[4]

Since you mentioned Clojure, have you looked at ClojureScript?[5] That may be a good entry to JS authors & articles you'd enjoy.

I have the impression that NodeJS is a bit more magical than the JVM [...] Is that correct? Where are good resources on this subject?

As other replies have mentioned, you're really talking about V8[6] for the "JSVM" executing that code. A thing I've seen throw some people for a loop is how minimalist the specification actually is.[7] The magic in NodeJS is certainly from V8 and the rate of optimizations there but also libuv,[8] what actually powers the infamous event loop.

Hope that helps!

[0] https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

[1]: Borrowing from Erlang, see Making reliable distributed systems in the presence of software errors, Joe Armstrong, page 104 "Error Handling Philosophy" https://erlang.org/download/armstrong_thesis_2003.pdf

[2]: _Most_ kinds of errors will cause the process to crash if you don't handle them, https://nodejs.org/dist/latest-v16.x/docs/api/errors.html . Promise rejections don't (yet) though it will log a warning, and callback-based APIs will always consist of an [error, data] tuple for the arguments

[3] https://github.com/tc39/proposals

[4]: Because Oracle owns the trademark, of course: http://tarr.uspto.gov/servlet/tarr?regser=serial&entry=75026...

[5] https://clojurescript.org/

[6] https://v8.dev/docs

[7]: "ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are no provisions in this specification for input of external data or output of computed results. Instead, it is expected that the computational environment of an ECMAScript program will provide not only the objects and other facilities described in this specification but also certain environment-specific objects, whose description and behaviour are beyond the scope of this specification except to indicate that they may provide certain properties that can be accessed and certain functions that can be called from an ECMAScript program." https://tc39.es/ecma262/#sec-overview

[8] https://github.com/libuv/libuv

You can just look at pure user counts and see they are more usable/accessible overall

User counts are a poor comparison when you consider how much the pool of potential users has grown.

As points to reference, Microsoft Windows 95 sold 7 million copies in its first 5 weeks so call it ~73 million copies sold the first year.[0]

20 years later in 2015, Samsung, Apple, and Huawei combined sold ~73 million phones across 5 models.[1] Windows 10, released that same year, had Microsoft shooting for it installed on 1 billion devices within 3 years.[2]

2005 estimates 1 billion (or 16% of the global population) online. 2020 estimates 4.9 billion (or 63% of the global population) online.[3] A million users used to be a big deal not that long ago.[4]

Not that I disagree we've gotten better at some things but Outlook Express (newsgroups) and mIRC (irc) seemed plenty accessible to millions of non-technical users.

[0] https://news.microsoft.com/announcement/launch-of-windows-95... - when searching for a number I saw first-year estimates at ~40 million

[1] https://en.wikipedia.org/wiki/List_of_best-selling_mobile_ph...

[2]: They made it in 5, https://www.theverge.com/2020/3/16/21116762/microsoft-window...

[3] https://www.itu.int/itu-d/reports/statistics/2021/11/15/inte...

[4] https://en.wikipedia.org/wiki/The_Million_Dollar_Homepage ; https://www.youtube.com/watch?v=4e0n7vTLz1U

Math Goblins 5 years ago

I think most of the Monty Hall confusion comes from focusing too much on the question and the math and missing the important part: The confusing setup is part of the game! Essentially it works like this:

Host: Contestant, please choose one of the 3 doors

Contestant: I choose door #1

Host: Confusing jibber-jabber to raise tension and keep this fun to watch

Contestant: I don't know what to do!

Host: Do you think the prize is behind your selection, door #1, or behind any of the others?

Expressed this way there's no confusion but it's the exact same problem. The contestant first selected 1/3 doors and the host is offering to let Contestant keep that 1/3 or choose the other 2/3. Any obfuscation in between is intentional for the sake of the game.

Math Goblins 5 years ago

If it helps any, you're supposed to be misled by the setup.

Monty could have asked the question as "Do you want to stick with the door you chose or do you think it's in one of the other two?" and skipped even opening one of them but that wouldn't have been as fun to watch.

they can always lend their own account to their kids, which would disable the mechanism

Current technology means statements like this are not necessarily true (these are all referring to the same story, Chinese language link last):

https://www.theregister.com/2021/07/08/tencent_facial_recogn...

https://www.nytimes.com/2021/07/08/business/video-game-facia...

https://mp.weixin.qq.com/s/Cr17TKWQ3XcuNzDw085OLw

    > the new feature sees the company check accounts registered in adults’ names if
    > they are playing games between 10:00PM and 8:00AM.  The company will then run a
    > facial recognition test and, if it identifies someone who is not the account
    > holder, they’ll be booted offline.  “Anyone who refuses or fails face
    > verification will be treated as a minor,” according to a machine translation of
    > Tencent’s QQ post.

My favorite working situations are when asking "stupid" questions and/or burning 6-12 hours on a subject is normalized and endorsed. I don't expect to live long enough to transcend anecdote, but both are necessary to learn and that's almost always important. I certainly had this in academic environments but they were somewhat cloistered or the educators expected them to be. In jobs like sysadmin/programming 6-12 hours on a thing could be 1 day or 15.

The 30-90 minute rule is to force people to search for answers themselves. If you don't know why that's necessary, I encourage you to spend several hours answering questions on sites you browse for answers (SO, HN, reddit, IRC, twitter, discord, slack, zoom, signal, mailing lists, GH issues, bugzilla, phpbb, anything) -- it'll take less than a week. People exist that don't do basic reading or research and will expect you to do everything for them. You'll get jaded.

The downside to this environment is a sort of pathological self-reliance. That's when these rules become upper limits: to keep someone from chasing waterfalls ( https://www.youtube.com/watch?v=NoKufWbP_L4 ). Collaboration always helps, some personal research is always needed... when to mix them varies.

Learn D3 6 years ago

This may feel like cheating, but it’s okay! Examples are not merely reusable templates but tools for learning, hinting at subjects for study. “Breaking” an example by tinkering—changing stuff and seeing what happens—helps you achieve understanding faster than passive reading.

I haven't had to use d3 in anger for some time but have an idea that means I need to re-learn it; I haven't finished yet but this is a great article. Thanks all for writing and/or sharing it.

When collaborating over ambiguous topics where the potential to be misunderstood is high, you need to use the "richest" communication channel possible. Body language, facial expression

I would dispute that body language and facial expression are somehow always correctly interpreted or unambiguous, like most forms of communication.

Written word, or a series of characters in a string, as I think we in a technical forum with many programmers in particular can appreciate, can in fact remove quite a bit of ambiguity if everyone is careful about what they type.

Github has many examples of this in-progress.

If the pen is mightier than the sword; transferring long-form information via Twitter is like leaving hand grenades lying around.

(The above sentence is 129 characters, feel free to tweet it)

I'm not trying to disparage this person, and I suspect he might even agree based on the screenshot of the message posted in Slack, I'm just wondering why we all keep treating this like it's normal.

Slack even has posts and (public?) file sharing as part of the product he could use to distribute this information!

I am not sure about Edge specifically, but as someone who tries to use mostly open source software: Digital Rights Management (DRM) requirements often directly conflict with licensing related to open source software.

HTML 4.01 is relevant to HTML5 in that it was the direct precursor to HTML5.

Put another way, when I learned a lot of the HTML we all use every day there was no HTML5.

By agreeing with the original reply and looking into why, I saw that it was defined in a specification I have read several times (HTML 4.01[0]). I knew CODE being vague was a thing and was part of why I didn't use it much, so seeing SAMP was similar explained why it would have slipped my mind or I totally glossed over it.

Another reply pointed out that <pre> is the block-level styling element I want and that <code> or <samp> make more semantic sense inline and nested. This does make sense to me and I thought it was funny that in a technical document like an HTML specification they would note the importance of the elements in technical documents but not give any example or further explanation.

Yet another reply corrected me again, that SAMP is defined with a monospace font-family in the CSS2 specification[1]! Now I can complete why I used to be wrong and now am not: <pre> always worked by default to get a monospace font and preserve literal whitespace in rendering. <samp> may have, I'd be interested to know but not interested enough to do research into old browsers' specific rendering. The entire <samp> thing was effectively unknown to me. <code>, while similarly defined in HTML, did not have that default font set and thus would not work in a spec-compliant browser by default unless they extended the specification in that browser. That is why in my head I used to prefer <pre> over <code> and that was all; and also why I enjoy posting in communities like these!

If I'm not mistaken, even Google amp is considered valid HTML5?

So far as I know (I haven't kept up with this level of detail in AMP) it is entirely implemented via some subset of HTML/JS/CSS: presumably any Google AMP would then include valid HTML5.

[0]: linked in my original post

[1] https://drafts.csswg.org/css2/sample.html

Thank you for laying that out clearly!

I pointed out the irony of not giving an example|intended use in a technical document because if a line or two like that was in the HTML 4.01 specification I probably would have written more-correct HTML since sometime in the early-mid ~2000s. I guess I'm glad my reading comprehension has improved but it also shows pretty clearly why it's the old spec.

Thank you for pointing that out! <samp> does indeed have a default font-family of monospace there.

And <code> isn't defined at all! I'm not disputing this is all internally consistent or that I used to write what I'm now learning is incorrect HTML, this completely explains what I used to know about the tags and I love it:

I didn't know or forgot <samp> was a thing for whatever reason. I know HTML5 is big and I don't know it all, HTML4 is much less so and I usually do.

I always prefer <pre> when I'm writing HTML to show intentionally-monospace blocks like code or code output because <code> is inconsistent, importantly for me it meant sometimes it didn't|doesn't work. Here I now know why: The CSS2 stylesheet doesn't define anything for <code>!

Other replies have described how it makes more literal/semantic sense to nest these things together and I agree completely; many times I am surprised at how elegant these old specifications are, if indirectly.

That's an odd nit to pick and I don't think it's accurate. In case you haven't heard the term sous-chef[0]:

Sous-chefs are in charge of making sure all kitchen equipment is in working order. [...] Under the oversight of the sous-chef, downtime should be used for prepping, cleaning and other kitchen duties.

In the body of a document titled "Mise en Place Writing," I do believe the author meant exactly that chefs[1] are the ones making sure all forms of preparation are completed, even if it means working the prep station.

In fact, I'd go so far as to say I'm certain this particular author checked a resource like a list of culinary terms or restaurant terminology[2] during a "pre-writing" phase like "Research" before using those words at all.

[0] https://en.wikipedia.org/wiki/Sous-chef

[1]: "A chef is a trained professional cook and tradesman who is proficient in all aspects of food preparation" emphasis added by me, https://en.wikipedia.org/wiki/Chef

[2] https://en.wikipedia.org/wiki/List_of_restaurant_terminology

I'm guessing because they were inconsistently supported by browsers, because me too!

I was even more surprised to see it in the HTML 4.01 spec, but if you look it makes more sense. I'll quote every mention of it here but the table of contents line:

    9.2.1 Phrase elements: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and ACRONYM
    
    <!ENTITY % phrase "EM | STRONG | DFN | CODE |
                       SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
    
    SAMP:
        Designates sample output from programs, scripts, etc.
CODE is equally well defined -- neither even mention monospace!

The other phrase elements have particular significance in technical documents

HTML never ceases to amaze me. This also explains why I still prefer <pre> even though I can never remember why it's <pre> and not <code>.

Almost forgot the link: https://www.w3.org/TR/html401/struct/text.html#h-9.2.1

I suggest giving a link to the rendered version of the quickstart sheet or some other "at a glance" list of the rendered elements.

While I appreciate the dogfooding and clever presentation style, it's adding some unnecessary steps when I want to see how you chose to style specific elements.

Regardless of how you feel about Bootstrap, I think their documentation[0] does this well. water.css[1] linked in another reply here does it even better (admittedly it's less complex).

[0] https://getbootstrap.com/docs/4.4/components/alerts/

[1] https://kognise.github.io/water.css/

If I want to find anomalies among them, what would be the way to go?

What is an anomalous JSON file other than a JSON file that does not meet the specification[0]?

I have never gotten a "strange error" from a JSON parser. Most JSON parsers are very specific about whatever character they dislike. I would suggest that the algorithm you're seeking is in fact whatever is giving you the error.

If you're speaking to an API returning JSON, then you should be able to determine what the API is supposed to return to you. Many times different responses contain meaning about why the response is different than expected, like HTTP status codes.

Deep learning is a tool to use to solve a problem. Until you have a well defined problem it will be difficult to apply various machine learning techniques to it.

[0] https://www.json.org/json-en.html

I really enjoyed this article and agree with other replies about the content.

Additionally it's the first time I think I've seen a styled scrollbar that fit into a site (ie: wasn't a demo of styling a scrollbar) since Angelfire/Geocities/etc -- I know it's been a long time because I actually checked the source and realized I didn't even remember the CSS names, just doing it in IE!

https://support.zoom.us/hc/en-us/articles/214629443

Has more information and browser support/feature tables.

Thanks a ton for posting this. I don't use Zoom as much as I used to but I know the browser client didn't use to exist. I can't vouch for how well it works to anyone reading this, but I prefer browser clients in general if possible and will try it out to anyone from Zoom. Your email QA was helpful years ago and sent a Linux build with more debugging[0] so you could fix some issue when that was still new!

[0] I don't remember the details now, I don't think they were anything particularly exciting then. I appreciated the "Yep, we've heard about it, can you run this version and email us the logs when it happens again?" That's all I remember so I think we can assume they fixed it.

The essay is funny. Per the SAT's own published rules, they are not graded on fact at all; purely rhetoric, vocabulary choice, and clarity. All of the prompts also usually include a historical figure or event of some sort -- you don't need to know anything about them other than what the prompt tells you

When I realized this applied to a lot of required essays -- ie, they can be fiction or satire -- I had a lot more fun writing papers. I wouldn't exactly recommend it but can confirm it doesn't completely tank your GPA.

I believe you're focusing on the days aspect of that equation without considering what a lower T_double/p_detect could mean relative to hospitalizations.

If the real number of cases is doubling significantly faster than those detected -- say due to not testing them because their symptoms are mild enough to be missed entirely or to not seek treatment -- the calculations around things like mortality rate and severity of illness may yet change. As I understand it, scientists have already identified mutations of the virus that may also impact its ability to spread or injure infected hosts. I should note that these changes can swing both good and bad, I'm simply pointing out that there are more variables and that these variables changing may represent something not obvious from the equation.

I'm not an expert; I have fun reading about medical statistics. Most papers I've read take the time to examine these various confounding factors and what unexpected variations in their proposed equations might mean.

As a software giant Microsoft's products intersect most parts of most economies. A hotel chain has its own technology needs and has views of the technology needs of its customers.

Whether a high-placed member of Marriott has specific insights to Microsoft I don't know, but I don't think it takes much imagination to fill in hypothetical reasons the person could be helpful.