Better HN
topnewbestaskshowjobs
Log inSign up

MatmaRex

273 karma · joined Sep 15, 2013 (13y ago) · 129 submissions

https://www.mediawiki.org/wiki/User:Matma_Rex
Submissions

comment 6y ago · link · parent

Yeah, that's true. We also always use the RETURN_DOM_FRAGMENT / RETURN_DOM options, which avoids the issue according to the article (I don't think we serialize/reparse the output anywhere ourselves). And also, we forbid the 'style' tag, which seems to be required by the exploits (although that is just a lucky coincidence).

https://github.com/wikimedia/VisualEditor/blob/master/src/ve...

comment 6y ago · link · parent

In my opinion, having read parts of jQuery's source code on various occasions… You should only read it for entertainment value, it makes for fascinating brain teasers. Here's one snippet I had the opportunity to read recently:

  contains = hasCompare || rnative.test( docElem.contains ) ?
    function( a, b ) {
      var adown = a.nodeType === 9 ? a.documentElement : a,
        bup = b && b.parentNode;
      return a === bup || !!( bup && bup.nodeType === 1 && (
        adown.contains ?
          adown.contains( bup ) :
          a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
      ));
    } :
    function( a, b ) {
      if ( b ) {
        while ( (b = b.parentNode) ) {
          if ( b === a ) {
            return true;
          }
        }
      }
      return false;
    };

comment 6y ago · link · parent

.match() only returns the result of one match, rather than all the matches in the string. To do that, you'd need to use .matchAll() (which didn't exist in 2008), or write an awkward do…while loop. Using .replace() looks neater.

comment 6y ago · link · parent

Good one, but it looks like you need an /s on this board.

comment 6y ago · link · parent

There are wireless headphones using other technologies than Bluetooth. I'm currently using a Steelseries Arctis 7 and it has no perceivable latency (I play rhythm games with it).

And it indeed comes with a USB "dongle"/base-station, with a cable and about the size of a watch, so not really usable on a train etc. (I use wired headphones when working away from my desk).

comment 6y ago · link · parent

I haven't seen one either but I can easily believe it, as there are proprietary magnetic USB-C adapters that do not support data (they only have 5 or 6 pins). I can imagine a "normal" cable behaving the same way.

comment 6y ago · link · parent

I work remotely and my employment agreement actually states that "The workplace is determined in <my address>" in the first paragraph. Might be worth checking yours.

comment 6y ago · link · parent

It was a surprise for me as well, but people in the US dial into meetings using their phone all the time. I don't understand it either.

comment 6y ago · link · parent

Microsoft Surface devices use 3:2 (15:10), I've bought one pretty much only because of that and it's nice.

comment 6y ago · link · parent

Recent Excel has a much more convenient interface for formatting pretty graphs than I remember from ~10 years ago. The available options are mostly the same, there indeed aren't really any new features in that, but it has live preview and more "visual" ways to modify the graph, compared to the gruesome modal interfaces that I remember where you have no idea what will happen until you "OK" it.

comment 6y ago · link · parent

> ...But then again, shouldn't the Null symbol ␀ redirect to the page on the Null symbol, which it actually is, not the page on the Null character, which it only symbolizes?

Perhaps it should. That page actually did not exist when the redirect was created:

https://en.wikipedia.org/w/index.php?title=␀&action=history

https://en.wikipedia.org/w/index.php?title=Null_symbol&actio...

comment 7y ago · link · parent

It probably depends on the OS. I assume screenshots in the article are on Linux. On Windows it looks different still: https://i.imgur.com/ri2yUrR.png

comment 7y ago · link · parent

It's certainly complicated but I think there is no way around it if you want to have correct translations. The same kind of system is used for translating MediaWiki and it seems to work great there. Example message: https://translatewiki.net/w/i.php?title=MediaWiki:Logentry-b...

comment 8y ago · link · parent

Interesting. On my machine, Razer mouse drivers (RzSDKService.exe) seem to be leaking 2 handles every second.

comment 9y ago · link · parent

These were widely used for at least one thing in practice: adding support for :hover pseudoclass on arbitrary elements (not just <a>) in IE6. https://peterned.home.xs4all.nl/csshover.html

comment 9y ago · link · parent

Depending on the merchant and the bank, debit cards might not work. For example, the debit card from my bank will not work if used to pay at Amazon (allegedly the bank is too strict about payment details and Amazon doesn't provide something). I had to get a credit card specifically because of this (the debit card works everywhere else I tried it).

comment 9y ago · link · parent

I have a Surface 3 and it's doable. Mind that the device is also a bit smaller than the usual laptop, so there's enough space (on my knees at least) to place the kickstand.

comment 9y ago · link · parent

The reasoning can be found here: https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletio...

comment 9y ago · link · parent

There was a CGI young Arnold Schwarzenegger in Terminator Salvation, in 2009. Admittedly, that scene did not require many facial expressions: https://www.youtube.com/watch?v=L7YYfgx_cHo

comment 10y ago · link · parent

MediaWiki uses tabs for indentation and discourages alignment. https://www.mediawiki.org/wiki/Manual:Coding_conventions

comment 10y ago · link · parent

Right, recursion is elementary, I missed that one. (It's even pretty much a prerequisite for depth-first graph traversal.) As far hash tables, I agree it's important to vaguely know how they work and to know the performance characteristics, but I wouldn't consider it critical to know how to implement one from scratch.

comment 10y ago · link · parent

Depth-first and breadth-first graph traversal does come up. Example: you're implementing a task tracking system, where tasks can have dependencies. Boom, that's a graph. You want to display a whole graph of dependencies of a task (and dependencies of dependencies, etc.). Boom, there's graph traversal. You need to limit the number of tasks displayed in that graph, because someone added a thousand dependencies somewhere and now the graph rendering is choking up. Boom, traverse breadth-first and stop displaying more tasks after some preset number. This is an actual issue I ran into in actual code.

Now, about most of the other things that were mentioned… I'm not convinced.

comment 10y ago · link · parent

I think OP's list of essential algorithms is a bit too long. I agree that knowing what a binary search is, or graph traversal, is something that everyone writing code should know, and something that does come up reasonably often. (And recursion, heh.)

But binary trees? Last time I needed them was in a CS class. Linked lists? They only came up when I had to convince a coworker that we really don't need to implement one in JS, we only have 50 items here, and someone is going to forget to update a linked list if we use one.

comment 10y ago · link · parent

I have a tablet/convertible that does this (Thinkpad Tablet 2) and it's the most infuriating thing. It doesn't seem possible to turn it off.

comment 10y ago · link · parent

They changed it a long time ago.

comment 10y ago · link · parent

That screenshot is labelled "dramatic reenactment", which I believe is just another expression for "fake".

comment 10y ago · link · parent

The git-review plugin is not required, you can instead do `git push gerrit HEAD:refs/for/master` to push changes for review and use the snippets from the change's page to pull them. But it's easier to do `git review` and `git review -d` instead, and it doesn't require understanding or memorizing the weird push command. (I work on MediaWiki, by the way.)

comment 10y ago · link · parent

I use Gerrit everyday (I work on MediaWiki) and I'm not having any problems submitting multiple dependent commits. Yes, you need to rebase the newer ones if an earlier one was non-fast-forward-merged or if an earlier one is amended, but most of the time (if there are no conflicts) this is just a click on the "Rebase" button in Gerrit's interface.
12345