So, I started out by trying to find the 100th Fibonacci number using a recursive function and by memoizing the function using the following code.  Function.prototype.memoize = function () {     var originalFunction = this,         slice = Array.prototype.slice;         cache = {};     return function () {         var key = slice.call(arguments);         if (key in cache) {             return cache[key];         } else {             return cache[key] = originalFunction.apply(this, key);         }     }; };  var fibonacci = function (n) {     return n === 0 || n === 1 ? n : fibonacci(n - 1) + fibonacci(n - 2); }.memoize();  console.log(fibonacci(100));   Now, as you can see in  fiddle, JavaScript logs 354224848179262000000 as the result. The hundredth Fibonacci number is actually 354224848179261915075 according to  which is correct.  Now, my question is this. Why does the number compute incorrectly, even though the algorithm is completely sane? My thoughts point to JavaScript because according to 1, the two numbers are equal.  What is it about JavaScript that causes such an error? The number is safely within limits of the maximum value of an IEEE 754 number, which is 1.7976931348623157e+308.  1In case this could be a bug on my platform, I have tested this on both Chromium and Firefox on Ubuntu.
Is this defined by the language? Is there a defined maximum? Is it different in different browsers?
ffmpeg settings for converting still images to video for archival I need to convert a set of still images (static cameras pointed at a road) to a video.  I have considered video codecs such as Theora, H.264, VP8, VP9, HEVC, Snow.   The video should have a minimum size with the maximum image quality. Now, from all available command-line arguments, I'm using framerate (fps), b:v (bitrate) and s (width*height). Also, for H.264 and HEVC there are -crf and -preset.  What other command-line arguments can be useful to achieve what I'm after? In ffmpeg dozens of command-line arguments and parsing each can take a long time. I have a WordPress install on a dedicated server with decent memory (upwards of 8GB).  The WordPress install includes many plugins - 50 active plugins. Most important to note is the  plugin to make WordPress multilingual. The theme is .  The stack is LAMP - CentOS 6.3, Apache 2.4.4, Percona MySQL, PHP-FPM.  I have been quite stupid, and didn't set up a test or staging server.  Everything was running fine till I updated to WordPress 3.8, and also updated several plugins at the same time.  I didn't pay attention at the time, but all my widgets got messed up, and so did any sort of navigation etc.  I enabled error_log for a bit, i.e.  ini_set('log_errors',TRUE); ini_set('error_reporting', E_ALL); ini_set('error_log', dirname(__FILE__) . '/error_log.txt');   This resulted in an immense file - basically the error_log grows by about a GB every 4 minutes or so.  The primary error I found in the error log was database server disconnect, better known as      MySQL server has gone away   The first priority was to patch the problem. So I installed  plugin. This mostly, though not completely solved the issue. Many of the widgets came back.  However, the special (non-English) characters are all messed up (converted to question marks). I tried to fix this by opening wp-mysql-ping.php and commenting out   if ( !DB_CHARSET &amp;&amp; version_compare(mysql_get_server_info($this-&gt;dbh), '4.1.0', '&gt;='))                                     {                                         $this-&gt;query("SET NAMES '" . DB_CHARSET . "'");                                     }   Didn't help.  Besides, the plugin is not a permanent or complete solution. So leaving the site in this messed up state, I started working on other possibilities:  As suggested at , I edited my.cnf to add  wait_timeout = 60   Didn't help.  Also added caching to my.cnf  query_cache_type = 1 query_cache_limit = 8M query_cache_size = 512M   Didn't help.  (and yes, I restarted mysql every time I edited my.cnf)  Also tried the method : In wp-db.php before  $this-&gt;select( $this-&gt;dbname, $this-&gt;dbh );   I added  $this-&gt;query("set session wait_timeout=600" );   Didn't help.  I'm at my wit's end. Please help! When a function has a specific-size array parameter, why is it replaced with a pointer? Computing the cardinality of a combinatorial set Define two sets: $S_1$ and $S_2$ where we have that $a$ is an odd natural number and $b\in \mathbb{N}$, $S_1 = \Big\{ \frac{2}{a},\frac{2}{a-2},\frac{2}{a-4},...,\frac{2}{a-(a-1)},$ $\frac{2+4}{a+2},\frac{2+4}{a},\frac{2+4}{a-2},...,\frac{2+4}{a-(a-1)},$ $\frac{2+8}{a+4},...,\frac{2+8}{a-2},...,\frac{2+8}{a-(a-1)},$ $\vdots$ $\frac{2+4\lfloor\frac{b}{2}\rfloor}{a+\lfloor\frac{b}{2}\rfloor},\frac{2+4\lfloor\frac{b}{2}\rfloor}{a+\lfloor\frac{b}{2}\rfloor-2},...,\frac{2+4\lfloor\frac{b}{2}\rfloor}{a-(a-1)},$ $\frac{2+4(\lfloor\frac{b}{2}\rfloor+1)}{a+\lfloor\frac{b}{2}\rfloor},\frac{2+4(\lfloor\frac{b}{2}\rfloor+1)}{a+\lfloor\frac{b}{2}\rfloor-2},...,\frac{2+4(\lfloor\frac{b}{2}\rfloor+1)}{a-(a-1),}$ $\frac{2+4(\lfloor\frac{b}{2}\rfloor+2)}{a+\lfloor\frac{b}{2}\rfloor-2},\frac{2+4(\lfloor\frac{b}{2}\rfloor+2)}{a+\lfloor\frac{b}{2}\rfloor-4},...,\frac{2+4(\lfloor\frac{b}{2}\rfloor+2)}{a-(a-1)}$ $\vdots$ $\frac{2+4b}{a},\frac{2+4b}{a-2},...,\frac{2+4b}{a-(a-1)} \Big\}$ and $S_2 = \Big\{ \frac{2}{\lceil\frac{a}{2}\rceil}, \frac{2}{\lceil\frac{a}{2}\rceil-1},\frac{2}{\lceil\frac{a}{2}\rceil-2},...,\frac{2}{1}$ $\frac{2+2}{\lceil\frac{a}{2}\rceil+1},\frac{2+2}{\lceil\frac{a}{2}\rceil},\frac{2+2}{\lceil\frac{a}{2}\rceil-1},...,\frac{2+2}{1},$ $\vdots$ $\frac{2+2(\lfloor\frac{b}{2}\rfloor-1)}{\lceil\frac{a}{2}\rceil+(\lfloor\frac{b}{2}\rfloor-1)},\frac{2+2(\lfloor\frac{b}{2}\rfloor-1)}{\lceil\frac{a}{2}\rceil+(\lfloor\frac{b}{2}\rfloor-2)},...,\frac{2+2(\lfloor\frac{b}{2}\rfloor-1)}{1}$ $\frac{2+2\lfloor\frac{b}{2}\rfloor}{\lceil\frac{a}{2}\rceil+\lfloor\frac{b}{2}\rfloor},...,\frac{2+2\lfloor\frac{b}{2}\rfloor}{1},$ $\frac{2+2(\lfloor\frac{b}{2}\rfloor+1)}{\lceil\frac{a}{2}\rceil+\lfloor\frac{b}{2}\rfloor-1},...,\frac{2+2(\lfloor\frac{b}{2}\rfloor+1)}{1},$ $\frac{2+(\lfloor\frac{b}{2}\rfloor+2)}{\lceil\frac{a}{2}\rceil+\lfloor\frac{b}{2}\rfloor-2},...,\frac{2+(\lfloor\frac{b}{2}\rfloor+2)}{1}$ $\vdots$ $\frac{2+2b}{\lceil\frac{a}{2}\rceil-1},...,\frac{2+2b}{1} \Big\}$ The question is, how do I determine the cardinality of the intersection of these two sets i.e. how would I compute the value $|S_1 \cap S_2|$? Note that duplicates may appear within both sets such as $\frac{1}{2}=\frac{2}{4}$ etc. Therefore we must make sure that for each fraction $\frac{n}{m}$ we have $\text{gcd}(n,m)=1$. I am aware of the existence of , but not entirely sure if that identity would be useful here. How to understand the memory usage and load average in linux server I am using a linux server which has 128GB of memory and 24 cores. I use top to see how much it is used. Its output is pasted at the end of the post. Here are two questions:  (1) I see that each of the running processes occupies a very small percentage of memory (%MEM no more than 0.2%, and most just 0.0%), but how the total memory is almost used as in the fourth line of output ("Mem:  130766620k total, 130161072k used,   605548k free,   919300k buffers")? The sum of used percentage of memory over all processes seems unlikely to achieve almost 100%, doesn't it?  (2) how to understand the load average on the first line ("load average: 14.04, 14.02, 14.00")?   Thanks and regards!  Edit:  Thanks!  I also really like to hear some rough numbers based on used percentage of memory to determine if a server is heavily loaded, since I once became the one who cramed the server without understanding the current load.  Is swap regarded as almost the same as memory? For example, when memory and swap are almost of same size, if the memory is almost running out but the swap is still largely free, may I just view it as if the used percentage of memory + swap is still not high and run other new processes?  How would you consider together CPU or memory (or memory + swap) usage? Do you become worried if either of them reaches too high or both?  Output of top：  $ top    top - 12:45:33 up 19 days, 23:11, 18 users,  load average: 14.04, 14.02, 14.00 Tasks: 484 total,  12 running, 472 sleeping,   0 stopped,   0 zombie Cpu(s): 36.7%us, 19.7%sy,  0.0%ni, 43.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st Mem:  130766620k total, 130161072k used,   605548k free,   919300k buffers Swap: 63111312k total,   500556k used, 62610756k free, 124437752k cached    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND  6529 sanchez   18  -2 1075m 219m  13m S  100  0.2  13760:23 MATLAB 13210 timothy   18  -2 48336  37m 1216 R  100  0.0   3:56.75 absurdity 13888 timothy   18  -2 48336  37m 1204 R  100  0.0   2:04.89 absurdity 14542 timothy   18  -2 48336  37m 1196 R  100  0.0   1:08.34 absurdity 14544 timothy   18  -2  2888 2076  400 R  100  0.0   1:06.14 gatherData  6183 sanchez   18  -2 1133m 195m  13m S  100  0.2  13676:04 MATLAB  6795 sanchez   18  -2 1079m 210m  13m S  100  0.2  13734:26 MATLAB 10178 timothy   18  -2 48336  37m 1204 R  100  0.0  11:33.93 absurdity  12438 timothy   18  -2 48336  37m 1216 R  100  0.0   5:38.17 absurdity 13661 timothy   18  -2 48336  37m 1216 R  100  0.0   2:44.13 absurdity 14098 timothy   18  -2 48336  37m 1204 R  100  0.0   1:58.31 absurdity 14335 timothy   18  -2 48336  37m 1196 R  100  0.0   1:08.93 absurdity 14765 timothy   18  -2 48336  37m 1196 R   99  0.0   0:32.57 absurdity 13445 timothy   18  -2 48336  37m 1216 R   99  0.0   3:01.37 absurdity 28990 root      20   0     0    0    0 S    2  0.0  65:50.21 pdflush 12141 tim       18  -2 19380 1660 1024 R    1  0.0   0:04.04 top  1240 root      15  -5     0    0    0 S    0  0.0  16:07.11 kjournald  9019 root      20   0  296m 4460 2616 S    0  0.0  82:19.51 kdm_greet     1 root      20   0  4028  728  592 S    0  0.0   0:03.11 init     2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd     3 root      RT  -5     0    0    0 S    0  0.0   0:01.01 migration/0     4 root      15  -5     0    0    0 S    0  0.0   0:08.13 ksoftirqd/0     5 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/0     6 root      RT  -5     0    0    0 S    0  0.0  17:27.31 migration/1     7 root      15  -5     0    0    0 S    0  0.0   0:01.21 ksoftirqd/1     8 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/1     9 root      RT  -5     0    0    0 S    0  0.0  10:02.56 migration/2    10 root      15  -5     0    0    0 S    0  0.0   0:00.34 ksoftirqd/2    11 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/2    12 root      RT  -5     0    0    0 S    0  0.0   4:29.53 migration/3    13 root      15  -5     0    0    0 S    0  0.0   0:00.34 ksoftirqd/3 How to record both screen and sound with Quicktime on El Capitan? I'm trying to record both what's happening on screen and the audio being played by the applications. To my surprise, QuickTime did not record the sound. I believe it worked before in previous OS X releases, but that is not something that I use often so I have not bothered to try earlier.  What is the current situation on El Capitan ? Have I messed with something that prevents QuickTime from capturing the sound, or has it never worked ?  Here is my view of Quick Time  / New Screen Recording on a Mac Mini:   On my Macbook Pro, I have the option select None or Internal Microphone. Internal microphone actually records the speakers of the Mac Book as heard from its own microphone, which obviously sounds terrible.  This is a MacMini 7,1 (late 2014) and there is nothing in Input Sources. Inequalities for combinations of $\int f $ and $\int (1/f)$ where $m\le f\le M$ on an interval How can Yoda identify Darth Bane? In the final episode of season 6 of The Clone Wars, (spoilers)      The mystical priestesses conjure up an illusion of Darth Bane, the ancient Sith Lord who started the Rule of Two. Just by visual inspection, Yoda knows the ancient Sith Lord's name and that he was the one who started the Rule of Two.   Darth Bane was around roughly a century before Yoda was born. It also seems like all of the Jedi who ever encountered him did not live long enough to talk about it (for example, the duel on Typhon). By the time Darth Zannah took the mantle as Dark Lord of the the Sith, the Jedi were convinced that the Sith were extinct.   explains how the Jedi found out about the Rule of Two, but it doesn't explain how Yoda was able to learn about the identities of the members of the Order of the Sith Lords. I am in the process of updating my CV. Since I often get labeled as "the bioinformatician" I get to play with many different languages and technologies, and similarly what people expect from a bioinformatician varies from person to person. So I figured it would be a good idea to indicate how much I feel I know in respective fields/languages.  Inspired by , I came to wonder whether or not its acceptable to have self-assessed ratings of your technical skills, such as: proficiency programming languages, familiarity with relevant software etc.   My own feeling is that such ratings are useful to indicate what you feel most confident or comfortable with. It would also be useful to show any potential future employer the level of competence you have in different fields. If you think about it a bit, it is common to have some type of rating for the languages one speaks, so I think an analogue to programming language proficiency should not be that alienating.  On the other hand there is the risk of rendering your CV like, as a friend of mine put it, a role-playing game character sheet.   Is it common to have such ratings on skills? Are there any potential problems with it?   Edit: What I was thinking is a small listing something like: Prefer composition over inheritance? Multiple Bluetooth speakers simultaneously I would like to pair two sticky dude Bluetooth speakers, at one time with my iPhone. With two of them at once it would be like stereo sound. Is there an app or something maybe? How to disable the Windows8 volume On-Screen-Display? Here is a picture of what i am talking about.    I am at my wits end with that annoying thing, please somebody help me. How To Change The Fonts In Windows 8 In Windows 7, there is an option to change the fonts for things such as the active title bar, menu, etc. It was found by opening the Window Color and Appearance settings in the Control Panel. I just installed Windows 8 and would like to change the fonts, but I can't find anything to change the actual fonts (there is however a limited drop-down list to change a few font sizes in the appearance settings). Does anyone how to change the fonts used in Windows 8? Some three-digit (incl. minus sign) vote count still doesn't display properly Related:      As the title says...    The Android app version is 0.1.58.  Here is my experimental results:   Vote counts >= 200 that I've tried seems to be fine Vote count == 241 has problem, 242 doesn't Vote counts which matches /^1[012345689][0-9]$/ seems to be having problem (may be overgeneralized) Vote count == -36 definitely has problem   Note that this is not a tablet, but a 4-inch mdpi phone, of 480x854px. Sphere inside a conical vessel touches the lid A conical vessel with semi-vertical angle 30 degrees and height 10.5 cm has a thin lid. A sphere kept in the vessel touches the lid. The radius of the sphere in cm is ... I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI.  However, I'm not against using a free 3rd party script/service. How to show $\lim_{n \to \infty} a_n = \frac{ [x] + [2x] + [3x] + \dotsb + [nx] }{n^2} = x/2$? As you may know, Facebook allows users to choose a "vanity URL," allowing easy linking to one's profile. However, once set, this URL cannot be changed and this was done for security reasons, understandably.  I have a friend whose now ex-partner set the URL to be "herfirstname.hislastname" without her permission. She tried to change it after this, but to no avail.  Has anyone successfully contacted Facebook and got them to either disable the name and revert back to an ID or change the name to another? Can helium disappear from Earth? Helium is lighter than air, so it should fly off from Earth. Is it possible that in the future we will run out helium? "any other verbs then being located in VP" -- is this acceptable? if the sentence you are analysing contains a modal verb, then it is positioned in ‘I’,any other verbs then being located in VP.      (English Syntax and Argumentation - Bas Aarts)   At first, I think the The bold clause should be "...is located..." but then I realize it might be in the form of a non-finite clause (ing clause with a subject) but I'm not sure. If it isn't, how you describe this usage? Is this common in English?