How should I handle disinterested/unorganized adviser?

Question: I've been working with Dr.X since the summer of last year. Things were going well until this past fall. He mislabeled some research files and asked me to do some analysis to help me determine if they were "A" or "B". I've done this type of research before in UG and never came across this level of disorganization. In any case, everyone makes mistakes so I tried to make the best out of it. After spending 2 months analyzing dozens of files, I told him many were too similar to separate confidently. Worse, the files that were supposedly labeled correctly (IE. "the same") were dissimilar. At this point, I was starting to get very frustrated (I didn't share that), because I wasn't doing actual "research". I told him I was supposed to state our research progress to the department and he decided we shouldn't (obviously) because nothing was done. I thought this reflected poorly on me, but I agreed. I was then out for the rest of the semester on maternity leave. I wrote him some code to process the files once he figured out which files were which. He may have just guessed. I really don't know what happened. Fast forward to this spring, he was away fixing equipment but stated we simply had to make great use of the time we had available. I agreed to meet him one morning and he completely flaked. He didn't email me. He showed up hours later and tells me he has to "go" and just rants about equipment breaking. Then he tells me to just read some paper, which I do. He also said he doesn't remember where we left off last semester. I reminded him and he said he wasn't sure if he ran my code yet. I told him we need to present research this spring, and he hasn't emailed me back (this was weeks ago). I emailed him this week asking him if we could do work remotely and have heard nothing...yet. I am losing respect for him and don't even want to work with him anymore. Is this a typical scenario? Oh, and there are rodents living in his office because he is so messy. I'm not joking. He was actually written up by the school. Our department is so tiny I don't know how to handle this situation. I did tons of research in UG and have published work, but have nothing started research-wise in my program. I'm a second-year student at a competitive school. Am I overreacting? TIA
Comment: It's time you changed advisor. As soon as possible, if you can. Someone who is messy to the point of having rodents in the office is dangerous, not unorganised. And I wonder why the university doesn't take action against such a serious health threat.
Comment: Thanks for your response. I'm writing the chair tomorrow since he isn't even responding to my emails. I've done all he's asked, but he's ghosted me. I know he's around because he sat in as a secondary instructor in one of my online classes and all of his traveling research has been canceled due to the virus.
Comment: Consider if your advisor might have attention deficit disorder.  It's very common.  If he does, that will not tell you the answer to your question, but it might help you decide how to respond.
Comment: I do not think you are over-reacting.  It seems like you are not reacting at all, and you should.
Comment: I sent a less pedantic email to the chair recently. I'm looking forward to actually doing research again.

"It seems like you are not reacting at all" LOL

I feel like I just lost 100 pounds of mental baggage.
Answer: Advisors are not expected to be perfect but they are expected to do their job. Yours doesn't, he's endangering your PhD and his institution (probably his career too but that's not the point).

Is this a typical scenario?

No.
Sure, some researchers are disorganized, have a messy office and/or hard drive, it's quite common. Some advisors are also known to occasionally abuse their role and give their students jobs which aren't related to their PhD, that's frowned upon but often tolerated. But whatever their shortcomings, an advisor must be able to fulfill their professional duties, and your advisor doesn't.

Am I overreacting?

Not at all.
Contact the head of the department, the institution ombudsman or whoever is in charge. It's not too late but it's time. Don't hesitate to go over the department, your institution has a responsibility to provide you with proper supervision.


During Assyria's conquest of Israel, what side did Judah take?

Question: Relations between Israel and Judah were fluid. They were sometimes allies and sometimes adversaries. During Assyria's long campaign against Israel culminating in the siege of Samaria and subsequent mass deportation, did Judah side with Israel, with Assyria, remain neutral, or oscillate between these positions as things got worse for Israel?
Answer:
In 721 BCE, the Assyrian army captured the Israelite capital at Samaria and carried away the citizens of the northern Kingdom of Israel into captivity. The virtual destruction of Israel left the southern kingdom, Judah, to fend for itself among warring Near-Eastern kingdoms. After the fall of the northern kingdom, the kings of Judah tried to extend their influence and protection to those inhabitants who had not been exiled. They also sought to extend their authority northward into areas previously controlled by the Israeli kingdom.

According to 2 Kings 18, while Sennacherib was besieging Lachish, he received a message from Hezekiah offering to pay tribute in exchange for Assyrian withdrawal. According to the Hebrew Bible, Hezekiah paid 300 talents of silver and 30 talents of gold to Assyria—a price so heavy that he was forced to empty the temple and royal treasury of silver and strip the gold from the doorposts of Solomon's temple. Nevertheless, Sennacherib marched on Jerusalem with a large army. When the Assyrian force arrived, its field commander Rabshakeh brought a message from Sennacherib. In an attempt to demoralize the Judeans, the field commander announced to the people on the city walls that Hezekiah was deceiving them, and that Yahweh could not deliver Jerusalem from the king of Assyria. He listed the gods of other peoples defeated by Sennacherib then asked, "Who of all the gods of these countries has been able to save his land from me?"

During the siege, Hezekiah dressed in sackcloth (a sign of mourning), but the prophet Isaiah assured him that the city would be delivered and Sennacherib would fail.1 Overnight, an angel killed 185,000 Assyrian troops.[2]

All quoted from Wikipedia - Assyrian Siege of Jerusalem
Comment: That addresses Judah's posture after the Fall of Samaria. What about before?
Comment: @PaulChernoch [Wikipedia - Assyrian Captivity](https://en.wikipedia.org/wiki/Assyrian_captivity) gives the whole historical background from scripture and other historical data. I only quoted in the answer what was relevant to the question - as to what 'side' Judah took.

During Assyria’s conquest of Israel, what side did Judah take?


Using the Qt framework strictly for a personal project I want in my GitHub portfolio

Question: I am using the Qt framework for a personal project of mine. Not intended to be sold or used by anyone else. Just a cool project that I want to have in my portfolio. What is required of me under the license if I am to add this to my public GitHub so employers can see it?
Answer: As this is a personal project, I will assume you are not using Qt under a commercial, paid for, license but under an open-source, free, license.
The requirements depend on how you incorporate the Qt code in your project and which Qt components you use.
If you use any components that are under the GPL license, rather than the LGPL license, then you must use a GPL-compatible open-source license for your code and it is preferred to use the GPL itself. This is because the combination of all code must be made available under the terms and conditions of the GPL license.
If you only use LGPL-licensed components, then it is very strongly advised that you dynamically link them as libraries into your project. The LGPL requires that it must be possible for the end-user to replace the LGPL code with a different version and that requirement is most easily fulfilled with dynamic linking. Other than that, there are no requirements on your code.


Unity - How to move a ship realistically to a point in a 2D top-down game

Question: i'm trying to move a sailing ship to the point where i clicked with the mouse.
this movement should be realistic (oar at the back where the ship moves around)
so if the mouse click is left and in front of the ship the ship should afterwards move there with a curvy path in order to have the right rotation
i'd be glad if someone could help me with this issue
thank
Comment: As your image seems to depict sails: Should wind be taken into account? Some maneuvers are impossible to do with the wrong wind or lack thereof.
Comment: More to the point, realistic-looking [sailing ship movement](https://en.wikipedia.org/wiki/Sailing) really *requires* taking wind into account; ignoring it would be almost like ignoring gravity when implementing jumping. You don't necessarily need a particularly detailed wind model, but you do need to keep in mind that your ships are being pushed around by the wind in their sails (and the water against their keel and rudder). In particular, ships can't sail directly upwind; they'll need to [beat](https://en.wikipedia.org/wiki/Tacking_%28sailing%29#Beating) their way there instead.
Comment: Usualy a "goto point" can be split into rotation phase and forward movement phase. Take the same aproach but impose to the rotation a forward movement. Example each x rad of rotation move the boat forward of y meters
Answer: See this page

Adding Realistic Turns
The next step is to add realistic curved turns for our units, so that they don't appear to change direction abruptly every time they need to turn. A simple solution involves using a spline to smooth the abrupt corners into turns. While this solves some of the aesthetic concerns, it still results in physically very unrealistic movement for most units. For example, it might change an abrupt cornering of a tank into a tight curve, but the curved turn would still be much tighter than the tank could actually perform.
For a better solution, the first thing we need to know is the turning radius for our unit. Turning radius is a fairly simple concept: if you're in a big parking lot in your car, and turn the wheel to the left as far as it will go and proceed to drive in a circle, the radius of that circle is your turning radius. The turning radius of a Volkswagen Beetle will be substantially smaller than that of a big SUV, and the turning radius of a person will be substantially less than that of a large, lumbering bear.
Let's say you're at some point (origin) and pointed in a certain direction, and you need to get to some other point (destination), as illustrated in Figure 5. The shortest path is found either by turning left as far as you can, going in a circle until you are directly pointed at the destination, and then proceeding forward, or by turning right and doing the same thing.

In Figure 5 the shortest route is clearly the green line at the bottom. This path turns out to be fairly straightforward to calculate due to some geometric relationships, illustrated in Figure 6.

First we calculate the location of point P, which is the center of our turning circle, and is always radius r away from the starting point. If we are turning right from our initial direction, that means P is at an angle of (initial_direction - 90) from the origin, so:
angleToP = initial_direction - 90
P.x = Origin.x + r * cos(angleToP)
P.y = Origin.y + r * sin(angleToP)

Now that we know the location of the center point P, we can calculate the distance from P to the destination, shown as h on the diagram:
dx = Destination.x - P.x
dy = Destination.y - P.y
h = sqrt(dx*dx + dy*dy)

At this point we also want to check that the destination is not within the circle, because if it were, we could never reach it:
if (h < r)
    return false

Now we can calculate the length of segment d, since we already know the lengths of the other two sides of the right triangle, namely h and r. We can also determine angle  from the right-triangle relationship:
d = sqrt(h*h - r*r)
theta = arccos(r / h)

Finally, to figure out the point Q at which to leave the circle and start on the straight line, we need to know the total angle + , and  is easily determined as the angle from P to the destination:
phi = arctan(dy / dx) [offset to the correct quadrant]
Q.x = P.x + r * cos(phi + theta)
Q.y = P.y + r * sin(phi + theta)

The above calculations represent the right-turning path. The left-hand path can be calculated in exactly the same way, except that we add 90 to initial_direction for calculating angleToP, and later we use  -  instead of  + . After calculating both, we simply see which path is shorter and use that one.
In our implementation of this algorithm and the ones that follow, we utilize a data structure which stores up to four distinct "line segments," each one being either straight or curved. For the curved paths described here, there are only two segments used: an arc followed by a straight line. The data structure contains members which specify whether the segment is an arc or a straight line, the length of the segment, and its starting position. If the segment is a straight line, the data structure also specifies the angle; for arcs, it specifies the center of the circle, the starting angle on the circle, and the total radians covered by the arc.
Once we have calculated the curved path necessary to get between two points, we can easily calculate our position and direction at any given instant in time, as shown in Listing 2.
LISTING 2. Calculating the position and orientation at a particular time.
distance = unit_speed * elapsed_time
loop i = 0 to 3:
    if (distance < LineSegment[i].length)
        // Unit is somewhere on this line segment
        if LineSegment[i] is an arc
            //determine current angle on arc (theta) by adding or
            //subtracting (distance / r) to the starting angle
            //depending on whether turning to the left or right
            position.x = LineSegment[i].center.x + r*cos(theta)
            position.y = LineSegment[i].center.y + r*sin(theta)
        //determine current direction (direction) by adding or
        //subtracting 90 to theta, depending on left/right
        else
            position.x = LineSegment[i].start.x
              + distance * cos(LineSegment[i].line_angle)
            position.y = LineSegment[i].start.y
              + distance * sin(LineSegment[i].line_angle)
        direction = theta
        break out of loop
    else
        distance = distance - LineSegment[i].length

Comment: This answer does not really look into the physics of ships. I also find it problematic that it is basically a link to and a lengthy excerpt from another website (I am unsure about the legality).
Comment: @Draco18s: What you *should* do is summarize the essential points of the linked material in your own words. (Or, better yet, answer the question based on your own experience, and only use links as supporting material or for further reading.) Short quotes are generally OK, especially in situations where they can't be really avoided (e.g. quoting somebody's exact words to demonstrate that they really said something), but quoting a substantial portion of an article is really going beyond [fair use](https://en.wikipedia.org/wiki/Fair_use).
Comment: The last time I provided an existing resource that was a solution to the question being asked, I was asked to include the content of the link in the event that the target site ceased to be.  Now I'm being asked to not include the content.  Make up your minds.
Comment: If the point is within the circle you can go out a bit and come back.
Comment: (Ps. See also [these](http://meta.stackexchange.com/questions/132911/copying-content-from-subject-matter-expert-site-to-support-answer) two [questions](http://meta.stackexchange.com/questions/64627/is-quoting-a-book-in-a-question-or-answer-copyright-violation) on meta.SE.)
Answer: As simple solution , as already I said in a comment, you can try this aproach:
consider a phase where you point the ship in the target direction, in that phase you apply a rotation to the sip but also a forward movement. When the ship is already facing target you can apply a full forward speed. I arranged a test in love2d , here follow the ship update method .
turnAngSpeed = 0.4 --direction changing speed
ForwordSpeed = 40 -- full forward speed
turnForwordSpeed = ForwordSpeed *0.6 -- forward speed while turning
function ent:update(dt)
            dir = getVec2(self.tx-self.x,self.ty-self.y) -- ship --> target direction (vec2)
            dir = dir.normalize(dir) --normalized
            a= dir:angle() - self.forward:angle() --angle between target direction e current forward ship vector
            if (a<0) then
             a=a+math.pi *2 -- some workaround to have all positive values
            end

            if a > 0.05 then -- if angle difference
                if a < math.pi then
                    --turn right
                    self.forward = vec2.rotate(self.forward,getVec2(0,0),turnAngSpeed * dt)
                else
                    --turn left
                    self.forward = vec2.rotate(self.forward,getVec2(0,0),-turnAngSpeed * dt)
                end
                --apply turnForwordSpeed
                self.x = self.x+ self.forward.x * turnForwordSpeed * dt
                self.y = self.y+ self.forward.y * turnForwordSpeed * dt
            else
                --applly ForwordSpeed
                self.x = self.x+ self.forward.x * ForwordSpeed * dt
                self.y = self.y+ self.forward.y * ForwordSpeed * dt
            end
end

The example animation shows (the final loop) a case where the ship can't reach the target , as the combination of turning and forward speed defines a turning radius too big, in this cases can bee usefull reducing the "turnForwordSpeed" or better make it dependent on angle distance (a) and target distance.
Comment: This is a nice answer, but it may or may not be realistic enough for the OP. Unlike, say, cars, ships don't really have a "turning radius": most self (engine/human) powered ships can essentially turn on a dime, while sailing ships depend on the wind, and can actually have a *negative* effective turning radius when tacking, in the sense that turning left into the wind can cause the ship to drift to the right. What ships *do* have is inertia (and drag): they cannot turn or move instantly, and once moving or turning, take some time and force to stop. Still, have a +1.
Comment: Thank you very much for your answer!!! :)
you sir are my hero!
Comment: @DavidT Then consider marking his/her answer as the accepted one, if it was able to solve your problem satisfactorily. :)
Answer: Unity Nav mesh system, it would likely do what  you want with a little playing around with the nav agent values.
Nav Meshes are pretty simple to use. And only usable in the top down setup (or at least only available to x/z movement)
Unity manual Page on setting up a nav mesh
Basically you can use any shape mesh to bake a navigation area, and add nav agents to your objects and have them find their paths around a navigation mesh
Comment: This is a good suggestion but, in order to be a good answer, it needs support and information on implementation. Please add some information regarding configuring nav meshes to make this a good answer. I think that's what the above commenters are trying to say :)
Comment: I find Draco18s's answer lacking in that regard as well. However, yours is not a real answer and more of a comment.


Unity dual monitor wallpaper corruption

Question: I am running 11.04. I have a Nvidia Geforce GT 240 with a dual monitor setup and am running the proprietary drivers. Each time I login, I get a weird problem. The left monitor has a corrupted background. It appears that the region where the app menu would reside is at a different zoom level than the rest of the screen.  If I do anything to cause occlusion on that part of the screen the background redraws and everything looks OK. Has anyone else experienced this problem?
Answer: I've seen this on occasion, I think it's due to some driver problems. What I do is open a window, and then drag it over the corrupted area, it should act like an eraser and show you the normal background.
It's reported on Launchpad: Bug #769458 Desktop background not properly drawn on login (dual monitor)

Unity dual monitor wallpaper corruption


How often do Ivy League universities advertise positions at the Associate Professor level?

Question: I've just seen a job opening at an Ivy League university, advertised as being open at either the Assistant Professor (tenure track) or Associate Professor (tenured) level. How common is this? Is it more likely that they have done this to widen the pool of potential excellent candidates, or because they already have someone in mind for the position, but need to advertise to satisfy an administrative requirement?
Comment: These schools have very high opinions of themselves. Therefore if they're going to give someone a tenured job, they think it should be someone who has already made truly monumental contributions in their field. That type of person already has tenure somewhere else.
Comment: It seems like the HR departments could provide an accurate answer.
Answer: In my experience it is quite common for universities at all levels to advertise positions in this way so that they can hire someone at the associate professor level if there is a strong candidate with appropriate experience.  I've been involved in many searches that were advertised in this way.  In my experience most of these positions end up getting filled at the assistant professor level anyway.


Are there languages that ban t+S (esh) sequences but have a č phoneme?

Question: I'm not expert in typology, but I wonder if it's possible for a language to ban t+S sequences but have a phoneme č.
Does anyone know of an example of one such language?
Comment: There are languages having a segment /t̠ʃ/, but lacking a segment /ʃ/, does this count as an answer?
Answer: English is a prime example, but that is a matter of analysis. One problem with the question as asked is that it mixes alphabets, contrasting tS (IPA tʃ) and č. The letter č is not IPA, so to normalize the letters into IPA, the question would presumably be about the cluster t plus ʃ versus the single segment t͡ʃ. Polish  czysta and trzysta, sometimes transcribed as [t͡ʃɨsta] versus [tʃɨsta], is an example of a contrast.
English on the other hand does not have a contrast. The question then is whether the thing in "church" should be analyzed as a cluster, or as a single segment. It is generally believed that it should be treated as a single segment, on the grounds that treating it as a cluster would complicate the rules for constructing syllable onsets. Stop-plus-fricative onsets are generally not found, and treating "ch" as a cluster would require a complex additional rule, which can be avoided be treating "ch" as a single consonant.
To be fair, we have to also see if there are any complications introduced by the single consonant analysis. "ch" does not combine with any consonant in the onset, so *chmee, *chrowl. This is similar to the restriction on ʃ, as long as you exclude (German and) Yiddish words like shmatte and Schweppes. However, there is one well-attested and unavoidable ʃC cluster, ʃr as in shrimp, shrove etc. One approach to this is to say that only /s/ can appear as a fricative in an onset fricative+C cluster, and treat [ʃ] in [ʃr] onsets as /sr/ (note the gap that there are no words like *[srɪmp]). If you accept the argument thus far, then it's simply a matter of also excluding the segment /t͡ʃ/ from onset clusters. (I am delaying the problem of "Toronto" being pronounced [t͡ʃranə] in said city, and "tree" being something like [t͡ʃri] in various parts of North America). The claim would be, specifically that [-anterior] coronals cannot appear in the onset with another consonant.
A large problem with this account is that it depends on there being an independent principle outlawing preconsonantal alveopalatal sibilants in the onset. While etymologically speaking all ʃC clusters derive from another language, that doesn't make them "not part of English". It is extremely unlikely that anyone pronounces the name Schwartz as [swɔrts], and Schwarts / sworts is probably a minimal pair for [ʃ,s] for people who know the word "sworts". So actually, we do have ʃC clusters.
This problem might be avoided by restating the relevant onset restriction: [-anterior] coronal stops are prohibited, but there is no ban on fricatives at the place of articulation. (Note that affricates qua single consonant are classically treated phonologically as stops). The problem is that the motivation for treating "ch" as a single segment is that treating it as a cluster requires adding otherwise unnecessary exceptional rules (exceptionally allowing t+ʃ). Alas, we need an otherwise unnecessary exclusion, to rule out [t͡ʃC].
The set of problematic onset clusters would be [t͡ʃw] and [t͡ʃr]. Stop plus obstruent is generally banned, likewise stop plus nasal, which leaves stop plus glide or liquid. There is also a ban on coronal stop plus [l], and you don't get [j] after alveopalatals... reducing the possibilities to [t͡ʃw] and [t͡ʃr]. As for [t͡ʃr], some speakers do pronounce initial "tr" something like that, so for them, it is possible that "tree" is /t͡ʃri/, and there is no gap. I say [tri], so for me there would be an unexplained gap. There is no independent rule that would rule out [t͡ʃw].
The point here is that invoking surface co-occurrence as the diagnostic for phonological analysis is a double-edged sword. In lieu of a Polish-type argument from contrast, the question is, how do you establish that a certain apparent CC sequence is a single consonant, versus a cluster? Analogous issues arise in the treatment of "prenasalized consonants" (NC clusters), "glottalized consonants (C+ʔ clusters), "rounded / palatalized consonants" (Cj and Cw clusters). Indeed, there are treatments of "sp, st" where these are "prespirantized stops" (Fujimura's CD model). Obviously, nothing can be concluded in a complete theoretical vacuum, but I find that it's extremely difficult to find nearly-universal agreement on the theoretical primitives pertaining to the problem of onset cluster vs. complex segment analysis.
Comment: English does have a contrast between the affricate and a /tʃ/ sequence in intervocalic position. Some Wikipedia article at one point listed "cat shit" and "catch it" as a minimal or near-minimal pair. The contrast can be analyzed in terms of syllabification, but it exists.
Answer: There are many languages that wouldn't permit a sequence like /t/ + /ʃ/ because it involves either coda /t/ (in the case of heterosyllabic /t.ʃ/ or a tautosyllabic stop-fricative complex coda /tʃ./) or a stop-fricative onset cluster, and it's not that unusual for a language to ban both of these things, while still allowing affricates like /t͡ʃ/ to occur as onsets.
(As user6726's answer pointed out, it's actually a bit difficult to establish based on other parts of the phonology that a language bans stop-fricative onset clusters, but onsets like [tʃ] are conventionally analyzed as affricate phonemes rather than as stop-fricative clusters unless there is clear evidence that they are two phonemes rather than one.)
For example, Japanese has [tɕ] as a possible onset, which can be analyzed as an affricate phoneme /č/ (I think there are other possible more abstract analyses, like an allophone of /t/ or /tj/, but my impression is that this is typically only considered to be the diachronic or morphological source of /č/). Japanese doesn't have coda /t/, nor any contrasting sequence of /t/ + a sibilant fricative. It does have a distinct phoneme /t/, as well as something that is probably a phoneme /š/ (as with /č/, the analysis is a bit complicated because /š/ originated from conditioned palatalization of /s/, and there are still some neutralizations and morphological alternations between Japanese š and s that could be understood as indicating that š is "underlyingly" something like /s/ or /sj/).
Standard Chinese has [ts], [tʂ], [tɕ], [tsʰ], [tʂʰ], [tɕʰ] as onsets, but doesn't have coda /t/ or any (other) stop + fricative sequences as onsets, so these are analyzed as affricate phonemes. Chinese does have /t/, /tʰ/ and /s/, /ʂ/, /ɕ/ phonemes.
Nick Nicholas brought up the example of Tsakonian in a comment.
Another example I thought of since posting this answer is standard Italian: it has č, t and š as phonemes, but no tš clusters, because coda consonants and consonant clusters are fairly limited in the native vocabulary of standard Italian. There is geminate čč. It is phonetically realized not with a double release like [tʃtʃ], but with greater duration of the pre-release portion, something like [tːʃ], but Italian speakers seem to perceive this as phonologically involving coda /č/ rather than coda /t/, and may transcribe it phonologically as /t͡ʃt͡ʃ/. The consonant /š/ behaves a bit interestingly as it is one of the "intrinsic geminate" consonants that always occurs as a geminate when it is in intervocalic position.
I think word-final /t/ can occur in Italian in loanwords from English, but I don't know too much about the way this is typically realized phonetically, and I'm not sure whether loanwords should be included in a discussion of this kind of phonotactic "ban".
Comment: Another example (not worth a separate answer): Tsakonian has melted down Greek phonotactics to eliminate clusters, keeping only NC, aspiration, and affricates; so /trexo̝/ > /tʃaxu/, /stoma/ > /tʰuma/. /tʃ/ is plentiful as an onset in Tsakonian; but no /t/ codas in Greek since the demise of gemination. Where they do survive in Greek, e.g. Cypriot, geminates can be initial—so geminates don't prove /t/ codas anyway. (In fact, /st/ > /tʰ/ likely went via an onset geminate.)


What methods exist for distance calculation in clustering? when we should use each of them?

Question: What methods exist for distance calculation in clustering? like Manhattan, Euclidean, etc.?
Plus, I don't know when I should use them. I always use Euclidean distance.
Answer: Well, there is a book called

Deza, Michel Marie, and Elena Deza. Encyclopedia of distances. Springer Berlin Heidelberg, 2009. ISBN 978-3-642-00233-5

I guess that book answers your question better than I can...
Choose the distance function most appropriate for your data.
For example, on latitude and longitude, use a distance like Haversine. If you have enough CPU, you can use better approximations such as Vincenty's.
On histograms, use a distribution-baes distance. Earth-movers (EMD), divergences, histogram intersection, quadratic form distances, etc.
On binary data, for example Jaccard, Dice, or Hamming make a lot of sense.
On non-binary sparse data, such as text, various variants of tf-idf weights and cosine are popular.
Probably the best tool to experiment with different distance functions and clustering is ELKI. It has many many distances, and many clustering algorithms that can be used with all of these distances (e.g. OPTICS). For example Canberra distance worked very well for me. That is probably what I would choose as "default".
Answer: There are two method which are widely used for calculating distance in the domain of clustering. They are:

Manhattan Distance
Euclidean Distance

However, there is no clear directive as to which of the above to select, so this post might be helpful to you regarding the same. Generally, the distance metric depends on the problem statement and the type of data.
For example, the euclidean and cosine distance are used when the data is dense and sparse respectively.

I always use euclidean distance.

I wouldn't blame you for that. However, when calculating cartesian distance (like in the case of Recommender systems), the Euclidean distance is preferred.
Answer: I wanna highlight that in addition to the well known distances:
 Manhattan Distance
Euclidean Distance
Symmetric kl-d can be used when you are clustering distributions.
Answer: Which distance function to use depends on the data geometry itself. In some cases you can plot you data and visualize then take decisions but in real world problems mostly it is not possible.
For most clustering algorithm like Kmeans, as long as a distance function is a metric you can use it.
There exists methods to learn a metric according to data geometry which you can use to cluster the data.

What is metric learning?
Introduction and Motivation.
Brian Kulis has a very nice survey paper on this.

Metric learning is closely related to dimensionality reduction.
If you are using MATLAB check this toolkit.
Comment: k-means only works with Bregman divergences, *not* with arbitrary metrics. Because of the *mean* not optimizing arbitrary metrics.
Comment: What it means when you say - mean not optimizing? Add a source please.
Comment: Search for "why k-means only works with Euclidean distance".


If the housing market is recovering, why would a REIT index ETF (e.g. VNQ) not be performing well?

Question: As you can see below, the Vanguard REIT ETF fund hasn't been doing very well for the last 6 months, but the housing market seems to be improving every month. Why do we have this difference?

VNQ Google Chart
VNQ FinViz Chart
Answer: VNQ only holds ~16% residential REITs. The rest are industrial, office, retail (e.g. shopping malls), specialized (hotels perhaps?) etc.
Thus, VNQ isn't as correlated towards housing as you might have assumed just based on it being about "real estate."
Second of all, if by "housing" you mean that actual houses have gone up appreciably, then you ought to realize that residential REITs seldom hold actual houses. The residential units held tend primarily to be rental apartments. There is a relationship in prices, but not direct.
Comment: Great remarks. I really got this wrong. So I guess the next question will be, which ETF should I research that correlate with the housing market?
Comment: @Geo why don't you ask it as a separate question? But note that this must be regional, since there are many markets even in a single country (especially as large as the US)
Comment: VMBS may be a better ETF in that it deals with mortgage-backed securities from GNMA, FNMA and FHLMC.
Comment: @Geo A separate follow-up question is a good idea.  You can link to this one.
Comment: @JBKing While there'd be a *relationship* between the health of housing & mortgages, the VMBS ETF (or any similar) isn't a good proxy for an investor to participate in real estate prices. Mortgage-backed securities are debt, like bonds, and they'll react more to changes in interest rates, credit risk, etc. Think: The holder of a mortgage doesn't participate in the upside; i.e. your bank doesn't get wealthier from your mortgage if your house value triples -- they are still just due back the principal loaned, plus interest. Higher home equity might make your mortgage less a credit risk, though.
Answer: To round out something that @Chris W. Rea pointed out, the business that a REIT is in will be either A) Equity REIT... property management, B) mortgage REIT... lending, or C) hybrid REIT (both).
A very key point about why REITs broadly have been struggling lately, (and this would show up in the REIT indices/ETFs you've linked to,) is linked to the REIT business models.
For an Equity REIT, they borrow money at the going rate (let's say ~4.5% for commercial-scale loans), and use that to take out mortgages on physical properties. If a property rents for $15K per month, and they can take out a $1.8 million loan at $9,000 per month, then their business is around managing maintenance, operating expenses, and taxes on that $6,000 per month margin.
For a mortgage REIT, they borrow funds as a highly qualified borrower, (again let's say ~4.5%), and lend those funds back out at a higher rate. The basic concept is that if you borrow $10 million at 4.5% for 30 years, you need to pay it back at $50,668 per month. If you can lend it out reliably at 5%, you collect $53,682 per month... a handy $3,000 per month. The cheaper you can get money at (below 4.5%) and the higher you can lend it at (above 5%), the better your margin is.
The worry is that both REIT business models are very highly dependent on the cost of borrowing money. With the US Fed changing its bond-buying/QE/stimulus activity, the prevailing interest rates are likely to go up. While this has its benefits (inflation), it also will make it more expensive for these types of companies to do business.


Infowindow selection change

Question: I am using infowindow to display the results of identifyTask that has two layers from my map service so it returns multiple features.
The infowindow has more button in each feature it identifies so that when I click the more button I get the data of current feature. How can I get the current selected feature? I am using this example.
 I want to get incase the popup identifies more than one feature to get current feature How can this be done.
Answer: For the map.infoWindow, you can either access the entire list of selected graphics by working with map.infoWindow.features, or you can get the current selected feature using map.infoWindow.getSelectedFeature(). This returns a graphic, and you can get the data on that graphic by looking at graphic.attributes.
function getMoreInfo() {
  var graphic = map.infoWindow.getSelectedFeature();

  // do something with the data inside the graphic
  doSomething(graphic.attributes);
}

If you want to know when the selected feature is changed in the infoWindow, and you're using an API version 3.4 or later (when the Popup was made the default infoWindow), you'll need to set up a listener to the infoWindow's "selection-change" event. Here's how you could do it using dojo/on.
dojoOn(map.infoWindow, "selection-change", getMoreInfo);

Comment: How do you know when the user has clicked the arrow to select a different feature?  InfoWindow appears to only have show/hide events.
Comment: If you're you're using the Popup InfoWindow, which was made default back in v3.4, you can listen to the infoWindow's "selection-change" event. https://developers.arcgis.com/javascript/jsapi/popup-amd.html#event-selection-change. I'll update my answer
Comment: Ah, you're absolutely correct.  I'm using a webmap from ArcGIS Online and had not made the mental connection that map.infoWindow is an instance of PopUp. I was just looking at the docs for esri.dijit.InfoWindow wondering why there wasn't a whole lot there.  I tested "selection-change" in this case and it worked.  Thanks!

Infowindow selection change


How to teach my son to protect himself from other kids?

Question: My son is 30 months old and he is very nice and quiet kid but children take his toys and beat him without saying anything to them. What i need to do to teach him to protect himself and not to cry when they take his toys.
Comment: Why would crying be a bad response? It gets adult attention to intervene
Comment: We need more context. Is this at home, at a daycare or somewhere else ? And we need the age of other kids as well.
Answer: It was common in a bygone era to let toddlers and other young kids play with little supervision as long as the children couldn't escape. This is no longer the case, and more egregious examples are prosecuted civilly by Family Services.
At 2 1/2 years old, there should always be an adult supervising play. If it's a play area in a mall or some such, that person is your partner or you.
If bullying is happening routinely at a daycare, it might be a good idea to change daycare providers. Otherwise, you could investigate the policies of the program and make a list of your grievances. At that point, it's up to the daycare to respond (by contacting the parents of the aggressive child).
My favorite one-liner when "disciplining" someone else's child in similar situations is "Keep your hands to yourself, please." If that doesn't work, it is better to remove your child from the situation rather than confront the aggressive child's parents. Usually, the apple doesn't fall too far from the tree.
Answer: Start by teaching appropriate boundaries.  Boundaries are the basis of personal safety.
A few examples:
How boundaries relate to abuse (bullying, picking on, etc.):

Boundaries define self.  When we have established clear boundaries (bouth our outer skin boundary and our internal inner life boundary), we are more aware of our own rights, have a strong sense of self, and how we deserve to be treated by others.  By first respecting ourselves, we are then able to instill respect in others and set limits around how we want to be treated.  With clear boundaries, we also have a clearer picture of our own needs and desires, so that we can choose to ask for assistance if we are unable to meet our needs on our own.
Boundaries clarify responsibilities.  Clear boundaries help define what we "own;" what we are responsible for.  We do not have to take on other people's responsibilities unless we choose to, just as they do not have to take on ours.  Wheile it is important to be sympathetic to other people's needs, it is equally important to know our own limitations.
Boundaries give us options.  Since boundaries give us ownership, we have control over what happens to us and our bodies.  Our choices and options are much broader because we have the right to say whether or not we want something to happen or not to happen.

-- www.childrenscenter.cc
Since we are talking about a 2 or 3 year old, it is meaningless to define or explain the concept of a boundary.  This must be a behavioral, functional approach focused on promoting conscious awareness of both one's own boundaries and the boundaries of others.
Modeling is by far the best, and sometimes only, effective method of teaching appropriate behavior of any kind to a younger children, especially toddlers.  The best way to model respect for boundaries is to both enforce and respect them with your son (complete modeling).  This can be done in many ways and in many natural situations.  Any time you dress him change his diaper (if still in diapers), bath him, apply sunscreen, etc., you can demonstrate respect for boundaries by gaining his consent before entering his personal space.  Even if the contact or action isn't optional, you can demonstrate respect for personal space and boundaries by telling him what you need to do and why.
The experience of having ones boundaries respected validates and reinforces them, and while enforcing them brings awareness to the boundaries of others and demonstrates that it isn't acceptable to violate them.
Making a game of boundary setting is even better as it makes it fun.

Why are Boundaries Important?
Establishing physical, social and emotional boundaries help us to judge the acceptable and unacceptable in all our social interactions. Without boundaries, our lives and relationships would be chaotic. Establishing healthy boundaries allows people to feel secure and in control of their personal safety.

-- http://www.sccstopchildabuse.org
How Does a young child enforce boundaries?
The simplest, and quite often most effective, way of enforcing boundaries is by forcefully saying "No!".  I am often surprised by the impact this can have even from the mouth of a two-year-old (I have one, and he uses that word a lot, often leaving it ringing in my ears).  It might not be a coincidence that this is one of the first words children learn.
Regardless of how well or poorly a child reacts to boundary violations, you can't expect a young child to assume responsibility for his own safety.  As others have pointed out, that is one of your jobs as a parent.  Make sure he is in an appropriate environment, and that your expectations and goals on his personal safety are developmentally appropriate.
Of course there is much more information out there, and you would do well to inform yourself and those closest to you on the subject.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/71618/discussion-on-answer-by-zugzwang-how-to-teach-my-son-to-protect-himself-from-oth).


Which endurance tires for touring?

Question: I got a recommendation from an experienced tourer to switch to Schwalbe Marathon Plus endurance tires during summer and Schwalbe Spike something during winter. I like the Marathon Plus tires, despite them being a bit slow, because I don't want to get a flat in locations called no-where. I am not interested about product recommendations but rather how can I know a good endurance tire for a certain touring location? If you know that a road is poor for the next 1000 kms, is it a good idea to switch to wider tires with greater volume? Is there any objective way to test a tire in a random shop? I have noticed that sometimes some LBSs have old tires but time-to-time it is hard to say. So how can I detect a good endurance tires if my favorite tires cannot be found? By it I mean that I want more objective ways to select tires rather than just brand.
Comment: found a start-up company Wheelenergy [1] that tests puncture-resistance. It is an independent laboratory, really uncommon in this area! If I have understood right, the company puncture the tires, not just pieces of tires traditionally. Certain firms such as Trek and Specialized use their services, have to investigate whether they have tested touring tires. [1] http://wheelenergy.webs.com/puncturecutresistance.htm
Answer: It's difficult to judge the quality of a tire hanging on a rack in a bike shop.  Experience (including recommendations) is an important factor, since it takes 1000's of kms to put a tire to the test.  When deciding on a touring tire, buy a set to try out pre-tour.  You'll get an idea how they handle, how fast they wear, how puncture-resistant might be just by using them for everyday riding.  Then when you're ready for the big trip, put a fresh set on the bike and save the worn ones for when you get back.
Certainly wider tires will help on rough roads.  Thicker tires may last longer.  For puncture resistance, stay away from racing tires and look for ones with a kevlar belt (or similar puncture protection layer).
If you know the roads may be bad, plan ahead and get a wider set for the entire tour.  Don't plan to buy wider ones during the trip -- you never know what will be available when you get there.  Conversely, if you find yourself having to replace a tire while on tour, your options will likely be limited.  You'll just have to settle for what you can find.  (I once had to replace a split road bike tire in a small mountain biking town but only one shop carried my size -- an off-road knobby tire. Still better than a split one!)
Comment: can you give a picture with `kevlar belt`? Google tells me that kevlar is some sort of strong polymer but no idea what it means with tires.
Comment: @hhh: added a link to an image on wikipedia.  The blue layer in the cross-section is made of kevlar (this may be a Schwalbe, hard to tell). Different manufacturers may use other materials, but it's basically an extra layer to keep glass and other debris from working through.  Not 100% effective, but can often slow down the onset of a puncture.  You won't see this from just looking at the tire, but it may make the casing feel stiffer.
Answer: Two points to note when choosing an endurance tire are firstly the thickness of the side wall, since while touring you can easily get rock, sticks, nails, whatever hitting the side while you are riding.  Secondly, you can "age" a tire a little bit by buying it before time, and placing it onto a rim with a tube pumped up to low pressure to help fill out the shape. After a month or so you will find that the tire has actually hardened a little, and will be slightly more puncture resistant.
Comment: can you clarify `"pumped up to low pressure to help fill out the shape"`? So even if I have 4.5-6 bar Marathon tires, it is initially better to fill them to low pressure? Any idea when to know when it is safe to use the maximum recommended pressure for `"ag[ing]"`? Yes, I have noticed that the new tires are not totally in shape so the idea sounds tempting to try -- did not even thought about using low-pressure for new tires! But yes the new tires can be fragile particularly as they haven't yet molded to the rim. Good tip to avoid flats. +1
Comment: I just pump them up so that when I give them a squeeze I can push my thumb to the rim, but there is a some resistance to this.  I think it works out to be about 60 psi for tires that have a maximum rating of 130 psi.  In terms of keeping them at maximum pressure, I think that this has a big drawback in that the strain on the threads will lead to splitting of the tire earlier then would otherwise be the case.  I actually let the pressure out of my tires if I know I won't be riding in the next week.

Which endurance tires for touring?


Use of proper tense when describing events as trivia

Question: I'm writing a speech for someone who will be speaking about events in the past. Specifically, he/she will review events in certain years in the past, which are presented as "trivia". For example, for 1981, he/she might say "...in 1981 the wreck of the Titanic was found." Or "...is found."?
I was so sure it should be past tense, but now I'm not so sure.
Is it present because the year being discussed will always exist in our present recollection of it?
Thanks in advance for any help.
Comment: You are trying to chose between the ***simple past tense*** and the ***historical present tense*** (https://en.wikipedia.org/wiki/Historical_present). Both are acceptable. The latter is sometimes used for rhetorical effect and in timelines (e.g., http://ncam.wgbh.org/experience_learn/educational_media/describing-images-for-enhanced/example-time-line).
Answer: As Silenus said, you are trying to chose between the simple past tense and the historical present tense. Either are acceptable, but the speaker should choose one or the other, for the most part, and not switch back and forth randomly.
Answer: The historical present is an affectation that is used pretentiously to give a spurious immediacy to an account of the past. It is often used by academics who strive for the urgency of the present when trying to enliven the past. Use the simple past and the tale will be told much more clearly and forcefully.
Answer: You're writing for a speaker so you should use the grammar of spoken English which isn't the same as the grammar of written English. 'Was' is the answer. 'Is' might have been correct in the 19th cent but not today. It would confuse the ears of the audience. Might I suggest that you read your text aloud. Anything that doesn't sit well in the mouth should be changed.


Has the concept of TU other application than proving convex hull characterizations?

Question: If a matrix is totally unimodular (TU), then we know that $\text{\{}x| Ax\leq b \text{\}}$ is integral for all integral $b$'s. This is often used for convex hull proofs, but does the concept of TU has further applications?
Answer: The reference: Model building in mathematical programming
Total unimodularity is a strong property that guarantees integer optimal solutions to an LP problem for all $c$ and integer $b$. Many IP models for which the matrix $A$ is not totally unimodular frequently (although not always) produce integer solutions to the optimal solution of the corresponding LP problem.
In particular, this often happens with the set packing, partitioning and covering problems. There is, therefore, great virtue in such a reformulation as the high computational costs associated with an IP problem over an LP problem is avoided. For example:
Comment: yes this is the application of convex-hull proofs. But is TU simply a tool for proving convex-hulls or is it interesting also in other contexts?
Comment: @user3680510, I think, the main practical usage of the TU also mentioned in the above reference is reducing the solving time by reformulating some constraints.
Comment: yes i agree, but this is the reason of this question, since this is the only pratical and theoretical reason i know.


Road bike frame sizing

Question: I found an old racing road bike with a 50 cm frame. I would like to build it out and use it, but I am concerned it may be too small for me. I'm 5' 7.5" and I think I should be riding a 54 cm frame, but I'm not sure. Would that 4 cm difference be an issue?
Comment: If it's any help I'm the same height but ride 56cm.
Comment: Do you have an existing bike that you find comfortable to ride?  If so, use a tape and measure from the BB axle up to the top of the saddle, staying parallel to the seattube on your known-good bike.  See if the other bike can replicate this measurement without exceeding the "minimum insert" mark on the seat post.   Mine's 83cm, anything less than 81cm is uncomfortably small.
Comment: I'm the same height and rode a 50cm frame. I had the longest seat post & stem I could find to get a good position on the bike. It worked OK for me for many years, but as I got older, it got less and less comfortable.
Answer: I'd say "proceed with caution." The main question is whether you can get your contact points where you need them. And you probably can, but there may be compromises.

A smaller main triangle, ridden by someone with bigger feet, will increase the likelihood of toe overlap.
You'll obviously need to jack up the seatpost, and if you're past the limit line, you may need to get a new seatpost.
You may need to put a longer stem on the bike in order to get the right "reach," and this can have consequences for handling. You'll probably want to put on a stem that has a fair amount of rise, to make of for the frame's smaller "stack." Otherwise you'll either need very good hip and torso flexibility or a willingness to ride with discomfort.

Also, for whatever it's worth, small bikes (such as 50 cm) often have innate geometry compromises in order to fit the frame around 700C wheels.

Road bike frame sizing


How do I tell my daughter she has a half-sister who wants nothing to do with her?

Question: When I was young, I'd had a daughter, "Sam". She's now about to turn 17. Her mother and I never married, and never considered being together. I pay child support, and communicate frequently, but we have no real interaction outside of emails. Sam doesn't have any real interest in me, or my current family. I do now have another daughter, "Rene", who is about to be 11. She doesn't know about Sam. I've not told her because I know how excited she would be to have a sibling, and how crushed she would be to find out that Sam wants nothing to do with her. Taking nothing away from Sam, Rene is an amazingly bright, happy, wonderful child. She's also very sensitive to her own feelings and the feelings of others. I know that Rene would be devastated to find out Sam would want nothing to do with her. And it would break my heart to see her go through that. My question is how do I tell her about Sam? Should I tell her about Sam? Should I have done so already?
Comment: Have you asked Sam whether she might be interested in meeting/e-mailing/... Rene? Is she clearly *opposed* or just *not interested*?
Comment: Oh yikes. Yah, this might be better left alone until they are both adults. 17 years old is a VERY selfish time for kids, and 11 years old is a VERY tough emotional time for kids. Very bad combo in this situation. Plus, you may be betraying Sam's trust by bringing Rene in on all of this.
Comment: @Stephie: Sam knows about Rene, and has made it very clear that she wants absolutely NOTHING to do with her. So much so she even refuses to call her "sister".
Answer: You would absolutely not frame it as her half-sister wanting nothing to do with her.  You frame it, correctly, as the daughter not wanting to be involved with you.
If you need to explain "why," tell her that you and her mom split up, and she feels hurt and rejected by not having you in her life as a full-time father, even if it wasn't an actual rejection by you, so she avoids contact and interaction because it reminds her of that hurt.
But, absolutely, do not allow your daughter to feel the rejection is in any way focused on her.
When should you?  I don't have as clear an opinion on that, especially since I don't know your daughter's personality like you do.
Answer: Have you told Sam about Rene and that Sam's feeling of resentment or frustration toward you doesn't change the fact that she shares blood with rene. Ask her to put herself in renes shoes. But don't be pishy. It may just take time. What rene won't know at this point won't hurt her and when she is old enough to fully grasp it all she most likely won't resent you for a desicion her sister made. I have family that wants nothing to do with me.I didn't believe my mom when she told me after I was 16. I met them.even stayed with them.moved to their state even for two years ...wasn't worth my energy.they still aren't and I thank my mom for not telling me when I was younger and giving me that worry of a family not yet known
Comment: 17 is a very selfish and emotionally volatile time for kids. Telling Sam right now has a high potential to in disaster because of Sam's stance. Once they are adults and more emotionally diverse, they may become close.
Answer: My dad had 3 marriages, and I knew that I have a sister from second, but never seen her. What I figured out when I was 27, that I have an even older half-brother. I can tell that I was surprised, but I could understand my dad being non-talking about it. But I was raised as single child and never was excited of having a brother. Anyway, it depends, and in my opinion there's no clear answer.
Answer: Imagine being in Sam's shoes. You're 17 and your dad, who never really cared to connect with you, now wants you to connect with his daughter, whom you have no interest in meeting, instead of showing an interest to mend the relationship between you two.
For Sam, Rene is a symbol of you moving on and not caring about her. By expecting Sam to care about Rene, your just rubbing salt into her wounds, you're the one being selfish. Just leave Sam alone and don't force Rene into her life.
My own dad remarried and had another daughter when I was 16, and I feel like what Sam is feeling must be stronger versions of feelings I've had myself at that time, That's why I thing you should not force Rene into Sam's life at all.
Comment: It's not me who had no interest in Sam, but her who had no interest in me. Even at a younger age she never really cared to have me around.


Did the Herodian Temple have virgins?

Question: I have heard a story about Mary being the "Ever Virgin" and it started out with her parents presenting her at the temple as a virgin and she stayed a virgin for the rest of her life, even after giving birth to Christ.
My question: Did the Herodian Temple have virgins similar to temple dedicated to some of the Greek gods and goddesses?
Comment: I saw something similar in I think the Infancy Gospel of James.
Comment: I am voting to leave this question open. It is basically a question about Mary's life, which relates to various Christian doctrines, including that referred to in the question itself as "Mary being the 'Ever Virgin.'" So it is certainly about Christianity and the roots of Christianity. Questions about Christian history are on-topic here.
Comment: I'm voting to close this question as off-topic because it's primarily about history, not Christianity.
Comment: I'm not sure I understand. What is meant by "Did the Herodian Temple have virgins?"
Comment: I was wondering if the Temple durring Jesus's day, the one built by Hardod, took young girl as virgins like the temples of Venus and Aphrodite did. So could the Hebrews have had something similar to Vestal Virgins?
Comment: @J.M.Myers I doubt it, but interesting question nonetheless.
Comment: Is this even a question about Christianity?
Comment: This question definitely deserves to be left open.
Answer: The first part of The Gospel of James, an apocryphal Gospel "contains the story of the unique birth of Mary to Anna and her childhood and dedication to the temple". Similarly The Gospel of Pseudo-Matthew confirms "Mary entering service as a temple virgin".
David Hughes gives a fascinating historical background on this subject where he says:

Mary "the Virgin", the only child and daughter of Heli (Luke 3:23) (Irenaeus' "Against Heresies", 3:21) (Palestinian "Talmud", Haggigah, Book 77, # 4) [possibly identified with Alexander "Helios", son of the Maccabee Queen Alexandra II by the first of her three husbands], who was a Davidic Dynasty prince, and his Levite wife, Anne, was born around 20/17BC.
In one of the apocryphal gospels Mary's parents appear as an elderly couple, childless, whose prayers for a child are granted by God and made known by an angel who visits them. Heli and Anne, when Mary was age three, dedicated her to God's service at the Temple in Jerusalem and at age nine or ten gave her into an order of temple virgins. . . .
Mary, according to apocryphal literature, was early orphaned at age ten and placed into an order of temple-virgins. There are different stories of this event: one, that, Mary, age ten, following the execution of her father, Heli, is taken from her mother, Anne, and, as a possible heiress, to prevent her from marrying or having any children to later rival King Herod or his heirs on the throne, was put by King Herod into an order of temple-virgins, whose members were made to take a vow of chastity, hence, the theory developed that Mary, under a vow, was "ever-virgin". Her mother, Anne, came to visit her daughter on occasions, but appears to have died while Mary was still a young girl, around age twelve. Here, enters the story of her aunt Elizabeth and uncle Zacharias, Elizabeth's husband, a priest, who periodically served in the Temple at Jerusalem according to the schedule of his particular religious order [Abijah].
There is a story that says Mary remained in the temple until she was age 13 when the High-Priest, during a change of political climate, gave Mary into the custody of her aunt and uncle, Elizabeth and Zacharias, who took Mary into their home [either at Hebron or Juttah], and for a while were her guardians. She returned to Jerusalem with them on the occasions of her uncle's periodical temple-service. (bolding is added; bracketed material is in the original)
Comment: I edited your post for formatting. Click [edit] to see how I did that. [See all the formatting goodies.](http://christianity.stackexchange.com/editing-help)
Answer:
Did the Herodian Temple have virgins?

The answer is almost certainly no.
The only real support for Jewish temple virgins is found in Roman Catholic writings in support of the Catholic doctrine of the perpetual virginity of Mary. This doctrine has no basis in the canonical scriptures, but only in non-canonical early writings, most of which were influenced or produced by the Essenes and similar mystical and ascetic quasi-Christians sects that existed in the first few centuries of the Christian era.
Jewish scholars and historians, by contrast, give a definitive "no" to the question of whether there were Jewish temple virgins.
Unlike in Catholicism, in Judaism marriage is considered the most holy state, pursuant to the first commandment of God given in the Hebrew Bible: "Be fruitful and multiply, and fill the earth, and subdue it" (Genesis 1:28). In Judaism celibacy is frowned upon and even considered sinful. To have consecrated virgins at the Temple would violate Jewish sacred law and custom. No Jewish writings, ancient or modern, provide any support for the idea that there were temple virgins at the Temple in Jerusalem.
There is mention of "women who served at the entrance to the tent of meeting" (i.e., the Tabernacle) in Exodus 38:8 and 1 Samuel 2:22. However, there is no support in these passages for the idea that they were virgins. The underlying Hebrew does not use the Hebrew words traditionally translated "virgin" in Christian translations of the Old Testament. (And those words themselves are not as cut-and-dried as many Christians think they are. See the article on "Virgin, Virginity" in the Jewish Virtual Library. Short version: These words commonly mean "young woman" rather than "virgin.") Exodus 38:8 uses a female form of a word meaning "one who serves" (at the Temple), and 1 Samuel 2:22 uses the common word for "women."
In the New Testament, there is mention of a prophetess Anna who stayed at the temple, but she was a widow, not a virgin. See Luke 2:36-38.
So although there were women associated with the Tabernacle and the Temple, who provided services there or engaged in prayer and prophecy, they were not consecrated virgins.
In short, the best scholarship on this subject says that there were no temple virgins at any of the ancient Jewish temples, including the Herodian temple.
Comment: @Schuh Still, in response to your quite valid point, I've removed the tangential line about temple prostitutes from the answer. Thanks.
Comment: @KenGraham A holy state is not the same as the most holy state.
Comment: While worship in the *Herodian temple* probably never included sacred prostitution, the earlier temple certainly did, according to the Bible.  An Asherah pole stood in Solomon's temple for about half of its 400 years, and we're told good kings Asa, Jehoshaphat, and Josiah tore down the houses of 'sacred prostitutes' on the temple grounds during their reforms.  Sacred prostitution was outlawed in the Deuteronomic law, but the Israelite/Judahite people didn't abide by that law during most of the time Solomon's temple stood.  [See DeYoung, p.165+, http://tinyurl.com/h7fjuhc ]
Comment: @Schuh It's quite true, according to the Bible narrative, that Solomon's temple was corrupted by proscribed practices during a substantial part of its existence. And it's a good point that the ancient Jews didn't always follow the commandments of their religion. However, temple *prostitutes* are not the same thing as temple *virgins.* While sexual immorality clearly existed in ancient Jewish culture, and apparently even invaded Solomon's temple during part of its existence, celibacy as a sacred practice had little traction in ancient Jewish culture as represented in the Bible.
Comment: **"Unlike in Catholicism, in Judaism marriage is considered the most holy state, pursuant to the first commandment of God."** Actually, Catholics hold marriages as a holy state!
Answer: Outside of apocryphal/pseudo-apocryphal writings, No
If at all the temple virgins or prostitutes would  have come from the Greek/Macedonian influence and defilement of the temple.  It was common for Israel to adopt foreign worship practices, for example;
Of King Ahaz -  "but he walked in the way of the kings of Israel. He even burned his son as an offering, according to the despicable practices of the nations whom the Lord drove out before the people of Israel.
2 Kings 16:3
After Judas Maccabee took over Jerusalem during the Maccabean  revolt the temple was cleansed (ritually) and returned to Levitical worship:
"10: 1 But Machabeus, and they that were with him, by the protection of the Lord, recovered the temple and the city again. 2 But he threw down the altars which the heathens had set up in the streets, as also the temples of the idols. 3 And having purified the temple, they made another altar: and taking fire out of the fiery stones, they offered sacrifices after two years, and set forth incense, and lamps, and the loaves of proposition." - 2 Maccabees 10:1-3
After the Maccabees, Queen Alexandra established Levitical worship as practiced by the Pharisees and
"She also restored again those practices which the Pharisees had introduced, according to the traditions of their forefathers"
13.16.2 Antiquities of the Jews.
With the Pharisees established as a liturgical authority they remained an influence into Herod's rule.
Also, according to Josephus (14.3.2), the Pharisees relied on the Romans to help restore the old priesthood and
"At this point, the majority of the city's inhabitants, pro-Pharisee and pro-Hyrcanus, decided to open the city's gates to the Romans. Only a small minority of Sadducees took refuge in the Temple and decided to hold out until the very end. This was Autumn 63 BCE. On this occasion Pompey broke into the Temple." - The History of the Second Temple Period, Paolo Sacchi, ch. 8 p. 269
With Herod a puppet King of the Romans it is unlikely he would have reverted back to pagan worship or practices in the temple thus going against the Pharisees to that extent.
Lastly, later during Paul's visit to the temple he was arrested and accused of 'defiling' the temple by merely bringing in a gentile. If there were pagan practices or traditions (virgins) it is not likely this would have even raised an eyebrow.
Acts 21:27-28
"When the seven days were almost completed, the Jews from Asia, seeing him in the temple, stirred up the whole crowd and laid hands on him,
crying out, "Men of Israel, help! This is the man who is teaching everyone everywhere against the people and the law and this place. Moreover, he even brought Greeks into the temple and has defiled this holy place."
Comment: Welcome to Christianity.SE. For a quick overview, please take the [Site Tour](http://christianity.stackexchange.com/tour). Thanks for offering an answer providing some historical background. Can you provide references for the statements about Judas Maccabee? Beyond that, the question is about Mary, who was Jewish, being presented as a virgin at the temple by her parents. So it's not about non-Jews becoming temple virgins or prostitutes there, but rather about whether the Jews themselves had an active tradition and practice among their own people of temple virgins at Herod's temple.
Comment: @LeeWoofenden references added.  The answer addresses whether there would have been temple virgins, a pagan practice, of which the answer is no therefore Mary could not have been one.
Answer: Did the Herodian Temple have virgins?
Catholic tradition holds this to be true, but these virgins were not similar to temple Virgins dedicated to some of the Greek gods and goddesses? They simple young virgin maidens of Israel.
The Presentation of the Virgin Mary, also called Entry of the Most Holy Theotokos into the Temple is a feast celebrated in the Catholic and Eastern churches on November 21. It was held in the Eastern church in the 6th century but did not become widely accepted in the West until the 15th century. The pope St. Pius V (1566–72) suppressed it, but in 1585 Pope Sixtus V reestablished the feast. Generally considered a feast of popular piety, it signifies Mary's total and lifelong devotion to God, as anticipated by her Immaculate Conception, and heralds her future vocation as the sacred vessel for the Incarnation.

The Presentation of the Virgin Mary by Titian (1534-38)
This Catholic and Orthodox feast is not associated with an event recounted in the New Testament, but from the apocryphal Protoevangelium of James. According to that text, Mary's parents, Joachim and Anne, who had been childless, received a heavenly message that they would have a child. In thanksgiving for the gift of their daughter, they brought her, when still a child, to the Temple in Jerusalem to consecrate her to God. Later versions of the story (such as the Gospel of Pseudo-Matthew and the Gospel of the Nativity of Mary) indicate that Mary was taken to the Temple at around the age of three in fulfillment of a vow.
The account of the Presentation of the Blessed Virgin Mary in the Temple is principally based on the Protoevangelium of James, which has been dated by historians prior to the year 200 AD. The story relates that in thanksgiving for the birth of their daughter Mary, Joachim and Anne decide to consecrate her to God, and bring her, at the age of three years, to the temple in Jerusalem. Mary's presentation in the temple draws parallels to that of the prophet Samuel, whose mother Hannah, like Anne was also thought to be barren, and who offered her child as a gift to God at Shiloh.

Previously we examined the tradition and biblical foundation for the Catholic teaching that Mary was consecrated as a Temple virgin at the age of three and lived in the temple precincts till the age of fourteen when she was married to Saint Joseph and there after virginally conceived the Son of God.
This school of Temple virgins in Jerusalem formed an altar guild that fulfilled the necessary tasks at the Temple. This included sewing and creating vestments, washing the vestments of the priests which would be stained regularly by animal blood, preparing liturgical linen, weaving the veil of the Temple, and most importantly, liturgical prayer. The Jewish and Catholic tradition holds that this school for Israelite virgins was completed by marrying age of about 14 and that they were dismissed at this time. There were also older women, perhaps widows such as the prophetess Anna, who served as teachers and governesses for the virgins under their care.
There has been some doubt as to whether their were really consecrated Jewish virgins at the Temple. In my previous post I referenced the first-century Jewish historian Josephus in support of "Temple virgins" in Jerusalem, but I fear that this cannot be substantiated. Jimmy Akin asked me for the citation and I cannot find it. One would assume that it would be in Book 5 of the Jewish Wars of Josephus. There Josephus mentions cloisters, but he does not tell us who lived in them. That's as close as Josephus gets.
There are, however, three Scriptural accounts that are used by Catholics to demonstrate that there were special women who ministered at the Temple complex.

Exodus 38:8 mentions women who "watch (צָבָא) at the door of the tabernacle."

The second is in 1 Samuel:

"Now Heli was very old, and he heard all that his sons did to all Israel: and how they lay with the women that waited (צָבָא) at the door of the tabernacle:" (1 Samuel 2:22, D-R)

In both of the verses above, Hebrew verb for "watch" and "waited" is the same. It is the Hebrew word צָבָא, which is the same verb used to described the liturgical activity of the Levites (see Num 4:23; 8:24). This corresponds to the Latin translation in the Clementine Vulgate, which relates that these women "observabant" at the temple doors – another liturgical reading.
So these women are not simply hanging out around the Temple, looking for men, gossiping, or chatting about the weather. These are pious women devoted to a liturgical function. In fact, the Court of Women might exist formally for these special "liturgical women."
The third and final reference to these liturgical females is in 2 Maccabees:
And the virgins also that were shut up, came forth, some to {High Priest} Onias, and some to the walls, and others looked out of the windows. And all holding up their hands towards heaven, made supplication. (2 Macc 3:19-20)
Here are virgins that are shut up. In the Greek it is "αἱ δὲ κατάκλειστοι τῶν παρθένων" or "the shut up ones of the virgins." In this passage the Holy Spirit refers not to all the virgins of Jerusalem, but to a special set of virgins, that is, those virgins who had the privilege and right to be in the presence of the High Priest and address him. It's rather ridiculous to think that young girls would have general access to the High Priest of Israel. However, if these virgins had a special liturgical role at the Temple, it becomes clear that they would both address the High Priest Onias and would also be featured as an essential part of the intense supplication in the Temple at this moment of crisis.
There is further testimony of temple virgins in the traditions of the Jews. In the Mishnah, it is recorded that there were 82 consecrated virgins who wove the veil of the Temple:
"The veil of the Temple was a palm-length in width. It was woven with seventy-two smooth stitches each made of twenty-four threads. The length was of forty cubits and the width of twenty cubits. Eighty-two virgins wove it. Two veils were made each year and three hundred priests were needed to carry it to the pool" (Mishna Shekalim 8, 5-6).
We find another reference to the "women who made the veils for the Temple…baked the showbread…prepared the incense" (Babylonian Talmud Kethuboth 106a).
Rabbinic Jewish sources also record how when the Romans sacked Jerusalem in AD 70, the Temple virgins leapt into the flames so as not to be abducted by the heathen soldiers: "the virgins who were weaving threw themselves in the flames" (Pesikta Rabbati 26, 6). Here we also learn that these virgins lived in the three-storey building inside the Temple area. However, it is difficult to find any other details about this structure. The visions of Anne Catherine Emmerich placed the cloisters of the Temple Virgins on the north side of the Temple (Emmerich's Life of the Blessed Virgin Mary 3, 5).
Even more, the first century document by the name of the Apocalypse of Baruch (sometimes called "2 Baruch") describes the Temple virgins living in the Temple as weavers of the holy veil:

"And you virgins who weave byssus and silk, and gold from Ophir, in haste pick it all up and throw it in the fire that it will return it to its Author, and that the flame will take it back to its Creator, from fear that the enemy might seize it" (2 Baruch 10:19).

So then, there is ample evidence for the role of consecrated women, especially virgins at the Temple. If one were to accept the passages above, we have plenty of testimony for cultic women in the time of Moses' tabernacle, in the time of David, in the Second Temple era, and in the first century of Our Lord.
This substantiates the claims of the Fathers and Doctors of the Church who claim that the Blessed Virgin Mary was presented to the Temple and served there from the age of three until the age of fourteen. To claim that Temple virgins are a myth of celibacy-crazed Catholic bishops does not hold up. Scripture and Jewish tradition records that there were specially commissioned virgins associated with the Temple. We may not know much about them, but we know that they existed. - Did Jewish Temple Virgins Exist and was Mary a Temple Virgin?

Did the Herodian Temple have virgins?


How to establish a mode?

Question: I would like to learn about the art of establishing a mode. For example, how to make A minor sound like A minor instead of C major.
Answer: The basic idea on how to establish a mode is make the tonal center of the progression and melody center the tonic (or home note) of the modal scale and use harmony that signifies the mode you are in.
For example this progression would signify C major.
  C - F - G - C
The progression stats and ends with C and the melody to accompany this would use the notes of the C major scale that would start and end with a note in the C major chord.
This same progression in A natural minor would be:
  Am - Dm - Em - Am
The progression stats and ends with Am and the melody to accompany this would use the notes of the A natural minor (C major) scale that would start and end with a note in the A minor chord.
However, most composers use the harmonic minor scale for minor keys by raising the 7th scale degree to a major 7th which would change the progression to.
  Am - Dm - E - Am
It is still derived from C major/ A natural minor, but the scale makes A feel more like the center tone.
A very interesting sounding mode I use all the time is Phygian which is built from the 3rd scale degree of the major scale. In the Phygian mode the II chord is very strong and is a great for establishing the mode.
  Em - G - F - Em
This progression diffres itself from a minor progression with the II and how II leads to i.
This is a very big topic, but this is the bare bones idea behind it. If you need more detail please ask.
Comment: Just want to add that establishing a tonal center has more to do with pitch emphasis and less about chord progressions.  The raised seventh in the V chord helps emphasize a pull to tonic, though this is merely one way to emphasize a pitch.
Comment: "n the Phygian mode the II chord is very strong": Is there any explanation about this and this kind of things? References?
Comment: @ysdx this: http://en.wikipedia.org/wiki/Cadence_%28music%29#Half_cadence and this: http://web.utk.edu/~mtheory/courses/murphy/documents/Neapolitan.pdf  Basically the half step between the root and the ii chord is similar to the function of the standard leading tone.
Comment: You can also think of it this way: the supertoinic is the same distance away as the leading tone so it has a similar function to the leading tone which Phygian does not have.
Answer: @Dom answered this from the perspective of harmony, so I thought I'd complement that with an explanation about melody.
There is an old theory of melody (maybe it was in Fux' Gradus ad Parnassum? Don't have time to check) that a melody starts "at rest", then "moves", then "returns to rest".  This pattern is generally found on at the level of the musical phrase, but can also be found at the level of multi-phrase systems, motifs, and the whole piece.
The "at rest" bits are typically at the tonic, and the "moving" part then passes through the other pitches, revealing what the scale is.  This is the (a?) mechanism by which we hear mode established in melody.  If the first note is a D, and in the subsequent melodic wanderings we hear F#s, Bs, C#s, As, Gs, and Es, and then the melody concludes on a D, our brains go, "Ah, D major!"  If from that same D first note, in the subsequent melodic wanderings we hear Fs and Cs that are natural and Bs that are flat, then comes to rest on D, our brains recognize that as D minor.  If from that D, we then pass through natural Fs, Cs and Bs, then back to D, our brains recognize that D dorian.  And so on.
This is slightly oversimplified.  The "at rest" initial note doesn't include pick-ups; it's really the first strong beat note.  And you can manage to assert a mode without starting on the tonic if you start on the dominant or the third (i.e. in the tonic chord), but that can be tricky.  You can also manage to assert a mode without ending on the tonic, in the same way, but I think you can't do both at the same time, because then the ear has no correct landmarks and will come to some other conclusion.
(I speak as someone who sings a lot of inner parts, where I often sing harmony lines that both do not start and end on tonic notes, and I promise you, when sung independently, those lines often sound like they're in a completely different mode.  For instance, there's been many a piece in D minor or D dorian, an inner harmony part of which did a fine impression of F major.  I discovered early that trying to learn my part independently of the ensemble would, if I didn't account for what everyone else would be doing musically when we put it together, be profoundly disorienting in context, because I'd be thinking, "The tonic is F and the mode is major! When we get to the end of this phrase it should be a major chord of which I will be singing the tonic!" and we'd get to the end of the phrase and "SOMETHING IS WRONG. WHY IS THIS CHORD MINOR? DID I SCREW UP?  DID I MISS A REPEAT SOMEWHERE?  AM I OFF PITCH?")
This is why it's common for arsis/thesis phrase pairs to consist of, first, a phrase that starts on the tonic and ends on something other than the tonic, and then second, a phrase that starts on something other than the tonic, and resolves to the tonic.
Answer: To expand on Dom's excellent answer, when you're in D dorian, it will sound quite minor, except that for the 4th chord, instead of the expected Gm, you'll use G maj.
On the mixolydian, G, it'll sound major, but a bit bluesy because of the flat 7.The 5th chord won't sound too pushy, though, as it's Dm rather than D maj. As above, you'll use all the same notes as C maj., but the home will need to be G rather than C.
When you are in F lydian, it'll sound like there's a #4 (which could be construed as a flat 5, as in blues) a sound that Vai uses.Obviously, centring will be around F.

How to establish a mode?


What should I do with fertile eggs if I don't want chicks?

Question: I have a cockatiel and just got her a partner as they told me it's better for her to have another cockatiel next to her if I cannot spend too much time with her. Eventually, they will probably mate and lay eggs, but I don't want more chicks and I don't want to sell them because I feel most people is really irresponsible and won't treat them as they deserve. What should I do with the eggs? Just throw them away inmediatly? If there's no other option, I will sell them but I want to avoid that if possible.
Answer: You can dispose of the eggs immediately, but the female might lay replacement eggs. That can be unhealthful for the female, since egg-laying drains calcium and can even weaken bones. To prevent her from laying replacements, get some dummy eggs. When you take the real eggs, replace them with dummies. Warm the dummies in your closed palm first and she should accept them.
Thank you for being a responsible cockatiel owner, too. There's an overpopulation problem in many markets, and we don't want to make it worse.
Comment: Thanks for the reply, do you think it's a good idea to boil the eggs and put them back in place?
Comment: @Macarena No! Eggs spoil rather quickly (especially if the're kept warm) and produce a pungent sulfur smell and become a health hazard. Dummy eggs are usually made from gipsum, plastic or ruber. They satisfy the breeding / sitting instinct of birds but don't spoil. Sooner or later your bird will realize that no chicks hatch from the egg and abandon it, just like a wild bird would.
Comment: @Elmy ok, thank you very much for the info, I'll buy some dummy eggs if necessary then :)
Answer:
Option 1 - Sell/exchange the male and get another female

In my opinion from what you have described this is the best option.
If you definitely do not want chicks then I would sell/exchange the male and get another female cockatile instead. This way you don't have any responsibility over the eggs as they won't be fertile.

Option 2 - Freezing the eggs

If you freeze the eggs for 24hrs it will ensure that they're no longer fertile. You can then warm these up in your hands if your cockatiel is particular about their eggs. I've never tried boiling but I believe this would work in a similar way. Just ensure they aren't too hot when you put them back in.(Including the inside of the egg.)

Option 3 - Keeping them together but seperated

E.g having a large cage with a wire partition down the center so the birds can still communicate/be in each other's company but limits or even eliminates the risk of fertile eggs. I like this one as if the pair do not get on in the future it can also ensure that there is less risk of harm to eachother.

Option 4 - Binning the eggs

Personally, I couldn't go through with this as they are already fertilised and it would have been my fault for putting the pair together. I don't see how this is much better than giving the eggs away if I'm honest... but that could be me battling my own morals.

Option 5 - Selling the eggs or giving them away

I understand your concern with this one but there's always a good chance that they will go to good homes. The best part is as they are your eggs you get to choose where and who they go to.
I may also add it's always better to replace an egg rather than remove it as your cockatiel may keep producing eggs thinking that her clutch is empty. Sometimes adding more fake eggs than what she's laid can trick her into thinking she has a full clutch and stop the egg laying early.
Comment: Thanks for your answer. At this moment time, I think it'd be very painful for me to exchange my cockatiel, since despite knowing him recently, I have already created a very special bond with him and for me he's one of the family. I'd keep them in different cages in case they didn't get along, but the idea is to keep them together because that's the advise I got. Regarding disposing of eggs, for me it's not a moral impediment, what worries me is the happiness of my cockatiels, I'm not concerned of a zygote that doesn't feel. And the fourth option is the one I'll consider if there's no other.
Comment: @Macarena - It's not the zygote that's the issue it's the fact that these fertile eggs are effectively your doing for putting a potential mating pair together.
Regardless, for a dummy egg you could always freeze an egg for 24 hours and return it if it's not cracked :)
Comment: I've been told they'd spoil too quickly. I've been researching and I red that chick eggs spoil in 3-5 weeks time, which in my opinion is not "too quickly". But who knows... Maybe cockatiel eggs spoil sooner.So if I wanted to use dummy eggs to fool my cockatiel, I guess I could buy some at the pet shop and that'd be 100% safe.


Digital vs Acoustic Piano

Question: Have the latest digital pianos from the likes of Roland, Yamaha etc at last managed to correctly simulate the weight/feel and touch of acoustic pianos keys?  I've been lead to believe from adverts and demo videos that the digital pianos are greatly improved but I'm not convinced. What are your thoughts?
Comment: You get what you pay for. An entry level "complete piano" plus a selection of other keyboard sounds, from Roland with a price tag of say £250, isn't going to feel or sound the same as a top quality piano-weighted keyboard controller (with no sounds at all!) costing say £1500, plus about £1000 for a top quality computer-based piano synthesizer, plus the cost of the computer to run the synth.
Comment: *Acoustic piano* is no well-defined term either.  2500€ will buy a digital one, where the average player would quite be challenged to recognize it in a blind test.
Answer: The very expensive ones have been using the exact same physical mechanism as a real piano for decades.
The cheaper ones never will.
Modern example - Yamaha AvantGrand N3X. This retails at about £16k... not cheap.
Videos & pretty pictures at Yamaha - AvantGrand
Disclaimer - I used to work for Yamaha in the 90s so I'm slightly biased towards them.
Answer: I play a variety of styles, and for the last few years have been very happy playing a Roland - not too expensive at around £600 ish. The feel is one of the better 'cheap electronic piano' actions, and I'm not looking at changing it any time soon, daily using a nice studio 'proper' piano as well. So, yes, there are pianos out there that do a very realistic job for less than £1000s. It also has the ability to produce loads of other sounds, although playing very realistic Hammond sounds on a piano feel k'bd. is rather weird.
Answer: It depends on the types of music that you play. Digital piano is great for contemporary/pop music as it offers a great selection of effects and sounds.
Piano is definitely a must if you are playing classical music as the sensitivity to touch, tone and timber is not something that current technology of a digital piano can perfectly emulate.
As a piano teacher, I will advice my Classical students to buy an acoustic from the very beginning or switch to an acoustic piano by the time they get to Grade 3. For the Pop students, they will do just fine with a digital as the Trinity and Rock School Exams require candidates to set up the digital piano during the exam.
Comment: "Piano is definitely a must if you are playing classical music.." Really? Listen to some of these - all played back entirely digitally from MIDI recordings of live performances: https://www.pianoteq.com/listen_ecompetition
Comment: It seems that manufacturers of digital pianos try to get an electric piano feel and sound like an acoustic but they haven't been successful. From what I'm hearing II don't think the digital piano will ever get the 'thumbs up' from the more professional classical pianists although players of more contemporary music seem more prepared to accept the newer technology as it fits in better with their style of music. I guess at the end of the day that the choice of a piano is a very personal one (or a financial/practice one!) and there are no definate right or wrong positions on the subject.
Comment: @alephzero being able to make a nice rendering from a midi file is impressive but it doesn't demonstrate anything about the pros or cons of learning to play on a digital vs acoustic instrument.
Comment: To me its all about transferability.  If you can play a digital piano well you may be surprised to find that you cannot play a "real" piano well.  Simply because there is a lot of technique involved in making the hammer strike the string correctly.  That, as far as I can tell, has never been transferred to a digital piano.  Its hard to see that it can be.  Game over as far as I am concerned.
Answer: It's a very valid question, as both types of piano give you a different feel, and you may also wonder which piano is more suited to your needs - digital or acoustic upright?
An acoustic piano, in general, produces a warm and resonant tone sound through a hammer mechanism, while a digital piano produces its sound through playing pre-recorded audio samples. Some may say the acoustic piano sounds better because of its resonant tone, but that is not always the case. A well-made digital piano with consistent and beautifully-recorded audio samples, can sound better than a mediocre acoustic piano. Nevertheless, based on my experience, I have a better control over articulation and expression of the songs I perform on an acoustic upright piano, than on the digital piano.
In terms of sound maintenance, the acoustic piano requires more maintenance than the digital piano does, therefore, you need to be wary about the future costs of tuning the acoustic piano. The greatest aspect about the digital piano is its versatility, meaning it can produce other instrumental sounds, record your practices, change the volume and it is portable.
In terms of frequent pedal usage, it really depends what kind of music you play. For music in the Romantic period, acoustic upright piano is the way to go. Some acoustic pianos have three kinds - the soft pedal, sostenuto pedal and sustain pedal, but not all do. Similarly,  digital pianos of reputable brands like Yamaha have three pedals, but not all have them.
In terms of genres, an acoustic upright piano is preferable if you are playing classical music, while a digital piano is more suitable for those playing pop, rock or funk music.
Hope this helps!
Comment: Thanks for your feedback which make a lot of sense to me. On the subject of digital pianos and pedals, I've noticed that a lot of the higher end digital pianos also have three pedals and sometimes even the build makes them look like upright acoustic pianos, just to make things even more confusing!
Comment: There are digital pianos that have 'soft' pedal facilities, but not sure about sostenuto. I'd have thought on expesive ones it would be readily available.
Comment: Adding to your point about which one suits you most, it's off-topic for the OP's question, but a piano owner needs to think seriously about how much space they've got for it.  Even an upright will occupy significant space in a small flat, and many digital pianos don't help themselves on that score either by trying to look look an acoustic piano! If the OP is considering a digital piano then they may want to consider a stage piano if space is an issue.
Answer: Liberty Park's answer already mentions differences in feeling between acoustic and digital piano, but I wanted to give my personal experience as someone who has always played on a digital piano.
TL;DR: Some newer digital piano seems to be a good choice for earlier training. But they still lack the physical feedbacks of an acoustic piano, mainly the vibrations you feel when you play them. That, and electronic parts in the digital piano are less likely to last a century than an acoustic upright piano that is well taken care of.

I started learning piano with a digital one with good action, and I believed that I would eventually upgrade it with another digital piano, because I did not want to have to tune it.
So I visited a piano store to try a digital, a hybrid and an actual upright piano to see what upgrade I should consider, and to know whether or not the newer digital piano can reproduce the feelings of an actual acoustic piano. I was only interested in the piano aspect of it, so I will not mention the different options you have in digital piano (changing sound, recording, metronome, etc.).

The digital piano I tried was one of the latest model, albeit still a year or two old. The action looked good for training, the sound was nice. But it still "sounded digital" to me, because it came out of some speakers. Even when I tried putting on some high quality headphones, it still had that "digital feeling", which kinda put me off. Maybe it would have been more accurate if I tried a digital model that came out in 2020, but the store did not have any.

The hybrid piano was slightly younger than the digital piano. My untrained ears did not hear much difference between them. The action felt funnier, because it was working like an acoustic upright piano (meanwhile digital piano usually simulate grand piano action). Beside that, I still had the "digital feeling" because the sound was coming off of speakers.

When I tried an upright acoustic piano, what surprised me was the "feedback" of the piano. Upon pressing a key, you would feel the vibration going into you finger through the key you pressed. Same goes for the foot on a pedal. Upon pressing a key and releasing it, the sound would still shyly resonate inside of it. On an upright piano, some model also have a training pedal for the middle one, which allows you to play silently even though it is not a digital piano.

So, there you go. Even though the digital pianos have made some progress lately, they still don't reproduce the actual feelings and feedbacks an acoustic would give you.
Beside that, a digital piano will last as long as its electronic parts are working. I am not an expert, but something tells me they don't hold as well as an acoustic piano, which if proper care are given could last a lifetime.

Digital vs Acoustic Piano