Unable to convert a string to integer
(Built-in) way in JavaScript to check if a string is a valid number
I'm developing some scripts. One for the  that popped in Ubuntu 16.04 even though pcspkr is blacklisted. Another to fix a  where sound switches off from TV to the laptop.  What is the best directory to put my bash scripts in?  I've searched the Q&amp;A database but I get a bunch of different answers for a bunch of different scenarios.  /usr/local has been recommended by one person because it's in the PATH$. Is that the right thing to do?  Thank you for your advice.    Even though I accepted below answer over a year ago, I ended up using:   /usr/local/bin for scripts needing sudo powers /home/me/bin for scripts running at user level   After creating directory /home/me/bin you need to log out and in again for it to get into your PATH. Persistent live drive with a partition for persistence There are some web sites describing  new tools new features in [new versions of] old tools  that can create a persistent live drive from an iso file with Ubuntu 19.10 and the corresponding Ubuntu family flavours.  Why and how does it work? How is it different from earlier methods for persistent live drives? Isn't live the default for a cloned drive? When to use unsigned values over signed ones? The "Reputation &amp; Moderation" page on any site (/help/site-moderators) still refers to the company behind Stack Exchange as Stack Exchange and not Stack Overflow.     Moderators act as a liaison between the community and Stack Exchange the company.   Seeing as how the name change was recent, I'm not surprised this hasn't been caught yet, and I'm sure there are other instances of this around somewhere. What is a word that could define someone who likes to cause conflict? Accessing variables from other functions without using global variables I've heard from a variety of places that global variables are inherently nasty and evil, but when doing some non-object oriented Javascript, I can't see how to avoid them. Say I have a function which generates a number using a complex algorithm using random numbers and stuff, but I need to keep using that particular number in some other function which is a callback or something and so can't be part of the same function.   If the originally generated number is a local variable, it won't be accessible from, there. If the functions were object methods, I could make the number a property but they're not and it seems somewhat overcomplicated to change the whole program structure to do this. Is a global variable really so bad? What happens to a bounty question if it gets migrated? clearly belongs elsewhere, but the asker already put a bounty on the question.  If the question is migrated, does the rep get refunded? Does the question continue to be a bounty question on the target site if the user has enough rep? (The asker in the referenced question does not have any associated accounts, but I'm curious about what happens.)  Edit: I just tried to add my own close vote, but apparently you can't when there's an open bounty. However, a mod should still be able to close/migrate/etc. ¿Can you help me with axiom of regularity? I understand that if we define a set such that $A=\{A\}$ we have then a contradiction because of regularity axiom, thus, a set can not be a member of itself. My question is; how can it be so, if I define a set $A=\{A,b\}$ ($b$ disjoint from $A$)?  Thanks. How to do power series expansion What is the coefficient of $x^{11}$ in the power series expansion of $\frac 1{1-x-x^4}$?    How do I do power series expansions? I have a dedicated server with 2 TB storage.   My problem is that the whole storage is allotted to the root partition.   Whenever I try to resize it using lvresize, the root partition gets corrupted and then I have to reprovision the server.   Is there any option to resize the root partition without unmounting in lvm?  I am trying to reduce the root partition to 100GB.  Vgs  root@s93079:/home/customer# vgs   VG        #PV #LV #SN Attr   VSize VFree   s93079-vg   1   2   0 wz--n- 1.82t    0   Lvs  LV     VG        Attr       LSize  Pool Origin Data%  Meta %  Move Log Cpy%Sync Convert   root   s93079-vg -wi-ao----  1.79t    swap_1 s93079-vg -wi-ao---- 32.00g   Fdisk - l  Device     Boot  Start        End    Sectors  Size Id Type /dev/sda1  *      2048     499711     497664  243M 83 Linux /dev/sda2       501758 3907028991 3906527234  1.8T  5 Extend /dev/sda5       501760 3907028991 3906527232  1.8T 8e Linux  Disk /dev/mapper/s93079--vg-root: 1.8 TiB, 1965782204416 byt es, 3839418368 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/s93079--vg-swap_1: 32 GiB, 34355544064 byte s, 67100672 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes   Vgdisplay   --- Volume group ---   VG Name               s93079-vg   System ID   Format                lvm2   Metadata Areas        1   Metadata Sequence No  3   VG Access             read/write   VG Status             resizable   MAX LV                0   Cur LV                2   Open LV               2   Max PV                0   Cur PV                1   Act PV                1   VG Size               1.82 TiB   PE Size               4.00 MiB   Total PE              476870   Alloc PE / Size       476870 / 1.82 TiB   Free  PE / Size       0 / 0   VG UUID               dPrEwA-77pM-pGai-9jZB-ldMZ-iL20-HAe9 Dj   lvdisplay /dev/s93079-vg/root   --- Logical volume ---   LV Path                /dev/s93079-vg/root   LV Name                root   VG Name                s93079-vg   LV UUID                bpGNau-XirV-P7PA-8d6k-OCOy-TAwN-HXl FVI   LV Write Access        read/write   LV Creation host, time s93079, 2016-08-27 09:22:05 -0500   LV Status              available   # open                 1   LV Size                1.79 TiB   Current LE             468679   Segments               1   Allocation             inherit   Read ahead sectors     auto   - currently set to     256   Block device           254:0   Lvdisplay /dev/s93079-vg/swap_1  --- Logical volume ---  LV Path                /dev/s93079-vg/swap_1  LV Name                swap_1  VG Name                s93079-vg  LV UUID                j74PLZ-E9gK-9Bbb-EkKq-xRJv-TuU4-FgH gm  LV Write Access        read/write  LV Creation host, time s93079, 2016-08-27 09:22:05 -0500  LV Status              available  # open                 2  LV Size                32.00 GiB  Current LE             8191  Segments               1  Allocation             inherit  Read ahead sectors     auto  - currently set to     256  Block device           254:1   Df - h  /dev/dm-0       1.8T  923M  1.7T   1% / udev             10M     0   10M   0% /dev tmpfs           3.2G  8.5M  3.2G   1% /run tmpfs           7.9G     0  7.9G   0% /dev/shm tmpfs           5.0M     0  5.0M   0% /run/lock tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup /dev/sda1       236M   33M  191M  15% /boot How to normalize my db schema for a quiz application? I am putting together a quiz application.   (I'm calling each quiz a "challenge")  I have a "challenge" table and a "challenge_question" table which is pretty straightforward.  challenge table: id name num_questions (I want to randomize and only display a certain number of Qs per each challenge)  challenge_question table: id challenge_id question (text of the question) required (some questions will be required to be displayed per each challenge) question_type (here I indicate what type of question: Mult. choice, T/F, Ordering, or Fill-in-the-blank)   Where I'm having trouble in normalization is with the types of question options:  Multiple choice, true/false, ordering, and fill-in-the-blank. I wonder, should I have a separate table for each type of challenge-question-option? Or is it possible to combine these into one somehow..  If I combined all possible options into a single table, it might look be something like this  challenge_options table: id challenge_question_id option (text field, can be used for both multiple choice and for fill-in-the-blank style questions) is_true (boolean field for true/false questions) is_correct (boolean, used to determine multiple choice answer) ordering_option_1  ordering_option_2 ordering_option_3 ordering_option_4 (these ordering fields would store the correct sequence of an ordering style of question)   This really strikes me as less than ideal.  Actually, I don't see how the ordering_options would work out correctly at all.  Wouldn't I need to have each of those be a separate option?  Surely there must be a better way.  Any suggestions/criticisms or alternate approaches? Comparing StringBuffer content with equals Why are 15 reputation points required to upvote? I think more reputation points should be required to add a new answer than to upvote an existing answer.  I don't continually watch for new questions, so usually when I find a question it has already been answered.  It seems bit inappropriate to answer an already-answered question in order to contribute to the conversation, but until you earn reputation, you can't upvote or comment; you can only add new answers, which prevents me from contributing at the moment as much as I would like to.  This seems backwards to me. If someone incorrectly upvotes a bad answer, the damage is minimal, as other users can down vote it and upvote the correct answers. On the other hand, an incorrect answer wastes the time of everyone who reads it.  So, IMHO, it should require more reputation points to add an answer than to upvote or comment on an existing answer.  I wouldn't say say that users should be prevented from answering unanswered questions until they have x reputation points, as that might prevent users who have answers from providing them, but perhaps it should be required if the question is already answered, to discourage users from reiterating previously given answers.  What do you think? Passing a formatted NSDate How should you deal with (deliberate) selective deafness? $x^2+y^2=z^n$: Find solutions without Pythagoras! I was presented with the following problem:      Prove that there exist solutions to $x^2+y^2=z^n$ for all $n$, with $x,y,z, n \in \mathbb{N}$   I showed that by taking any Pythagorean triple $x^2+y^2=z^2$ and multiplying by $z^{2(n-1)}$ we get $(z^{n-1}x)^2+(z^{n-1}y)^2=(z^2)^n$, which allows me to generate solutions easily for any value of $n$. I managed to find several similar questions on this site, such as  concerning the specific case $n=3$. I notice that all of these questions take a similar approach and start with a Pythagorean triple and use it to generate general solutions.  Is there a way to prove the statement (or better yet provide solutions to the equation) without first relying on Pythagoras? Should I use the singular or plural verb in mathematical formulae ("Two and two make/makes four")? Can a function be made to accept a variable amount of inputs? How to prove Euler's formula: $e^{i\varphi}=\cos(\varphi) +i\sin(\varphi)$? How can I convert a complex number into an exponent form