Sign of the real numbers in archimedean property

Question: Let a, b be two positive real numbers. Then there exists a natural number n such that na >b.
The above statement is called the archimedean property of real numbers.
The theorem holds if a be positive and b be negative.
Then why we take two positive numbers?
Comment: Welcome to Mathematics Stack Exchange.  If $n>0$ and $a>0$ and $b<0$, it's trivial that $na>b$.
Comment: The statement holds if $b<0$; it's just not remarkable or noteworthy in that situation
Comment: Then why we take two positive numbers? I tnink in the theorem we shouldn't mention b as positive. We can say a is positive and b is a real number.
Comment: In fact, in Rudin's *Principles of Mathematical Analysis* (third edition, page 9), he does not require that $b$ (which he calls $y$) be positive
Answer: If $n>0$ and $a>0$ and $b<0$ then $na>0$ and $0>b$,
so it's trivial from properties of $
">"$ that $na>b,$ in any ordered field.
The Archimedean property that there exists a natural number $n$ such that $na>b$ when $a,b>0$
is a special property that works for real numbers but not all ordered fields.
Answer: The significance  is that no member of $\Bbb R$ is greater than every member of $\Bbb N$ nor less than every negative  integer. So if $b\ne 0$ then there exist $n_1,n_2\in \Bbb N $ such  that $-n_1<a/b<n_2.$ And if $x\ne 0$ then $|x|>1/n$ for some $n\in \Bbb N.$
This is a consequence of the definition of $\Bbb R.$ We can extend $\Bbb R$ to a larger arithmetic structure that has objects that are greater than every member of $\Bbb N.$
Answer: Some people prove it as a theorem. Others take it as axiom.
Either way, a theorem or definition or axiom doesn't (always) claim to apply to all possible objects it could apply to.
In this case the emphasis is not on the negative reals. Indeed, the ancient Greeks didn't believe in such. All their magnitudes were real and positive. Not even $0$ was considered a quantity.
Thus, the theorem tells you that given two quantities (thought of as positive moduli), say $\epsilon<<<<\cdots<<M,$ where I have used the notation $<<<<\cdots<<$ to signify that the difference $M-\epsilon$ may be as large as you please, then we can aggregate sufficiently many $\epsilon$'s in order to exceed $M,$ thus the claimed existence of a positive integer (called a number, arithmos, by these Greeks), say $N,$ such that $$N\epsilon>M.$$
This claim essentially says that we cannot have infinite quantities, or in other terms, infinitesimal quantities. However, we can discard this axiom and allow such quantities; then we have an example of what is called a non-archimedean field. Such are used in alternative constructions of standard objects, for example nonstandard analysis, or in the development of $p$-adic numbers.
In sum, a definition or theorem or mathematical statement doesn't claim to exhaust some class of objects. Its hypothesis or claims apply to precisely the types of objects it is interested in applying to. Here, we're concerned with positive magnitudes; we don't care a fig about any other thing the axiom/theorem applies to.


Magento 500 server error because of Zend

Question: I cannot access front or back end of my Magento site. I was in Magento Connect and tried upgrading the Zend framework, but as it was attempting to do so, the browser crashed. I tried to go back in but I'm getting a 500 server error on both ends.
The error messages are:
Warning: include(Zend/Log.php): failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94

Warning: include(Zend/Log.php): failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94

Warning: include(): Failed opening 'Zend/Log.php' for inclusion (include_path='/app/code/local:/app/code/community:/app/code/core:/lib:.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') in /lib/Varien/Autoload.php on line 94

Fatal error: Class 'Zend_Log' not found in /app/code/core/Mage/Core/functions.php on line 247

How can I get it working again?
After trying possible fix, I now get this error message:
**Warning: include(Zend/Cache.php): failed to open stream: No such file or directory  in /lib/Varien/Autoload.php on line 94
#0 /lib/Varien/Autoload.php(94): mageCoreErrorHandler(2, 'include(Zend/Ca...', '/...', 94, Array)
#1 /lib/Varien/Autoload.php(94): Varien_Autoload::autoload()
#2 [internal function]: Varien_Autoload->autoload('Zend_Cache')
#3 /app/code/core/Mage/Core/Model/Cache.php(135): spl_autoload_call('Zend_Cache')
#4 /app/code/core/Mage/Core/Model/Config.php(1354): Mage_Core_Model_Cache->__construct(Array)
#5 /app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/cache', Array)
#6 /app/code/core/Mage/Core/Model/App.php(412): Mage::getModel('core/cache', Array)
#7 /app/code/core/Mage/Core/Model/App.php(306): Mage_Core_Model_App->_initCache(Array)
#8 /app/code/core/Mage/Core/Model/App.php(348): Mage_Core_Model_App->baseInit(Array)
#9 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /index.php(83): Mage::run('', 'store')
#11 {main}**

Answer: You're error isn't necessarily due to the Zend Framework.   If you look at the lines PHP is complaining about
#File: app/code/core/Mage/Core/functions.php
function mageCoreErrorHandler($errno, $errstr, $errfile, $errline){
    //...
    if (Mage::getIsDeveloperMode()) {
        throw new Exception($errorMessage);
    } else {
        Mage::log($errorMessage, Zend_Log::ERR);
    }
}

You'll see the error is happening in Magento's custom PHP error handler.  i.e. -- PHP is trying to report an error of some sort, and Magento's custom error handling code reaches this line
Mage::log($errorMessage, Zend_Log::ERR);

and the halts, because the Zend_Log::ERR constant hasn't' been defined yet.  This is a long standing bug in the Magento 1 framework for errors that happen early in the bootstrap process.
Two possible fixes here:

Switch Magento into developer mode and instead of logging the error, Magento will throw an exception.  This will let you see the real error message and diagnose the problem.
Temporarily add the following line before the Mage::log call

.
require_once 'lib/Zend/Log.php';
Mage::log($errorMessage, Zend_Log::ERR);

This will include the missing file and let PHP finish its error logging (which should, again, let you see the real error message in the logs and start diagnosing the problem)
Comment: I have revised my original post to show the error messages after putting into developer mode.


Do we need Mass Effect have tags for each installment, or should those tags be synonyms?

Question: I noticed we have tags mass-effect, mass-effect-2, and mass-effect-3. Do we really need a tag for each installment?
Answer: No, we don't.

We have 37 questions tagged with any of those tags. Of those 37, we have

26 questions tagged with just mass-effect
1 question tagged with just mass-effect-2
4 questions tagged with just mass-effect-3

The tag wiki excerpt for mass-effect-3 already says that it should always be used in conjunction with mass-effect.
This leads me to the conclusion that these tags add very little over the general tag.

mass-effect-2 and mass-effect-3 should be synonyms for mass-effect.
Comment: Done. Padding chars!
Comment: @Keen Great work!
Answer: They should be separate tags. They're each for different works that will each have their own questions. The misuse of mass-effect as a franchise tag should end though, as that confuses the first game with the franchise.  I propose a mass-effect-franchise for this purpose.
Synonymizing them into one would be like merging all the individual Star Wars film tags into one. It destroys the correctly fine-grained nature of the tags.
Comment: Should we create a separate 'mass-effect-series' or similar tag?
Comment: @phantom42 I was thinking [tag:mass-effect-franchise] ala [tag:alien-franchise].
Comment: Star Wars only needs separate tags for each film because the volume of questions justifies it, otherwise tagging with the franchise and allowing the context of the question to determine which installment is in question is sufficient.  Lets put it this way - would a tag for each episode of firefly be justified?
Comment: @Tritium21 Is each episode of Firefly a dozen+ hours long?
Comment: That does not really matter.  Its not about the quality of the product or the number of installments, its about volume of questions and the likelihood of experts to be able to answer questions of the tag.  A Mass Effect expert is likely to be able to answer a question from the entire series AND the volume of questions does not justify multiple tags.


Can I finish cooking a pork roast next day after partially cooking it

Question: I will be having 17 people for dinner, and I will serve a pork roast. Can I partially cook it, wait until it cools, wrap it and put it the refrigerator and  finish cooking it the next day?
Comment: I think this question's answer addresses your question: http://cooking.stackexchange.com/questions/16421/how-many-times-is-it-safe-to-reheat-chicken/16425#16425 The danger is exactly the increased time that the food sits between 40 and 140 degrees. WIth the extra cooling/reheating time, it sounds risky. Why can't you cook it the day of?
Comment: What is your motivation for only partially cooking it?  If you have the time, why not fully cook it and then reheat it the next day?
Comment: There is a standard food safety question but I don't have the rep to close anyway.  Have cumulative time between 40 and 140 and there is something about getting it up to 165.
Comment: related : https://cooking.stackexchange.com/q/43428/67 ; https://cooking.stackexchange.com/q/104119/67 ; https://cooking.stackexchange.com/q/54506/67 .  And I could've sworn I had an answer on here recommending that you slice up a roast and place it into warm gravy to reheat it, but I can't find it.
Answer: This is an instance where sous vide really works well.
You can pre-cook your pork roast to 140 for 4 to 6 hours in the sous vide the day before.  Chill in an ice bath (still in the bag that you cook it in) to bring it down to safe temperature quickly, and then into the fridge.
the next day you can sear it in a number of different ways (broiler, on the grill, in cast iron, either whole or cut into chops and sear individually), and that should be plenty of heat to re-heat it nicely.
Comment: 140 C is quite high a temperture for waterbath to reach. (I assume you mean 140 F, but that does not show in your answer.)
Answer: Yes and no. You can't safely half cook it. You'd be pulling it out of the cooking process at exactly the point where you'd made it more attractive to bacteria.
You can, however, fully cook it and reheat it. This is a tiny bit tricky with a pork loin, since the optimal temperature for a pork loin is actually somewhat below the temperature that's really safe. You'd want to cook it to at least 140F, a bit more than is really optimal. The best way to do that would be sous vide, though you can also do it in a slow oven. Other roasts, like a shoulder roast, with more fat, would be more amenable to cooking to a higher, safer temperature.
Cool it down quickly, and refrigerate. Then the next day you can reheat it. There are a number of ways to do this; see Reheating pork loin roast for a party for one example. A different tack would be to preheat the oven to 400F, put your roast in it, and turn off the oven. That would quickly put a nice crust on the outside, while gradually bringing the (already fully cooked) roast up to temperature.
A meat thermometer is highly recommended for this. There are too many variables to do it by time, and you want to avoid both under- and over-cooking.
Answer: I do not recommend partial cooking of any meat.  You risk bacteria growth. Completely cook your meat, and then warm it up again wrapped in foil to maintain juiciness.


Default Clasure Where in Includes Generyc Repository Entity Framework 6.1 Code First c#

Question: I have a generic repository where all the database tables have a column to delete logical. For example:
View my simple database diagram
I need all the queries held by the repository from the Sale table is added to condition negating delete columns, including when the tables (SaleItem, Item, Customer) were included.
[Table("Sale")]
public partial class Sale
{
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
    public Sale()
    {
        SaleItems = new HashSet<SaleItem>();
    }

    public long ID { get; set; }
    public long? CostumerID { get; set; }
    public virtual Costumer Costumer { get; set; }
    public bool Deleted { get; set; }

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
    public virtual ICollection<SaleItem> SaleItems { get; set; }

public class SaleRepository : BaseRepository<Sale>
{
    public async Task<Sale> FindOneAndRelatedAsync(object id)
    {
        return await FindAsync(id,
            (s => s.Costumer),
            (s => s.SaleItems),
            (s => s.SaleItems.Select(si => si.Item))
        );
 }

public class BaseRepository<T> : IBaseRepository<T> where T : class
{
    private string deletedName = "Deleted";
    public async virtual Task<T> FindAsync(object id, params Expression<Func<T, object>>[] includes)
    {
        return await FindAsync(id, false, includes);
    }

    public async virtual Task<T> FindAsync(object id, bool hasDeleted = false, params Expression<Func<T, object>>[] includes)
    {
        var query = DbSet.AsQueryable();

        query = includeRelationships(includes, query);

        query = query.Where(idPredicateExpression(id));

        if (!hasDeleted)
            query = query.Where(deletedPredicateExpression());

        return await query.FirstOrDefaultAsync();
    }

    protected Expression<Func<T, bool>> deletedPredicateExpression()
    {
        return columnPredicateExpression(deletedName, false);
    }

    protected Expression<Func<T, bool>> columnPredicateExpression(string columnName, object keyword)
    {
        var arg = Expression.Parameter(typeof(T), "p");

        var method = keyword.GetType() == typeof(string) ? typeof(string).GetMethod("Contains", new[] { typeof(string) }) : keyword.GetType().GetMethod("Equals", new[] { keyword.GetType() });

        var body = Expression.Call(
            Expression.Property(arg, columnName),
            method,
            Expression.Constant(keyword));

        return Expression.Lambda<Func<T, bool>>(body, arg);
    }

    protected IQueryable<T> includeRelationships(Expression<Func<T, object>>[] includes, IQueryable<T> query)
    {
        if (includes != null)
        {
            query = includes.Aggregate(query, (current, include) => current.Include(include));
        }

        return query;
    }

As can be seen in the above code, I can create an Expression to add the condition WHERE somene the Sale entity with the method deletedPredicateExpression(). It works perfectly. But the entities that are included by includeRelationships() method (SaleItem, Item and Costumer) must include the condition WHERE.
When the relationship is 1:n, as the Costumer entity. I can perform insert the code below.
    protected IQueryable<T> includeRelationships(Expression<Func<T, object>>[] includes, IQueryable<T> query)
    {
        if (includes != null)
        {
            int i = 0;
            query = includes.Aggregate(query, (current, include) => current.Include(include));
            foreach (var include in includes)
            {
                    var test = test(include.Body.Type);
                    query = query.Where(test).AsQueryable();
            }

        }

        return query;
    }

    protected Expression<Func<T, bool>> test(Type typeEntity)
    {
        string columnName = typeEntity.Name +"." + deletedName;

            string[] props = columnName.Split('.');
            Type type = typeof(T);
            ParameterExpression arg = Expression.Parameter(type, "m");
            Expression expr = arg;
            foreach (string prop in props)
            {
                // use reflection (not ComponentModel) to mirror LINQ
                PropertyInfo pi = type.GetProperty(prop);
                expr = Expression.Property(expr, pi);
                type = pi.PropertyType;
            }
            var val1 = Expression.Constant(false);
            Expression e1 = Expression.Equal(expr, val1);
            Type delegateType = typeof(Func<,>).MakeGenericType(typeof(T), type);
            return (Expression<Func<T, bool>>)Expression.Lambda(delegateType, e1, arg);
    }

If my relationship is N:N or when I need to access an object inside a collection as in entity Item that is below SaleItems can not include the clause WHERE because it does not have the property Deleted of the object SaleItems or Item for example.
Exist a way to filter all the entities to always generate a query considering a condition in the case WHERE Deleted  == 0 by default?
Answer: Create a base entity that include Delete status property. Then, inherit all your class from this base entity. So, you can filter anywhere with Where.
public abstract class BaseEntity
{
    public BaseEntity()
    {
        IsDelete = false;
    }
    [Key]
    public int Id { get; set; }

   public bool IsDelete { get; set; }
}

public class Yourclass : BaseEntity // Sale class or somethingelse
{
  //
}

And you need to use this BaseEntity class as main class instead of class for generic T class.
public class BaseRepository<T> : IBaseRepository<T> where T : BaseEntity
{
   public T GetById(int id)
    {
        return this.Entities.Single(item => item.Id == id && !item.IsDelete);

    }
    // implement your methods here by using IsDelete property in `Where`          condition.
}

Using this BaseEntity as main entity class, you can filter all classes by delete status even in collection.


Water hammer and expansion waves

Question: I was thinking about the relationship between water hammer and expansion waves. Pressure seems to drop across a surge wave travelling at the speed of sound in water hammer (after the fluid has been initially brought to rest by a compression). Pressure also drops across an expansion wave (e.g. a rarefaction fan). I know they are not the same, but my question is - "is the wave travelling at the speed of sound in water hammer more like an expansion rather than a compression (or is it the other way round)?"
Answer: The simple answer is both - flow never really cares about travelling "out of a high density" or "into a low density" zone, it just travels from areas where there are density differentials.  However, your intuition is right - and I personally consider it more of an expansion wave than a compression wave.  The reasons are complicated, as you would imagine for a question that remained unanswered for two years.  The short version is you consider the expansion of the pipe in the first half while the fluid compresses.  In the second half, when the pipe compresses back to it's unstressed state, the fluid expands backwards to the source to refill the reservoir from whence it started flowing.  Sometimes that's a pump, not a reservoir, which can cause additional problems.
A source I have has a rigid mathematical model to water hammer, as well as a few other situations.  For more, see Analysis and Design of Energy Systems, 3rd Edition, by BK Hodge and Robert P Taylor - ISBN 978-0135259733, specifically chapter 7.  The simplest model is a water filled tank, with water at height h, connected via a long pipe of length l, diameter D, with a valve at the end of the pipe.  We begin with fluid in the pipe, and open the valve.  Working through the continuum mechanics, we find the equation for the fluid beginning to flow out through the valve follows along the lines of:
$$-\frac{\partial H}{\partial x} - \left(\frac{\partial z}{\partial x} = 0 \right) -\frac{fV|V|}{2gD} = \frac{1}{g}\frac{dV}{dt}$$
Note the weight per volume, $\gamma$ is treated as a constant - this is considered a rigid body of water.  Integrating across the pipe, pretending $f$ (the friction factor) is constant, and dividing the pressure by the specific weight to treat this as fluid head, we wind up with:
$$H-\frac{fL}{D}\frac{V^2}{2g} = \frac{L}{g}\frac{dV}{dt}$$
A simple differential equation to solve for flow development velocity $V$ with respect to time.  For closing the valve, the water is treated as compressible, but so is the pipe and as a result the pipe bulges with stored potential energy.  As a result, the speed of water hammer is a combination of the speed of sound of water and the pipe, and slightly less than the speed of sound in water:
$$ a =\left(\frac{Kg}{\rho(1+(K/E)c)}\right)^\frac{1}{2}$$
where $K$ is the bulk modulus of the fluid, $E$ is the modulus of the pipe, and $c$ is an empirical factor that varies from 0 to $\infty$, but is on the order of the ratio of the Diameter of the pipe to the pipe wall thickness.  Note that plastic and flexible pipes will have a slower hammer speed because of a higher $(K/E)$ ratio.  The water hammer is modeled with a second wave equation coupled to the original:
$$\frac{a^2}{g}\frac{\partial V}{\partial x} + \frac{\partial H}{\partial t} = 0$$
The source goes on with methods of using these equations together to get useful finite-element based numerical results.  In this, water is returned back to the original tank, the pipe compresses excessively, and as the pipe returns back to the original unstressed state, the liquid fills back up under pressure from the reservoir and the second cycle repeats, dampened by the friction factor only.  As such, the main results to be seen is that:

Depending upon what you look at, the fluid compresses, followed by the pipe compressing
Or ... the pipe expands from a low stress state to a high stress state, followed by the fluid expanding to form a high head.
Both are valid ways to look at it, but the second seems more intuitive, and captures the main point of the danger of water hammer - it will damage your pipes if you fail to account for it!

Water hammer and expansion waves


How to colour vertices as a grid (like wireframe mode) using shaders?

Question: I've created a plane with six vertices per square that form a terrain.
I colour each vertex using the terrain height value in the pixel shader.
I'm looking for a way to colour pixels between vertexes black, while keeping everything else the same to create a grid effect. The same effect you get from wireframe mode, except for the diagonal line, and the transparent part should be the normal colour.
My terrain, and how it looks in wireframe mode:

How would one go about doing this in pixel shader, or otherwise?
Comment: Maybe draw the (black) wireframe on top of (after) the terrain?
Answer: See "Solid Wireframe" - NVIDIA paper from a few years ago.
The idea is basically this: include a geometry shader that generates barycentric coordinates as a varying for each vertex. In your fragment / pixel shader, check the value of the bary components. If they are below a certain threshold, you color the pixel however you'd like your wireframe to be colored. Otherwise, light it as you normally would.
Given a face with vertices A,B,C, you'd generate barycentric values of:

A: 1,0,0
B: 0,1,0
C: 0,0,1

In your fragment shader, see if any component of the bary for that fragment is less than, say, 0.1. If so, it means that it's close to one of the edges of the face. (Which component is below the threshold will also tell you which edge, if you want to get fancy.)
I'll see if I can find a link and update here in a few.
Note that the paper is also ~10 years old. There are ways to get bary coordinates without the geometry shader these days in some situations, and I'm sure there are other workarounds. (Geometry shaders have their place, but are not the greatest friend of performance.)
Also, while geom shaders come with a perf hit, they're significantly faster than a second pass to draw a wireframe. Drawing in wireframe mode in GL (or DX) carries a significant performance penalty because you're asking the rasterizer to simulate Bresenham's line algorithm. That's not how rasterizers work, and it is freaking slow.
This approach also solves any z-fighting issues that you may encounter with two passes.
If your mesh were a single triangle, you could skip the geometry shader and just pack the needed values into a vertex buffer. But, since vertices are shared between faces in any model other than a single triangle, things get a little complicated.
Or, for fun: do this as a post processing step. Look for high ddx()/ddy() (or dFdx()/dFdy(), depending on your API) values in your fragment shader. That also lets you make some interesting effects.
Answer: Given that you have a vertex buffer containing all the vertices of your grid, make an index buffer that utilizes the vertex buffer but instead of making groups of 3 for triangles, use pairs of 2 for line segments. This will be a Line List and should contain all the pairs that make up the squares of the grid. You could generate this list automatically in your program.
Rough algorithm for rendering:

Render your terrain as normal
Switch your primitive topology to Line List
Assign the new index buffer
Disable Depth Culling (or add a small height value to each point in the   vertex shader so the grid appears above the terrain)
Render the Line List

This should produce the effect you are looking for of the terrain drawn and shaded with a square grid on top of it. You will need to put a switch (via a constant buffer) in your pixel shader that tells it when it is rendering the grid so it can draw the grid black instead of using the height values.


how can i conect a lipo charger to a teensy 4.0?

Question: I have the battery charger product https://www.adafruit.com/product/2124
and a teensy 4.0, that I would like to use to power it.
what, if any pin would I connect from bat, to the teensy?
Its my understanding that the Lion backpack is a voltage regulator, and thats it. it takes Vin, ground, and Vout.
I understand the 5v output goes to the 5volt pin of the teensy.
the gnd goes to gnd. should Vin go someplace? Or should I leave it off?
Please assist.
Comment: the charger does not have a Vin pin
Answer: The output voltage of the charger board is marked with BAT. You should connect it to the Vin pin of the Teensy, which then will convert the batteries 3.7-4.2V down to 3.3V.
Of course you need to connect the grounds of the charger board and the Teensy (on the charger board ground is marked with G).
The 5V pin on the charger board is no output. The board does not give you 5V. This is actually the pin for the charging voltage, which is 5V. Here it depends on how you want to charge the battery. If you use an external source, you can simply connect it's 5V to the board. If you want to use the USB jack of the Teensy, you can connect the boards 5V to the Teensys 5V. But: Be sure to cut the little trace between Vin and VUSB/5V at the back of the Teensy. You don't want to connect the battery voltage with an USB power source.
Comment: I was going back and forth on that. I didnt want to smoke my teensy experimenting, and I couldnt find clear statements on that. I hooked it up that way, and it totaly worked though. A side note, the teensy has a tutorial on cutting vin away from a pad connected to VUSB. VUSB has a through hole via though. I cut the trace between the via and the VUSB pad, giving me a larger pad to solder to. I would have preferred a via for VIN, but using 2 pads seems to make a pretty solid connection.


Centrifugal force misconceptions

Question: I am a high school student and I want to know that how centrifugation technique really separates substances according to their molecular masses? In many books and sites, it is written that it is because of the centrifugal force which is much higher on particles of high molecular mass than on lower ones but in reality I know that there is no centrifugal force, and I am not able to think intuitively how all things are happening, please give me an insight?
Comment: @Mia I challenge the concept of 'exists in a rotating reference frame'. I have two classes of reasons to dismiss the concept of 'exists in a rotating reference frame'. Class 1: it is a purported explanation that is more complicated than the thing it purports to explain. Class 2: Both in newtonian mechanics and in GR the concept of 'exists in a rotating reference frame' is redundant. In terms of GR: leave out the concept of 'exists in a rotating reference frame' and GR is still just as powerful. It may be that in your perception it's not redundant. That can be discussed.
Comment: Re class 1: It's not more complicated in all cases.  There are plenty of situations in classical mechanics where using a rotating reference frame is a more elegant way to capture the dynamics.  Re class 2: I don't see what the point of nitpicking the definition of "exists" is.  It's an observable phenomenon.
Comment: This would be an advanced topic to learn in high school, but it's worth pointing out that centrifugal forces do exist in rotating reference frames.  So in the reference frame of a particle going in a circle, there is a centrifugal force pushing it away from the center, creating a buoyant force that separates more and less dense materials.
Comment: @Mia As to observable phenomenon: let me make a comparison: Einstein 1905 discussed the magnet-and-coil observation, and that a Lorentz Aether theory gives two distinct explanations for the induced current, depending on whether the coil or the magnet is assumed to be stationary. Observed induced current is the same either way. The distinction made in terms of a Lorentz Aether theory is not inherent in the phenomena. Lesson learned: to have *two* distinct explanations for a *single* observation is not a good idea. Single explanation: we infer the existence of inertia.
Comment: @Mia I endorse the stackexchange policy that the comment section is not for protracted discussion. I'm eager to discuss this subject, but that has to happen somewhere else; the comment section is not the place for it.
Answer: Start with visualizing a centrifuge for drying clothes.
To sustain circumnavigating motion a centripetal force must be provided. In the case of a clothes centrifuge the walls of the drum provide the required centripetal force.
There is a fairly strong adhesion between water and the fibers of the clothes. (I'm talking natural fibers here; cotton, linnen, wool, none of that plastic rubbish.)
If you hang a soaking wet piece of textile on a clothesline some of the water will drip out, but that dripping stops when the textile is still pretty wet. In other words: pulling 1 G of acceleration does very little.
When the clothes are in the centrifuge drum, and the drum is spinning fast: for the water it is now up to the forces of adhesion to provide the required centripetal force. Given the radius of the centrifuge drum and the rate of rotation you can work out how many G's the centrifuge is pulling.
The walls of the centrifuge drum are perforated, so the water can exit the drum.

Generally when people say something like: 'so-and-so is being forced outward by centrifugal force' what they are referring is a situation where not enough centripetal force is provided to sustain a particular radius of circumnavigating motion.
A clothes centrifuge: the faster it is spinning the stronger the required centripetal force. When the required centripetal force exceeds the adhesion force the water migrates away from the center of rotation.
Comment: Ok! I understood it, so, what actually exists is inertia and when we say that centrifugal force is pulling it outwards ,in inertial frame it means that not enough centripetal force is provided and actually it  sustain the position (if it was initially at rest) but from the rotating frame say a centrifuge machine it appears to go radially outward w.r.t the test tube.
Answer: A centrifuge separates dense molecules from less dense molecules in the following manner.
1.The centrifuge turns with a specific amount of centrifugal force, say "y".
2. Heavier masses end up at the furthest point (or area) away from the axis of rotation (perpendicular to the floor and in centre of centrifuge)
No.2 occurs because heavier masses require a higher centripetal force. Here is the mathematical reason for it.
You see, centripetal force is given by m * centripetal acceleration. The only way to increase the centripetal force is to increase mass (centripetal acceleration is a constant value provided by the power level of the centrifuge).
Therefore, the heavier the mass = the greater centripetal force needed. Now we also know that centripetal force is the force that pulls something inward in a centrifuge.
However the "y" centripetal force is not enough to provide for the centripetal force required by heavier mass. Therefore, there is not enough inward pull for the heavier mass and so, the heavier mass stays the furthest away in the test tube from the axis of rotation. This is how centrifuges work in separating substances of different densities.

Centrifugal force misconceptions


Coefficient meaning in DWT

Question: I understand that approximate and detail coefficient represent the different signal bands. But what do the values mean and how are they used?
Comment: @LaurentDuval I was watching the mathworks video on DWT mathworks.com/videos/understanding-wavelets-part-3-an-example-application-of-the-discrete-wavelet-transform-121284.html. When applying it my own data, I noticed the resulting arrays are of shorter length than the original signal. So I am wondering if the values are narrowbanded signals or represent something else.
Comment: Answers to your question may fill entire books. Could you please focus a little more, sharing your sources and motivations for understanding the DWT?
Comment: The shorter length is often due to downsampling
Comment: Can you please vote or validate answers?
Answer: DWTs turn a signal into a list of coefficients, whose combined sizes are equal to or greater than the signal length. Coefficients are grouped in packs called subbands. Each subband gathers coefficients resulting from some band-pass filtering, followed by a subsampling.
They are not exactly narrow-band signals, but instead projections onto embedded subspaces. The "narrowband" signal for each subband could be recovered by inverse transforming those coefficients only.
Answer: Every number in a Discrete Wavelet Decomposition is an amplitude of a corresponding wavelet. Each of them is localized in time and has its own shape. The original signal is a sum of these wavelets.

Coefficient meaning in DWT


How to set a bluetooth device as my playback device without going to the device menu?

Question: I have some speakers that I would like to easily connect to when I arrive home and I'm already playing something on my device. Is there a way to easily set the device, when I arrive? Probably an automation script?
Answer: Shortcuts and automation are perfect for these kind of tasks. You first would need to create a shortcut that does all these actions and then using automation to trigger this shortcut.
The shortcut must contain the follwoing elements:

turn the bluetooth on
wait a couple seconds
set the playback destination to your device (it must be connected and on, otherwise it won't appear on the list)

After the shortcut is set, set the personal automation task to run the shortcut when you arrive to the place.


Can we use super-capacitor/s as a Vin input of the voltage regulator instead of DC power supply?

Question: I do not want to use a battery in my circuit. My circuit would contain some charged super-capacitors and voltage regulators.
Answer: You can, but there some some gotchas that you need to be aware of.

Supercaps are rated for low voltages, often 2.5-2.7V. Any you find rated higher than that are either not really supercaps, or are multiple supercaps in series in the same package. If you put them in series yourself, you'll need to do some analysis to determine whether balancing is necessary. Balancing can drastically increase your leakage.
Cell relaxation is a real phenomena. If you charge a supercap up to its rated voltage, and remove power, with no load, it will discharge to ~60-70% of its rated voltage in less than an hour. This effect can be minimized by holding the cap at the charge voltage for a period of time.
Leakage current can be significant. Check the datasheet of your caps to see what the leakage current is, and under what test conditions it was measured.
Comment: Thank you. That makes sense. I want to use those charged super-capacitors for low power switching purpose.
Answer: You can. You will have to make sure that you charge this supercap correctly. Although it's not a battery, some rules apply. Mainly you have to control/limit charge current.
Comment: How can I control/limit charge current? My planned Circuit follows like this Super-capacitor, Voltage regulator, Op-amp/Transistor for switching, LEDs.
Comment: @Mat_python Gregory is talking about charging the capacitor, not discharging it. That will probably work fine for discharging. But supercapacitors start "flat", unlike batteries, so you're not going to get any power out of one without charging it first.


Bootable USB disk Ubuntu 18.04 gives FreeDOS message

Question: I created bootable USB flash drive using the downloaded Ubuntu 18.04.2 ISO file and Rufus.
I booted up the HP Proliant. Instead of Ubuntu starting, I get a DOS message about FreeDos and the C:> prompt.
The same occurs if I try to run it on my HP Laptop
Comment: Please recreate the flash drive, make sure the second field in Rufus shows _Disk or ISO image_.
Comment: Thanks title is wrong due to a misunderstanding. It's not the bootable USB disk that gives that message, it's because it's not booting that the already installed FreeDOS gives that message.
Comment: Possible duplicate of [How to change boot priority?](https://askubuntu.com/questions/208417/how-to-change-boot-priority)
Answer: Rufus developer here.
Most likely, you are seeing this because you forgot to properly select the ISO in Rufus or changed the Boot selection field to FreeDOS after you picked the file.
You need to make sure Boot selection says something like ubuntu-19.04-desktop-amd64.iso (or whatever the name of the ISO you selected is) before you press START. If you don't see the name of your ISO when you press START, it means that you haven't picked the proper option to create a bootable Ubuntu drive.


hostapd on two interfaces (two configuration files)

Question: I have two wireless interfaces and I want to run different APs on each. (Neither hardware supports multiple SSIDs.)
I have a .conf file for each interface. How do I get hostapd to use them both automatically?
This works fine:
# hostapd -dd /etd/hostapd/hostapd.wlan0.conf /etc/hostapd/hostapd.wlan1.conf

The problem is getting it to work automatically.
One claim is to set in /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.wlan0.conf /etc/hostapd/hostapd.wlan1.conf"

but this doesn't work because the whole string is interpreted as being one file -- which doesn't exist.
I see this is used by /usr/lib/systemd/system/hostapd.service as
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

However, I also see something called /usr/lib/systemd/system/hostapd@.service which does something different:
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.%i.pid $DAEMON_OPTS /etc/hostapd/%i.conf

(what does %i mean?)
However, systemctl seems only to know about hostapd and not about hostapd@.
Answer: You were almost there at the end of the question. %i is used for instanced services. Here's an excerpt of the role of instances described in the systemd.unit(5):

Unit files can be parameterized by a single argument called the
"instance name". The unit is then constructed based on a "template
file" which serves as the definition of multiple services or other
units. A template unit must have a single "@" at the end of the name
(right before the type suffix). The name of the full unit is formed by
inserting the instance name between "@" and the unit type suffix. In
the unit file itself, the instance parameter may be referred to using
"%i" and other specifiers, see below.

Or in the specifiers list:

├─────────┼───────────────┼───────────────────────────────────────────────────┤
│         │               │For instantiated units this is the string between  │
│"%i"     │Instance name  │the first "@" character and the type suffix. Empty │
│         │               │for non-instantiated units.                        │
├─────────┼───────────────┼───────────────────────────────────────────────────┤

Using instanced services will run one independent hostapd daemon per interface. This allows for example to alter or kill one instance with the assurance the other instance, and thus the other interface won't be affected.
You can do this for using instances:

revert to default settings everywhere and disable and stop hostapd.service

rename your configurations to accommodate an unmodified hostapd instanced service which expects with %i.conf only the interface name followed by .conf:
mv -i /etd/hostapd/hostapd.wlan0.conf /etd/hostapd/wlan0.conf
mv -i /etd/hostapd/hostapd.wlan1.conf /etd/hostapd/wlan1.conf

use the instanced version of the hostapd service, distinguished by the @ character and which is configured differently from the normal instance as already written in OP. Once per interface:
systemctl enable --now hostapd@wlan0
systemctl enable --now hostapd@wlan1

In the end the daemon will be running twice as these:
/usr/sbin/hostapd -B -P /run/hostapd.wlan0.pid   /etc/hostapd/wlan0.conf
/usr/sbin/hostapd -B -P /run/hostapd.wlan1.pid   /etc/hostapd/wlan1.conf

(unless there was something in $DAEMON_OPTS).
Comment: I note that the config file name _must_ be the interface name.
Answer: I have edited /usr/lib/systemd/system/hostapd.service to hard-code the two configuration files.
After editing it appears to be necessary to run
# systemctl daemon-reload

Seems like an unpleasant hack, but it works.
Comment: I believe the proper file to edit (or create) here would be **/etc/systemd/system**/hostapd.service, as the `/usr/lib/systemd/` one should be under the control of a package and your changes could be lost during an update.


Why is the left button of a mouse the primary button by default?

Question: By default, most computer users use the left button of the mouse in order to open a file or to perform other tasks. I know is it up to a user to configure the left or right button as the main button, but why does it default to the left and why do companies like Apple offer single-button mice?
Comment: Because you press things using your index finger, and the left button is where your index finger sits.
Comment: You _primarily_ press with your index finger, and you _also_ press with other fingers. The mouse button supports your primary behavior.
Comment: @JonW but you also presses things using other fingers, not only by index or trigger finger.
Answer: The left-click operation is normally operated by the index (pointing) finger, which is usually dominant (being the most dextrous and sensitive). The left button of a mouse is configured as the primary button by default because that suits the vast majority (~90%) of right-handed users.


BICEP2 experiments

Question: How was the polarization experimentally measured in the BICEP2 experiments and why did they look specifically at B-modes? Why is it implying the existence of gravitational waves and the need to quantize gravity? Moreover, why is it implying inflation as a unique option?
Comment: Hm... well, a good rule of thumb, especially in this case, is that you should be able to ask your core question in the post title, and the question body should be an elaboration of that. "Some questions on BICEP2 experiments" is frankly a bad title, which makes it seem like you have an assortment of unrelated questions. If you can put your main question in the title, and expand on the question body to show how these other things are related to it, this would probably be a much better question. If you can't adequately summarize your question in the title field, it may be too broad.
Comment: Could you edit your post to ask one specific question please? The others you can post separately, although check our existing BICEP2 questions to make sure they're not duplicates.
Comment: The problem is that they are all connected and I prefer to get a coherent answer which connects between them. I already checked for duplicates but found none.
Answer: I can answer partially to your questions.
How do we measure polarisation ?
They measured the so-called $Q$ and $U$ Stokes parameters. There are four Stokes parameters : $I$, $Q$, $U$, and $V$. $I$ is the intensity, that we already know a lot about (temperature), then $Q$ and $U$ are linear polarization along axis that are tilted with an angle of 45° with respect to each other, and V describe the circular polarization. There is no physical phenomena to create circular polarisation in the CMB, that is why we ignore it and only consider $Q$ and $U$ (maybe $V$ is still measured for calibration or whatever but it is near zero). Wikipedia
Why do we look specifically at $B$ modes ?
The $Q$ and $U$ parameters can be easy to measure experimentally, but are not very handy on a theoretical point of vue since they depend on the system of coordinates that you use. What is more interesting is the $E$ and $B$ modes of the polarisation. Given a $Q$ and $U$ map, you can decompose the polarisation into $E$ and $B$ modes (it can be a tricky problem however when you have a lot of pixels or some borders).
The $E$ modes are often referred as the "gradient" part of the polarisation, while the $B$ mode are the "curl". The thing is that $B$ modes can only be created with tensorial perturbation (i.e. gravitational waves), and not scalar perturbation (temperature).
Last, I don't think observing $B$ modes has for only implication that the inflation is the only possible theory. You can always find other fancy theories that would produce the same signal. But those are generally more complicated and less convincing in general. This is why people consider that observing $B$ modes is a solid hint for inflation.
Answer: Here is the link to the paper.
This is a detector at the south pole with a telescope focusing the cosmic background radiation (CMB), on a focal plane equipped with incident energy sensitive detectors, the signal going to a data acquisition system. All the system is kept at 4 kelvin because the incident CMB is very very low frequency: a black body radiation system of temperature 2.7 kelvin.
It seems that the detectors in the focal plane are paired

Changes in the power incident on this island were detected
using a transition edge sensor (TES). There was an 8x8 array
of pixels on each tile, and four such tiles were combined
to form the complete focal plane unit. There were thus, in
principle, 256 dual-polarization pixels in the focal plane for
a total of 512 detectors,

. . .

The focal plane was cooled to 270 mK by a closed
cycle three-stage sorption refrigerator.

In section 4.1

In the next step the sum and difference of each detector
pair is taken, the pair-sum being ultimately used to form maps
of temperature anisotropy, and the pair-difference to measure
polarization. Each half-scan is then subjected to a third order
polynomial filtering.

This says that it is the relative difference between adjacent temperature detectors that will give the information on polarization. These transition edge detectors use superconductivity to attain the sensitivity to polarization.
From the FAQ of the experiment

What is B-mode polarization and how is it generated by inflation?
Measuring the polarization of the Cosmic Microwave Background at different points on the sky determines a direction and polarized intensity (the polarized intensity of the CMB is less than 1/1,000,000 its total brightness). This can be visualized as a map of little line segments at every spot on the sky, the patterns of which we analyze. B-mode polarization is essentially the swirly part of that pattern (known mathematically as the 'curl'). For the density fluctuations that generate most of the polarization of the CMB this part of the primordial pattern is exactly zero.
[This is because density flows in the early universe go into or out of dense regions, and the polarization lines up with these flows in a way that doesn't swirl, producing only so-called E-mode polarization. To generate a B-mode pattern in the early universe you need gravitational waves.]
Inflation magnifies quantum fluctuations, which exist even in vacuum. The quantum fluctuations in the inflation field itself ("inflaton") become the density fluctuations seen in the CMB and at much later times in galaxy distributions. During inflation, the quantum fluctuations in gravity ("graviton") become long wavelength gravitational waves that produced the B-mode we see.

This is exciting because it is a first detection of an imprint of the graviton. To have gravitons, gravity must be quantized. What the result tells us is that the approximate field theoretical models used for the first instances after the Big Bang, which assume quantization of gravity are on the right path, which means gravity has to be quantized.
This observation excludes models that do not have this high intensity gravitational fields that the Big Bang standard cosmology has. I suppose theorists with different theories will be scrambling to fit the data.
In this blog post a good discussion of the results is given by prof. Liam McAllister.
Comment: "During inflation, the quantum fluctuations in gravity ("graviton") become long wavelength gravitational waves that produced the B-mode we see." Does that mean that quantum gravitational waves were created during inflation, and put to large scales because of inflation ? Therefore, the gravitational waves were still present when the CMB was released, imprinting the polarisation ? I was confused by that. Does that also mean that primordial gravity waves are still existing today, but we can't see them because they have waayyy to small amplitude ?

BICEP2 experiments


unable to launch R or reinstall R due to missing libblas.so.3gf

Question: I've run following command:
sudo apt-get install r-base

and I got:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:

then run
sudo -i R

but it shows:
/usr/lib/R/bin/exec/R: error while loading shared libraries:
 libblas.so.3gf: cannot open shared object file: No such file or directory

Answer: Before the steps
sudo apt-get purge r-base
If your are in 14.04:

sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'

gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9

gpg -a --export E084DAB9 | sudo apt-key add -

sudo apt-get update

sudo apt-get -y install r-base

If you are in 16.04

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'

sudo apt-get update

sudo apt-get install r-base
Answer: libblas.so.3gf is provided by the package revolution-mkl (REvolution Computing high-performance numeric libraries for R) so install it. Run the following commands and comment if they give any error messages.
sudo apt update
sudo apt upgrade
sudo apt install r-base-core r-revolution-core revolution-mkl


Is there a way to make a very strong pickaxe?

Question: In my Minecraft Xbox world, I am trying to make the best pickaxe in the game. I want mending, fortune 3, Efficiency 5, and unbreaking 3. I have tried many different ways to make it, but it always says too expensive on my anvil. Is it possible?
Comment: Yes. It's *possible*, it just depends on how you want to achieve that. The `minecraft-console` tag makes me assume you are willing to do this through the use of commands?
Comment: @Ben I want to say the tag pertains to the console version of Minecraft. As far as I know, the "console commands" don't exist in the gaming console versions.
Comment: They don't exist
Comment: ohh... My mistake. Thought that meant the use of the commands, not referring to the console version of the game.
Comment: I don't know if xbox behaves same as PC version, but if your anviling is too expensive, just rename the pickaxe, as it will reset the anviling cost of exp. It works at least for repairs. And ... I think you should consider to make few specialized tools instead of one for everything.
Comment: I will consider it and will try naming it
Answer: Well, you need to have enough XP (killing mobs, mining ore, smelting ore, etc.), and you will also need Lapis Lazuli in order to make better items at an enchanting table. Using book shelves at least a block space away from the enchanting table (with nothing in the way, no torches, nothing) will power it more. You might also want to find enchanting books, which can be found by fishing, or by searching chests underground (more chances of finding it in strongholds). If you want to use an enchanting book use an anvil to combine the book with your tool. The strongest type of pickaxe is the diamond pickaxe, which can be crafted by diamonds. Diamonds can be found deep underground starting below layer 16 (best chance in layer 11). It can only be mined with  at least an iron pickaxe.
Comment: I have the bookshelves and i can get levels by using my skeleton mob grinder but after i have all the books I need when i try to add them to a brand new pickaxe  i can add a few but it says Too Expansive. On my current pickaxe which is still pretty good i have mending efficiency V  fortune 2. i didn't repair it at all, besides mending.\
Comment: you are wrong it can be mined with a diamond pic too
Comment: @Enderssoilder fixed
Answer: There are several ways to obtain the enchantments you're looking for:

Fishing - this is random, and there is no guarantee that you can find what you're looking for. However with a Fishing rod with Luck of the Sea and Lure, you should hopefully be able to find some useful items.

Grinding - i.e. the usual method. This can be broken down into several steps, or different approaches. However, it can get quite expensive, and you may not be able to achieve this, once the cost gets too high.

Books: Enchanting books is the "cheapest" method, though it will take some time and a lot of resources to craft the books, and enchant them. There is no guarantee you'll be able to get what you want. Once you have 2 books of the same level enchantment (i.e. Unbreaking 1); you can combine them in the anvil to make an enchanted book of a higher level. This can get quite expensive and time consuming however, as to increase the enchantment again, you will need two books of the same level (Unbreaking 2 x 2; which means you will need 4 Unbreaking 1 books. This grows exponentially).
Gold Tools: Using gold tools is another method of "tricking" the enchantment table into giving you better enchantments for your weapons/tools. By placing a Gold Pickaxe in the table first, you have a higher chance of getting more powerful enchantments, which you can then remove from the table, put in your Diamond Pickaxe, and apply an enchantment that way. While less time consuming, this is entirely random, and you will have no control over the enchantments you do receive on the equipment*.

As for the Diamond Pick, you can mine diamonds normally, using either an Iron or Diamond Pickaxe. I would refrain from using a Diamond Pickaxe however - this will incur a cost to repair, and may get too expensive to enchant. Iron is fairly common and inexpensive, and will do the job well enough until you collect the resources for enchanting your Diamond Pick. Diamonds can be found around levels 16 to 5

*There is a belief that the "enchantment language" can be translated, to identify which enchantments are currently on offer. However, I personally do not believe this to be true.
Comment: The enchantment language is not true. It's basically randomised sentences. You cannot predict what you're going to get by decoding the language. But you can mod minecraft to tell you what you're going to get.
Comment: @Bradman175 Yes, I stated so, and provided proof of that to avoid people going down that rabbit hole. Additionally, since this is on console, mods cannot be applied.
Comment: On Xbox, it will show you the enchantment when you hover over an option.
Comment: I have everything i need to make it but the anvil level cap (40) is stopping me from combining them (fortune 3 mending unbreaking 3 efficiency 5) does anyone know a way to get around it?
Comment: If someone has a pickaxe just like the one I want can you tell me the order you combined it in.


How to find out what Graphics Card is present in your system?

Question: Is it possible to find the exact configuration and model of your systems graphics card in Ubuntu 10.10?
Comment: Possible duplicate of [How do I find out the model of my graphics card?](http://askubuntu.com/questions/72766/how-do-i-find-out-the-model-of-my-graphics-card)
Answer: The quickest (non-graphical) way to this is to run lspci | grep VGA in a terminal.
If you want you can also install hardinfo
 on your system, and when you launch it (system benchmark and profiler in the system menu), you can find your graphics information easily.

See this image for an example.
Comment: The problem with lspci is that, it does not show the integrated graphics card! I have one enabled but it wont show up on lspci results! the funny thing is I am using both at  the moment!
Comment: Hi Roland, I have edited out a broken image link (cf. [the previous version](http://askubuntu.com/revisions/12783/4)). It's maybe worth going over your old posts and seeing which other bit.ly links have rotted?
Comment: @E.P. There are a lot of them. If you want to edit them, replace with `http://hostmar.co/software-small` (or `http://hostmar.co/software-large` or `http://hostmar.co/software-banner` as appropriate). See http://meta.askubuntu.com/a/1853/158442 and http://meta.askubuntu.com/a/395/158442
Answer: Use
$ sudo lshw -C display
  *-display
       description: VGA compatible controller
       product: G73 [GeForce 7600 GT]
       vendor: nVidia Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:16 memory:fd000000-fdffffff memory:c0000000-cfffffff memory:fc000000-fcffffff ioport:8c00(size=128) memory:fe7e0000-fe7fffff

Answer: $sudo inxi -F -x
(case sensitive) Will give a nice summary of your system, easy to read. Use the switch -G for just graphics. But it doesn't show video RAM, though one should be able to google the reported graphics for what it 'should' have. I also like the graphical 'hardinfo' which summarizes hwinfo (I think)  will give more but still doesn't report graphics memory that I can see
$sudo dmesg |grep VRAM  will show how much video ram you have.
Also
glxinfo -B

lspci, lshw, hwinfo seem to just report the prefetch (often 512mb) or reports each module in hex format


Is there any alternative to Magic Folder for ubuntu?

Question: Is there any alternative to Magic Folder for ubuntu? Or can we make a folder which will allow us to easily categorize and move files. When we drag a file to the folder it will look at the file extension and place Document files (like doc, xls, ppt, etc) in the Document folder. It places image files like (JPEG, PNG, TIFF, GIF, etc) into the Pictures folder or move the file to the custom specified location.
Answer: Using a shell script could accomplish this easily, all you do is move the following script in the folder you want to be organized:
find <path to folder> -name "*.file_extension" -exec mv {} <target directory> \;

and then put that in your startup applications. I have this and a similar script that removes all files with a certain extension, and cleans up my downloads folder.
Comment: Is this the code of the script and in what extension I have to save the script
Comment: This is the code, and you just save in a .sh file. Make sure to give it permissions by going to properties > permissions > allow file executing as a program.
Comment: I used the code *" -name "*.exe" -exec mv {}  \;"* but it did not move the file but instead create two file *"-name"* & *";"*
Comment: sorry for not being clear, but you don't use the '<' or the '>'. I just use them when I'm saying type what's meant, not what's actually said.
Comment: A shell script running on startup, [using inotify](https://unix.stackexchange.com/a/24955/209677) to monitor for changes on folder should do the job
Answer: pysorter is a python library that can do just that. It runs on Ubuntu and supports custom definitions of filetypes.
It's quite simple to install:
sudo pip install pysorter

Then type
pysorter --help

for a detailed help message.
An example filetypes.py file can be found in the GitHub repository.
Disclaimer: I am the author of pysorter.
Answer: Assuming you want a Private folder that is encrypted when you are not logged in, and decrypted when you are logged in, try the command ecryptfs-setup-private in a terminal. You may need to install ecryptfs-utils first, if it is not already installed.
This will create a new folder called "Private" in your home directory as /home/USERNAME/Private. Anything you put inside (files, folders) will be transparently encrypted. You can use the default file viewer, Nautilus to copy and move files to and from Private folder.
To test you will need at least two user accounts, say user1 and user2.
First, create the Private folder while logged in as user1.
Second, copy some files and folders inside the Private folder. While you are still logged in as user1 you can open, read and edit these folders and files.
Third, logout from the user1 account and login as user2. Try to navigate to the User1's Private folder and verify that the files and folders inside are secure.
When you log back in as user1 the encrypted folder "Private" will be automatically decrypted for you so that you can read and edit flies and folders inside "Private" again.
See the documentation and How to get a encrypted folder with passphrase for additional details.
Comment: I want something that can be easily categorize and move files & folder.
Comment: I am not sure I understand what you mean by easily categorized. I will edit my answer on what the `ecryptfs-setup-private` does.
Answer: I suggest truecrypt
following this link :
sudo add-apt-repository ppa:michael-astrapi/ppa
sudo apt-get update && sudo apt-get install truecrypt

Comment: I want something that can be easily categorize and move files & folder.
Answer: I am not aware of any application in Ubuntu that will do that for you. This can probably be implemented easily using Nautilus extension scripts. For example, right-click on a selected number of files and a context menu "Categorize" could invoke a shell script that parses filenames and filetypes, and moves them to pre-determined user directories.
As far as I know, someone needs to write this.


How can you rotate/turn a crank in barrel organ?

Question: I cannot quite figured it out how can you turn the crank and animate it? I tried parenting it to IK bone so when I move then hand it would rotate alongside but instead it just moves the crank without rotating it.
Answer: Turning the barrel organ handle -

The handle is animated to rotate.
The right arm hand-bone's 'Pole Target' (in Inverse kinematics) is set to the handle so it is forced to stick onto and follow the handle.
Comment: Thanks. Helped alot


Automated backup script for MOSS 2007 and WSS 3.0

Question: I'm looking for example of scripts people are using to automate the backup of MOSS 2007 and WSS 3.0. Would be great to have built in support for various types and schedule of backup.
Answer: Here is a powershell solution - it is pretty flexible and can backup everything you need to restore your site, or just individual site collections.
Answer: We have a very small setup and run a full backup nightly.
One batch script that looks like this:
cd \
cd "Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
# you may hit some permissions problems here. our backup writes to the DB server, and is enacted by an account that has backup access to DB and write access to server
stsadm -o backup -directory \\servername\share\sharepoint_backup\ -backupmethod full

Then to clean up every N days the backups I use BackupCleanup.vbs. Check the comments at the top for testing.
Usage:
cscript.exe BackupCleanUp.vbs <Number of Days> \\servername\share\sharepoint_backup\spbrtoc.xml

Answer: SQL Server has some pretty good tools for that. And a content database backup is pretty useful for most disaster recovery models.


how to calculate cumulative probability for *dependent* events?

Question: The formula for cumulative probability for independent events is easy enough.   Just multiply the probability of the events together.  For example, 2 independent events, each with a probability of 0.80 would have a cumulative probability of 0.8 * 0.8 = 0.64.  But I need to figure out the formula to determine cumulative probability for dependent events.  For example, what is the probability of both Event A and Event B occuring if they are both dependent on each other?  Let's say that Event A has a probability of .80 and Event B has a probability of 0.90.
Answer: In this case you can say that $0.7 \leqslant P(AB) \leqslant 0.8$, and nothing else - for any number $x \in [0.7, 0.8]$ there are events $A$ and $B$ with $P(A) = 0.8$, $P(B) = 0.9$, $P(AB) = x$.
There is also notion of conditional probability - by definition, $P(AB) = P(A) \cdot P(B | A) = P(B) \cdot P(A | B)$.


What is the meaning of the word 'Armageddon' in Revelation 16:16?

Question: The word Armageddon appears only once in New Testament in Revelation 16:16. Is this a Greek word or a Hebrew word? What does this word mean?
Comment: A "good" question on BHB lets readers know that the questioner has done his or her "homework"; IOW, the questioner has attempted to research the question and has encountered a difficulty  or has gotten stuck. In your case, something as simple as including in your question a citation from a dictionary would indicate to readers you've done at least some cursory research. For instance, here's a citation from the Free Dictionary: "from Late Latin Armagedōn, from Greek, from Hebrew har megiddōn, mountain district of Megiddo, in N Palestine, site of various battles in the Old Testament."
Comment: Good question. +1.
Answer: 1.  First the word. "Armageddon" in English is translated from a NT Greek text that shows some variation at this point in the text.  Of the edited versions of the GNT:

Those that have "Har magedon" or "Harmagedon": W&H, UBS4/NA27, UBS5/NA28, NIV, Souter, Nestle 4, SBL, THGNT, Byzantine Text (=R&P), Apostolic Text = OC 1904, Jerome Vulgate
Those that have "Armagedon": F35, TR, Clementine Vulgate.
Those that have "Magedon": Majority Text (Possibly a mistake??)

Here I will assume that the "correct" text is "Harmagedon".
2.  Meaning.  The text of Rev 16:16 explicitly says that this word is Hebrew and thus must be read as "Har magedon" which is obviously, "Mountain of Megiddo".  As any map or geography of Palestine shows, the town of Megiddo is on a plane but its closest mountain is mount Carmel.
3.  Allusion.  The key to understanding the book of Revelation and its symbols is to find the allusion each symbol makes to an OT story.  Here, we are spoilt for choice as there were numerous battles fought at Meggido (Josh 12:21, 17:11, Judges 1:27, 1 Kings 4:12, 9:15, 2 Kings 9:27, 23:30, 1 Chron 7:29, 2 Chron 35:22, Zech 12:11).  However, none of these involved the mountain of Megiddo, namely Carmel.
The most probable allusion is to the incident in 1 Kings 18 where Elijah and Ahab created the great contest of the Gods and the one who answered by fire was the true God.  It was here that the people turned back to God and the prophets of Baal were defeated.  This is a good parallel to the material under the sixth plague of Revelation.
4.  Interpretation - That is the subject of another question.
I note that the Pulpit commentary reaches a similar conclusion:

By the employment of the Hebrew term, attention is called to the
  symbolical nature of the name. Similar cases occur in Revelation 9:11
  and elsewhere in St. John's writings (see on Revelation 9:11). The
  correct reading, Αρμαγεδών, Har-Magedon, signifies "Mountain of
  Megiddo;" the Authorized Version, 'Αρμαγεδών, Armageddon, "City of
  Megiddo." Mount Megiddo possibly refers to Carmel, at the foot of
  which lay the Plain of Megiddo, which was well known to every Jew as a
  gathering place for hostile hosts and as the scene of many battles. It
  is referred to in Zechariah 12:11 as a type of woe, on account of the
  overthrow and death of Josiah having taken place there (2 Kings
  23:29). Ahaziah also died there (2 Kings 9:27); and there also the
  Canaanitish kings were overthrown (Judges 5:19). The name is,
  therefore, indicative of battle and slaughter, and intimates the
  complete overthrow in store for the dragon and the kings of the earth,
  which is described later on (Revelation 19.).
Comment: I'd love to know which codices "Jerome's Vulgate" refer to in contradistinction to something like the Clementine edition. Do you know where one can access 'Jerome's' Vulgate? I understand you're maybe just citing the textual research data from a committee, but just in case you were familiar with one.
Comment: I purchased a copy of Jerome's vulgate, "Biblia Sacra Vulgate" published by Deutsche Bibelgeselschaft.  Available in many places such as  https://www.amazon.com/Biblia-Sacra-Vulgata-Vulgate-Bible/dp/1598561782/ref=sr_1_1?keywords=Vulgate+Jerome&qid=1559684225&s=books&sr=1-1  I am not citing textual apparatus but the actual volumes (in paper) that sit on my shelf.
Answer: The name "Armageddon" comes from the Greek word "Harmagedōn" (Ἁρμαγεδών) which is a transliteration of the Hebrew words "Har-Magedon" (הַר מְגִדּוֹן) meaning the hill of Megiddo, which overlooks a valley with a vast plane.
That valley is traditionally understood as the location of the final battle between the world's nations and God, when Jesus returns as King of Kings, to replace the kingdoms of this world with his own Kingdom of God.
But the battle itself won't be in the valley itself; Armageddon will simply be the staging area for what is to follow.

It is surprising that no one has suggested taking magedon as
  deriving from the secondary sense of the Hebrew gadad that means "to
  gather in troops or bands". The simple way in Hebrew to make a noun
  from a verb is to prefix a ma to the verbal form. Thus we have
  maged, "a place of gathering in troops", and the suffix o, meaning "his", yielding "his place of gathering troops". This is almost
  equivalent to the expressions in vss. 14, 16 — "to gather them (the
  kings and their armies) for the battle on the great day of God
  Almighty" — and would allude to the prophetic expectation of the
  gathering of the nations for judgment — The Expositor's Bible
  Commentary p. 552
Comment: The quotation from Expositor's Bible Commentary is interesting which suggests the word "gadad"  as derived meaning. Probability of this cannot be denied as book of Revelation at many occasion has hidden meanings behind signs, symbols, numbers and words.
Answer: The Greek word is G717 - harmagedōn from Hebrew origin הַר (H2022) and מְגִדּוֹן (H4023).
הַר means mountain/hill and מְגִדּוֹן Megiddo is a location modern term Tel (city) Megiddo located on the southern rim of the plain of Esdraelon 6 miles (10 km) from Mount Carmel and 11 miles (18 km) from Nazareth
Answer: The operative word in Rev 16:16 (about which there is little MSS dispute but see NA28 for details) is Ἁρμαγεδών (Harmagedōn).  According to the same verse, this is a Hebrew word and thus must be read as Har-Magedōn = "mountain of Megiddo".
Note that "Har" = mountain in Hebrew.
How this should be interpreted is another matter entirely.  Ellicott sums up the historical place and a possible spiritual interpretation:

Armageddon is the mountain of Megiddo. It is the high table-land
surrounded by hills which was the great battle-field of the Holy Land.
There the fortunes of dynasties and kingdoms have been decided; there
the cause of liberty has triumphed; there kings fought and fell; there
Gideon and Barak were victorious; there Ahaziah and Josiah were slain.
The old battle-ground becomes the symbol of the decisive struggle. It
is raised in meaning: it is a type, not a locality. The war of
principles, the war of morals, the war of fashion culminates in an
Armageddon. The progress of the spiritual struggle in individual men
must lead in the same way to a mountain of decision, where the
long-wavering heart must take sides, and the set of the character be
determined. "There is no waving of banners and no prancing of horses'
hoofs; the warfare is spiritual, so that there is in sight neither
camp nor foe." It is that conflict which emerges out of various
opinions and diverse principles: "the religious tendencies of the
times" are (as we have been reminded) powers marshalling themselves
for the battle of Armageddon. We must not look for great and startling
signs: the kingdom and the conflict of the kingdom is within and
around us (Luke 17:20-21).
Comment: While your answer to the Q is correct, the location suggested by Ellicott has due to recent research meet with some challenge. Megiddo was a 'convenient' location so as to separate the battle of Armageddon from Gog/Magog. But, this is another discussion for another time.
Answer:
'Then they gathered the kings together to the place that in Hebrew is called Armageddon.'
(Revelation 16:16 NIV)

A prophecy which is variously described in the hebrew scriptures employing the figure of sheaves or gathered wheat (עָמַר aw-mar') in a valley (גַּיְא gah'-ee) for threshing or judgement (דִּין deen) - or in greek ΑΡΜΑΓΕΔΩΝ - Armageddon.
עָמַר - (aw-mar') - gathered wheat
גַּיְא - (gah'-ee) - in a valley
דִּין - (deen) - for judgement
Armageddon.

'... they go out to the kings of the whole world, to gather them for the battle on the great day of God Almighty.'
"Look, I come like a thief!"
"It is done!"
(Revelation 16:14-15, 17 NIV)

Prophetic of a great conflict, precipitating the return of the king, and the culmination of all things.

'Then the iron, the clay, the bronze, the silver and the gold were all broken to pieces and became like chaff on a threshing floor in the summer. The wind swept them away without leaving a trace. But the rock that struck the statue became a huge mountain and filled the whole earth.'
(Daniel 2:35 NIV)

This corresponding to the "It is done!" and the subsequent city :

'And he carried me away in the Spirit to a mountain great and high, and showed me the Holy City, Jerusalem, coming down out of heaven from God.'
'... the Lord God Almighty and the Lamb are its temple.'
'The glory and honor of the nations will be brought into it.'
(Revelation 21:10, 22, 26 NIV)

Micah being eloquent to this mountain and temple and worship :

'In the last days
the mountain of the Lord's temple will be established
as the highest of the mountains;
it will be exalted above the hills,
and peoples will stream to it.'
'Many nations will come and say ...'
"Come, let us go up to the mountain of the Lord,
to the temple of the God of Jacob.
He will teach us his ways,
so that we may walk in his paths."
The law will go out from Zion,
the word of the Lord from Jerusalem.'
(Micah 4:1-2 NIV)

But also eloquent as to the preceeding events :

'But now many nations
are gathered against you.
They say, "Let her be defiled,
let our eyes gloat over Zion!"'
'But they do not know
the thoughts of the Lord;
they do not understand his plan,
that he has gathered them like sheaves to the threshing floor.'
"Rise and thresh, Daughter Zion,
for I will give you horns of iron;
I will give you hooves of bronze,
and you will break to pieces many nations."
(Micah 4:11-13 NIV)

Joel is also eloquent as to these events :

"In those days and at that time,
when I restore the fortunes of Judah and Jerusalem,
I will gather all nations
and bring them down to the Valley of Jehoshaphat."
(Joel 3:1-2 NIV)

Jehoshaphat being the Lord judges.

"Let the nations be roused;
let them advance into the Valley of Jehoshaphat,
for there I will sit
to judge all the nations on every side."
"Swing the sickle,
for the harvest is ripe."
'Multitudes, multitudes
in the valley of decision!
For the day of the Lord is near
in the valley of decision.'
(Joel 3:12-14 NIV)

Etcetera.
Wheat gathered into a valley for threshing.
עָמַר - (aw-mar') - gathered wheat
גַּיְא - (gah'-ee) - in a valley
דִּין - (deen) - for judgement
ΑΡΜΑΓΕΔΩΝ - Armageddon - is to be understood in hebrew. It is patently nothing to do with Megiddo, a name that is equally understood in greek.
And of course, Megiddo is neither a valley nor a mountain and has absolutely nothing to do with the return of christ to Jerusalem.

'"Men of Galilee," they said, "why do you stand here looking into the sky? This same Jesus, who has been taken from you into heaven, will come back in the same way you have seen him go into heaven."'
Then the apostles returned to Jerusalem from the hill called the Mount of Olives, a Sabbath day's walk from the city.'
(Acts 1:11-12 NIV)

An echo of the description of the return found elsewhere :

'On that day his feet will stand on the Mount of Olives, east of Jerusalem, and the Mount of Olives will be split in two from east to west, forming a great valley ...'
(Zechariah 14:4 NIV)

A sabbath day's walk from the city. The return of the king, to Jerusalem, and a thousand year sabbath until the city.

"How foolish you are, and how slow to believe all that the prophets have spoken!"
(Luke 24:25 NIV)
Answer: V16 "They assembled them at the place which is called in Hebrew
Armageddon."
The key to understanding this battle is to appreciate that Armageddon
is the re-running of the battle of Megiddo (609 B.C.) Megiddo is the battle
in which God's champion, Josiah, stood up against the enemies of God
and was defeated, a result which cannot be allowed to stand.
Josiah was very much the Lord's king. It was during his reign that the
"book of the Law", commonly identified as Deuteronomy, was
"discovered" by the priests of the Temple. Josiah took steps to proclaim
the Law, and to renew the nation's covenant with the Lord. He made a
point of removing anything that might be considered idolatrous from the
territories under his control. He was the king who abolished the provincial
altars of Yahweh, and centralised the worship and the celebration of the
Passover at Jerusalem. "Before him, there was no king like him, who
turned to the Lord with all his heart and with all his soul and with all his
might, according to the law of Moses, nor did any like him arise after him."
( 2 Kings ch23 v25).
This achievement was thrown away in one moment of madness. The
Pharaoh Necho was on his way to fight great wars further to the north.
Josiah chose to intercept him, at Megiddo, and lost his life. The ultimate
sequel, and perhaps the consequence, was the destruction of his kingdom
at the hands of the king of Babylon. The loss of Josiah was deeply
mourned. The "laments" which were written around the event were still
sung centuries later- "to this day", as the Chronicler puts it. Much hope
must have been invested in this king, by those who followed the Lord. The
disappointment of the battle would surely compare with the sense of loss
of the disciples on the road to Emmaus; "We had hoped that he was the
one to redeem Israel". In effect, the death of Josiah was the Good Friday
of the Old Testament period.
I believe that the resemblance between these two battles should be
sought not in the location, but in the parallel between the two sets of
combatants. In the one corner, ladies and gentlemen, God's anointed king,
the champion of God's people. In the other corner, the power of
oppression, as represented by the Egyptians, and by the "kings of the
earth". The first time this battle was fought, at Megiddo, the result was a
catastrophe. Therefore the same battle must be fought all over again, at
Armageddon, so that the result can be reversed. It would symbolise, at the
same time, the reversal of all the other apparent setbacks, from the fall of
man to the supremacy of the Beast in its "war on the saints". This is God
having the Last Word.


Regression doubt on ols estimator

Question: I understand that beta-1 and beta-2 are parameters/OLS Estimators. But why is the variance of the error term a parameter?
Comment: What do you assume about the variance?  That will determine whether it is a parameter or not.
Answer: The "parameters" in the regression model are just the unknown and unobservable aspect of the model.  It is usual to assume that we don't know how variable the error term in the model is, and since this variance is not directly observable (it is inferred from the data), it is a parameter.
Also, I notice that your question has a secondary confusion.  The parameters $\beta_0$ and $\beta_1$ are not the same as their corresponding OLS estimators.  The parameters are unknown unobservable values, whereas the estimators are functions of the data that are used to estimate the parameters.  This is another aspect of the confusion between a parameter, and the estimator that is estimating that parameter.

Regression doubt on ols estimator


Removing the Bulk Delete Option from magento Catalog

Question: I want to remove "Delete" action from magento admin panel. Please guide.
Answer: Baconl's answer will technically work.  However, it is not the preferred solution to accomplishing this task.
If you move the file to local, you are overwriting the entire core file.  If anything ever changes in that file during an upgrade, you lose those changes because of a small edit in one function.
The function that adds the delete mass action has an event at the end of it.  It's best to write a module that has an observer that observes that event and removes the "delete".
With this solution, you have the least impact on the other code in that file and lose nothing as far as upgradeability.
Here is a link to some code that does it this way: https://stackoverflow.com/questions/29584740/how-do-i-remove-a-massaction-from-the-product-grid-using-observers-in-magento
Answer: You will need to make a custom version of the file
/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
copy it to:
app/code/local/Mage/Adminhtml/Block/Catalog/Product

Find and remove this bit of code:
$this->getMassactionBlock()->addItem('deletes', array(
         'label'=> Mage::helper('catalog')->__('Deletes'),
         'url'  => $this->getUrl('*/*/massDelete'),
         'confirm' => Mage::helper('catalog')->__('Are you sure?')
    ));

Never change Magento core files, keep in mind this in not a clean way to fix this problem. TJ Gamble at Jamersan`s answer is a clear way to fix it.


Online quests Wii U and 3DS Monster Hunter 3 Ultimate

Question: I have been playing a lot MH3U on Wii U, and also my son... He has a 3DS, and I'd like to play online quest with him, and another players around.
If i buy a 3DS cartdrige of this game, we can join online quests simultaneosly? For example, I play on Wii U, and he plays on 3DS, at the same time, in the same online quest, with other two any players?
Comment: I vaguely recall that this is not really possible. The 3ds cartridge has no native online ability, and when connected to the wii-u it occupies the wii-u's wifi capabilities, meaning you need a wired internet connection, which requires a usb converter and a specific app from the e-store. And I'm not sure the Wii-u game can go online with the 3ds game connected.
Comment: I remember researching this as my roommate had the wii-u version and I the 3ds. But I can't remember if we abandoned trying to go online together because it was not possible, or because the extra cost and effort was not worth it.
Comment: My Wii U uses wired connection... maybe the 3DS could use the wi-fi...
Answer: You can't. The 3DS version of Monster Hunter 3 Ultimate can only access online capabilities when a certain app is run from the Wii U. The only way to play multiplayer locally would be through the use of Monster Hunter 4 Ultimate with multiple 3DS systems.


I lost 100 reputation points

Question: I was quite busy for a few months and did not have any chance to check Arduino Stack Exchange and when I open today I have lost near about 120 points I don't know why and there is a message Serial Voting corrected. Is there any chance I can get back my lost reputation? Or do I need to earn them again?
Comment: Hey - yeah, Majenko's answer here is correct. It's seriously unfortunate, but was a necessary voting correction that affected a good number of users. If you or anyone else has questions about it, I'm happy to help answer them. Just poke me in the comments here.
Comment: No, thank you @Slate. It is now clear to me if I have any further doubts I will surely let you know. Thank you
Comment: I'm late to this question on meta, but I just realized, that I lost a whole 3600 in reputation. I was wondering but this answers it. Must have been a really bad rogue user to give me 3600 points.
Answer: Don't worry, you're not alone. We had a rogue user that caused some trouble, and their bad behaviour has been corrected. Those 120 points you had are gone I'm afraid. But don't worry, some people lost thousands of rep.
Keep writing great answers and I'm sure you'll soon enough earn them back.

I lost 100 reputation points


Why do people say perennial food crops only produce for a few years?

Question: When reading about plants I've heard that plants only produce for a few years, then die. Why can't they produce for as long as they're healthy?
Comment: Plants come in various lifespans: Annuals, Biennials, Perennials. So, this depends on the species.
Comment: @FiascoLabs where I'm from the plants that survive are either trees, or perennials.
Comment: I've pondered this question myself, and postulate - at least in the case of nightshades - that this probably has to do with the increasing difficulty pushing nutrients to the growing part of the plants.  (In the case of Eggplants, they tend to keep growing longer and longer, but production drops off as they age)
Comment: Also, some plants do produce for pretty close to forever - for example the original Hass avocado tree lived 76 years until it dies of root rot.
Comment: Fruit trees can produce for 10 years or more depending on which fruit or variety it is. Can you edit your question and be more specific about what perennial food crops you were thinking of?
Answer: Nothing lasts forever.The term perennial simply means a plant that will last for more than 2 years. That can mean 3 years that can mean 50 years or more. As the plants age they can lose their ability to produce the same quantity or quality of fruit.
Perennials don't live forever. They do eventually die or lose their ability to produce. For example asparagus is said to only produce for about 20 years. Lavender will survive for about 15 years.
In addition to their expected life span, other issues such as pests and disease can be a problem. These issues can build up over the course of many seasons. For various reasons it's suggested that strawberries be removed and new ones replanted every 4 years for example.
You might get a more meaningful answer if you indicate specific plants you're interested in.
Comment: Why do people say something doesn't last long when it lasts forever growing?
Comment: To be able to put my answer in better context.. may I ask how old you are? Is this for a school project?
Comment: 32, and just getting into gardening.
Comment: @blackthumb I updated my answer to provide some more details. I believe your confusion may be a result of thinking perennials mean the plants will last forever. That's not the case as I mentioned in my answer. It just means they'll live longer than 2 years. Or more specifically they have a reproductive cycle that isn't complete or repeats itself past 1 or 2 years.
Comment: @blackthumb Think of pets: a dog can get ten or fifteen years old, then it dies of old age. A hamster lives for two to three years, a large parrot fifty to a hundred years. The same is true for plants - a few hundred years is no problem for some kinds of trees, strawberries won't last a fraction of that time.
Answer: It's called evolution.  Different plants have different strategies to help replicate their genome across the planet.  Annuals, or bi-annuals have found it best to flower in the first or second year.  So, you'll see cabbages etc change their shape dramatically as they become tall and flowery so that they can disperse their seeds as far as possible.  Once they have fulfilled their purpose, there's no biological need to persist and compete with their offspring, so they die.
Comment: I was thinking more about about perennial food crops.
Comment: If you'd only like answers relating to perennial food crops, rather than flowers, would you mind editing your comment into the body of your question? That way the comment won't get lost, and people won't miss an important part of the purpose of the question. Thanks!
Comment: if you feel the question is better asked/explained another way, always feel free to edit it.


Is the water radical sometimes three strokes and sometimes two strokes?

Question: 凍, does it have the water radical on the left? Why is this three strokes in some words and two strokes in others?
Comment: https://en.wikipedia.org/wiki/Radical_85 and https://en.wikipedia.org/wiki/Radical_15
Answer: While 「氵」 is indeed an abbreviation of 「水」 (water), it is rather unfortunate that the colloquial name of 「冫」 in both Chinese and Japanese implies that 「冫」 has something to do with water. To emphasise, 「冫」 does not have anything to do with water, unless the appearance of 「冫」 is due to graphical corruption from 「氵」.

西周金⿱一丞卣集成5318秦簡日乙227 冬睡虎地秦簡今楷
「冫」 was originally a picture of forged metal plates, now written as 「鉼」 (Zhengzhang OC: /*peŋʔ/). It was later borrowed to represent the morpheme now written as 「冰」 (/*pŋrɯŋ/, ice) via the rebus principle.
As a stand-alone character, 「冫」 thus represents the two morphemes

[鉼]{へい}, metal (plates)
[冰]{ひょう} (Shinjitai: 氷), ice

In accordance with how Chinese characters work, as a character component, 「冫」 may impart either a meaning hint, a sound hint, or both a meaning and sound hint to the character it is part of. These meaning and sound hints are taken from the morphemes that it represents; that is, if you see 「冫」 as part of a character 「X」, you should be thinking to yourself about one of the following:

X sounds like へい
X sounds like ひょう
X has something to do with metal (plates)
X has something to do with ice
X both sounds like へい and has something to do with metal (plates)
X both sounds like ひょう and has something to do with ice

Examples:

冶 - to smelt metal
匀 - ancient weight measurement, now written as 「鈞」
金 - きん, metal, compound of 「冫」 (metal plates), semantic 「王」 (metal battle weapon > power/authority > king) and phonetic 「今」 (also きん). See What is the etymology of the kanji 金?
冷 - cold
冬 - winter
凍 - freeze
馮 - びょう, ひょう
Answer: I can give you a hint:
In 冷たい、the key on the left side in the kanji 冷 depicts : "ice with a few cracks on it".
Source: https://www.amazon.com/Key-Kanji-History-Characters-Japanese/dp/0887277365
I cannot affirm with certitude that is the same radical as in 凍 though.
Comment: FYI: that description of 冫 is incorrect.
Answer: The radical on the left of 冷 and 凍 is called にすい (二水) but it's not the usual "water radical" which is さんずい (三水). You'll just have to count the strokes.


Collapse of wavefunction in hydrogen atom under measurement of $L^2$

Question: If a hydrogen atom is in the state $\Psi = \frac{1}{\sqrt{3}}(\psi_{100} + \psi_{211}+\psi_{21-1})$
and the square of the angular momenta was measured to be $2\hbar^2$. After the measurement will the state be
$\Psi' = \frac{1}{\sqrt{2}}[\psi_{211}+\psi_{21-1}]$  or $\frac{1}{\sqrt{2}}[Y^{1}_{1}+Y^{1}_{-1}]$ with $Y_m^l$ a spherical harmonic function?
Answer: After the measurement the state of your Hydrogen atom will be $\frac{1}{\sqrt{2}}[\psi_{211}+\psi_{21-1}]$. With the measurement you are projecting onto the states with angular momentum quantum number $l=1$ as the eigenvalues of $L^2$ are $l(l+1)\hbar$.
The state of your Hydrogen atom remains of course in a "state of the Hydrogen atom". Which contains the Spherical Harmonics, but also information about the radial component. Therefore it is not correct to write the remaining state solely in Spherical Harmonics.
You can make that explicit by writing $\psi_{n,l,m}(r,\theta,\phi)$ and then you see that you would loose the $r$ if you take your proposition with solely Spherical Harmonics.
Comment: Yes, I thought so, but I saw different answer in some test. Thanks!
Comment: @NadavAmitai If this answered your question, consider to accept it.
Comment: @NadavAmitai Think of the wave function as a description of the state of your atom. It does not make any sense to talk about the state of an atom without the information about the radial distribution.


select() issue with a push server - c/c++

Question: I'm writing a server in C ++ for both Windows and Unix systems.
A key feature of this server is that it must be able to receive and send network packets at any time.
Specifically, the server must be able to send data to the client not only in response to their messages, but also be able to send packets to them asynch in push.
I'm having difficulty in implementing a solution that uses the select() function in the scenario described above.
The solution I have currently implemented does not convince me at all and I think it can be implemented with better patterns/solutions.
I currently have a dedicated thread (selector) that performs the select by listening on events in the reading for the server socket (to accept new connections) and for the sockets connected to the server.
This is the main select() loop:
    if((sel_res_ = select(nfds_+1, &read_FDs_, NULL, &excep_FDs_, &sel_timeout)) > 0){
    if(FD_ISSET(serv_socket, &read_FDs_)){
        //we have to handle a newly connection.
        ...
        if(sel_res_ > 1){
            //in addition to the newly connection, there is also some other message incoming on client sockets.
            ...
        }
    }else{
        //we have to handle incoming messages on client sockets
        ...
    }
}

This solution works well for receiving the data and to respond to client requests in synchronous form.
However, the server must also be able to send asynchronous data, and send when necessary, packets in push.
To do this I currently use separate threads that perform directly the send() on the client sockets.
This solution does not convince me, and I would like to centralize the packets receiving and sending on the selector thread.
The main difficulty is that the select() by its nature is blocking and I have no control until a client does not send any packet or the timeout is triggered.
The solution to set a timeout very low does not convince me; I see it as an easy solution that is actually doing active wait, and not only, however, the worst case I would pay the price of the timeout before sending the push packet.
I thought a more 'elegant' solution; I think, will work well, but only for a Unix/Linux platform.
I thought to use an anonymous pipe and insert into the select() read_FDs_ the anonymous pipe read descriptor.
In this way, when a thread wants to send a data in push, it writes something on this pipe, interrupting the select() and returning control to the selector that can then predispose to send the data to the client, without significant loss of time.
I think that this solution, unfortunately, cannot be implemented on Windows because the select() function on that system works only with fds that are actually sockets.
So the question is: Is there some well known solution that can be used to address this kind of scenario (both Linux and Windows)?
Comment: Use two threads, one for reading and one for writing.
Answer: You can create a self connected UDP socket, this works equally well on Windows and Linux.
Basically, you create a UDP socket, bind() it to INADDR_LOOPBACK and port 0, and connect() it to itself (with the address taken from getsockname()).
At this point, you can send yourself a single byte message (or something more specific) to wake yourself up.