I'm using  (a tool to tidy up bash scripts). It has a -s (simplify) option that rewrites a line like:  if [[ -n "$out" ]]   to unquoted version:  if [[ -n $out ]]   I'm actually curious if unquoting variables is safe for string-based comparisons/tests in [ and [[. In other words, is the tool rewriting the code to be any better?  I feel like there's no harm in the quoted version, it would definitely prevent splitting but I guess [ and [[ aren't really susceptible to splitting?
I'm confused with using single or double brackets. Look at this code:  dir="/home/mazimi/VirtualBox VMs"  if [[ -d ${dir} ]]; then     echo "yep" fi   It works perfectly although the string contains a space. But when I change it to single bracket:  dir="/home/mazimi/VirtualBox VMs"  if [ -d ${dir} ]; then     echo "yep" fi   It says:  ./script.sh: line 5: [: /home/mazimi/VirtualBox: binary operator expected   When I change it to:  dir="/home/mazimi/VirtualBox VMs"  if [ -d "${dir}" ]; then     echo "yep" fi   It works fine. Can someone explain what is happening? When should I assign double quotes around variables like "${var}" to prevent problems caused by spaces?
How to read "service --status-all" results I need to identify the currently running services but I can't figure out the results of running service --status-all, I mean what does ?, - and + mean ?  $ service --status-all  [ + ]  acpid  [ + ]  anacron  [ + ]  apparmor  [ ? ]  apport  [ ? ]  atieventsd  [ + ]  avahi-daemon  [ ? ]  binfmt-support  [ + ]  bluetooth  [ - ]  brltty  [ + ]  console-font  [ + ]  console-setup  [ + ]  cron  [ + ]  cups  [ + ]  cups-browsed  [ - ]  dbus  [ ? ]  dns-clean  [ + ]  friendly-recovery  [ - ]  grub-common  [ ? ]  irqbalance  [ - ]  kerneloops  [ ? ]  killprocs  [ + ]  kmod  [ ? ]  lightdm  [ - ]  lm-sensors  [ ? ]  mysql  [ ? ]  networking  [ ? ]  ondemand  [ ? ]  pppd-dns  [ - ]  procps  [ - ]  pulseaudio  [ ? ]  rc.local  [ + ]  resolvconf  [ + ]  rfkill-restore  [ + ]  rfkill-store  [ - ]  rsync  [ + ]  rsyslog  [ + ]  saned  [ ? ]  sendsigs  [ + ]  setvtrgb  [ ? ]  speech-dispatcher  [ - ]  sudo  [ + ]  timidity  [ + ]  udev  [ ? ]  umountfs  [ ? ]  umountnfs.sh  [ ? ]  umountroot  [ - ]  unattended-upgrades  [ - ]  urandom  [ + ]  virtualbox  [ - ]  x11-common   And would running this command with sudo make any difference ? I tried it and in my case it didn't make any difference, but may it differ in other setups ? $\lim_{h\to 0}\int \frac{f(x+h)-f(x)}{h}\,\mathrm{d}x = f(b)-f(a)$ Let $f:[a,b]\to  R$ be integrable and continuous on $(a,b)$. Prove that: $$\lim_{h\to 0} \int_a^b\frac{f(x+h)-f(x)}{h} \,\mathrm{d}x = f(b)-f(a).$$  What I've tried so far: make a change of variables, which didn't help. I also thought of using the intermediate value theorem inside the integral, but the function being differentiable is not specified. Any help, tips? Thanks in advance! I use Windows 10 with the same Microsoft account on 3 different computers, each one with a different physical keyboard layout: ITA, UK, DE.  In "Control panel - Clock and International settings - Language" I have ITA as display language with ITA/DE/UK keyboard layouts, followed by ENG(US) with only UK layout.  In the same window I opened "Advanced settings" where I set an override (second drop-down list) to the default ("the first one on the list") language/keyboard: that would be ITA/ITA, while I want (on this computer) ITA/DE.  However, when now I log in in the other computers, I get ITA/DE there as well, while each computer should have a different one, being the physical keyboards different: ITA/DE here, ITA/UK on the second one and ITA/ITA on the third one.  If I change one, they all change. And if I don't apply the override, the issue seems to be the same.  Basically the last used language AND keyboard settings are stored on the cloud and applied wherever I log in.  How to set Windows 10 to remember, PER computer, the last used language/keyboard layout settings, without having that setting follow me? Move item to folder when added/edited (SP2013 or O365) How to move item to folder automatically when it has been added or edited in a library? The folder is in the same library. The correct folder will be defined by metadata. This should happen automatically when the item has been added or edited. The listitem Id should be preserved. No server-side code should be deployed.  Can this be done using workflows (SP2010/SP2013)? If not then what would be the other options? I searched here and see mention of Clonezilla and Remastersys - but nothing I found answered my question completely, so I ask:  My home PC is just a generic one, and now that I changed it to Ubuntu I really love how it's come out and how it runs better !  My office PC is a different generic set of hardware, and I'd like to 'clone' the exact same setup to it but not have to repeat all the tweaking and such that I did already.  Is there a program that will allow me to replicate/install my already customized setup from one to the other, easily ? Are there certain steps I must make before doing something like that so it'll be compatible with different hardware ?  Thanks ! Age replacement policy for hard disks and SSDs at servers I'm planing an age replacement policy for our storage and servers. Most of them are for DBs and some for images (static content) so yes, they have an huge I/O everytime.  Also, we use Samsung 840 Pro SSDs for the RAID Controllers (PERC H700i) as CacheCade.  Are you guys managing the replacement of old hard drives and solid state drives? Opacity problem over white object in Illustrator I have a problem. I'm working with an object at 50% opacity. When it's over the artboard itself the color looks great, but when I put a white object behind it I get this weird color that doesn't look accurate.  This happens with every object and only in CMYK. I'm pretty sure this never happened to me before so maybe I changed something in the settings or I don't know.  Does anyone have any idea? How to initialize private static members in C++? What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:  class foo {     private:         static int i; };  int foo::i = 0;   I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this? Best font for programming? How to install Wi-Fi driver for Realtek RTL8821CE on Ubuntu 18.04? How do I "parent" objects? Why does the /winsxs folder grow so large, and can it be made smaller? 301 redirect blogspot to an existing domain? Is it possible to redirect a blogspot site to an existing URL?  Note that I don't want to buy a new domain and tell blogspot to use that, eg as per this question: .    Instead I am trying to 301 redirect to an existing website in order to combine the website and the blog in one place.  So it needs to be:  301 example.blogspot.com/post to example.com/blog/post What is the module/method used to get the current time? How many sequences of $n$ tosses of a coin that do not contain two consecutive heads have tails as the first toss? If you toss a coin $n$ times, there are $2^n$ possible sequences of heads and tails. Let $E_n$ be the set of sequences which do NOT contain two consecutive heads and $e_n$, the number of sequences in $E_n$.  Thus $E_3$ $=$ $\{$ $TTT$, $TTH$, $THT$, $HTT$, $HTH$ $\}$ and $e_3$ $=$ $3$.  How many elements of $E_n$ have $T$ as the first toss?  Please can anyone help me out here? There are several unknown numbers in mathematics, such as optimal constants in some inequalities. Often it is enough to some estimates for these numbers from above and below, but finding the exact values is also interesting. There are situations where such unknown numbers are necessarily natural numbers, for example in Ramsey theory. For example, we know that there is a smallest integer $n$ such that any graph with $n$ vertices contains a complete or an independent subgraph of 10 vertices, but we don't know the exact value of $n$.  What kinds of unknown small (less than 100, say) integers are there? What are the smallest unknown constants which are known to be integers? Or, more rigorously, what is the smallest upper bound for an unknown but definable number that is known to be an integer?  I know that asking for the smallest unknown integer is ill-defined since we do not know the exact values. The more rigorous version of the question is well-posed, but I do not want to keep anyone from offering interesting examples even if they are clearly not going to win the race for the lowest upper bound.  An answer should contain a definition of an integer quantity (or a family of them) and known lower and upper bounds (both of which should be integers, not infinite). Conjectures about the actual value are also welcome. I have given one example below to give an idea of what I'm looking for. In how many different ways can you split $10$ people into two groups of $5$ people? In how many different ways can you split $10$ people into two groups with the same amount of people?  My attempt: Since the order in which you choose someone doesn't matter, I chose to calculate the combinations: $10 \choose 5$ What does the notation like 8.6e-28 mean? What is the 'e' for? I'm writing a thesis which is an aggregate of separate articles. I have the source code for the articles and I'm using \include to include them in the main document of the thesis. So in my main.tex (thesis document), I have  \include{article1} some pages in between the two articles \include{article2}   The problem that I'm getting is with the Appendix sections. In article 1, I have at the end:  \appendix \numberwithin{equation}{section} \section{Coefficients}\label{sec:Coeffic} \subsection{Good coefficients} then comes the first line of appendix   This gives in article 1 (when  compiled separately with the article class):     A. Coefficients      A.1. Good coefficients   and equation numbers in the Appendix A as (A.1), (A.2)  which is ok and what is expected.  When I put article 1 within main.tex, I use \include command. Also, I removed the document class for article 1 and put \chapter instead.  But when I compile main.tex (the thesis document), I get the appendix sections as:     .1 Coefficients      .1.1 Good coefficients   and the equation numbers in the appendix A as (.1.1), (.1.2) etc  My article 1 is treated as a chapter in the main thesis document (main.tex) and the title and section numbers, equation numbers are preceded by A in main.tex. This is what I want.  Maybe it would be ok to get the appendix in my main.tex as     A.A. Coefficients      A.A.1 Good coefficients   and the equation numbers in the Appendix as (A.A.1), (A.A.2) etc  to denote that it refers to appendix A of paper A. First A is for the first article and second A is for first appendix. How to get this? Reinstalling a fresh Windows 7 on a SSD while its original HDD version was upgraded to Windows 10 Many posts around that subject, but this case is a bit specific (I think) since it's not about a migration nor a cloning.   Initially Windows 7 on a 500GB HDD (OEM) then upgrade to Windows 10 (offered by Microsoft)   Now we have a brand new 550GB SSD and would like to install a fresh Windows  on it (and get rid of the old one on the HDD).   Do we have to install the initial (Win 7) or the upgraded (Win 10) on the SSD? What happens with the license, will Microsoft accept the license "transfer" automatically?   We'd prefer to install Windows 7, unless 10 is mandatory (or recommended).  Edit  Actually we'll go for win 10 since we need to switch languages after the install (thanks @Ramhound). Thus the question is back to the classical Win 10 reinstall, and is definitely a dupe . . .