SH script in $PATH is not found on Linux Alpine 3.11 I am using Alpine Linux 3.11 as a new Docker container.  I have the default $PATH variable, which reads:  echo $PATH /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin   When I place a script, wait-for (which is a shell script starting with #!/bin/sh) in /usr/local/bin it displays fine:  chmod +x wait-for mv wait-for /usr/local/bin/wait-for ls -l /usr/local/bin/wait-for   produces:  -rwxr-xr-x    1 root     root          1451 May  1 16:09 /usr/local/bin/wait-for   It also runs when I use sh /usr/local/bin/wait-for to execute it.  However, when I am in /usr/src/ and I try to run wait-for I get sh: wait-for: not found  My understanding is that because the /usr/local/bin directory is in $PATH then any script inside that directory should be called globally.  What have I misunderstood?   I can run the file from /usr/src/ if I use sh /usr/local/bin/wait-for, but not if I use /usr/local/bin/wait-for (without sh prefix), which returns sh: /usr/local/bin/wait-for: not found.  The output of /etc/fstab is:  /dev/cdrom      /media/cdrom    iso9660 noauto,ro 0 0                           /dev/usbdisk    /media/usb      vfat    noauto,ro 0 0
Shell script works when saved with nano but not when saved with Notepad++ When I copy my bash script across from Notepad++ into a new file with nano editor inside SSH and save. It runs fine. (sh ./install).   But if I save the file (Exact same contents), upload to my web server, download it using Wget on the same machine. I get syntax errors. I've checked the encoding and they seem to be the same. I have since used a plethora of character encoding to see if it will resolve the issue. I am also setting the file to executable once I download it using wget!  The file runs fine and I have zero errors when copy and pasting using nano. Any idea what this may be?
What is the correlation if the standard deviation of one variable is 0? multiple definition error including c++ header file with inline code from multiple sources I have a c++ header file containing a class. I want to use this class in several projects, bu I don't want to create a separate library for it, so I'm putting both methods declarations and definitions in the header file:     // example.h #ifndef EXAMPLE_H_ #define EXAMPLE_H_ namespace test_ns{  class TestClass{ public:     void testMethod(); };  void TestClass::testMethod(){     // some code here... }  } // end namespace test_ns #endif   If inside the same project I include this header from more than one cpp file, I get an error saying "multiple definition of test_ns::TestClass::testMethod()", while if I put the method definition inside the class body this does not happen:  // example.h #ifndef EXAMPLE_H_ #define EXAMPLE_H_ namespace test_ns{  class TestClass{ public:     void testMethod(){         // some code here...     } };  } // end namespace test_ns #endif   Since the class is defined inside a namespace, shouldn't the two forms be equivalent? Why is the method considered to be defined twice in the first case? There are so many questions on this website. There is so many questions on this website.  The former &quot;sounds right,&quot; but the contracted form of the latter does as well:  There's so many questions on this website.  Which is correct? Ubuntu 16.04 slow boot (apt-daily.service) My boot is horribly slow, and I don't know why.  $ systemd-analyze  Startup finished in 10.975s (kernel) + 49.732s (userspace) = 1min 708ms $ systemd-analyze blame           34.971s apt-daily.service          20.590s snapd.refresh.service          17.113s grub-common.service          16.033s apport.service          16.027s networking.service          15.894s ondemand.service          15.860s irqbalance.service          15.655s speech-dispatcher.service          11.695s ModemManager.service           9.772s accounts-daemon.service           8.626s NetworkManager-wait-online.service           8.058s systemd-logind.service           8.053s bluetooth.service           7.944s gpu-manager.service           7.896s alsa-restore.service           7.892s pppd-dns.service           7.882s rsyslog.service           7.860s avahi-daemon.service           7.844s dev-sda1.device           7.842s systemd-user-sessions.service           7.648s lightdm.service           7.610s teamviewerd.service           6.445s apparmor.service   Also, during boot-up, I see a message that says something like:  device descriptor read/all, error -62 ata1 softreset failed (device not ready) #most of the times error loading journal #(sometimes) Test WP failed, assume Write Enabled Asking for cache data failed     #most of the times Assuming drive cache: write through   apt-daily.service slows the boot the most. Any idea on how to tackle that?  I have Ubuntu MATE 16.04. Arrows describing matrix Lets say I have a 5x5 matrix. I want to place 2 leftrightarrows (with descriptions "3", "2") underneath the matrix, but really close to it: first pointing from col1 to col3 and second from col4 to col5. Plus updownarrows with similar outcome. How can I achieve that?  draft:  1 1 1 | 1 1  &lt;--> &lt;-> To find out how something is called is the one thing I don't know how to use Google for.  If I have a vector $v$ and a symmetric matrix $H$, then the operation $v^T H v$ gives me some sort of projection of the matrix $H$ on the vector $v$. For example if $H$ is the Hessian, the operation gives me the second derivative in the direction of $v$.  What is the name of this operation? How to influence the position of float environments like figure and table in LaTeX? How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference When and why is the [featured] tag removed by the Community user? I've found that the Meta (moderator only) tag  is automatically  by the  user. So, I want to know when and why is the tag  is removed by this user?  Is there any mechanism for this removal or is there simply a specified time period after which the  is automatically removed by the Community user? Is a strong background in maths a total requisite for ML? I'm starting to want to advance my own skillset and I've always been fascinated by machine learning. However, six years ago instead of pursuing this I decided to take a completely unrelated degree to computer science.   I have been developing software and applications for about 8-10 years now, so I have a good handle but I just can't seem to penetrate the maths side of machine learning/probabilities/statistics.   I start looking at learning material and on the first page it might include something which confuses me and immediately sets up a barrier in my learning.   Is a strong background in maths a total requisite for ML? Should I try and fill in the blanks of my maths before continuing with ML? Can self learning really work for just a developer without any hard computer science background?    Related question: If we have an implicit surface $g(x, y, z)=...$, the gradient is a normal vector. But why? Do I have to start with tangent vectors and then show the gradient is perpendicular? Not sure how to approach this. How do I run a game for a larger group? I am currently running a Dungeons and Dragons 4 campaign for a group of 9 players.  Whittling the group down to a more manageable size is not really an option since they are all family.  When we do combat it takes forever even if I have one player help me and allow them to go 2 at a time.  When we do story based adventure there are 2-3 players that do most of the talking and the others twiddle their thumbs.  I've tried encounters with many foes, encounters with only a few tough foes, dialog only encounters, social puzzle encounters, everything I can think of.  What else can I try to get this group more engaged? What are badges? How do users get badges? How can users get tag badges? Can badges be lost/revoked/taken away after they are awarded? If so, how and when? How can I suggest a new badge?   For more information, see &quot;&quot; and the  in the . Animation Blending Basics Say I have a framework with characters that can run and walk and of course, stand still.  Am I right in thinking that animation blending is the process of smoothly transitioning between these by generating dynamic animations at runtime?  If so, what is the basic theory of how this works, and how would I implement it? How do you choose Spells Known when creating a new character above 1st level? It's not clear to me how to choose Spells Known when creating a new character at a higher level.  Let's take the Bard as a working example first:  Bard level 2:   Spells Known: 5 Slots per Spell level: 1st &times; 3   Bard level 3:   Spells Known: 6 Slots per Spell level: 1st &times; 4, 2nd &times; 2   I'm interpreting this to mean that, if an existing 2nd-level Bard gains a new level (level 3), he's gaining 1 (one) new spell known. He can then choose the new spell known to be either 1st or 2nd, correct?  What I don't understand then, is the case of creating a new character starting at a higher level; say, creating a new Bard at level 3.  In that case you're forced to choose 6 spells, which must be from the list of 1st- and 2nd-level spells, correct?  When making this 3rd-level Bard from scratch, though, can I select 2nd level spells for all 6 spells known?  As another example, say you're creating a very high level Bard from scratch, starting at level 15. The book says your Spells Known is 19, and your spell slots are 1st × 4, 2nd × 3, 3rd × 3, 4th × 3, 5th × 2, 6th × 1, 7th × 1, and 8th × 1.  So, for those 19 Spells Known, you can choose any spells from 1st through 8th spell level. Am I free then to select as many spells as I can at 8th spell level (5 in number), working backwards, and in the end ignoring the 1st, 2nd, 3rd level spells entirely?  As another example, the Ranger doesn't know any spells at 1st level, nor have any spell slots, but the book says “You know two 1st-level spells of your choice from the ranger spell list.” Does it mean at 2nd level and above?  Long story short: When choosing Spells Known for a spellcasting character created above 1st level, am I allowed to choose my Spells Known at whatever spell level I like, just so long as I have at least one spell slot of that level?  I'm working on a D&amp;D 5e character generator and need to clarify this. The command history between sessions is not getting saved. I'm using guake and the history for the session is working fine. I noticed that .bash_history had some commands I executed in sudo -s mode and tried the same again and all the commands while in the session got saved so I tried: chmod 777 .bash_history  Now the old commands appear at the start of a session but no new commands are getting saved. The idea behind the sum of powers of 2 I know that the sum of power of $2$ is $2^{n+1}-1$, and I know the mathematical induction proof. But does anyone know how $2^{n+1}-1$ comes up in the first place.  For example, sum of n numbers is $\frac{n(n+1)}{2}$. The idea is that we replicate the set and put it in a rectangle, hence we can do the trick. What is the logic behind the sum of power of $2$ formula? How to print without newline or space? How do I get help for "echo" or other bash commands? man echo works. but out of curiosity, does echo have something similar to a --help flag/parameter? Showing $\sum_{i = 1}^n\frac1{i(i+1)} = 1-\frac1{n+1}$ without induction? I oversaw a high-school mathematics test the other day, and one of the problems was the following     Show, using induction or other means, that $$\sum_{i = 1}^n\frac1{i(i+1)} = 1-\frac1{n+1}$$   The induction proof is very standard, where the induction step relies on the fact that $\frac{1}{n+1} + \frac{1}{n(n+1)} = \frac{1}{n}$, and I'm sure it's been answered on this site before. However, I got intrigued by the "or other means" part of the question.  I don't know whether the teacher who wrote the test even considered any alternative solutions (he may just have written it so that if anyone has a crazy idea that works out, then they should get a full score for it), but I tried to find one. For instance, we may do the following telescope-ish argument: $$ \frac{1}{1(1+1)} + \frac{1}{2(2+1)} + \cdots + \frac{1}{(n-1)n} + \frac{1}{n(n+1)} + \frac{1}{n+1}\\ = \frac{1}{1(1+1)} + \frac{1}{2(2+1)} + \cdots + \frac{1}{(n-1)n} + \frac1n\\ \vdots\\ = \frac{1}{1(1+1)} + \frac12\\ = 1 $$ However, I feel that this is just an induction proof in disguise (hidden in the vertical dots). If one uses the mechanics of the induction proof to check whether the formula is true for a specific $n$, then one certainly does the exact same calculations as I have done here.  Is there a proof of this fact that clearly does not use induction (or at least hides it better)? The more elementary the better, and the ultimate goal would be to do it within the syllabus of the students taking the test (or at least not far from it). For reference, they should be familiar with the summation formula of arithmetic and geometric series and their derivations (so techniques resembling those would be well within specifications).  If there is a solution using calculus, then the students should be able to integrate elementary trigonometric functions, as well as exponential functions, logarithms and rational functions. They are familiar with integration by parts, substitution and partial fractions.  I welcome more advanced solutions as well, of course. If a question is in all-uppercase or all-lowercase, our quality filters should automatically reject it Proposal If a question on an English-language Stack Exchange site does not contain at least one uppercase and one lowercase letter, our quality filter should reject it. (We can make exceptions for sites which don't use a mixed-case alphabet, such as .) Justification The quality filter currently rejects neither all-uppercase nor all-lowercase posts. I've checked. The best Stack Exchange users use mixed case. If an asker is too lazy to use their Shift key, their question tends not to be of very good quality. Don't take my word for it. You can see proof. Sam Saffron helped me write  which lets you see with your very own eyes that what I am saying is true. Single-case askers tend to ask poor-quality questions such as:      In addition, posts which use only uppercase or only lowercase — even if they aren't riddled with typos or grammatical errors — tend to be hard to read. Capitalization aids readability. Why is this proposal not a duplicate? This proposal is not a duplicate of the older proposal . This is because it also deals with all-lowercase questions. All-lowercase questions are 50 times more common than all-caps questions.  Stack Overflow gets only about 100 all-uppercase questions per year; see .  Yet it gets about 5,000 all-lowercase questions per year; see . (These statistics are for Stack Overflow only; the rest of our network wasn't considered.) I suspect that the older proposal was declined for two reasons:  All-uppercase questions are rare.  Therefore, the effort required to block all-uppercase questions is too much.   This proposal is better. For just a bit more effort, the Stack Exchange developers can get a much richer reward. Conclusion What do you think of my proposal? Agree? Disagree? Thoughts? PS: This idea is modified and adapted from  by Stack Exchange user Gilles. My dear sir Gilles, I thank you. Note There's even a  which automatically detects questions with all-caps titles and alerts interested users and moderators.