xs = ['10','10','10']   [ '10', '10', '10' ]      xs.map(parseInt)   [ 10, NaN, 2 ]   xs.map(parseFloat)   [ 10, 10, 10 ]   why is the result 10,nan,2 for first one? why the second one is right?
From the :  [1,4,9].map(Math.sqrt)   will yield:  [1,2,3]   Why then does this:  ['1','2','3'].map(parseInt)   yield this:  [1, NaN, NaN]   I have tested in Firefox 3.0.1 and Chrome 0.3 and just as a disclaimer, I know this is not cross-browser functionality (no IE).  I found out that the following will accomplish the desired effect. However, it still doesn’t explain the errant behavior of parseInt.  ['1','2','3'].map(function(i){return +i;}) // returns [1,2,3]
I have a virtual machine running ubuntu and I am trying to host some files on ubuntu and map the drive in windows PC.  Following the steps , I am able to see (from windows) the "work" folder after typing in \ubuntu_ip. But when trying to access or map it with "svc_acct" from windows, I get "0x80070043 error the network name cannot be found". I guess I am not accessing correctly from windows.   SAMBA config below (svc_acct is an account set up under linux). When accessing the folder from windows, I get prompted for username/password. Not sure what credential to type in exactly.  samba config: [work] path = /home/svc_acct/work valid users = svc_acct available = yes read only = no browsable = yes public = yes writable = yes force user = svc_acct create mask = 0777 directory mask = 0777   UPDATE:  All I did to resolve this is by changing samba config's path from path = /home/svc_acct/work to path = /home/svc_acct following  post  (last sentence). Then no more prompt for password in windows when I try to click into the folder. Thanks to @sancho.s for suggesting the link. TSA lock reset button stuck and now lock button is also stuck Can the expression $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m \in \mathbb{N}$ are perfect squares? It doesn't seem likely, the only way that could happen is if for example $\sqrt{m} = a-\sqrt{n}, \ \ a \in \mathbb{Q}$, which I don't think is possible, but how to show it? How to give name to topics created using LDA? Vertical line for the the right margin in Notepad++ Does anyone know if Notepad++ can display a vertical line on the right margin to indicated that the text will or will not fit on a printed page?  I have looked but I cannot find it.  Word wrap does work, but it wraps by my screen width, not by the width of a printed page. Converting string of 1s and 0s into binary value I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as "11110111" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if there's anything in the C/C++ standard libs that can already perform such an operation? Let $L$ be a linear operator on a complex vector space $V$, how to show that eigenvalues of $L^\dagger L$ are positive? I guess this might be a statement taught in a functional analysis class or an advanced linear algebra class? I am not experienced in Number Theory but what I know is that some results of this filed are applicable in other areas, e.g. algebra. For sure FLT made (and makes) people be interested in Number Theory leading to the development of new methods which can be themselves applied not only for the proof of FLT (like financial problems motivated somehow development of stochastic analysis). I am interested - if there are applications or implications of FLT itself?  More precisely: if the fact "for each $n\geq3$ there are no integer solutions of $a^n+b^n=c^n$" leads to solutions of problems which are not in the field of Number Theory?   I would specify that I wonder about some problems which are already formulated: since FLT is known for more then 300 years I am pretty sure that there were formulated hypothesis which follow from FLT directly (if there are such hypothesis not in the field of Number Theory). syntax error in case 'remove' when decrementing Prevent Windows 10 installer from using the preinstalled serial key without disabling UEFI I have the following commands.  cd import zcat urls1.sql.gz | mysql -u root -p urls cd /var/www/project1/ nano 1.php   As of now I'm executing it one by one.  Is there a way to combine those commands in one line? New line in Sql Query What is the error "Every derived table must have its own alias" in MySQL? Orthogonal complement examples Mutable vs immutable objects I'm trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an array of strings from a method) but I'm having trouble understanding what the negative impacts are of this. What are the best practices around using mutable objects? Should you avoid them whenever possible? Continuous and bounded variation does not imply absolutely continuous UK Visa Refused - can I reapply immediately? For which positive integer values of $n$ does $a|mn-b?$ I am taking a number theory class, and I was not able to solve this homework problem.   Let $a,$ $b,$ and $m$ be constant positive integers. For which positive integer values of $n$ does $a|mn-b?$   I tried this out for a couple of values, and the values of $n$ satisfying this expression seem to occur in a cycle.  (For example, let $m=2019,$ $a=20,$ $b=19.$ The values of $n$ that work are $1,21,41,61,....$) However, I am not able to show that this always happens. Should an image carousel on a mobile site automatically rotate? Enable Wireless Monitor mode for traffic sniffing I need to sniff all the wifi traffic that I can capture using wireshark in Ubuntu. My wireless interface is named as eth1 in the interfaces list. When I select that interface in Wireshark and start new sniff, I got following error;    As  thread says, I tried to installed the mentioned driver but I got an error in installation saying that that driver is not supported by my device. After that I tried the second answer in the same thread and run following command to enable monitor mode in my wireless card.  echo 1 &gt; /proc/brcm_monitor0   Then I saw a new Ethernet interface (not a wireless interface ) called prism0 in wireshark interface list. I couldn't start a sniff using that interface using monitor mode because in that interface settings, monitor mode check box has been disabled.  I have installed a broadcom wireless driver in Additional Drivers as follows:    Is there an error listing my Wifi interface as eth1 rather than wlan0 in the interfaces list? How can I start my wireless interface in monitor mode for sniffing?   Thank you.