Wikipedia:Reference desk/Archives/Computing/2014 March 14

= March 14 =

Maze generating with recursive backtracker
Please comment the (pseudo)code given in the article.
 * Talk:Maze generation algorithm

CiaPan (talk) 09:01, 14 March 2014 (UTC)

Jumping into a register
What modern CPUs, if any, can fetch an instruction directly from a register, to optimize the case where it is being written just before being stepped into? (As an example of a use for this feature, during an undergraduate assignment, I had a program that worked by copying an instruction from an array on each pass of a loop, then stepping onto the address where it had been copied; on the virtual CPU architecture we were coding for (which had no caches), this was more efficient than a jump table, because all the subroutines were a single instruction. But as I understand Intel and AMD's x64 architectures, this would not be efficient on them, because the fetch/decode for the affected thread would stall while the instruction was being written from the register to the L2 cache to the L1 instruction cache.) Neon  Merlin  13:58, 14 March 2014 (UTC)
 * It's hard to see how that would work, since (a) lots of machine instructions make use of bytes that immediately follow the instruction pointer, and (b) how would the machine know what instruction to execute after the one that is encoded by the register? Looie496 (talk) 14:25, 14 March 2014 (UTC)
 * I'm pretty sure that no modern (or ancient) architecture supports this. It would presumably be pretty inefficient anyway, since decoding would be stalled until the register's value was available. Not to mention that it would introduce a dependency of the decoding unit on the value of a general-purpose register, which would probably require a lot of new wiring and control logic for an extremely rare use case. -- BenRG (talk) 20:02, 14 March 2014 (UTC)
 * The ICT 1900 computers allowed this. The address space was given by a base and limit and the first few words were identified with the registers - and they could be executed like normal store. A quick search with Google doesn't get me a match, but I see an ad "Great deals on ICL 1900. Grab a bargain on eBay today!" No eBay, that's a big fat porky pie!, you do not have ICL 1900's for sale! Ah just found it on Wikipedia ICT 1900 second paragraph. Dmcq (talk) 21:55, 14 March 2014 (UTC)


 * This is one of the things which look great to a pure computer scientist, but are Bad IdeasTM in real life. Self-modifying code is hard to debug, so the usual programs avoid it; viruses use it to hide their true nature. In decades long gone, self-modifying code was a powerful tool to write compact code. You could change a MOV AX,... instruction to ADD AX,... or SUB AX,... by changing its first byte. I have seen at least one program that does exactly that to avoid having three subroutines for those.
 * In many newer OSes, code cannot modify itself any more, mostly because the savings are insignificant now. - ¡Ouch! (hurt me / more pain) 07:12, 17 March 2014 (UTC)

can't play wikipedia audio video on safari
How do i play the embedded audio and video directly in my safari browser?Kshah13788 (talk) 17:31, 14 March 2014 (UTC)
 * See Media help (audio and video), which should be linked from videos and audio in browsers like Safari which lack native support. The Mac OS X section for Quicktime should work for both Windows and Mac OS X although I don't think you need to install iTunes on either OS, only the XiphQT codec.
 * On OS X it looks like you can also add WebM support via although I've seen reports it doesn't work very well and unlike the IE plugin it doesn't seem to be recommended by WebM. Perian may also work  although it's been abandoned by the official developers (but is still newer than the WebM plugin). I believe the wikimedia software is set up to provide Theora versions of every video so you shouldn't need WebM (except in rare cases such as when the conversion has not yet happened and the upload was in WebM) and it could potentially make things worse if the Quicktime codec does have problems.
 * As per the page, you have no option on iOS devices to playback on Safari.
 * Nil Einne (talk) 04:11, 15 March 2014 (UTC)