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

Sorry, coy “in my country” posting is one of my biggest online pet peeves. Why not just say that you mean Bangladesh?

I just say it so it doesn’t seem like I’m cherry picking a random example.

England had coal at the start of the Industrial Revolution.

England adopted free markets which started the IR.

Funny how differently people can perceive things. That's my least favorite SO answer of all time, and I cringe every time I see it.

It's a very bad answer. First of all, processing HTML with regex can be perfectly acceptable depending on what you're trying to do. Yes, this doesn't include full-blown "parsing" of arbitrary HTML, but there are plenty of ways in which you might want to process or transform HTML that either don't require producing a parse tree, don't require perfect accuracy, or are operating on HTML whose structure is constrained and known in advance. Second, it doesn't even attempt to explain to OP why parsing arbitrary HTML with regex is impossible or poorly-advised.

The OP didn't want his post to be taken over by someone hamming it up with an attempt at creative writing. He wanted a useful answer. Yes, this answer is "quirky" and "whimsical" and "fun" but I read those as euphemisms for "trying to conscript unwilling victims into your personal sense of nerd-humor".


There's nothing that brings joy into this world quite like the guy waiting around to tell people he doesn't like the thing they like.

The whole argument hinges on one word in your post: arbitrary.

I parse my own HTML I produce directly in a context where I fully control the output. It works fine, but parsing other people’s HTML is a lesson in humility. I’ve also done that, but I did it as a one time thing. I parsed a specific point in time, refusing to change that at any point.


It also hinges on another word: parsing. There are things other than parsing that you might want to do. For example, if you want to count the number of `<hr>` tags in an HTML document, that doesn't require parsing it, and can indeed be done with regex.

No you can’t. You can have an unescaped <hr> inside a script tag, for example. The best you can do is a simple string search for “<hr>” and hope it’s returning what you think it might be returning. Regexps are not powerful enough to determine whether any particular instance of “<hr>” is actually an HTML tag.

Like, it’s not a matter of cleverness, either. You can’t code around it. It’s simply not possible.


My Sony TV doesn't do this, thankfully

My Samsung Frame TV shows ads in the app bar and you cannot disable/remove them. They can’t even use the Google excuse because the TV runs Samsung’s OWN TizenOS.

They’re lucky it’s a good (beautiful) TV..


This doesn't really bother me. I just use my TV to watch Netflix.

Ofcourse Samsung has "sponsored" apps everything does.


Alcohol is flammable around 40%. French cooks aren’t using overproof brandy to do flambé.

Gunpowder doused in alcohol is, very famously for people interested in the history of rum, flammable if the alcohol is around 57.1% or higher, but straight alcohol/water without gunpowder is flammable at a lower strength than that.


Well, they still exist and you can still pay for things with them (though a lot of businesses won’t give you them in change, and just round up to the nearest $0.05).

I guess it’ll be a few years before they’re out of circulation entirely.


True. Nevertheless, the fact that it even boots, after many years of it not working at all, is huge news.

> after many years of it not working at all

And by "many", we of course mean "2", because the M3 was only released 2 years ago.


Wow, you're absolutely right. Not sure why it felt like longer to me.

OpenOffice? Do you mean LibreOffice?

OpenOffice has been effectively dead for many years (though, maddeningly, Apache continues to publish it and squat the trademark); LibreOffice is the mainline where development continues.


[flagged]


Yes, the name confusion is bad, I'm not really sure what this has to do with the topic though.

Fn can only be called concurrently if its environment is Sync, which is often true but not necessarily.

It’s more precise to say that Fn can be called even when you only have shared access to it, which is a necessary, but not sufficient, condition for being able to be called concurrently.


I'm not sure myself, does Fn correspond to reentrancy or is there some detail I am missing?

`Fn`, `FnMut`, and `FnOnce` can also implement and not implement `Sync` (also `Send`, `Clone`, `Copy`, lifetime bounds, and I think `use<...>` applies to `impl Fn...` return types).

EDIT: https://news.ycombinator.com/item?id=46750011 also mentioned `AsyncFn`, `AsyncFnMut`, and `AsyncFnOnce`.


The least restrictive for the caller is Fn (you can call it whenever), then FnMut (you can call it only if you have exclusive access to it, as many times as you want), then FnOnce (you can call it only if you have exclusive owned access, and calling it once destroys it).

The least restrictive for the function itself is the opposite order: FnOnce (it can do anything to its environment, including possibly consuming things without putting them back into a consistent state), followed by FnMut (it has exclusive access to its environment, and so is allowed to mutate it, but not destroy it), followed by Fn (it has only shared access to its environment and therefore is not allowed to mutate it).

Since these orders are inverses of each other, functions that are easier to write are harder to call and vice versa. That’s why they implement the trait with the minimum amount of power possible, so that they can be called in more places.


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

Search: