Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
goto11
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
89 ms
·
931.
▲
by
goto11
5y ago
Does your regex assumes that "-->" must be prefixed by a space? This is not the case in XML. (Also the string "--" must not occur inside a comment, so the last clause is not necessary.)
932.
▲
by
goto11
5y ago
So what do you use instead of regular expressions for such tasks?
933.
▲
by
goto11
5y ago
"Match open tags" obviously refers to writing a regular expression which matches opening tags, not to pair opening tags with end tags. If you look at the regex which the OP themself suggests, it is clearly only intended to match o
934.
▲
by
goto11
5y ago
So if using regular expressions is "bad practice", how should one write the tokenizer or lexer stage of a parser?
935.
▲
by
goto11
5y ago
If the task at hand is something which can be solved with a regex, then any other solution (e.g manual string scanning) would be far more complex.
936.
▲
by
goto11
5y ago
The headline says XHTML. HTML does not even have the self-closing tags the question is concerned about.
937.
▲
by
goto11
5y ago
The question is about XHTML, not HTML. HTML does not even have the self-closing tags the question is concerned about. In XHTML, either the opening angle bracket must be escaped, or the script should be in a CDATA section.
938.
▲
by
goto11
5y ago
The question is about XHTML though, not HTML which have a more complex syntax.
939.
▲
by
goto11
5y ago
The question is not about parsing at all. The question is about tokenization of XHTML. You can tokenize XHTML with a regular expression.
940.
▲
by
goto11
5y ago
Have any of the developers noticed the fundamental fallacy in the answer? The question is not about parsing, it is about recognizing a token in a string, which is exactly what regular expressions are designed for.
941.
▲
by
goto11
5y ago
The question is not about parsing, it is about tokenization.
942.
▲
by
goto11
5y ago
But you can argue against someone misunderstanding what a theorem says and applying it in the wrong context. The question is about tokenization, not parsing.
943.
▲
by
goto11
5y ago
A rebuttal here: https://www.cargocultcode.com/solving-the-zalgo-regex/
944.
▲
by
goto11
5y ago
Yeah, in reality Haskellers are more like: A monad is just like a spacesuit, whats the problem?
945.
▲
by
goto11
5y ago
Yeah, in reality Haskellers are more like: A monad is just like a burrito, whats the problem?
946.
▲
by
goto11
5y ago
The article is rather garbled, but as I understand it he is talking about a hypothetical effect, not something Pixar actually uses.
947.
▲
by
goto11
5y ago
Thanks for championing Rust!
948.
▲
by
goto11
6y ago
But isn't this the same if you add some field to a JSON structure? If code depends on it, you can't remove it. The risk of data loss from removing a JSON field would be exactly the same as removing a column.
949.
▲
by
goto11
6y ago
Conceptually it seems simpler to add a column to table rather than adding a property to some serialized structure. I wonder if it isn't a question of process and tooling encouraging the wrong thing? At least in other contexts I have se
950.
▲
by
goto11
6y ago
That is not what the article is about though.
951.
▲
by
goto11
6y ago
No. It doesn't even explain what "hyper-color" is.
952.
▲
by
goto11
6y ago
The term hyper-color does not even appear in the article. Pixar used color to "hack your brain" the same way Shakespeare uses language to hack your brain - i.e. they use it artistically to invoke emotion. That in itself is interes
953.
▲
by
goto11
6y ago
> If talking about music is, as someone once said, like dancing about architecture, then talking about color is like doing a trapeze act in zero-g on a space station. OK, but you could just show some screen-caps to illustrate what you ar
954.
▲
by
goto11
6y ago
The whole point of FizzBuzz is it is a trivial exercise. It could be any trivial problem. For some reason many applicants to software development jobs are simply not able to program even trivial stuff.
955.
▲
by
goto11
6y ago
Homer and Greek mythology was certainly not obscure at the time! The influence was pervasive in Western art and literature throughout history. In the middle ages it was mostly known through Latin sources, but deeply influential nonetheless.
956.
▲
by
goto11
6y ago
Cookies are sent with the first request, so the site can customize the response based on user ID. If the site uses local storage to identify the user , it will first have to send some bootstrap page which loads the id and sends it back. Muc
957.
▲
by
goto11
6y ago
OK I agree it was not intuitive to change the display-type to table-cell just in order to vertically center content. It basically mirrored how you would would vertically center in presentational HTML, except you didn't need to misuse t
958.
▲
by
goto11
6y ago
What do you mean "semantic"? CSS is for presentation, not semantics.
959.
▲
by
goto11
6y ago
You can do the similar in pure CSS with: foo { display: table-cell; vertical-align: middle; } And it has also worked a lot longer than the flex-approach. But now when flex is available it seem the more appropriate tool for the job.
960.
▲
by
goto11
6y ago
I guess programmers can mean different things with "easy to read", but to me it means "easy to understand by reading". This in turn has two aspects: How complex the meaning is, and how clearly the syntax express this und
More ›