What are the reasons for using strumming and picking patterns?

Question: From what i can tell so far, STRUMMING patterns are for two things, making sure the right beats are accented (because on the up strokes, youre only supposed to hit two strings) and keeping track of quarter and eighth notes (because the down strokes are all quarter notes and the up strokes divide them into eighths). Is that correct and are there any other reasons that im missing?
What about picking patterns? I have no idea what these are for. Please explain all the reasons for them. It seems kind of silly to me to play the notes of every arpeggio in the same order. What am i missing here?
Comment: Do you mean "picking pattern" with fingers, or with a plectrum ?
Answer: A strumming pattern is a technique for playing a rhythmic pattern. Most simple rhythms are best played with the strumming pattern you describe because this is the best way to keep your rhythm accurate.
As for picking patterns, it is not silly at all. It is crucial that you learn the most mechanically efficient way to execute sequences.
For instance:
Single string: Sequences where many notes are played on the same, repeated string are best played with alternate picking, which is a strict down-up pattern (or sometimes up-down).
Crossing strings: Sequences like arpeggios which are on three or more consecutive strings (either up or down) are best played with sweep picking because you don't need to reverse the pick's direction to continue onward and strike a new note.
Complicated patterns: string skipping will help you to play complicated patterns that leap over many strings. The picking direction of string skipping is often alternate picking but it really depends.
Combinations: Many combinations of the above two are best achieved by economy picking which basically means that the picking pattern will be alternate picking when the notes on a string are repeated and sweep picking when changing to a new string.
I think if you're seeing alot of information about "play this thing with that picking pattern", it may be confusing you and you may have trouble seeing the forest from the trees. But you need to master the basic mechanics of picking, and most passages definitely have a mechanically ideal pattern that should be considered. Advanced guitar players know these patterns, and if you choose a pattern other than the most mechanically efficient one, you're making it harder on yourself than an advanced guitar player would make on himself.
Answer: In addition to Grey's excellent answer, there's also hybrid picking, where a pick and fingers are used. Often, the pick is held between thumb and index finger (sometimes middle as well) and the remaining fingers can be used to pick strings, usually individually. This works well when the alternative is string skipping, as the hand doesn't need to be moving up or down - the pick and fingers are pretty well in the right place all the time.
I said usually individually, but of course, a pattern such as 5 /1+2+3 /6 /1+2+3 /would be good to play in a hybrid way.
Which leads on to playing without a pick at all - finger-style, where all digits can be used. Here, the thumb often plays on strings 6 and 5, maybe 4, while fingers (at a player's choice) will play 1,2,3(and maybe 4).A lot of folk, acoustic and country style guitar uses this.And of course, classical.
Comment: +1 for Tim. I think there is a lot to be said about using fingers vs. a pick as per tone. Touch is more intimate and allows for a more vivid tone palette. Why use a pick when you can actually massage, pinch, or pull the strings as needed. I am not the only one who shares this opinion many of the best blues musicians I know have taught me this e.g. Kenny "Blue" Ray's CD "Pull the Strings".


jQuery - How to calculate width of li floats

Question: Let's say i got a list looking like this:

Lorem ipsum

Lorem ipsum #2

Lorem ipsum #3

Lorem ipsum #4

Lorem ipsum #5

Lorem ipsum #6

How would i find the correct width of each li in this list?
Currently i tried to loop the li's and then print out the outerWidth, innerWidth and width.
All seems to return 0 as width.
Got any ideas on how to get the correct with of the elements without having to calculate the length of the string?
Comment: count letters, multiply it by constant, add some additional space.
Comment: Your approach is correct, but are you sure you do it *after* the DOM is loaded? Could you post your code?
Comment: create a jsfiddle that replicates your issue
Comment: not really on topic but...Is there any reason to put the same css rule on every li element instead of, for example, giving a class to the ul?
Comment: @microspino It is an example. If i just wrote some class'es you would have no idea what they would do.
Comment: @All - Thanks for all the suggestions. Found out that because the container in which the list was had a display none it could not calculate the width of the elements. I will reward the one with the most documented and correct answer with thumbs up and marked at answer. Thanks
Answer: You can just use the width method. eg.
$('li').each(function() {
    alert( $(this).width() );
});

This requires:

The DOM to be loaded (i.e. run the code from a ready handler)
The elements to be visible on the page

The element itself cannot be display: none
And all parent elements must be visible

http://jsfiddle.net/DvNf5/
Comment: @DannieHansen - Can you produce a jsfiddle that reproduces your problem? That will make it easier to see what's wrong.
Comment: Returns `79, 99, ...` for me. What browser are you using? And are you running your script after the DOM has loaded?
Comment: Read the comment on the main post :) Thanks, was entirely my mistake. Been sitting with the issue for like 4 hours straight. We all got our blond moments.
Answer: This code is returning widths for me -
$("ul > li").each(function() {
    alert($(this).width());
});

Demo - http://jsfiddle.net/CdyYa/
Answer: Works for me:
    $("li").each(function(){
       console.log( this.offsetWidth );
    });

//79 99 99 99 99 99

http://jsfiddle.net/63nxL/
Comment: Darn it :) That returns 0 as well.
Comment: @DannieHansen, then your page does something different from jsfiddle :P
Comment: Looks like if i turn block on and off using chromes editor(HTML) and then execute the function to fix the width one more it works. But no matter when or where i execute the fix with in my JS it won't return correct widths.
Answer: How about, instead of display: block; float: left;,
display: inline-block;

Comment: Tried that as well- No luck either.
Comment: Works for me on all modern browsers.
Answer: using jquery...
http://jsfiddle.net/y4X8S/  (the fiddle uses console.log instead of alert)
$( function(){
    $('li').each( function( i,el ){
        alert( $(el).width() );
    } );
});


@ResponseStatus and web.xml

Question: Here's what i have so far :
controller :
public abstract class MyController {
   @ExceptionHandler(Exception.class)
   @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
   public void handleAllExceptions(Exception e) {
      // stuff
   }
}

and my web.xml :
<error-page>
  <error-code>500</error-code>
  <location>/error.htm</location>
</error-page>

And when an unexpected exception occur, the handle works, the stuff is done, but i'm not redirect to /error.htm
Instead i'm still on the same page, but a error 500 is printed by apache.
What did i miss ?
Thanks :)
Answer: I think you need to return the view you want to show.
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String handleAllExceptions(Exception e) {
  return "error.jsp"; /* use the correct view name */
}

@see: Spring 3 controller exception handler implementation problems  for some examples
Comment: return "redirect:/error.htm"; with the redirect: it works ! Thanks :)

@ResponseStatus and web.xml


How to have a function feed another function's input

Question: I'm making a hangman game and testing how different letter picking algorithms fare, but to do this, the guessing algorithm function has to feed a letter into the hangman function's input('Select a letter').
How do you make it so that a function detects when another function is waiting for an input ?
Comment: You tagged with question with both `python-3.x` and `python-2.7`. Which version are you using? Are you aware that [Python 2 is officially deprecated](https://www.python.org/doc/sunset-python-2/)?
Comment: @Brian My bad I am using 3.6
Comment: One option is to run it as a subprocess and have the testing code pump newline delimited characters into its stdin. Another is to rewrite the hangman function to separate out the input prompt. That can get a bit tricky.
Answer: Assuming you are doing input() in a loop inside your hangman function, you could switch that to a yield and let an external function drive input as needed. In this example I have a hangman function that uses yield to get data. Now its a generator and driving function can use next and the generator's .send method to pump data into it.
def hangman(chances=5):
    for i in range(chances):
        letter = yield "prompt"
        if letter == "quit":
            yield "quit"
            return
        print("letter", letter)
        # do all the things
        solved = False
        if solved:
            yield "solved"
    yield "failed"

def command_line_prompt_hangman():
    feeder = hangman()
    state = next(feeder)
    while state == "prompt":
        state = feeder.send(input("Next letter: "))

def test():
    # after years of testing the best algorithm is
    test = ['a', 'b', 'c', 'd', 'e', 'f']
    feeder = hangman()
    assert next(feeder) == "prompt"
    for count, letter in enumerate(test, 1):
        state = feeder.send(letter)
        if state == "solved":
            print("did it in ", count, "tries")
            break
        if state == "failed":
            print("exceeded count")
            break

command_line_prompt_hangman()
test()

Comment: Being a rather casual user of Python I learned a lot of useful things from this, thanks a lot !
Answer: Instead of using the input function, write a custom function to pull an output from whatever algorithm you are using.  That would look something like this:
user_input = algo_obj.get_input(game_state)

In this case, algo_obj would be an object storing the current state of the algorithm/generator (if such a state exists, otherwise you can just call the function normally).  game_state would be some representation of the game's current state (available letters, the word-form -- ie. blanks & letters).
You can then feed user_input to your Hangman function.
Comment: I have actually figured out the 'finding the next letter to pick from the current state of the game' part, I was looking for a way to make a function that starts the Hangman function and iteratively listens for an input() command, which would prompt it to feed it the best current choice for a letter, and wait for the next input prompt.
Comment: In that case, `input` should auto-wait whenever you call it.  Basically, you can just call the `input` function at the beginning of each cycle and either use it to check whether or not you should continue or just call and discard the result.  It will wait either way.
Answer: This should be as simple as:

Define both functions.
Pass one function return value to the other one as argument.

This can be done by using input() as according to this
e.g. Define the functions
def first_function():
    input_variable = input("Please enter some data")
    return input_variable

def second_function(a):
    print(a) # Do some calculations here

And use them:
second_function(first_function())

I wouldn't say that this is necessarily the best way to go about but it solves Your problem. If You would like to receive a more detailed answer please provide code samples.


Prove that the following function is holomorphic

Question: Let $g:B(0,R)\to\mathbb{C}$, $g(z)=a(\rho,\alpha)+ib(\rho,\alpha)$ an holomorphic function I have to prove that $h(z)=\overline{f\left(\frac{R^2}{\overline{z}}\right)}$ is holomorphic over $\mathbb{C}\setminus \overline{B(0,R)}$. I have troubles in proving the validity of Cauchy-Riemann equations for $h$.
C-R in polar coordinates are:
$$
\frac{\partial a}{\partial \rho}=
\frac{1}{\rho}\frac{\partial b}{\partial \alpha}\\
\frac{\partial b}{\partial \rho}=
-\frac{1}{\rho}\frac{\partial a}{\partial \alpha}\\
$$
My attemp so far:
$$
h(z)=a\left(\frac{R^2}{\rho},\alpha\right)-ib\left(\frac{R^2}{\rho},\alpha\right)
$$
$$
\frac{\partial }{\partial \rho}a\left(\frac{R^2}{\rho},\alpha\right)=\frac{\partial a}{\partial x_1}\frac{\partial x_1}{\partial \rho}=\frac{\partial a}{\partial x_1}\left(-\frac{R^2}{\rho^2}\right)\\
-\frac{\partial }{\partial \alpha}b\left(\frac{R^2}{\rho},\alpha\right)=
-\frac{\partial b}{\partial \alpha}=-\rho\frac{\partial a}{\partial \rho}=-\rho\frac{\partial a}{\partial x_1}\frac{\partial x_1}{\partial \rho}=-\rho\frac{\partial }{\partial \rho}a\left(\frac{R^2}{\rho},\alpha\right)
$$
but the minus sign is wrong...
Any help will be appreciated.
Comment: I would suggest that you edit your post to include the details of your efforts. We cannot read your mind and guess where your problem lies. Personally, I would not using polar coordinates here, but if you are you should begin by writing the Cauchy-Riemann equations in polar form.
Comment: I edit the question to clarify where the problem is.
Comment: First, you didn't write down CR in polar, as I asked. Second, you're being extremely sloppy about where partial derivatives are evaluated when you proceed.
Comment: @TedShifrin. My fault. I have added C-R equations.
Answer: For me, the best way to show this kind of things is to use the definition of holomorphic maps as conformal maps. Your function $h$ is the composition of three maps:
$$z\mapsto g(z) = \frac{R^2}{\overline{z}}$$
$$z \mapsto  f(z)$$
$$z \mapsto c(z) = \overline{z}$$
The maps $g$ and $c$ are easily shown to be antiholomorphic, that is, they preserve angles and switch orientations, and $f$ is holomorphic, that is, it preserves oriented angles. The composition $h = c\circ f\circ g$ then preserves the magnitude of angles (because the three factors do), and it switches orientation two times, so in the end it preserves oriented angles. That proves that $h$ is holomorphic.
In general, the composition of a holomorphic function with an even number of antiholomorphic functions is holomorphic. Antiholomorphic functions are recognized as functions of the conjugated variable $\overline{z}$.
EDIT: This is even more trivial if you think of $f$ as a power series of $z$. If you substitute $z$ by $R^2/\overline{z}$ in this power series, you get a power series of $\overline{z}$ (because $R^2/\overline{z}$ is itself a power series of $\overline{z}$). Applying conjugation, you get a power series of $z$, which is equal to $h$, hence $h$ is holomorphic.
Comment: I have understand your answer. I'm requested to use Cauchy Riemann equations and I'm stucked with partial derivation and I miss some minus sign.
Answer: You have not followed up on my suggestion to be careful about where partial derivatives are evaluated, so I'll do half of the proof here.  (I think the simultaneous use of the letters $a$ and $\alpha$ is bound to lead to disaster.)
Let $A(\rho,\alpha) = a(R^2/\rho,\alpha)$ and $B(\rho,\alpha) = -b(R^2/\rho,\alpha)$. You want to show, for example, that
$$\frac{\partial B}{\partial\alpha} = \rho\frac{\partial A}{\partial\rho}.$$
We have
$$
\frac{\partial B}{\partial\alpha} = -\color{red}{\frac{\partial b}{\partial\alpha}\big(R^2/\rho,\alpha\big) \overset{\text{C-R}}=} -\color{red}{\frac{R^2}{\rho}\frac{\partial a}{\partial\rho}\big(R^2/\rho,\alpha\big)}
= \rho\frac{\partial A}{\partial \rho},$$
because $\dfrac{\partial A}{\partial\rho} = \dfrac{\partial a}{\partial\rho}\big(R^2/\rho,\alpha\big)\cdot \left(-\frac{R^2}{\rho^2}\right)$. Note the portion in red is crucial, and this is why I told you to be careful about where partial derivatives are evaluated.
Comment: Now is clear. I'm not evaluating in \rho but in R^2/\rho... C-R has to be adapted accordingly.


events.js:167 throw er; // Unhandled 'error' event at ionic framework

Question: I am developing a simple mobile application using the ionic framework. And got this error on my CLI during the serve command ionic serve
Below I have mentioned the versions of my application
Ionic:

ionic (Ionic CLI)  : 4.4.0 (C:\Users\Jahir\node_modules\ionic)
Ionic Framework    : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:
cordova (Cordova CLI) : 8.1.2 (email@example.com)
Cordova Platforms     : not available
Cordova Plugins       : not available

System:
Android SDK Tools : 26.1.1 (C:\Users\Jahir\AppData\Local\Android\Sdk)
NodeJS            : v11.2.0 (C:\Program Files\nodejs\node.exe)
npm               : 6.4.1
 OS                : Windows 7

I also posted my error elaborately from the CLI, please find it below
events.js:167
  throw er; // Unhandled 'error' event
  ^
Error: spawn cmd ENOENT
  at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
  at onErrorNT (internal/child_process.js:421:16)
  at process.internalTickCallback (internal/process/next_tick.js:72:19)

Emitted 'error' event at:
  at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12)
  at onErrorNT (internal/child_process.js:421:16)
  at process.internalTickCallback (internal/process/next_tick.js:72:19)

Please give me the solution, I know it is a simple error, a solution will be much helpful.
Answer: just add it to the PATH: C:\Windows\System32 and start cmd as Administrator
Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.
Positively Hope, it will work
Comment: This procedure solve the issue? In my case no... Another idea? thans


What kind of data is appropriate for probability density plots?

Question: Is it appropriate to use a probability density plot on calculated data?  For instance, in ArcMap I have several gridded data sets that I use to calculate a final gridded data set?  Is it appropriate to use a probability density plot on this data?  I wouldn't consider it experimental - I do not believe I am sampling from some population, P, but rather using measured values (or estimated values) to generate another estimated value.  Can a probability density plot still be used?  I have found it is the clearest method to visualize my data, even if not entirely appropriate.
OP added as comment October 28, 2015 [minute editing Nick Cox]
The main reasons I have for choosing density plots over histograms in this very case, are that the density plots (from ggplot) are less muddied and more clearly indicate areas of overlap as well as the tails of the calculated variables compared with the histograms I have been able to generate from the same graphics package and other similar ones. Therefore, they seem to give a better understanding of my results (calculated for different formulations/combinations of inputs) then using the standard-bearer, histograms.
Answer: I presume this means the result of some density estimate, e.g. from a kernel density calculation. I see absolutely no reason why not. It's just a smooth representation of your (calculated) data. In principle you would presumably not object to a histogram, which is just (equivalent to) a different estimate of the density function. Any kind of smoothing can thought of as an attempt to get at the main signal in the data: you are not committed as a matter of dogma to the idea that everything you do has to be interpreted in terms of a larger population or a generating process.
Orthogonally to that, I will just add that too many users accept the default from their software as the estimate, which is not a good procedure, even if the default is based on some sensible rule of thumb or on cross-validation. Any density estimate you take seriously needs a little sensitivity analysis in terms of changing kernel width, perhaps kernel type, and very often also what is done if the variable is bounded above and/or below.
For example, a common default that bites especially when a variable is positive, or non-negative, and positively skewed is that probability is smeared below zero, and then ignored. It's also common in such cases that the density is under-smoothed for high values and over-smoothed for low values.
I'd add that quantile plots don't require any arbitrary choices at all and with a little effort reveal level, spread, skew, tail behaviour, gaps, ties and outliers. Density plots blur some of these details. So, if you have reservations about histograms (as do most practising data analysts) there are other kinds of graphs too.


Polynomial Factorization

Question: I was handed $x^3-x^2+x-2=0$ to factor, but I'm not sure how.  I tried all the methods I know of--which, at the time of writing, are limited by my precalc math background (I'm working on that...).  Is there some method to factor this?
Comment: Using the rational roots theorem we check $x = \pm 1, 2$, none of which give us equality. So this won't factor over the rationals.
Comment: Perhaps it's a misprint for $\rm\ x^3-x^2+2\ x-2\ =\ (x-1)\ (x^2 + 2)\:.$
Comment: Great.  But considering how complex this should be, how am I supposed to factor it?
Comment: @CMC,http://www.wolframalpha.com/input/?i=factor+x^3-x^2%2bx-2
Comment: Sorry... just how complex *should* this be? What if you were handed $x + 5$ to factor??
Comment: @CMC,$(x-1.35321) (x+(0.176605-1.20282 i)) (x+(0.176605+1.20282 i))$
Answer: The following answer omits numerical details.  You can fill in these details, if you care to.  The full answer is rather messy. It is possible that whoever handed you the problem had a simpler one in mind, and wrote down the wrong coefficients.
There are two factorizations that one might have in mind: (i) Factorization over the complex numbers and (ii) Factorization over the reals.
(i) Over the complex numbers: Let $a$, $b$, and $c$ be the roots of the equation $x^3-x^2+x-2=0$. Then we have
$$x^3-x^2+x-2=(x-a)(x-b)(x-c).$$
Now we have the complete factorization over the complex numbers.  There is, of course, a little missing detail: finding $a$, $b$, and $c$. We will get to that later.
(ii) Over the reals: It turns out that the equation $x^3-x^2+x-2=0$ has exactly one real root. Call that real root $a$. The other two roots are non-real.  It turns out (not by accident) that these non-real roots  are complex conjugates. One of them has shape $p+iq$ and the other has shape $p-iq$, where $p$ and $q$ are real and $q\ne 0$. Then the factorization over the reals is
$$x^3-x^2+x-2=(x-a)(x^2-2px+p^2+q^2).$$
Again, we are finished, once we have found the roots.  Actually, we only need to find $a$.  For once we have found it, we can use division of polynomials to divide the polynomial $x^3-x^2+x-2$ by the polynomial $x-a$ to find the quadratic factor.
For either problem, finding the roots is more or less inescapable.  But what does it mean to find the roots?
There are two reasonable interpretations of what it means to find the roots.  (a) Find a good numerical approximation to the roots and (b) Find an exact expression for the roots.
(a) Numerical approximation: There are many ways to find a good numerical approximation to the real root of $x^3-x^2+x-2=0$. Many calculators (except the cheapest, like mine) will find a good numerical approximation.  So will Wolfram Alpha.  There are nice calculus-based methods that I will not describe since this is a pre-calculus question.  You can also decide where the root might be, and get better approximations by intelligent trial-and-error, or by using a graphing calculator to zoom in on the relevant portion of the curve $y=x^3-x^2+x-2$. Once you have a good numerical approximation to the real root $a$, you can divide the original polynomial by $x-a$ and get an approximate factorization of your polynomial.
(b) Exact expression: The equation $x^3-x^2+x-2=0$ does not have any "nice" solutions, in particular it has no rational solutions. Luckily, a formula for the roots of a cubic was found by Cardano in the middle of the sixteenth century (I am lying a little, the history is more complicated than that.)
Wolfram Alpha knows that formula.  For the details about the formula, you might want to look at this Wikipedia article (As usual, there are better sources, it depends on how much detail you want.)
Now you can use the formula in the Wikipedia article to find an expression for the real root $a$, and continue as suggested above. Or else you can use Wolfram Alpha. The expression for the real root is a mess, and would horrify more than it would enlighten. But actually the reasoning behind the formula is interesting, and really not all that hard. I can supply more detail if your searching does not satisfy your curiosity.

Polynomial Factorization


How can I turn an electric bass into a fretless electric bass by myself?

Question: I have an old electric bass that I don't use anymore. I thought I could turn it into a fretless one.
Is there any way I could remove the frets by myself and turn it into a functioning fretless electric bass?
Answer: Looking online, opinion seems to be split about the merits of doing this, with some sources pointing out that you can simply buy a fretless neck for a reasonable price. But I certainly remember bass playing friends of mine removing the frets from basses, to convert to fretless, and I can understand why you would want to do this with a bass you don't currently use.
I'm pretty sure my friends just knocked the frets out and didn't worry too much about doing it properly… But there is plenty of info online about how to take a more measured approach.
One comment that seems to pop up regularly, is that you should be okay as long as you are not bothered about putting frets back in later! This is because you may well cause some damage to the neck while removing the frets. It's easy to fill any splinters that come away from the fretboard, then sand and refinish, but it would then be hard to refret.
I managed to find a site where you can download a free eBook taking you through the full bass-defretting process, here. I downloaded the book and it looks pretty good; it has really detailed information and a lot of pictures! It is recommended by other sources online.
A much shorter version of the same method can be found here. I won't simply copy the text here, but some of the main points are:

remove the neck if possible, before starting this job.
don't use a screwdriver to remove the frets (!) Instead, use "end cutters, a flat nail clipper, or another specially designed tool to lift the frets out."
try to glue down any splinters that come off the neck immediately; this will mean you have less filling and refinishing to do later.
if the frets don't want to come out, soften the glue by applying a soldering iron to the frets directly, but be careful not to scorch the wood of the neck.
if you want the fret grooves to match the colour of the neck (i.e. you don't want "markers") then save sanding dust from the neck as you sand it, you can mix this with glues to make a matching filler.
"use a radius block to sand and finish your defret"

Other sources suggest a couple of other useful points:

put masking tape either side of the frets before removal, to help avoid marking the neck.
you can fill the gaps with a thin veneer before sanding to make fret markers.
Comment: As I recall, it worked for Jaco.
Comment: Great answer, please add it to http://music.stackexchange.com/questions/1801/how-do-i-go-about-de-fretting-a-bass-guitar if (when) this is closed as a duplicate.
Comment: Often fretboards will have trim along the sides which complicates matters. Even if that's not the case you may wish to do as I did instead, which is to file off the frets. You might begin with a dremel tool, but you'll want to finish off with a flat file either way before any gouge is in danger of falling below the fretboard. Cut out pieces of tin can lid to tape or glue between frets until you're in the final stretch, and filing then sanding into the resin, carbon, or wood. You'll need to varnish, but not fill the nice nickel fret lines. However... !
Comment: Examine the quality of the underlying fretboard before embarking on this first. Fretboards can become worn from people gouging out wood during bending. Some fretboards may have never been flat to begin with, as the manufacturer merely had to level the frets themselves, not the fretboard. You can adapt to gradual neck curvature, but if your fretboard is gouged out from play on just three strings of three frets, as I found to be the case on the acoustic I converted, it kind of sucks, and a repair would require filler resin/varnish and a long straight steel sanding block.
Comment: These are good points, Kristal. I reckon they're detailed enough to warrant posting as an answer. As this post is a dupe, it might be worth posting an answer to the question linked to above.


Convergence of F(n,n) distribution to normal

Question: Suppose that $X \sim F(n,n)$, an F distribution on $n$ and $n$ degrees of freedom. I'm trying to figure out why some literature state that $X$ converges in distribution to a normal distribution.
My confusion lies in the fact that $X$ can be written as a ratio of two chi-squares,
$$ X = \frac{\chi_n^2/n}{\chi_n^2/n} $$
However, it is known that $\chi_n^2/n$ converges in probability to $1$. So by Slutsky's theorem, shouldn't the above converge to a degenerate distribution at $1$?
Comment: An argument that it converges to a normal would require us to standardize in some suitable way; it'll be a standardized variate that converges to a normal. You'll still want to use Slutsky in there as well, I'd say.
Comment: $\sqrt{n/4}(X-1)$ converges to a standard Normal distribution.
Comment: @whuber Thank you. I tried reasoning out the asymptotic distribution in my edited post. Please let me know if there is anything missing in my argument.
Comment: @Flowsnake I suggest you take the "edit" you inserted in your question and post it as an answer and accept it too (it is totally within the rules of the site). In this way, the thread will be taken out of the "unanswered" queue.
Comment: Thank you, I will do that, although it feels strange accepting my own answer.
Answer: Sorry for the bump, but I will do what was suggested in the comments and post this as answer instead of editing the question:
Let $(X_1,..,X_n)$ and $(Y_1,..,Y_n)$ be independent chi square samples with 1 degree of freedom. Then by the CLT,
$$ \sqrt{n}(\bar{X} - 1) \rightarrow N(0,2) $$
$$ \sqrt{n}(\bar{Y} - 1) \rightarrow N(0,2) $$
It follows from the Delta Method with $g(x,y) = \frac{x}{y}$ and $\nabla g(x,y) = (\frac{1}{y} , -\frac{x}{y^2})$, that,
$$ \sqrt{n}(g(\bar{X},\bar{Y}) - g(1,1)) \rightarrow N(0,4) $$
But $g(\bar{X},\bar{Y}) = \dfrac{\frac{1}{n}\sum\limits_{i=1}^nX_i}{\frac{1}{n}\sum\limits_{i=1}^nY_i} \sim F_{n,n}$. So, $\sqrt{n}(F - 1) \rightarrow N(0,4)$ as @whuber showed in the comments.


locally host a working website

Question: I'm trying to locally host an already working/hosted website using wampp to try and edit it without messing up the site. But every time I try to open the site using localhost/example, it automatically redirects to the hosted domain(https://www.example.com). Can someone help me solve this issue?
Answer: You have an .htaccess rewrite rule / PHP redirect moving all traffic to https://www.example.com when the domain/protocol doesn't match.
If it's in .htaccess look for these lines and comment them out:
<code>RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</code>
If there's an http -> https redirect that will have been set up manually (the above is included in the core .htaccess), so you'll need to locate and remove that separately.
If it's in PHP, it typically happens in settings.php. You should be able to see what's doing it fairly easily and comment out/remove for your local environment.
Failing that, you'll probably need to trawl the code to find out what's responsible for the redirect.
Answer: Check if the URL is hardcoded in .htaccess file, any re-direct module or rule enabled. Also try opening in a different browser as Firefox apparently per this thread tries to fix the address if there's a bad connection. If nothing fixes the redirect, try a re-install following the steps here.

locally host a working website


JBoss 5.1.0 GA with Apache Load Balancer

Question: I've followed the tutorial here: http://community.jboss.org/wiki/UsingModjk12WithJBoss
All my files as configured as it says there but then I try to access http://localhost/jmx-console I get
<code>Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /jmx-console.

Reason: DNS lookup failure for: host1
</code>
If I call http://localhost/admin/ the browser seems to be loading forever.
Any ideas ?
Comment: I think you're going to need to post some more info before anyone can provide an answer. Try including the relevant information from your apache and modjk configuration files. Can you get to /jmx-console when you access your jboss instance directly (bypassing apache)?
Comment: Here is my httpd.conf :
http://pastebin.com/3EDqhm0V and
httpf.conf : http://pastebin.com/Cm7DKcdm
mod-jk : http://pastebin.com/3Wug1Z7t ,
uriworkermap.properties : http://pastebin.com/hDiSyhSq and
workers.properties : http://pastebin.com/RxPeA7yb .

With these configured I can acces http://localhost/myapp-1 and http://localhost/myapp-2 but not http://localhost/jmx-console/ .

Thank you.
Comment: Try commenting out lines 488+ in your httpd.conf. It looks like you may have been trying to use mod_proxy at some point and left that in? Those lines are causing it try to proxy requests for /jmx-console to a server called "host1" which does not seem to exist in your environment.
Answer: For the sake of recording an answer: Comment out the unused mod_proxy directives in the httpd.conf file.
Comment: With the same config files, I start a second JBoss instance on another PC, and when I call http://192.168.224.5:80/autoid/ I get time-outs. The only modification between the two JBoss's is jvmRoute="node2" in server.xml in the second computer. Is that correct ?
Comment: I've also added in mod-jk.conf Allow from 192.168.224.160 (the IP of my second computer) under the  tag but to no use.
Comment: Ignore the above post. Firewall issues.


Chamada Assincrona a um RestFull WebService

Question: Preciso fazer uma chamada ao WebService em Android, e com outra classe chamá-la. No final mostrar no design a resposta obtida pelo ws. Eu já fiz o WebService só que a parte do "assincrona" não está a dar.
Este é o meu WebService, recebe três strings:
public class WebServiceRestFull extends AsyncTask<String, String, String>
{
    protected ProgressDialog dialog;

    public String wsURL;
    public String wsFunction;
    public String wsInput;

    public int codigoHTTP;
    public String mensagemHTTP;
    public String strResposta;

    public WebServiceRestFull(Context act)
    {
        dialog = new ProgressDialog(act);
    }

    @Override
    protected void onPreExecute() {
        dialog.setMessage("Aguarde por favor...");
        dialog.show();
    }

    @Override
    protected void onPostExecute(String result)
    {
        if (dialog.isShowing())
        {
            dialog.dismiss();
        }
    }

    @Override
    protected String doInBackground(String... params)
    {
        //chamada ao webservice e retorna uma string

        //return resposta do webservice;
    }
}

Do lado do "Android Activity" eu chamo esta classe assincrona do seguinte modo:
WebServiceRestFull web = new WebServiceRestFull(this);
web.wsURL = "http://someurl.com/rest/etc";
web.wsFunction = "login";
web.wsInput = "mike";
web.execute();
Thread.sleep(1000);

O problema é que não está a fazer de fato uma chamada assíncrona e os resultado quase sempre não são recebidos pelo WebService.
Existe alguma maneira mais simples de fazer isto ou estou a fazer errado nalgum lado como a chamada ao WebService ou a própria classe do WebService?
Comment: Um bom exemplo para começar esta aqui.

http://programmerguru.com/android-tutorial/android-restful-webservice-tutorial-part-1/
Comment: A resposta é passada ao método `onPostExecute()` através do parâmetro `result`. É nesse método que deve tratar a resposta.
Comment: Você não está fazendo nada no código acima, você apagou o código no `doInBackground` ? Do jeito que está, você só exibe um dialog e fecha
Answer: Miguel, não sou especialista em Java, mas considerando o conceito de Threads você está utilizando o "Thread.sleep(1000)" por qual motivo?
Se sua classe está fazendo uma requisição assíncrona e você está aguardando um segundo por ela, então provavelmente não está implementado como deveria, pelos seguintes motivos:
1) A Activity é síncrona por exato 1 segundo com a classe assíncrona esta não é a forma correta de lidar com o retorno de uma classe assíncrona.
2) Não foi apresentado nenhum código para recuperação de resultados na sua questão, logo parto do entendimento que você está fazendo isso logo após o Thread.sleep, o que nem sempre será suficiente.
Portanto recomendo que implementa alguma forma (eventos?) de detectar quando sua classe assíncrona conclui a busca de informações no WS e então recuperar o valor desejado, de forma que isto não impeça a execução contínua da Activity (isso sim seria assincronismo).
Não colocarei nenhum exemplo em código pois minha contribuição em Java limita-se a teoria aplicada também a outras linguagens.
Espero ter ajudado, amigo.
Answer: Estou em um projeto parecido. O WS vai retornar os dados para a sua activity principal.
O jeito de resolver pelo AssyncTask
que realmente faz o que você quer, ao invés de esperar o tempo da thread e sim fazer pelo que vai acontecer depois.
olha as respostas dessa pergunta sobre usar Thread ou assync ou handler https://stackoverflow.com/questions/6964011/handler-vs-asynctask-vs-thread
Tá aqui um exemplo do assynctask
https://jsfiddle.net/nzqLxa5v/
mas esse é do meu projeto, ai vai de vc adaptar.
Mas o que ocorre ai é vc entender o doInBackground e onPostExecute
Comment: Não sabia disto, sou novo aqui ainda.. Não sabia desse ctrl k. Valeu obrigado.
Comment: Em vez de colocar um link, coloque o código directamente na resposta.
Comment: Coloquei  o link para não poluir o tópico e não perder tempo dando espaços já que a intenção é só ajudar
Comment: O código não é poluição, a grande maioria das resposta tem código associado e ele deve ser postado. Para formatar o código não necessita de introduzir espaços linha a linha, basta seleccioná-lo e clicar ctrl + k.


What is a chord in terms of frequencies?

Question: I'm trying to understand what chords are in terms of frequency.
So I get that each note represents a frequency range. For instance, an "A" note in the third octave (A2) is ~110hz.
An A major chord (in third octave) is constructed with an A, C#, E, with corresponding frequencies 220.5, 138.5, 164.5. Since we are playing this in a single stroke, one might assume that this blends into a single frequency that is equal to the average of the three, which is 174.5hz. But an F3 note is also equal to 174.5hz, and it doesn't sound just like an F, so that must be incorrect.  Chords can also span multiple octaves, which definitely throws out the method of averaging note frequencies
What are chords in terms of frequencies? Why does a (major, for instance) chord use a third and a fifth? Most books/articles I've read regarding music theory just take this as a given and don't properly explain why a chord has these frequencies meshed together.
From the comments below, the brain does analyze the notes individually.  What is it about the sound that makes this possible?
Comment: "I assume that this blends into a single frequency that is equal to the average of the three, which is 174.5hz." I don't know why you would assume that, but it's dead wrong. Musical instruments, acoustical physics, our ears, and our brains do not work like that at all. There's no averaging. It's the opposite - **all the different frequencies present are separated and analyzed by our brains**, more or less. Some frequencies are more important than others when our brains decode them.
Comment: Right. Obviously my assumption did not hold; that's why there is a question here at all. But if the brain can analyze the individual notes that make up the chord, why do these note intervals make up a chord? Perhaps it has to do with the ratio then?
Comment: You might need to edit your question, taking a step back, removing the incorrect assumptions, and ask something more direct to help you understand more about chords or maybe just single notes and why they sound the way they do. Right now it's hard to write any kind of answer to this question since the question doesn't really make sense as it is. Not all chords use thirds and fifths. The most popular chords do, but that's not all chords.
Comment: If A2 is 110, why would A3 be 220.5 rather than 220.0?  Also, C# and E would be 138.6 and 164.8 respectively, calculated using the twelfth root of 2 (that is, in 12-tone equal temperament).
Comment: While Todd is pretty much correct there is a threshold to pitch discrimination and when we are provided a pair of frequencies that are close we may perceive the average as the tone and hear the difference as an amplitude modulation.  However this does NOT happen with notes in a chord.
Answer: As Todd noted in a comment, frequencies combine rather than average.  Remember that sound is simply moving air (or other medium) being pushed around by, for example, a vibrating string.  If you push on something 3 times a second and someone else pushes on it 2 times a second, you wouldn't see it move only 2.5 times per second!  You also wouldn't see it move exactly the same amount 5 times, either, since some of your pushes are going to line up at the same time and result in one bigger movement.  And when it comes to sound, you're not just pushing but also pulling — so some of your pushes will cancel out.
This graphic (credit to Alex Basson) illustrates how waveforms combine:

As you can see from the final image, both of the original frequencies are represented — the overall frequency is still that of x, but it has a clear sub-frequency that matches y (which is double that of x, in this case).  This allows your brain to "pick apart" the sound and hear all of the notes in a chord — different combinations will make different shapes, all representing their components.
Related post that the above was taken from: How do harmonics work?
As for why notes are "chosen" for a chord — well, any two or more notes form a chord.  But the most common are structured around a note and its fifth (seven semitones above) because they form a 2:3 frequency ratio.  Other than 1:1, 1:2, or 1:3 ratios (two of the same note separate by 0-2 octaves), this is the simplest ratio (the one with the smallest sides) — which means that, while it has bit of intermingling to sound interesting, the frequencies regularly "line up" and form peaks and troughs together, as above.  This is called constructive interference, and when it works well and sounds pleasing it's called consonance.
If you want your sound to be more "interesting", you add in notes that line up less often, giving more twists and turns to the waveform.  When this becomes too much and just a jumble of frequencies it tends to be unpleasant, and is called dissonance.
For a mathematical representation of consonance/dissonance, see my answer here.
Comment: How do you justify saying that the frequency of x is the "overall frequency" of the sum?  This is not true by any measure.
Answer: A good question to ask!
As said by Tood Wilcox and Matthew Read, combined sounds don't just average their frequency; instead they superimpose. To get a better idea, it might help to consider water waves: you can have big shallow ocean waves and much smaller excitations on top at the same time. Clearly, the result is not just a single wave (monochromatic, to use the proper term) with the average frequency, but, well, a distinguishable combination. It works just the same way for sound waves†.
That is, except when it doesn't. Your assumption actually holds sometimes, if only under special circumstances.
When you hear two violinists playing a single note unisono, you hear in fact not two individual pitches which just happen to be the same frequency (almost the same: intonation is never completely accurate). Instead, you do hear a single note with something like the average frequency, but also a slightly different tonal character. The reason is quite a remarkable mathematical fact, namely that the additive superposition of two sine oscillations is equal to the multiplicative superposition of two other oscillations.
sin(θ) + sin(φ) = 2 · sin(θ+φ/2) · cos(θ−φ/2)
Here, θ+φ/2 is your average frequency! θ−φ/2 is the beat frequency; if θ and φ are very similar then the difference will be much smaller than the individual frequency. In fact, if one violinist plays 439 and the other 442 Hz, then the difference frequency is inaudible infrasound! The cos(θ−φ/2) factor is nevertheless not irrelevant. Multiplication by a constant like 2 means modifying the amplitude and thus also the loudness. cos(θ−φ/2) is almost constant because the frequency is so low, but nevertheless it changes in time, making the sound louder and quieter periodically. This is the phenomenon called beat.
Now, it only works quite so simple for two pure sine (or cosine, doesn't matter) waves of the same amplitude. Real instruments do not cause sine oscillations, they have more complicated waveforms, and somewhat different between any two instruments. Nevertheless, beat is audible when you tune e.g. the empty strings of two violins to match, together with other effects that make the sound generally more "smooth / silky" – I won't discuss that here.
I said special circumstances. Well, when the frequency is not almost the same, then the sine beat will be too fast to actually be recognised as loudness modulation. However, there are other special cases which lead to a similar phenomen: instead of almost the same, φ≈θ consider now twice the frequency, i.e. φ=2·θ. (Again the following will also work with almost twice, you just get an additional beat term.) Then two oscillations of φ will exactly fit into one oscillation of θ. So the result has the same periodicity as a θ-oscillation alone – by definition, this means it has the same frequency! Does this then mean that superimposing a double frequency doesn't change anything? Well, not quite. The waveform will sure be different. In fact, one useful way to interpret the different waveforms of various instruments is that they all consist of a superposition of many integer-factor sine waves, the overtones, mixed with different amplitudes. Some instruments actively exploit that: an organ creates its different sounds by mixing pipes whose frequency is a factor 2, 4, 6 or 8 apart. Each combination sounds different, but they're all perceived as one tone with a "shared frequency".
Except when they aren't. This illusion does work for an organ passage where every note uses the same combination. If you have actual independent instrument voices, then each chord has a slightly different mixture. Our ears notice this and the brain is able to deduce back the individual frequencies. There can be other cues as well, e.g. in a strummed guitar chord the notes don't begin quite at the same time. Nevertheless, the sound of (almost) integer-related frequencies is perceived as, well, consonant, harmonious. That's how chords work!

†Actually, sound waves are simpler than water waves – these involve funny circular movements around imaginary surface points. Sound waves behave more like a queue of people (≈ air molecules) in which everybody waits to get pushed from behind, and then transmits the push to the guy standing in front (but nobody actually steps forward). You could then imagine an ongoing sequence of shoulder-taps every few seconds, interspersed by two-hand pushes every minute or so. Again, superposition of two frequencies. Of course that's also not really how sound waves behave, but you get the idea.
Comment: Are "imaginary surface points" points on an imaginary surface, or imaginary points on a surface?  Or something else?
Answer: They do not "blend" in any way shape or form.  To understand this better you need to delve into a few disciplines; physics, math, biology, and psychology.  I will come from the math-physics angle.  First of all when you play the 110Hz that is the lowest note in your chord you are NOT playing or experiencing 110Hz alone.  Any instrument that is "attacked" to produce a note produces a whole spectrum of notes based on the harmonics of the system.  Within that spectrum you actually have an octave, a 5th and the maj 3rd (actually 2 octaves and a 3rd above the fundamental).  This is also true of the other notes you play in the chord, the C# has harmonics that correspond to E# and G#, etc.  The mechanical wave and the acoustic wave produced by the instrument is a fairly complex entity but it can be described as the linear superposition of a bunch of pure sine curves, each with three pieces of information in them; the frequency, amplitude, and phase.  A single plucked note on the guitar for example would, in theory, have an infinite number of harmonics in it.
wave = sum over all harmonics n = 1...Infinity of (Ansin(2pi * fn * t - kn*x + phi_n)).
kn and fn are related.
When you play a chord you play three or more of these infinite combinations of harmonics.
The reason this is important is because your ear creates harmonics too.  Even if one could build a sophisticated machine that can create a pure sine wave (and we have such machines in physics labs, maybe not perfect or ideal but close) you ear will create the harmonic sequence.  So, it is not possible (as far as I am aware) for a human to NOT hear the harmonics.
What does it even mean to "combine" frequencies?  That depends on how you used the term.  It seems based on your post that you were thinking that something like the average might be present in the wave or heard by the listener.  So lets discuss the wave first.  It is true that the superposition of multiple sine curves can be massaged into a single function that has an effective average frequency and something called a beat frequency that is experienced as amplitude modulation.  This can be demonstrated with trig identities.  Consider the wave given by
w = Asin(w1t) + Asin(w2t) = 2Acos((w2 - w1)*t/2) * sin((w2 + w1)*t/2)
The severity of the envelope beats depends on how close the two pitches are to each other.  If they are very close then the resulting wave looks like a single frequency wave with a long amplitude modulation.  We use this to tune instruments but comparing a note with a standard and listening for when the beats go away.
Just looking at the equation you might get the impression that there are 4 frequencies present, f1, f2, |f1-f2|/2, and (f1+f2)/2.  w = 2pif in the equations.  But this is not the case.  There are only 2 frequencies present and they are f1, and f2.  If one were to capture the wave form described by the right hand side of the equation and analyze it with a spectrum analyzer you would find f1, and f2 and NOT the other two.
This is why I ask, as part of my answer to you, what does it mean to combine frequencies.  The idea that a complex wave form can be described by an infinite series of sines is due to a mathematical theorem by Fourier and is the foundation of a lot of engineering and scientific analysis.  The fact that this can also be used to describe acoustic phenomenon is due to the approximate fact that acoustics and mechanical vibrations in musical instrument is to very good degree linear.  The phenomenon are described by linear equations and this allows the solutions to be described completely by a Fourier series with appropriate boundary conditions applied.  So the individual sines do mix up in the sense that they add together to make a complicated looking function.  But the only frequencies present are the ones in the sequence!  They do not really "MIX" in any way.  When we say a frequency is present in a spectrum this is because we've done a Fourier transform on it and found the individual parts of the sum on the left hand side of the equation.  You will NEVER find the sum and difference tones in a spectrum.  Unless, ... the analysis or the system used to capture the sound is itself non-linear.  This is rare but an example if such a system is your ear.  This non-linearity is what creates aural harmonics and prevents people from every experiencing a sine tone.  Once the information is passed to our brain we are doing some sort of spectral analysis on it (I am not sure how as this is far from my training).  The specific nonlinearity of the ear does not (as far as I know) inject sum and difference tones into the signal, just harmonics.  So there is no "mixing" or blending of frequencies.
There is however a limit to human pitch discrimination and at some point we cannot tell the difference between two pitches.  I do not know if this is due to a non-linearity or a simple resolution threshold.  But when two pitches are very close to each other you will tend to hear the average and the beats as I mentioned before regarding the tuning of an instrument.  But this is a property of us as signal detectors and spectrum analyzers, and NOT necessarily an intrinsic property of the wave propagating in space.  That acoustic wave however complicated it looks only has the components of the harmonic sequence in it, and not the average tones.
I also wanted to state that the notes in a chord are typically far enough apart so that they are not below human pitch discrimination threshold and are not perceived as an average.  However that also depends on voicing!  In fact common practices in chord voicing probably evolved to avoid the issue of pitch discrimination.


Weak-* Convergence of functionals defined by probability measures $\{\delta_n\}$

Question: Consider the sequence of Dirac delta probability measures $\{\delta_n\}_{n=1}^\infty$ on $\mathbb R$, i.e. the measures which assign probability 1 to the point $n\in\mathbb R$.
These give the associated linear functionals $\Lambda_n$ defined by $\Lambda_n(f) = \int f\,d\delta_n = f(n)$ for all bounded continuous functions on $\mathbb R$, i.e. all $f\in C_b(\mathbb R)$. All these $\Lambda_n$ therefore have norm $\leq 1$.
So while this sequence is not tight and does not have a subsequence converging to a probability measure, it is contained in the compact unit ball of the weak-* topology by the Banach-Alaoglu theorem. So it has a subsequence which converges in weak-* to some linear functional $\Lambda$.
I am having a hard time seeing how this can be so. What can this limit be? How can we have that $\lim_{k\to\infty} f(n_k) = \Lambda(f)$ even exists for every bounded function?
Comment: While the closed unit ball is (topologically) compact in the weak-$*$ topology, this topology is not metrizable, and hence it does not necessarily follow that it is *sequentially* compact as well.
Comment: As a side note, the weak* topology on a dual space $X^*$ *is* metrizable on bounded sets if $X$ is a separable Banach space (even though not in the whole space, unless the dimension is finite), but this is not the case since $C_b(\mathbb R)$ is not separable. If you considered instead $C_0(\mathbb R)$, being this separable you would obtain a metrizable dual. In fact in this case the limit exists and it is the zero functional.
Comment: Oh wow, thank you! I now see more clearly why we had to use nets to prove the Banach-Alaoglu theorem.
Answer: I will summarize the given comments to answer this question.
The unit ball in every dual space is weak-* compact. However, only for separable spaces, the unit ball in the dual space is sequentially weak-* compact.
The space $C_b(\mathbb R)$ is not separable.
Thus, your sequence $\{\Lambda_n\}$ may not have a weak-* convergent subsequence (and indeed, it does not have any), but it does have a weak-* convergent subnet.
If I am not mistaken (please correct me if I am wrong!), the existence of this weak-* subnet requires the axiom of choice, hence you cannot write down an explicit subnet which converges weak-*.


Capturing correlation failure between two time series

Question: I have two time series as shown in the figure. The step curve in black is the trigger that causes the blue curve. As you can see first two peaks in both the series occur in the same time interval, however, the third peak on the blue curve does'nt seem to be caused by the step series in black. I need to capture such anomalous instances.

I have tried doing co-variance analysis between the series; piece-wise, i.e. as the data is time aligned, I divide the series in several time intervals, and then check co-variance between the series at each time interval. Any low co-variance value indicates that the series are not much correlated in that particular interval.
I am not a statistician so I am not sure if this approach is right or if there are better and more efficient methods to achieve what I am after. The datasets I'm working with are huge (up to a couple of millions samples).
Right now I am also trying wavelet coherence analysis on this as suggested in the post here -  statistical analysis between two time series
Though I am not sure how I am supposed to interpret the results of the analysis to catch those anomalous time intervals.
Any help or guidance is much appreciated. Thanks in advance.
Comment: No I dont have any such model. These series are experimental data. For example, the step curve is the input pressure which is increased or decreased suddenly (manually), and the blue curve is the temperature (captured by a sensor) which increases or decreases based on the change in pressure. So basically I would like to know if the temperature is rising because of change in pressure or there is some other reason e.g. sensor fault, environmental, other inputs, etc. And yes, the input is always a rectangular pulse.
Comment: [Using correlation for time-series can be tricky.](https://www.kdnuggets.com/2018/06/correlation-coefficient-time-series-angel.html)
Comment: Is it always the case that your trigger signal is a series of positive  rectangular pulses? Do you have any model that predicts the blue given the black, such as a convolution kernel?
Answer: What about to try (via m-regression!):
y(t+1)~b0+b1*y(t)+b2*x(t) or
dy~b0+b1*y(t)+b2*x(t) or
d2y~ ...
next just to explore resids,
or exclude t=6 & t=6.5 as out & try again...
Why "the step var" lost the odds counts???
imho you will get the results likes these:
y1  y1  y1  y1  -95.00% +95.00% y1
Param.  Std.Err  t      p    Cnf.Lmt    Cnf.Lmt Beta

Int.5.20    1.99    2.61    0.02    1.01    9.38
x   11.41   3.48    3.27    0.00    4.09    18.73   0.60
y   0.14    0.18    0.75    0.46    -0.25   0.53    0.14
out 4.65    4.23    1.10    0.29    -4.23   13.52   0.21
dy  dy  dy  dy  -95.00% +95.00% dy
Param.  Std.Err  t       p     Cnf.Lmt  Cnf.Lmt Beta (?)

Int 3.64    1.68    2.17    0.04    0.10    7.17
x   11.46   2.81    4.08    0.00    5.53    17.40   0.57
y   -0.67   0.16    -4.15   0.00    -1.00   -0.33   -0.58
Comment: Hi thanks for your reply. I'm sorry but I couldnt understand your solution. Is y(t+1) a lag ahead of y(t)? And how do you interpret solution from y and dy coefficients?


Can't get Varnish working properly, not caching anything. (varnishd is running , status is tick)

Question: System info:

Ubuntu / LAMP
Drupal 7.14
Varnish 3.0.2
Varnish module: 7.x-1.0-beta1
http port 80

I have installed Varnish in server.
I started it as:
<code>$ sudo varnishd -f default.vcl -s malloc,1G -T 127.0.0.1:2000
</code>
varnishd started and running.
default.vcl details (from this page: https://www.varnish-cache.org/trac/wiki/VarnishAndDrupal)
<code>backend default {
    .host = "127.0.0.1";
    .port = "80";
}

sub vcl_recv {
  // Remove has_js and Google Analytics __* cookies.
  set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__[a-z]+$
  // Remove a ";" prefix, if present.
  set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");
  // Remove empty cookies.
  if (req.http.Cookie ~ "^\s*$") {
    unset req.http.Cookie;
  }

  // Cache all requests by default, overriding the
  // standard Varnish behavior.
  // if (req.request == "GET" || req.request == "HEAD") {
  //   return (lookup);
  // }
}

sub vcl_hash {
  if (req.http.Cookie) {
    hash_data(req.http.Cookie);
    return (hash);
  }
}
</code>
Vanish module enabled.
Following conf added to settings.php
<code>$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['page_cache_invoke_hooks'] = FALSE;
</code>
Varnish module configuration page screenshot:

Performance page screenshot:

Then I browse my site. (as anonymous), repeatedly refresh various pages. Checked stats of varnish
<code>$ varnishtop
</code>

apparently it is not receiving any request, not caching anything.
Also check the site on http://www.isvarnishworking.com/  , shows Vanish is not working on the site.

What is wrong?
Thanks for any help.
Answer: By default, Varnish is not working on port 80 (and in this case it could not be either since your Apache is occupying that port). You should configure your Apache to listen to another port, then use that port for your backend setup in Varnish. You should also configure Varnish to listen to port 80.
To debug, you should try to figure out what port your Varnish is listening to now and browse using that port, then you should see traffic in varnishtop.
The reason I'm being vague on the varnish configuration is that I have only used Varnish on CentOS which reads in the startup defaults from /etc/sysconfig/varnish - since you are using Ubuntu you should try to find out where that default configuration is being kept on your system. A fair starting point might be the /etc/init.d/varnishd script which might give some clues.


Prove combinatoric inequality: ${n \choose {j+k}}\le {n \choose j}{{n-j}\choose k}$

Question: How can one prove the following combinatoric inequality?
$${n \choose {j+k}}\le {n \choose j}{{n-j}\choose k}$$
My line of thought was:
$n$ people applied for an interview for a company. (And the company must accept everyone for some job or another)
On the right hand side, we first filtered the not so good people for simple jobs, and then sent the better ones for better jobs.
But on the left side, we just randomly chose a job for each applicant.
Now how do I conclude from here, or is the analogy incorrect?
Absolutely different solutions are welcome as well.
Comment: Try rewriting the inequality and simplify it as much as possible...
Answer: Hint: try showing $$\binom{n}{j}\binom{n-j}{k}=\binom{n}{j+k}\binom{j+k}{j}.$$
Answer: A combinatorial argument something like the one that you tried is possible.
You have $n$ applicants for two jobs, and you want to choose $j$ of them for one job and $k$ of them for the other. No one is to get two jobs. There are $\binom{n}j$ ways to pick the $j$ applicants for the first job, and once that's been done there are $\binom{n-j}k$ ways to pick the $k$ applicants for the second job, so there are $\binom{n}j\binom{n-j}k$ ways to fill the two jobs. Alternatively, we could pick $j+k$ of the applicants to fill the two jobs, and then decide which of them get the first job and which get the second. There are $\binom{n}{j+k}$ ways to pick $j+k$ of them. No matter what $j$ and $k$ are, there's at least one way to split the single group of $j+k$ people into a group of $j$ for the first job and a group of $k$ for the second job, so
$$\binom{n}{j+k}\le\binom{n}j\binom{n-j}k\;.$$
(The factor of $\binom{j+k}j$ in Rebecca's solution is of course the number of ways to split the chosen $j+k$ people into the desired two groups.)


Display all attributes of a point using tmap function

Question: enter image description hereI am trying to make a shiny application that shows the location of public fruit trees around Bellingham, WA. When a user clicks on a tree location I want them to be able to see all attributes of a given tree such as status (confirmed/unconfirmed) and lat/long coordinates. When I create an interactive map, however, I can only see the attribute I used to color code the points by, in this case species. Species is made obvious by the tmap legend and I would like to be able to see status (confirmed/unconfirmed) and lat/long coordinates when I click on a point.
This is the code I used for creating a simple interactive map application using r shiny. I loaded the necessary packages.
library(dplyr)
library(shiny)
library(leaflet)
library(tmap)
library(sf)

I created the data frame.
dat <- data.frame(lat = c(48.7323,48.7308,
                          48.7301,48.7276,
                          48.7246,48.7323,
                          48.7211),
long = c(-122.4928,-122.4940,
         -122.4942,-122.4939,
         -122.4958,-122.4975,
         -122.4946),
 species = c("Apple", "Apple",
             "Pear", "Plum",
             "Fig", "Plum",
             "Pear"),
 status = c("Confirmed", "Unconfirmed", "Confirmed", "Confirmed", "Confimed", "Unconfirmed", "Confirmed"))

# created ui and server components

ui <- fluidPage( mainPanel(
  tmapOutput(outputId = "tmapMap"),
)
)

server <- function(input, output, session) {
  output$tmapMap <- renderTmap({

# converted to spatial points df

dat2plot <- st_as_sf(dat2plot, coords = c("long","lat"), crs=st_crs("EPSG:4326"))

   # and plotted map

map1 <- tm_shape(dat2plot) +
 tm_dots(col= "species", alpha=0.8,size = 0.1) +

tm_legend(show = TRUE) +
 tm_view(set.zoom.limits = c(14,16))
    map1

})

}

shinyApp(ui = ui, server = server)

The image attached is what is returned.
Answer: This seems to be a bug as it only works if you define a single color via col. If you adjust the corresponding lines as follows you will see at least all attributes, however the color coding does not appear:
# converted to spatial points df
dat2plot <- st_as_sf(dat, coords = c("long","lat"), crs = st_crs("EPSG:4326"), remove = FALSE) %>%
   relocate(species, .before = lat)

# and plotted map
map1 <- tm_shape(dat2plot) +
 tm_dots(col= "blue", alpha = 0.8, size = 0.1) +
 tm_legend(show = TRUE) +
 tm_view(set.zoom.limits = c(14,16))

map1

Comment: Ok thank you. Is there any way to maintain the color coding and display this information? Or should I write the developers?


How to correctly invert non-compound greater-than-octave intervals?

Question: (A.S.: Assuming that "non-compound" means "contains eight or less degrees.")
TL;DR: How to invert doubly augmented seventh?

I've ran into inversion problem with greater-than-octave intervals (not only compound ones).
Simple inversion is to invert something like major sixth (i.e. C4 to A4), – obviously, we will get minor third (A4 to C5).
A bit more complicated inversion is to invert compound intervals: you should first bring it to non-compound view; so, major third over octave E♮4 to G♯5 becomes minor sixth – G♯5 to E♮6 (or G♯4 to E♮5, or G♯3 to E♮4).
Other weird thing is to invert augmented octave: it considered as compound interval and becomes diminished octave (not diminished unison, as one might think, since diminished unison is incorrect interval).

So, if there is a doubly augmented seventh (C♭4 to B♯4), what interval will we got if invert it? Doubly diminished second (B♯4 to C♭5)? Is this correct? Is it OK that lower pitch is higher than upper one?
Comment: How has the interval come up for you?  Typically choices of notes are based on a function they serve, so I would expect that a double augmented 7 (x7) would have a function different than the b9, which it is enharmonically equivalent to.
Comment: @Basstickler: Try not to think tonally, like in serial technique, — there could be anything, up to the four times diminished unisons.
Comment: Sounds interesting.  I'm curious what the benefit of writing things out this way would be.  Function aside, would it actually sound different and therefore have an advantage as being referred to as such?  Serialism is essentially trying to break free from tonality, so ultimately requires another means of explanation/description, so it sounds like you're in a similar realm with this. Would you perhaps be able to provide something to listen to or read on the subject (for me, not necessarily SE)?
Comment: @Basstickler: I'm not sure I got your point (especially, what exactly could sound different? after which action?). Anyway, the serial technique was mentioned here to appoint that tonal relationship of notes may not be taken into account (because of the specific of serialism) and can be safely omitted when inverting intervals. Schönberg's music can serve the example of serialism (but beware of its extreme expressionism).
Comment: @DmitryParzhitsky this interval wouldn't come up in serialism or at least the 12 tone flavor as you would stick with the naturally named notes and either all sharps or flats for the notes that are not naturally named. And even then you are more look at just the distance in semitones.
Comment: @DmitryParzhitsky - I suppose I'm not sure how it would sound any different either.  I'm just looking to understand the purpose of this exercise, specifically why you would name these intervals as such, instead of using one of the more standard approaches.
Answer: You are dealing with extremes of intervals so the result may not be straightforward and I can almost guarantee you will never see anything like that in practice. In general doubly diminished and augmented intervals are only seen in 4ths and 5ths due to them being perfect and are extremely rare in practical music as seen in and explained this question.
In general for inverting intervals you want the sum of the degrees to equal 9 and the qualities to balance out. For example, a P5 inverts to a P4, a M3 inverts to a m6, and an A4 inverts to a d5.
In your example of C♭ to B♯, you have the interval of a doubly augmented 7th written as AA7. The inverse interval B♯ to C♭ is a doubly diminished  2nd written as dd2 in accordance to what was talked about in the last paragraph.
The fact the pitches sound over an octave or reversed is irrelevant when it comes to naming as an interval is defined as how the pitch is written which is why the interval  C to F♯ is not the same interval as C to G♭ even though in equal temperament they will sound exactly the same. If the interval looks like a second it needs to be denoted as such.
I've included a quick mock up of what both intervals look like in standard notion and anyone looking at them would realize pretty fast that the first is some kind of 7th and the second is some kind of 2nd. They may need to think about what the qualities are since this is very atypical, but the distinction is extremely important which this question goes more into.
Answer: This can be answered fairly simply.
The inversion of a doubly augmented seventh is a doubly diminished second.  A doubly diminished second is -1 semitone, so it's more than "OK" that the (nominally) "lower" pitch is higher; it follows naturally from the definition.  If you descend by -1 semitones, you go up in pitch.
Answer: You mention inverting an augmented 8ve. You can't invert an aug 8ve. If you try, the higher note still ends up being the higher note.  That would make it an augmented unison.  Essentially, it becomes reduced and not inverted.


derivation of heat equation

Question: In deriving the heat equation in the book it says
Fourier's law says that heat flows from hot to cold proportionately to the temperature gradient. Therefore change of heat energy in $D$ is also equals the flux across the boundary,
Here u(x,y,z,t) is the temperature.
$\frac{dH}{dt}$=$\iint_{bdyD}   k(n.{\nabla u})dS$.
($bdyD$  is the boundary curve)
What I don't understand is why  two integral signs are used?Because when writing flux shouldn't there be only one integral sign .
Because  flux=$\int F$.$\hat n    dS$
$ds$ is the area right?So is $dS$ equivalent to $dxdydz$
Answer: In physics, it is common notation to use multiple integral signs to signify the number of dimensions even before the $dS$ (or $dV$ or something like that) is expanded in terms of the parametrization.
In this case, it's telling you that the integral is 2D: it integrates over a surface (closed surface in this case). $dS$ is not $dx\,dy\,dz$. It integrates across two dimensions - the parametrization depends on your surface. For a cube, you could have a sum of integrals over $dS=dxdy$, $dS=dydz$, $dS=dxdz$, for a sphere, you could integrate $dS=r^2\,d\phi\,d(\cos\theta)$ and so on.
So you commonly write the divergence theorem (Gauss' theorem) like this:
$$\iiint \nabla\cdot \vec{F}{\,\rm d}V=\iint \vec{F}\cdot\,{\rm d}\vec{S}$$
Sometimes with a circle over the double integral to signify that the surface is closed.
Another notation is to show the dimensionality by writing volume integration as ${\rm d}^3 r$ and surface integration as ${\rm d}^2 S$.

derivation of heat equation


Unintended chorus like effect when recording Fender P bass through Behringer Xenyx Q502USB

Question: I'm relatively new to the home studio game. I have started recording demos using my Behringer Xenyx Q502USB as an audio interface.
It mostly works fine - but when I record bass through it the sound is, well, terrible. My bass is a Fender P-Bass, I am running it through a Behringer Ultra DI DI-20 (attenuation set to 0db), and into the audio interface.
The thing that is particularly frustrating is that it makes a chorus like effect when playing the low notes. This makes it really difficult to record good bass parts. It also makes this sound when I adjust the attenuation on the DI box, and then when I go directly into the audio interface.
Has anyone here got any advice / had a similar issue before? How do I fix it!
Thanks!
Comment: Just to make sure we understand the signal chain, you have a 1/4" cable from the bass to the DI and then an XLR cable from the DI to the interface? Do you also have a bass amp around? I'm wondering if you don't hear the sound when you play through an amp. Also, do you have a recording of the sound you could put on SoundCloud or something and add a link to it?
Answer: Are you hearing the chorusing while you are recording or when you playback?
If it is only during recording, then you have a monitoring problem - most likely cause by hearing the live signal together with the recorded signal (which will be later).


Establishing whether or not a set is ordered

Question:

I'm having trouble with determining whether the first criterion is met or not, specifically in the case of $x<y$. Could someone please help me out here?
Comment: Please, write down the assignment and the two definitions, instead of using pictures.
Comment: I'm confused, is there like an example/homework problem/exercise you're working on or something? If so, the example set you're working with is important to include (it'll make life easier for us if nothing else).
Comment: @EeveeTrainer This is from MIT OCW Analysis 1 Problem set 1. Link: https://ocw.mit.edu/courses/mathematics/18-100b-analysis-i-fall-2010/assignments/MIT18_100BF10_pset1.pdf
Answer: No, consider the relation $x\preceq y\stackrel{\text{def}}\iff x=y$ on a set with at least two elements.
Answer: Let $X$ be the set of all subsets of $\Bbb N$ and define $x \preceq y$ iff $x \subseteq y$, a classical example of a partially ordered set. If we define $\prec$ by the recipe indicated it will not be an order (as defined in 1.5) because e.g. $\{1\}$ and $\{2\}$ have no relationship, they're different and neither is a subset of the other. Many such pairs exist, of course.


AD Sites, Costs and DFS

Question: I've got a bunch of physical sites:
East-1, East-2, Central, West-1 and West-2, they all have domain controllers and have servers that provide DFS services.
Other sites Near-East-1, Near-East2, Near-West-1, Near-West2 have domain controllers but no servers that provide DFS services.
Central is our main data center.
Each site is defined in AD Sites & Services, and a Site Link from each site to Central exists and has a cost of 100 so it winds up being a kind of hub & spoke configuration with Central being the hub.
Users in the sites that have DFS servers are connecting to those on-site servers, that's not an issue. But users in nearby sites are connecting to the DFS server in Central instead of the one nearby. A user in Near-East-1 should connect to East-1 but are instead connecting to Central. I could create a Site Link from Near-East-1 to East-1 with a lower cost than the Near-East-1 to Central link and that should fix that problem but lets say there is a different DFS folder in East-2 that needs to be accessed. I'd need to create another Site Link from Near-East-1 to East-2 with... what cost? The same as the one to East-1?
And what if I add more sites in one of the areas? Would I need to create Site Links from each of those new sites to the sites that have the DFS servers? This can get real messy real fast.
What would be the best way to configure this to ensure that users connect to the actual closest DFS server?
Answer: You may want to configure DFS to enable Site Costing.
https://learn.microsoft.com/en-us/windows-server/storage/dfs-namespaces/set-the-ordering-method-for-targets-in-referrals
You can also configure AD to use the next closest site for AD authentication. By default a client will try any domain controller if not in the local site.
In Group Policy, "Try next closest site". Computer > System > Net Logon > DC Locator DNS.
Comment: I already have Site Costing enabled, its set to Lowest cost ordering.

Does the "Try next closest site" setting also affect DFS?
Comment: Hard to say. Some of this can be normal. You may want to enable netlogon debug logging and review what is present in the current state
Answer: consider creating separate site links for each DFS server location. Assign appropriate costs to prioritize local connections. This way, users in Near-East-1 would connect to East-1, and you can set specific costs for each link based on the network conditions.
Comment: I assume the cost for a link from Near-East-1 to East-1 should be lower than the cost from either of those sites to Central, is that correct?

AD Sites, Costs and DFS


Is it possible to reset FTDI virtual com ports enumeration, we easily get hundreds of COM ports in production environment

Question: When producing devices that use a FTDI USB to serial chip to communicate with a Windows host, we get hundreds of COM-ports, since Windows seems to just increase the port number each time a new FTDI vid+pid+serial is connected to the PC.
I have looked into HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\FTDIBUS and tried deleting the new entries that appear, but the only effect is that the COM port number is increased even for devices with the same vid+pid+serial (i.e. devices that have already been connected once).
The question: is it possible to reset this counter some way so that the enumeration starts from the first free COM port number?
Edit: Is this question better suited for superuser.com?
Edit2: It has been answered on superuser
Answer: Note: Copied from SuperUser
I'm not at work so I don't have any hardware in front of me, but the FTDI application note AN_107 - Advanced Driver Options looks to have some promising options.
In particular, I think the "Ignore Hardware Serial Number" (section 7.1, page 20) option would do what you want.

7.1  Ignore Hardware Serial Number
If devices have the same vendor ID and product ID but different serial numbers, the system will normally treat them as different devices. This causes the drivers to be installed for each device and create registry entries for each device.
It is possible to override this behaviour to make the system ignore a device's serial number and treat all devices with matching VID and PID connected to the same USB port as if they were the same device. This is achieved by adding a REG_BINARY value called IgnoreHWSerNum to the registry and setting it to 01.

The AN_123 How COM Ports Are Allocated On Driver Installation app note is also very informative.
OT, devices these days are getting so complex that most of the documentation is being moved out of the datasheet and into App Notes. Don't forget to always read the app notes!
Answer: Here are instructions to prevent a Windows computer from assigning a new COM port number each time a new device with a FT232RL IC is plugged into a USB port: http://liionbms.com/pdf/DisableFTDI_Enumeration.pdf
Feel free to use
Answer: Microsoft has a command line utility called DevCon which may do what you need.
Examples:
List present and non-present USB devices:
devcon findall =usb

List present and non-present ports:
devcon findall =ports

Remove all USB devices:
devcon remove @usb\*

Remove all ports:
devcon remove @ports\*

Proceed with caution. You might need to do a devcon rescan or even a devcon reboot afterwards.
Comment: Thanks for the tip about devcon. It did not reset the port counter, though. After I remove the device using devcon and then re-insert the cable, the com port number just continues counting up.


Import/export configuration and translations

Question: I downloaded the .po file for loading the Italian language and installed it on my local version of Drupal.
Then, I launched the config:export command with drush and I committed the created configuration files
When I imported the configuration on the target machine (via jenkins) I did not find all the translations loaded
In particular, compared to about 7,000 exported translations, I find only 600 imported ones
Why did this happen?
Answer: The translations are not part of the configuration.
You can configure and export the source of translation files. One option is to have the local filesystem as the source. The translation files are stored locally in the sites/default/files/translations directory, but can change this directory on the File system configuration page.
What you could also configure and export how frequently you want to check for new interface translations for your currently installed modules and themes. At
/admin/config/regional/translate/settings
Check for updates

Never (manually, this is the default)
Weekly
Monthly

You can manually download the translations at:
/admin/reports/translations/check?destination=/admin/reports/translations


HTTP Error 503 - Service is unavailable (how fix?)

Question: i have a web site for download mobile files and there many users in my web site.
sometimes i have the error below :
HTTP Error 503 - Service is unavailable
1-so why this error happens and what is that mean?
2-as i know appache free up itself when it's oveloaded, but what about iis?
how can i put some limitations in my server (i have remote access to my server) for prevent this error happening?
a.is limitation of dowload's speed efficient for prevent that error's occur?
how can i do that?
is squid useful for this job or i can do that with another iis extension.
b.is limitation of download's Bandwidth efficient for prevent that error's occur?
how can i do that (with iis or another extension)?
in right side of iis -> configure area -> i found some limits.
what do those limits mean and can i use them for keep my server alive all the time?
EDIT:
after viewing event viewer of windows -> custom views -> server rols -> web server (iis)
i figure out there is no error in that area.
but many warnings and information.
the latest warnings and information are like below :
warning

A worker process '2408' serving application pool 'ASP.NET 4.0
  (Integrated)' failed to stop a listener channel for protocol 'http' in
  the allotted time.  The data field contains the error number.

warning

A process serving application pool 'ASP.NET 4.0 (Integrated)' exceeded
  time limits during shut down. The process id was '6764'.

warning

A worker process '3232' serving application pool 'ASP.NET 4.0
  (Integrated)' failed to stop a listener channel for protocol 'http' in
  the allotted time.  The data field contains the error number.

warning

A process serving application pool 'ASP.NET 4.0 (Integrated)' exceeded
  time limits during shut down. The process id was '3928'.

thanks in advance
best regards
Comment: What is in the log files? Or in the event log (which is the Windows equivalent to log files)?
Comment: hi mailq, which log files? event viewer of windows server (iis section) or another log file.would you please tell where should i search for log files?
Comment: hi, plz see my edit.
Comment: I had the same problem.
Turns out my drives had swapped letters somehow! Check that all your file paths are correctly configured, including virtual directories and application paths for SCB's etc.
Answer: My guess is that you are hitting the limit of available threads that IIS has available. IIS allocates a certain number of threads depending on the version of IIS and the configuration settings which by default depend on the number of processors/cores in your server. You can tune this specifically to your needs.
You probably run out of threads because you stream downloads to the clients. If you do this in a synchronous way your website will eventually run out of the threads as each thread will be occupied by a single download. If possible you should modify your download code to work asynchronously, e.g. by implementing it as a asynchronous HTTP handler.
EDIT:
The 503 error is occuring because IIS is running out of threads to service additional requests and thus can't handle the request. The errors in the event log are a consequence of this as IIS is trying to free up threads and resources by trying to quit/recycle the application pool as it's not responding to the internal 'alive' pings.
Limiting the download speed will actually increase the problem as you will run out of threads even sooner. You should only limit the download speed if you run out of total bandwidth, otherwise just let clients download as fast as they can.
The only real solution that will make your server scale is to change your code so that downloads are handled asynchronously. Or change your solution so that the download is  handled by the static file handler of IIS itself, for example by using rewrite rules or a custom rewrite provider. Difficult to say anymore without knowing a bit more details about your application.
Comment: really thanks for answer / would you please give us some info about my questions!
Answer: "HTTP Error 503 - Service is unavailable" error occurs if your application pool fails due to the error made to your application more than Maximum Failure limit allocated to your apps in iis.
Resolution for it

Open IIS Manager.
Figure out your application pool and click the advanced setting of your pool.
Once you click the advanced setting, it will open and window.
Here under "Rapid Fail Protection"  you can find the "Maximum Failure" increase it from default 5 to 50.

After modifying the Advanced Setting, recycle the apps.
Answer: There is no one particular way to fix this issue, Btw we can try some easy ways to fix 503 error by following method.

Open the URL again and again
Restart the Router
Try after some time again
Contact Website owner if must needed to visit.

Here some more info about Http Error 503 fix, If required you can visit.
Answer: Remote Desktop into your Server,
Check if your 'SQL Server Reporting Services (MSSQLSERVER)' Service is running.
If not.
Start it.


Show that the matrix $A = \begin{bmatrix} 2 & 0 \\ -1 & 2 \end{bmatrix}$ is not diagonalizable.

Question: I have this question:

Show that the matrix $$A = \begin{bmatrix} 2 & 0 \\ -1 & 2 \end{bmatrix}$$ is not diagonalizable.

So is the general strategy is

To Find the eigenvectors and then
Show that the matrix of eigenvectors is not invertible? If they are invertible, then it has a unique solution to ($\lambda \bf {I - A)x = 0}$ which would imply that they are linearly independent. If it's linearly independent, then it would be diagonalizable?

I'm following this theorem

Condition for Diagonalization
A $n \times n$ matrix is diagonalizable iff it has $n$ linearly independent eigenvectors.

So I have to find the eigenvalue first, which is $2$ because the $2$ is on the diagonal of this matrix in a triangular matrix, using this theorem.

Eigenvalues of Triangular Matrices
If $A$ is a $n \times n$ triangular matrix, then its eigenvalues are the entries on its main diagonal.

Solving for $\lambda {\bf I - A}$:
$$\begin{bmatrix} 2 & 0 \\ 0 & 2 \end{bmatrix} - \begin{bmatrix} 2 & 0 \\ -1 & 2 \end{bmatrix} = \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix} $$
Since this matrix is not invertible, it is not diagonalizable. Is this right?
This is the proof that I'm relying on:
Answer: What you wrote is not correct.
If $\lambda$ is an eigenvalue of $A$, then $A-\lambda I$ is never invertible, no matter if $A$ is diagonalizable or not.
For example, your "proof" can be used to prove that the matrix $I$ (the identity matrix) is also not diagonalizable, which is clearly absurd.

A matrix is diagonalizable if there exists an invertible matrix $P$ such that $A=P^{-1}DP$ and $D$ is a diagonal matrix. You have probably proven in classes (or a textbook you are learning from did) that this happens if and only if there exits $n$ linearly dependent eigenvectors for the matrix.
This is what you should start from. In your case, the matrix has only one eigenvalue, and that eigenvalue has only one eigenvector (up to, of course, scaling), and from that, we can conclude the matrix is not diagonalizable.
Comment: @KittyCapital The only thing you have proven is that $A-\lambda I$ is non-invertible, which is always true if $\lambda$ is an eigenvector. In fact, the kernel vectors of $A-\lambda I$ are exactly eigenvectors of $A$. However, in your case, you can only get **one** linearly independent eigenvector, not **two**, and therefore, the matrix is not diagonalizable.
Comment: @KittyCapital $P$ is the matrix whose columns are all eigenvectors of $A$!
Comment: I updated my post with the proof that I'm using. I don't really follow @5xum....the proof says that the matrix P could be invertible no?
Comment: @KittyCapital Which part of my answer do you not follow?
Comment: omg I accidentally set P = $A - \lambda * I$ even though all that produces is an eigenvector which is single as you said. My mistake!
Comment: Yeah my mistake. ugh.
Comment: anyway you can help out with this: https://math.stackexchange.com/questions/2929754/diagonalization-and-linear-transformations/2929798#2929798
Answer: Diagonalizable $\iff$ every eigenvalue has same algebraic multiplicity and geometric multiplicity. $A$ has an eigenvalue $\lambda=2$ with algebraic multiplicity 2, however, since $A-\lambda I$ has rank 1, thus its geometric multiplicity $=\dim \{N(A- \lambda I)\} = 2 - 1=1 \neq 2$ by rank-nullity theorem. Thus not diagonalizable.


Transcribing music which has no obvious metre

Question: I am about halfway through transcribing Ryo Fukui's "Early Summer", but I am having trouble figuring out how to notate the rhythm for the introduction (0:00 - 0:44) since I can't identify any beat to the music.

It seems clear that the measures all start on the strong bass notes, but that's about all I can tell.
I'm able to put together a 'literal' transcription -- i.e., one that when played sounds identical to the performance -- but it would be almost impossible to actually read, because the notation is very unmusical and pretty ugly. For example, this is the first bar of the piece:

(I apologise for any bad notation; I have no background in music theory and I haven't tried to clean it up yet. I want to get it all down roughly in MuseScore before I switch to Lilypond for the final version.)
How should I go about transcribing a piece like this, which seems to lack any sort of constant rhythm? Should I just get down the rough shape of the piece and leave the exact timings to interpretation, and how would I notate this?
Comment: Who is performing the piece? If it's you, why not just go with a rough version, since you can add the rhythmic nuances yourself in performance? (This is what happens with jazz transcriptions.)
Answer: If I were transcribing this, I would approach it just like you have--by tackling one bar at a time. Then I would follow this method.

Within each bar, I would use with the right hand melody/solo line to establish the nearest meter/beat. For example, I hear measures 1-2 as being in 6/4 time.
Then I would approximate simple rhythms for the melody/solo line, removing any interpretive stretching or squeezing of the rhythm.
Finally, I would transcribe the left hand and pair the left hand rhythms with the right hand rhythms.

There are ways to notate the "stretching" and "squeezing" of the tempo. For example, in measure 2, the left and right hands are off from each other rhythmically, and I think this is because the right hand is pulling back a bit, lagging behind the left hand. Nonetheless, I would still write those notes as simultaneous and would add the text "pull back" above the right hand part.
For example, this isn't perfect (and I haven't listened closely with any transcription software), but my first pass would be to notate it like this:

The third measure "squeezes" the time a little bit--it cuts out a beat and moves on to the fourth measure more quickly. For a case like that, I would simply notate measure 3 as being in 5/4 time. Alternatively, in those scenarios, you could notate it as 6/4 and put some text indicating to move quickly to measure 4.
The really fast notes in measures 4-5 might be a little quicker than sixteenth notes, but I would notate them as 16th notes since that's the nearest beat:

and perhaps I would add some simple text (maybe "play faster") indicating to speed up, though this probably isn't necessary. Too much of that type of text, though, can make the piece hard to read, so I would save it for the most extreme cases.
EDIT: There's another reason I mention the sixteenth notes--sometimes I have to find whatever touchstones I can to establish the beat/rhythms. I knew those notes in the right hand were faster than eighth notes, but it could've been hard to discern whether they are eighth note triplets or sixteenth notes. So I turned to the bass in the left hand and listened more closely to the second note (the D). This D sounded like it occurred on a downbeat, and this was crucial information: this base note D (this downbeat) occurred immediately after the fast run in the right hand. The only way for the fast run to conclude immediately before a downbeat (the D bass note) is if those fast notes in the right hand are sixteenth notes, not eighth note triplets. So that measure is an example where the bass note can serve as a touchstone for the beat. (It helps a lot that the bass/left hand is repeating a similar pattern throughout all of these measures.)
This is a really fascinating solo piano part to transcribe, and it provides a way to study several interesting notating/transcription techniques. Great choice!
Answer: The tempo isn't constant but there is a clear enough "beat". Start with the left hand, which repeats a pattern of two "bars" - the second one is a tone higher than the first.
When you have decided how to notate the left hand so it is readable, add the right hand notes around it. It will probably be a good idea to use grace notes for some of the faster runs, rather than trying to notate the exact rhythm.
Don't be too literal about trying to get computer playback "exactly right". That will always lead to a mess like your example.
Find some examples of the sheet music of songs that are performed in a free rhythm, and study them.
Answer: You should do exactly what you're doing: try to get the rhythms down as exaxctly as reasonably achievable and refer people to the original for the definitive version. This is what Keith Jarrett did when people kept asking for a transcript of his Köln Concerto, and in fact he'd been refusing to transcribe it at all for a long time, because he thought the result couldn't be faithful enough - so you're in good company!


Free Dataset Resources?

Question:
Possible Duplicate:
Locating freely available data samples

Where can I find freely accessible data sources?
I'm thinking of sites like

http://www2.census.gov/census_2000/datasets/?
Comment: Actually, I think the previous question is more a subset of this one. EAMann was asking for a datasets with some particular characteristics (although I'm not sure anybody is paying attention to those criteria); this question is wide-open.  For example, I feel comfortable voting up many of these answers, because they are, in fact, datasets, but not any of the answers on the previous question, because I haven't opened them up to see if they suit EAMann's requests.
Answer: Amazon has free Public Data sets for use with EC2.
http://aws.amazon.com/publicdatasets/
Here's a list: http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=243
Answer: I really like the FRED, from the St. Louis Fed (economics data). You can chart the series or more than one series, you can do some transformations to your data and chart it, and the NBER recessions are shaded.
Answer: For time series data, try the Time Series Data Library.
Answer: http://infochimps.org/ - is a good resource for free data sets.
Comment: Maybe I'm not looking in the right place, but for me in February 2019, this website has no data sets, much less free ones
Answer: For governmental data:
US: http://www.data.gov/
World: http://www.guardian.co.uk/world-government-data

Free Dataset Resources?