What are the sizes of tword, oword and yword operands?

Looking at the nasm source, it looks like: ‘oword”https://stackoverflow.com/”DO’ is 8 times as big as “word” (O for “octoword”), synonymous with dqword (“double-quad”); that would be 128 bits, corresponding to the size of an SSE vector register. ‘tword”https://stackoverflow.com/”DT’ is 80 bits (T for “ten bytes”), the full size of an Intel x87 floating point register. … Read more

What’s the size of a QWORD on a 64-bit machine?

In x86 terminology/documentation, a “word” is 16 bits because x86 evolved out of 16-bit 8086. Changing the meaning of the term as extensions were added would have just been confusing, because Intel still had to document 16-bit mode and everything, and instruction mnemonics like cwd (sign-extend word to dword) bake the terminology into the ISA. … Read more

Javascript: Move caret to last character

The following function will work in all major browsers, for both textareas and text inputs: function moveCaretToEnd(el) { if (typeof el.selectionStart == “number”) { el.selectionStart = el.selectionEnd = el.value.length; } else if (typeof el.createTextRange != “undefined”) { el.focus(); var range = el.createTextRange(); range.collapse(false); range.select(); } } However, you really shouldn’t do this whenever the user … Read more

Javascript: Words to numbers [closed]

Here’s my JavaScript replacement of @Greg Hewgill’s Python module, minus the testing from the bottom of the code: var Small = { ‘zero’: 0, ‘one’: 1, ‘two’: 2, ‘three’: 3, ‘four’: 4, ‘five’: 5, ‘six’: 6, ‘seven’: 7, ‘eight’: 8, ‘nine’: 9, ‘ten’: 10, ‘eleven’: 11, ‘twelve’: 12, ‘thirteen’: 13, ‘fourteen’: 14, ‘fifteen’: 15, ‘sixteen’: … Read more

Replace a whole line where a particular word is found in a text file

One approach that you can use on smaller files that can fit into your memory twice: $data = file(‘myfile’); // reads an array of lines function replace_a_line($data) { if (stristr($data, ‘certain word’)) { return “replacement line!\n”; } return $data; } $data = array_map(‘replace_a_line’, $data); file_put_contents(‘myfile’, $data); A quick note, PHP > 5.3.0 supports lambda functions … Read more

Converting words to numbers in PHP

There are lots of pages discussing the conversion from numbers to words. Not so many for the reverse direction. The best I could find was some pseudo-code on Ask Yahoo. See http://answers.yahoo.com/question/index?qid=20090216103754AAONnDz for a nice algorithm: Well, overall you are doing two things: Finding tokens (words that translates to numbers) and applying grammar. In short, … Read more

Python – tool for word learn

There are an unlimited number of ways to do that. You could make a script that just does this: print(“cats”) But, I don’t think that’s what you want. You’re looking for a Language Model. Again, there are many ways of doing this, from the fairly simple Bayesian model to a more advanced neural network language … Read more