Assumption in amplifier theory is troubling me

Question: Suppose we have an amplifier which uses a non-linear device to amplify voltage or current. Now suppose we connect the output of amplifier A to the input of amplifier B. We replace the transistor with its equivalent circuit made of only linear elements (small-signal analysis) preassuming the biasing of the transistor of amplifier A is fixed by the DC source of the circuit. Why do we assume that the biasing of the transistor of amplifier B is fixed by the same DC source when amplifier A amplifies its input signal resulting in a much larger input signal for the next stage?
Comment: Your question needs clarification. Why is only amplifier A using a non-linear device? Why do you assume that amplifier B is biased in the same way as amplifier A? If I understand your question at all, you are correct in that the design of amplifier B has to take into account that its input will be a higher level than that of amplifier A.
Comment: I do not understand whether you are worried about DC biasing or about input signal? When we talk of DC biasing, it is computed in the absence of an input signal. A small diagram will help explain your question better
Answer: In a system of cascaded amplifiers A and B, let's say that the gain of A is 1000.
If your input signal (to A) has an amplitude of, say 1μV, you might consider that to be small, but the input to amplifier B would be 1000 times larger, 1mV in amplitude, which is definitely not small. Your concerns would be valid, since that would certainly be enough to upset the biasing of various non-linear devices in B.
The answer to your question is: if you manage to disturb the DC operating point (biasing), then the input was not small.
In the context of small signal analysis, we don't consider 1μV to be small, or even 1nV, since any element with sufficient gain can produce a significant deviation of potentials and currents from their quiescent value.
In this context "small" means so small, that no potential, and no current anywhere in the circuit is ever further than an infinitesimally small amount from it's DC operating point.
What happens when that is not the case? Well, if amplifier A is producing a signal significant enough that potentials or currents deviate by more than an infinitesimally small amount from their quiescent values, then your input signal is already too large to be called a "small signal".
That is why we use the term "infinitesimal". It means as close as it's possible to get to zero, without actually being zero. A value so small that even if you multiplied it by a number approaching infinity, it would still be infinitely close to zero.
Then, you would need elements in the circuit to have infinite gain, to be able to produce any deviation from the DC operating point, which is not feasible.
Small means really, really small, a perturbation so small that it's impossible for anything in the circuit to respond with anything that isn't itself considered small.
Technically, biasing sets conditions at a particular place on a curve off \$V\$ versus anything else, say \$I\$, and the relationship between \$V\$ and \$I\$ can be very non-linear, like this (a diode's IV curve):

However, any small section of that curve (inside the green markers, for instance)  \$V(I)\$ looks like a straight line, linear, if you constrain your position along it to a very small region:

This is the principle of calculus. As long as the function \$V(I)\$ is continuous, and \$dI\$ and \$dV\$ are infinitesimally small changes, the gradient doesn't change at all either side of point \$(I, V)\$, say \$(I+dI, V+dV)\$ or \$(I-dI, V-dV)\$, and you may consider that section of curve to be linear, with constant and equal gradient at all points along it.
By biasing your diode, or whatever element, at some point along its curve, the relationship between \$V\$ and \$I\$ there is perfectly linear, providing you don't deviate further than an infinitesimal distance either way along the curve.
Since our "small" signals are intended to deviate from this "operating point", to take advantage of this region of linearity, we have to ensure that those signals are small enough that no point anywhere in the circuit, even following an amplifier with gain one million, or trillion, is perturbed enough to exit its own region of linearity.
In the true sense of calculus, \$dI\$ and \$dV\$ are the amounts of deviation permitted. Those values are infinitesimally small, as close to zero as it's possible to get, without actually being zero. We are talking about a \$dV\$ that makes 1μV, 1nV and even 1pV look gargantuan.
A large answer, about small.
Answer: If the signals are no longer small signal, then small signal analysis won't be very accurate, and may not be useful at all. That applies to a one-stage amplifier as well as each stage of a multi-stage amplifier.
However if have a 100uV signal and amplify it by 20 to 2mV it's still a pretty small signal compared to bias levels in most cases.
Answer: What you do is you first analyze the amplifier performance assuming the small signal (i.e., linearized) model.  Then you take the resulting signal amplitudes at (and between) various points in the circuit and you check to see if the small-signal model is still valid.
Note that this requires some judgement: if you have a transistor stage where the entire input signal shows up across the base-emitter junction (i.e., there's effectively no feedback), then depending on what you consider to be objectionable, you may start seeing objectionable amounts of distortion at \$V_{be} \pm 2\mathrm{mV}\$, or even less.  But in a stage where there's heavy feedback, because the feedback will reduced distortion the variation around \$V_{be}\$ that's still acceptable could go up considerably, even to the tens of millivolts.
Answer: Excellent question, I feel like this is not emphasized enough in textbooks.
The short answer is: small-signal analysis becomes a good approximation of the amplifier characteristics when the loop gain of the negative-feedback amplifier in question is large.
Why? because a negative-feedback amplifier actually amplifies the error signal, not the input signal itself. The first stage output of the amplifier is actually the amplified version of the input error signal.
You might remember that one of the golden op-amp rules is V(+) = V(-). This is equal to saying V(+)-V(-)=0. In other words, that the amplifier's error signal is 0. This is equivalent to saying that the amplifier has an infinite open-loop gain, which would translate to an infinite loop gain.
This is obviously impossible with a practical op-amp, but it's still a damn good approximation for large open-loop gains.
Nonetheless, we know that the output signal is large, and probably a lot larger than the output of amplifier's first stage. How does the small-signal approximation hold for the subsequent stages then?
Well, the larger the swings in the subsequent stages, the worse the small-signal approximation becomes. So, you might argue that the small-signal approximation is best used for the 1st and 2nd stage, while for the 3rd stage will probably not hold to large output swings (most amplifiers don't have more than 3 stages).
You can also say something is an small signal judging by the bias voltage and variation around it. If you have some typical common-emitter amplifier with a collector held at a few volts, and your signal swing is few millivolts, you might consider approximating this with small-signal analysis. People still do so with higher swings, mostly to get a feel for what's expected, you can't expect accurate results doing so.


Removing blend effect from a copied object; Inkscape

Question: So I'm creating a logo with the multiply blend effect on one layer, and there's a part I made on that multiply/layer that I copied and pasted to one above it so I could make it opaque. But the multiply effect is still part of the object I copied despite it now being on a normal layer.
How do I remove that effect so that I can make the part opaque?
Answer: Select 'Filters' > 'Remove Filters...' - the blend mode is just a filter applied to a layer.
Objects in the layer inherit the filter from the group (=layer) they are in.
If you copy one of them out of the layer, it keeps the filter.
It's the same behaviour for groups (and layers are just groups in Inkscape).
So, it's maybe unexpected if one doesn't know how Inkscape layers and blend modes work, but very explicable.
Answer: You have found some obscure behaviour. Here's a green rectangle in the bottom layer and a blue rectangle in the mid layer which has layer blending mode = multiply.

When the blue rectangle is copied and pasted to the top layer, the copy has blending mode=multiply. It's bounding box seems quite big. The reason=Unknown.

If the blending mode of the copy is changed to Normal, the multiply layer also turns to normal and the original blue rectangle becomes invisible;

The original blue rectangle still exists. It's selectable in the Objects panel:

The scene is fixed when the layer blending mode normal is turned back to multiply:

I do not know, if this is a known bug.
Comment: "If the blending mode of the copy is changed to Normal, the multiply layer also turns to normal and the original blue rectangle becomes invisible;" - that's definitely a bug (although not related to the question that was asked). Would you make a report at https://bugs.launchpad.net/inkscape ?


Is there method to protect coffee from moisture

Question: Yes, tight lid is the best way, you might say, but that is not very easy/creative idea to do it. Have you got your best way to protect coffee from getting wet and damage?
Comment: ground coffee or coffee beans?
Comment: How does your coffee get wet before you use it? What is the source of the problem?
Answer: If its ground coffee, I always keep that in the freezer and use it straight out of the freezer too. I put the original bag inside a ziplok freezer bag and pop it in the bottom drawer of the freezer. Keeps fresher for a lot longer too...
Comment: The condensation created every time you open that frozen bag of coffee will cause more damage than the freezing actually helps. Most experts suggest wrapping the coffee up into smaller portions before freezing so you can remove just enough to use a few days at a time without exposing *all* the coffee every time you open that bag.
Comment: Experts I've read recommend *not* freezing coffee -- specifically because of condensation.  if you wrap pre-measured portions before freezing, and let the coffee come up to room temperature before opening, you should avoid most of that and get maximum benefit by freezing your beans or grounds.
Comment: I usually keep it in its container, no humidity issues... @RobertCartaino
Comment: @RobertCartaino - I guess it matters if you drink coffee frequently - I don't, it'll sit in the freezer for easily six months, maybe a year, without being used at all.... and when I do use it, I'll be using half the packet at a time (for 6-8 people)
Answer: Just store your coffee in an airtight container or plastic bag, along with a small pouch of silica gel on top of the contents.
Silica gel is non-toxic, non-flammable, non-reactive and stable with ordinary usage. It absorbs moisture from the surroundings effectively. It is commonly used to dry out empty water bottles and to remove moisture from shoes, which in return prevents the stench.
Comment: Good point. I was mistakenly associating your idea with a recommendation in another answer.
Comment: Silica gel will continue to absorb moisture below freezing, but effectiveness is somewhat diminished. The optimum performance is at room temperatures between 70-90º F (21-32º C), so you might need to use more of the product to be effective. Silica gel is also "Generally Recognized as Safe" by the FDA, but make sure the packaging used for the gel is *also* safe. The industry standard is  Tyvek or food-grade plastic containers.
Comment: Silica gel granules can be replenished by heating them in an oven or on a heating pan. Secondly, you don't need to freeze the coffee if you are using this technique but rather store it in a cupboard.
Answer: Due to supply problems importing, roasting, and blending forces me to order and buy a minimum amount of my favourite coffee at a time. It will last me more than a month.
I asked the supplier how best to store my investment.
The supplier suggested I keep/store the unground beans at room temperature in the original corrugated-plastic lined paper bags with a roll-down cuff and metal "closure" seal. Grind as much as you need and roll the cuff to keep air in the package to a minimum for the remainder. If you do refrigerate the beans, let them come to room temperature before grinding to enjoy the full flavour and bouquet from the brew.
I keep unopened bags of coffee in a small carton on the bottom shelf of a cupboard in the kitchen. I've been doing this for years.
I did notice that when I first get the batch of beans from the coffee roasters they're oily and very shiny. As time passes, the gloss slowly disappears and near the end of the batch the beans have a matte finish as the oil gets absorbed into the body of the bean.
Answer: Zipper closure plastic bags.  Squeeze out the air when closing, and store them in an opaque canister or similar to keep light out.  This will preserve coffee as well as any other method I've heard of.
Also, buy whole bean coffee and grind it when you're setting up the machine to brew -- whole bean keeps several times longer than ground coffee, and costs no more (you will need to buy a grinder, but they aren't expensive).
Answer: We keep our ground coffee in a stainless steel container with a tight lid in the fridge.

The low temperature and dry air in a fridge will not only prevent moisture from entering the ground coffee but it will also help to keep the aroma fresh for a much longer time.
Answer: Use one of those airtight jars/containers for sugar,flour,rice,or cracker snacks would work for protecting your coffee from moisture. Searching for those online yields a lot of different brands and styles of containers for you to choose from. An example of what those look like:
Answer: I use one of these to store my coffee. They are great.
http://www.containerstore.com/s/kitchen/food-storage/canisters/click-clack-pantry-canisters/123d?productId=10033113


Is it possible to drag and drop from/to outside a Flash applet with JavaScript?

Question: Let's say I want a web page that contains a Flash applet and I'd like to drag and drop some objects from or to the rest of the web page, is this at all possible?
Bonus if you know a website somewhere that does that!
Answer: This one intrigued me.  I know jessegavin posted some code while I went to figure this out, but this one is tested.  I have a super-simple working example that lets you drag to and from flash.  It's pretty messy as I threw it together during my lunch break.
Here's the demo
And the source
The base class is taken directly from the External Interface LiveDocs.  I added MyButton so the button could have some text.  The majority of the javascript comes from the same LiveDocs example.
I compiled this using mxmlc.
Answer: DISCLAIMER I haven't tested this code at all, but the idea should work. Also, this only handles the dragging to a flash movie.
Here's some Actionscript 3.0 code which makes use of the ExternalInterface class.
import flash.display.Sprite;
import flash.external.ExternalInterface;
import flash.net.URLLoader;
import flash.net.URLRequest;

if (ExternalInterface.available) {
  ExternalInterface.addCallback("handleDroppedImage", myDroppedImageHandler);
}

private function myDroppedImageHandler(url:String, x:Number, y:Number):void {

  var container:Sprite = new Sprite();
  container.x = x;
  container.y = y;
  addChild(container);

  var loader:Loader = new Loader();
  var request:URLRequest = new URLRequest(url);
  loader.load(request);

  container.addChild(loader);
}

Here's the HTML/jQuery code

  <title>XHTML 1.0 Transitional Template</title>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
      id="MyFlashMovie" width="500" height="375"
      codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
      <param name="movie" value="MyFlashMovie.swf" />
      <param name="quality" value="high" />
      <param name="bgcolor" value="#869ca7" />
      <param name="allowScriptAccess" value="sameDomain" />
      <embed src="MyFlashMovie.swf" quality="high" bgcolor="#869ca7"
        width="500" height="375" name="MyFlashMovie" align="middle"
        play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
        type="application/x-shockwave-flash"
        pluginspage="http://www.macromedia.com/go/getflashplayer">
      </embed>
    </object>

Answer: I would say it is possible to drop to Flash if you detect that the item is dragged on to the  that contains the flash stuff, and you set your dragged objects to have a z-index higher than the flash. Then when it is dropped you can talk to Flash using javascript to tell it where and what was dropped.
However the other way around is probably much harder, because you'd have to detect when the object hits the border of the flash movie and "pass" it to the javascript handler (create it in the html, hide it in flash).
The question is probably to know whether it's worth the trouble, or if you can maybe achieve everything in JS or in Flash ?
Comment: So I guess the answer is: it may be possible but there is no known API or other facility to do it in a standard way
Answer: Hang on, the encapsulation point is a valid one but flash can execute JS functions, and Seldaek is right that an HTML element with a higher z-index should float on the flash movie. So if you did all the drag handling in JS and had the flash read its own dimensions and the position of the pointer in the app it could signal JS methods that slave element(s) to the pointer even (especially) when the pointer leaves the boundaries of the flash app. It would be pretty hairy though.
Answer: If the whole site is one big embedded flash file then yes it's possible.
I don't think that you can acheive it any other way
Answer: Not possible in flash - unless you want to drag to a target inside the same flash application.
Could probably be done with a signed Java applet (but who wants to go down that road?)


Maximum Stress and Deflection of Rectangular Plates Under Hydrostatic Load - Tall Plates

Question: I am hoping someone here can help point me in the right direction.  I am trying to understand the fundamental behavior of rectangular plates under load and have run up against a wall.  Can anyone help with this?
The practical problem I am trying to understand better is design of tanks to hold liquids.  They are rectangular tanks, but they present a number of different problems.  The bottom of the tank has uniform load consistent with the depth and density of the liquid in the tank and the walls have hydrostatic load from the liquid, but depending on the design of the tank all walls may be "wider" than the are tall, all may be taller than they are wide, and in some cases you may have both.  Imagine, for instance, an aquarium where the front and back are typically wider than they are tall but the sides are often taller than they are wide.
I understand the top level formulas intended for use with tabulated values and I have access to all of the tables, but both the relatively low precision of the numbers in the tables (usually only two digits) and the relatively sparse entries were such that I wanted much better precision and higher sampling.  See, for instance, in referring to Roark's Formulas for Stress and Strain (I'm looking at the Seventh Edition), the tables I am referring to are 11.4.1a (for a plate simply supported on all sides under uniform load), 11.4.1e (for a plate simply supported on all sides under hydrostatic load with the load varying on the shorter side - "wide" tank walls), and 11.4.1d (for a plate simply supported on all sides under hydrostatic load with the load varying on the longer side - "tall" tank walls).
Here is the curve that Roark's uses to derive the values in Table 11.4.1e.  I have colored the curve in red to highlight it.  If you check Roark's you'll see that the values in the table agree with this curve.  I can derive this curve from first principles.

The curves (here and below) are Roark's reference (Ref. 8 in the Seventh Edition) for the values in it's tables: https://asmedigitalcollection.asme.org/appliedmechanics/article-abstract/3/2/A71/1101081/Stress-and-Deflection-of-Rectangular-Plates?redirectedFrom=fulltext
I've used Navier's solution to calculate the stresses and deflections to any precision needed for any ratio of length/width, and it is also possible with Navier's approach to also prove that when the length/width is infinite, that the transverse shear deformation factor (β) is exactly 3/4 (for all Poisson ratios) and the axial stress deformation factor (α) is exactly 5(1-ν2)/32, where nu is the Poisson ratio for the material.  So that is under control.
I've used Levy's solution for 11.4.1e with similar success.  I can calculate α and β to any precision desired at any a/b ratio (for width greater than height) and can prove that when the width/height is infinite that β for this case is also the same for all ν, and the closed form is $2 \sqrt3/9$.  At infinite a/b ratio α is dependent upon nu here as before, constant*(1-ν2) again, but the constant is $(4/255)\sqrt([15 + 4\sqrt(6/5)]$.  So that is also under control.
These results can be replicated to any desired precision.  With a little work after studying the literature, the actual mathematical description of the curve (α) above is as follows (in Mathematica):

Poisson's ratio is ν, which is set at 0.3 (similar to glass) for the curves shown here.  In the formula above, "b" is the a/b ratio.  At 201 summation terms this converges to better than a part per million versus the sum at infinite limit.  This is the maximum deflection factor.  The formula gives the deflection factor at a given position x, which is the direction that the hydrostatic load varies (x = 0 corresponds to no load, x = 1 corresponds to maximum load), so the position where α is a maximum must be searched, which is what "FindMaximum" does.  By symmetry, the position of the maximum deflection is on the y axis if the problem is set up that way (as I did in this case), so y=0 and drops out of the equations I started from.  The result for a/b = 1 is shown here to be 0.224317 (0.22 in Roark's table) and the position of maximum deflection is {x, y} = {0.548744, 0}.
I first solved this last case following Timoshenko's prescription in Chapter 5 of Theory of Plates and Shells (2nd Edition) where he lays this last case out in detail, then on page 196 of that edition he suggests that the Roark's case 11.4.1d, with the plate "taller" than wide, can be solved using the same approach as before with some suggested modifications and leaves it up to the reader to work out the rest of the details.  I made several attempts at that and have been able to generate values similar to, but not identical to those in Roark's tables.  That's where I am having difficulty completing this exercise.  In trying to understand this better I went to Roark's ultimate source for these values, referenced in the table: Wojtaszak, I. A.: Stress and Deflection of Rectangular Plates, ASME Paper A-71, J. Appl. Mech., vol. 3, no. 2, 1936.
This ASME reference has plots of curves for α and β for plates under various conditions, but while they are single curves for the other cases, it is not a single curve in this case as for the others and as is expressed by the results of the above approaches, but in fact composed of multiple curves.  There is absolutely nothing in Timoshenko that would suggest multiple curves are required to fully describe the physics, or why.  There is nothing in Reddy's text that would suggest multiple curves are required, or why. I have actually reached out to both Reddy (Theory and Analysis of Elastic Plates and Shells) and the current editor of Roark's but have received no responses.  I have been through all the references I can obtain from the ASME paper that claims this behavior is described in the references, but except for a copy of "Elastische Platten" published in Berlin by A. Nadai in 1925 and "Theory of Structures of Ships" published in St. Petersburg in 1914 by J Boobnoff, neither of which I have been able to obtain, none of the references in that paper discuss this issue at all.
Here is the curve used by Roark's for the values in its Table 11.4.1d.  I have shaded the two separate curves that make up the composite curve in red and green for each portion. As before, the values in Roark's table correspond to this composite curve.

So here is what I am asking.  Does anyone have any idea why there would have to be multiple curves to describe this behavior?  Can anyone point me to a reference that discusses it that might help me figure out how to handle it?
Also, is anyone aware of any resources that calculate these values numerically (but from first principles, FEM, not using the tables!!) which I might use to calculate values to several digit precision so I could see: a) are the results described by multiple curves, b) if so, where do those curve break/meet and if I have more precise descriptions of the curves can that inform my own rederivation of the unique mathematical description of each curve.
I am also interested in the same cases under hydrostatic load, but with one edge free (the top edge) - but again the values in Roark's tables for these cases are derived from the same ASME paper and in both cases there are multiple curves describing the α and β values.  It's a vexing problem.
Thanks for any insights or suggestions...
[30 March 2022 Update]
OK - here is a preliminary update that confirms the proper behavior for the simply supported plate, under hydrostatic load, with the plate being taller than it is wide is definitely described by a single curve and not a composite of multiple curves. For the deflection of the plate I was able to model this simply with partial differential equations.  The problem is pretty straight forward.  The displacement function is described by the biharmonic equation.  The Laplacian of the Laplacian of the deflection function is equal to the load.  For a plate with uniform load the load is just a constant, q.  For a plate with hydrostatic load the load is just q*x/a (where a is the width of the plate in the x direction).  So at x=0 the load is zero, at x=a the load is q.  This is the way the hydrostatic force works.  In both cases q = (ρ g h), where ρ is the density of the fluid.
I used Mathematica's numerical differential equation solver.  I thought there was a bug in Mathematica that delayed the results, but it turns out it was a change in syntax that wasn't properly documented, so they explained to me what the new syntax was and are correcting the documentation.  Using the differential equation I described and the necessary boundary conditions I derived the displacement function then searched for the maximum displacement on that function (which in turn is proportional to α).  In this way I repeated calculations for the plate under uniform load and the plate under hydrostatic load that I had previously solved analytically and was able to demonstrate that the numerical solutions agreed within the reasonable precision of the method (on the order of a part in about 10^-5 to 10^-6).  It was then easy to extend the problem to plates that are taller than wide and I was able to show two things:

The data from Roark's tables (for Case 1d) and the reference above are wrong, but reasonably close to right.  It seems clear these were mathematical approximations made at a time when computing numerical sums of slowly converging series was challenging.

The new numerical result also agrees well with expectations.  Let me show the results first and then talk about that a little more.

Here is a plot of the alpha values for each of the three cases I described.

The green lines are the new numerical results I have and the red dots on the lines are the values from Roark's for those cases - as labeled.  The blue line is the new result for plates taller than wide and the orange dots are the values from Roark's that clearly show the deviations between the table values and the line.  There is a lot of confidence the blue line is correct because the same code for the other cases is clearly correct and the agreement with the tables for the case in question is close as you'd expect it would have to be since people have been using those tabulated values without disaster.  But two other pieces of evidence confirm the blue line is correct.  The first is that for a square plate case 1d and 1e are identical.  And those two curves meet at a/b = 1 == square.  The second is that for infinitely tall plates the problem should converge on the same result as Case 1a at infinitely large ratios - and for large values (ratios greater than 100) the two results converge - and converge to the 5(1-ν2)/32 values described before.  So this is all very strong evidence this result is correct - and it's not a surprise.  Numerical solutions of differential equations of this sort should be reliable.
OK - so that's great confirmation that the α values should behave as expected and even provides a means to calculate α values for other materials with other Poisson ratios.  The Roark's tables all provide values calculated for materials with a Poisson ratio of 0.3.  But, for instance, in the case of tanks to hold water made of acrylic or glass, acrylic Poisson ratios are on the order of 0.4 and glass values are typically 2-2.3.  So the table values are not as ideal as you would like them to be.  In practical application the "engineering factor" chosen here is often quoted as 3.8, which is a little excessive, and probably because the tabulated values are not that great.
But, as great as this progress is it is a little anticlimactic because I still seek the more analytical result.  But far more importantly, this is only the α values, which describe the deflection behavior of the plate.  To properly engineer the plate thickness to ensure the tank won't shatter the β values are required, which describe the plate stresses.  With an analytical solution to the deflection problem determining the stresses is straight forward, since the bending moment (and therefore the stress) is proportional to the second derivative of the deflection function.  If the deflection function is a numerical approximation instead of an analytical function the problem is challenging at best, and fraught with numerical imprecision as numerical methods are applied on top of numerical methods.
So I am still looking for anyone who can offer any hints on how to address this problem analytically.
[02 April 2022 Update]
So, I knew this would not be super pretty - but I had to see the results.  Falling back to plate theory, if you have a function describing the curvature of the plate under stress (the deflection function) then you can calculate the moments - the x moments are the second derivative of the deflection function with respect to x and the y moments are the second derivative of the deflection function with respect to y.  The maximum stress, which is proportional to the beta constant, is the maximum of the x moment function plus the Poisson's ratio times the maximum of the y moment function:
σmax = Mx, max +ν My, max
So, recapping, we are deriving the curvature function, which is the numerical solution of a 4th order differential equation, then we're taking two separate numerical second derivatives of that original numerical function, searching for the maximum of each of those functions, then the desired result is proportional to the result immediately above.
I did this first for Case 1a - a simply supported plate with uniform load - because I have the exact answers, and compared those results to exact results and as you can see from the graph immediately below, those results are extremely good.  Two things to note for these numbers: the maximum stress is guaranteed by symmetry to be at {x = a/2, y = b/2} so there is no need to search for the maxima (simply calculate them); and the immediate result, σmax, is only proportional to the β value you want.  I found the value needed to scale these numbers is 0.5522.  From Roark's:
σmax = (β q b2) / t2
That scalar should be t2 / (q b2), but it's not.  So I am scratching my head about that a little bit.  In the plot, the green line is the numerical fit I just described, the black dots are the exact results derived analytically.  So the numerical method is doing what it is supposed to do.

The final thing to point out about the Case 1a results is that you will notice some "jagged" behavior of the numerical results shown in the green line.  This is because the number of dependently coupled equations is so high that the results are literally non-deterministic.  If I rerun the calculation the line is extremely similar, but not identical.  And I could not use the canned Mathematica routines to search for the maxima of the moment curves because this non-deterministic behavior caused the routines to fail.  I had to write my own routine to search out the maxima.
Case 1e is also shown, again, the green line is the numerical fit just described but the Case 1e conditions and the black dots are the exact results determined analytically. Other than the more pronounced "excursions" from the multi-step/multi-numerical approach, I think it's clear the physics is also being correctly modelled here.  Again the scalar, which in this case is about 30, isn't directly relatable to the analytical relation above.
Finally, Case 1d, which is the "white whale" I have been after (1 of 2 white whales), using the same scalar as that derived for Case 1d, is shown in blue with the black dots there representing the values in Roark's Table 11.4.1d (because I have no analytical solution for that yet).  This is more important than the α values - the β factor is used to decide how thick of a plate you need to guarantee the plate doesn't fail under load.  I think it's very clear here that the present numerical fit is modelling the physics correctly, and other than the "jagged" behavior is getting the correct values, but even with that behavior, and now that the Roark's β values are posted, I think the graph makes quite clear the tabulated values are actually quite poor and clearly do not lie on a single curve, which the physics clearly indicates they do.
A direct finite element analysis would get more deterministic and presumably higher precision results.  I guess I have to start looking at that.
So, again, my hope is someone can help me with any references or suggestions on how to solve the problem analytically.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/134950/discussion-on-question-by-merrick-maximum-stress-and-deflection-of-rectangular-p).
Comment: Top-right corner, click on the StackExchange logo. This opens a menu starting with "Current Community", right below which is "Engineering" (when you're on this site), with links to "help", "chat" and "log out".
Comment: Thanks!  Slowly learning my way around.
Comment: I guess I should add- it's a bit aside from the specific question, but a large part of the motivation.  Right or wrong, the tables values are given for materials with Poisson's ratio of 0.3.  But acrylic and glass, which most tanks are made of (aquariums for sure) have Poisson's ratios of about 0.4 for acrylic and about 0.2-0.25 for most glasses.  So the table values are all wrong that those purposes.
Comment: Instead of giving additional information as a comment, it's best to [edit] your question with this information. You can place it wherever it is most relevant and to make sure everyone sees it.
Comment: Yes - that was my plan - but I wanted a more substantial update that that.
Comment: In Industry ( eg, oil) , I never saw rectangular tanks unless they were very small. One exception is drilling mud and frac fluid; they use rectangular tanks because they are moved on roadways.
Comment: you may be looking at too large a scope.  maybe solve specific cases as necessary.  Concepts that may help: an inflatable pool is allowed to have a weak bottom because it is expected to be supported by the ground below it.  as tank walls deform, the load distribution changes from fluid level changes.
Comment: The problem is that the "solutions" that everyone looks to in the tables are wrong.  If the tables were right there would be no problem.  So the problem is to get the tables right.
Comment: I actually got a response back from JN Reddy recently.  He said my email got set aside and he'd only recently seen it.  But that he'd look into the problem.  I'm hoping he'll have some useful insights.
Answer: ""Elastische Platten" published in Berlin by A. Nadai in 1925" is available at the library of the "Technische Universität München" (Technical University of Munich, Germany). However, the book contains some serious errors, probably committed by the typesetter and not corrected by Nadai. The book has been scanned, so the university library (www.ub.tum.de) may be able to send you a pdf version.


Confused using sleep and sleep in

Question: Can both sentences be used?

I need a bed to sleep in.

I need a bed to sleep.
Comment: [***sleep in***](http://www.collinsdictionary.com/dictionary/american/sleep-in) also has idiomatic usages.
Answer: I need a bed to sleep in.
You're looking for lodgings or a place to spend the night.
I need a bed to sleep.
You don't sleep very well on the floor, or on a cot or sofa; you require the comfort of a bed.
I need some music to fall asleep by.
I need some music to fall asleep.
I need a pen to write with.
I need a pen to write.
P.S.  Phrases following this pattern, with the preposition at the end, are parsed as noun phrases, with the infinitive-phrase complementing the noun at the head:

words to live by ... words by which to live aka words for living | living words
shoes to run in ... shoes in which to run  aka shoes for running |running shoes
light to read by... light by which to read aka light for reading | reading light

So that noun-phrase becomes the {direct object} of "need":
I need {shoes to run in}.
I need  {shoes in which to run}.
On the other hand, phrases in this pattern:

a bed to sleep
a pen to write
music to fall asleep

the to-infinitive chunk functions like a so-called "zero"-conditional clause:
I need a bed to sleep = To sleep, I need a bed. If I want to sleep...
I need a pen to write = To write, I need a pen.  If I want to write...
I need music to fall asleep = To fall asleep, I need music. If I want to fall asleep...
Answer: TRomano put it well. Both are acceptable in my mind, although the connotation is different. You may wish to bear in mind that a lot of teachers will take exception to ending a sentence in a preposition. This is one of those arbitrary no-no's that English writing and language teachers love.
However, I would simply say "I need a bed." It will be presumed you need to sleep. Otherwise the subject would be "we" and really, you wouldn't really be obliged to tell people why the bed was needed.

Confused using sleep and sleep in


Blocked resources > /customer/section/load/?sections=cart&update_section_id=false&_=15382656000

Question: This message is coming from the Google Webmaster Tools (section Blocked Resources); has anyone an idea why this happens? Is this something to correct (if so, how this could be done?). Thanks for your collaborations
Answer: Please find the google Blocked Resources Report in that How to unblock your resources
To unblock your resources:

Open the Blocked Resources Report to find a list of hosts of blocked resources on your site. Start with the hosts that you own, since you can directly update the robots.txt files, if needed. You might not have control of all the hosts that we list, but change the ones that you can.
Click a host on the report to see a list of blocked resources from that host. Go through the list and start with those that might affect the content and layout in a meaningful way. Less important resources, such as tracking pixels or counters, aren't worth bothering with.
For each resource that affects layout, click to see a list of your pages that uses it. Click on any page in the list and follow the pop-up instructions for viewing the difference and updating the blocking robots.txt file. Fetch and render your page after each change to verify that the resource is now appearing.
Continue updating resources for a host until you've enabled Googlebot access to all the important blocked resources.
Move on to hosts that you don't own, and if the resources have a strong visual impact, either contact the webmaster of those sites to ask them to consider unblocking the resource to Googlebot, or consider removing your page's dependency on that resource.

Note : content copied from google.
Comment: Hi Kanhaiya; everything in customer/ is supposed to be blocked in the robots.txt: "Disallow: /customer/"
Comment: @JulianMurillo In magento usually customer related data is not allow to crawl, reason is google or any 3rd party will not get exact data and it always fetch login page data only because all data is session based. and in case of  customer/section  is used to get or sync the website local-storages or cookie only, so it not necessary to  unblock. so in my opinion it is fine to block.
Comment: @JulianMurillo if you fine with above shared info please mark it valid answer. any help please let us know.


JBoss AS / Wildfly community version corresponding to Red Hat EAP version?

Question: As far as i know the EAP editions of JBoss Application Server (AS) are just a bunch of community edition JBoss projects with some sugar.
So, what is the community edition of the JBoss Application Server that JBoss EAP 4.3.0 corresponds to?
Comment: With the announcement of an official name change, be mindful that JBoss Application Server (JBoss AS) is now called WildFly. http://www.wildfly.org/
Comment: Not "some sugar"! They are **significantly** different in terms of bug fixes. See my answer.
Comment: WildFly starts from version 8. And targets Java EE 7. So there will probably be a corresponding **EAP 7** version.
Answer: This response is really late but I came across the unanswered question in a Google search and I wanted to make sure there's a correct response.  I work for JBoss support so you can consider this a qualified answer.
JBoss EAP is the only commercially supported version of JBoss.  It contains JBoss AS and JBoss Seam.  EAP diverged (in terms of the svn branch it's built off) from JBoss AS around version 4.2.1 (not exactly, but close enough).  EAP has a 5-year lifetime and is tested and certified rigorously.  EAP has paid commercial support and patches (called CPs or cumulative patches) that are designed to maintain ABI/API stability over time while allowing for security issues and bugs to be fixed.  It is actually against policy to introduce a feature in a CP, but it happens on occasion.
If you're familiar with how Red Hat Enterprise Linux differs from Fedora, you can consider the difference to be quite similar.  The JBoss project/product split is much newer, though, so the differences are smaller.  Here's the official page describing what I've said.
http://www.jboss.com/products/community-enterprise
Cheers,
Chris
Comment: See my answer below, with the official JBoss answer
Answer: According to JBoss Enterprise Application Platform Component Details, JBoss EAP 4.3 is based on:

JBoss Application Server 4.2.1 with various updates, component upgrades, and bug fixes
Comment: This link is very useful and is a matrix of components per EAP version (covers 4.2, 4.3, 5.x, 6.x). The direct link to 4.3 version is https://access.redhat.com/site/articles/112673#EAP_4_3
Answer: The primary difference between EAP and the community release is that EAP is the officially supported configuration of the community edition, with fixed versions of the various components. RedHat was finding it too difficult to support the different component versions used by man+dog, and nailed it down to one set.
As for versioning, the EAP version numbers roughly track the community releases, but with differences:

EAP 4.2 is based on JBossAS 4.2
EAP 4.3 is also based on JBossAS 4.2.1, but with JBossMQ replaced by JBossMessaging, and Java6 support
EAP 5.0 is based on JBossAS 5.1
EAP 5.1 also seems to be based on JBossAS 5.1, with some cumulative patches

Edit:

EAP 6.x is based on JBoss Application Server 7.x
Answer: I've been digging into JBoss version information to try and find an answer to a more specific question i'm dealing with, and i thought i'd share my observations. You can get a picture of the names and dates of releases from JBoss's JIRA bug tracker: you can check out the info for the Community and Enterprise editions.
I was interested in the 4.2 branch rather than 4.3. If you hunt back a few years, you'll find that the Community release 4.2.0.GA came out on the 14th of May 2007, and was followed six weeks later by the Enterprise release 4.2.0.GA on the 3rd of July 2007. After that, the numbering diverged: the Community edition shipped point upgrades - 4.2.1.GA, 4.2.2.GA and 4.2.3.GA - every few months after that. The Enterprise edition instead shipped a series of 'cumulated patch' releases based on 4.2.0, starting with 4.2.0.GA_CP01 and hitting 4.2.0.GA_CP06 a few months ago. How do these releases relate to each other? I'm still not sure about this, but i think the theory is that the Enterprise edition doesn't gain any new features (within that branch), only bugfixes, but that those bugfixes are applied to both the Enterprise and Community editions. In fact, i suspect that in the case of my bug10, the fix was developed against the Community edition, and then crossported to the Enterprise edition, although i'm far from sure about that.
Turning back to your actual question, things are less clear. The Enterprise 4.3.0.GA came out on the 7th of January 2008, after the Community 4.2.2.GA, but before 4.2.3.GA. There is no Community 4.3.0, nor is there an Enterprise 4.2.x for any x > 0. Chris says that the Enterprise and Community versions "diverged", and i assume that what he means by that is that the Enterprise version is no longer based on just bugfixing a Community version, but rather is now an entirely separate development stream - presumably taking code drops from the Community edition where that's appropriate.
So, the answer to your question is some combination of: 4.2.2.GA (but only distantly), 4.2.0.GA (plus years of separate development), and mu.
Answer: While JBoss AS / Wildfly is really the basis for JBoss EAP, it's definitely not just "some sugar" what is added.
EAP is what went through an extensive testing and many many bug and security issues are fixed.
More, EAP is usually also faster after going though a period of performance tests, soak testing, and code analysis.
Also, EAP artefacts (jars) are all built by Red Hat, i.e. Red Hat is responsible for whatever is in them - i.e. you don't get whatever anyone puts in the central repo or whichever other repo you may have configured in your settings.xml (in case you build your own AS). Many of these third-party libraries are changed - CVE's fixed, performance issues addressed etc.
And lastly, EAP is way better in terms of features. For example, last 7.x release of JBoss AS is 7.1.1, year-and-something old, while EAP 6.1 is about a month old, and is way better in regards of manageability, stability, configurability etc. There is a several hundreds of commits difference between those two.
So, stating that "JBoss EAP X is based on JBoss AS Y" may be true, but at the same time misleading.
Check the EAP 6.1.


BJT with Zener diode

Question:
I got the picture from my prof's notes, and I don't quite understand why there can be two different currents at the given node. If there are only two currents shouldn't the currents' values be the same
Comment: What about the current arrow that is not present but is the current entering that node from the far left?
Comment: That's what I'm not sure about, from what I see, I believe it's just a voltage source to ground, but on the right side, I was able to use a KCL equation and there was no current going towards the circle to the right
Comment: Have you considered that the voltage source (ideally) can supply whatever the circuit is providing?
Answer: The current going into the node from the left (the power supply) is 1.0209A, determined by KCL.
It leaves (splits into two) as 39mA, of which about 10mA flows into the load through the base-emitter junction and 0.99A which flows into the load through the collector-emitter junction.
The signed total of all three currents at that node is 0.0 as it must be.
Answer: On the top node you can see that there is one incoming current that is equal to the sum of the two outgoing currents there. At the bottom node, you can see that the two incoming currents are equal to the outgoing current. And at the middle node (base of BJT), there is one incoming current and two outgoing currents and the sum of the two outgoing equals the incoming. Finally, you can see that the node at the BJT emitter receives the collector current and the base current as incoming currents and that the load current equals the sum of those. It all works out just fine.

simulate this circuit – Schematic created using CircuitLab
Comment: I'm very confused by the convention used in the diagram, because for the unshaded circle on the right, it was a power source, but on the right the unshaded circle was just telling me the voltage at that node. Is there any way to know whether or not it is a power supply?
Comment: @RichardChang In general, if a node is labeled as "15 V" then it is reasonable to assume it was meant as a "low impedance power supply rail, referenced to ground" (or the equivalent of some kind.)

BJT with Zener diode


Issue in running QR Code reader sdk

Question: I am doing a project to read QR codes.For that I am using the sample code from 2D barcodes (QR Code, Data Matrix) - iOS4 or above only  from the link http://www.quickmark.com.tw/En/basic/SDK.asp But when I am trying to run that sdk I am getting an error saying "_OBJC_CLASS_$_DecodePickerController", referenced from:Objc-class-ref in QMSampleViewController.o Symbol(s) not found for architecture i386 Collect2: ld returned 1 exit status.
    what is the reason?anyone tried this?help please.
Answer: I have tried to build the sdk, there is no issue for device build.May be you are trying to build for iPhone simulator.
Please try to build it for device.

Issue in running QR Code reader sdk


What is this furniture part, and where can I find one?

Question: I am trying to repair some chairs at church. One of them is missing the part in the photo. What is it called, and where can I find one in the US? Metric threads.
Thanks.
Comment: Look on the underside of the chairs. There is probably a manufacturer label with an address/phone number.
Answer: That is a barrel nut and bolt. You can find them at most hardware stores, but they are a specialty item, so they may not have the exact ones you need.
You need to take those with you to a hardware store or get the model information of the furniture to identify the size, or calipers to get accurate measurements. I recommend starting by trying to find the make and model of the furniture to contact their customer service.
Answer: You can try a company called Tacoma Screw. In my experiences, I've found that metric tends to be a little harder to find for these styles of bolts. You can of course check Amazon, Ebay and the like.
Answer: Thanks for the responses. There are no labels on the chair anywhere. Unfortunately, my parts are unlike any I've been able to find. It is different than a standard barrel nut & bolt, in that there is a threaded hole in the end. The hole in the side is an un-threaded clearance hole for the stud at the bottom. The stud goes into the clearance hole, then the pointed screw goes into the end of the barrel and pins or retains the stud by the hole in the stud.
I am going to see if I can find out from our financial officer who we bought the chairs from. If not, I think I can make the chair work without it.
Thanks,
Ken
Comment: This really should have been an update to your question. :)


Celery task state does not update

Question: I'm seeing a bizarre problem with a Django app which uses Celery as as the task queue:

I kick off a task.
During execution, the task calls update_state(...) to set the task state to indicate progress.
The task completes. I verify this through logs.

However, this view (http://myapp/tasks/37d9a3ac-5bd2-4791-9729-2234ff3be762/status) returns a STALE result for a variable amount of time well after the task has completed. I can repro this using both Redis and database as the back-end. Eventually the task state is returned correctly, but this really breaks my app because the UI polls to see if the task is completed before the user can do anything.
EDIT: my app is deployed on Heroku. I wonder if Cedar does any response caching??
Any idea what's going on?
Answer: It turns out this was not related to Celery. It was happening because my AJAX query to task/{id}/status was getting cached by the browser. Telling jQuery to not cache the response did the trick!

Celery task state does not update


Antenna to receive 50Hz

Question: The human body seems to be a good antenna to pick up 50Hz, at least touching a scope's probe shows a 50Hz waveform more than a volt in amplitude. Is it possible to construct an electronic antenna that does the same thing? (Wavelength at 50Hz is 6000km)
And if there's so much energy in it (1V in 1M\$\Omega\$ is 1\$\mu\$W), then why don't high-impedance pins pick this up?
Answer: A human body is a really crappy antenna at 50 Hz.  What you are seeing is capacitive pickup, nothing like a antenna picking up a self-propagating wave.
Yes, any hunk of conductive material the size of a human body will pick up 50 Hz about the same.  Since it's all capacitive coupling, its the area that matters, not the bulk.  A proper size sheet of aluminum foil would do just as well, probably better.  Just about anything large and metal will pick up 50 Hz, assuming this is coming from your power line and this is indoors where power lines are all around in the walls, cords running to appliances, etc.  A metal desk that is not connected to ground is a good example.
Answer: The body can couple large amounts of common mode voltage but little power. if touching a high impedance mic input, say humm.  If poorly shielded, say hummmmm.
YOu can easily get 50~100V on a 10Mohm probe. THe reason the probe doesn't is that is shielded. As soon as you touch ground with another body part your probe will drop to zero V.  Now can you say humm? Your best debug tool is your finger. With this you can inject power hum and DC offset to ground or whatever your other finger is connected to V+.. Measure your finger capacitance and resistance in various skin conditions, (dry or not). It is a useful bench debug tool, signal generator and ground capacitance. If that makes perfect sense, score accordingly. Generally good designs with adequate shielding and measured with a decent short ground clip are not too sensitive to stray fingers.
Comment: "YOu can easily get 50~100V on a 10Mohm probe." Looking very sceptical ...

Antenna to receive 50Hz


Postfix mail queue is empty but emails keep coming?

Question: I have typed in "mailq" in command line and it shows 0 mail in queue, however postfix is sending out emails every 5min. How is this possible? The emails were requested 1 hour ago by me during testing and were never sent, but now they are being sent randomly. Why aren't they shown in queue? I have "softbounce" enabled is this the problem?
Answer: go ahead and stop postfix and clear out /var/spool/postfix/active then restart it. Obviously you'll need to verify if any of these messages are legit or not.


What do we mean by honest nodes?

Question: In his recent paper, Vitalik often mentions the term "honest nodes". What do we mean by that exactly?
Answer: An honest node is a node that does not try to modify history. This is opposed to an attacker node which tries to modify a past block in the blockchain presumably to benefit them financially.
Note that because transactions are cryptographically signed, "An attacker can only try to change one of his own transactions to take back money he recently spent," Bitcoin Whitepaper.
Answer: An honest node is one which behaves in the way that we expect nodes to behave. This means that the node does not try to modify history, serves blocks and transactions correctly, transmits messages correctly, transmits correctly formatted messages and data, etc. These are all things that have a correct way of doing and honest nodes are ones which do all of these correctly.
This is opposed to malicious nodes which do not behave in the way that we expect nodes to behave. Such nodes may send malformed messages, send incorrect data, send too much or too little data, etc. These are things that are the wrong version of what a node is supposed to do, thus these nodes are behaving in a way that is not what we expect nodes to behave.

What do we mean by honest nodes?


Epson drivers in deb

Question: I'm looking for the old Epson scanner drivers. In particular: iscan_2.10.0-2_i386.deb
There is iscan_2.10.0-2_i386.rpm version and sources at official site that can't be build with up-to-date gcc. Alien approach isn't working for the same reason. Old 3rd party site that hosted deb versions is dead. Any ideas?
Answer: I would find a old linux distro that is known to have the correct version of gcc or alien, and install either on an old system, virtual box or run from live cd. Then use the older gcc or alien to get the files needed to install. Then get those files onto the computer you want to install them on, and install from there.
Comment: At the end it all was useless. I'v managed to convert rpm to deb in old kubuntu virtual machine, but these debs can't be installed as some required i386 packages are missing. I was able to unpack them from rpm and copy missing i386 libs manually - that didn't help. Then I've managed to build from sources and even debug the driver at runtime but realized that it needs some proprietary piece of lib that Epson distributes without sources. And it's 32bit So I'm stuck. I'll need whole SANE to be 32bit to make it work. And this will require 32bit vers for GUI frontend I'm using. It doesn't worth it.
Comment: To run a 32-bit executable file on a 64-bit multi-architecture Ubuntu system, you have to add the i386 architecture and install the three library packages libc6:i386, libncurses5:i386, and libstdc++6:i386:

sudo dpkg --add-architecture i386  and if that does not work sudo apt-get install multiarch-support after you have done the first ones. Like Kosh!

Epson drivers in deb


Are questions asking how well a piece of hardware does X accepted?

Question: So I got an MP3 player (technically MP4, but the screen is about the size of my thumb), but it's old and obviously doesn't support Bluetooth headsets. Reason I wanted a Bluetooth headset was due to my earplugs' connection piece constantly breaking after a couple weeks. Anyway, ...
Answer: Generally, no. Questions should ask for a recommendation of specific hardware - that means if you've already got hardware, this is probably not the right site for it.
However, if you haven't bought the hardware yet, but are looking at one option in particular, you can turn the question around. Instead of asking "How well does X do Y?", you can ask "I want an A that does Y well, and I'm particularly interested in your opinions on X".


Daisies planted last year are not flowering

Question: I planted several daisies last year.  They didn't flower then, but I assumed it was due to stress.  This year they appear quite lush, except that they're still not flowering.  Is there anything specific I should try?
Answer: Daisies grow their flowers on stems, which come up later in the season. Those plants are healthy and should flower at the right time. You just have to be patient. That is how daisies look before they send up stems. If you wait until Summer, and the plants haven't sent up shoots, there is something wrong. For now, just water, weed, and wait.
Comment: Thanks, I was a little concerned because just about everything else has flowered.
Comment: Keep your fertilizer to a minimum and use an extended release fertilizer low in nitrogen.  The NPK, or nitrogen, phosphorus and potassium, the macro-nutrients are numbers that show the percentage of each nutrient in the fertilizer.  Keep the first number equal or lower to the P & the K.  If you use too much N, you'll get lots of luscious leaves and few flowers.  Be careful with fertilizer, it IS NOT PLANT FOOD.  Plants make their own food and only need a little of these macro nutrients.  These plants bloom in summer, late summer so you have a while to wait...need more late-blooming perennials.


Limit bandwidth SFTP user

Question: Is there any possibility to limit the bandwidth of an SFTP user? My server has an upload of ~500kb/s and I don't want to 'spend' it all on one user
Comment: possibly you coukld use `tc`, but that doesn't understand "users", only ip addresses.
Answer: For openssh, see man sftp

<code> -l limit
        Limits the used bandwidth, specified in Kbit/s.
</code>
Comment: OpenSSH doesn't support a server side bandwith limit.
Comment: Alright, this enables someone who logs in to the shell to limit his own bandwidth. However, I want to limit the user's bandwidth before the log in, permanently. I don't think you can do that with the -l parameter.
Answer: If you are using WHM (Web Host Manager), you can simply go to "Limit Bandwidth Usage" under the "Account Functions" section. Choose an account and then enter a limit.
If not, you can use a utility called trickle - https://github.com/mariusae/trickle
Comment: Accepted answer is getting downvotes. Completely irrelevant but otherwise accurate references to man pages is getting upvotes. Weird!

Limit bandwidth SFTP user


How to play media files from folder and subfolders or directory and subdirectories in Windows?

Question: I would like to know how to play media (audio and video) files that are located in a folder and its subfolders using Windows.
I don't want to create a music libraries first. I simply want to click on a media file, have a player start playing it and continue with the next files in that folder and subfolders.
Is there any solution?
Answer: If you use VLC-MediaPlayer you can simply right click on the folder where the media files are and select "Play with VLC" or something like this. This action selects all media files within the folder and its subfolders.
If you use Windows Media-Player it is the same: right click on folder > select "Play with Windows Media Player".
Comment: I see. This requires the folder properties->customize->optimized for music which removes all the important file information, but I can fix this. Unfortunately this adds the files to a Media Player playlist which obfuscates the subfolder information. The problems with VLC are besides I am not having the context menu because I am using the portable version that it takes many seconds to load files from a smb NAS server. So VLC is not an option for me either.
Comment: @FrankBreitling Another Workaround ist to press CTR+A and then open the files with context menu
Comment: Ok, just be aware that for the context menu to appear it requires the folder to be optimized for music. And in a Media player playlist the subfolders are difficult to find.
Comment: If you are already inside the first folder, where a media file is located, you can press CTRL+A and then click right **on the media file** and select "Play". This does not need any folder to be optimized for Music
Comment: Oh, you are right, then the context menu depends on the file type. For .mp4 files I don't see the `Play with Windows Media Player` but for .mp3 it shows up.


How to render a file with Blender called from a PHP script?

Question: I'm writing a basic web service to render colour swatches with nice lighting and shadows, using blender in its 'command line' mode, and called from a php script ( that also handles cataloging swatches in a database ). Everything is running under apache on win32, with php 5.2
Everything seems to be working well until the final step of actually rendering something at which point all fails. I've tried using all the different php execution commands ( exec(), system(), passthru() etc. ) and all have the same result - eg nothing at all. The weird thing is that it IS working because if I pass in a malformed argument to blender, then php echoes the correct error message from blender, which verifies that it is definitely starting the program. If I supply correct arguments then exec() etc. just hang, and no blender process appears in the task manager.
I have a feeling its a file permissions problem as Blender needs to write a jpg file to the web folder ( which is sitting in the default apache install dir, eg: within program files ), but I have no idea how to set the correct permissions under windows.
executing my render command from a command window does exactly what it should and outputs the rendered file, but the same command in PHP fails.
here's my php code ( in this case using system() but all other variants seem to have the same result ):
$swatchId = $args->swatchId;
$sql = "SELECT * FROM `colours` WHERE `Id` = ".$swatchId." LIMIT 0, 1 ";
$rows = mysql_query($sql);
$command =  ".\blender\blender -b _swatches.blend ";

while ($row = mysql_fetch_assoc($rows)) {
    $filename = $row["ProductCode"];
    $red = $row["Red"];
    $green = $row["Green"];
    $blue = $row["Blue"];
}

$command = $command."-o ".$filename." -F JPEG -x 1 -f 1";
echo json_encode(array("Command"=>$command));
$result = system($command);

this results in the command:
.\blender\blender -b _swatches.blend -o NPRKGAP -F JPEG -x 1 -f 1

which executes correctly in a command window, but not when called in php ( from a web request ).
I have safe mode turned off in PHP, and have bumped up the maximum memory a script can use, though the blend being rendered is not that demanding.
If anyone can help I'd be eternally grateful.
Comment: Also info on using the netrender render engine: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Performance/Netrender
Comment: This may or may not be useful: http://sourceforge.net/projects/phpblender/
Comment: Thanks george - I will study those links, however phpBlender looks to be doing exactly the same as me at a first glance.
Answer: Try adding the flags to your blender command.
-noaudio -nojoystick

I am doing something similar, except I'm using python.
Back story:
I was getting crazy permission issues when trying to get www-data user to launch blender (what you are also doing). I looked at George Reith's comment and saw in the netrender examples that they make you put noaudio and nojoystick. So I randomly tried it and suddenly www-data can run blender!
Answer: Create a script and put the following code in that file and save it as .py
import bpy

bpy.ops.render.render(animation=True)

and change
$command =  ".\blender\blender -b _swatches.blend ";

with
$command =  ".\blender\blender -b _swatches.blend " + "Directory\script.py";


curse of dimensionality & nonparametric techniques

Question: I have seen it many times in a number of articles that nonparametric techniques are subject to the curse of dimensionality, which may lead to the failure of these methods. Why does this happen? Could give me an example? Thanks!
Answer: Imagine that effects aren't additive. Imagine we only have to worry about two values of each predictor, $x_i =$ Low and $x_i =$ High. Then there'd be $2^p$ values our function would need to provide estimates for. In practice, there are more than two values in each dimension to worry about.
http://en.wikipedia.org/wiki/Curse_of_dimensionality
Comment: Because without constraining/regularizing/whatever to dramatically reduce the way that the parameters grow, you can rapidly overwhelm *any* ability to estimate - there's no point in having 2^40 points if you have 2^60 parameters. More points simply doesn't cut it - even if it wasn't prohibitively expensive, there are all manner of other constraints that will bite (space, time, ...). Hence, for example, the focus in statistics on using additive models (possibly after transformation) with nonparametric methods.
Comment: Thanks very much. According to your response, I guess we need more data to estimate the unknown parameters or functions. However why is it called curse?
Answer: Further to Glen's answer, I think it is nice to think of the problem in terms of the volume/concentration of high dimensional space. Directly from the wikipedia article:

There is an exponential increase in volume associated with adding extra dimensions to a mathematical space. For example, $10^2$=100 evenly-spaced sample points suffice to sample a unit interval (a "1-dimensional cube") with no more than $10^{-2}$=0.01 distance between points; an equivalent sampling of a 10-dimensional unit hypercube with a lattice that has a spacing of $10^{-2}$=0.01 between adjacent points would require $10^{20}$ sample points.

So basically as the dimension increases, the number of points required to provide the same coverage of space increases exponentially with the dimension.
This means that for non-parametric methods, which rely on there being points locally to base an estimator on, far more points are required as the volume explodes.
The curse is also often considered in terms of computational feasibility of trying to estimate functions in high dimensions, maybe you could look into this if you're still looking for insight.
Comment: I just wanted to add a side comment - from what I've seen, often in non-parametric literature the curse of dimensionality is 'ignored' by assuming that the number of derivatives the target function has grows with the dimension. This obviously is a pretty huge assumption to make. Thanks for the corrections to my fortmatting user603.


Why does a ball when bounced at an angle not come back to you?

Question: Say we have a ball. We throw it at the wall at an angle. The ball hits the wall with a force and a direction away from you. The wall then applies a force equal in magnitude and opposite in direction. So the direction was away from you at an angle and now the opposite of that should be back at you right? Then why does the ball bounce off with the same angle on the other side of the perpendicular like a ray of light. Am I missing something here?
Comment: Note: answers below neglect the angular momentum of the ball and, how it changes as a result of contact with the wall. They answer as if the contact was frictionless. If you bounce a [superball](https://www.amazon.com/dp/B0001ZN49I) on a hard surface, giving it a good spin in various directions, you can get an intuitive feel for how angular momentum and friction change the direction of the bounce. Then, let it bounce more than once, and you can start to see how the direction of the bounce changes the spin.
Comment: To see what @Solomon-Slow is alluding to, check out this ["Back & Forth Bouncing Ball"](https://www.youtube.com/watch?v=uFLJcRegIVQ) demo from St. Mary's University.
Comment: If you give the ball an appropriate spin, it _will_ come back to you.
Answer:
The ball hits the wall with a force and a direction away from you. ... the opposite of that should be back at you right?

Indeed, if the force were in the direction you suggest then the motion would be as you describe. This implies that the initial assumption must be incorrect. The force is roughly perpendicular to the wall. It is not directly along the line of motion of the ball.
The wall provides a constraint force. Than means a force that constrains the motion. In the case of a smooth wall, it constrains the motion to not go into the wall, but does not constrain motion away from the wall or along the wall. Such a constraint force is directed normal to the wall and is of sufficient magnitude to prevent any inward motion.
Answer: Neglecting friction, the wall applies a force that is orthogonal to its surface (and is equal and opposite to the normal component of the force from the ball). Therefore, the velocity of the ball in the plane parallel to the wall is unchanged.
Answer: The ball does not apply the force in the direction in which it hits the wall. The force exterted is in the direction perpendicular to the surface of the wall.. So it exerts a force that is opposite to only the normal component of the force.. Which makes the ball to recieve equal and opposite force (only in the direction perpendicular to it).. This can be better understood if you resolve the momentum or force when the ball decelerates at contact into its parallel and normal components.. And in addition, The ball thrown has only a fixed velocity, it has no force in principle, The force comes into play only when there is a momentum change, a ball in motion has a fixed momentum, The momentum description is more correct than a description based on forces.
Answer:
Suppose the ball has a velocity vector v1 and hits the floor.
If you think in terms of hard body objects, neither the ball nor the floor can deform, so the ball has to instantly flip its velocity vector to bounce off the floor: collision with the floor will take zero time, and a velocity vector flipping direction in zero time implies infinite acceleration and therefore an infinite force. That doesn't work. So it's better to not use the hard bodies paradigm: the ball will squish a little bit. Even if it's a steel ball bearing, it'll squish.
Bouncing happens because the kinetic energy of the ball is stored as potential energy in the compressed "spring" formed by the elastic material (or the air pressure inside, if it's inflatable). Then this energy is released and converted back into kinetic energy as it jumps off the floor.
Anyway, if the floor has very low friction, for example a steel ball bearing bouncing on a greased polished steel plate, then the floor's reaction will be normal to the surface and the horizontal component of the ball's velocity vector will not change. So it will bounce off with the vertical component of its velocity vector flipped, and the horizontal component will remain identical (minus losses).
If the floor has friction, as I drew in the second illustration, then it will indeed exert a reaction in the opposite direction as the force applied by the ball, and as you said this reaction will push the ball back to the person who threw it.
However this reaction force does not apply to the center of gravity of the ball, but to the contact area with the floor, so it will apply torque to the ball and tend to make it turn (ie, gain angular momentum).
So the ball's velocity vector does lose a bit of its horizontal component, and also a bit of magnitude, as some of the ball's kinetic energy and momentum are converted into rotational energy and angular momentum.
If the ball was turning before it hit the floor, then that will also influence the direction of the bounce. If you turn it fast enough, and if the angle with the floor is not too low, it is possible to make it bounce back towards you.
Comment: wow, what an insightful answer! the torque part made it even more clear and also the conservation of energy part. thank you
Answer: Lets look at this figure

( http://wandinger.userweb.mwn.de/TMD/v2_4.pdf)
you throw a ball ,with the velocity   $~v_A~$ and the angle $~\alpha_A~$ towards a wall
the ball hit the wall and come back, in case of inelastic collision (left figure)
with the velocity $~v_A~$ and the angle
$~\alpha_A~$
if the throwing angle $~\alpha_A~$ is zero the ball will come exactly back to you , but a soon as the throwing angle not exact zero the ball will not come exactly back to you.
in "reality"  you have the   semi elastic case so even if the  throwing angle $~\alpha_A~$ is zero the ball will hit the wall an come back with the angle $~\alpha_B\ne 0~$ not exactly to you
Comment: Can you add proper attribution for the source of the images?


Can't update my schematic to PCB layout in Altium

Question: I have finished my schematic for an echo circuit using PT2399 IC as per the application circuit in datasheet. I have downloaded the part (including footprint) from snapeda.com and updated my Altium library. But I can't update the design to PCB. There's no option as 'Update PCB document' under the 'Design' tab to update the design to PCB. But it is showing for other projects I have done. I don't understand. Please help me, it's urgent.
Comment: At risk of insulting MegaMind (which is not my intention) but do you have a .PcbDoc setup in the .PrjPcb?  And, is this "update PCB" function grayed-out or just not there?
Comment: Thank you so much Steve. Actually I'm new to this Altium. This is my first project besides a simple power supply which I did to learn this and it was done some time ago and honestly I forgot. Thank you sir.
Comment: No worries there MegaMind.  I, was baptized-by-fire (no formal training) learning Altium so I understand the possible frustration/s.
Answer: Altium Designer is similar to, for example, Microsoft Visual Studio and other major development applications, in the sense that you can open a single document or an entire project (collection of related documents).
When you have just a PCB or schematic document open, Altium has no context for updating one from the other. If you have the project open — even if you only have one schematic within it actually open — then Altium 'knows' which PCB you want to update.
The file extensions of interest (per Altium 19) are:

PrjPcb = The entire project
PcbDoc = PCB
SchDoc = Schematic

(It may help to have file extensions shown.)


Time complexity and optimality

Question: If a problem has worst-case lower bound Ω(n^2) and there is an algorithm
with W(n) ∈ O(n), What can we say about the possibility, importance and order of optimality about this problem and algorithm?
Answer: I'll consider decision problems only, for optimisation problems the question could be quantified in plenty of ways.
I assume that you are asking the following: if a language $L \not\in \mathrm{DTime}(n^2)$ and another language $L' \in \mathrm{DTime}(n)$, how close in some sense $L'$ could be to $L$?
One of the more or less natural measures of closeness is the following one.
For each $n \in \mathbb{N}$, $\mathbf{P}(L(x) = L'(x)) > 0$ where $x$ is uniformly distributed among $\{0,1\}^n$. Surprisingly, there exists a language $L \in \mathrm{DTime}(n^2)$ such that for any $L' \in \mathrm{DTime}(n)$ there exists infinitely many values of $n$ such that $\mathbf{P}(L(x) = L'(x)) = 0$. One can prove that using diagonalisation in a very similar way to time hierarchy Theorem:
An algorithm $B$ for the language $L$ will act as follows. $B(x)$ will run the algorithm corresponding to the string $|x|$ in binary form for $|x|^{1.5}$ steps (this takes $O(|x|^{1.5} \log |x|)$ time) and answers $0$ if $\langle|x|\rangle$  (the algorithm) did not halted and $1-\langle|x|\rangle(x)$ otherwise.
For each algorithm in $\mathrm{DTime}(n)$ there are infinitely many equivalent algorithms and therefore the length of the encoding string of one of them is such that $|x|^{1.5} > cn$ where $c$ is a constant such that $\langle|x|\rangle$ does at most $cn$ steps. Thus $B$ will run $\langle|x|\rangle$ for sufficient number of steps and return the opposite value for any $y \in \{0,1\}^{|x|}$.
Answer: If your lower bound for the worst case is $\Omega(2^n)$, no algorithm with worst case $O(n)$ can possibly solve all cases. It might work up to some bound (before $\Omega(2^n)$ overtakes $O(n)$, that is), but not for all sizes. Your problem might be such that there is an $O(n)$ on average algorithm, that would mean that the "hard" cases are just incredibly rare.

Time complexity and optimality


iOS Development: How can I run my iPhone 4.2 app on the iPhone 3.2 simulator?

Question: I'm diving into iOS development and I'm building a simple app that will support iOS version 3.2 to 4.2.  I've tested it fairly well in the latest version of Xcode on the 4.2 simulator, but I would like to also simulate it running on a iOS 3.2 device.  After reading a few tutorials on this, I managed to download and install an older version of xcode along with the older 3.2 SDK, but when I build my project in the older version of Xcode, I get a ton errors due surrounding all the iOS 4.2 functionality that the older version of Xcode doesn't support.  I'm weak-linking all the 4.2 frameworks, but I'm still getting errors.  How can I get my 4.2 app to build successfully in this older version of Xcode and get it to run in the 3.2 iPhone simulator?
Thanks so much for your wisdom!
Answer: Did you select the option of setting the base SDK to 3.0 or others?Because by doing so you can run the new APIs available in iOS 4.2 on older OS also.
Cheers
Comment: Thanks, Aditya.  I don't see the "3.0 or others" setting anywhere.  "3.0" is the closet setting that I have.
Comment: You can see that in the Project Setting->Build->Base SDK section.
Answer: You need to add #ifdef __IPHONE_4_2...#endif around any lines that reference features that only exist on 4.2. That way the 3.2 compiler will build your app as if those lines don't exist.
You need to be extremely careful to structure these statements in such a way that they exactly mirror the bits of code that would be disabled when running the built-for-4.2 build on 3.2, otherwise there's not a lot of point.
This will build your app without any of the 4.2 functionality included, so it isn't actually testing whether your weak-linking etc is correct, it's just testing how the fallback 3.2 code works.
It will probably throw up a few warnings about features/methods you didn't know didn't exist in 3.2. Make sure these have appropriate fallback code added.
(btw Apple has been known to reject iPhone apps with a Base SDK of 3.2. You need to support at least 3.1.3 if you go back before 4.0)
Comment: wow, really?  i have to manually simulate the structure of the code?  that's horrible, i'm not messing with that.  anyhow, thank you!
Answer: On the second issue, of actually running it in a 3.2 version of the iPhone within the iOS simulator: I've struggled with this -- Xcode 4.0.2, set my deployment target to iOS 3.2, set my project to iPhone only, but when I try to run in the iOS Simulator under version 3.2, the simulator morphs into the iPad simulator, even if it had been running as an iPhone simulator until I selected the version number.
This frustrated me for a while. But I read this and it made sense:
http://en.wikipedia.org/wiki/IOS_version_history
The iPhone never ran 3.2; that was an iPad-only release.  So, even though the Hardware > Version menu in the iOS Simulator lists 3.2 (7W367A), presumably that setting is only intended to be compatible with Hardware > Device > iPad.  The simulator is enforcing this rule when it switches me into an iPad simulator.  It makes complete sense.
So I'd need a 3.1.3 simulator, or older, to run my app as if running on a 3.x-generation iPhone. This isn't available in my Xcode 4 build, so it makes sense to me now that I'm just unable to do anything about this, short of putting older Xcode builds on my machine.
Answer: I think the right way to do is as follows:
1.If you are developing for version 4.2, then you must be having Xcode version 4.2 installed.
2.While building your application on devices 4.0 and 3.2 OS, select base SDK to 4.2, and deployment target device to the minimum version you want to support, say 3.2. This will make your code compatible to lower version and your application will be loaded on lower versions.
Also to support new APIs in lower versions you may follow the link :
http://www.marco.org/1648550153
I hope this helps you
Comment: Thanks, Snehal, tho I don't think you understood my question.  I understand how to configure the xcode project to support multiple version of the OS, that part is very straightforward.  Where I'm stuck is actually getting my app to run on older versions of the simulator.  As I understand it, I needed to download the older version of Xcode that has the 3.2 simulator, which I did, but when I try to build my code so it can run on the 3.2 simulator, I get a ton of compile errors because the 3.2 SDK doesn't understand the 4.2 code.  So that's my problem and that's where I'm currently at.
Comment: Does the compiler give error like ...this menthod is unsupported by OS version 4.0. Did you follow the above link?
Answer: You can run both 3.2 and 4.x simulators in the latest Xcode (not at the same time, of course!). You have to set "Base SDK" to 4.2 and "iOS Deployment Target" to 3.2. Now you can select the 3.2 Simulator (or later) from the "Overview" popup menu in the top left corner of the project window. Also you can select the simulator version in the iOS Simulator app itself, via the "Hardware->Version" menu item.


Statistics on the site's development

Question: I noticed the other day that at the Area 51 page for the Linguistics site, there is a little summary of some statistical measures of the site so far, along with the "good" and "not so good" values for those measures.  I'm not sure how many other people were aware of that page, so I wanted to publicize it here.  It can help us keep track of our site's progress and make sure that it continues to develop well (as measured by the Stack Exchange folks).  We're currently doing pretty well, it looks like, so let's keep it up.  :)
Comment: For details on interpreting these numbers, see: http://blog.stackoverflow.com/2011/07/does-this-site-have-a-chance-of-succeeding/
Comment: We'll we need more people. There might be a slowly increasing influx thanks to links from, for instance, Google but it doesn't hurt to shout from the rooftops for a little while :)
Answer: Traditionally beta sites (and most sites altogether) have no problem with '%questions answered' or ' answers per question'. The main difficulty are the other three.
'questions per day' and 'visits per day' are increased by advertising (a good, popular question in the StackExchange what-do-you-call-it 'most popular question' can do it).
But the '#avid users' is only really made by voting as much you can.
Answer: Yeah, I've been looking at those stats now and then.
Some paramaters "need some work", using the stats words :) but it's also true that we are in a good position. If we keep growing like this, the site will be healthy.

Statistics on the site's development


Is the order of NVIDIA kernel modules in mkinitcpio important?

Question: I'm troubleshooting a solution for Nvidia screen tearing cited on the Archlinux wiki which instructs to enable DRM kernel mode setting:

nvidia 364.16 adds support for DRM kernel mode setting. To enable this
  feature, add the nvidia-drm.modeset=1 kernel parameter, and add
  nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm to your initramfs#MODULES.

I entered the MODULES into mkinitcpio.conf as instructed. Here is the relevant line from my .conf file: MODULES="ext4 dm_mod dm_crypt vfat nvidia nvidia_modeset nvidia_uvm nvidia_drm"
Troubleshooting, I discovered evidence the modules are not loaded:
$ rmmod nvidia_drm nvidia_modeset nvidia
rmmod: ERROR: Module nvidia_drm is not currently loaded
rmmod: ERROR: Module nvidia_modeset is not currently loaded

I know mkinitcpio HOOKS go in order (ie. LUKS). Is the order of NVIDIA kernel modules in mkinitcpio important?
Answer: I think that your syntax is wrong.
The MODULES variable is an array, so assigning to it should be done using (...):
MODULES=(ext4 dm_mod dm_crypt vfat nvidia nvidia_modeset nvidia_uvm nvidia_drm)


Can't Get Cisco Switch SG300 to More Than 100M Half

Question: I have a Cisco SG300-10SFP switch which I purchased just 6 months ago. I had intended to use it as a hub for a fiber network on our premises. It has 8 SFP ports and two Ethernet ports (all 1000M). I planned on using the two Ethernet ports in a LAGG to connect to my main switch. The SFP ports (which are running fiber) are working fine at 1000M full. However, the two Ethernet ports won't autonegotiate any higher than 100M at half duplex.  I've tried different cables, different equipment and have narrowed it down to the switch. I even tried a laptop with a 3in cable.  Both ports began having this problem at the same time which tells me its probably a setting and not necessarily a hardware issue.  I even factory reset the router with no luck. I don't usually ask on forums unless I've exhausted all other options. Any help would be appreciated.
Comment: What are you using for the transceivers?
Answer: Try setting the speed and duplex manually.
From interface config mode the commands should be
Speed 1000
Duplex full
Answer: Maybe additional turn auto-negotiate off:
<code>auto-negotiation off
</code>
If it does not work, show us the switchport config.


Can you use bray-curtis distances to evaluate standardized abundances in an NMDS?

Question: So I'm trying to run an NMDS (using the vegan package in R) for a species X site matrix. Unfortunately the abundances of species are not inherently equal (If you can use that word) meaning that not all the sites had equal sampling efforts for this data. Therefore I standardized the abundances of everything by dividing the abundance by the number of months that were actively sampled per site. For example, if site A only sampled 5 out of 12 months and had an abundance of 30 for species B, then the new standardized value would be 30/5 or 6. I realized that when I run the NMDS, the default method in vegan is to utilize bray-curtis distances to calculate distances between sites in terms of dissimilarity or turnover.
My question is: Can we use that measure of beta diversity for data that has now been altered and don't reflect true abundances but rather abundances per sampling effort? Maybe the better question is: Is it right to do so? If not then what other sort of measure should I be using.
Comment: Looking at Bray-Curtis distance (or similarity) one can say there is absolutely no restrictions whether the data values be integer, counts, proportions, etc.  Any nonnegative values support the formula and its meaning.
Comment: I'm far not an expert in bioecosystem field but I know many special measures are used to compare abundances, including Ellenberg, Gleason and Pandeya similarities. Maybe they worth to consider for you too. (You can see their formulas in the doc. "Various proximities" on my web-page.)
Answer: You can use "abundances per sampling effort" to calculate Bray-Curtis distances. However, it does not account for the fact that you are more likely to have higher species richness in the more intensively sampled sites. Whenever you sample a site, there will be species you don't detect - at sites where you have sampled 12 months you are more likely to have found rare species than sites that you have only sampled for 5 months. When you turn each count into a proportion there is still a difference between zero and non-zero proportions for those rare species.
Instead of normalizing through proportions, you can use rarefaction.  This works by randomly removing sampling from your more intensively sampled sites until all sites have the same (lowest) sampling effort. The downside of this is that you lose a fair bit of your data, and so lose some power for distinguishing differences between sites. There are papers recommending alternatives to rarefying if you're interested, but the methods are often quite complex and less intuitive.


Coldplug or hotplug device?

Question: Is there a way given a device file name to figure out if it was created by some udev rule or it was created "the cold way"?
Answer: No.  Once a device node is created, there's no trace left of what process created it.
At best, you could examine udev rules and determine that a node might have been created by one of the rules, but you can't tell if it actually was created due to the rule.
It may have been created manually at the command line, it may have been created by some other script that ignores udev rules.  The device node may have been originally created by udev, but later deleted and re-created by some other method.
Comment: I see, and I was afraid of that kind of reality. However (putting manual device file recreation aside) shouldn't there be some logs left in the system when udev rule is applied? What about audit events? I mean, it sounds like a flaw in security if e.g. someone could plug-in arbitrary USB stick into a server or someones workstation, and it would be impossible to detect that without physical presence at the scene.
Comment: `udev` doesn't log device-node creation by default.  you can increase udev's log level to `debug` in /etc/udev/udevd.conf (IIRC, the default log level is "info")....and that **might** show when it creates device nodes (I don't know for sure, because I haven't tested it).  But a) you almost certainly don't want to run udev like this all the time because of all the log spew it will generate, and b) it won't tell you if a udev-created device node was deleted and re-created by something else.
Comment: The kernel will log events like USB device insertion and removal.   It won't show whether udev created a device node or not, though.

Coldplug or hotplug device?


What alternative name to give to controllers?

Question: There are several posts and other contents in the internet that claims against naming classes ending with "er"  (like manager, controller, helper...). I personally agree with that, but what alternative names could be given to MVC controllers in the scope of web development? I came up with "entry points"  or "end points"  (like "UsersEntryPoints", for example) but I'm not sure if it reflects exactly what it does.
Comment: remove the word 'controller' from the class name
Comment: So, instead of calling "CommentsController"  you'd call it just "Comments"  and handle HTTP requests there?
Comment: I would write the code as if its not a web api/site just a library and name accordingly. It helps stop you adding "Service" "Controller" "View" etc
Answer: The point about avoiding "smurf naming" is not to think of synonyms for "smurf", but to not use the term. So the thinking goes that if you have a user controller in a folder called Controllers, then just call the class User, rather than UserController.
However, the problem with that is then you end up with a User class in views and in controllers and in models, which makes it hard to distinguish between them.
The point about avoiding "er" classes is that they upset hardcore OO folk who see them as a sign of procedural code masquerading as OO code. Just ignore them and they might get bored and go away one day. Seriously; it's an inane argument.
The term "controller" has a special meaning for MVC. The convention for those controllers is to call them thus. So stick to UserController. Readers of your code will thank you for it.
Comment: Yeah, that last part is that makes me think. I really think that "controller" is not a meaning name, it sounds exactly the same as "manager" to me but I understand what it does because I've been working with them since a long time ago and the name was already stablished way before I started using it. Never the less what bothers me is the lack of meaning in a name, but I kind of feel that the tradeoff of using a well stablished name over a more meaningful is worth it.
Comment: @Talysson, you'll find many MVC frameworks map a URL to a class that ends in `Controller`, and you'll have to jump through quite a few hoops to change that convention without writing your own framework.  Unless your framework does something fundamentally better than what's currently out there, it may not be a battle worth fighting.


Can I use my old Korg D1600 as an audio interface to connect to laptop?

Question: Does the Korg d1600 have mic preamp or d/a converters inside that would allow me to use this piece of equipment as an audio/midi interface? I believe It has all the appropriate inputs and outputs?
Comment: do you mean this one  here?
 https://www.youtube.com/watch?v=JL_Nhca1Izc
then you'll have the answer! midi will work!
The KORG D1600 MkII Digital Recording Studio is truly a studio-in-a-box. The accompanyng music is the onboard demo shipped with the unit and was excellently recorded on this beautiful machine.
Answer: The Korg D1600 has a comprehensive list of inputs, including mic preamps with phantom power.  But I see no mention in the manual (linked below) of being able to use it as a computer interface.  The words 'USB' or even 'Firewire'  do not appear in the manual.  So I'm afraid your answer is no.  It is essentially a self-contained recorder.
https://www.zikinf.com/manuels/korg-d1600-manuel-utilisateur-en-38857.pdf
Answer: You can use it as an input for all your devices (mics, synths, guitars) and then plug thru the S/PDIF optical output. But you have to have a bacic sound card with optical S/PDIF. If you have an old computer you can use M-Audio Firewire 410 (drivers are only available for older operating systems like Win 7 etc). You can record only 2 tracks in real time. But you don't need to plug and uplug your devices again and again if you use the Korg as an input. Korg also has great effects which you can apply during recording process.


Random text generator

Question: What is the best way to generate random a string which is composed of alphabets and its a maximum of 8million characters which will be tested using string searching algorithms? is Math.random still be ok for the randomness or the reliability of the spread of characters based on statistics? any comment is appreciated, right me if im wrong with my ideas.
Answer: How to generate a random alpha-numeric string?
Answer: Sure, why not? 8 MiB isn't that much, actually. Even bad PRNGs have periods at least of a few billion and Java uses an 48-bit LCG. So yes, it should be ok.
Answer: It depends entirely on the purpose of generating this string.  If you're generating strings in order to test the performance of a search algorithm then you may want to generate "English-like" text containing a distribution of words similar to a typical document.
One way to achieve this would be to build a Markov Chain, whereby for each state you generate a given word; e.g. "The" and then transition to a new state with a certain probability; e.g. "The" -> "first".  You could auto-generate the Markov chain using a large body of sample text, such as the Brown Corpus.
Or even simpler, you could test your algorithm using a particular corpus (such as the Brown Corpus) rather than having to generate any samples yourself.
Answer: This class of commons-lang library does that job
org.apache.commons.lang.RandomStringUtils
You can use method "random"
<code>String s = org.apache.commons.lang.RandomStringUtils.random(5, true, false);
</code>

Random text generator