Live data from Hacker News

What's up with all those equals signs anyway?

lars.ingebrigtsen.no

121–130 of 200 posts

Re: What's up with all those equals signs anyway?

#121

Earlier quoted context omitted.

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 eit…

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 `` tags in an HTML document, that doesn't require parsing it, and can indeed be done with regex.

Re: What's up with all those equals signs anyway?

#122

Earlier quoted context omitted.

> It's the same class of bug as manually parsing HTML with regex, it works right up until it doesn't I'm sure you already know this one, but for anyone else reading this I can share my favourite StackOverflow answer of all time: https://stackoverflow.com/a/1732454

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 eit…

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.

Re: What's up with all those equals signs anyway?

#123
post #8

Earlier quoted context omitted.

I am just wondering how it is good idea for a sever to insert some characters into user's input. If a collegue were to propose this, i d laugh in his face It's just sp hacky i cant belive it's a real life's solution

It's called escaping, and almost every protocol has it. HN must convert the & symbol to & for displaying in HTML. Many wire protocols like SATA or Ethernet must insert a 1 after a certain number of consecutive 0s to maintain electrical balance. Don't remember which ones — don't quote me that it's SATA and Ethernet.

Protocols that literally insert a bit are HDLC / PPP / CAN and they insert a 0 after a few 1s

Re: What's up with all those equals signs anyway?

#124
post #90

Earlier quoted context omitted.

Yeah, and using two bytes for a single line termination (or separation or whatever)? Why make things more complicated and take more space at the same time?

Remember that back in the mists of time, computers used typewriter-esque machines for user interaction and text output. You had to send a CR followed by an LF to go to the next line on the physical device. Storing both characters in the file meant the OS didn't need to insert any additional characters when printing. Having two separate characters let you do tricks like overstriking (just send CR, no LF)

True, but I don’t think there was a common reason to ever send a linefeed without going back to the beginning. Were people printing lots of vertical pipe characters at column 70 or something?

It would’ve been far less messy to make printers process linefeed like \n acts today, and omit the redundant CR. Then you could still use CR for those overstrike purposes but have a 1-byte universal newline character, which we almost finally have today now that Windows mostly stopped resisting the inevitable.

Re: What's up with all those equals signs anyway?

#125
post #61

Earlier quoted context omitted.

I prefer the question about CPU pipelines that gets explained using a railroad switch as example. That one does a decent job of answering the question instead of going of on a, how to best put it, mentally deranged one page rant about regexes with the lazy throw away line at the end being the only thing that makes it qualify as an answer at all.

For anyone wondering about the railroad switch post: https://stackoverflow.com/questions/11227809/why-is-processi...

This is new to me, and a wonderful dive that I wish I was aware of during my OS course. Thanks!

Re: What's up with all those equals signs anyway?

#126

Earlier quoted context omitted.

I just read it mainly in one place and through the web interface when I have to.

If your "in one place" reader is still open and downloading messages then there will be no messages to view in the web interface when you have to.

POP3 is more for reading and acting on your email in one place (taking notes, plan actions, discard and delete,…). No need to consume them on other devices as you’ve already extracted the important bits.

I use imap on my mobile device, but that’s mostly for recent emails until I get to my computer. Then it’s downloaded and deleted from the server.

Re: What's up with all those equals signs anyway?

#129

The most interesting thing to me wasn't the equals signs, which I knew are from quoted-printable, but the fact that when an equals sign appears, a letter that should have been preceding or following it is missing. It's as if an off-by-one error has occurred, where instead of getting rid of the equals sign, it's gotten rid of part of the actual text. Perhaps the CRLF/LF thing is part of it.

That's exactly how you end up with mystery missing characters in something that's supposed to be evidence
Post reply on HN