Why is True returned when checking if an empty string is in another?

Question: My limited brain cannot understand why this happens:
>>> print '' in 'lolsome'
True

In PHP, a equivalent comparison returns false (and a warning):
var_dump(strpos('lolsome', ''));

Comment: So perhaps PHP is wrong here? The empty string *is* present, in all strings.
Comment: I actually think this is an interesting question.  I hope it doesn't get closed while I'm researching.
Comment: not a question to be down-voted so hard.
Comment: Indeed, this is not as much about why is Python behaving right, but why is PHP behaving wrong (as always).
Comment: @thefourtheye I edited because I do want to find a empty string into a string with chars, and strpos signature is `strpos ($haystack ,$needle)`, so, my first PHP example was wrong, just as you have stated in your answer.
Comment: @Marcelo I am sorry, your last edit changes the meaning of the question drastically. So, I had to revert your edit.
Comment: I can't understand why anyone expects otherwise.
Answer: From the documentation:

For the Unicode and string types, x in y is true if and only if x is a substring of y. An equivalent test is y.find(x) != -1. Note, x and y need not be the same type; consequently, u'ab' in 'abc' will return True. Empty strings are always considered to be a substring of any other string, so "" in "abc" will return True.

From looking at your print call, you're using 2.x.
To go deeper, look at the bytecode:
>>> def answer():
...   '' in 'lolsome'

>>> dis.dis(answer)
  2           0 LOAD_CONST               1 ('')
              3 LOAD_CONST               2 ('lolsome')
              6 COMPARE_OP               6 (in)
              9 POP_TOP
             10 LOAD_CONST               0 (None)
             13 RETURN_VALUE

COMPARE_OP is where we are doing our boolean operation and looking at the source code for in reveals where the comparison happens:
    TARGET(COMPARE_OP)
    {
        w = POP();
        v = TOP();
        if (PyInt_CheckExact(w) && PyInt_CheckExact(v)) {
            /* INLINE: cmp(int, int) */
            register long a, b;
            register int res;
            a = PyInt_AS_LONG(v);
            b = PyInt_AS_LONG(w);
            switch (oparg) {
            case PyCmp_LT: res = a <  b; break;
            case PyCmp_LE: res = a <= b; break;
            case PyCmp_EQ: res = a == b; break;
            case PyCmp_NE: res = a != b; break;
            case PyCmp_GT: res = a >  b; break;
            case PyCmp_GE: res = a >= b; break;
            case PyCmp_IS: res = v == w; break;
            case PyCmp_IS_NOT: res = v != w; break;
            default: goto slow_compare;
            }
            x = res ? Py_True : Py_False;
            Py_INCREF(x);
        }
        else {
          slow_compare:
            x = cmp_outcome(oparg, v, w);
        }
        Py_DECREF(v);
        Py_DECREF(w);
        SET_TOP(x);
        if (x == NULL) break;
        PREDICT(POP_JUMP_IF_FALSE);
        PREDICT(POP_JUMP_IF_TRUE);
        DISPATCH();
    }

and where cmp_outcome is in the same file, it's easy to find our next clue:
res = PySequence_Contains(w, v);

which is in abstract.c:
{
    Py_ssize_t result;
    if (PyType_HasFeature(seq->ob_type, Py_TPFLAGS_HAVE_SEQUENCE_IN)) {
        PySequenceMethods *sqm = seq->ob_type->tp_as_sequence;
        if (sqm != NULL && sqm->sq_contains != NULL)
            return (*sqm->sq_contains)(seq, ob);
    }
    result = _PySequence_IterSearch(seq, ob, PY_ITERSEARCH_CONTAINS);
    return Py_SAFE_DOWNCAST(result, Py_ssize_t, int);
}

and to come up for air from the source, we find this next function in the documentation:

objobjproc PySequenceMethods.sq_contains

This function may be used by PySequence_Contains() and has the same signature. This slot may be left to NULL, in this case PySequence_Contains() simply traverses the sequence until it finds a match.

and further down in the same documentation:

int PySequence_Contains(PyObject *o, PyObject *value)

Determine if o contains value. If an item in o is equal to value, return 1, otherwise return 0. On error, return -1. This is equivalent to the Python expression value in o.

Where '' isn't null, the sequence 'lolsome' can be thought to contain it.
Answer: I dug deeper and found the source code corresponding to the strpos function,
    if (!Z_STRLEN_P(needle)) {
        php_error_docref(NULL, E_WARNING, "Empty needle");
        RETURN_FALSE;
    }

They consider the empty string being searched as a problematic case. So, they are issuing a warning and returning false. Apart from this I couldn't find any document discussing why it is being considered as a problem.
As far as Python is concerned, this behaviour is well defined in the Comparisons section,

Empty strings are always considered to be a substring of any other string, so "" in "abc" will return True.
Comment: Haha, this is awesome, with you going into the PHP source and me into the Python source, this question is really well solved.
Answer: Basically, from math:

The empty set is a subset of every set

The same logic works here. You can consider '' an empty set. And therefore, it's a subset of every string set, since they must be the same type.
>>> a = ""
>>> b = "Python"
>>> a in b
True
>>> set(a).issubset(b)
True
>>> a = set() #empty set
>>> b = set([1,2,3])
>>> a.issubset(b)
True
>>>

But be careful! A subset and a membership are different things.
Comment: The empty string is empty set logic doesn't work with other Python sequences. `set([]).issubset(set([1,2,3]))` is `True`. But, `[] in [1,2,3]` is `False`. Same goes to `tuple`. The empty string is empty set logic is wrong.
Comment: @NizamMohamed `in` operator for a `list` only work for individual items, not a sequence of items, e.g. `[1, 2] in [1, 2, 3]` will also evaluate to `False` as the item `[1, 2]` is not present as an item for the list on the RHS.  `1 in [1, 2, 3]` will evaluate to `True` as that is how the `in` operator will function for a list on the RHS.  The logic for the `in` operator on the `str` on the RHS will match against the whole sequence provided on the LHS, not individual characters in the `str`, hence any empty sequence will be present in any sequence, as per logic.
Comment: Screenshot of text is rarely useful here on [so]. The text cannot be searched for, nor copy-pasted. Always include the text itself, at least in the alternate text of the image. The UI elements in this specific screenshot are noisy and confusing (can be mistaken for actual controls when skimming the page).
Answer:
The empty string is the unique string of length zero.
  The empty string is the identity element of the concatenation operation.
  The empty string precedes any other string under lexicographical order, because it is the shortest of all strings.
  The empty string is a legitimate string, upon which most string operations should work.
Wikipedia

 > strlen("");
=> 0
 > "a" . "" == "a";
=> true
 > "" . "a" == "a";
=> true
 > "" < "\0";
=> true

From above, it seems PHP treats the empty string as a valid string.
> strstr("lolsome", "");
strstr(): Empty needle :1

But it doesn't seem to consider the empty string as fully legitimate one. Most probably PHP is the only language which doesn't allow the substring to be searched within a string to be an empty string.
Is it a defensive mechanism? Obviously, programmers don't have to protect the needle with if. If so, why other languages allow this test to pass!!! Language designers have to answer
What's a Python string made up of?
>>> ''.count('')
1

Obviously The empty string has one empty string.
>>> 'a'.count('')
2

One element string has two empty srings.
>>> 'ab'.count('')
3

So it seems Python string is concatenation of one element strings. Each element in a string is sandwiched between two empty strings.
>>> "lolsome".split('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: empty separator

But here Python contradicts the validity of the empty string. Is it a bug?
Ruby and JavaScript pass the test here.
 > "lolsome".split("")
=> ["l", "o", "l", "s", "o", "m", "e"]

I've compiled several language examples from Rosetta code, it's interesting to note that they all allow the empty string in substring search and return true.
AWK
awk 'BEGIN { print index("lolsome", "") != 0 }'

C
int main() {
    printf("%d\n", strstr("lolsome", "") != NULL);
    return 0;
}

C++
#include <iostream>
#include <string>

int main() {
    std::string s = "lolsome";
    std::cout << (s.find("") != -1) << "\n";
    return 0;
}

C#
using System;
class MainClass {
  public static void Main (string[] args) {
    string s = "lolsome";
    Console.WriteLine(s.IndexOf("", 0, s.Length) != -1);
  }
}

Clojure
(println (.indexOf "lolsome" ""))

Go
package main

import (
    "fmt"
    "strings"
)
func main() {
    fmt.Println(strings.Index("lolsome", "") != -1)
}

Groovy
println 'lolsome'.indexOf('')

returns 0, on error returns -1
Java
class Main {
  public static void main(String[] args) {
    System.out.println("lolsome".indexOf("") != -1);
  }
}

JavaScript
"lolsome".indexOf("") != -1

Lua
s = "lolsome"
print(s:find "" ~= nil)

Perl
print index("lolsome", "") != -1;

Python
"lolsome".find("") != -1

Ruby
"lolsome".index("") != nil

Comment: C `strstr` also finds the empty `needle` at the beginning of a `haystack`. Considering that so many PHP string functions are modelled after their C counterparts (though there is no *strpos*), this is somewhat surprising.
Answer: Suppose you have 2 piles of similar objects, say, best stanzas of your favorite poet, of 5 and 2 respectively. Does bigger set contains smaller set? How to check:
1) for any stanza in the smaller pile you may find it in a bigger one.
2) smaller pile doesn't contain something which is absent in bigger one.
So we may use this pseudocode to check:
for object in smaller:
    if object not in bigger:
       return 'we found object from smaller absent in bigger'
    else:
       go to next object
return 'all is ok - all objects from smaller are in bigger'

If you haven't found such an object, you come to the end of algo, and think smaller is a subset of bigger.
Now imagine smaller pile is of 0 stanzas.
Applying the same rules above, we perform 0 checks and also do not find object from smaller which is absent in bigger.
So it's correct and handy to deem empty string as a subset of any other string. Even itself. And this is realized in python.
    >>> '' in 'adfsf'
    True
    >>> '' in ''
    True


Hissing Sound with Rode NTG2 Phantom

Question: I have a loud hissing problem using my Rode NTG 2 when it was hooked up to my Tascam D40. When I record from the internal Tascam mics, there isn't a hiss. So I think it's my Rode mic that is causing the hiss. Has anyone dealt with this before? I've tried different input levels and always have the problem with mic. Should I get it replaced with my warranty or is this something I can fix?
Comment: Have you tried different cables?
Comment: Are you using a snake?
Answer: It's the Phantom power.  I've done a lot of testing and the Phantom power adds a lot of noise to the NTG 2. I don't know why, but if you don't run it on phantom power and use it only with batteries, the noise goes away.
Answer: As mentioned in the comments, trying a different XLR cable can make a difference here.
I also make sure that if I've got phantom power turned on (via the TASCAM), that there's no AA battery sitting inside the Rode NTG2. Sticking to just one power source has fixed similar issues for me before.
Answer: Some hand held recorders (including some Tascams) only supply limited current when supplying phantom power and if this isn't enough for the mic you will get noise, and sometimes it won't even work at all.
I have the DR-100 mk3 which can supply 24 & 48 volt phantom power to a maximum of 3mA per channel. If I plug in a mic that needs more than 3mA (even if the voltage is correct) the mic will not perform well.
I don't know what current (mA) the NTG2 needs but some of those Rode mics seem pretty "current hungry" to me (eg the NTG4+ needs 4.5 amps!) so that may be the problem. It would also explain why the mic is ok on its own power.
Answer: Have you applied a low pass and/or high pass filter on the audio?  Mid grade mics often have built in high/low pass filtering but higher end pro mics will leave the audio feed untouched and expect you to fix it in post.

Hissing Sound with Rode NTG2 Phantom


What are some helpful online tools (databases, etc..) for economic analysts?

Question: More specifically, I'm looking for a online database of US economic statistics that is regularly updated. Most of my searches result in older data, that is not particularly useful for what I need it for. I'm needing to make many cross references with it, for instance, comparing the unemployment rate of two cities/regions.
Answer: St. Louis Fed:
https://fred.stlouisfed.org/
Has very good US data.
I am not aware of a database that systematically aggregates city-level data. I recommend state government sites and, for larger cities, city government sites.
Comment: Exactly what I was looking for. I would love to be the one who implements a system that compiles all that data, with continuous delivery. I would imagine it would have to be done with the help of quantum computing. One day...
Answer: Also check out quandl.com. The data from the Fed and World bank type of organizations is usually free and updated regularly, as with most of the public economic data. There are other more curated types of sources which are "premium" and range in prices. To download data you will need an account but its super easy and free. (just username, email address and password, nothing else. You can even use your linkedin or google account)
There are also more data sets being added all the time. With that said, just a suggestion, use the search function if you know what your looking for, if you just use the filters you'll get a return of dozens of pages long.
It's my favorite data source for Fed data. Here's a link to the Fred data: https://www.quandl.com/data/FRED-Federal-Reserve-Economic-Data
While it doesn't look like it at first, the Fred database list above is several 1000's of pages long. A total of 339,641 Fred data sets, all for free! Not to mention other free databases or premium content.
I'm not paid by quandl.com in anyway, just a big fan of the site and use it as much as I can.


Package Manager vs Dependency Manager

Question: What is the difference between a package manager and a dependency manager?
Comment: Duplicate: http://stackoverflow.com/questions/21587901/difference-between-dependency-and-package-managers
Comment: Question and Answer in that post is not short and understandable for me. I wanted key difference and after long research I find out short answer and wrote down. What I wanted is answer for when someone confused and want to shortly look. Thanks anyway.
Answer: TLTR: Package Manager is used for SYSTEM and Dependency Manager for PROJECT

Package Manager - is used to configure system, ie to setup your development environment and with these settings you can build many projects.
Dependency Manager - Is specific to project. You manage all dependencies for a single project and those dependencies are going to be saved on your project. When you start another project you should manage your dependencies again.

EXAMPLE: In PHP world there is COMPOSER as dependency manager and PEAR as package manager. When using composer all your settings and extensions are for single project where pear settings to setup new extension and library to php core.
Comment: I think the confusion comes from the Python world where these terms are used interchangeably. And this makes sense because in Python your project dependencies are system wide global packages. That's the very reason for virtual environment managers like conda and penv come to exist.
Answer: There is an excellent and simple explanation on Composer's website:

Composer is not a package manager in the same sense as Yum or Apt are.
  Yes, it deals with "packages" or libraries, but it manages them on a
  per-project basis, installing them in a directory (e.g. vendor) inside
  your project. By default it does not install anything globally. Thus,
  it is a dependency manager.
Comment: Interesting read: https://medium.com/learnwithrahul/understanding-npm-dependency-resolution-84a24180901b
Comment: @rahul286 Composer can install globally as a convenience, while it's not its main focus or architecture philosophy. This affects the dependency resolution algorithm, for instance, which behaves differently in Composer and NPM. If I'm not mistaken, Composer reads all the dependency resolution tree and tries to find common ancestor packages that suffice all the packages constraints. If it can't do that, it does not complete succesfully. I'm not familiar with NPM, but I think that in NPM you get a package of each version, instead of a common ancestor.
Comment: But with the composer, you can install packages globally too! How does it count?

Package Manager vs Dependency Manager


What are the qualities of a good (math) teacher?

Question: In forming your answer you may treat the qualifier math or maths as optional, since part of the question is whether there is anything peculiar to the subject of mathematics that demands anything peculiar of the teacher.‡
The question is hardly new, but it came up most recently in the context of answering another question about good ways to respond to people who say,"I was never much good at maths at school", especially if one is motivated to give "answers that would actually educate the other person".
A moment of reflection tells me that there's another question in the back of my mind when I muse on this question in the present setting —
Bonus Question.  Working on the assumption that people visit this site for the sake of learning and sharing mathematical knowledge, what do your answers to the question of teacherly virtues tell you about the qualities of social-technical system design that would best serve that purpose?
‡ "peculiar" distinctive, not "peculiar" ha ha …
Comment: @Qiaochu Yuan : It's respondent's choice, or else feel free to give a parametric answer (a.k.a. "2-parter").
Comment: There is a commentary in the June-July issue of the Notices.  Dealing primarily with teachers of elementary or middle school math.
Comment: My answer is very different depending on whether you mean high school or college.  Could you clarify?
Comment: Eric Mazur has a very good talk about peer instruction (around 1 hour and 20 minutes long): http://www.youtube.com/watch?v=WwslBPj8GgI
Answer: I have answered this question with what I hope are some qualities a teacher can learn in order to improve their class. This is as opposed to listing qualities of a truly exceptional math teacher. I wrote this thinking of middle and high school level math, but most of it could be applied at other levels as well.
1) A good math teacher should motivate the math and engage the students. Take the example of solving linear equation. One can start by telling students the formal rules for how to manipulate an equation, but I think students will find this very dry, and won't understand why they are doing what they are doing. It becomes and exercise in memorization. Instead, one can start with problems that can be solved with such equation. One can first get students to solve them with other techniques (e.g. guessing and checking or using some sort of graph). After a while one realizes there should be an easier way, which turns out to be solving a linear equation. This way the students understand why the formal math was developed, understand how to apply it, and see how it is related with other ideas (like graphs). Right now you might ask where one can find good problems to use in this way. I think I will ask that as a separate question...
2) A good math teacher makes their students do math. I think it is crucial that every student, in every math class, every day, solve some math problems. Some of these should be easy (i.e. just practice solving equations, once they have been introduced), and some should require more creativity. It is of course a mistake to drill students with boring problems until they hate the subject, but it is also a mistake to let them do "interesting" or "discovery based" math all the time, and not make them practice the techniques they discover.
3) A good math teacher should convey the beauty of the subject. One of the other answers said ``infectious enthusiasm" was needed. That would be great, but in reality not all math teachers can be that charismatic. Even without a great deal of charisma, I believe it is possible to show students the wonder of extracting a simple answer from a seemingly difficult question, and the beauty of the tools that help one do this. Often it is enough that students see that their teacher believes this. So in particular, I do not think it is a good idea to say things like "I hated math when I was your age too, but we'll get through this".
Answer: Every great teacher has his or her own teaching style and philosophy but here are some thoughts on things that I think make for a pretty good teacher (some more math-specific and some less so).
I think good teachers respect their students.  I think teachers can effectively engage students by treating teaching and learning as a collaborative process and by showing their students that their thoughts and opinions are valued.  It can be really good motivation for students to feel that they're working with their teacher to develop their understanding.
Following on from that, I think good teachers can get their students talking.  Having students ask and answer questions about the material being covered is a great way to get them really thinking about the ideas for themselves.  Also, some teachers really encourage their students to talk to each other and I think that's a great way to show students how much they can learn from each other, independent of their teacher.
Along those lines, great teachers should challenge their students.  They should encourage their students to get out of the mindset of "I only know as much as my teacher tells me".  In math, I feel like many students end up expecting all the problems they encounter to be similar to some example they've been shown.  An invaluable skill that great teachers pass on to their students is the ability to take their knowledge and skills and apply them in unfamiliar situations.  It's important to show students that they can do things on their own!
Great teachers provide positive encouragement and credit where it's due.  When you're in the middle of learning something, it can be hard to take stock of how far you've come or whether you actually know more than you did weeks or months ago.  So it's important for teachers to keep track of their students' progress and to let them know about it.
Especially in math, I think good teachers provide motivation and explanation for the material.  It's so easy to get caught up in formulas and theorems and simply ignore where they came from but it's so important to make sure that students realise that math doesn't just come out of nowhere.  Even in cases where rigorous explanations are a little beyond the students, good teachers can appeal to their students' intuition and give basic ideas about why things are true.  Being able to show students that math is all about logic and reasoning and that it should make sense I think is the mark of a really incredible teacher.
Answer: Initially, this was supposed to be a comment about point 3) in Peter Tingley's answer, about a math teacher being able to "convey the beauty of the subject", but it got too long so I turned it into an answer.
While I generally agree with it, I think it is also a tad too idealistic. Dr. Johnson, in one of his invectives against the Scots, barked that "much may be made of a Scot if he be caught young". Contrapositively, if a student arrives at university without any appreciation for Mathematics, there is only the slimmest of chances that he will gain it there. And teenagers? Mathematics has to compete in a teenager's mind with Lady Gaga and porn sites; with mtv rap and online gaming; with entertainments that range from the irrational to the inane. Call me an elitist cynic, but the plain matter of fact is that the majority of students will be completely unmoved by the beauty of mathematics, much as great literature can only be understood and enjoyed by a relative minority within each generation. I guess what I am saying is that a  quality that a good teacher must have is a thick-skin and somehow, by whatever means, keep the flame alive inside his own heart so that when that special, receptive student does come along, he will be able to kindle the fire and infect him with the rapturous love for Mathematics. Or in the words of Samuel Beckett, "Try Again. Fail again. Fail better."
Comment: This is second time in my life I see a reference to something called "Lady Gaga", and both of them have been here on MO. I wonder if that means my inner flame is safe...
Comment: I think that there is a wonderful point between the lines. Keeping in mind that you have to compare with Lady Gaga can be one of the most helpful things while teaching mathematics. Most (if not all) of us will agree that mathematics can be beautiful. However, we cannot hand it at a student and expect them to see the beauty. I believe that every teacher should also try to be entertaining and colorful. Of course, there is a limit to that (we are not stand up comedian), but I believe that really putting an effort into presenting it in a fun and entertaining way (like something on MTV) would help.
Comment: Excuse this off-topic comment, but this reminded me of another Dr. Johnson quote. This is the occasion when Boswell was first introduced to Johnson through a mutual acquaintance, Mr. Davies. Boswell writes, "Mr. Davies mentioned my name, and respectfully introduced me to him. I was much agitated; and recollecting his prejudice against the Scotch, of which I had heard much, I said to Davies, 'Don't tell where I come from.' 'From Scotland,' cried Davies, roguishly. 'Mr. Johnson, (said I) I do indeed come from Scotland, but I cannot help it.' I am willing to flatter myself that (cont.)
Comment: (cont.) I meant this as a light pleasantry to soothe and conciliate him, and not as an humilating abasement at the expence of my country. But ... [he] retorted, 'That, Sir, I find, is what a very great many of your countrymen cannot help.'
Answer: A good teacher should

be able to figure out when a student's understanding becomes better than his own to recommend some reading or to pass the student on to a more knowledgeable teacher
develop individual approaches for gifted students (say, emphasizing theoretical vs problem based depending on the student)
be realistic in estimating the impact of his teaching work on students, and not be lazy, e.g. repeat important things again and again
have enough "infectious enthusiasm"; without it any efforts will be pointless

(clearly there's much more, but that's something that comes to my mind right away)
Answer: The math teachers that I like the most are the ones that make the subject they teach look very easy. For instance, my abstract algebra teacher makes all the definitions justified and look very simple. He always finds the simplest arguments for every proof, and since he does everything in the right order it just seems to flow, and we almost could guess every proof that he's about to give us, because they all seem very natural.
I'm not sure I know how to summarize this quality exactly, but I'd say that every math teacher should be able to make the subject he's teaching look simple and easy by finding the simplest proofs and doing all the necessary intermediate steps that lead to a more difficult theorem.
Comment: From your description it sounds like your abstract algebra teacher is indeed a very good teacher.  However, I don't think that "making it look easy" is what makes him so good.  What you are describing instead sounds to me like he is very well organized!  I often dislike teachers who try too hard to makes things look easy, because often this simply results in sweeping the fiddly bits under the carpet.
Comment: yes, I guess, I didn't really mean that he was "trying" to make his class easy, more that the way he explains makes it look easy, without even trying, because of his organization... That said, there are some fields that I doubt any teacher would be able to make look as simple... For example, my analysis classes have never seemed as easy, mostly because of the harder proofs...
Comment: I think the word 'easy' may be not quite right. Perhaps the right word is 'natural'. One of my favorite professors (actually the guy currently in the office next to Emily) had the miraculous ability to be clear while doing math on his feet. I think this is a consequence of having thought very carefully about things and worked them out for himself. Somehow it was possible to benefit from his effort/natural point of view to pick up on how to approach the subject. I feel that his material was so well-worn and honest that it was inspiring. What he presented looked simple, but you knew it wasn't!
Answer: First and foremost an excellent teacher has all the qualities of an excellent student. She is articulate, open minded and friendly. She is excited about the subject and is able to communicate her amazement and understanding to her students by articulating her own intuitions and expertise in a way that is accessible to everyone. She also provides a bird's eye view of the subject by interjecting various tidbits from the history of the subject and pointing to stumbling blocks. You'd be surprised to see how many teachers act like answering a simple question is beneath them, speak in monotone, purposely ask trick questions to make the students feel stupid, dismiss questions as not worthy of an answer and just plain act rude and unfriendly.
Comment: While some people are better teachers than others, very few of the top researchers that I know fit Andrew L's description.
Comment: Andrew L, perhaps you could try to distinguish more between "things that are generally true," "things that are true in your experience" and "things that you have heard are true"?  Whenever you begin discussing "top researchers," you deliver a lot of pronouncements that sound like they're in the first of these three categories, but I suspect that they belong on the last.  The fact that you defend your perception by reference to a fictionalization of the biography of an exceedingly unusual individual really reinforces my perception.
Comment: @Andrew L: So, going back to the three categories mentioned in my comment, you assert that you make pronouncements of "general truth" based on personal experience, rather than hearsay.  Yet every time you make such a comment, someone has responded to note that your experiences differ noticably from their own.  How do you suppose this can be reconciled?
Comment: @Andrew L: It really troubles me that "Perhaps my views don't really reflect universal truth" isn't on your list. How hard have you considered this possibility? (Incidentally, I've never found it difficult to "be accepted as a mathematician by my peers," nor have I ever been subject of any sort of negative attention for my expressed love of teaching. And while I have certainly been subjected to my share of bad teaching in undergraduate and graduate level math classes (and in other subject areas!), none of it even remotely reminds me of your experiences.)
Comment: What makes this behavior even more despicable at the university level is that many of its worst practitioners are some of the field's top researchers.They're POed they actually have to come down from the mountaintop and teach,which is the most degrading of actions for someone of thier self-percieved character.I can't help but think of that scene from "A Beautiful Mind",where Russell Crowe's John Nash is really upset he has to teach at MIT and delibrately gives the students a homework exercise he knew they couldn't solve without a trick to both keep them out of his hair and demoralize them.
Comment: @JBL Continued:I'm not saying top-level researchers are all like this,of course. Far from it.I'm just saying the culture of academia encourages it and does nothing to discourage it.Worse,they end up setting this example for the next generation of P.H.D's.
Comment: @David continued: Of course,there are exceptions.There are great researchers who are passionate teachers-such as Micheal Artin at MIT and John Milnor at SUNY Stonybrook. But sadly,they are the exception and not the rule and the 'publish or perish" philosophy at major universities only encourages this behavior.
Comment: @JBL I was using a well-known movie for literary resonance.I can recount a half a dozen real experiences-without naming names,of course-as I've been a wanderer auditing classes at colleges of just about every level and course type.For example,at Princeton University several years ago,where I was visiting a friend, a well known researcher was guest teaching a regular level course on linear algebra and used a 2 sided module without defining it in an unusual proof of the dimension theorum.Half the class was completely baffled.One asked what a module was.
Comment: @JBL Continued: The professor just smirked and said,"Well,if you ask me,spoon feeding something as childishly simple as linear algebra like this is a waste of everyone's time to begin with. Rather then interrupting me and wasting my time further,why don't you try and look it up yourself?" No one asked a question for the rest of the 3 lectures the professor gave after that and worse,when I brought it up to the graduate students there,they all laughed."Being able to do that to undergraduates is a sure sign you've made it,Andrew".
Comment: @JBL Perhaps they were fortunate enough to be students in programs where that was by and large not the case with the instructors they personally dealt with.Perhaps in the long painful struggle to be accepted as mathematicains by thier peers-the one they need to impress the most being of the previously described group-they've allowed themselves to become much more tolerant and understanding of such behavior then they're willing to admit to themselves. "Rules of the game". Or maybe they just are in denial.
Comment: @JBL Then you've been fortunate and I envy you.I also envy your students as they'll mature with a much more positive and optimistic outlook then I. Keep up the good work for them. And now,sadly-we better terminate this exchange before both of us get in trouble with the moderators for making too many personal comments.If you want to continue via email,drop me a line sometime.
Answer: A little late - A good math teacher is someone who has a passion for mathematics and can share and instill that passion upon their students.
Good math teachers/professors should be the ones who encourage their students to go beyond the classroom with their learning. They should encourage and help their students get involved in original research and advise them on what steps to take. The teachers have the experience and the students do not; thus, the teachers should share this experience with their students.
A good math teacher is one that teaches students what the true joy of mathematics is and how to function in a world outside school utilizing mathematics.
Answer: Just knowing that it took Whitehead and Russell almost 370 pages of the first edition of Principia Mathematica to be able to state 1 + 1 = 2, and nearly 800 pages of P.M. to q.e.d. 1 + 1 = 2, I think that most of us will be satisfied that it CAN be done that painstakingly, if need be, while we meanwhile get on with our shortcuts to go on to more interesting results.
Comment: Seems like this should be a comment on Jose Brox's answer rather than an answer all on its own. The OP never said anything about painstakingly justifying everything from the axioms
Answer: A good teacher should know his/her audience : what do they know? what do they expect? what is the goal?
A same lecture will be one's joy and another's torture.
You definitely won't treat the same subject in the same way in front of would-be mathematicians, would-be engineers, would-be biologists, would-be economists, etc! [and that's just mentioning students, not pupils...]
There are audiences in front of which you won't give any definition, any lemma, any theorem. You'll just take examples, first very down to earth to show how to compute/visualize something, then a little more general, but still not abstract, to show off the magic.
And even in front of mathematicians, you should beware : are you talking to a pack of specialists of the subject or in some sort of colloquium? On that matter, I can link you to William Thurston's "On proof and progress in mathematics" (which I recently read because someone pointed it out in an unrelated question).
90% of teaching isn't about the core of the subject, but being receptive to the people you're dealing with.
Answer: I think it is crucial for the math teacher to give a detailed description of anything he does, justifying any step he takes from definitions and axioms, from the start. Of course, before/later he should add a lot of intuitive explanations and examples about how and why the definitions are chosen and the results are going to be true; but the teacher should keep well in mind that, for every step he spares, he will get a bunch of students who will reach to the conclusion that maths is not a logical subject, but merely a collection of boring and inscrutable pieces of symbolic relations that they should memorize, even more if they are immersed in a program that teaches them more algorithms than theoretical results (as happens in the highschools of many countries, for example here in Spain, where I live).
Comment: I disagree with this. Carefully justifying every step very much sends the message that math is a collection of boring symbolic manipulations. When I do mathematics, I don't justify every step, and I don't think kids should either. Unless it's the crux of the argument, I would never say to a kid "hold it right there; how do you know the sum of two even numbers is even?" The place for careful arguments is when something interesting happens, when your intuition (or something you "proved") says something you know is wrong. Kids should learn the value of being meticulous, not have it forced on them
Comment: For an argument longer than 600 characters, see Paul Lockhart's "A Mathematician's Lament" (http://www.maa.org/devlin/LockhartsLament.pdf), which I first came across in this question: http://mathoverflow.net/questions/5074
Comment: The level of detail that suits the teachable moment at hand is of course a judgment call, but the rule of thumb that reason must be given where reason is due — that, I think, is basically sound.

Our teaching seminars in grad school expressly cautioned against impressing students too deeply with the "Bag of Tricks" theory of mathematical prestidigitation.  Sure, we all love those tricks, but leading students down the path of thinking that math is "nothing but tricks" is going a bridge too far.
Comment: @Anton : Thanks for the frabjous essay!  I'll have to print it out and give it another couple of readings.
Comment: I agree (to a point) with Anton. The goal should be for students to reason precisely. More fine, detailed steps should be a means to that end. Demanding justification can add or subtract from this goal. You want justification where being ambiguous or unclear affects the reasoning. But demanding every minute justification may undermine the cause -- students might view such steps as symbol pushing disconnected from the "real" reasoning.
Comment: I saw math teachers who are unable to build a logical chain carefully, without gaps and/or mistakes. I think, Jose had in mind that a teacher must have enough qualification for doing this in case when he sees that his pupils don't understand the logic of the exposition. Not that every time he must explain each millimeter of the proof. Am I right, Jose? :)


How can P=NP relate to creativity and proof automation, as said by Scott Aaronson?

Question: I read several times of Scott Aaronson saying that P=NP implies that human creativity is boring and something like that, and that P=NP has something to do with proof automation. I don't get his argument, despite having studied basic complexity theory. What is he talking about?
Comment: You're asking what somebody means without telling us what they actually said. Without some quotations, this question is essentially Chinese whispers.
Comment: Do you have a more precise quote? Also, have a look at [Impagliazzo, R. (1995, June). A personal view of average-case complexity. In Structure in Complexity Theory Conference, 1995., Proceedings of Tenth Annual IEEE (pp. 134-147). IEEE.](http://www.karlin.mff.cuni.cz/~krajicek/ri5svetu.pdf)
Comment: I think Juho provided what I needed to understand. I will ask a different question after reading that. Thanks.
Comment: any proof that humans cant figure out implies limited human creativity. as for proof automation there is more thinking on this in the recent book by fortnow, Golden Ticket. there is an informal/ folklore idea that "finding proofs" might be easy if P=NP. but it seems this has not really been formalized. aaronson muses on P vs NP and not all of his ideas are mainstream esp because he is approaching it somewhat from a physicist angle. agreed, the exact quotes need to be considered.
Answer: There is a relatively often cited quote

"If P=NP, then the world would be a profoundly different place than we usually assume it to be. There would be no special value in "creative leaps," no fundamental gap between solving a problem and recognizing the solution once it's found. Everyone who could appreciate a symphony would be Mozart; everyone who could follow a step-by-step argument would be Gauss; everyone who could recognize a good investment strategy would be Warren Buffett."

However, Scott has later distanced from it:

Given how many confusions and weird misinterpretations it's spawned, I, Scott Aaronson, hereby formally disown my statement about how "everyone who could appreciate a symphony would be Mozart" if P=NP.

(source)
Answer: Here is a take on the idea in your question (trying not to put words in anyone's mouth). NP can be viewed as the class of statements that have "reasonable" proofs. Here statements are technically of the form "this string is in this language" and the proof is the "witness"/"certificate", and by "reasonable proof" I mean of polynomial size and verifiable in polynomial time.
P can be viewed as the subset of NP for which these proofs can be found efficiently and mechanically by an algorithm. If $\mathsf{P}=\mathsf{NP}$, then the algorithm removes the need for human creativity in finding the proof. If $\mathsf{P} \neq \mathsf{NP}$, then any algorithm would take a very long time and to get a fast proof of the statement, we need some heuristic like human creativity. In theory, anyway.
To make this viewpoint really bite, you'd want to connect the statements we want to actually prove to $\mathsf{NP}$ languages, which, like vzn, I haven't seen completely formalized. But I think the idea would be to consider a verifier that knows all of the axioms and rules of logic in your proof system and can check that each step in a given proof is an application of one of these axioms or logical rules to the previous step. Therefore, the language of interest is the set of true statements that can be deduced in your logic in $p(n)$ many steps, for a fixed polynomial $p(n)$. If $\mathsf{P}=\mathsf{NP}$, then there is an algorithm that checks if a given statement is in this language: given the statement we want to prove, it quickly and mechanically deduces whether it is true and provable in $p(n)$ steps.
It would be great if any experts could comment or improve this response....
Comment: think this is acceptable answer but lets keep in mind that certificates as "proofs" is a legitimate but very narrow/ specialized concept of proofs in math.


Sky map for tropics

Question: I like to use rotational sky maps to use in the field, but I have this only for latitude 50°N.   I'd like to have a similar sky map for tropics: 10°N. Do you know where I can order one?
Comment: questions about where to specifically purchase things, AFAIK, are off-topic for The Great Outdoors.
Comment: @studiohack, this is really a rare item so it requires a good know-how of where to buy it. And sharing know how is on-topic here AFAIK.
Comment: I agree this is on topic - it's not asking where the best place is for an item, just *anywhere* where a rare item can be purchased.
Answer: Skymaps.com offers free rotational style sky maps to print out in PDF form each month, including equatorial editions (scroll down half way) that are drawn for 0° but good to ±15°.
Comment: thank you. I know skymaps.com, I'm looking for something more detailed and possibly (but not necessarily) rotational (2 pieces of paper rotating against each other) so that it shows sky for particular time.
Answer: Have you thought about Google Sky Map for Android or Star Walk on iPhone? These may give you what you need.
(I know, batteries run out, phones get wet etc., but these will show sky at a particular time)
Comment: thanks Rory, I thought of this, but Android is dead in tropics, since the battery lasts 2 days only and you cannot use normal replaceable AA batteries!
Comment: Yeah - not ideal, as I mentioned, although you can get some reasonable solar chargers...

Sky map for tropics


How do you talk in general chat?

Question: What is the slash command to speak in General chat on Diablo 3?
Answer: It's /c (for channel)

/c Hello there.

This, of course, requires you to actually be in the General channel. If you joined another channel the same command would let you speak there, and if you're not in a channel the command wouldn't work.
You can also press the Quick Chat button next to the chat box, or just hit the [tab] key with chat open, to choose where your messages will be sent.
Comment: Hitting the [tab] key with the message box open will also bring up a popup that lets you tab between chat channels
Answer: As Hex points out you can use /c or /csay in any chat channel to speak, once you have joined that channel.  You can check out a full list of chat commands here.
Blizz provided a helpful tutorial on joining chat channels here as part of a bug workaround.  The relevant portion of which is this :

Do note that as of patch v1.03 (v.18.104.22.16857), chat settings are saved when you log out, so if you join General and log out, you'll re-join General the next time you log in.

Chat settings and preferences will now be saved whenever you log out

How do you talk in general chat?


how to apply scrollBar to the form manually in palm application

Question: in my project that is developed using palm technology ie webos ,in this application form is  not get scrolling option automatically,so i have to apply scrollbar manually.with this user can feel userfriendly.could some help me in this isue hoe to apply scrolling manually.
                                    thanking u
Answer: A Mojo.Widget.Scroller is available by default in every scene, unless you are manually disabling it.  Scroller Widget Page
It is against WebOS UI standards to have an actual scroll bar or buttons.
If you are using fixed positioning for any of your elements, or don't have content that extends past the bottom of the screen, you may not see scrolling action.


Will i lose my facebook acount if I force- stop it?

Question: My facebook account is causing my mobile phone to run slow and it keeps restarting. Is it safe to force stop facebook?
Comment: Adding to what Lucky said - you will not lose the Facebook account even if you uninstall the app.
Comment: No. It wont be deleted. Please read my answer.
Answer: First, it's not your account that is slowing down your smart phone, it's the app itself (don't worry, even I had the same problem).
Your phone is probably weak or you are running too much of apps and processes at the same time, saving less resources for facebook.
So, to answer your qustion: No, your account will not be deleted if you force stop facebook (or any other app like google+). Deleting an account is a totaly different process. For that you will have to request facebook to delete your account. But what's hapening in your case is simply stopping the app (for geeks: the front end part) from doing further work. Your account detailes and stuff are perfectly safe at facebook's server (for geeks: back end).
So go ahead, force stop your app. You can still use facebook from their mobile site, which is not heavy and much resource consuming.
Happy facebooking =)


Can we produce tritium from helium 3? If yes how?

Question: I want to know the best and economic way of the manufacture of tritium from helium-3
Comment: I don't think this can be done
Comment: Then again, this might be a worldbuilding question (helium-3 and tritium are both used a *lot* in science fiction). However, at least for now it seems to ask a legitimate chemistry question.
Answer: From my knowledge, helium-3 is actually a by-product of tritium decaying. Tritium is usually manufactured industrially by bombarding lithium-6 nuclei with neutrons in a nuclear reactor, and is currently the cheapest way to manufacture tritium.
Answer: In fact, producing T from 3He is straightforward. A visit to the National Nuclear Data Files site gets you cross sections for the various reactions.
The He3(n,p)T reaction has a cross section in excess of $10^{5}$ barns at low (thermal) neutron energies.
The Li6(n,T)He4 reaction mentioned in another answer has a smaller cross section, in excess of $10^{4}$ barns at low neutron energies, so it is about 10x less efficient to make tritium this way (not even counting enriching to get Li6 instead of Li7).
Yet, tritium is indeed bred from Li6 in reactors. This is beacuse they use solid lithium compounds in the reactor. Trying to stuff as much He3 into the same volume would require high pressures, and you still would not get the same amount in a given reactor volume. So, they use Li6 and wait longer.


Reactivity in my standard solution of Cu, P, Al, Ca, Fe, K, Mg, Mn, Na and S in 7,8% HNO3 and H2O2

Question: I have a problem with my standard for ICP-OES. It contains the following elements Cu, P, Al, Ca, Fe, K, Mg, Mn, Na and S in a solution of 7,8% HNO3 and H2O2.
I cannot make it work for reading P and most worryingly the high concentration standard bottle expands and makes a high hiss when opened after a while indicating a reaction that makes a gas.
Can anyone suggest what elements cross reacts? We have measured all elements in other combinations without problem.
Comment: What is precisely the composition of your solution ?  Apparently the solution is acidic and contains the cations $\ce{Cu^{2+}, Al^{3+}, Ca^{2+}, Fe^{3+}, K^+, Mg^{2+}, Mn^{2+}, Na^+}$ and the anions $\ce{NO3^-, PO4^{3-}}$. What is the concentration of $\ce{H2O2}$ in the solution ? Don't you think the "hiss" is not simply due to $\ce{O2}$ produced by the catalytic decomposition of $\ce{H2O2}$ ? It is not a cross reaction. It is well known that the ions of $\ce{Fe, Cu, Mn}$ act as catalyzers in the spontaneous $\ce{H2O2}$ decomposition.
Comment: To get any help, make readers feeling they know your scenario as well as you do.
Comment: Are you following a standard protocol that has been shown to work and that you have tried before? What is the exact concentration? Are other elements giving the expected readout?
Comment: @Buttonwood, P can easily have ppm or below ICP detection limits.
Answer: The knowledge of classical chemistry remains important, irrespective of the sophistication of analytical techniques or the cost of the instrumentation. It is important to understand the incompatibility between iron and phosphorus, which form highly insoluble phosphates. Similarly, Mg, Cu, Al will all interact with dissolved phosphate with their insoluble phosphates. Consequently, the utility of a dissolved phosphate in the presence of these metallic ions to save analysis time goes to waste. This explains the poor limit of detection for phosphorus, which likely is resting at the bottom of the standard stock solution. A second concern is the catalytic decomposition of  $\ce{H2O2}$. A repetition of the entire analysis is needed because the whole standard solution is messed up.
Until and unless these metallic ions were strongly chelated (perhaps not) by the standard solution manufacturer, the results of these ICP-OES analyses are not reliable at all.


Separate or combined boiler and hot water heater

Question: I'm looking to replace my boiler and hot water heater.
For background, I live near Boston, my home is about 2000 square feet, we have gas for heat, stove, and dryer, and we are two people in the house.
It seems that there are three basic options:

Combination boiler and tankless hot water heater
Combination boiler and hot water tank
Separate boiler and hot water tank

For a novice, the first option seems to be the most efficient option, but one plumber strongly advocated for the third option.
His reason is that the boiler is expensive and it is only really needed for 5 months of the year.  A combined unit requires the boiler to be used all year and thus puts unnecessary wear on it.
What else should I consider in selecting between these three options?  It is an expensive job so I want to make sure I do it right.
Comment: How deeply can the boilers you are looking at modulate?
Answer: I have always used your item #3 since I believe it would be a lot less expensive to operate and service this arrangement. Why run the large boiler in the summer just to get domestic hot water? my 2 cents.
Answer: I'll go for #1 because

1-I have all hot water I need
  2-I do not have idle consumption
  3-I do not risk hot home floood due to boiler failure

It's enough to choose the right delta-T, so, if you want 50° water and your lowest winter water temp is 5°, you need a 45° water rise boiler for the water flow you need: 1 bathroom 10L/m, 2 bathrooms 18L/min, if you have more than 2 bathrooms storage is better because can deliver bigger flow. So for 18L/min and 45° delta you'll need a 48kCal (55kW) furnace (190K BTU/h).
Otherweise I'll go for solution #2 as combi are, by far, more efficient than traditional WH (95%HHV vs 80%HHV) and also because combi are safer because have air inlet and smoke outlet coming from outside so there's almost no risk of CO poisoning while standard WH have room air inlet and backflow is quite possible.


Restore Mac from Time Machine while in Safe Mode. Password protected, not seen

Question: When I boot to safe mode and try to restore my Mac from Time Machine, OS X can't find my WD My Passport External Drive as it's password protected. Unless I unlock the drive, OS X won't be able to access my Time Machine Backup. So what do I do now?
Comment: What kind of protection is used in your WD My Passport External Drive? FIleVault or a  custom encryption?
Comment: Im not sure, this is the product webpage: http://www.wdc.com/en/products/products.aspx?id=1490
Answer: Unlocking the WD My Passport External Drive probably neither works in Safe Mode nor in Recovery Mode because a custom 256-bit AES hardware encryption is used. The decryption/unlocking only works with WD Security for Mac or WD Drive Utilities for Mac installed.
You have to boot to Recovery Mode (hold cmdR while booting) erase your main OS X volume and reinstall OS X.

Now you can either migrate the data with the Migration Asssistant:
Make a temporary admin user (different short user name than your backup) and then install the WD Security software. Then you can run Migration Assistant to read the files from the now-unlocked drive.
Once your migration is complete, you can leave things as they are or decrypt the WD drive and instead use Apple's encryption. That is supported at boot time so you don't have to do a dance when you erase and reinstall.
If you do that, the steps will be simply reboot to Recovery Mode and restore the Time Machine backup.
or use Time Machine to completely restore the Time Machine backup:
Install the WD Security software and completely remove encryption of the WD My Passport. Then reboot to Recovery Mode and use Time Machine to restore the backup.


what is the cross aldol product of ethanal and acetone(major product)?

Question: my teacher told that major product would be when acetone will form nucleophile because it will attack more positive carbon of ethanal(less +i than acetone) however i read in my book that since formation of carbanion is rds ethanal should be nucleophile (more stable due to less +i)
Comment: The anion of ethanal may form, and may react with acetone but it can just as easily break down reforming the starting materials if that is not the most energetically favourable pathway. Don't get hung up on which anion forms fastest, it is not the factor that determines the outcome.
Comment: Unclear what you mean by "most cases." I've got 15+ years of experience, and I'm not sure I've seen close to enough to count as having seen most cases.
Comment: Remember the whole process is reversible
Comment: ya i got it but why do we then in most cases decide major product using rds step?
Answer: As pointed out by Waylander, the question essentially wants students to go for the most stable product, or thermodynamic product. This is sort of like a well-understood thing for aldol product determination questions. Why? Well... Simply because there is usually only 1 thermodynamic product while there are several possible kinetic products. It is therefore hard to argue that the kinetic product drawn is really the major product under kinetic control. Under kinetic control, you may just get a mixture of products with nothing formed in significantly higher quantity.
Based on this understanding, we can go on to determine the thermodynamic product. This reaction is a very straightforward aldol reaction due to there being only two possible reaction pathways since one reactant is a symmetrical ketone while the other is an aldehyde. So there really are only two possible products...
One possible product comes from aldehyde as a the electrophile and acetone behaving as the nucleophile. Upon dehydration, we obtain A, which is a ketone and has a di-substituted conjugated $\ce {C=C}$ double bond. The other possible product comes from aldehyde as the nucleophile and acetone as the electrophile. Upon dehydration, we obtain B, which is still an aldehyde but it has a tri-subustituted $\ce {C=C}$ bond.

Which one is the thermodynamic product? Usually, we will just look at the substitution of the conjugated double bond formed. Very clearly, the kinetic product must be A since the more nucleophilic enolate from acetone attacks the more electrophilic aldehyde. However, is B really more stable? No, it isn't. The explanation presented below is based on qualitative molecular orbital theory.
Well... The key differences between A and B are:

A, being a ketone, has extra hyperconjugative interactions between the $\ce {C-H \sigma}$ MOs and the $\ce {C=O \pi^*}$ MO, compared to the B
B instead has extra hyperconjugative interactions between the $\ce {C-H \sigma}$ MOs and the $\ce {C=C \pi^*}$ MO, compared to A

The former hyperconjugative interactions are stronger since the $\ce {C=O \pi^*}$ MO is lower in energy and thus more energetically-accessible to the $\ce {C-H \sigma}$ MO. This is due to the higher electronegativity of the oxygen atom. Thus, we would expect the thermodynamic stability of A to be higher than that of B.
To provide even more concrete substantiation for the higher stability of A over B, Karsten Theis has kindly provided a source of data which indicates the Gibbs free energy of formation of the two compounds. As stated on chemeo, here and here, A has $\Delta G_f = \ce {-57.48 kJ/mol}$ while B has $\Delta G_f = \ce {-36.63 kJ/mol}$. This very clearly indicates that A has higher stability than B.
Thus, A is the answer.
Comment: On chemeo, the Gibbs energy of formation is tabulated as [-57.48 kJ/mol](https://www.chemeo.com/cid/37-523-0/3-Penten-2-one%2C%20%28E%29-) for the ketone A and as [-36.63 kJ/mol](https://www.chemeo.com/cid/25-268-7/3-methyl-2-butenal) for the aldehyde B.
Comment: @KarstenTheis Thanks for your data. I will add it to my answer.
Answer: This is a question of thermodynamic vs kinetic control. For reactions that are irreversible, the kinetics will determine the product ratio. For reactions that are reversible, the product ratio will be determined by the stability of the products if you wait long enough before working up the reaction.
Highly reactive starting materials (e.g. Grignard reagents) typically are associated with kinetic control (you don't expect the Grignard reagent to reform).
Slow reactions that could go in either direction depending on conditions (e.g. esterification/saponification) typically are associated with thermodynamic control.
For some reactions, you can steer them in either direction. One example from molecular biology is taking single-stranded DNA and annealing it either by slow cooling (thermodynamic control, the best matches will be made) or fast cooling (kinetic control, the first matches made will be the products). This is used in the PCR process, where short primers will bind to long DNA because they are present at high concentration even though there is complementary long DNA in the mixture that would form a more stable product.


A problem about real quadratic field

Question: I have calculated some real quadratic field 's Hilbert class field with class number $2$,and I found they were satisfied $Gal(H_{K}/Q)\cong Z/2Z\oplus Z/2Z$,here $H_{K}$  is the Hilbert class field of a real quadratic field $K$ whose class number is $2$.Is it true for all quadratic field with class number $2$? How to prove it?(ps:I'm a beginner of algebraic number theory ,and I'm very interested in Hlibert class field .)
Comment: If there exist a prime $p$,that $Q(\sqrt p)$ has class number $2$,this could be a counterexample of my problem.
Answer: This is a consequence of "genus theory". If $K / \mathbf{Q}$ is an abelian extension, then the "genus field" of $K$ is the maximal extension $L / K$ such that $L/K$ is unramified and $L/\mathbf{Q}$ is abelian. You can read more about genus theory here: https://en.wikipedia.org/wiki/Genus_field.
In your case, the fact that $H_K$ is Galois over $\mathbf{Q}$ and $[H_K : \mathbf{Q}] = 4$ implies that $H_K$ must be abelian over $\mathbf{Q}$ (since there are no nonabelian groups of order 4); so $H_K$ coincides with the genus field $L_K$. The genus field of of a quadratic field is always a composite of quadratic fields, so $H_K$ must have Galois group $C_2 \times C_2$.
(More generally, for any quadratic field (real or imaginary), genus theory completely describes the 2-torsion part of the class group.)

A problem about real quadratic field


Conditional segue performed on tap on UITableViewCell

Question: I'm working on some project for iOS 5 using Xcode 4.2. I have one UITableViewController and want to perform a segue when user tap on table cell, but destination view controller depends on action performed on that cell. For example, when user tap on cell I would like to load SomeViewController, but when user tap on the same cell in editing mode I would like to load AnotherViewController. Unfortunately, there is no way to configure multiple segues on same cell in Xcode 4.2 storyboard builder, or I just don't get it. Perhaps there is a way to create segue by hand, in code editor. Generally what I want to achieve is to provide user a  way to "enter" the item represented by cell using one view controller and "edit" the item represented by the same cell using another view controller. Switching to the second view controller (editor) when in table-edit-mode only was my first though, but maybe there is a better way. Any help will be appreciated.
Comment: It would be nice if you elaborated on this into an answer, showing exactly how you set the segues.
Comment: I've just figured it out. It simple, and can be done using Xcode storyboard editor. I've added two segues to my TableViewController pointing to different view controllers, and I'm triggering proper one from code when user selects a cell, and depending on it is done in editing mode or not - I'm triggering proper segue. Earlier I've tried to add multiple segue to same cell witch is not possible.
Comment: Refer : http://stackoverflow.com/questions/7819796/how-to-cancel-a-uistoryboardsegue
Answer: While looking  Storyboard, control-drag from your source View Controller to your Destination view controller. This will create a segue that you can trigger programmatically right from your source View Controller. Ensure that you give you Segue a name. This name is what you will pass into the source View Controller's performSegue:withIdentifier: method.
Comment: The bit that's often missed in the answers I've seen to this question is how to detect the touch that ordinarily triggers the segue now that you've detached it from the cell. The answer is to implement `tableView:didSelectRowAtIndexPath:` in your UITableViewController - even if it's a static table view. In the body for that method, you put your conditional code and call `performSegue:withIdentifier:` when conditions are right
Comment: The point is that you can setup more than one segue from a tableView prototype cell. Just give them distinct identifiers. That way in your didSelectRowAtIndexPath: you can set a condition if ([self.tableview isEditing]) and cause the segue in using the identifier you set up.
Answer: I'm adding an extra answer just because after reading the selected one above in many places other than this - and it is the correct answer - I found myself wondering how to detect the touch that would ordinarily trigger the segue. You see, if you create your segue the usual way by ctrl-dragging from the table view cell to the next controller, then two things are done for you automatically.

the touch in the cell is detected
the segue is performed

but of course, you can't block the segue.
Now if you want to conditionally segue, then (as mentioned in the other answers) you delete that segue and create a new one from the UITableViewController (drag it from the objects navigator rather than the storyboard) to the next controller - and give it a name.
Then - and this is the part I was missing - implement tableView:didSelectRowAtIndexPath in your table view controller to perform the segue programmatically and conditionally, as below.
Note that you also need to identify your cell somehow so you know if the one you're interested in has been selected. You could do that by knowing the index path in a static table, but I prefer to set my cells unique identifier in IB (even though I don't need it for dequeueing since it's a static table) and checking it. That way if I move my cell up or down in the static table, I won't need to change this code.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Find the selected cell in the usual way
    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];

    // Check if this is the cell I want to segue from by using the reuseIdenifier
    // which I set in the "Identifier" field in Interface Builder
    if ([cell.reuseIdentifier isEqualToString:@"CellIWantToSegueFrom"]) {

    // Do my conditional logic - this was the whole point of changing the segue
    if (myConditionForSegueIsSatisfied) {
        // Perform the segue using the identifier I was careful to give it in IB
        // Note I'm sending the cell as the sender because that's what the normal
        // segue does and I already had code counting on that
        [self performSegueWithIdentifier:@"SegueIdentifer" sender:cell];
    }
}

Note how I send the cell with the segue - the normal segue from the cell does that, and I had originally passed nil, and my code which had depended on it stopped working.
Answer: This is an old question and some great correct answers but I'll post some additional information I felt helpful when I encountered this:

If you create a segue in the storyboard by ctl+drag from SomeVC to AnotherVC, delete it.
In the object navigator, ctl+drag at the ViewController level (usually first in the hierarchy under the name of the VC) from SomeVC to AnotherVC. Give the segue a unique identifier.
Implement tableView: didSelectRowAtIndexPath: as described above.
I found it helpful to use a switch statement in tableView: didSelectRowAtIndexPath:
switch (indexPath.row) {
case 0:
    [self performSegueWithIdentifier:@"yourIDHere" sender:self];
    break;
case 1:
    // enter conditional code here...
    break;
case 2:
    // enter conditional code here...
    break;
// ... for however many cells you require

default:
    break;

}

Thanks for the great answers everyone.
Answer: You can easily control opening of any segue in your custom UIViewController by implementing:
override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool {
        return true // or false, depending on what you need
    }


Get number of rules in Geoserver style using webservice

Question: How can I know the default style for a layer in Geoserver, and the number of rules it contains, using a REST call or service?
Answer: You can request the style using REST (_http://myserver.com/geoserver/styles/mystyle). Once you've got the file use something like
<code>grep '<Rule' mystyle.sld | wc -l
</code>
to count the number of lines.
Obviously you can use any programming language of your choice to automate this.


how to create a 3d mosaic out of a 2d image

Question: i have a  mosaic image and i want to turn it into a plan object that is going to have a 3D bumps.the result is going to be printed with a 3d printer .the idea is to extract the parts of the image so i can feel them with my hands
i still didn't try any method and i don't know where to start.
Comment: have a look at Materialize http://boundingboxsoftware.com/materialize/ it is Windows only but is free and the video tutorials show how you can create bump/height maps from photo textures.
Comment: Easily 'extracting' the bumps from the image does not seem like a very realistic possibility here. There are no uniform properties in the image that could define height - the bits have different colors and brightness values. I think this might be a suitable case for the good old-fashioned loads-of-tedious-hard-work workflow. It could be loosely recreated adding arrayed cubes and sculpting to add variation in 3d, or it could be recreated as a 2d image to be used for displacement. There are repeating patterns there, so that makes things a bit easier.
Comment: i a little bit in a rush and i don't have time to recreated and sculpted .So is there any method or a software that can help me do it faster. i also heard that i can't use normal maps and textures because it's only in the software the details won't appear when i print it.
Comment: Sadly, the lack of time in your situation does not influence the amount of available solutions to your problem. If you wish the result to have any meaningful amount of accuracy, there is not much that can be done. You could attempt to edit the brightness of the image isolating it by color in some image editing software. For example in Photoshop there is a function Image -> Adjustments -> Black and White where you can try to make the colored tiles brighter than the gaps. It will not be a very precise result. You would have to deal with shadows as well. Look into Frequency Separation techniques.
Answer: The only automation you can have is to translate the brightness value of every pixel into a height map, setting it as texture in a displace modifier on a highly subdivided plane. The result is quite random because of the problems Martin Z said. In my example we have 1.500.000 vertices.


avi recording index failure

Question: Since 3-4 Weeks I have Problems with Video-File Recording. Everytime I become an Index Fail after close / finish the Recorded File. But the Index is very important for me, because the recorded files should be used later for some Cut Processes. With this Index Failure it Cut me the wrong Part from the Video...
The Constalation is the Follow:
Logitech (B910HD) Webcam as Input Source => Xvid Codec as De/Encoder => Filewriter. All this done by a little, own developed Tool with the help of DirectShow (DirectShowLib-2005.dll).
I tried all logical debugging Steps... I has reinstalled Codecs / tried very lot of Codec Settings / tried other Computers and other Codecs (x264vfw) / reinstalled System (Windows 7 Pro x64 AND Windows XP Pro SP3) / changed WebCam (other B910HD and C920HD Pro) / ....
The more or less crazy thing is that its working very well before the 4 Weeks AND that is working fine on some other machines (same OS / exactly same Units and Hardware). So I though maybe its a Hardware failure from this Units (maybe HDD or Memory) but Tests of this Hardware was good too!
Comment:
Only VLC Media Player says the Index is defect. Windows Media Player tell me nothing and play the File....
Answer: Seems like the B910 and also C920 webcams are not providing a constant framerate under all conditions. This leads to an incorrect video index. For me it helped to disable the auto-exposure feature.

avi recording index failure


How to find the path of the feed for content type in drupal 7?

Question: I wanted to add the path to the feed view display, but I'm not able to know what the path is?
Comment: What kind of feed is it, and which module created it?
Answer: You can use the Views module to create feeds. Simply add a new display of type "Feed" and customize the view to contain only the content you want. You have to set the path in Feed Settings(enter your own path for example: type feed or any path you want).
To add a "Feed" display:
Go to your views administration and select the view you want to edit. Towards the top of the page you will see the "Displays" heading with an "+ Add" button. Click that and select "Feed" . You will then have a Feed display that is using the Default Display's settings.


The ambient light sensor/camera/accelerometer isn't working on the Nexus 7. Are there plans to support it?

Question: There are several sensors and devices on the Nexus 7 that are not currently working with Ubuntu that work in Android.  Are there plans to support these sensors/devices?
Answer: There are plans to support all of the modules and sensors found in the Nexus 7.  This is one area in specific where help from the community would be an enormous help.  The status of this ongoing goal can be found in the meeting notes from a UDS Session about enabling all of the sensors, and can be found here: http://summit.ubuntu.com/uds-r/meeting/21334/desktop-r-arm-input-sensor-drivers/


Count number of values between two numbers

Question: I am finding with some formulas for my web application. I need a formula that counts the number of values between two number, e.g. there are four numbers (3,4,5,6) between 2 and 7
Comment: this problem just might be NP-complete.  i hope you have enough computing power to tackle it.
Answer: larger - smaller - 1. If you don't count the larger and the smaller (like your example).
If the numbers are $n, n+1, \dots, n+k , n+k+1$, the numbers you want are $n+1, n+2, \dots, n+k$, which are $k$ in number = $n+k+1 - n - 1$ = larger - smaller - 1.
Comment: @Cudos: and *if* your quantities are both integers, and you include *all* integers between the two in your count, and *only* integers...
Comment: Not faulting you; I always have to hit my students over the head with the fact that "numbers" doesn't mean "integers and only integers" unless one says so explicitly.
Comment: @Arturo: Yes, that was the assumption made based on the example.
Comment: @Arturo: Agree with that :-)
Answer: The number between $a,b$ is $(a<b)$

Including $a,b$ them self: $b-a+1$
Excluding $a,b$ :$b-a-1$
Answer: HINT $\ $ The problem admits an obvious shift symmetry, e.g. considering the example that you gave, a shift of $-2\:$ to $[3, 6]$ yields $[1,4]$, which clearly has $4$ integers. Innate symmetries should always be investigated since they may play a key role in simplifying the search for a solution. Moreover, it's best to learn these symmetry-based problem solving techniques for simple problems like this, since you may not be able to see the forest for the trees in much more complex problems.
Answer: The bigger number minus the smaller number minus 1.
Or if $b$ is the bigger number, $s$ the smaller. We have:
$b - s - 1$


Did Paul receive The Holy Spirit?

Question: If you think Paul received The Holy Spirit, please explain the text where you feel this is expressed. Thanks-
Answer: Saul encountered Jesus outside of Damascus. He became blind and was taken to a house in the city. After 3 days Jesus sent Ananias to Saul:

So Ananias departed and entered the house. And laying his hands on him he said, "Brother Saul, the Lord Jesus who appeared to you on the road by which you came has sent me so that you may regain your sight and be filled with the Holy Spirit." (Acts 9:17 ESV)

As Saul went on his missionary trips he became known as Paul. There are events which indicate he had the Holy Spirit and times where it is stated he was filled with the Holy Spirit. For example:

Then Saul, who also is called Paul, filled with the Holy Spirit, looked intently at him (Acts 13:9 ESV)

Additional explanation:
The literal translation in both cases would be Spirit Holy: Πνεύματος Ἁγίου. There is no definite article present. "The" is an addition by translators as it is implied based upon the nature of God. If one is filled with "Spirit Holy" from God, then unless there is more than one Holy Spirit, one is filled with "The" Holy Spirit from God.
Comment: I just want to point out that in neither of those verses verses is there a definite article so I believe it should be translated "filled with holy breath" or "filled with holy spirit".
Comment: Wounded Ego, I like your comment. The definite article is important to me. Except Revelation has "the" before "Holy Spirit" -is the definite article added in the ESV? Also, if you are so inclined, I would like to see you expand on your comment by posting the Koine Greek and the translation, and from where you are deriving that -which manuscripts? Thank you

Did Paul receive The Holy Spirit?


At what point are contracts necessary?

Question: My main source of income for day-to-day operations include just simply fixing computers or doing upgrades, which usually bill the client less then $200 when all is said and done. For this small of a charge (multiple clients per day, mind you), is it worthwhile having a contract and full Scope of Work drawn up? Is it OK to just use a work order and invoice? Or am I opening myself up to bigger issues?
Answer: Work orders and invoices are contracts. Documents detailing the agreed upon work to be done and payment for that work.
Work orders define the scope of work and the invoice defines the terms of payment. You should have costs on the work order if you don't already. Listing your liability on work orders and dispute resolution terms on invoices is a good idea as well. If the client agrees to the work order, they've expressed agreement to the terms.
Just because something doesn't have the word "Contract" on it, it doesn't mean it's not a contract.
Answer: As Scott says, your work order is a contract and should probably include the scope of work, the payment and payment terms.
When I was doing this type of work years ago, I would not start on a job until the client signed a form agreeing that they are responsible for their own data, that they have a current backup and that I cannot be held responsible for any data loss. This is important to avoid being sued for any data loss, whatever the reason. Data loss can happen through hardware failure or malware or even your own mistakes but ideally the client should have a backup to be able to restore the data.
You might also get clients to sign a document stating that they own appropriate licences for the software they are asking you to install on their computers. You don't want to be held responsible for installing unlicensed software on a machine when you have been led to believe there is a legitimate license.
Answer: I would not dig myself into administrative things for such a small money and such a large number of clients. I sign contracts only where there is a good and long-term job where I want to bind the client not to make silly moves (like leaving me all of a sudden).
Of course, the most important thing is what your Laws say. If they do not prescribe having contracts for such small jobs, then I would not complicate my life.

At what point are contracts necessary?


Change VFOs with external mic button in Icon ID-51?

Question: Is it possible to configure a external mic, specifically, a Icom HM-75LS, to switch between the two VFOs when pressing a button on an Icon ID-51 Plus2?
Answer: From https://www.manualslib.com/manual/628105/Icom-Id-31a.html?page=65

■ Optional HM-75LS
The optional HM-75LS allows you to remotely select operating frequencies, memory channels, etc.
Remote control functions can be selected from three settings. These can be selected with "MIC Simple Mode" in the FUNCTION menu.
MENU ➪ FUNCTION ➪ MIC Simple Mode (p. 44)
The HM-75LS has a lock switch on the backside to prevent accidental frequency changes, and so on.
Be sure to turn power OFF when plugging or unplugging the HM-75LS to and from the [SP/MIC] jack.

SIMPLE:
[A]Toggles the Monitor function
[B]Turns the Call channel mode
[p] Select memory channel 0
[q] Select memory channel 1
NORM-1: (default)
[A]Selects the Call channel mode
[B]Toggles the VFO mode and Memory mode
[p] Frequency or memory channel 'UP'
[q] Frequency or memory channel 'DOWN'
NORM-2:
[A]Turns the Monitor function
[B]Toggles the VFO mode and Memory mode
[p] Frequency or memory channel 'UP'
[q] Frequency or memory channel 'DOWN'

The SIMPLE mode can select only three channels, and is useful for group operations during touring, and so on.
The VFO mode cannot be selected from the microphone when Simple mode is selected.

It appears that it can change the VFO mode in the normal-2 mike mode but I did not see that it can change to the other VFO. I did not see any way to program it differently. There may be a method that I am not aware of but I doubt it.


Seeming contradiction on wikipedia about rear nodal points and how the principal plane is related to focal length

Question: There are two lines on the wikipedia pages for "cardinal points" and "focal length" that seem to contradict each other, and I would be extremely grateful if someone could explain to me why they do not. In the page for cardinal points, it says:

If the medium surrounding the optical system has a refractive index of 1 (e.g., air or vacuum), then the distance from the principal planes to their corresponding focal points is just the focal length of the system. In the more general case, the distance to the foci is the focal length multiplied by the index of refraction of the medium.

This makes sense to me. I also get that these principal planes can often be located outside of the lens with some clever optics, allowing for lenses that are physically shorter than their focal length. However, on the page for focal length, the page reads:

When a photographic lens is set to "infinity", its rear nodal point is separated from the sensor or film, at the focal plane, by the lens's focal length. Objects far away from the camera then produce sharp images on the sensor or film, which is also at the image plane.

I don't see how these can both be true, because if the focal point, the point as I understand it to be where all the light converges, was on the film plane, an image wouldn't be rendered, it would just be an indistinguishable point of light. Does the light not have to travel a distance past the focal point to the film plane in order to form an image?
I think it is possible that I am getting my front and rear nodal points confused, or that I have a larger fundamental misunderstanding about how focal length is measured. Thank you so much for your help!
Comment: Does this answer your question? [How does photography (as opposed to physics) define "focal-plane"?](https://photo.stackexchange.com/questions/45970/how-does-photography-as-opposed-to-physics-define-focal-plane)
Comment: Related: [How does photography (as opposed to physics) define "focal-plane"?](https://photo.stackexchange.com/q/45970/15871)
Answer: "because if the focal point, the point as I understand it to be where all the light converges, was on the film plane, an image wouldn't be rendered, it would just be an indistinguishable point of light."
This understanding is incorrect... at all points on an objective lens exists all of the light required to form an mage (a portion of the total). That is why you can have a 200mm f/4 lens (50mm objective element) and a 200mm f/2 lens (100mm objective element). It is more accurate to understand objective lens area (aperture, f#) as being "stacking images."
The point at where all light converges is then where all source points from all areas of the objective element converge as a single point at the image plane. i.e. a point source in the scene converges as a point on the sensor.
This is a related diagram I made regarding DoField/DoFocus, but it shows the concept. The narrow aperture light/paths also exist w/in the wide aperture image; I just didn't include them for clarity/simplicity. Only the blue source is in true focus; and the narrow aperture image is darker (grey) because there are fewer images (light paths) focused/stacked/combined at the image plane.
Answer: I believe I now see the confusion (sorry, slow on the uptake).
Most lens and imaging diagrams do indeed give the impression that all the light comes to a point at the focus point, it's even in the name. However that's not what is actually happening. The smallest point of light is actually an image, not a point.
The focal length of a lens refers to the fixed image distance of focus for an infinite object distance. This focal point is actually a focal image.
This diagram from an old physics book shows this better than most:

Note that last (f) At infinity. The focus point F' is where the image forms, it's not actually a point.
(c) & (d) explain macro photography.
Answer: The focal length of a lens is a measurement taken when the lens is imaging a far distance object like a star. If the lens structure is a single symmetrical (convex – convex) then this measurement is taken from the center of the lens to the focused image. A distant object is at an infinite distance when its light rays arrive at the camera lens as a bundle of parallel rays.
For all practical math purposes an object is at an infinite distance 1000 meter (1000 yards) distant. The ray trace starts from a single point on the subject and is then extended to show how it traverses the lens. The ray trace is then continued showing its path downstream from the lens. If properly focused, the trace inside the camera will depict a triangle with its apex just kissing off on the surface of the digital image sensor or film. The key point being, the ray trace is just a single point on the subject.
In actuality every point on the subject could be ray traced. Such a ray trace reveals that each point on the subject has a ray trace that resembles a cone of light. You see, the lens works by fracturing the light from a subject (vista) into a googolplex of cones of light. Each has an apex. Since all lenses have optical defects called aberrations, the apex of each ray trace as they kiss off on the sensor is never a point; it is actually a tiny circle of light juxtaposed with others and it has scalloped boundaries. Because it is seen as an imperfect circle jumbled with others, it is called a circle of confusion. The image derived from the lens is thus, countless cones of light each with an apex that kisses off on the sensor. As a rule, a ray trace to show the focal length is just a trace of a ray passing through the center (axis) of the lens. All the other rays are not shone.
Opticians are unable to eliminate these aberrations. The best that can be done is to mitigate each. This is done by designing the lens so that it consists of several glass elements. Some are dense glass, some are less dense, some are convex with positive power, and some are concave with negative power. Some are cemented together, some are air-spaced. The air-space has a figure (shape) formed by the surfaces of lens that sandwich it in. This lens shaped air-space also acts like a weak lens. There are seven major types of aberrations. To mitigate is takes seven or more glass lenses of different powers.
Because the camera lens is a complex array of glass, the measuring points used to find object distance and image distance are two cardinal points or nodal.  Their placement likely does not fall in the center of the lens barrel.  The forward nodal is the measuring point for object distance. The rear nodal is the measuring point for image distance.
The optician, likely uses lenses of different powers and this causes the nodal points to be shifted around. A true telephoto lens, as compared to a long lens of the same focal length, has its rear nodal moved forward. It can even fall in air ahead of the lens. This shortens the lens barrel making it less awkward than its long lens counterpart. Often, a wide-angle lens has a focal length too short to reach the image sensor / film. The optician shifts the rear nodal to lengthen the back-focus (distance last lens to film/sensor).
The focal length is measured from the rear nodal to the apex of the cone of the image forming rays.   When we focus on an object closer than infinity, the cone of the image forming rays is elongated due to the fact that then has limited refractive powers. Refract is Latin to bend backwards or inwards.
The key point for you:  Ray traces to show focal length are simplified drawings, likely only the axial rays are shown. The way a lens works is to fracture the subject into countless points. Each sends out light rays that traverse the camera lens. Each traces out a cone of light. There will be a googolplex of cones of light and thus a googolplex of circles of confusion. When focusing on objects closer than infinity we focus by moving the lens further away from the film / sensor.
Nobody said this stuff is easy!
Answer: When talking about light converging on the image plane in photography, we're talking about light from a particular point in the camera's field of view converging at the plane that contains the film or digital imaging sensor. In photography, this plane is called the focal plane or image plane. In the scientific field of optical physics, the terms focal plane and focal point are defined quite differently. When one reads such terms it is important to understand which usage for them is being employed.
Light from a singular point within the camera's field of view falls on the entire surface of the front of the lens. If the lens is properly focused at the distance which that point source of light is from the camera, then the light from that singular point that falls on the entire surface of the front of the lens converges on the same point at the image plane. Light from other points in the camera's field of view that are the same distance also converges on points on the image plane, but the points at which the light from different point sources converge on the image plane are not the same point. Light that is at an angle so that it is in the upper left corner of the camera's field of view will converge in the lower right corner of the image plane. Light that is at an angle so that it is in the top center of the camera's field of view will converge at the bottom center of the camera's image plane. Light that is at the center right of the camera's field of view will converge at the center left of the camera's image plane, and so on. Only light that is located on the lens' optical axis will converge in the center of the camera's image plane.
When a lens is focused at infinity, then the point source of light in question is sufficiently far enough away so that the light from that point which is reaching the front of the lens is sufficiently collimated to be indistinguishable from a source of light that is infinitely far away. Consider a star. We think of it as a point source of light. But stars are huge! They're much larger in diameter than the front element of any lens I've ever seen! Thus the light rays from a star (except our own sun, which is about one-half degree of arc in diameter as observed from the Earth's surface) that reach a lens here on Earth are almost perfectly parallel. This is what we refer to as collimated light.
We're not talking about all light falling on the front of the lens from every conceivable angle converging on the same point at the imaging plane. We're talking about light from one specific point within the camera's field of view falling on one specific point of the camera's film or sensor.
It seems you might be getting tripped up by the two different types of ray diagrams that are common. They look similar, but depict two very different things. One traces multiple rays of collimated light from a single point source at infinity. The other traces single rays striking the front of the lens from each of multiple points within the lens' field of view. In the first case, the rays converge on the sensor/film/focal plane. In the second case the rays from opposite sides of the lens cross over halfway between the lens and the sensor/film/focal plane. These two types of diagrams are not showing the same thing.


Does the lead character get targeted more often?

Question: I've got my favorite character set as party's "lead" character (the first one in the menu, and the one shown on screen when walking around the map). But it seems like they get attacked by enemies significantly more often than the other three characters. Is the lead character purely a cosmetic choice, or is that character targeted more often than the others?
Comment: I used to think that too, then I switched Tiz to another spot in the party. Guess who died first, numerous times. Again.
Comment: Edea was always getting KO'd on my team. She was always in slot 4 though.
Answer: Enemy targeting is largely random as far as I can tell. If you're having problems with a certain character being targeted, make sure they aren't using any targeting modifiers such as wearing a Red Muleta or the Pirate's Provoke. If your other characters are using Freelancer's Mislead or Ninja's Kakuremi, that might also be the issue at hand.
You can also use the aforementioned things to decrease the chance of your character being targeted if that's a problem.


How can I get Google to remove links to my site from their index and then recrawl my site?

Question: I have put my web site up on the internet and google has pretty much completely indexed it. I have changed my url structure so now all the pages google has indexed are 404. Is there a way I can get google to delete all these pages and then
Answer: You should be doing 301 redirects from the old URLs to the new URLs. That way Google knows the pages have moved and associate the new URL with the old URL.
But, if for some reason you don't want to do that, don't do anything. The 404 errors will cause Google to eventually stop crawling those old URLs. The new URLs will be found through internal links on your site and through your XML sitemap. You did submit an XML sitemap, right?
Comment: I was only really testing my site, so didn't expect google to start indexing yet. I don't have a list of the old addresses to programatically set up 301 redirects. Yeah I have an XML sitemap, so I guess I just have to sit and wait.
Comment: Perhaps if you add a `robots.txt` disallowing all pages, the wait may be a little less.
Answer: you can remove the old urls in webmaster tools, remove the old sitemap and resubmit a new one


How to store MS Sql Server uniqueidentifier in MySql table

Question: I have migrated MS Sql Server database to MySql (using MySql Workbench tool) and having some hard time to figure out how to store uniqueidentifier in the table. The tool automatically converts the uniqueidentifier to VARCHAR(64) but I am not sure whether this is correct.
In the web, lot of people are saying we can store the uniqueidentifier as CHAR(36) OR BINARY(16) in MySql so, can someone please tell me which one is correct & efficient to use.
Also, I tried BINARY(16) in a sample table to store GUID but it is not storing the full 32 character GUID instead it stores only the first 16 character and truncates the remaining characters. Please advise.
On the side note, I am trying to consume this GUID in the .Net application using Entity Framework 6 so, will this work fine or will I get any conversion error?
Answer: According the the MySQL website you should match it to VARCHAR(64)
<code>UNIQUEIDENTIFIER in MSSQL maps to VARCHAR(64) in MySQL
</code>
Click here to check what MySQL says about the same


Windows 2008 folder has lost all permissions, can't be deleted, edited or permissions changed

Question: I was testing a batch file that used the following dos command rmdir test2 /s /q, this command failed part way through and now I seem to have folders that have no permissions. For example, in the commandline I used DIR /Q to see the owners of all folders in that directory most of them were "BUILTIN\Administrators", but the folder I'm having trouble with shows "...". I assume that means there is no owner. So even though I am a domain admin I can not view, delete, edit or modify the permissions on this folder. Does anyone have an idea of how to delete/edit this folder?
Answer: You can always "Take Ownership" of the folder and subfolders, at which point you should be able to manage the permissions (assuming that filesystem corruption isn't in play here). You can use the built-in commands below to take ownership and reset the permissions:
TAKEOWN /f "X:\test2" /r /d y
ICACLS "X:\test2" /reset /T

Comment: Then try to log with a local administrator. If u get errors in security tab dont worry. U must go to ownership.
Comment: Hi Evan I tried your commands above, and get an Access is denied." Error, that seems to be the root of all my problems.
Comment: Does not work for me.
Comment: Can you offer-up some of the messages you might be seeing, or otherwise provide some more detail? This answer just turned 7 years old (happy birthday, answer!) but it should still work as it did in current versions of Windows.
Answer: Run/schedule a chkdsk with system fix turned on.