SharePoint 2010 licence cost

Question: For a very large size organization which wants to implement intranet portal which is having 20K user in each region e.g. North America, South America, Europe, Asia pacific, Africa region how is SharePoint 2010 licence required. do they need licence for each 0.1 million user/employees?
or how it works?
Answer: I would ask Microsoft representatives to be completely sure in this case. But they will probably tell you that you need to buy a SharePoint CAL for every domain user that can and will access your SharePoint Portal regardless of the geographical location. So, yes, it might be 0.1 M users.
Comment: any idea how SQL server cost works in this case?
Comment: It greatly depends on whether the company already has SQL CALs. If it doesn't - it can indeed be pretty costly. You need to have a CAL for every user or device accesing SharePoint. Number of SQL Servers does not matter.

SharePoint 2010 licence cost


What is the Unscented Kalman Filter?

Question: What is the Unscented Kalman Filter and when is it used in preference to other types of filters?
edit: I find the Wikipedia explanation a bit too technical to be readily understood.
Comment: Doesn't http://en.wikipedia.org/wiki/Kalman_filter#Unscented_Kalman_filter answer this question?
Answer: The Unscented Kalman Filter is a type of non linear Kalman filter. (ie when the transition and observation functions are non linear)
If these functions are differentiable, one can simply use the Extended Kalman Filter (EKF). But when the functions are highly non linear, one might need to use an Unscented Kalman Filter (UKF), which is based on the Unscented transform.
The original paper introducing UKF is here.
Modify your question if you have something more precise to ask. What don't you understand in the UKF?
Answer: An Unscented Kalman Filer is one of the versions of  nonlinear Kalman filter ( together with Extended KF). They solve problems that are non-linear in nature. While the Extended KF uses gradual expansion of linear algorithm, Unscented KF take a unique approach to eliminate linearisation proces [Kim 2011].
The unscented KF does not use the Jacobian to obtain a linear model and so is free from the divergence which can happen with the Extended KF. Downside is that an algorithm can be seen as harder to understand, although it is in the main frame of KF - prediction of state variables based on a system model and calibrating the prediction with measurement to get the final estimate.
The Unscented KF is based mainly on unscented transformation which in its idea is similar to Monte Carlo, but makes a delicate selection of weights for each sample.
References:
Kim, P. Huh, L. "Kalman Filter for Beginners: With MATLAB Examples" 2011 http://books.google.co.uk/books?id=W8u_XwAACAAJ
Comment: I honestly find it easier to understand than the EKF. It's derivative-free, doesn't throw gazillions of matrices in your face and just works. :) That said, a very good book on basically all sorts of KFs is Probabilistic Robotics by Thrun et. al.
Answer: The KF and EKF estimate a state by tracking the mean and variance that measurements make of the state. They both project the state to the current measurement updating the estimate by a linear operation. Once updated with new information, the new state estimate is the forward projected mean and the uncertainty of the state is the forward projected covariance.
These two filters make an assumption (among others) that the uncertainty of the state is gaussian and can be fully (adequately?) described with the mean and a 1-sigma point (along each estimated dimension with cross-covariance - how one dimension varies relative to another dimension changing). The operation of forward projecting the mean (read: state estimate) and covariance (read: uncertainty) is linear and thus only scales and translates these values.
But this might be a bad assumption. Imagine a system that may evolve and not preserve (or ever really have) a classical gaussian shape. Simply describing the updated state estimate by how evolved uncertainty and new information affects just the mean and 1-sigma value would inadequately estimate the actual non-linear system.
As an analogy, imagine a conical section rolling down an incline. We could approximate the rolling object as a cylinder with a radius that is the mean of the conical section. Across short times, this may be adequate, but a cylinder rolling down an incline evolves linearly, but a conical section in actuality will arc and swing - a non-linear state transition.
The UKF is equivalent to tracking the evolution of the state as many points, and running these points through the non-linear measurement updates and time projections. The new state estimate and uncertainty are then the independently calculated mean and variance of the points at the new time with new information, and thus decouples the previous and new state estimates from errors associated with linear state transitions.

What is the Unscented Kalman Filter?


Magento 2: How to see the exact error

Question: There are two parts to this question.

1. How can we add data to the database using factory not through object manager?

2. How can we find exactly what is the error in the code (dev mode is active, var/logs all files are checked)?

I wrote some code i know there is an issue in the code but I am unable to see this in Magento logs . for the sake of adding data to the database, i am doing this. the module is complete and working, in template file code is.

        <?php foreach($block->getItemsResults() as $items) : ?>

<?php echo $items->getName() ?> : <?php echo $items->getDescription(); ?>

    <?php endforeach; ?>
    <form method="post" action="<?php echo $block->getFormData() ?>">
        Add Name Here
        <input type="text" name="name" >
        <input type="submit" name="submit" value="submit">
    </form>

and this is the block file.

<?php

    namespace Mastering\SampleModule\Block;
    use Magento\Framework\View\Element\Template;
    use Mastering\SampleModule\Model\ResourceModel\Item\Collection;
    use Mastering\SampleModule\Model\ResourceModel\Item\CollectionFactory;

    class Hello extends Template {
        private $cf;
        private $messageManager;
        public function __construct(Template\Context $context , CollectionFactory $collectionfactory , array $data = [] ){
            $this->cf = $collectionfactory ;
            parent::__construct($context,$data);
            //$this->messageManager=$messageManager;

        }
        public function getItemsResults(){
            return $this->cf->create()->getItems();
        }
        public function getFormData(){
            $post=$this->getRequest()->getPost();
            if(!empty($post)){
                $name=$post['name'];
                $this->messageManager->addSuccessManager("data saved");
            }
        }
    }

this is the code. what can I do to add data to the database and how can i find an exact errors list? right now the error is messageManager. but there is no way where i can see the error.

Comment: where is  $messageManager; ? you are using its method but have not added it in your constructor
Comment: yes sir i have written it in the question ... i know the error is $messageManager but there is no way to see the error log ?
Comment: dev mode throws exception when there is error. isn't that working for you ?
Comment: it shows error when i remove the private $messageMassanger .. but right now it is not showing any error . but as we all know this is an error .
Answer: If developer mode is active then errors should be thrown in browser directly.
For debugging it is always good to use xdebug.
Of course  you can use custom logging:
__construct(
   \Psr\Log\LoggerInterface $logger
) {
   $this->logger = $logger;
}

And then in the code:
$this->logger->info('message');

For the message manager here is info how to use it properly: https://magento.stackexchange.com/a/88118/72246
You've asked about adding to database without using object manager. Yes you should never use objectmanager directly. But to answer to that question please describe what do you want to save to database, so I can help.
Comment: thankyou for the knowledge .  what is "ofc" and what is "ind" ? and second thing you can see in the template file i have attached . there is a simple input type text . i want to take data from there and add it to some table in my database .

Magento 2: How to see the exact error


Counterexample to Sard's theorem for a non-C1 map

Question: Is there a function $f: \mathbb{R} \rightarrow \mathbb{R}$ which is differentiable but not $C^{1}$, such that the image of the points where $f'(x) = 0$ has measure bigger than 0?
If the answer is no, is it possible to find such an $f$ without requiring that it is everywhere differentiable?
Comment: As a side remark: Sard himself remarked in his paper that if the domain has dimension $n \geq 2$, the regularity condition in his theorem is sharp: that is if $f\in C^m(\mathbb{R}^n,\mathbb{R})$ with $m < n$, the set of critical values may have measure bigger than 0. See http://projecteuclid.org/euclid.dmj/1077489217
Comment: That's true, but it concerns $C^{m}$-regularity, I was wondering what happens for the intermediate case of a derivative which is not necessarily continuous.
Answer: No, such functions do not exist. More precisely, let $f:\mathbb R\to\mathbb R$ be an arbitrary function, $\Sigma$ is the set of $x\in\mathbb R$ such that $f'(x)$ exists and equals 0. Then $f(\Sigma)$ has measure 0.
By countable subadditivity of measure, we may assume that the domain of $f$ is $[0,1]$ rather than $\mathbb R$. Fix an $\varepsilon>0$. For every $x\in\Sigma$ there exists a subinterval $I_x\ni x$ of $[0,1]$ such that $f(5I_x)$ is contained in an interval $J_x$ with $m(J_x)<\varepsilon m(I_x)$. Here $m$ denotes the Lebesgue measure and $5I_x$ the interval 5 times longer than $I_x$ with the same midpoint. Now by Vitali's Covering Lemma there exists a countable collection $\{x_i\}$ such that the intervals $I_{x_i}$ are disjoint and the intervals $5I_{x_i}$ cover $\Sigma$. Since $I_{x_i}$ are disjoint, we have $\sum m(I_{x_i})\le 1$. Therefore $f(\Sigma)$ is covered by intervals $J_{x_i}$ whose total measure is no greater than $\varepsilon$. Since $\varepsilon$ is arbitrary, it follows that $f(\Sigma)$ has measure $0$.
Comment: Can your proof be adapted for $n \geq 2$ and $f : R^n \to R^n$?
Comment: Thank you. Just a question: why "for every x∈Σ there exists a subinterval Ix∋x of [0,1] such that f(5Ix) is contained in an interval Jx with m(Jx)<εm(Ix)"?
Comment: @Fabio: Just take $I_x=(x-\delta/5,x+\delta/5)$ where $\delta$ is such that $|f(y)-f(x)|/|y-x|<\varepsilon/5$ whenever $|y-x|<\delta$. The existence of such $\delta=\delta(x,\varepsilon)$ is essentially the definition of $f'(x)=0$.


Why didn't Rem die after killing Kaneboshi?

Question: In the Death Note anime, Rem kills Ginzo Kaneboshi in episode 21 to help Misa convince Higuchi that she is the second Kira. But why didn't Rem die after this? If she died after killing Watari/L, but why not after killing Kaneboshi?
Answer: That is because a Shinigami can die only if they try to extend or prolong the life of a human. In this case, Misa was not in any danger, and killing Ginzo would in no way extend Misa's life directly.
This excerpt from Wikipedia explains that Shinigami can die only by saving a human life (emphasis mine):

Like humans, Shinigami also can die, of sorts by extending the life of a human they care about (by saving them from certain death): the
  purpose of a Shinigami is to end life, not give it, and hence saving a human is contrary to their nature. Shinigami who die in this manner are reduced to dust. Their Death Note is left behind. The other way that a Shinigami can die is that they stop writing names in their Death Note- since Shinigami take human lifespans for their own when they write a name in their Death Note, if they stop they will eventually die when their lifespan runs out.

Hope this helps :D
Comment: But Rem can see her lifespan. He should have seen her life wasn't in danger, right? By showing himsef and tell everything he must have altered something in time...


why wont my nexus 10 hold a charge?

Question: I've had my Nexus 10 for a while and it's been great until recently and the battery now won't hold a charge. Whenever I unplug the charger it just turns off right away and when I plug in the charger that goes from 0 percent to a hundred percent in like 5 seconds
Comment: It could be that your battery or some other piece of hardware has died, unfortunately. Have you tried different chargers or cables just to rule that out? It sounds like it would likely not help, but may be worth doing if you can.
Answer: It may be because it came out on an earlier android version, requiring less power and battery to run. If you have a newer android version, e.g KitKat or Lollipop, it may be more intensive both visually and in terms of the power required to run it. Battery Doctor is a good application, (available on the play store), which might solve you issue.
Comment: There were issues with newer Android versions wobbling down a charge faster. But five seconds is a bit real fast (and a charger which charges a device in 5 secs is neither out for sale), so that part of your answer doesn't make much sense. Neither is the second part, as that app won't work when the device shuts down immediately.

why wont my nexus 10 hold a charge?


How to change a formula when changing the axis?

Question: I have been lerning about acceleration and free fall recently, and we were told the formula for distance is $s=s_0+v_0t+\frac {1}{2}at^2$ (for movement along $x$-axis) but when we change the axis (to movement along $y$-axis) and describe the free fall equation it will now be like this $s=s_0+v_0t-\frac {1}{2}at^2$. My question is, if I have any formula for something (now generally, not talking about the example above, for any movement or anything) along the $x$-axis and I want to describe the movement (or anything else) along the $y$-axis, how do i know, when to change the + for - (or the quantify in this case $+g$ for $-g$)? Please explain for this case and also generally so that i can use the knowledge in the future when talking about different topics/problems.
Answer: The equation $x = x_0 + v_0t + 1/2 at^2$ is the general kinematic equation that describes motion under constant acceleration.  For motion in two or three dimensions, it is customary to use "x" for the horizontal direction, "y" for the vertical direction, and "z" for the "depth" direction.  Thus, if an object is falling straight down, with no horizontal or z-directed motion associated with it, the equation to describe this motion would normally be $y = y_0 + v_0t + 1/2at^2$, where "a" is the acceleration due to gravity.  Note that if "x" and "y" motion is occurring simultaneously (e.g., projectile motion), and equations of motion are being used to represent vector components, it is customary to use subscripts on the variables "v" and "a" to indicate which component variables are being described.
Regarding the direction of the motion, you are free to choose that direction at the start of the problem, and as long as you stay consistent in the sign designation, everything will work as it should.  For most problems, up will be designated as positive and down will be designated as negative.  Under this directional assignment, the acceleration due to gravity is negative, because it is in the negative direction.  On the other hand, some problems may work better if down is defined as the positive direction.  If that is the case, then the acceleration due to gravity is positive, and any motion in the upwards direction is negative.
Comment: But then shouldn't the velocity also be negative?
Comment: Displacement, velocity, and acceleration are ALL vector quantities.  The defined positive direction applies to all vector quantities, so if you defined up as positive, anything that is in the downward direction is negative.
Answer: Very generally, everything is a choice. We choose to favor one direction, or one sign, over the other. Often times, though, we will choose a convention that makes the most sense.
For example, it could make sense for the sign to be negative in the $y$-axis because it reminds us that the height of the object is decreasing with time. Conventionally, the positive direction of the $y$ axis is "up" and the negative direction is "down".
These choices eventually become the convention, and everyone agrees that that choice is the choice to use. It doesn't really matter which choice it is, so long that everyone is using it, consistiently. This is actually kind of weird because you already know a lot of conventions, but you've never even thought about it. Everyone knows that $x$ and $y$ are used as variables, while $a$, $b$, and $c$ are used as constants, and it just looks strange if you don't do it like that. Conventions are sometimes silent agreements that are hardly touched upon or "taught"; those are the ones that will almost never cause confusion.
Other times, the choice is in the hands of the teacher or author, for their own reasons. In these cases, you have to go and ask them what convention they are using (or read the "about this book" section). In your case, ask the teacher: "Hey, is this negative sign always going to be the case?" and make sure that you understand how they are choosing to express their equations or signs so that there are no misunderstandings.
Similarly, if you are talking about or teaching a topic and you're choosing to use some unnatural conventions, be sure to let others know, so you that they can understand you.
Ultimately, the universe doesn't care. The answers should be the same, regardless of which ones we choose.


Not Allow Download from Windows Server Network Share

Question: I have a network share (SMB) on our file server (Windows 2012 R2) that will be holding sensitive data. I am trying to figure out how I can limit access to not allow anyone accessing the share to download the files/folders. Is this possible?
Answer: You can specify who has the rights to read and write files. But if you give users the right to read files, the can read the files. That is the point of allowing them read access. You can set the rights so nobody can read the files, but then why place them in a network share?
Comment: There's a list permission too which will simply enumerate the files without allowing read or write
Comment: Yes, there are some special permission, too, but what is the point to allow list but not read and write? In special cases you may deny list so that only users who know the exact name can access the file, but that doesn't apply here.
Answer: This is a problem that's generally solved with an administrative policy rather than via technical means.  For example, you could force users to sign something saying that if they download the files off the network share onto any other device it's a termination-level offense before granting them permissions to access the share.
You might also want to turn on auditing on the share to see who's accessing which files, but I don't believe it'll alert you if they copy the files elsewhere.  (Auditing would tell you that they accessed the file if they read or copy it.  Writing the file to another device would require auditing on the other device for writes.  Also, you would need to read the event viewer to see the audit information.)  While you're at it, you probably want to disable USB devices, block access to cloud services on workstations used to access the files, etc., and none of that is a guarantee.
So, to answer your question, it's probably not possible to prevent it via technical means.  This is why most people create an administrative policy instead.


Implementing a CursorAdapter to get DB rowID's of ListItems in a ListView

Question: I'm trying to implement a CursorAdapter in my Android App. I read different tutorials and tried out different things but it won't work!
I found one question here very similar to mine but I didn't get the idea out of it.
Here's the thing:
I got a Database with multiple tables and foreign keys and so on.  I wrote a (tested and working) Database including an
extension of the SQLiteHelper class to work properly. The DB-Class containts a lot of methods to get various operations
on that DB like: insert, update, delete, alter and some special needs....
My Problem is the following:
I have written a method which returns all Data containing (all rows) in the Database which i want to present
in a ListView. The returning object is a wrapped  ArrayList> . I got the thing working all fine
with an ListViewAdapter but then i came to my problem which now almost drives me crazy:
The User shall click a random item in that specific list (which contains all rows from the DB) and then i want to
update that specific row in the DB with some new data the user put into a EditText box. Pretty simple task actually but I think I just don't understand the usage of the CursorAdapter.
My questions now:

What does my DB-Method have to return (or look alike) that the CursorAdapter can handle it....
How do I have to implement the Adapter that it just fulfill this one task (retrieving the correct rowID of the DB entry in the list)

Here is my method retrieving the data from the DB
public ArrayList<ArrayList<Object>> getAll()
    {
        ArrayList<ArrayList<Object>> allRows = new ArrayList<ArrayList<Object>>();

        //Cursorobjekt haelt die Daten einer Zeile und dient dazu in diesen zu iterieren
        Cursor myCursor1,myCursor2,myCursor3;

        myCursor1 = db.query
        (       "Faecher",
                new String[] { "id" , FACH_NAME, FACH_ART },
                null, null, null, null, null
        );
        // Den Pointer an die erste Stelle ruecken
        myCursor1.moveToFirst();

        myCursor2 = db.query
        (
                "Ort",
                new String[]{"id" , ORT_RAUM , ORT_GEBAEUDE},
                null,null,null,null,null,null
        );
        myCursor2.moveToFirst();

        myCursor3 = db.query
        (
                "Profs",
                new String[]{"id", PROFS_NAME, PROFS_SNAME, FKEY_GENDER_ID},
                null,null,null,null,null,null
        );
        myCursor3.moveToFirst();

        for(int i=0; i < myCursor1.getCount(); i++)
        {
            ArrayList<Object> row1 = new ArrayList<Object>();

            row1.add(myCursor1.getLong(0));
            row1.add(myCursor1.getString(1));
            row1.add(myCursor1.getString(2));
            row1.add(myCursor2.getLong(0));
            row1.add(myCursor2.getString(1));
            row1.add(myCursor2.getString(2));
            row1.add(myCursor3.getLong(0));
            row1.add(myCursor3.getString(1));
            row1.add(myCursor3.getString(2));
            row1.add(myCursor3.getLong(3));
            allRows.add(row1);

            myCursor1.moveToNext();
            myCursor2.moveToNext();
            myCursor3.moveToNext();
        }

        myCursor1.close();
        myCursor2.close();
        myCursor3.close();

        return allRows;
    }

The Adapter is empty right now because my code was real crap and now looks like this hull:
public class SubjectListAdapter extends CursorAdapter
{
    private LayoutInflater myInflater;

    public SubjectListAdapter(Context context, Cursor c)
    {
        super(context, c);

    }

    @Override
    public View newView(Context context, Cursor myCursor, ViewGroup parent)
    {

        return null;
    }

    @Override
    public void bindView(View parent, Context context, Cursor myCursor)
    {

    }

}

I hope someone can help me out with my problem or give me a hint where I have to go to get this working.
Comment: A CursorAdapter expects to operate on a Cursor. So you need to provide a Cursor for it. If it is possible to combine your queries you can use the cursor returned from your db. It thats not possible you can take a look at ArrayAdapter which handles array (like the one you return in your method).
Answer: If I understand your question correctly, it seems like your primary issue is determining which element has been clicked on within the adapter. You may need to switch from bindview and newview to just using getview. If you do, you can just add an onClicklistener to the view before getView returns it. This way, each row in the list has its own listener and can update the correct row in the db. Any particular information that the onClickListener needs to run the correct database update method  (ie the rowId) can also be passed into the listener with a Tag on the view. Hope that helps.
Comment: Hi user659874 and Frenkenstein.
Thx for giving me a hint. I haven't got alot of time in the last couple of days but as soon as possible i will start a new try and report back. Thx so far.
Comment: Hi again,
i think i still have a basic understanding problem. I'm not sure how to use the Cursor adapter. Do i have to create an Object of my CursorAdapter class and pass it a cursor ? And where do I have to define the onClick Method u talked about? Within the CursorAdapter or in the Activity where i create the listview ?
sorry for being a bit stubborn here...
Comment: Hi, i forgot to mention your flag so that u get notified. I asked another question and would be thankful to hear from you again.
Answer: You have to create one big query from DB and get one Cursor. You can use even ordinary sql selection like
String selectQuery = "SELECT  id, " FACH_NAME", "+ FACH_NAME ", " + FACH_ART .... +" FROM Faecher INNER JOIN ....";
        SQLiteDatabase db = this.getWritableDatabase();
        Cursor cursor = db.rawQuery(selectQuery, null);

to get requared cursor. Than create custom CursorAdapter with getted cursor
 public class ExampleCursorAdapter extends CursorAdapter {
                public ExampleCursorAdapter(Context context, Cursor c) {
                    super(context, c);
                }

@Override
            public void bindView(View view, Context context, Cursor cursor) {
                TextView something1 = (TextView)view.findViewById(R.id.something1);
                something1.setText(cusror.getString(0));
                        TextView something2 = (TextView)view.findViewById(R.id.something2);
                something1.setText(cusror.getString(1));
                        .......
                viev.addOnClickListener(new OnClickListener{
                     public void onClick(...){
                     }
                     });
            }

@Override
            public View newView(Context context, Cursor cursor, ViewGroup parent) {
                LayoutInflater inflater = LayoutInflater.from(context);
                View v = inflater.inflate(R.layout.item, parent, false);
                return v;
            }
        }

Method bindView(....) will be called for each raw of Cursor but it will be setted to the different position, you souldnt change it inside this method. Than just bind this adapter to your ListView by setAdapter(....) method.


How to get my birthday present in Guild Wars?

Question: My character gets 1 year old soonish. How do I get the birthday present?
Answer: Your birthday present will appear in the first empty spot in your inventory the first time you log in with that character on your characters birtday.
If your inventory is full on the birthday of your character, you will receive the gift the next time you log in with at least one space free.
Answer: Patience =)... They just show up in your inventory on your player's birthday.
Comment: And if you keep your character long enough, you'll get another one on your next birthday :)
Answer: As people said in the answers above, the present appears in your inventory on your character's birthday. I suggest creating as many characters as you can (fill all your available slots) to get more presents - every character will get their own gift on the anniversary.


How to handle missing data in machine learning

Question:
i know how to find and fill the missing values. But i am not sure when to fill the values with min., max. , mean, median or mode. Can someone help me to understand on what basis i can decide , i have to remove the missing rows or columns and if i have to keep the missing data on what basis i can fill the missing values.
how i can fill the missing data in categorical feature?
Comment: Are you using R or Python?
Comment: I am using python
Answer: This is a complicated question. I recommend the book by little and Rubin statistical analysis with missing data.
https://books.google.com/books/about/Statistical_Analysis_with_Missing_Data.html
Basically, there are three categories of missing data. We assume that
each data record can be divided into an "observable component" and an
"unobservable component". We also assume that the data records are independent
and identically distributed.

MCAR (Missing Completely At Random) where the pattern of missinginess
is statistically independent of the data record. Example: you have a data
set on a piece of paper and you spill coffee on the paper destroying part
of the data.
MAR (Missing At Random) where the probability distribution of the pattern of missingness is functionally dependent upon the observable component in the record. MCAR is a special case of MAR. Example: you have a question on a survey
asking if the survey participant is a drug addict and another question which
asks if the survey participant has less than one alcoholic drink per year.
Assume the answer to the alcoholic drink question is always observable, then
the probability that someone fails to answer the drug addict question is
most likely functionally dependent upon their answer to the alcoholic drink
question.
MNAR (Missing Not at Random) which is defined as the case which is NOT MAR.
In the MNAR case, you can have situations where both the drug addict and alcoholic drink questions are absent in the same record. Another example,
is a case where the question is: "What is your gender?" Suppose that females
are less likely to answer this question than males. This is another example
of an MNAR question because the probability that the answer is observable
is conditionally dependent upon the unobservable component of the data record.

Ok...now that we have some terminology, we can discuss some strategies and
recommendations...

1) Never insert mean, mode,mean, max, min, median, or anything else for missing values. That is avoid deterministic imputation even though it is widely used and available in most software packages. It underestimates and distorts the statistical regularities (e.g., underestimates variance is one example) present in your data sample. In some special cases such as linear regression it might have some limited value but in general I wouldn't mess with it.

2) if the data records are MCAR Then you can delete records with missing data.
3) if the data records are MCAR, then sometimes you can
stochastically impute the missing values rather than
deterministically impute them. So this means that if you specify the
marginal probability distribution of a missing value as Gaussian
with some known mean and some known variance then you can sample
from that distribution to impute values into the data set. You need
to be careful here and do some additional research beyond this
answer before moving forward with this.
4) If the data is MAR then an algorithm such as Expectation    Maximization can be used to handle the missing observations.
5) If the data is MNAR you can include binary indicators in the data    record which explicitly identify when a variable is not
observable.    The challenge with this approach is that a highly
nonlinear model    needs to be designed to properly integrate this
information in an    appropriate manner. This might work in a machine
learning algorithm    where the binary indicators "disconnect" the
influence of predictors    which are not observable. Consequently,
the MNAR theory (i.e., the    theory of the joint distribution of the
complete data record and    missing data pattern) is instantiated in
the learning machine's    probabilistic model of its statistical
environment.


how can i combine fitness and diabets together ? how can i be a professioal athlete?

Question: Doctor's said that you cant exercise anymore , now i see nacho ( REAL MADRID F.C midfielder ) can play football as well as anyoe else , in high rate and grade , although he has diabets since he was 12 !
i'll be happy if you help me .
Comment: There are many athletes at all levels that perform quite well with diabetes. This is something you should work out with your doctors and coaches.
Answer: Reason why doctor don't want you to train is that while exercising sugar level in your blood can vary. Too low level can be dangerous for you. There are diabetics who do train, but that requires extra care. Since your life is in stake no one will guide you over Internet. Find out people in your country who train, and ask them for contacts to doctors, more help. Please note that doctors are humans as we all. Some of them are better skilled, some are more deliberative. Find one that can help you, but please be care, and do not do it for your own. That is really serious.


How do I know whether the description of an electron state is complete?

Question: Let's consider an electron as part of a larger system as an atom consisting not only of a nucleus but also of several other electrons. I guess, one can characterize the atom quantum-mechanically in a complete way. Then I am tempted to describe the electron as subsystem of the atom which as part of a complete system would only be possible by a density matrix. But I guess that we can still describe the electron of the atom with a wave function as long as its state is pure. To be a pure state there must exist a complete set of measurements which always give an unique result. However, how do I know that the state of the (this) electron is described by a complete set of measurements which give an unique result ? For instance I can imagine electron states in an atom where I can measure energy, orbital angular momentum and spin (this description seems to be complete) whereas there might be also states I can only measure energy and total angular momentum. So how we know if the description of a state is still complete or not ?
In particular I would appreciate to learn about a counter-example, i.e. where indeed the description of the electron is no longer complete as the case where the description of the electron state is still complete seems to be more standard (at least in an atom).
My thinking has been simulated by Landau/Lifshitz volume 3, chapter 1, 14 and 67.
Comment: Actually I am asking for a case where the product decomposition of $N$-electron state into a 1-electron state with a $(N-1)$-electron state is no longer possible, i.e. a density matrix description would be necessary.
Comment: @Chiral Anomaly: Sorry for my slow response. Your answer was quite elaborate & I wanted to fully understand it before responding. I expected a density matrix as "1-electron state"-description in a complicated atom. Probably to write down such a matrix is complicated. It wasn't my prime interest to see such a matrix. I actually would like to know when can I still expect to describe an electron state as pure state in an atom and when is it no longer possible ? What would be the condition for a switch from a pure electron state to a mixed electron state ? Or doesn't this question have an answer ?
Comment: The question is answerable, after adjusting the question to account for the fact that electrons are indistinguishable particles (fermions). I posted a new version that is hopefully more clear than the previous one. I also trimmed out the previous example to make the answer a little shorter.
Answer: A pure state of an $N$-electron system may be represented by a single wavefunction
$$
 \psi(x_1,x_2,...,x_N),
$$
where $x_n$ denotes the whole collection of variables needed to parameterize both the location and spin of the $n$-th electron. Even though this is a pure state of the $N$-electron system, it might not be decomposable into a one-electron pure state and a $N-1$-electron pure state. The question is how we can recognize when such a decomposition is possible.
Making the question precise is tricky, because electrons are "indistinguishable" particles. Specifically, electrons are fermions. This means that the state of an $N$-electron system never has the form
$$
 \psi(x_1,x_2,...,x_N) = f(x_1)g(x_2,x_3,...,x_N)
\tag{1}
$$
where $f$ is a single-electron state and $g$ is the state of the remaining $N-1$ electrons. A multi-electron state must be antisymmetric, meaning that it must change sign when any two of its arguments are exchanged, like this:
$$
 \psi(x_2,x_1,x_3,...,x_N)
 =-\psi(x_1,x_2,x_3,...,x_N).
\tag{2}
$$
For this reason, there are no observables (or measurements) associated with an individual electron. Any measurement that we try to apply to a single electron will automatically be sensitive to all of the electrons that are present. For example, we can count the number of electrons in a given region of space, but we cannot determine whether or not a specific electron is in that region; the latter concept is not even meaningful.
The closest we can come to something like (1) in an $N$-electron system is this:
$$
 \psi(x_1,x_2,x_3,...,x_N)
 =
 f(x_1)g(x_2,x_3,...,x_N) + \text{even} - \text{odd},
\tag{3}
$$
where "even" and "odd" refer to all possible even and odd permutations of the indices. For example, the $N=3$ version of equation (3) is
\begin{align}
 \psi(x_1,x_2,x_3)
 &=
 f(x_1)g(x_2,x_3) \\ &+
 f(x_2)g(x_3,x_1) \\ &+
 f(x_3)g(x_1,x_2) \\ &-
 f(x_2)g(x_1,x_3) \\ &-
 f(x_1)g(x_3,x_2) \\ &-
 f(x_3)g(x_2,x_1).
\tag{4}
\end{align}
If a $3$-electron state has the form (4), then we can describe it as the composition of a one-electron state $f$ with a two-electron state $g$, while respecting the fact that electrons are "indistinguishable" particles (more specifically, they are fermions). With that in mind, the question could be interpreted like this:

Given an $N$-electron state, how do we know whether or not it can be decomposed into a pure state  $f$ of one electron and a pure state $g$ of $N-1$ electrons, as shown in equation (3)?

If that is the question, then this is the answer: The given $N$-electron state $\psi$ can be written in the form (3) only if
$$
 \psi(x_1,x_2,...,x_N)\psi(x_{N+1},x_{N+2},...,x_{2N})
 +\text{even} - \text{odd} = 0.
\tag{5}
$$
In particular, if
$$
 \psi(x_1,x_2,...,x_N)\psi(x_{N+1},x_{N+2},...,x_{2N})
 +\text{even} - \text{odd} \neq 0,
\tag{6}
$$
then we know that the $N$-electron state $\psi$ cannot be written in the form (3), no matter what we try to use for the functions $f$ and $g$.
Comment: Thank you for your answer. Actually I don't understand the expression (5). In particular $\psi(x_{N+1}, \ldots, x_{2N})$. It would suggests to me that the number of  electrons has doubled. What is the meaning of it. ?
Comment: @FredericThomas Intuitively, if any one of the original $N$ electrons has a pure state $f$ of its own, then we would violate the Pauli exclusion principle if we tried to make a system with $2N$ electrons using two copies of the original $N$-electron state, because we'd be trying to put two electrons in the same single-electron state $f$. That's what equation (5) is saying: if we try to make a $2N$-electron state from two copies of the $N$-electron state, antisymmetrized overall as required, then we'll get an invalid state-vec (zero) if any of the original electrons had a pure state of its own.
Comment: @FredericThomas ...so you're right: in equation (5), the number of electrons has doubled. The idea is to use that doubling "experiment" as a test to see if it violates the Pauli exclusion principle. If it doesn't, if the $2N$-electron state is still valid (non-zero), then we know that none of the original $N$ electrons has a state $f$ of its own. The idea of a "density matrix" doesn't work with fermions the way it does with distinguishable particles, because we can't choose which electrons to ignore (they're indistinguishable). That's why I didn't express things in terms of a density matrix.
Comment: When I asked the question I did not expect such a criterion. Interesting. Thank you for your help.


How to make the taskbar blink my application like Messenger does when a new message arrive?

Question: Is there an API call in .NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with?
Answer: FlashWindowEx is the way to go. See here for MSDN documentation
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool FlashWindowEx(ref FLASHWINFO pwfi);

[StructLayout(LayoutKind.Sequential)]
public struct FLASHWINFO
{
    public UInt32 cbSize;
    public IntPtr hwnd;
    public UInt32 dwFlags;
    public UInt32 uCount;
    public UInt32 dwTimeout;
}

public const UInt32 FLASHW_ALL = 3;

Calling the Function:
FLASHWINFO fInfo = new FLASHWINFO();

fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;
fInfo.dwFlags = FLASHW_ALL;
fInfo.uCount = UInt32.MaxValue;
fInfo.dwTimeout = 0;

FlashWindowEx(ref fInfo);

This was shamelessly plugged from Pinvoke.net
Comment: For WPF applications, set fInfo.hwnd to `new System.Windows.Interop.WindowInteropHelper(this).Handle`
Comment: @oscilatingcretin you might have figured this out already, but I'll add it here anyways if anyone else has the problem.

You can add:
public const UInt32 FLASHW_TIMERNOFG = 12;
fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;

This will make the window stop flashing when the window is focused.
Comment: I am using this on a console app.  It starts flashing, but how do I get it to stop once the app is clicked from the taskbar (ie, whenever the window has the focus)?
Comment: @oscilatingcretin you can set uCount to the # of times you want it to flash, that won't stop it flashing but at least it will stop eventually. you could also look into using FlashWindow which is simpler and just flashes it once: http://msdn.microsoft.com/en-us/library/windows/desktop/ms679346(v=vs.85).aspx
Comment: @dummy, do you know of a way to do something similar for cmd.exe? I want the cmd.exe taskbar button to flash after a long running cmd script is complete.
Answer: HWND hHandle = FindWindow(NULL,"YourApplicationName");
FLASHWINFO pf;
pf.cbSize = sizeof(FLASHWINFO);
pf.hwnd = hHandle;
pf.dwFlags = FLASHW_TIMER|FLASHW_TRAY; // (or FLASHW_ALL to flash and if it is not minimized)
pf.uCount = 8;
pf.dwTimeout = 75;

FlashWindowEx(&pf);

Stolen from experts-exchange member gtokas.
FlashWindowEx.
Answer: From a Raymond Chen blog entry:

How do I flash my window caption and taskbar button manually?
How do I flash my window caption and
  taskbar button manually? Commenter
  Jonathan Scheepers wonders about those
  programs that flash their taskbar
  button indefinitely, overriding the
  default flash count set by
  SysteParametersInfo(SPI_SETFOREGROUNDFLASHCOUNT).
The FlashWindowEx function and its
  simpler precursor FlashWindow let a
  program flash its window caption and
  taskbar button manually. The window
  manager flashes the caption
  automatically (and Explorer follows
  the caption by flashing the taskbar
  button) if a program calls
  SetForegroundWindow when it doesn't
  have permission to take foreground,
  and it is that automatic flashing that
  the SPI_SETFOREGROUNDFLASHCOUNT
  setting controls.
For illustration purposes, I'll
  demonstrate flashing the caption
  manually. This is generally speaking
  not recommended, but since you asked,
  I'll show you how. And then promise
  you won't do it.
Start with the scratch program and
  make this simple change:
void
OnSize(HWND hwnd, UINT state, int cx, int cy)
{
  if (state == SIZE_MINIMIZED) {
    FLASHWINFO fwi = { sizeof(fwi), hwnd,
                       FLASHW_TIMERNOFG | FLASHW_ALL };
    FlashWindowEx(&fwi);
  }
}

Compile and run this program, then
  minimize it. When you do, its taskbar
  button flashes indefinitely until you
  click on it. The program responds to
  being minimzed by calling the
  FlashWindowEx function asking for
  everything possible (currently the
  caption and taskbar button) to be
  flashed until the window comes to the
  foreground.
Other members of the FLASHWINFO
  structure let you customize the
  flashing behavior further, such as
  controlling the flash frequency and
  the number of flashes. and if you
  really want to take control, you can
  use FLASHW_ALL and FLASHW_STOP to turn
  your caption and taskbar button on and
  off exactly the way you want it. (Who
  knows, maybe you want to send a
  message in Morse code.)
Published Monday, May 12, 2008 7:00 AM
  by oldnewthing Filed under: Code
Answer: The FlashWindowEx Win32 API is the call used to do this. The documentation for it is at:
http://msdn.microsoft.com/en-us/library/ms679347(VS.85).aspx
Comment: Only available on WinXP, Win2KPro and Vista
Answer: I believe you're looking for SetForegroundWindow.
Comment: Available on all Windows OSes but behaviour changes over time.


How can I find out about redaction practices?

Question: I would like to find out how common it is to use redaction software, vs. the old-fashioned magic marker.  How can I formulate an acceptable question about this?
Reference question that was closed: How common is electronic redaction?
Comment: https://opendata.stackexchange.com/questions/tagged/foia
Comment: Q & A this Friday on slack: https://twitter.com/rcfp/status/857298742105571330
Answer: I've been trying to figure out an easy way to look at a question and determine whether it's on-topic or not, in the simplest sense - whether it's a question about law. And I think I may have the beginnings of a good solution, which coincidentally answers your question.
I think that, if you can remove the legal element(s) of a question and it isn't still substantially the same question, you may want to consider whether it is actually on topic here. This is something I've been considering for a while, and perhaps this theory has gaps, but for most questions, this is probably true.
For example, your question asks how common a practice of - let's call it "manual" - redaction is, and you offer a somewhat legal prologue to this, being that the documents that were so redacted were obtained under an FOIA request.
But... would it really be a different question without that first paragraph? I would say not.
On the other hand, many (and I would hope most, if not all) of the questions on our site are defined because of their legal elements, and would be fundamentally different questions if you tried to divorce those legal elements from those questions.
As I say though, it's just the beginnings of a nugget of an idea.
But in answer to your question: I don't think asking how common a particular method of redaction is, on its own, would ever be an on-topic question.
Perhaps if you located some legislation that stipulated how that information must be redacted, in particular applications, or in specific industries, it might be something that could be answered legally.
Answer: A question about how frequently people engage in some practice is clearly not a question about law. I even question whether a question of the form "how often does the law require X" is really about law as opposed to politics, since unless the answer is along the lines of "Only in these 3 cases is that (not) required", the question ultimately comes down to asking for a list of political decisions: that is, it doesn't tell you anything about The Law. And it is almost certainly not an answerable question, assuming that the topic has not been professionally researched. For example, a question like "how often do municipalities establish 'by permit only' parking zones?" cannot reasonably be answered, and instead you'll get an anecdote "In my town, they do" or "In my town, they don't".


what is the correct use of "when vs If"?

Question: Stop work and initiate emergency response when unplanned contact with a buried facility occurs. OR
Stop work and initiate emergency response if unplanned contact with a buried facility occurs.
Comment: The grammar aside, the meaning of the sentence is quite strange.
Answer: According to definition 2 for "when" and 1a for "if" as listed below, the words may be used interchangeably.
It should be noted however that there is the phrase "when, not if" which is used to denote the inevitability of something, which may or may not be what you're looking for.
TL;DR
Both are valid, but using "when" might be interpreted as something that will happen, while "if" leaves the possibility of something not happening open.
Merriam-Webster's definitions for the conjunction "when" are

a : at or during the time that : while
went fishing when he was a boy
b : just at the moment that
stop writing when the bell rings
c : at any or every time that
when he listens to music, he falls asleep
2 : in the event that : if
a contestant is disqualified when he disobeys the rules
3a : considering that
why use water at all when you can drown in it— Stuart Chase
b : in spite of the fact that : although
quit politics when I might have had a great career in it
4 : the time or occasion at or in which
tomorrow is when we must decide humor is when you laugh

and those for the conjunction "if" are

1a : in the event that
b : allowing that
c : on the assumption that
d : on condition that
2 : whether
asked if the mail had come
I doubt if I'll pass the course
3 —used as a function word to introduce an exclamation expressing a wish
if it would only rain
4 : even though : although perhaps
an interesting if untenable argument
5 : and perhaps not even
few if any changes are expected
—often used with not
difficult if not impossible


Javascript Blob constructor not working on iPad

Question: I am trying to take a screenshot of the user's screen when they are using my website and upload it to the server using html2canvas. This works well at my desktop using Chrome and Firefox (screen > html2canvas > imageURL > Unit8Array > Blob > upload).
However when I run the code on an iPad, the Blob creation code is messing up the input from html2canvas's image file. The image shrinks for no apparent reason from around 40k in size to 19 bytes. Below is my code.
The iPad's output is highlighted using "*".
<code>var unit8 = new Uint8Array(imageArray);
var imgBlob;

// check length of encoded image
// *** On this iPad, this generates meaningful size eg 41240 ***
if(navigator.userAgent.match(/iPad/i) != null){
    alert('length of the Unit8Array: ' + unit8.length);
}

if(typeof Blob !== 'undefined'){
    // detect if Blob object is supported
    // *** The iPad supports Blob object, it even support it's constructor ***
imgBlob = new Blob([unit8], {type: 'image/jpeg'});
} else if(window.BlobBuilder || window.MSBlobBuilder ||
            window.WebKitBlobBuilder || window.MozBlobBuilder) {
    // generating Blob - the old fashion way
    // Not used by iPad
    var blobBuilderObj = new (window.BlobBuilder || window.WebKitBlobBuilder ||
              window.MozBlobBuilder || window.MSBlobBuilder)();
    blobBuilderObj.append(unit8.buffer);
    imgBlob = blobBuilderObj.getBlob('image/jpeg');
} else {
    // Cannot generate Blob
    alert('Error occurred during Blob generation');
    return;
}

// check length of encoded image
// *** On the iPad imgBlob.size = 19 and imgBlob.toString() = [Object Blob] ***
if(navigator.userAgent.match(/iPad/i) != null){
    alert('Before attach 1: length of the encoded message: ' + imgBlob.size +
        ', Blob content: ' + imgBlob.toString());
}
</code>
Any idea why?
Many Thanks,
Hoi
Comment: Doesn't fully answer the question, but some conjecture on why it may not work: [blob does not accept Uint8Array on ios](http://stackoverflow.com/questions/14340989/blob-does-not-accept-uint8array-on-ios)
Answer: From my research of comments here, it looks like you have to pass to Blob() constructor not Uint8Array object, but it's buffer property:
new Blob([unit8.buffer], {..})
At least this way I've managed to create Blobs which can be uploaded on iOS6 on iPhone5.


How does an oscillating sprinkler like this change directions?

Question: I'm trying to understand how an oscillating sprinkler like this, is able to change directions. Does it still use a four bar linkage mechanism like a traditional oscillating sprinkler?
Comment: The algorithm for that is rather simple. The incoming water stream is divided into two. Moving the sprinkler left closes the right stream and opens the left, and vv. You should see that when you disasemble it.
Answer: Most mass-produced devices have utility patents on them. I was able to locate the one (or a very similar one) for your device:
EP19970306109

"By pushing the arm 19 in one direction the rocker member 17 is moved to the position illustrated in Figure 8 in which the inlet 15 is open
  to enable water to enter the inlet 15 whilst the inlet 14 is blocked
  by the member 17..."
  "When water reaches the impeller 8 through the inlet 14, the
  water flow drives the impeller in one rotational direction and when
  water reaches the impeller 8 through the inlet 15 the water flow drives the impeller 8 in the other rotational direction."


Why did Miss Hardbroom and Indigo Moon discontinue their friendship in The Worst Witch?

Question: Indigo Moon had a friend named Joy. She never heard back from her. It turned out Miss Hardbroom was Joy but she didn't want to tell Indigo that. Later, Indigo planned to use forgetting powder to forget that Joy existed. Then Miss Hardbroom admitted that she was Joy but can't have that kind of friendship anymore because she's her teacher. Why does the fact that she's her teacher prevent it?
Comment: After watching certain episodes in the fourth season, I can safely say "because Hecate Hardbroom would prefer Indigo lost her memory rather than confront their relationship".
Comment: Because it's weird for a fifty year old and a thirteen year old to be friends?
Answer: If Miss Hardbroom looked at Indigo as a friend and not as a student, there would be cases of open favoritism. A teacher should be someone to talk to with respect. A friend is someone to talk to casually. Besides, look at the age difference! Miss Hardbroom is literally 30 years older than Indigo. I doubt such a friendship would work.
Comment: The think is a teacher's job is to teach. The student can't figure out all by themself how to do everything. So it's the job of the teacher to teach them how to do it. It's their job to make it clear what they have to do and what they don't have to do. If the teacher is all casual like a friend, the student will not be able to figure out when something is a rule and when something is just a suggestion for how to play with them like a friend.
Answer: I think it's to do with the fact that a teacher's job is to teach. A student doesn't have God like abilities to enable their teacher to take for granted that if they give them any kind of wrong instruction including suggestion of an activity like a friend, they will recognize that it's not actually something they have to do and talk back about it. If the teacher teaches the wrong way, the student will be unable to believe the teacher wouldn't properly teach them what it is they're supposed to do and learn it the wrong way.


Dyes that can stain oil and water

Question: Is there such a thing as a dye that can stain both oil and water?  In other words, does anyone know of an amphiphilic dye?  Maybe a surfactant that is also a pretty shade of blue?  Or maybe turn one color in oil, but another in water, but stain both well?
Thanks
Comment: Perhaps not a direct answer to your question, but I would imagine that anionic, water-soluble dyes could be transferred into organic solvents by use of a [phase-transfer catalyst](http://en.wikipedia.org/wiki/Phase-transfer_catalyst).
Comment: A napthalimide made with a PEO oligomer amine might split the difference in Day-Glo, doi:10.1016/j.jphotochem.2010.09.002
Answer: The diazo dye (1), known as Solvent Yellow 124 or Somalia Yellow is soluble in aliphatic hydrocarbons. In the European Community, it is used to mark low-taxed diesel fuel (for heating purposes). In order to prevent its use in cars, samples are acidified. This results in acetal cleavage and protonation of the diazo-fragment, yielding the red, water-soluble iminoquinone species (2)

Since this is probably not exactly what you wanted, what about dyes that exist in a neutral and a zwitterionic form, depending on the polarity of the solvent?

Brooker's merocyanine is one of the most prominent examples and show strong solvatochromism, i.e. the colour changes with the polarity of the solvent

Dyes that can stain oil and water


how to know the public address of a wallet that sent me funds (bitcoins), using python

Question: I have a website that will show a QR code of my bitcoin wallet (public key), I will ask the client to deposit bitcoins there, I want to know which wallet (public key) was the one that deposited this in order to know which client is paying for a service that I am going to give you. I am using Python and Django to create the WEB page
Answer: You cannot; Bitcoin has no concept of a "sender" of a transaction.
If you want to know which invoice/bill has been paid, give out a new address for every payment you expect.
Bitcoin block explorer sites sometimes do show the "input addresses" of a transaction, but these do not have the properties you generally expect from a sender:

There may be 1, or more, or even no identifiable input addresses.
The addresses may not all belong to the sender, in case of a payjoin transaction.
The addresses may not belong to the sender at all. For example if the sender uses an exchange site, the addresses you see will belong to the exchange.
You don't know anything about where money goes if you'd try to send coins back there. If you want a refund address, you need to ask the payer for one.
Comment: As Pieter wrote, a wallet doesn't have an address. A wallet has control over "coins" previously sent to many "addresses" created by that wallet for receiving that money. When you are paid, the sender's wallet chooses which coins to use to make up the amount and thus what  "addresses" to use. The user usually has no control over which coins (and therefore addresses) are used unless their wallet offers a feature called coin control and the user chooses to use it. All addresses are functionally like an invoice-reference-number.
Comment: @evvrivas For the reasons I elaborated on above, that does not work; Bitcoin simply has no concept of a "sender address". If you want to determine which client paid you, give each client a separate address, and remember which address belongs to whom.
Comment: If I know the public address of my client's wallet, how do I know when and when BTC has been sent to my wallet? How can I do that query?
Answer: That won't work: Bitcoin transactions do not reliably identify the sender.
Bitcoin addresses are unlike (e)mail addresses. Think of bitcoin addresses as "invoice identifiers": whenever you want to get paid, request to be paid to a new address on your invoice. Then, whenever you get paid, you know which invoice was paid.
Bitcoin wallets have many addresses and addresses should not be reused.


Are Loop Closure Equations and Holonomic Constraints the same thing?

Question: I'm reading a book on robotics, and it has a different section on each term. The way both concepts are worded and phrased mathematically make them seem like they both constrain the configuration space of a closed loop mechanism in more or less the same way. I'm not sure if I'm missing something, but they seem like the same thing.
Answer: Is a cell phone and a pocket calculator the same thing? It's not, but a cell phone is often used as one (using the app).
I think it depends on the context. In many multi body simulation solvers, holonomic constraints are the usual way to model joints. Think of it as using "loop closures" in all places, as a convenient way to not set up equations recursively.
I am not sure about that, but there may also be other ways to close the (algebraic - this what you mean?)  loop.


Increasing the pressure inside a diving bell

Question: Is it physically possible to increase the pressure inside a water diving bell so that it exceeds the pressure outside it while submerged by allowing water into it?
Answer: Not that I'm aware of, no.
The interface between the air pocket and the surface of the water should be approximately the same pressure.  If they were not at the same pressure, then once would be pushing against the other with a greater force, and the interface would move until the forces equalized (therefore the pressures approximately equalize).
Adding more water of the same pressure to the bell would not increase the air pressure.  To get that water in, you would either need to let air out, or pressurize the water to greater than the surroundings.  If you add in pressurized water, you may temporarily increase the pressure of the air.
So pumping in more water would work as long as you keep the pump going, but letting in more water implies a natural flow; which wouldn't happen when the air and water are the same pressure.


Solr - Customize Fragment

Question: I want to use Regexp Fragmenter in my solr highlighting feature to customize my fragment.
As per requirement , we need to return 25 words before and after highlighting term.
Below is one sample highlight fragment.
Some polls show a major gender gap between men and women when it comes to gun control. A Washington Post/ABC News poll in January showed that women supported a semi-automatic gun ban by 20 more points than men. They favored a ban on high-capacity magazines by 15 points.
To do so, I have made below regular expression
((?:\w+\W*){25})\b(span class)\b((?:\W*\w+){25})

This regular expression working fine with the simple string. (tested) , but while using it with solr, it does not seems to work properly.
Few highlights coming fine, but for few highlights , the highlight term comes in very start of highlighting fragment.
I am not sure, that regexp fragmenter can do, what I need. And is there any other ways to fulfil this requirement.
Can anybody suggest me on this?
Answer: Possessive Quantifier (an extra "+") will do the trick:
((?:\w++\W*+){25})\b(span class)\b((?:\W*+\w++){25})

Solr - Customize Fragment


Would a perfectly clean and perfectly smooth champagne glass have no bubbles?

Question: My understanding is that nucleation sites for bubbles in a champagne glass are either due to defects in the glass or due to fibers in the glass (see this article for details on that statement). Does this imply that champagne poured into an absolutely clean and perfectly smooth glass would have no bubbles?
Comment: I recall learning in one of my physics courses that the amount of energy necessary to produce a bubble was $\propto$ r$^{-2}$, where r is the radius of the bubble.  So if the bubble starts from zero radius, it would effectively take infinite energy to form.  However, my prof. quickly pointed out the irrelevance of this idea since everything has "corners" or impurities and nothing is perfectly smooth.
Answer: No, the bubbles will still originate inside the liquid, but the process is usually slower. It is called homogeneous nucleation. In nature most nucleation is on surfaces, also called heterogeneous nucleation.
Answer: Disclaimer: this is me hypothesizing. Anyone with actual facts at their disposal is encouraged to contradict me.

No, there would be no bubbles formed in the champagne. The reason for this is found in the comment by @honeste_vivere : inside a very small bubble, the pressure (because of surface tension) is very large. In fact, for a bubble of radius $r$, the cross sectional area is $\pi r^2$ and the circumference is $2\pi r$ so the pressure is
$$P = \frac{2\pi r \sigma}{\pi r^2}=\frac{2\sigma}{r}$$
where $\sigma$ is the surface tension (which has units of force per unit length - so multiplying by the circumference gives force, and dividing by area gives pressure).
The problem with this equation is that the pressure becomes "infinite" as the radius becomes very small. And for a very small bubble, this means that the pressure would be so great that $CO_2$ is driven back into solution.
In other words - in the absence of nucleation, there is a minimum bubble size needed for bubbles to be able to grow - and bubbles cannot spontaneously get to that size. When a nucleation site is present, it alters the balance of forces so bubbles can form.
For cold champagne, the surface tension is around 40 - 50 mN/m (source). The pressure inside a closed bottle of champagne is about 6 atm (source)_.
It is reasonable to assume then that if a bubble can get to the size where the excess pressure due to surface tension is less than 5 atm (plus the atmosphere itself makes 6), then it will grow with no problem. What is that critical size?
$$r_{crit} = \frac{2\cdot 50mN/m}{10^5 N/m^2} = 1µm$$
This is considerably smaller than the size of a champagne bubble "at the surface" which is about 0.5 mm (same source) - this makes sense of course, as the bubble, once it starts to form, can keep growing.
But can a 1 µm bubble form spontaneously? I think the answer is "absolutely not". At that size, it contains approximately  $1.4\cdot 10^7$ molecules of CO2. I don't believe a statistical fluctuation can achieve such a large bubble - the force pushing the gas back into the liquid would be too large. You need "something" to bring about nucleation.
Comment: Hey, have you had any voting activity on this question today? (I've just gotten 4 spurious downvotes across a few sites)
Comment: @AlecTeal No, nothing. I can't explain what happened to you, sorry. "Serial down voting" is typically detected and automatically reversed, although if it happens across multiple sites it may stay below the detection threshold. This stuff sometimes happens on SE. Shrug and move on is the best advice I can give you. But I know it sucks when it happens. Been there myself.
Comment: Thanks for the reply (I know it's really off topic) if it persists (across sites) can I report it do you think, does it help if I have a theory already of who it might be?
Comment: You could flag one of the downvoted answers for moderator attention, and describe the problem that you see (in the flag comment). For four downvotes it is unlikely they will take action - if it continues they might. Good folks, our moderators. But busy.
Comment: Ingenious argument.  There is a similar obstacle (in reverse) to the formation of fog droplets when moist air is cooled.  To prove extreme improbability, you might estimate the energy barrier and compare it to *kT*.
Answer: Just to add to the existing answer:
If you put a rough mint into a carbonated drink it famously erupts, this is nucleation, the craters form "nucleation sites" where bubbles can form, the same happens with the metal element inside a kettle.
However if you microwave water in a clean glass beaker it will not boil DO NOT TRY THIS but if you drop something in the really-hot water bubbles can form on that object and it will spit hot water and steam everywhere.
In water there no "homo" (same) nucleation, there is hetro (different) between the thing you drop in and the water.
With champagne (and indeed Shweps Lemonade) and probably Pepsi Max and a whole host of other fizzy drinks if you gently tap the glass against the table the bubbles will dislodge from the side and you will then be able to see inside the liquid, you will notice that bubbles seem to be spawning from no-where, in the liquid itself this prove that you don't need hetrogenous nucleation by example as the liquid is clearly capable of emitting bubbles.
This is actually to do with partial pressures of the gas, there is carbon dioxide dissolved in the liquid that doesn't want to be there, inside the bottle the pressure is keeping it in (it's "easier" to stay in the liquid than not) which is why it wont bubble when you shake a bottle, however open the bottle once it will froth the next time and so forth.
This is more of an evidence based answer, hope it helps.
Comment: Just got a downvote today, some 8 months later, any ideas why?
Comment: I think the "nowhere" bubbles you describe are actually forming on microscopic nucleation sites (particulates in the liquid). Just because you don't see them doesn't mean they are not there.


Can't get rid of x11vnc output

Question: I'm on an Ubuntu system which has a touchscreen set up on display :0.
I wanted to be able to control this touchscreen remotely from Windows, so I set up x11vnc. It works great. But here's the setup:
I have two users (excluding root). One restricted user (basically no permissions, and no password) who logs in automatically to the touchscreen, and one fully configured user with a complex password, sudo permission, etc. I only really care about starting x11vnc when the restricted user logs in (touchscreen becomes active), so I put the command x11vnc -loop & at the end of the file /home/restricted/.profile. Works fine. Note, however, that it has to be a background process because there's other commands that this user has to run (hidden from the human user) later on.
The problem I'm having is that x11vnc is very noisy with its output. Especially if you don't use a password (which I don't), and it's a loop so it just keeps on repeating. Usually this wouldn't be an issue, but not only is redirecting the output to /dev/null not working (explained below), but the output is appearing on the other user's terminal when I log in via ssh to it (which is really annoying because I use that account for maintenance and its impossible to do anything when your screen is being filled with output of some background process. Here's an example of the output I get:
--- x11vnc loop: 1 ---

--- x11vnc loop: waiting for: 1551

###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  **  WARNING  **  WARNING  **  WARNING  **  WARNING  **   @#
#@                                                           @#
#@        YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!!        @#
#@                                                           @#
#@  This means anyone with network access to this computer   @#
#@  may be able to view and control your desktop.            @#
#@                                                           @#
#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
#@                                                           @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  You can create an x11vnc password file by running:       @#
#@                                                           @#
#@       x11vnc -storepasswd password /path/to/passfile      @#
#@  or   x11vnc -storepasswd /path/to/passfile               @#
#@  or   x11vnc -storepasswd                                 @#
#@                                                           @#
#@  (the last one will use ~/.vnc/passwd)                    @#
#@                                                           @#
#@  and then starting x11vnc via:                            @#
#@                                                           @#
#@      x11vnc -rfbauth /path/to/passfile                    @#
#@                                                           @#
#@  an existing ~/.vnc/passwd file from another VNC          @#
#@  application will work fine too.                          @#
#@                                                           @#
#@  You can also use the -passwdfile or -passwd options.     @#
#@  (note -passwd is unsafe if local users are not trusted)  @#
#@                                                           @#
#@  Make sure any -rfbauth and -passwdfile password files    @#
#@  cannot be read by untrusted users.                       @#
#@                                                           @#
#@  Use x11vnc -usepw to automatically use your              @#
#@  ~/.vnc/passwd or ~/.vnc/passwdfile password files.       @#
#@  (and prompt you to create ~/.vnc/passwd if neither       @#
#@  file exists.)  Under -usepw, x11vnc will exit if it      @#
#@  cannot find a password to use.                           @#
#@                                                           @#
#@                                                           @#
#@  Even with a password, the subsequent VNC traffic is      @#
#@  sent in the clear.  Consider tunnelling via ssh(1):      @#
#@                                                           @#
#@    http://www.karlrunge.com/x11vnc/#tunnelling            @#
#@                                                           @#
#@  Or using the x11vnc SSL options: -ssl and -stunnel       @#
#@                                                           @#
#@  Please Read the documention for more info about          @#
#@  passwords, security, and encryption.                     @#
#@                                                           @#
#@    http://www.karlrunge.com/x11vnc/faq.html#faq-passwd    @#
#@                                                           @#
#@  To disable this warning use the -nopw option, or put     @#
#@  'nopw' on a line in your ~/.x11vncrc file.               @#
#@                                                           @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
###############################################################
20/05/2016 10:53:18 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 1551
20/05/2016 10:53:18 XOpenDisplay("") failed.
20/05/2016 10:53:18 Trying again with XAUTHLOCALHOSTNAME=localhost ...
20/05/2016 10:53:18
20/05/2016 10:53:18 *** XOpenDisplay failed. No -display or DISPLAY.
20/05/2016 10:53:18 *** Trying ":0" in 4 seconds.  Press Ctrl-C to abort.
20/05/2016 10:53:18 *** 1 2 3 4
Invalid MIT-MAGIC-COOKIE-1 key20/05/2016 10:53:22 XOpenDisplay(":0") failed.
20/05/2016 10:53:22 Trying again with XAUTHLOCALHOSTNAME=localhost ...
Invalid MIT-MAGIC-COOKIE-1 key20/05/2016 10:53:22 XOpenDisplay(":0") failed.
20/05/2016 10:53:22 Trying again with unset XAUTHLOCALHOSTNAME ...
Invalid MIT-MAGIC-COOKIE-1 key20/05/2016 10:53:22

20/05/2016 10:53:22 ***************************************
20/05/2016 10:53:22 *** XOpenDisplay failed (:0)

*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

Some tips and guidelines:

** An X server (the one you wish to view) must be running before x11vnc is
   started: x11vnc does not start the X server.  (however, see the -create
   option if that is what you really want).

** You must use -display <disp>, -OR- set and export your $DISPLAY
   environment variable to refer to the display of the desired X server.
 - Usually the display is simply ":0" (in fact x11vnc uses this if you forget
   to specify it), but in some multi-user situations it could be ":1", ":2",
   or even ":137".  Ask your administrator or a guru if you are having
   difficulty determining what your X DISPLAY is.

** Next, you need to have sufficient permissions (Xauthority)
   to connect to the X DISPLAY.   Here are some Tips:

 - Often, you just need to run x11vnc as the user logged into the X session.
   So make sure to be that user when you type x11vnc.
 - Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
   file may be accessed.  The cookie file contains the secret key that
   allows x11vnc to connect to the desired X DISPLAY.
 - You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
   by the -auth option, e.g.:
       x11vnc -auth /home/someuser/.Xauthority -display :0
       x11vnc -auth /tmp/.gdmzndVlR -display :0
   you must have read permission for the auth file.
   See also '-auth guess' and '-findauth' discussed below.

** If NO ONE is logged into an X session yet, but there is a greeter login
   program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
   to find and use the raw display manager MIT-MAGIC-COOKIE file.
   Some examples for various display managers:

     gdm:     -auth /var/gdm/:0.Xauth
              -auth /var/lib/gdm/:0.Xauth
     kdm:     -auth /var/lib/kdm/A:0-crWk72
              -auth /var/run/xauth/A:0-crWk72
     xdm:     -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
     dtlogin: -auth /var/dt/A:0-UgaaXa

   Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.

   Starting with x11vnc 0.9.9 you can have it try to guess by using:

              -auth guess

   (see also the x11vnc -findauth option.)

   Only root will have read permission for the file, and so x11vnc must be run
   as root (or copy it).  The random characters in the filenames will of course
   change and the directory the cookie file resides in is system dependent.

See also: http://www.karlrunge.com/x11vnc/faq.html

 --- x11vnc loop: sleeping 2000 ms ---

 --- x11vnc loop: 2 ---

And that just repeats on and on.
It's yelling at me about not being able to open the display, but it works. I'm guessing this is because the restricted user already ran this command and it connected fine, but now this user is trying to do so as well, so it can't connect.
Why is this happening? There's clearly some hole in my understanding. Here are the different things I tried:

Redirecting output to /dev/null
In the same place, /home/restricted/.profile I tried replacing the existing command x11vnc -loop & with x11vnc -loop > /dev/null 2>&1 &.
This had zero effect, output was still on other user's terminal and (obviously) didn't go away.

Running command with nohup
Again in /home/restricted/.profile, I tried replacing the existing command x11vnc -loop & with nohup x11vnc -loop &.
Once again, this had no effect at all. Output was still there. Nohup didn't even create a nohup.out file. At least, I couldn't find it.
For sake of completion, I also tried nohup x11vnc -loop > /dev/null 2>&1 & again, nothing changed.

Starting x11vnc as a daemon
Here, I started realizing that I was doing something wrong. I figured that maybe it was because /home/restricted/.profile was the wrong place to put this kind of thing. So I made a script in /etc/init.d to be run on boot and made the link with update-rc.d following the example of the skeleton file.
Once again, x11vnc worked, but the output was on all my terminals.

Starting x11vnc in screen
My last attempt at fixing this thing was throwing the command in a screen session. Screen usually fixes problems like this for me... But not this time.
In /home/restricted/.profile, I replaced x11vnc -loop & with screen -d -R x11vnc x11vnc -loop
This time, x11vnc didn't work anymore (wasn't able to connect via Windows client), but the output was STILL on all the terminals.

Again, clearly there's something I'm not understanding either about x11vnc or spawning a process on boot.
As you might have been able to tell from the above, I've been at this troubleshooting for a while and can't find anything else on the web about this. So help here would be awesome. Thanks in advance.
Comment: Maybe if you detach it from controlling tty, for example with `setsid`, it will calm down? Always wondered about x11vnc being such VERY noisy. However 0.9.3 which I am using is not noisy if I will just daemonize it.
Comment: Your command `x11vnc -loop & > /dev/null 2>&1` has the `&` in the wrong place. It must be at the end, as it is like a `;` and ends a command. Also try `-q` and `-o logfile` for the output.
Comment: @meuh Whoops! You're right, my bad. I just fixed it and tried again, but it didn't resolve the problem. I will fix my code above so that others don't assume the same problem though.
Answer: The >& to redirect output worked for me.
x11vnc -repeat -noxdamage -ncache 10 -forever -loop -rfbauth &> x11vnc.log

Can't get rid of x11vnc output


How can potassium rich foods reduce blood pressure?

Question: How come sodium increases blood pressure, but potassium, which has to some extent similar properties helps lower it?
Answer: potassium is really the main guy in charge of everything that happens involving action potentials which in turn govern homeostasis such as blood pressure.
k+ lowers blood pressure due to making it harder to get an action potential going, which in the macro scale causes the heart to pump less.
too much k+ kills the person as it stops the pumping of blood (lethal injections are just lots and lots of k+ along with some pain killing drugs)
Comment: This provides some information but does not fully answer the question. Why is $K^+$ the main "guy" rather than $Na^+$.  The question assumes that they have similar properties. In what ways relevant to the question are these two ions different?
Comment: I agree with @vkehayas but I'd go a step further to say that this answer is completely wrong as far as the mechanisms for what the OP is asking about. We aren't talking about lethal injection levels of K+ or anything about K+ concentration effects on action potentials when talking about K+ effects on blood pressure.


How to add TwitterBootstrap to Symfony2

Question: I want to use TwitterBootstrap in my Symfony2 bundle. Please give me a advise how to do that right way.
I use composer to install TwitterBootstrap into my vendor derectory (composer require twitter/bootstrap).
How to link css & js in to my twig template?
Answer: Thank you for the help.
For now I don`t  want to use additional bundles or other thinks. I just want to connect css and js files to my template.
Solution I use for now is:

Install fia composer jquery and twitterbootstrap in vendor/components/jquery and vendor/twbs/bootstrap directories
In config.yml I create a named assets:
# Assetic Configuration
assetic:
    assets:
        twbs_js_and_jq:
            inputs:
                - '%kernel.root_dir%/../vendor/components/jquery/jquery.min.js'
                - '%kernel.root_dir%/../vendor/twbs/bootstrap/dist/js/bootstrap.min.js'
        twbs_css:
            inputs:
                 - '%kernel.root_dir%/../vendor/twbs/bootstrap/dist/css/bootstrap.css'
        bootstrap_fonts_woff:
            inputs:
                - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.woff'
            output: fonts/glyphicons-halflings-regular.woff
    bootstrap_fonts_ttf:
            inputs:
                - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.ttf'
            output: fonts/glyphicons-halflings-regular.ttf
    bootstrap_fonts_svg:
        inputs:
            - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.svg'
        output: fonts/glyphicons-halflings-regular.svg
    bootstrap_fonts_eot:
        inputs:
            - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.eot'

It's important to create jQuery asset first. Assetic changes the paths to your assets, this will break any background images (or other paths) that uses relative paths, so I ned to add rule for the font files to make glyphicons work (find example here).
In the head section of layout.html.twig file I paste:
{% javascripts '@twbs_js_and_jq' %}

{% endjavascripts %}

{% stylesheets '@twbs_css' filter='cssrewrite' %}
     <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

All worked!
Answer: An easy way to integrate Bootstrap is to declare the stylesheet in the base.html.twig file :
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

You can also use asset to load your stylesheet. Have a look to Templating with Symfony
Comment: Thank you! Is it possible to link styles from not public directory (from vendor/twitter/bootstrap)?
Comment: Yes, you just have to hard-code the stylesheet in your templates. And not use `asset`
Comment: I use assetic to link TB from vendor directory. Named assets with link : `'%kernel.root_dir%/../vendor/twbs/bootstrap/dist/js/bootstrap.min.js'`
Answer: As all knows Bootstrap is related to assets, and all third party bundles, or direct includes lookls ugly (mostly form /vendor/ directory do not do this!). So better use Bower what created special for managing your asstes. You can configura it for install all assets to Symfony2 web directory and then use assets in twig. Here is some links for documentation:
Instalation guide
Configuration
Hope this will help to you :)
Answer: Another way would be to use the MopaBootstrapBundle.
With this Bundle you get a really great integration into Symfony, for example twig extensions and templates for use with Symfony Form component, so you don't need to style everything by yourself.

How to add TwitterBootstrap to Symfony2


The word "distinguished" in algebra

Question: When we define something like a ring, we often say that the elements $0$ and $1$ are "distinguished elements". What does this mean? It obviously doesn't mean they are distinct.
Answer: You are correct: "distinguished" doesn't mean that the points are different from each other. A "distinguished point" in an algebraic structure can be thought of as a point that has a label attached to it: in a ring, "I AM THE ADDITIVE IDENTITY!" for point 0, and "I AM THE MULTIPLICATIVE IDENTITY!" for point 1. In the trivial ring, a point can have both these labels attached to it.
Comment: Thanks. This clears things up.
Comment: Also there is the (implicit?) assertion of _existence_: a ring must have at least the element $0$, and if it is said to have "a unit" must have an element $1$. This use of "distinguished" is pretty bad, in my opinion, since it does not connect with either colloquial or substantial mathematical usage, although there does appear to be a pattern of this usage in the last few decades.
Answer: In my experience, in algebra, "distinguished elements" never implies that the elements are distinct. One usage is to denote named constants (a.k.a. nullary operations) in algebraic structures, such as constants $0$ and $1$ in rings - the additive and multiplicative identity elements, respectively. Similarly one may speak of structures with distinguished maps, e.g. groups with distinguished operators, vector spaces with distinguished linear maps e.g. (when deriving normal forms for matrices), and rings with a distinguished automorphism (e.g. in difference algebra, which studies solutions of difference equations = recurrences).
A quick search of Google Books confirms this usage, e.g. see definitions of rings and fields in Cohn, Skew Fields p. 3; Enderton, Set Theory, p. 122; Jacobson, Basic Algebra, p. 86;  Lidl and Niederreiter, Finite Fields, p.12; Rowen, Ring Theory p. 2, etc.
Comment: I'd strongly second @Bill Dubuque's note. That is, "distinguished elements" should _not_ (necessarily) be construed to mean that the things named are different-from-each-other, even if their names are different. Rather, they are "constants" in the "theory of" the objects at hand. The only real "corollaries" of such assertions are things like the point that the underlying set of a group cannot be the empty set, because it contains at least the "identity" element. The "issue" of whether $0=1$ in a ring is not a real issue, and this is not the issue at hand, either.
Answer: distinguished:
set-apart-from; notable; noted; eminent; of particular importance; distinct, distinctive.

To disambiguate the different connotations of "distinguished", we need context.
E.g. In algebra, e.g. in a ring or field, $0$ is distinguished by the fact that it represents the additive identity, and $1$ is distinguished by the fact that it is the multiplicative identity. So $0$ and $1$ are certainly distinguished (set-apart-from other elements, of particular importance, which happen also to be distinct, except for the case of the trivial ring).
Comment: This answer rather misses the point: "set apart" is too ambiguous to answer the question at all, and as OP said themself, "distinct" is certainly not what's meant, even though the elements may happen to be distinct as well.
Comment: @Peter: that's why I pointed out that 0 is the additive identity, and 1 is the multiplicative identity: these elements are of particular importance in that, without them, we would not have a ring, or a field. The fact that they also usually happen to be distinct is besides the point!
Comment: Fair enough — yes, I think it's a lot clearer since the edits.
Answer: If you don't recognize that many expressions are simply abbreviations, and that meta terms are freely used, you will quickly get things wrapped around the axle. The statement that 0 and 1 are distinguished points is an abbreviation for the statement that 0 is a distinguished point and 1 is a distinguished point, and the term 'distinguished' is a meta term, with no object-level mathematical meaning, being used for purely psychological reasons, that is, as a sort of verbal highlighting.

The word "distinguished" in algebra


complexity of computing the singular vector corresponding to the smallest singular value

Question: It is known that the singular value decomposition of an $m \times n$ matrix $A$ is in general of complexity of the order $m n^2$, assuming that $m \ge n$. But what if we only want to compute say the singular vector corresponding to the smallest singular value? Can we do this significantly faster than $m n^2$ operations? Please note that $A$ is not assumed to have any specific structure, such as being sparse.
Comment: This seems to boil down to computing the smallest eigenvalue of the $n \times n$ matrix $A^T A$ and then calculating its associated eigenvector.  However, if the matrix is not sparse, it naively seems like this cannot be done cheaply using iterative methods.
Comment: @NawafBou-Rabee: I agree.
Comment: You want the smallest nonzero singular value, right? Even then, what if there are multiple equal (or nearly equal) values?
Comment: @BrianBorchers: Actually what i really want is to compute a right nullvector of $A$. And when $A$ is full rank, i want to compute the right singular vector corresponding to its smallest singular value. I don't really care about computing the actual singular value though. And if there is some clustering of small singular values, then computing any corresponding singular vector would also do.
Answer: The question has been studied at some length. See, for example,
Hubert Schwetlick and Uwe Schnabel, MR 1997360 Iterative computation of the smallest singular value and the corresponding singular vectors of a matrix, Linear Algebra Appl. 371 (2003), 1--30.
And
Qiao Liang and Qiang Ye, MR 3291626 Computing singular values of large matrices with an inverse-free preconditioned Krylov subspace method, Electron. Trans. Numer. Anal. 42 (2014), 197--221.
I can't seem to find theoretical complexity result, but the practical performance seems comparable to computing the maximal singular value.
Comment: After looking at these papers and some others, i have the impression that the complexity is larger than that of computing the largest singular pair (which is $n^2$). I think the reason for this is that to compute the smallest singular pair iterative methods solve at each iteration some system of linear equations whose coefficient matrix is at least as large as $A$ (in an inverse power iteration style). Please let me know if you agree or think otherwise.


Using gdal2tiles on mac

Question: I need to create some map illustrated tiles to use in leaflet.js for a small web-app I'm building. So far I've been unable to install and configure the GDAL package to work for me.
The things I have tried so far (all on mac OS 10.15.4):

download and installed GDAL2.4 package from http://www.kyngchaos.com/software/frameworks/
Once that was done, I scratched my head a lot, as I couldn't really find any documentation as to how exactly I'm supposed to use the package - sure it's installed, but what does that give me exactly?
After much searching and guessing, I found the script I wanted to run - gdal2tiles.py in my /Library/Frameworks/GDAL.Framework/Versions/2.4/Programs directory and from there was able to try running:
$ python gdal2tiles.py [args] but it returned an error:

File "gdal2tiles.py", line 52, in
from osgeo import gdal
ModuleNotFoundError: No module named 'osgeo'
4. from there, I went down multiple rabbit holes

checking python versions (apparently I need to run 3.6 and I now am)
uninstalling/reinstalling all the things

But nothing fixes the problem.
Eventually I came across this post which suggests you can install GDAL2 via homebrew, which to me seems like it should be easy.. but no - whilst the process outlined was easy to follow, it left me with the same issue - I have GDAL installed, but no idea how to run the gdal2tiles.py script -I can still run the steps I outlined above and I get the same result. I'm guessing now I probably have multiple versions of GDAL installed which will bite me some other way.
Can anyone help me with this?
Essentially an idiots guide to installing and using GDAL would be perfect - all the info I can find during days of internet trawling seems to assume that I should know the answers already, but I'm not a Python dev, and have never run python packages before.
The main problems I would love solved would be:

The first issue - how do I install or make the osgeo module available to my gdal2tiles script?
If that's going to be too difficult, how can I access and use the gdal2tiles.py script through my homebrew installed version of GDAL2?

Some extra info
$ gdalinfo --version
returns GDAL 2.4.2, released 2019/06/28
If I open a python 3.6.5 shell, and try import gdal I get ModuleNotFoundError (someone suggested that this would test if gdal was "available" to my python install).
I've added a bunch of stuff to my .bash_profile as I've tried out different things and I have no idea what is helping or hindering anymore, so my .bash_profile now includes:
export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
export PATH=/Library/Frameworks/GDAL.framework/Versions/2.4/Programs:$PATH
export PATH=/Users/smallmighty/Library/Python/3.7/bin:$PATH
export PATH=/Library/Frameworks/GDAL.framework/Programs:/Library/Framework/PROJ.framework/Programs:/Library/Frameworks/SQLite3.framework/Programs:/Library/Frameworks/UnixImageIO.framework/Programs:$PATH
export PYTHONPATH="/Library/Frameworks/GDAL.framework/Programs/"
export PYTHONPATH="/Library/Frameworks/GDAL.framework/Versions/2.4/Programs"

Comment: Did you install the gdal python bindings?
Comment: Hi @IanTurton no I didn't, I was unaware that it was a thing. I'm unable to find any relevant references to the process either. Do you have any useful resources you could point me to?
Comment: sorry, I'm not a mac user - but that would be the solution on windows and linux
Answer: As a solution for this I'll recount my experience. I'm currently running OSX and needed to tile some geoTiffs. I noticed that my existing GDAL installation didn't have gdal2tiles so I opted to use the python library gdal2tiles. The execution was a little different and out of the box requires you to create a python script to run gdal2tiles.generate_tiles(...)
The generated html pages are a good start but I'd suggest creating your own previewer with Leaflet following the instructions here
I'd also suggest using virtual environments with python which allows you to install libraries for specific projects instead of globally. Here's some instruction on this too https://docs.python.org/3/library/venv.html
Answer: Under Python, install osgeo. You can use pip install or conda install. Then it should work.

Using gdal2tiles on mac


Why we use GPIO for embedded systems?

Question: I'm using an F2802x microcontroller and I saw in Embedded Coder in Simulink that I have Digital output block. When I use this block, how does it work?
Comment: There seems to be a mismatch between the header and body. Also the way its beibg asked is incredibly broad. Please fix the question to something more understandable and manageable. What do you want to achieve?
Answer: GPIO stands for General Purpose Input Output. Lets assume you want to generate a pulse at pin 39 as in the below image. So when you wire the pulse to pin 39 the underline software will generate the necessary code to configure pin 39 to be an output pin enabling the pin to output a pulse.

Below is the code stack between Simulink and Microcontroller. So when you create a Digital Output block the software will essentially convert and configure your Digital Output block into a Digital output pin. The code will convert into binary code to be able to loaded into the micro controller. Below is a high level diagram that explains the process.

References:

C2000 Digital Signal Controllers
Embedded Coder Target for Energia

Why we use GPIO for embedded systems?