I want to add a progress bar in my bash script that show the "." character as progress , and process ended after MAX 180 second  in the bash script I use curl command , so curl give the results after sometime but not greater then 180 sec   something like that  |.                                           after 2 sec |...........                                 after 60 sec |...................                         after 100 sec |..........................                  after 150 sec |................................|           after 180 sec    final example  |................................|       after 180 sec    or  |....|                                   after 30 sec
How can I create a progress bar with bash?  This is my script :  #!/bin/bash  pass='number1 number12 number13 number14 number15 number16'  chk='number14'  for i in $pass ; do    if [ "$i" == "$chk" ]; then      echo ' Found ^_^'    else      echo 'loading 50%'    fi  done   I want to replace echo 'loading 50%' with anything to create an progress bar.
How to unit test an object with database queries I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files.  I'm using PHP and Python but I think it's a question that applies to most/all languages that use database access. How to move and overwrite subdirectories (and files) to parent directory? I can not update  on a Debian 6.0 (Squeeze) server to get rid of the discovered vulnerability:  bash --version GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)  apt-get update apt-get install bash Reading package lists... Done Building dependency tree Reading state information... Done bash is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.   Can I use Squeeze-LTS for this server just to update Bash? After one week I will be on another server, so I will not make any other updates.  uname -m x86_64  lsb_release -a No LSB modules are available. Distributor ID: Debian Description:    Debian GNU/Linux 6.0.5 (squeeze) Release:        6.0.5 Codename:       squeeze Question mark for sentence which starts with a question but doesn't end with one I'm basically looking at sentences which start with a question, and end with an explanation to it. But there may be more instances of a similar structure. Sample sentence :      Can you book a room in advance, because otherwise we'd be in trouble   Should this sentence end with a period or a question mark?  PS: I read the apparently similar question  but the sentence structure there is different from what I'm looking for.  Edit: I just discovered that this question is a duplicate. A resolved question already  exists:   But i do like the explanations here better. I have an image that is Base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6. From this , I now understand the gradient to be the directional derivative that returns the steepest slope at a point. However, reading my textbooks, they all say that the gradient is normal to the tangent plane. In the above SE question, the gradient sounds like it should be parallel to a direction in the $xy$ plane, not actually up on the surface.   My question is therefore do I have a misunderstanding of the tangent plane, gradient or directional derivative?   In addition, I question how the gradient always passes through the origin or the $xy$ plane? If for instance in the graphic, the gradient had been another direction (say horizontal), then it wouldn't pass through the origin! In addition, the gradient of other points in the graphic would satisfy this example. Many thanks! Citing a range of papers using numeric keys as in \cite{a, b, c} -> [1-3] How can I cite a range of papers, the output is a range of numbers, instead of a list of numbers? In other words, when I type  ... some dummy text here is due to me \cite{me1, me2, me3, me4} ...   I want the output to be     ... some dummy text here is due to me [3-6] ...   instead of     ... some dummy text here is due to me [3.4.5.6] ...   (I use LaTeX, and am currently using the amsart class and whatever it includes. But I am open to other suggestions.) Ignore python multiple return value Say I have a Python function that returns multiple values in a tuple:  def func():     return 1, 2   Is there a nice way to ignore one of the results rather than just assigning to a temporary variable? Say if I was only interested in the first value, is there a better way than this:  x, temp = func() How to remotely display my Android on my PC? There is a thing which is called miracast, it can mirror the display of the Android phone to another monitor, but my screen doesn't have this function, am I possible to do it in Ubuntu? Can I safely connect the power-only-end of a USB-Y cable to an other power source? If the host computer for an USB device doesn't provide enough power for a device which has no dedicated power port, can I connect the power-only-plug of a Y-USB-cable to an other computer, an USB-charger or even a regular mobile charger? I'm afraid this could damage some of the devices.  Edit: The device in question is a USB Hard drive (Samsung S2 Portable 640GB (but on the back it's written to use 0.85A)) which is supposed to work whit just a single USB port. It did so well on a other laptop and whit some cables even on my actual net book back in Europe. But now in Malaysia it works only some times (I still try to figure out what the conditions are) and then it stops working after a while (maybe when it goes to power save mode). I heard from others their hard drives need one more power plug here in Malaysia to but can't imagine why... $(z_{2n})_{n\in \mathbb{N}}$ and $(z_{2n+1})_{n\in \mathbb{N}}$ converges to same limit. Show $(z_n)_{n\in \mathbb{N}}$ converges to the same limit. $(z_n)_{n\in \mathbb{N}}$ is a complex valued sequence such that subsequences $(z_{2n})_{n\in \mathbb{N}}$ and $(z_{2n+1})_{n\in \mathbb{N}}$ converges to same limit.  How could I show that the sequence $(z_n)_{n\in \mathbb{N}}$ converges to the same limit using $\epsilon$, $N$ definition?    For every $\epsilon &gt;0$,  $|z_{2n}-l|&lt;\epsilon$ whenever $n&gt;N_1$, and   $|z_{2n+1}-l|&lt;\epsilon$ whenever $n&gt;N_2$.  We want to show that for every $\epsilon &gt;0$, there exists $N$ such that $|z_{n}-l|&lt;\epsilon$ whenever $n&gt;N$. I tried something like  $|z_{n}-l|\le|z_n-z_{2n}|+|z_{2n}-l|$ but wasn't sure what to do next I really like the 'ring chart' or 'wheel chart' given as an example on page 88 of the PGF manual. It is like a pie chart, but with a label in the centre. Unfortunately, the manual doesn't give the source for that chart. Does anyone have an example? Thanks. Nominate for Reopening Shows Duplicate Message Boxes "Unable to locate package" while trying to install packages with APT When I try to install any package through the command line, I get an error.   $ sudo apt-get install &lt;package&gt; Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package &lt;package&gt;   Can anyone help me on this? Is TV harmful to my infant's development? Unupvote immediately followed by an upvote gives me a net -10 reputation points I would have expected the correlation coefficient to be the same as a regression slope (beta), however having just compared the two, they are different. How do they differ - what different information do they give? Probability of first actor winning a "first to roll seven with two dice" contest? Classifying whether a collection of objects is a set Example where $f\circ g$ is bijective, but neither $f$ nor $g$ is bijective Can anyone come up with an explicit example of two functions $f$ and $g$ such that: $f\circ g$ is bijective, but neither $f$ nor $g$ is bijective?  I tried the following: $$f:\mathbb{R}\rightarrow \mathbb{R^{+}} $$ $$f(x)=x^{2}$$  and  $$g:\mathbb{R^{+}}\rightarrow \mathbb{R}$$ $$g(x)=\sqrt{x}$$  $f$ is not injective, and $g$ is not surjective, but $f\circ g$ is bijective  Any other examples?