Probability that $2$ dice selected from $3$ rolled dice will have sum $7$

Question: If I roll $3$ dice ($6$-sided) and then proceed to choose $2$ of them (discarding the 3rd), what is the probability of the total of those $2$ dice totalling $7$?
Comment: How do you choose them? Are you selecting in favor of getting a 7? Against? Highest two, lowest two, Max and min, random?
Comment: simply choosing the 2 you want to get the number you want
Comment: Well, then it is just the number of cases where one die is a $1$ and other a $6$, or a $2$ and a $5$ or a $3$ and a $4$, divided by the total number of combinations with $3$ dice. Do you know how to do this?
Comment: the probability of rolling a combo 7 with 2 dice is (6/36), there are 18 combinations with 3 dice and 108 total combinations, but that just gives the same probability (18/108), no?
Comment: Say the dice are blue, green, and red.  Then each outcome can be represented in the form $(b, g, r)$, so there are $6^3 = 216$ possible outcomes.  What you need to count is the number of outcomes in which $b + g = 7$ or $b + r = 7$ or $g + r = 7$.
Comment: I would think it is somewhere closer to the combinations of 1+6, 2+5 & 3+4 (=18) and the total combinations of 3 dice minus the toal combination of the discarded dice (108-36=72).  Thats not gonna be quite right, but it seems like it should be around 18/72
Comment: The answer provided by InterstellarProbe is correct.  If you would like, I could confirm it by expanding on what I wrote in my preceding comment.
Comment: Also, when you pose a question here, you should place your attempt in your question and explain where you are stuck so that you receive responses that address the specific difficulties you are encountering.  This [tutorial](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) explains how to typeset mathematics on this site.
Comment: @N.F.Taussig, thanks. I'll be sure to write it out as such in future.
Answer: In Excel, I used the following formulas.
In cell A1: =1+MOD(ROW()-1,6)
In cell B1: =1+MOD(INT((ROW()-1)/6),6)
In cell C1: =1+MOD(INT((ROW()-1)/36),6)
In cell D1: =OR(A1+B1=7,A1+C1=7,B1+C1=7)
I copied these down 216 rows. This gives me every possible outcome of the roll of 3 dice, along with a TRUE/FALSE for if it satisfies the condition that at least one pair will add to 7. There are 90 such combinations out of 216.
In cell E1, I put: =COUNTIF(D1:D216,TRUE)
$$\dfrac{90}{216} = \dfrac{5}{12}$$
To calculate this combinatorially, we can count the number of ways three dice can achieve the desired result of at least one pair adding to 7 and divide by the total number of ways to roll three dice.
You can have 3 distinct numbers or two numbers with one number repeated.
For three distinct numbers, two of them must be one of the six pairs that add to seven and the last can be any of the four remaining numbers. Then we choose two of the numbers to be the pair that adds to seven: $$6\times 4\times 3 = 72$$
For two distinct numbers with one repeated, we choose one of the pairs of numbers, then we choose two of the dice to be one of the numbers: $$6\times 3 = 18$$
Total: 90 ways to achieve three dice where at least one pair adds to 7 out of 216 total.
Comment: this is great, thanks.  For someone who uses excel a lot, I dont know why i didnt consider using it to help me out as you did.  great stuff.  thanks again.
Answer: Let's say the dice are blue, green, and red.  Each outcome can be represented by the ordered triple $(b, g, r)$.  Since there are six choices for each entry, there are $6^3 = 216$ possible outcomes.  Assuming the dice are fair, they are equally likely to occur.
Method 1:  The favorable outcomes are those in which at least one pair of dice selected from the three rolled dice have sum $7$.
There are $\binom{3}{2} = 3$ ways to select a pair of dice.  Say we select the blue die and the green die.  There are six ways for that pair of dice to have a sum of $7$: $(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)$, where each ordered pair is of the form $(b, g)$.  For each such pair, there are six possible outcomes for the red die (or, in general, the other die), giving $3 \cdot 6 \cdot 6$ favorable outcomes.
However, we have counted each outcome in which there are two pairs of dice that have sum $7$ twice, once for each way we could have designated one of the pairs as the pair that has sum $7$.  For this to occur, two of the dice must show the same number and the third die must show the difference between $7$ and the number that appears on the other two dice.  There are $\binom{3}{2} = 3$ ways for exactly two dice to display the same number and $6$ numbers these two dice could display.  For any such outcome, there is only one possible outcome for the third die.  Hence, there are $3 \cdot 6$ such outcomes.
Thus, the number of favorable cases is $3 \cdot 6 \cdot 6 - 3 \cdot 6 = 108 - 18 = 90$.
Therefore, the probability that when three dice are rolled that a pair of dice may be selected with sum $7$ is
$$\frac{3 \cdot 6 \cdot 6 - 3 \cdot 6}{6^3} = \frac{90}{216} = \frac{5}{12}$$
as InterstellarProbe found.
Method 2:  The favorable outcomes are those in which at least one pair of dice selected from the three rolled dice have sum $7$.
There are two possibilities.  Either each die shows a different outcomes or two of the three dice show the same outcome.  Since $7$ is not a multiple of $3$, it is not possible for all three dice to show the same outcome.
Each die shows a different outcome:  There are $\binom{3}{2} = 3$ ways for two of the dice to have sum $7$ and $6$ ways for those two dice to have sum $7$.  There are four possible outcomes for the other die.  Hence, there are $3 \cdot 6 \cdot 4$ such outcomes.
Two of the dice show the same outcome:  There are $\binom{3}{2} = 3$ ways for exactly two of the three dice to show the same outcome and six possible outcomes those two dice could show.  The other die must show the difference between $7$ and the outcome on those two dice.  Hence, there are $3 \cdot 6$ such outcomes.
That yields a total of $3 \cdot 6 \cdot 4 + 3 \cdot 6 = 90$ favorable outcomes.
Hence, the probability that a pair of the three dice has sum $7$ is
$$\frac{3 \cdot 6 \cdot 4 + 3 \cdot 6}{6^3} = \frac{90}{216} = \frac{5}{12}$$
in agreement with the answer we obtained above.
Answer: The question isn't clear about how do we decide which 2 dice we pick.

If we pick the two uniformly random: every pick has 1/3 probability and since the choice of the dice is independent in the roll we get that for every choice the probilirt is 1/6. Overall ,since all the events are simetric, we get $\frac{1}{6}$.
If we choose as we wish, assuming that If there are a pair which sum to 7 we will pick them: denote by $A$ the event that the is a pair whose sum is 7. We first roll only two dice (arbitrary chosen beforehand) and denote by $B$ the event that their sum is 7. And by $C$ the event that that both are the same.
by the law of total probability
$$Pr(A) = Pr(A|B) Pr(B) + Pr(A|\bar{B}\cap C) Pr(\bar{B} \cap C) + Pr(A|\bar{B}\cap \bar{C}) Pr(\bar{B} \cap \bar{C} ) = 1*\frac{1}{6} + \frac{2}{6} * \frac{4}{6} + \frac{1}{6} * \frac{1}{6} = \frac{15}{36} =\frac{5}{12}.$$

When we used the fact that if the first pair didn't sum up to 7 the third dice can "complete" each of the first to into sum of 7 by  exactly one option and hence
$Pr(\bar{B} ) = 2/6$.
As the probability of rolling the same number stwice is $1/6$, the probability of rolling two different numbers which don't sum up to 7 is
$5/6 - 1/6$.
Comment: In the second case, are you accounting for the possibility that the first two dice have the same face up?
Comment: You're right I missed that. Fixed


Is there any evidence that in the middle ages (France and maybe Spain), there was a wafer/bread given to the priests as a gift for the priest?

Question: Is there any evidence that in the middle ages (specifically in France and maybe Spain), there was a wafer/bread given to the priests as a gift for the priest and not given to be used for Eucharist?
Answer: Is there any evidence that in the middle ages (France and maybe Spain), there was a wafer/bread given to the priests as a gift for the priest?
There is no direct historical proofs of this, but it stands to reason that this did occasionally happened.
The Romanum  Rituale of 1614 had six blessings for bread outside the tradition of blessing bread for Easter. Tradition tells us that sometimes bread blessed by bishops or priests were blessed and given to their friends. Certainly, some of their friends would by fellow priests.

The little loaves or cakes of bread which received a special benediction and were then sent by bishops and priests to others, as gifts in sign of fraternal affection and ecclesiastical communion were also called eulogiae. Persons to whom the eulogia was refused were considered outside the communion of the faithful, and thus bishops sometimes sent it to an excommunicated person to indicate that the censure had been removed. Later, when the faithful no longer furnished the altar-bread, a custom arose of bringing bread to the church for the special purpose of having it blessed and distributed among those present as token of mutual love and union, and this custom still exists in the Western Church, especially in France. This blessed bread was called panis benedictus, panis lustratus, panis lustralis, and is now known in France as pain bénit. It differs from the eulogia mentioned above, because it is not a part of the oblation from which the particle to be consecrated in the Mass is selected, but rather is common bread which receives a special benediction. In many places it is the custom for each family in turn to present the bread on Sundays and feast days, while in other places only the wealthier families furnish it. Generally the bread is presented with some solemnity at the Offertory of the parochial Mass, and the priest blesses it before the Oblation of the Host and Chalice, but different customs exist in different dioceses. The prayer ordinarily used for the blessing is the first or second: benedictio panis printed in the Roman missal and ritual. The faithful were exhorted to partake of it in the church, but frequently it was carried home. This blessed bread is a sacramental, which should excite Christians to practice especially the virtues of charity, and unity of spirit, and which brings blessings to those who partake of it with due devotion. The Church, when blessing it, prays that those who eat it may receive health both of soul and body: "ut omnes ex eo gustantes inde corporis et animae percipant sanitatem"; "ut sit omnibus sumentibus salus mentis et corporis". In some instances the pain bénit was used not only with superstitious intent, and its virtues exaggerated beyond measure, but also for profane purposes. This usage was brought from France to Canada, and was practised chiefly in the province of Quebec. There the pain bénit had blessed immediately after the Asperges, and then distributed to those who assisted at high Mass. The parishioners furnished it in turn, and vied with one another in presenting as rich and fine a pain bénit as possible, until finally the bishops, seeing that it entailed too much expense upon the poor circumstances, prohibited it. Within the last twenty-five and thirty years the custom has almost entirely disappeared.
In the present Roman ritual there are six blessings for bread. Two of these are entitled simply benedictio panis, and as mentioned above, are often used for blessing the panis benit. The third entitled benedictio panis et placentarum (blessing of bread and cakes), is found in the appendix among the blessings which are not reserved. The other three are approved for particular localities, and are special blessings given under the invocation of certain saints, usually on their feast days, in order to gain special favours through their intercession. The first, approved for the Archdiocese of Cologne, is a blessing of bread, water, and salt given under the invocation of St. Hubert; the second, approved for the Diocese of Bois-le-Duc, is a blessing of bread and water under the invocation of St. Machutus, and the third, for the Diocese of Urgel, is a blessing of bread, wine, water, and fruit to be used on the feast of St. Blasius. Some other places have local of blessing bread on certain feast days, as for instance on the feasts of St. Genevieve, of St. Nicholas of Tolentino and others. - Liturgical Use of Bread

The tradition of blessing bread in the Middle Ages was quite popular. I can not imagine that priests were not the beneficiaries of such pious devotions.

In Great Britain, sweet currant-filled buns decorated with a cross—and aptly named hot cross buns—are traditionally prepared for Good Friday. The custom dates back at least to the Middle Ages, and some still insist that baking hot cross buns on Good Friday will protect a home from all sorts of calamities during the upcoming year, including fire and bad luck. During the 1500s, when a law prohibited the sale of hot cross buns except on Good Friday, Christmas, and for burials, people made hot cross buns at home to get by.

Portuguese Sweet Bread has traveled the globe; it has taken hold where larger populations of Portuguese immigrants settled, including Hawaii and New England. Called folar in Portuguese, it is traditionally made during Easter. There is a savory variation called folar de Chaves, which is stuffed with ham, linguiça, and salpicão.
These loaves are just a sample of some of the rich bread traditions associated with Easter. When it comes to the holidays, bread has played an important role in holiday meals across many different cultures and traditions. Modernist Bread includes a number of recipes for different traditional holiday breads, including Colomba di Pasqua as well as Portuguese Sweet Bread. - The Tradition of Easter Bread
Blessed bread has been a tradition in both France and Spain also.

Blessed Bread, 'First Neighbours' and Asymmetric Exchange in the Basque Country
As I mentioned above that I can not find any direct historical evidence that priests themselves received such gifts, I find it highly doubtful that they would have been overlooked, especially in communities that very supportive of their pastors, notably at Christmas (Christmas Baking and Bread Blessing).
In some places a priest is given bread to bless. Once blessed he keeps a little for himself and gives the rest away, as this modern tradition explains:

In the town of Deir el Qamar in the Shouf where  our family originates,we  would buy this sweet bread at the store; usually, we'd finish it before getting home.
It has no eggs, but all the best  flavourings, mastic, mahlab, orange blossom and rose water, nutmeg and some milk. For the sake of authenticity, I used  a mold I got online from a purveyor of Greek-based goods, as it is the same mold used in Lebanon.  It has an inscription in Greek Christ is risen or something like that; ( I don't read Greek!). According to Chef Ramzi, this holy bread recipe is from the Greek Catholic Church in Lebanon. It represents the body of Christ and is distributed at church, sold in  stores and bakeries; traditionally it was  made at home on certain occasions and given to the priest to bless, keep some and give out  the rest.

Holy Bread (Qurban)

The following may be of interest:

Oplatek, The Breaking of Tradition
Christmas wafer


Canning jars seal then go bad

Question: I have canned a lot in the past with with aa jar here and there. But the last year I have lost so much food to crowning of lids after they have sealed. I again lost 22 quarts of beautiful red beets. All sealed two days later the lids are swelling and crowned lost all 22 jars.
We do have lime in our water and it seems to be stronger since the dry weather.
Comment: Welcome Kathy, please edit your question to include the recipe (ingredients and the process) so you can get a good answer.
Answer: Since you don't describe your process in detail it`s impossible to figure out the exact cause of the spoilig. Most common mistakes while canning are:

Improper sterilization of the glasses and lids.
Too short or cold pasteurization of the canned vegetables. Time and temperature required are highly dependent on the type of canned good. For raw red beets it should be 45 min at 100°C, for pre-cooked 20 min at 100°C.
Too much air remaing under the lid.
Failing to create a vacuum for sealing, allowing micro-organisms to enter the glass.
Comment: Plain beets (as opposed to pickled beets) require pressure canning to be considered safe.

Canning jars seal then go bad


Are chicken gizzards okay to eat if still pink inside?

Question: I sautéed chicken gizzards for quite a while, then added water and boiled another 15 minutes but they are still pink inside. Are they safe to eat even though they are pink inside?
Answer: After boiling for that period of time (especially after sauteing), the gizzards have certainly reached a "safe" temperature. They are probably not really good eating though. Gizzards are a tough piece of meat. They benefit from a low and slow cooking process. Here's a pretty good article from Livestrong. Among other advice, they suggest braising (or boiling) first for 15 or so minutes, then searing at a very high heat.
Here's a pretty typical recipe for Southern Fried Chicken Gizzards. It starts with simmering the gizzards for 45 minutes or longer, then cooling, then breading.
Safety really isn't the issue here, or color; after 15 minutes of boiling, you have well surpassed the USDA recommended temperature of 165F (74C). For good flavor though, they need more time.

Traditionally, chicken or turkey giblets are cooked by simmering in water
  for use in flavoring soups, gravies or poultry stuffing. Once cooked, the
  liver will become crumbly and the heart and gizzard will soften and
  become easy to chop. Cooked giblets should have a firm texture.
  Casseroles containing giblets should be cooked to 165 °F. Stuffing should
  also be cooked to 165 °F. Chicken giblets are commonly fried or broiled.
  Leftovers should be refrigerated within 2 hours.
Answer: I cook chicken gizzards and hearts at least once a week. I sautee them in butter, garlic and white wine for about 15 minutes. They are still pink in the middle when I eat them and perfectly safe and tender.
Comment: Welcome to SA, Nicole!  You're posting an answer on a question that is 6 years old and already has a pretty good answer.  You might try focusing on questions that do not have an answer instead.


What determines when my Apple Watch uses a haptic tap for a notification?

Question: Some notifications on my Apple Watch (e.g. Viber) use a haptic tap when they appear on my Apple Watch. Others (e.g. Facebook) do not. What determines whether a haptic tap is used or not? Is this something I can change?
Comment: If it happens consistently on a per-app basis for multiple users, it could be a decision made by the app's developers.
Answer: From this Apple Discussion:

There are variations. The 3rd party app developers have some control over what you get, but they won't have been able to check it before launch - they'll have been using a simulator.

This can currently not be changed by the user.
To turn haptic feedback of:

Open the Settings app.

Scroll down and tap Sounds & Haptics.

Turn Haptic Alerts on or off.
Answer:
What determines whether a haptic tap is used or not? Is this something I can change?

There are two types of haptic feedback:

System provided
Application provided

This means that in addition to the ones provided iOS, app developers can implement haptic feedback as they see fit.
Looking at Apple Developer's Human Interface Guidelines, it states:

Some system-provided interface elements, such as pickers, switches,
  and sliders, automatically provide haptic feedback as users interact
  with them. Your app can also ask the system to generate different
  types of haptic feedback. iOS manages the strength and behavior of
  this feedback.

Can you (the end user) enable this manually?  Not unless the haptic feedback was implemented by the developer and gives you the option to selectively disable.  From a system-wide perspective, you can only enable or disable all of them.

Not all devices support the full range of haptic feedback, and people can disable the feature entirely in Settings if they choose.


Wordpress linking to password protected content

Question: I just redid my company's Joomla website to work on the WP platform.  My problem is that there is content that log-in is required to access.  In our newsletter, I need to link to content that requires log-in.  Currently, If I link to that content and the customer is not logged-in, they get a 404 error.  Putting the content to be openly accessed is not an option.
Is there a plugin or some way for this to occur:
Link on newsletter to specific content --> log-in with credentials --> redirected to the specific content
I would very much appreciate your help with this!!!
Answer: In the post/page editing form at the admin page, there is a "Visibility" option on the "Publish" field. Just check the password protected, and you can hide the page/post with the password.
hope it help..


Recursive item recipe creation

Question: I was trying to write code that would get as input a recipe consisting of item materials and would create all possible recipes that could be used to create craftable of the recipe.
The Recipe is represented by this data class:
private data class RecipeTree(
    val materials: List<Material>,
    val craftableID: Long,
    val producedQty: Int,
    val subRecipes: List<Pair<RecipeTree, Int>>,
)

Recipe consists of (1) materials, (2) id of item that is creates using this recipe, (3) quantity of items produced by this recipe, list of sub-recipes that needed to be created beforehand + number of times the sub-recipe needed to be used - hence I used a pair of Recipe + Int.
Material is represented as a simple class of Item + Quantity required.
private data class Material(val item: Item,val qty: Int)

class Item(
  var name: String,

  var recipes: MutableSet<Recipe> = mutableSetOf(),

  var id: Long? = null
)

Given a RecipTree of the original recipe, I needed to create all possible recipes that can be used to create the desired craftable. For example, if the original recipe consisted of item1 and item5, with item5 having a recipe that uses item4 to create item5, then one possible recipe would be item1 + sub-recipe that uses item4 to create item5. This can go on and on, for example item 4 could have another recipe.
I created the following recursive extension function.
Extension function is a function with receiver - you can think of it as a function that has hidden parameter which is the object on which it is being called. In my case, hidden parameter is an object of type RecipeTree. This parameter is used when code uses variables not defined by function parameters or local variables. For example,in code materials.size is actually an access to the property of RecipeTree on which the extension is called.
fun createRecipe(recipeCreationDTO: RecipeCreationDTO){
  ....
       RecipeTree(recipeCreationDTO.materials.map { Material(materials[it.materialID]!!,it.quantity) },recipeCreationDTO.craftableID,recipeCreationDTO.producedQuantity, emptyList()).derivedRecipes(0)
....
}

The extenstion function:
private fun RecipeTree.derivedRecipes(index: Int) : List<RecipeTree>{
    if(index == materials.size - 1){
        val result = mutableListOf<RecipeTree>()
        result.add(RecipeTree(listOf(materials[index]),craftableID,producedQty, emptyList()))
        for(recipe in materials[index].item.recipes){
            val recipeQty = ceil(materials[index].qty / recipe.producedQuantity.toDouble()).toInt()
            val subRecipe = RecipeTree(recipe.materials().map { Material(it.item,it.quantity) },recipe.craftable.id!!,recipe.producedQuantity, emptyList())
            result.add(RecipeTree(emptyList(),craftableID,producedQty,listOf(subRecipe to recipeQty)))
            result.addAll(subRecipe.derivedRecipes(0).map { RecipeTree(emptyList(),craftableID,producedQty,listOf(RecipeTree(emptyList(),recipe.craftable.id!!,recipe.producedQuantity,listOf(it to recipeQty)) to recipeQty)) })
        }
        return result
    }

    val partialRecipes = derivedRecipes(index + 1)

    val result = mutableListOf<RecipeTree>()

    for(partialRecipe in partialRecipes){
        result.add(partialRecipe.copy(materials = partialRecipe.materials.plus(materials[index])))
        for(recipe in materials[index].item.recipes){
            val recipeQty = ceil(materials[index].qty / recipe.producedQuantity.toDouble()).toInt()
            val subRecipe = RecipeTree(recipe.materials().map { Material(it.item,it.quantity) },recipe.craftable.id!!,recipe.producedQuantity, emptyList())
            result.add(partialRecipe.copy(subRecipes = partialRecipe.subRecipes.plus(subRecipe to recipeQty)))
            result.addAll(subRecipe.derivedRecipes(0).map { partialRecipe.copy(subRecipes = partialRecipe.subRecipes.plus(it to recipeQty)) })
        }
    }

    return result
}

I will try to explain the code:

I used a recursive function because at first I was trying to create a function that would create recipes with different combination of materials + recipes that could be used in place of the material. This was similar to generating all possible bit string combinations(00,01,11,10 for example) where 0 mean use of material and 1 used of recipe of the material, with the only difference that instead of having 0 and 1, i would have more values for each position since one material could have 10 recipes and another 5. So what I basically do to create all combinations of recipe consists of x materials, is i recursively create all possible combinations for a recipe consisting of x - 1 materials, and then I modify each recipe to add the material/sub-recipes of the current recursive call.
When I reach the last index, I create all possible combinations of Recipe by creating (a) recipe that contains the material at specified index, (b) for each recipe of the material, I create a sub-recipe that is used as a replacement of the material in additional recipe, (c) for each sub-recipe that is used as a replacement of the material I create all possible combinations that can be used to replace it and create additional recipe for each that uses the sub-recipe of the material that uses the created sub-recipe.

I tried this code with the following test data and got 287 combinations.
Test Data:
Original Recipe:Item1,Item4.
Item1 recipe: item2.
Item2 recipe: item3.
Item3 recipe: item4,item5.
Item4 recipe: item5,item6.
Item5 recipe: item7.
Item7 recipe: item8,item9.

I need other people's opinion about the code, whether it has flaws/mistakes, maybe there are certain cases no covered, improvements/simpler solutions.
Answer: Sorry I haven't gotten too deep into your code so my review will be a bit shallow.
I like when by just looking at data structures, I can clearly understand the point.
From looking at your structures I don't see clear relationships between dataclasses.

RecipeTree is definitely confusing and overly complex class, that I am sure and needs rebuilding.
I find it strange that in RecipeTree you are using Pair<Something, Int>, where Int represents count of Something, yet soon afterwards you have  Item and Material, I could see Material as Pair<Item, Int>. Choose one and stick with it.
Naming is bad imho. Is really Material X of Items in real life? If I see 2 classes named like that, this is not my intuitive conclusion.
Class Recipe referenced in your code is missing.
I feel like there is maybe room for polymorphism where sometimes there's a recipe, but sometimes there's already resource, that cannot be divided anymore, but these both entities can serve as resources for recipes to create new resources.

I could go on, but the main suggestion here is - take a deep breath, step back and really take time to define your structures, name them and define relationships between them.
If you do that correctly, your code later will be much simpler just because of that.

Recursive item recipe creation


Is there a way to see an event when the system caret is visible or not?

Question: Is there an event that fires when the system caret (text cursor) appears and disappears system wide regardless of application or window?
Assume that the applicatiosn are all well behaved Windows apps.  Apps like Firefox that manage the text cursor themselves are not an issue for me.
I need to know when the system caret is visible so I can start an accessibility support process as well as when it it no visible so I can "sleep" the support aplication.
I am writing my project in C# but C++ samples would be fine.
Regards,
Jim
Answer: According to the documentation, EVENT_OBJECT_CREATE and EVENT_OBJECT_DESTROY are fired for the caret (OBJID_CARET).


Can half-Elves interbreed with half-Orcs?

Question: Can half-elves and half-Orcs interbreed with each other and who will be born in this case?
Comment: Are you asking about lore, or mechanical rules (if any), or something else? Given that you've added tags for D&D 3.5e, 4e, 5e, and all D&D editions in general, I can only guess that you're asking about lore. Is there a particular edition you're most interested in, or are you open to info from all editions? ...Also, what's the reason you're asking? Knowing that will help us provide an answer that is most useful to you.
Comment: Are you asking as a DM or as a player?
Comment: Possilbly related:
https://rpg.stackexchange.com/questions/69761/
https://rpg.stackexchange.com/questions/97766/
Answer: There are no prefab stat blocks for such a half-half-breed in the rules that I'm aware of. So you'll need to come up with something yourself.
If you are a player: Ask your DM. They may even be willing to come up with a custom stat block for your race.
If you are the DM: It's up to you. Your world, your rules. You could use the stat block for either Half-Elf or Half-Orc, or design something in between.
Comment: To be fair, that's hard to tell from a one-sentence question
Comment: OP isn't asking about using this as a playable race, they're asking about historical racial interbreeding across editions.
Answer: The rules do not explore this in any detail. They are mostly concerned with player characters.
Lore perspective: possibly, up to the DM
The information about what races orcs can breed with in Volo's Guide to Monsters states

The lore of humans depicts orcs as rapacious fiends,
intent on coupling with other humanoids to spread their
seed far and wide. In truth, orcs mate with non-orcs only
when they think such a match will strengthen the tribe. (p. 88)
In order to replenish the casualties of their endless
warring, orcs breed prodigiously (and they aren't choosy
about what they breed with, which is why such creatures
as half-orcs and ogrillons are found in the world). (p. 85)

That is about the level of detail you get. The rest is up to the DM to decide. I am not aware of any mention of a character that is the child of a half-orc and a half-elf in published materials. Even if there would be one, this would depend on the setting.
From a lore perspective, elves and orcs originally could not interbreed (1e MM, p. 76), so it is unlikely there would be half-elf-half-orc crossbreeds:

Half-Orcs: As orcs will breed with anything, there are any number of unsavory mongrels with orcish blood, particularly orc-goblins, orc-hobgoblins, and orc-humans. Orcs cannot cross-breed with elves.

Real-world perspective: it depends
D&D is not a physics simulation, and for the same reasons, not a biology simulation. Real world biology of interbreeding is complex. For example, you can get different results for the same two species, depending on who is the father or mother, as seen in ligers and tigons (offspring of lions and tigers).
Generally, only members of the same species can interbreed and breed true, that is, their offspring is fertile too and can reproduce their kind. Being able to cross-breed is largely how a species is defined. It also is possible to have cross-breeds from separate species, called hybrids, but those are often infertile (like a mule, as the child of a male donkey and female horse), or cannot sustainably reproduce their kind.
Since there is no language about half-elves or half-orcs being infertile, this would be an indication that all humanoids are from the same species. But even giants can interbreed with humanoids, for example the game has half-ogres where ogres, which are of creature type giant, mate with humans, orcs, bugbears or hobgoblins, which all are of humanoid type. There is no mention of them being infertile either. Does this mean humanoids and giants belong to the same species? Or are these hybrids? It's not clear.
Fantasy race does not map usefully to earth biology, maybe not unexpected in a world where minotaurs are a real thing.
From a genetics perspective, if they could interbreed, they simply would be half-human-quarter-orc-quarter-elves overall, but assuming they have diploid genomes like humans, for any given gene there could be a different pair of alleles: human/human, human/orc, human/elf, or elf/orc, depending on which of the two alleles for this gene they randomly inherit from each of their two parents.
PC perspective: not as a playable race
Throughout editions, half-elves and half-orcs have required one of their parents to be a human, and the other an elf or orc. So you could not count the result of a half-elf/half-orc interbreeding as a half-elf nor as a half-orc when it comes to playable races, as this creature did not have a pure human and a pure elf or orc as their parent. It thus would not be playable under the rules, as neither of these systems has an elf-orc or half-elf-half-orc character race.
D&D 5e
Half-elves, page 38 of the PHB:

Walking in two worlds but truly belonging to neither,
half-elves combine what some say are the best qualities
of their elf and human parents

Half-orcs, page 41:

orc and human tribes sometimes form alliances, joining forces into a larger horde to the terror of civilized lands nearby. When these alliances are sealed by marriages, half-orcs are born.

D&D 4e
Half-Elves, page 42, PHB:

Born heroes and leaders who combine the best features of humans and elves

Half-Orcs (page 14, PHB 2):

Fierce warriors who combine human resolve with orc savagery

D&D 3.5
Both on p. 18, PHB:

Humans and elves sometimes wed, (...) they leave an enduring legacy: half-elf children.

Half-orcs who live on the frontier live with either human or orc parents

Bonus answer: D&D 1e
Both on page 17, PHB:

Half-elves do not form a race unto themselves, but rather they can be found amongst both elvenkind and men

Orcs are fecund and create many cross-breeds, most of the offspring of such being typically orcish. However, some one-tenth of orc-human mongrels are sufficiently non-orcish to pass for human
Comment: Where does OP ask about playability? This seems like a question about races and interbreeding across editions.
Comment: I think this answer is accurate for playable races, but there is a lot of divergence from playable races in the lore, especially in Faerun. For example, half dwarves and dwelves are mentioned in the lore. Most mentions of half (whatever) will say something like "mostly of human descent", kind of leaving open the option. It appears WotC/Hasbro are eliminating "half" races though, so probably not in any future lore.


Why doesn't a phone li-ion battery die for 5 years and a pc li-ion battery dies in 1-2 years?

Question: WHat is the major factor? heat?,size? consumption style like full discharge?
Comment: Laptop batteries are typically overcharged.  A few systems (like my Sony) can be set to not charge the battery to 100% but that's apparently the exception.  It helps to run the system on battery from time to time (though don't regularly run it flat).
Answer: I have to replace the battery of my android phone every 18 months because it won't hold enough charge after being fully discharged on daily basis for 400+ days, so it's not really about what kind of device the battery is in.
The factor is mainly number of full discharge cycles and the operation condition. Lithium batteries can typically survive 400-600 full charge cycles and still hold a respectable amount of charge. However, if you constantly over-discharge it or use it under high temperatures its life will be drastically reduced. (Just 30 degrees Celsius is high enough !!)
Any temperature that is hot for humans is certainly too hot for li-ion batteries. That's places like the back or bottom of a laptop where the battery normally resides. If possible remove the battery when you're on a stable AC power and put it in the fridge. Never turn the phone back on if its automatically shutdown: you won't have enough time to do anything with it and you're killing the battery.
Read http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
Comment: Plus the quality of the battery itself. which can be night and day differences in: number of charges, length of time, suseptibility to conditions, even charge state and storage.  I have many cell items of various types in use and testing. The high quality ones have lasted more than 8 years, the low quality ones around 2, all of them treated very well.  Add to that again, the quality of the electronics on the battery itself, and charge curcuitry. Balance , and charge alogrythm.


Can we sell the physical goods using ERC721?

Question: I'm new to this. can anyopne provide any feddback to the following things:

I need to build the marketplace to sell physical goods.
Can we sell the physical goods using ERC721?
I need to update the metadata after publish, Is it possible.

Thanks
Answer: You can absolutely use erc721 to make validate or facilitate  physical purchases. For example, your website to ship an item might check the wallet of a user before the shipping option is made available. Then, it could even determine exactly which item is being shipped by the tokenId. Ultimately, your erc721 will be the redemption ticket for your customer.
As for Metadata, it is common practice for it to point to an IPFS endpoint. This data can be adjusted at any time before, during, and after sale of your ERC721.


minimal number to generate an ideal

Question: How to prove that we need at least three elements to generate the ideal
$I=(x^2,y^2,xy)$ in $\mathbb{C}[x,y]$  ?   Is this related to dimension of a module? This is not homework, thank you.
Answer: This follows more or less from the definition of being a free variable, but I doubt this would help you in this concrete setting. Thus we will try to show that the maps $\mathbb C^2 \rightarrow \mathbb C$ induced by these polynomials satisfy what you claim.
First, observe that any polynomial in $I$ has no summands of degree $0$ or $1$, since it must be a sum of multiples of degree $2$ polynomials. Since, up to units, the only degree $2$ polynomials in $\mathbb C[x,y]$ are $x^2, y^2, xy$, it suffices to check that no subset of $\{x^2,y^2,xy\}$ generates $I$.
We will make use of the substitution homomorphism $\varphi_{z,w}: \mathbb C[x,y] \rightarrow \mathbb C$ given by $f \mapsto f(z,w)$.

Consider the ideal $J = (x^2, xy)$. Then, we have that $\varphi_{0, 1}(x^2) = \varphi_{0, 1}(xy) = 0$. Thus, we obtain that $J \subset \ker \varphi_{0,1}$. But $\varphi_{0,1}(y^2) = 1$ and $y^2 \in I$, so $J \neq I$.
Similarly, the ideal $J = (y^2, xy)$ is not equal to $I$.
Consider the ideal $J = (x^2, y^2)$. Suppose toward a contradiction that $xy \in J$. Since the degree is additive it follows that $xy = ax^2 + by^2$ for $a, b \in \mathbb C$. (A priori we have that $a,b \in \mathbb C[x,y]$, but by the remark about the degree I just made it follows that $a,b$ are degree-$0$ polynomials.) Note that since $\varphi_{0,1} (xy) = \varphi_{1,0}(xy) = 0$ for all $w$, we obtain that $ax^2 = by^2 = 0$. But this contradicts $\varphi_{1,1}(xy) = 1$.

minimal number to generate an ideal


What is the significance of selecting publication target when creating new mailing?

Question: What is the core significance of selecting publication target when creating new mailing?
Answer: When a mailing is created the first option you have is to "Test" it, i.e. send it out to one or multiple test email adresses. This will also render the mailing (i.e. execute the Template code). For this part you need a Publication Target.
Once the mailing is rendered once, its outcome is cached and that is what will be used for future mailings (untill you test it again). Hence you need to select the Publication Target at creation time of the mailing.
The final rendering done at mailing time will only combine Contacts and content, i.e personalize the mailing for the specific Contact you are sending it too.
Comment: Bart is absolutely correct. It's a side-effect of needing to render the templates using Content Manager, which currently requires a Publication Target.


Prove that $\frac{1}{a^3(b+c)} + \frac{1}{b^3(a+c)} + \frac{1}{c^3(a+b)} \geq \frac{3}{2} \text{ when } abc=1$

Question: So I have a possible proof but I'm not certain it's right:
$\text{As } \frac{a_1}{x_1} + \frac{a_2}{x_2} + \frac{a_3}{x_3} \geq \frac{(a_1+a_2+a_3)^2}{x_1+x_2+x_3}\text{, we obtain } \frac{1}{a^3(b+c)} + \frac{1}{b^3(a+c)} + \frac{1}{c^3(a+b)} \geq \frac{9}{a^3(b+c) + b^3(a+c) + c^3(a+b)}$
$\begin{align}
a^3(b+c) + b^3(a+c) + c^3(a+b) & = a^2(\frac{1}{b} + \frac{1}{c}) + b^2(\frac{1}{a} + \frac{1}{c}) c^2(\frac{1}{a} + \frac{1}{b}) \\
& \geq \frac{4a^2}{b+c} + \frac{4b^2}{a+c} + \frac{4c^2}{a+b} \text{ by the same inequality as above} \\
& \geq 4\frac{(a+b+c)^2}{2(a+b+c)} \text{ (same reason)} \\
& \geq 2(a+b+c)
\end{align}$
Now, we have:
$\frac{1}{a^3(b+c)} + \frac{1}{b^3(a+c)} + \frac{1}{c^3(a+b)} \geq \frac{9}{2(a+b+c)}$
I'm not sure if this is a logical progression to make though. Because if $a \geq b$ then $\frac{1}{a} \leq \frac{1}{b}$, so is this not true? I feel like it must be as I can get the desired result, but I'm confused about it.
However, if this is true it is then sufficient to prove that $a+b+c \geq 3$.
$a+b+c = a+b + \frac{1}{ab} \geq 2\sqrt{ab} + \frac{1}{ab}$
It can be proved with calculus that $\forall x\ge 0,f(x) = 2\sqrt{x} + \frac{1}{x} \geq 3$. Thus the inequality is true, and the proof is finished.
Can someone please explain either why my proof is true (namely what I am confused about) or why this false proof yields the right result?
Answer: I think your first step gives a wrong inequality.
For the proof we can make the following thinks.
By Holder and AM-GM we obtain:
$$\sum_{cyc}\frac{1}{a^3(b+c)}=\sum_{cyc}\frac{b^3c^3}{b+c}\geq\frac{(ab+ac+bc)^3}{3\sum\limits_{cyc}(b+c)}=$$
$$=\frac{(ab+ac+bc)(ab+ac+bc)^2}{6(a+b+c)}\geq\frac{3(ab+ac+bc)^2}{6(a+b+c)}=\frac{(ab+ac+bc)^2}{2abc(a+b+c)}\geq\frac{3}{2},$$
where the last inequality it's just $\sum\limits_{cyc}c^2(a-b)^2\geq0$.
Done!
Comment: Yeah ok, that's much more simpler than mine, thank you. However, I am still confused as to whether my proof is correct or not. Would you be able to answer that question?
Comment: @Jim Jimson I think your first step is not correct.
Answer: I don't think generally $\frac{a_1}{x_1} + \frac{a_2}{x_2} + \frac{a_3}{x_3} \geq \frac{(a_1+a_2+a_3)^2}{x_1+x_2+x_3}$($a_i=10$, $x_i=1$ is counterexample), it should have been$$\frac{a_1^2}{x_1} + \frac{a_2^2}{x_2} + \frac{a_3^2}{x_3} \geq \frac{(a_1+a_2+a_3)^2}{x_1+x_2+x_3}$$by Cauchy-Schwartz inequality.
And if $x<y$ then $1/x>1/y$, therefore you should calculate the upper bound of $a^3(b+c) + b^3(a+c) + c^3(a+b)$, not the lower bound.
Also, it is true that $a+b+c \ge 3$ and you can prove it much simply with AM-GM inequality: $a+b+c \ge 3\sqrt[3]{abc}=3$. However, it only proves that $\frac{9}{2(a+b+c)}\le \frac{3}{2}$, which is not what you want.
Answer: We have
$$\sum \frac{1}{a^3(b+c)} = \sum \frac{1}{a^2(ab+ac)} = \sum\frac{(bc)^2}{ab+ca}.$$
Replacing $ab=z,bc=x,ca=y$, we need to show
$$\sum\frac{x^2}{y+z}\ge\frac32,\tag1$$
for $xyz=1$.
Now (1) is trivial from C-S:
$$2(x+y+z) \sum\frac{x^2}{y+z}=\sum (y+z) sum\frac{x^2}{y+z}\ge (x+y+z)^2$$
and
$$x+y+z \ge 3\sqrt[3]{xyz}=3.$$


IIS 8.5 URL Rewrite redirect with URL-Parameters

Question: I want to redirect a SEO-Friendly outgoing link like example.com/out/productxyz with IIS 8.5. So I created a Rewrite-Rule with the Action-Type forward. The target URL has Parameters, e.g. example.com/action.aspx?param1=value&param2=value
The Problem is: When the IIS is saving the rule, the '&' chars from the parameters are converted to their HTML-Values:
<action type="Redirect" url="http://example.com/action.aspx?param1=value&amp;param2=value" redirectType="Found" />

So a '&' is converted to '&'. I took a look in the header and the IIS is exactly redirecting to 'http://example.com/action.aspx?param1=value&param2=value'. This breaks because of the '&' and so I get another side, and not the one which I would get with correct parameters.
I already tried to replace all '&' to '&' in the web.config, but then I got an error in IIS that the config isn't a well-formed xml. So my question: How can I redirect a custom URL to a target URL with URL-Parameters, without broke the parameters?
Answer: the value in web.config should look like
<action type="Redirect" url="http://example.com/action.aspx?param1=value&param2=value" redirectType="Found" />

not (notice the extra amp; you have here)
<action type="Redirect" url="http://example.com/action.aspx?param1=value&amp;param2=value" redirectType="Found" />


Iam getting bad thoughts and insults about allah

Question: Assalamualikum,
i am a 20 year old muslim boy. I am facing a problem from several days. I get bad thoughts and insults about allah and his prophet in my mind. I get very bad words about allah and i feel depressed after having such thoughts. These thoughts keep constantly coming to my mind whenever i pray salah ;and also in other times. Earlier these thoughts used to come only in salah but now they come all the time. I am also not sure whether i say these bad words in mind or did i utter it slowly because i have a habit of saying things to myself. I dont know how to deal with these thoughts. Will i be accountable for these thoughts (the thoughts are very bad sometimes i feel like i may lose eeman because of these thoughts). Thats why i am sending you this problem so i that i ca get help regarding this. Please provide me a detailed answer whether iamaccoountable for these thoughts or not and if iam accountable then how should i repent for it. I hope you will answer me soon because my anxiety is increasing day by day.
Answer: This is the waswasa from the Satan. Whenever you have these thoughts say 'Auzubulliah'. He is always trying to make disconnection between you and Allah. Some tips to stop these

Do Zikr of Allah because it keeps your towards Allah.

Try to be in wudu it gives protection from Satan.

Never forget Allah because it's the target of Satan.

Watch YouTube videos about Islam and hear lectures of Islamic scholars.
I give you a link of videos series that will build your faith about Allah
https://www.youtube.com/playlist?list=PLpbPLDjlfpaCMdicwFbKpiM5G2o_8Ce6p


Why do my egg whites separate after whipping?

Question: Every time I try to whip egg whites, I seem to end up with the same problem. After a good bit of strenuous beating with the whisk, the egg whites finally reach the "firm peak" stage. I then go grab something (last night, it was the chili peppers to coat in egg), and right away the egg has separated into fluffy white peaks on top, and liquid on the bottom.
What's going on? Is there a trick to keeping the egg white a uniform texture?
Answer: This is the nature of meringue: they will start to fall apart as soon as you stop whipping.  There are a few tricks to help it hold longer, but in general you want to have EVERYTHING ready to go as soon as the meringue is whipped.
To help stabilize the meringue you can:

Use a copper or SILVER-plated bowl to whip, or add a tiny amount of powdered copper supplement from a health food store
Acidify it slightly: add 1/8 tsp cream of tartar or 1/2 tsp lemon juice per white, before beating
Let the bowl warm to room temperature, which increases the ability of the whites to take in air
Ensure there is absolutely no yolk in with the whites.  The fat greatly destabilizes the foam.

Now for WHY these tricks work:
I'm going to quote heavily from Harold McGee's "On Food and Cooking", as it does a wonderful job explaining meringues and other whipped egg whites:

Like the head on a beer or a cappucino, an egg foam is a liquid--the
  white--filled with a gas --air-- in such a way that the mixuture of
  liquid and gas keeps its shape, like a solid.  It's a mass of
  bubbles, with air inside each bubble, and the white spread out into a
  thin film to form the bubble walls.  And the makeup of these liquid
  walls determines how long a foam can stand up.  Pure water has such a
  strong surface tension--such strong attractive forces among its
  molecules--that it immediately starts to pull  itself together into a
  compact puddle; and it's so runny that it puddles almost immediately.
  The many nonwater molecules in egg white both reduce the surface
  tension of the water they float in, and make it less runny, and thus
  allow the bubbles to survive long enough to accumulate in a sizeable
  mass.  What gives the mass of foam a useful kitchen lifetime is the
  white's team of proteins.

Whisking unfolds these proteins, primarily globulins and ovotranferrin, which bond to each other and stabilize the bubble walls.  Cooking will evaporate the water and unfold ovoalbumin, creating a rigid and permanent protein network.
However, the same proteins can ALSO destabilize the foam if they bond too tightly. "The protein network begins to collapse when too many of these bonds accumulate and the proteins cluster together too tightly" (page 102). In the case of egg proteins, one of the strongest bonds is a disulfide bond between the sulfur-containing amino acids, cysteine and methionine. Eggs contain copious quantities of these amino acids, which are why they produce such a potent stench when they spoil; the sulfur is converted to malodorous sulfur compounds, particularly hydrogen sulfide.
Copper, silver, and acids stabilize the egg foam by preventing the formation of these disulfide bonds. To quote Harold McGee (page 103):

It turns out that along with a few other metals, copper has the useful
  tendency to form extremely tight bonds with reactive sulfur groups: so
  tight that the sulfur is essentially preventing from reacting with
  anything else.  So the presence of copper in foaming eggs whites
  essentially eliminates the strongest kind of protein bond that can
  form, and makes it harder for the proteins to embrace each other too
  tightly.

McGee also notes that silver has the same property of inhibiting disulfide bonding. Acid achieves the same goal of reducing disulfide bonding, but works slightly differently:

The sulfur bonds form when the sulfur-hydrogen (S-H) groups on two
  different protein molecules shed their hydrogens and form a
  sulfur-sulfur (S-S) connection with each other.  The addition of an
  acid boosts the number of free-floating hydrogen (H) ions in the egg
  white, which makes it much harder for the S-H groups to shed their own
  H, and so slows the sulfur bonding down to a crawl.
Answer: Hard to say what's going on exactly, but there are a few things you can do.

Add a pinch of salt before whisking.
Have the whites and the bowl cold.
You can even put the bowl in a cold bain marie.
Use a very clean metal bowl (grease will interfere).

That's about it.
Comment: I always use a glass bowl to whip, that way you can see what's happening at the bottom.
Comment: As long as it's not plastic.
Answer: Same thing happens to me every time when making sponge cake! it helps if your egg whites are at room temperature instead of cold.
Answer: We were making a topping for muffins wth egg whites agave & cream of tarter. It separated out before the muffins were  cooled enough for icing. I thought  to cook in a double boiler while beating with an electric mixer to form peeks. Like a 7 min. Icing. MED. LO heat . Worked fine!! Remained stable in the frig for days! And I did not need to be concerned about  the safety of  keeping raw eggs fresh.
Answer: Don't over whisk the  egg whites.
Comment: I won't delete the answer despite a flag, because it does address the issue in a way. However, I consider it to be a very poor answer, because 1) it doesn't really give an explanation (the OP explicitely asked why it is happening), and 2) doesn't add anything to the existing answers.


can i get lost images/ videos from broken phone if i had a google account

Question: I lost all the pictures and videos on my last phone because it got wet and wouldn't come back on. On this new phone (same exact phone as broken one) under settings> backup & recover its was already set to automatically back up files so I'm assuming the old one was too. But I don't know what I need to do to find them or get them back. I have the info for my old google account but I also set up a new account when I got this phone
Answer: If you enabled sync with Google Photos, you would find it here: https://photos.google.com/


Bed sheet as wing skin?

Question: https://en.m.wikipedia.org/wiki/Aircraft_fabric_covering
This article states several early aircrafts that successfully used cotton as wing skin including Wright flyer.  "Colditz Cock" glider had its wingskin made from bedsheets plus this guys

 used bedsheets to make their wingskin and the plane kinda took for like 2 seconds.
Can a  good,strong bedsheet successfully replace tedlar in an airplane without any problem?
Comment: Depends on what you mean by "replace".  After all, there were fabric-covered aircraft for decades before there were synthetics like mylar &c.  Though I would look at a fabric optimized for strength rather than sleeping comfort, myself :-)
Comment: Trying to cut costs or something?
Answer: Absolutely you can use a fabric for covering and airframe.  I used to build large scale R/C aircraft much like they used to build real world aircraft. I used fine silk to cover the wings, elevator, tail, and fuselage. I used epoxy to adhere it to the wooden airframe and then later apply some kind of lacquer, which serves to shrink and pull tight the silk and also makes it airtight. This can then be painted or not.  Silk is a very strong lightweight material. The performance is actually probably better than many modern materials, but probably would not hold up to the elements as well over time.
Comment: Welcome to aviation.SE!
Answer: Fabric coverings need to be strong enough to handle the load to which they are subjected. As an example:

Piper PA–18s, for example, emerged from the factory wearing Grade A cotton fabric tested to withstand a minimum of 80 pounds per square inch.

This super cub cruised at 130mph with a wing loading of about 10lb/sqft.
Fabric wings, particularly cotton, are often also "doped", meaning they are painted with a material that shrinks, preserves and makes the fabric less permeable to air.

Classic and antique aircraft got coats of plasticized lacquer called dope, a flammable material that served to tighten the fabric and provide some protection from the elements; paint was applied over the dope.

Some ultralights with UV resistant nylon coverings do not take this extra step. If your aircraft is only to be used a couple of times, preservation is less important.
Answer: The earliest covering systems were actually bedsheets... well not literally bedsheets, but the fabric was linen.  The Wrights used muslin, a tightly woven cotton used for womens' unmentionables. Grade A cotton came later after linen, then polyester after WW2.
I'd say the cheapest alternative to Tedlar might be to use commercial grade polyester fabric of a suitable weight that can be heat shrunk and use premium exterior latex house paint as the filler system. You'd have to use polyester instead of cotton or linen because on those fabrics it's the dope coating that shrinks the fabric to make it taught and I don't think latex paint will have the same shrinking effect.
Instead of aluminum powder added to the dope for UV protection as is done for normal airplanes, for latex you add carbon black to the base coats.
Anyway, I'm not making this up.  Latex paint has been used on homebuilt aircraft with success http://www.flysquirrel.net/piets/paint/paint.html.  I've seen that Peitenpol in the article at Oshkosh and it looked pretty good.  The article notes that the latex finishing system was actually lighter than an actual aircraft finishing system like Polyfibre.

Bed sheet as wing skin?


Stress-energy tensor given Einstein tensor

Question: Suppose that you want to solve the Einstein Field Equations $$R_{\mu\nu}-\frac12Rg_{\mu\nu}=\frac{8 \pi G}{c^4}T_{\mu\nu}$$ but already know all the components of the metric $g_{\mu\nu}$. If thats the case, this implies that we know the Ricci tensor $R_{\mu\nu}=g^{\rho\sigma}R_{\rho\mu\sigma\nu}$, which further implies that we know the scalar curvature $R=g^{\mu\nu}R_{\mu\nu}$ which would mean that we can find the Einstein tensor $G_{\mu\nu} \implies G_{\mu\nu}=R_{\mu\nu}-\frac12Rg_{\mu\nu}$. Since we know the Einstein tensor does that this imply we can solve for the Stress-Energy tensor by $$R_{\mu\nu}-\frac12Rg_{\mu\nu}=\frac{8 \pi G}{c^4}T_{\mu\nu} \implies T_{\mu\nu}=\frac{c^4}{8 \pi G}({R_{\mu\nu}-\frac12Rg_{\mu\nu}})?$$ Is this even feasible?
Comment: Yes, people do this all the time.
Comment: Is that all you want to do, multiply by $c^4/(8\pi G)$? You can even rearrange to get the Ricci tensor in terms of the stress-energy, if you're interested.
Comment: Yes, that is all I want to do for now. However, given the definiton of the SEM tensor $$T_{\mu\nu}=\frac{-2}{\sqrt{-g}}\frac{\delta S}{\delta g^{\mu\nu}}$$, can I get the same result using the definiton $$T_{\mu\nu}=\frac{c^4}{8 \pi G}({R_{\mu\nu}-\frac12Rg_{\mu\nu}})$$?
Comment: Ah, _now_ [we're getting at what you want](https://meta.stackexchange.com/a/66378): to derive the EFEs from an action. [This article](https://en.wikipedia.org/wiki/Einstein%E2%80%93Hilbert_action) does it. Your action needs two pieces, only one of which appears in your penultimate equation; the other gives the Ricci side.
Answer: Yes, you can obtain the stress-energy tensor from the Einstein tensor. If you do not specify the stress tensor beforehand, any Lorentzian manifold will provide a solution to the Einstein equations. However, not necessarily it will be a physically interesting solution.
As a historical example, we can consider the Alcubierre Warp Drive, which has a geometry constructed to provide a way of allowing a spaceship to travel hyperfast within General Relativity (in a super short form, the spaceship is surrounded by a bubble of spacetime which moves faster than light, but the spaceship is not locally moving faster than light since it is at rest with respect to the bubble, so nothing is violated). The original paper by Alcubierre proposes a geometry and only then computes the stress tensor, which turns out to involve negative energy densities (and we currently do not know of any sort of classical matter with these sorts of properties).
The presence of negative energy densities, or matter going on acausal motion (moving faster than light), and so on is usually undesirable on General Relativity, so it is common to impose energy conditions to forbid these sorts of issues. Computing the stress tensor from the Einstein tensor might lead to tensors that violate these energy conditions, meaning that often these stress tensors might not be realizable by any sort of matter we currently know of.
In summary, yes, you can obtain the stress tensor given the Einstein tensor. However, this does not mean the stress tensor you obtain will be physically interesting or physically realizable.
Comment: By physically interesting, this means approximation, correct?
Comment: @aygx pretty much. "Physically interesting" here means that is approximates to some degree of precision the stress-energy tensor of something that actually exists within the phenomena we are considering (well, roughly, I'm not attempting to give a mathematically precise definition hahahaha). Something with negative energy densities is not physically interesting if we only consider classical matter, but quantum effects can lead to these effects, for example.


Big-O of algorithm

Question: I have a quite simple problem, however I am a bit unsure of what the actual runtime (e.g. Big-O) is of this.
The program looks like this.
n <- user input
for i=1 to n
    foo(i)

foo a:
for i=1 to a
    foo2()

foo2 does an near constant amount of work which is not going to be significant.
What is the Big-O of this?
Answer: For each integer 0 <= i <= n, there's another loop which goes 0 <= j <= i.
So, the i-th integer requires i calls to foo2().
Over n integers, this adds up to an average of (n / 2) extra calls to foo2() per integer -
n + (n - 1) + ... + 1 + 0 is the same as
n + (n - 1 + 1) + ... + (n - n/2 + n/2), or
n * (n / 2).
Since the upper bound on complexity is n^2 / 2, its growth will happen as quickly as n^2 - so the complexity is O(n^2).
Answer: (Assuming the inner function foo2() is Θ(1))
It's Θ(n^2), because the outer loop is executed once for all i=1...n with the inner loop being iterated i times per outer loop iteration, that makes in total sum(i) from i=1 to n executions of foo2(), which is equal to (n+1)*n/2 = 1/2*n^2+1/2*n times.
Θ(n^2) implies O(n^2).

Big-O of algorithm


What is a "risk wafer"?

Question: In integrated circuit manufacturing I came across the term "risk wafer" which seems to be different from a "normal" wafer. But I can't find any information online on what a risk wafer really is.
Answer: When you release a design to manufacturing, i.e. Tape-out, fracture (mask making) and then lot start what is normal is that you start a ES (engineering sample) lot that is smaller than a full production lot (25) the size of this ES lot is dependant upon the fab, but is typically 12 or so.  You then put in wafer holds at various points in the process.  You start with 12 wafers, but three get held at say implant, and then another 3 get held at gate poly etch, and then another 3 get held at metal 1 thus allowing the final 3 to go through to the end step.
This is done so that if you find problems at various steps you can correct the issues and then restart these held back wafers and not incur as long of a time delay.  Also it doesn't make sense ot fab 25 wafers that go to scrap.
You can never just hold 1 wafer as a lot of processing steps do multiple wafers at a time (say 6, or 3 or 4) and thus if you stop just one wafer, it would have to have a replacement "dummy" wafer with similar processing put into it's place.  Fabs don't like wasting production capacity on scrap.
The amount held at each stop will depend on the machines (3 wafers, or 4 wafers etc. at that machine center).
The "risk wafer" that you mention, can be the first lot of 3 that makes it through ES with stops or holds at various places for the other wafers in the lot.  The first ones through are far "riskier".  The wafers held at the various locations are maybe not so risky so they may not be considered risk wafers.  Although some fabs do consider them that.
And finally in some fabs, any non-qualified wafer run are considered risk wafers.
So the term will depend upon the fab you use.
A hat tip to @bdegnan who pointed out that in some fabs, a "risk wafer" is one where a process waiver has been requested and granted. So might ask for a change in process steps, dosage, or be adding new stapes (that have yet to go through qualification) or even a DRC (design rules check) waiver.  Captured this from the comments.
Comment: @bdegnan edited and added to my answer, with attribution. Comments get scrubbed so salient information needs to migrate into the answer field.
Comment: @Fritz One that has not undergone qualification. Typically when you bring up a new process, you have to then spend hours in test chambers, ensuring the long term stability and reliability of the devices on the wafer. This is part of the qualification process, which also looks at performance and cost.
Comment: We get the "risk wafer" sticker when we ask for DRC and doping wavers.  For instance, if you want to make a MESFET on a standard CMOS process, you end up breaking enough non-critical rules to get the flag even if you don't actually "break" any rules.
Comment: @bdegnan you should add as a separate answer, I forgot to add that aspect.  Good point!
Comment: You pretty much hit it so I didn't think that my single errata was enough for a proper answer.
Comment: @placeholder: Could you explain, what a "non-qualified wafer run" is?

What is a "risk wafer"?


Which regression used for normalized count data

Question: I am working with social network data. I have multiple networks of various sizes and I'm calculating indegree (the number of connections between people) in each of the networks. I've been told to normalize the count of the number of connections by dividing by the number of possible connections for that network. I'm unsure whether this is accurate, but if it is, can I just work with a linear regression on this transformed data?  If it's not accurate should I just go with the Poisson or Negative Binomial route? If someone can provide citations or proofs for reasons that would be greatly appreciated
Comment: Was there given a reason for the requirement of normalization? It seems a strange thing to do with count data. Maybe used the  (log of) total number of possible connections as an offset? with poisson/negbin? Search this site
Comment: So there was probably no good reason, so don't do it! You might find something useful in this [saved search](https://scholar.google.no/scholar?hl=no&as_sdt=0%2C5&q=social+network+data+and+count+data+analysis&btnG=)
Comment: There was no concrete reason. Something about standard deviation still being the same if you transformed it by z-scoring the count data? Made no sense to me.
Answer: In a larger network a person may have a chance to have more connections, but on the other hand they may not choose to - there is likely a saturation once the network gets above a certain size.  You could look at the degree spectrum of each network separately - do these spectra change with network size? If so then the networks are not 'saturated' and it might be appropriate to scale the degree counts by some function of network size.  You could choose a function that equalises the degree spectra.


Are Rey and Luke Skywalker Connected?

Question: Star Wars: The Force Awakens, what is the connection Between Rey and Luke Skywalker? Are they related?
Comment: I'm voting to close this question as off-topic because it conflicts with our "future works" policy; http://meta.scifi.stackexchange.com/questions/5187/should-questions-about-future-works-be-closed-as-primarily-opinion-based
Comment: That would be one of the big unanswered questions.
Comment: can you make it simple Jolenealaska
Comment: I personally don't think so. Luke was looking pretty celibate by Return of the Jedi. So, it's just speculation at this point. My money is on her  being Obi's granddaughter.
Comment: yea it could be..
Comment: Also a duplicate of http://scifi.stackexchange.com/questions/111072/reys-familial-ties-in-the-force-awakens
Answer: Well, there are speculations that Rey is Luke's daughter... You might be able to infer it from how strong Rey is with the force. In the trailer, Luke says that the force runs strong in his family: His father, his sister, and himself. And he seems to be talking to someone, saying it runs in him/her as well. That's why Kylo Ren was so strong: because of Leia.
Also, in the movie, Maz had Luke's lightsaber in her keeping, and it called to Rey, when it has never done that for anyone before. When this was found out, Maz also explained to Rey that what she was looking for was not in the past, on Jakku, where someone had 'abandoned' her as a child. Instead, it was in the future. And since Maz wanted her to help find Luke, that might have been a hint that Rey is Luke's daughter.
It is also very possible if you take into account the plot around Kylo Ren, aka Ben Solo. His mom is Leia Organa, which means his uncle and ex-mentor is Luke. So, in the interest of plot development and storyline, it would be pretty ironic to see Kylo Ren face off against his cousin, who will probably be Luke's new apprentice. It could be a throwback to when Anakin, Obi-Wan's old apprentice, faced off against Luke, Obi-Wan's last apprentice.
Another possible point, many have marked the similarity between Jakku, and Luke and Anakin's home planet, Tatooine. So... Hehehe you can draw your own conclusions...
But watching the trailer and the movie, especially where it is purposely not mentioned who left Rey on Jakku, that this particular connection is not one that will be made so soon. However, and this is my personal take, if the Moviemakers are smart, they would have dropped all these hints on purpose to make everyone think Rey is Luke's daughter. But at the same time, they would have come up with a totally different, yet plausible explanation, that will blow us all away. If they're smart.
Comment: They put porgs in there. They're not smart. Prepare to not be blown away.

Are Rey and Luke Skywalker Connected?


Since the West will no longer allow Russia to raise money by selling sovereign debt, what alternatives does Russia have?

Question: are there any precedents of this ? What is generally the alternative in such cases ?  Do other authoritarian countries help you finance debt ?
Comment: Turn towards East? China?
Answer: You could take the example of Cuba and Iran which have been for a long time under US sanctions. But there are also a lot of countries that are not officially barred, but can't take loans abroad because nobody trusts them. Sometimes those countries manage to get some loans directly from private institutions skipping the step of the public negotiation, sometimes they simply adapt their economy to work without asking a loan to a foreign country or institution.
BTW. Russia foreign debt is quite small. According to the Russian ministry of finance, the Russian debt in 2019 was 15.3% of GDP, with only 3.6% of GDP being foreign-held debt and 11.7% of GDP being debt held by domestic investors.
Comment: @Philipp can't you just put is a search engine the keywords "russia foreign debt by gdp" I am under the impression that the requirement to provide evidence has become a kind of mental lazyness where users ask evidence for the obvious instead of asking evidence for what is dubious.
Comment: "requirement to provide evidence has become a kind of mental lazyness" Good answers should be based on facts and backed up by references where possible. Of course we can search for this ourselves, but where is the value in somebody only providing opinions that then need to be checked by everyone then anyway? Q&A here should be a knowledge repository, not a discussion forum or opinion poll. That's probably where references and exact numbers make content more useful. Just as explanation why one would ask for the amount of Russian foreign debt.
Comment: Regarding the claim that Russia foreign debt is quite small: I think it would be interesting to see a source which shows how exactly Russian government debt is structured. Not that I doubt that claim, but it would be interesting to see some numbers nevertheless.
Comment: What happened to Cuba and Iran? Did they get financial help from other authoritarian countries?
Comment: @Trilarion "What happened to Cuba and Iran? Did they get financial help from other authoritarian countries?" Yes, I know, the current financial elites make a lot of money by forcing governments into debt. Therefore they spread around the notion that a country cannot develop without making debt, but that is only propaganda, debts are not necessary.
Comment: "debts are not necessary." So Cuba and Iran do not have debt then? You mentioned these countries as examples, so I assumed you would also kind of answer the question for them.
Comment: @FluidCode Well, if you think I am just lazy and not interested in having good content on this site, then I think you won't mind if I invest the work to add a source and some numbers to this answer myself.
Comment: @Philipp Here is a source: The St. Louis Federal Reserve. [Central government debt, total (% of GDP) for the Russian Federation](https://fred.stlouisfed.org/series/DEBTTLRUA188A) annually. According to FRED (Federal Reserve Economic Data) Russian debt in 2019 was 17.3% of GDP. Looks like FRED's source is the [World Bank, and theirs is the IMF](https://fred.stlouisfed.org/data/DEBTTLRUA188A.txt).
Answer:
Since the West will no longer allow Russia to raise money by selling sovereign debt, what alternatives does Russia have?

The Russian regime through the mainstream state-controlled Russian TV channels spoke about the pending Western sanctions. This means that Kremlin has already considered alternatives. They will be revealed in due course. Some politologists, such as Victor Nebozhenko, refer to China's regime as a possible source of support. (References provided upon request, in the meantime feel free to search for his recent clips on YT.)
Other sources of finances for the Putin's regime and their oligarch friends, families, and mistresses are continuing sales of Russian gas and other raw materials as well as weapons. There is little other Russian exports that exist, although I think that Stolichnaya Vodka and the like should be also accounted for, to be absolutely 100% precise (which I am not).

are there any precedents of this ?

None that I know of, although other Axes countries throughout history were under similar partial sanctions (USSR, Nazi Germany, Fidel's Cuba, fundamentalist Iran, Kim's North Korea).

What is generally the alternative in such cases ?

Friends around the world. Examples: Iran-Russia, North Korea-China.

Do other authoritarian countries help you finance debt ?

Yes, of course, authoritarian countries help other authoritarian countries. Also, "useful fools", partly corrupt, outright purchased, and blackmail-threatened politicians in democratic countries are considered high-quality assets for authoritarian regimes.


HTML/CSS Validation Links/Buttons

Question: Is there a reason many websites place a small link/button to the W3C CSS/HTML validation of the respective site or is this just a weird practice that caught on?
Comment: some use it to flaunt that they adhere to web standards
others like me use to to spread awareness to the web dev community that a site show up better in any browser if you follow the web standards
Comment: see http://stackoverflow.com/questions/1053916/why-would-you-need-a-valid-xhtml-css-notice-at-the-end-of-a-page
Answer: Validation just shows that you took time to ensure that the webpage adheres to the standard, as specified in your DOCTYPE.
Ideally every page should validate, but that is very much not the exception.
For some companies it is to avoid lawsuits, as there is a standard for blind people, so, if you don't pass their validation then you can be sued.
Here is a link about ADA compliance:
http://www.icdri.org/CynthiaW/is_%20yoursite_ada_compliant.htm
You may want look here for more reasons:
http://www.clfsrpm.net/w3c-validator/docs/why.html
Basically, if you want to do something, you might as well learn to do it right and pass the validation.
Comment: Wow, lawsuits prevention via w3c disclaimer, never thought of that. :P
Comment: @o.k.w - Unfortunately it does happen. Here is one article: http://mecktimes.wordpress.com/2009/10/09/lawsuits-target-businesses-failing-ada%E2%80%88compliance/
Answer: So people can show off the fact that they've spent time complying with standards.
Complying with standards can be useful, as it helps ensure that your page will work across browsers. But very frequently there's no reward for spending the time getting your page to validate, and validators are a lot pickier than they really need to be to ensure interoperability. So, some people find it nice to stick a little badge on their page indicating that it validates, to show off the work they've done.
It's really not all that useful to stick a validation badge on your page, and a large number of the pages I've seen the badge on don't actually validate (as they stuck that badge on before they made changes, or they have an error that allows an & to come through unquoted), so you're pretty much right, it's just a weird little practice.
Answer: Well, it's just like why corporations want to display their ISO certifications wherever they can, on the name cards, website etc.
Answer: Maybe it's a consciousness-raising move by the developer to belatedly right the wrong done by all those rubbish 'Best viewed in Netscape Navigator 4' type of pseudo-disclaimers you used to get all the time.
Answer: It should be noted that there is no "standard", there are only "recommendations", which are not strictly followed by anyone. Besides, validator marks a lot of useless things as errors (such as missing "alt" attribute). And it doesn't guarantee anything related to how your website is displayed, it only guarantees that the syntax of your html is valid (you can easily "break" the recommendations with your code still being validated perfectly).
In my opinion it's mostly used in the same way as "Web 2.0" term: to show off. It doesn't really mean anything.

HTML/CSS Validation Links/Buttons


A simple paradox on conservation of energy

Question: Well this problem is challenging me, but seems ridiculously simple:
Imagine we have a frictionless hill, and a mass of m
 which starts slipping down without an initial velocity from the height h. So when it reaches the horizontal ground at the end, it has the horizontal velocity $$v = \sqrt{2gh}$$ to the right.
Now let's imagine the observer is moving with the speed of u to the left, so the mass has an initial velocity of u to the right so $$E = mgh + (mu^2)/2$$
On the other hand the mass had the speed of v at the end before, now it has the speed of v+u at the end so $$E = (m(v + u)^2)/2 = (m(\sqrt{2gh} + u)^2)/2 = mgh + (mu^2)/2 + u\sqrt{2gh}$$ so the energy at the beginning of the slipping and the end of it are not equal, and it means that an additional work of $$u\sqrt{2gh}$$ is done on the mass while slipping. But I can't figure out why and what is the force causing it.
Comment: Kinetic energy is not frame independent. https://physics.stackexchange.com/q/23323/104696
Comment: @farcher but the conservation of energy is.
Answer: According to the observer, the hill is moving to the right.  The normal force exerted by the hill on the mass has a component pointing to the right.  So in this frame, the normal force does work on the mass.
Comment: the hill is not accelerating, and so the dot product between the hill's normal force and the the masses displacement is still zero.
Comment: How do you figure?
Comment: Whoops I was a little too soon to dismiss this. $P =  F * v so for the power done on the hill by the mass: P = mg *  u = 0 but for the power done by the normal force on the mass: P =  N * ( v +  u) = N * u != 0. Interesting.
Comment: @cms https://physics.stackexchange.com/questions/23734/is-the-energy-conserved-in-a-moving-frame-of-reference contains a detailed derivation of this effect!
Answer: I just wanted to add the explicit energy balance relation in the moving frame because I found it interesting. The moving frame is not accelerating and so the forces are the same that we have in the fixed frame.
In the moving frame, at $t=0$, the mass moves horizontally with velocity $u$. Let's say the angle of the hill is $\alpha$. Right before hitting the floor,  the velocity of the mass is $\vec{v_f} = (u \cos \alpha +\sqrt{2gh})\hat{i} + u \sin \alpha \hat{j}$, where $\hat{i}$ points in the falling direction of the hill and $\hat{j}$ is normal to the surface of the hill, pointing upwards. Notice that the angles in this expression come from the fact that we move horizontally while the hill has an inclination. Also, this velocity is what we would obtain from the regular Galilean transformation of the fixed frame.
The time taken by the mass to fall completely is the same in both frames, namely $t_f  = \sqrt{\frac{2h}{g}}\csc \alpha$.
Between $t=0$ and $t=t_f$, the velocity of the mass is given by $\vec{v} = (u \cos \alpha + t g \sin \alpha)\hat{i} + u \sin \alpha \hat{j}$.
The normal is $\vec{N} = m g \cos \alpha \hat{j}$ and the weight looks a bit odd in this basis, $\vec{W}=m g \sin \alpha \hat{i} - m g \cos \alpha \hat{j}$.
The energy balance is then $\frac{1}{2} m u^2 + m g h + \int^{t_f}_0 \vec{N} \cdot \vec{v} \, \mathrm{dt} = \frac{1}{2} m \vec{v_f}^2$. There we see explicitly how the kinetic energy of the mass is changed by the work done by the weight, $\int^{t_f}_0 \vec{W} \cdot \vec{v} \, \mathrm{dt} = mgh$, and the work done by the normal, $\int^{t_f}_0 \vec{N} \cdot \vec{v} \, \mathrm{dt} = m u \cos \alpha \sqrt{2gh}$.
PS. Notice that something very interesting happens if the moving frame moves instead in the direction of $\hat{i}$! In that case, the normal does no work but the weight does an unexpected amount of work.
Answer: You can't do the u+v.
Ignoring mass and 1/2:
$KE1=u^2$
$KE2=v^2$
Total $KE =u^2 + v^2$
Which does not equal $ (u + v)^2$
Comment: Tip: use LATEX format for formulas. Everything you write between dollar symbols "\$ text \$" will be converted to math format according to laTex commands. Try also enlarging and clarifying your answer.
Answer: Let me expand on Ben's answer by giving a quantitative argument.

Let $x$ be the horizontal coordinate and $y$ the vertical one, such that, for instance, the gravitational acceleration is $\mathbf g=-g \mathbf{\hat y}$.
We consider a profile $y=f(x)$ for a frictionless hill, where a point particle of unit mass is constrained to move.
The function $f(x)$ is such that (letting $a$ be the base of the hill)
$$
f(0)=h\,,\qquad f(a)=0\,,\qquad f'(a)=0
$$
and $h$ is the maximum of $f$ in the interval $[0,a]$.
The gravitational potential energy is $U(y)=g y$.
$\bullet$ In a reference system which is stationary with respect to the hill, the trajectory $\mathbf r(t)=(x(t),y(t))$ of a point particle constrained to its surface satisfies:
$$
\begin{aligned}
y(t)-f(x(t))&=0\\
\dot y - f' \dot x&=0\\
\ddot y - f' \ddot x - f'' \dot x^2&=0\,.
\end{aligned}
$$
In particular, by the second equation, the trajectory is always tangent to the surface, whose unit normal to the constraint is $\mathbf n =(n_x, n_y)$
$$
n_x=\frac{-f'}{\sqrt{1+f'^2}}\,,\qquad n_y=\frac{1}{\sqrt{1+f'^2}}.
$$
Namely,
$$
 \mathbf n \cdot \dot{\mathbf{r}}=0
$$
The Newton equation reads
$$
\ddot{\mathbf{r}}=-g \mathbf{\hat y} + R \mathbf n
$$
where $\mathbf R=R \mathbf n$ is the reaction of the constraint, and it is normal to it because the hill is frictionless. Then, multiplying by $\dot{\mathbf{r}}$, we get te usual conservation of mechanical energy $E$
$$
\dot E(t)=\frac{d}{dt}\left(\frac{1}{2}\dot{\mathbf{r}}^2+gy\right)=R \mathbf n\cdot \dot{\mathbf r}=0\,.
$$
If the particle starts with zero velocity, the energy balance $E_0=g h=\frac{1}{2}v^2$ gives $v=\sqrt{2gh}$ for the final velocity.
$\bullet$ If now we choose a reference system which moves with respect to the previous one, with a constant velocity $-u \mathbf{\hat{x}}$, the previous equations get modified as follows.
$$
\begin{aligned}
y(t)-f(x(t)-ut)&=0\\
\dot y - f' (\dot x-u)&=0\\
\ddot y - f' \ddot x - f'' (\dot x-u)^2&=0\,.
\end{aligned}
$$
So,
$$
\dot E(t)= R \mathbf n \cdot \dot{\mathbf{x}}=-\frac{u f'}{1+f'^2}(g+(\dot x-u)^2 f'')\,.
$$
This equation can be integrated by employing the conservation of energy in the stationary frame, since $x-ut$ is indeed the trajectory in that frame by Galileian invariance:
$$
dt = \sqrt{\frac{1+f'^2(x)}{2(E_0-U(f(x)))}} dx\,,\qquad
\dot x^2=\frac{2(E_0-U(f(x))}{1+f'^2(x)}\,.
$$
The result is
$$
E(t)=E(0)+u\sqrt{\frac{2(E_0-U(f(x)))}{1+f'^2(x)}}\,\Bigg|_0^a\,.
$$
Since $E_0=gh$, $f'(a)=0$ and $U(f(x))=g f(x)$, we finally find
$$
E(t)=E(0)+u\sqrt{2gh}\,.
$$
Imposing this with an initial velocity $u\mathbf{\hat{x}}$ and a final velocity $(u+v')\mathbf{\hat{x}}$, in the moving frame, yields
$$
\frac{1}{2}(u+v')^2=\frac{1}{2}u^2+g h + u \sqrt{2 g h}
$$
and this is solved by $v'=\sqrt{2gh}=v$, as desired.