4 years ago by 1

I am trying to add two floating point numbers var sum = parseFloat(a) + parseFloat(b); How do i set the decimal precision of the result to one? Eg: 0.1+0.2 should give 0.3 . . .

javascriptfloatdecimalprecision
  • 0
  • 0
  • 733
4 years ago by 1

I have to map an array of lowercase characters a to z to numbers 1 to 26. Example: [a,c,f] to [1,3,6] I tried  arr.map( function(x){ return (x-96); } )   However this returns an array o . . .

javascriptcharacter-asciiascii-conversionarraymap
  • 0
  • 0
  • 1392
4 years ago by 1

I have an associated array $myarray = array(                      "foo1" => "bar1",                 . . .

phpassociative-arraystring
  • 0
  • 0
  • 929
4 years ago by 1

What is the best way to check if string is Palindrome in PHP? . . .

phppalindromestringfunction
  • 0
  • 0
  • 1396
4 years ago by 1

Should i use isset() or array_key_exists()? . . .

phpassociative-array
  • 2
  • 0
  • 1848
4 years ago by 1

Hi, echo "/n";   is not working for me somehow?   . . .

phpnewline
  • 1
  • 0
  • 689
4 years ago by 1

how can i check if samba is already installed or not in my raspberry pi? I have a folder named samba in /etc with 2 files smb.conf and gdbcommands  I can see 2 samba related packages in the list . . .

raspberry-pisamba
  • 1
  • 1
  • 2372
4 years ago by 1

I'm trying to edit the file /etc/samba/smb.conf in my Raspberry Pi using vi editor. When i try to save the file i get  this error "/etc/samba/smb.conf" E212: Can't open file for writing I am l . . .

raspberry-pivisambasmbconf
  • 1
  • 0
  • 1294
4 years ago by 1

How do i list all files or directories starting with 'a' or 'b' using ls? I tried ls a* and it doesn't work? . . .

linuxls
  • 0
  • 0
  • 809
4 years ago by 1

What are the arguments to tar command for extracting from tar.xz? . . .

linuxtarxzuncompress
  • 1
  • 0
  • 824
4 years ago by 1

How to set environment variables like PATH? How to do this from shell and how to make it available permanently? Is the command same for various distributions? . . .

linuxenvironment-variablepath
  • 1
  • 0
  • 879
4 years ago by 1

What is the easiest way to find Linux version and distribution name from the terminal? Is there a command that works for all different distributions? I am on Fedora. . . .

linuxfedoraversiondistributioncommand
  • 1
  • 0
  • 738
4 years ago by 1

Is it possible to completely remove / disable cortana from windows 10? If possible i want to remove the search box completely from the taskbar. . . .

windows-10cortana
  • 0
  • 0
  • 761
4 years ago by 1

I am trying to insert into MYSQL table some data recieved from AJAX post. Error: Cannot enqueue Handshake after already enqueuing a Handshake.     at Protocol._validateEnqueue (C:\nodejs\n . . .

nodejsexpressmysqlhandshake
  • 2
  • 0
  • 13340
4 years ago by 1

I have configured file history backup on my windows 10 laptop to copy files from a drive partition to an external usb HDD drive. In the Backup-options page when i click on backup now, it says ba . . .

windows-10filehistorybackup
  • 1
  • 0
  • 1679