I have defined a function: 

myJ2[n_] := 1/n* Total[RandomVariate[NormalDistribution[0, 1], n]^2]


This is basically an approximation to the gaussian integral. I want to plot this and the error graph (difference between the approximation and the exact value) at the same time. Using a random variable makes this difficult. I tried this:

DiscretePlot[{myJ2[n], 1 - myJ2[n]}, {n, 1, 1000}, Filling -&gt; None, Joined -&gt; True]


However, this is not quite correct, since the myJ2 function is called twice and hence gives different values due to the randomness. I improved this by using:

DiscretePlot[{x, 1 - x} /. x -&gt; myJ2[n], {n, 1, 1000}, Filling -&gt; None, Joined -&gt; True, PlotStyle -&gt; {Red, Blue}]


This gives me the correct values but both in the same color. How can I get both the function and the error function displayed in two graphs or with two different colors?

Thanks

Charly


Question: How do you import members from another system to Wordpress and update passwords so they'll work?
Answer: You couldn't have a more perfect solution, since this is precisely what WordPress core itself has to handle.

See, in early years WP used just one pass MD5 for passwords. Then they went to better hashing, but obviously it should have kept working with old hashes.

Now if you take a look at wp_check_password(), what it is doing (at the moment user attempts to log in) is following:


Checks if hash looks "old"
If so verifies it in "old" mode
If so updates hash to "new" one (using password, which is available at this moment in runtime)
Otherwise verifies in "new" mode


You should simply follow precise same logic! Hook into check_password or override wp_check_password() altogether (it's so called pluggable function). Then implement same check &amp; upgrade logic for your hashes.