I have a file with a list of directories and I need to find out if they actually exist on the system. It's quite a large list so I'd like to figure out how to automate the check.  The file is formatted with each directory on a new line:  /usr/bin /usr/sbin /bin /sbin   Any suggestions? Thanks!
How can I check if /bin/x86_64/bin/ls is a directory in a bash shell script  Here is what I tried:  #!/bin/bash  if [ $# -eq 2 ]; then     if [[ "$1" = /* ]]     then     cd ./bin/x86_64/bin/ls         if [ -d "$1" ]; then             echo "ok"             i="$1"             echo $i         else             echo "error2"             exit         fi     else         echo "error"         exit     fi fi
Are there any best practices for choosing the title of web pages? There are a lot of resources online oriented toward SEO, but not toward users.  My impression is that most sites have something similar to Product - Page. But there are cases when switching this around is more useful. For example, if mail clients displayed the title like this:  Inbox (3) - Gmail  Instead of:  Gmail - Inbox (3)  You would be able to see the message count, even if the title was cut off. (I'm pretty sure Gmail used to do this).  I assume the title is mostly ignored by users except when:   using boorkmarks finding the right tab in the browser   What are the considerations for users when choosing a web page title? Are there different considerations for the home page, pages behind a login, etc? I hope this qualifies as a programming question, as in any programming tutorial, you eventually come across 'foo' in the code examples. (yeah, right?)  what does 'foo' really mean?  If it is meant to mean nothing, when did it begin to be used so? Password Reset for Users on a Multisite Subsite I have a multisite network. I want my users to be able to reset their passwords while staying within their subsites. So for example clicking the "lost your password?" link keeps them within their subdomain (subdomain.domain.com/wp-login.php?action=lostpassword) as opposed to taking them to the main site (domain.com/wp-login.php?action=lostpassword).  After they submit the username or email to reset the password, I would like for that email to contain links back to their subdomain and not the main site as is the default functionality.   Prior to the 4.0 update I was able to use this patch  and ultimately this plugin  to get the exact functionality described above. All was great.  However after the update it is no longer working. Asking for assistance in the various places referenced has still not helped solve the problem. Is anyone able to help? Placement of images in row using subfigure I want to put four figures in a single row. The code I am trying to use is taken from .  This puts three figures in a row. When I add a fourth one, I get three images in row and the last one appears in the second row. But I want all of them in one row. Here is my code.  \documentclass[12pt,twoside]{report}% Use this line for the print version of the thesis   \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} \begin{document}  \begin{figure}         \centering         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{gull}                 \caption{A gull}                 \label{fig:gull}         \end{subfigure}%           \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{gull}                 \caption{A gull2}                 \label{fig:gull2}         \end{subfigure}%          ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{tiger}                 \caption{A tiger}                 \label{fig:tiger}         \end{subfigure}         ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{mouse}                 \caption{A mouse}                 \label{fig:mouse}         \end{subfigure}         \caption{Pictures of animals}\label{fig:animals} \end{figure} \end{document}   As I have mentioned above, it works for three figures.  But I can not use it for four figures. What should I change?   What does  width=\textwidth mean?   I changed    \begin{subfigure}[b]{0.3\textwidth}   to  \begin{subfigure}[b]{0.2\textwidth}   but it didn't help.  Then, I changed     \includegraphics[width=\textwidth]{mouse}   to  \includegraphics[width=0.5\textwidth]{mouse}   Still no solution. This question arises when I try to describe my itinerary to ticket service in the UK. Take for example, I plan to buy a ticket from A to B. B is the terminal. How to say its counter part A? I cannot find a proper term. I have to say "I will depart from A" or "I plan to go to B from A". Or I even use "departure place" to refer to B. Linear maps $f: M_n \longrightarrow \mathbb{R}$ such that $f(AB) = f(BA)$ Let $M_n$ be the vector space of $n \times n$ matrices over $\mathbb{R}$. Find (with proof) all linear maps $f: M_n \longrightarrow \mathbb{R}$ such that $f(AB) = f(BA)$ for all matrices $A$ and $B$.   I know that the trace map is one such $f$. The determinant map satisfies $det(AB) = det(BA)$ -- but isn't a linear map, so it doesn't suffice.   Is there a constructive way to find all of the desired linear maps $f$, and show that there are no others ?   Any help would be appreciated. Thanks (= Question involving the Cauchy-Goursat Theorem Show $\int_C \frac{dz}{(z-z_0)^n} = 2\pi i$ when $n = 1$ and 0 when $n \gt 1$   I'm not entirely sure how to approach this one.  Any help would be much appreciated. Mouse Pointer Locator Due to a stroke, I have had some vision impairment in that I sometimes have a hard time locating my mouse pointer on the screen.  I have tried making the mouse pointer larger which helps but is still not the solution.  I am new to the Mac world and would appreciate your help.  In Windows, there is an option where pressing the CTRL key will help to identify the mouse pointer using a temporary display of several radiating concentric circles around the mouse pointer.  Is there something like this on OS X? Template Hierarchy: confused with index.php, front-page.php, home.php I'm really confused with index.php, home.php and front-page.php. In many cases even though I had an index.php, I overwrite it with front-page.php. But recently, I became aware about home.php.   What's the difference between the home.php and index.php? What's the ideal condition to use a home.php than an index.php? What's the ideal condition to use a front-page.php? When I'm using a front-page.php then what specific task an index.php is doing for me then?   I've read the  in Codex. Please don't mix my question with Page Templates, I understand 'em, alHamduLILLAH. Two paths that show that $\frac{x-y}{x^2 + y^2}$ has no limit when $(x,y) \rightarrow (0,0)$ What is the purpose of LongLength for .Net Arrays? I'm working on the following problem set.  Let $\mathcal{H}$ be a Hilbert space and $A$ and $B$ orthogonal subspaces of $\mathcal{H}$.  Prove or disprove:  1) $A \oplus B$ is closed, then $A$ and $B$ are closed.  2) $A$ and $B$ are closed, then $A \oplus B$ is closed.  I could prove 1) and if my proof is correct, it even holds if $\mathcal{H}$ is just an inner product space.  Unfortunately, I can't manage to prove 2). Since $\mathcal{H}$ is by assumption a Hilbert space and I didn't use that fact to prove 1), I should probably use it here.  It means that $A$ and $B$ are also complete. Given some convergent sequence in $A \oplus B$, I want to show that the limit is also in  $A \oplus B$. Here I'm stuck. I want to use the completeness of $A$ and $B$, but I don't see how to obtain suitable Cauchy sequences.  Can anyone drop me a hint? Or is my approach all wrong? I'm editing a book that includes about 25 papers written in LaTeX by different authors.  Since many of them use the same \label, to avoid collisions I redefined the \label command (and \ref and \pageref and \cite and \bibitem)  so that if the third paper has  \label{main_theorem} the aux file actually uses the tag "iii:main_theorem", and \ref{main_theorem} actually refers to the same tag.  I did a similar thing for \cite and \bibitem.  %*************** bib/cite hacks \let\TheReal@citex=\@citex \let\TheReal@bibitem=\@bibitem \let\TheReal@lbibitem=\@lbibitem \gdef\@lbibitem[#1]#2{\TheReal@lbibitem[{#1}]{#2\roman{chapter}}} \gdef\@bibitem#1{\TheReal@bibitem{#1\roman{chapter}}} \gdef\@citex[#1]#2{% \toks@={}\count@=0% \@for\@citec:=#2\do{% \advance\count@ 1 \ifnum\count@=1\edef\0{\the\toks@\expandafter\expandafter\noexpand\@citec\roman{chapter}}% \else\edef\0{\the\toks@,\expandafter\expandafter\noexpand\@citec\roman{chapter}} \fi% \toks@=\expandafter{\0}}% \TheReal@citex[#1]{\the\toks@}% } %************** label/ref/pageref hacks  %%%%%%%%%%%%% must be before ams pkgs \let\TheRealLabel=\label \let\TheRealRef=\ref \let\TheRealPageref=\pageref \gdef\label#1{\TheRealLabel{\roman{chapter}:#1}} \gdef\ref#1{\TheRealRef{\roman{chapter}:#1}} \gdef\pageref#1{\TheRealPageref{\roman{chapter}:#1}}   This all worked fine until I used hyperref, which seems to ignore the redefinition of \label, whether I load it before or after the above code.  Any suggestions?  It would be nice if the redefinition would work whether or not hyperref was loaded, so I don't want to just grab the defintion of \label out of the package and tweak it.  I'm also open to alternative methods.  Redefining \label and \ref just seemed the most straightforward (to me) solution.  Note that I also want to be able to refer to the inner labels from outside, as well.  For example, I might want to say "the main theorem of the third paper is  \ChapRef{iii}{main_theorem}  from within the introduction (a different chapter). Order of execution of jquery document ready Show function is continuous at origin $$ \begin{cases}xy^2\sin\left(\frac 1 y\right), \text {if $y$ $\neq$ 0} \\ 0, \text{if $y$ = 0} \end{cases}$$  I'm not sure how to work out this limit as $x$ goes to infinity. If it were just the y part, I know that $y^2$ goes to 0 and $\sin$ is a limited function, so it has to go to 0, but I don't know what to do with the $x$ term. When an air-filled balloon is released without its opening tied up, it moves in a circular path rather than a straight line. Why is that? Is there a graceful way to handle passing a list of ids as a parameter to a stored procedure?   For instance, I want departments 1, 2, 5, 7, 20 returned by my stored procedure. In the past, I have passed in a comma delimited list of ids, like the below code, but feel really dirty doing it.   SQL Server 2005 is my only applicable limitation I think.  create procedure getDepartments   @DepartmentIds varchar(max) as   declare @Sql varchar(max)        select @Sql = 'select [Name] from Department where DepartmentId in (' + @DepartmentIds + ')'   exec(@Sql) How to get only filename using sed How can I get only the filename using sed? I've this  out_file=$(echo $in_file|sed "s/\(.*\.\).*/\1mp4/g")   But I get the path too /root/video.mp4, and I want only video.mp4. Can I use virtualbox with a 64 Bit image in a 32 bit host I have Virtualbox 4.1.20 in Ubuntu 12.04 32 Bit (With PAE) and I want to run Ubuntu Server 64 Bit on the Guest. Is this possible?. I ask since I get the following warning:    I want to make sure that there is no option to "emulate" this. I have a 64 bit CPU that supports virtualization. The Intel DZ68DB motherboard with an Intel I7 2600 CPU. Integrating $\frac{1}{\sqrt{ax^2+bx+c}}$ for $a<0$ I'm trying to integrate the function $\frac{1}{\sqrt{ax^2+bx+c}}$ for $a&lt;0$ and $b,c&gt;0$.   From a list of integrals of irrational functions from Wikipedia I know the result should contain arcsin or arcos, but I don't understand how to get there.  I've tried Euler's substitution and trigonometric substitution but I always stumble over the fact that $a$ is negative.  Can please someone help me?