Impeachment of Evidence

Question: I don't know how to use impeachment of evidence. How is this used in court? If a motion in limine is used, what happens at the hearing for that motion? Does a judge need to see evidence of facts when you argue your facts to reflect a dishonest act?
Comment: Anyone have any comments on this topic?
Comment: The law can be different in different states and countries, I apply the majority U.S. rules of evidence in my answer.
Answer: Impeachment evidence is evidence offered at an evidentiary hearing or trial to show that something a witness testified about (or a document previously admitted into evidence) is false.
Impeachment evidence may be admissible in some circumstances even if lack of pre-trial disclosure of the evidence would bar it, even if it isn't otherwise relevant to the case, and even if it might be hearsay.
The relaxed admissibility of the evidence reflects the judgment of evidence rule writers that it is hard to predict that someone will lie under oath about a matter upon which you can prove the falsity of, but that it is important that the evidence be admitted in order for the trial to be fair.
Impeachment evidence could be sworn testimony of a witness, documentary evidence, or a request to take judicial notice of a fact. The evidence is offered to the court in the same way as any other testimony, document, or request to take judicial notice, but the standard of what is admissible evidence (as opposed to evidence that can be excluded for violating the rules of evidence) is different. The admission process is the same, only the ruling on an objection to the evidence, if the other side makes one, would be different.
For example, suppose that Bob testifies in court in a will contest trial that he was in New York City on the morning of 9-11-2001 where he saw his late father's last will and testament being signed, and Bob's ex-girlfriend happens to be present in the courtroom as a spectator. She was not disclosed as a witness prior to trial, but she is put on the stand as a witness to testify that actually Bob was having breakfast at a restaurant with her in Chicago to announce their engagement on the morning of 9-11-2001 and hence that he couldn't have seen the last will and testament signed in NYC. The fact that they got engaged in this time and place, in and of itself, isn't relevant to the pending lawsuit, because the engagement was not logically related to whether the will was signed or not. But, nonetheless, Bob's ex-girlfriend's testimony would be admissible as impeachment evidence to show that Bob's previous testimony in the case was false.
If instead of testimony from the ex-girlfriend, the lawyer for the person opposing Bob's testimony offered up newspaper clipping showing him at a Chicago restaurant at the relevant time and place that was not previously disclosed and a witness authenticated the newspaper clipping, that would also be admissible as an exhibit to impeach Bob's testimony.
After all evidence is admitted and all parties have rested their evidentiary cases, in closing arguments, you could then argue that the judge or jury as the case might be should not believe Bob's testimony about seeing the will being signed (or really about anything dependent upon his credibility) since the impeachment evidence that was admitted into evidence was more credible than Bob's testimony and contradicted his testimony.

If motion in limine is used, what happens at the hearing for that
motion?

Generally impeachment evidence is not considered on a motion in limine because the allegedly false testimony or evidence of the other party hasn't been offered into evidence yet to impeach.

Does a judge need to see evidence of facts when you argue your facts
to reflect a dishonest act

This doesn't make a lot of sense, but maybe the discussion above will clarify the issue.
Comment: @phoog I don't think that the definition you propose and the one that I used are different. You are ascribing more strength to the word "show" than I intended.
Comment: "to show that something a witness testified about (or a document previously admitted into evidence) is false": I have always understood it to mean "to call the truth of [other evidence] into question."  Is the term in fact properly limited to the stronger meaning given in this answer?  (Or am I perhaps ascribing more strength than is warranted to "show"?)
Comment: The impeachment of Evidence of conviction is the type of evidence in referring to. This is under rule 609(a)(2). Which is admissible as long as the conviction is related to a dishonest act or false statement. If the opposing party does initiate a motion in linem, would specific evidence to show facts need to be provided to the judge during that motion? I hope I'm not confusing it.

Impeachment of Evidence


Can we detect atmosphere on exoplanets?

Question: We are finding new planets in other solar systems all the time.  Some of them are in a habitable zone of their sun.  Are we able to detect the atmosphere of any exoplanet?  Is there any atmospheric element that would be indicative of known life forms?
Answer: Yes, they are starting to examine exoplanet atmospheres. A spectroscopic analysis is made of the light from a exoplanet transiting its star. The spectra of the star is subtracted from the combined star/planet data, and the remainder is assumed to be the absorption spectra from light passing through the planet's atmosphere. Here's an article from a recent Centauri Dreams column that goes into some detail: Tau Boötis b: A '3-D' Look at Star and Planet.
As far as elements indicative of life forms, one would expect to see water, carbon dioxide and methane on a life-bearing planet, but, of course, these are common substances that can readily be explained by natural processes.
Comment: That works for planets detected by the transit method, but do you know of any techniques for planets detected by other methods such as star wobble (radial velocity)?

Can we detect atmosphere on exoplanets?


str_replace not preserving whitespace

Question: I'm pretty sure this is just a PHP question but I'm asking here in case the problem may inside a WordPress function.
I have term meta called 'intro text' which is simply a description of the term. I'm trying to get the description to link to the parent element.
What I'm trying to do is link a term to its parent term IF:

Parent term exists.
Parent name is contained within the child term description. Eg. 'House music' term description is 'Upbeat Electronic music' where 'Electronic music is the parent term name.

In essence, 'Electronic music' would actually be a hyperlink to 'Electronic music'.
Here's the meat of the code:
function replace_parent_name_with_parent_link() {

    ...

    $link = sprintf( '%s', get_term_link( $parent ), $parent->name );

    return str_replace( $parent->name, $link, $intro_text );

}

So this code is used as a filter in 2 places which are pretty much identical. The issue is that whitespace isn't preserved when used as one of the filters but not the other.
What I want (what I get in one page):
Upbeat Electronic music.

What I don't want (what I get in the other page). Notice the lack of a space after 'Upbeat':
UpbeatElectronic music.

Why is this happening? It's doing this when theres a space before and after the parent name. I've repeatedly looked over my code and can't find a reason why this is happening. Please help.
Note: I've tried with different combinations using trim() but no luck.
Answer:
Did you clear cache after making changes with trim()?
Try with: str_replace( trim( $parent->name ), $link, $intro_text );
Are you sure that the term is Upbeat Electronic music and not UpbeatElectronic music?
Try with this to be sure:
str_replace( trim( $parent->name ), ' ' . $link, $intro_text );

str_replace not preserving whitespace


Etymology of cuspidal representations

Question: In the literature on representation theory of $GL_2(\Bbb F_p)$ and $GL_2(\Bbb Q_p)$, the irreducible representations with trivial Jacquet module are often called "cuspidal" or "supercuspidal". Why are these representations called cuspidal and who started calling them that? Also, is there any difference between cuspidal and supercuspidal?  I imagine this is related to modular forms but haven't been able to find any explanation in the literature. These representations seem mysterious to me and maybe understanding their etymology will give me a better sense of how they fit into the bigger picture.
Comment: 1. Harish-Chandra. 2. Take a look at Gelfand-Graev-PS "Representation theory and automorphic functions" to understand the connection with the cusps of lattices in $PSL_2(\mathbb{R}).$
Comment: The cuspidal representations are essentially the representations that are actually native to the group - they aren't induced from subgroups like the principal or special series. People seem to use "cuspidal" and "supercuspidal" pretty interchangably when talking about groups such as $GL_2(\Bbb{Q}_p)$, but I believe that the "correct" terminology is that the representations with all Jacquet modules trivial are cuspidal while the representations which cannot be obtained through the constructions of the principal and special series are supercuspidal.
Comment: It's also worth noting that for a supercuspidal representation of $GL_2(\Bbb{Q}_p)$, its matrix coefficients are all supercusp forms - I belive this is why Harish-Chandra gave them that name in the first place.
Comment: Can't edit the first comment for some reason but I suppose I should clarify that when I say "aren't induced from subgroups" I actually meant "aren't induced from lower dimensional subgroups", so in the $GL_2$ case that's just "aren't induced from characters". And of course, cuspidal = supercuspidal for $GL_2$, but there are cases where you should differentiate between the two.
Comment: @Peter- Thank you, this is very helpful.
Answer: Cuspidal modular forms vanish at the cusps of $SL_2(\mathbb{Z}) \backslash \mathbb{H}$.
Via Strong approximation you can lift the to functions on $SL_2(\mathbb{Q}) \backslash SL_2(\mathbb{A})$ because
$$ SL_2(\mathbb{Z}) \backslash \mathbb{H} \cong SL_2(\mathbb{Q}) \backslash SL_2(\mathbb{A}) / \prod\limits_p SL_2(\mathbb{Z}_p) \times SO(2).$$
Let $N$ be the group of upper diagonal matrices. Being a cusp form here means
$$ \int\limits_{N(\mathbb{Q}) \backslash N(\mathbb{A})} f(ng) d n=0 $$ for all $g$.
Being a cuspidal (or nowadays rather square-integrable modulo center) representation $(\pi,V)$ on $GL_2(F)$ for $F$ local means for all $g \in GL_2(F)$
$$  \int\limits_{N(F)} \pi(n) v dn =0.$$
So it is the analogue of a global concept. So cuspidal means the integral along unipotent subgroups vanishes.
Supercuspidal representation is a different concept. It means that the matrix coefficient hae compact support. They are among the cuspidal representations.
Answer: To reinforce what's already been said and add some references, I'd emphasize first that Harish-Chandra's "philosophy of cusp forms" was indeed a driving force in the study of representations over both finite and local fields.    Borel organized the 1965 AMS summer institute at Boulder around these ideas and the emerging Langlands program. Certainly the term "cusp" arose in the early work on arithmetic groups and fundamental domains, leading indirectly to the idea of "discrete series" of representations. This starts with $\mathrm{SL}_2(\mathbb{R})$ and was developed very generally by Harish-Chandra for real semisimple Lie groups.   He and many others also opened the way to study of such groups over local fields as well as over finite fields. His conference talk Eisenstein series over finite fields (in the volume Functional Analysis and Related Fields, Springer, 1970) reflects his interest in carrying classical ideas over to such fields.
Concerning the character theory of finite groups of Lie type, there is of course a long history going back to work of Frobenius and Schur, in which it became clear that parabolic induction alone would not produce all characters.
In his influential 1955 paper on characters of finite general linear groups, J.A. Green was able to use combinatorial methods to fill in the missing characters.   But his student Bhama Srinivasan had more difficulty with the case of $\mathrm{Sp}_4(\mathbb{F}_q)$, which helped to shift attitudes toward the systematic study of "discrete series" or "cuspidal characters" in terms of Harish-Chandra's philosophy.   Here one associates series of characters to the various types of finite tori, ranging from split to anisotropic ("compact").   The latter lead to cuspidal characters, and the 1976 paper by Deligne-Lusztig made possible the use of sophisticated geometric methods for their study.   (Lusztig himself had been influenced by Green in his earlier construction of some discrete series characters satisfying "cusp conditions" for general linear groups, in his paper Ann. of Math. Studies 81 (1974).)
Along the way there was also a special year at IAS in 1968-69, organized by Borel and influenced by Harish-Chandra, Springer, and others. In particular, Springer had two relevant series of lectures written up in Lecture Notes in Mathematics  131 (Springer, 1970), including Cusp forms for finite groups.   It's difficult to disentangle all the overlapping contributions here, but the terminology (codified in Roger Carter's 1985 book) is appropriate even if indirect.
As noted already, terminology for the groups over local fields developed along similar philosophical lines, but with the addition of terms like "supercuspidal" which doesn't come up over finite fields.
Comment: @MarcPalm , Jim Humprheys I was wondering for a long time - what is the relation between two points of view on cuspidal representations presented in your answers, it would be quite helpful if it can be explained...
Comment: @AC: The relationship between working over finite fields or local fields (including the reals) is part of the puzzle, I guess, which experts know more about than I do.   But all of this work related to Harish-Chandra's philosophy contributes to the hoped-for "unity" of mathematics.  Of course, there are more direct connections between $p$-adic rings and finite residue fields, but involving $p$-modular representations rather than ordinary characters.  (For finite groups these theories too are intricately related.)

Etymology of cuspidal representations


ToLower in Array.Contains in Entity Framework Core

Question: It seems that in EF Core's query like myContext.Books.Where(b => new [] { "harry potter", "the lord of the rings" }.Contains(b.Title.ToLower())) filtering part is not executed on sql server, no 'where' close is built. I'm using postgresql and npgsql driver, but I've checked that the same behavior is for ms sql server.
So, do you know if it's possible to built query which will generate sql where clause like this (for postgresql):
where lower(title) in ('harry potter', 'the lord of the rings')
Answer: Your linq statement appears to be a little off for doing a loose matching is all.
class Program
  {
    static void Main(string[] args)
    {
      var contextMock = new List<Book>
      {
        new Book(1, "Harry Potter and The Sorcerer's Stone", "Fiction"),
        new Book(2, "Harry Potter and The Secret Chamber", "Fiction"),
        new Book(3, "Dune", "Fiction"),
        new Book(4, "The Lord of The Rings The Fellowship of the Ring", "Fiction"),
        new Book(5, "The Lord of The Rings Return of the King", "Fiction"),
        new Book(6, "A Brief History of Time", "NonFiction")
      };

      var wrong = contextMock.Where(x => (new[]{ "harry potter", "the lord of the rings" }).Contains(x.Title.ToLower())).ToList();
      var right = contextMock.Where(x => (new List<string> { "harry potter", "the lord of the rings" }).Any(y => x.Title.ToLower().Contains(y.ToLower()))).ToList();

      Console.ReadLine();
    }
  }

Comment: It doesn't help. As I wrote, I want EF to generate sql with `where lower(title) in ('harry potter', 'the lord of the rings')` but now it generates only `select ...  from ...` which cause fetching whole table and then does filtering in memory.
Comment: ???  EF does not generate queries unless you are overriding the T4 template.  Postgresql is just a flavor of database.  Unless you have some other npgsql is just a driver.  So without more data you are just presenting a predicate that WHERE EVER you are putting it is wrong for your intention of lose matching.   If it is generated somewhere you did not provide that detail.  I just saw the linq '.Where(b => ...)' and saw it was wrong for the intent.
Answer: You are hitting limitation EF Core SQL translation. Upto release 1.1.2 EF core assumed that in Array.Contains(item), item would be member expression or EF.Property method call indicating property access. But in your case, you have a different method call because you are calling ToLower() hence EF Core fails to recognize the pattern and does not translate Contains to server.
Co-incidentally this limitation was removed while fixing a different issue.
Now EF Core translate item if possible. Since ToLower() is can be translated it works correctly and generate IN statement. That issue is fixed in 2.0.0-preview1. So it should be available in 2.0 release of EF Core.
I tested the query with nightly build of 2.0.0 of EF Core. Following is the generated SQL.
SELECT [x].[Id], [x].[Title]
FROM [Blogs] AS [x]
WHERE LOWER([x].[Title]) IN (N'harry potter', N'the lord of the rings')


Comparing the energies needed to reach the same relative velocity

Question: I have a beam of particles being accelerated up to an energy $E$ and hitting a stationary target. I have 2 other beams pointed at each other and each one accelerates their respective particles up to $E_0<E$. How can I compare $E$ and $E_0$ in such a way as to show what values for each are needed to reach the same relative velocity?
Answer: You have to compute the energy in the (relativistic) centre of mass, generally indicated with $\sqrt s$. This is $2E$ (where $E$ is the beam energy) in the case of a high energy collider, but for fixed target it is just $\sqrt{2 E}$. The computation is pretty common in textbooks of accelerator physics and special relativity.
Here are some random online notes from a quick Google search.
The interesting fact is that although colliders allow keeping a linear dependency between beam energy and collision energy, they are much more complicated as they require extreme control of two beams. Also, the density of a beam is nothing compared to the one of a fixed target: most of the particles just go through the opposite beam without relevant interactions.


Waves on water generated by a falling object

Question:
Let an object of mass $m$ and volume $V$ be dropped in water from height $h$, and $a$ be the amplitude of the wave generated. What is the relation between $a$ and $h$. How many waves are generated? What is the relation between the amplitudes of successive waves? Does it depend on the shape of the particle?
Assume the particle is spherical. What would be the shape of the water that rises creating first wave?
Comment: I'm putting the [tag:homework] tag on this because it seems like it is, but really, experimentX, it would help if you mention why you're interested in this question and what research you've done to try to figure out the answer yourself.
Comment: I'm planning a simulation project .. I'm not in hurry!! We will discuss this later after my exam.
Comment: I'd be very curious about the setup and results of such a simulation.
Answer: This is crude.
Maybe there can be an energy approach. Initially the mass has potential energy $T=m g h$. At the point of peak splash-back lets assume all the energy has been transferred to the water with peak potential energy related to the radial wave height function $y(r)=?$. A small volume of water a distance $r$ from impact has differential volume ${\rm d}V =  y(r) 2\pi r {\rm d}r$ .
The potential energy of the small volume of water is ${\rm d}T = \rho g \frac{y}{2} {\rm d}V$ where $\rho$ is density of water. The total energy is thus:
$$ T = \int_0^\infty \rho g  \frac{y(r)^2}{2} 2\pi r {\rm d} r $$
Putting a nice smooth wave height function of $$y(r) = Y \exp(-\beta\, r) \left(\cos(\kappa\, r) +\frac{\beta}{\kappa} \sin(\kappa\, r)\right)$$ with $Y$ a height coefficient. This has the properties of ${\rm d}y/{\rm d}r=0$ at $r=0$ with $y(0)=Y$.
$$ T = \frac{\pi Y^2 g \rho \left(9 \beta^4+2 \beta^2 \kappa^2+\kappa^4\right)}{8 \beta^2 \left( \beta^2+\kappa^2 \right)^2 } = m g h $$
So wave height should be $$ Y = \propto \sqrt{ \frac{h m}{\rho  \pi }} $$
Comment: This sparked my interest to look into scaling laws for impact craters.  I found one arbitrary source to give an equation, although for the diameter.  Ideally we would look at the depth or the height of ejected material, but the diameter still has everything on the same side of the fraction as you. http://palaeo.gly.bris.ac.uk/Communication/Brana/equation.html
Comment: Interesting, although this equation looks empirical.
Comment: The question is empirical only due to the fact that we *can't* answer it exactly.  The link I gave is for an empirical equation, but the point I was trying to establish is that it has basically h, m, rho, and g equivalents present and on the same side of the fraction.
Comment: It looks empirical to me because of the fractional powers.
Comment: @ja72 What does '∝' stand for in the final equation?
Comment: @MarinoKlisovich it means "proportional to"
Comment: Why does gravity appear in the denominator in the square root formula for Y? Shouldn't it cancel out with gravity from the potential energy term on the right of the T equation?
Comment: @GabrieleGiuseppini hmm ,,, you have a point.
Answer: There isn't any simple relationship between the size of the splash and the impact velocity. Modelling splashes turns out to be a surprisingly hard thing to do. The problem is that the response of the water to the falling object is described by the Navier-Stokes equations, and apart from a few simple cases these are fiendishly difficult to solve.
I had a quick Google and found various school experiments where pupils measured splash height as a function of impact velocity. The nearest I found to a comprehensive description is this PhD thesis.
If you have a look on Youtube there are loads of slow motion videos of splashes.
Answer: I want just to add a thing. I think that the only reasoning we can do without solving the Navier-Stokes equations, nor doing experiments, is a dimensional analysis calculation.
(I suggest these notes sec 3.6 pag.83 for a complete treatment of this approach.)
The physical parameters we have are the density of water, the density of the ball (we have its mass and volume), the speed of the ball hitting the surface of the flow (via the conservation of kinetic energy, assuming no air resistance), and the viscosity of water. So:
$$\rho_b=m/V,\ \ mgh=\frac{1}{2}mv_b^2 \Longrightarrow v_b=\sqrt{2gh}$$
The only group of these parameters having the dimensions of a lenght is:
$$ \left(\frac{\rho_b}{\rho_w}\right)^\alpha\frac{\mu}{v_b}=\left( \frac{m}{\rho_wV}\right)^\alpha \frac{\mu}{\sqrt{2gh}}$$
with arbitrary $\alpha$. So we can't estimate neither the value of the amplitude, nor the frequency of the wave with only this argument, and we should solve the Navier-Stokes equations in this particular case (as said in the previous answer, this is possible only in a few special cases). Therefore, we can just state the dependence on some physical parameters, saving the arbitrariness about the power of the non-dimensional number $\rho_b/\rho_w$.
Comment: @ja72 so $Y$ doesn't depend on the viscosity of the fluid? Is this reasonable?
Comment: I think the last comment was directed to the other answer, but I think the need or the lack of need for viscosity is an interesting question.  I would suggest that surface tension might actually matter more than viscosity.  The mental image the OP has in mind is probably in a regime where surface tension matters a great deal.  Plus, when we are dealing with large scale drops into water where surface tension doesn't matter much, does it make the kind of waves we have in mind in the first place?
Comment: Actually it was, but I can't comment the other answer, I don't know why :(


Validation rule based on 2-column combinaton OR calculated column

Question: I haven't found any definitive answers to my particular dilemma - here's what I've got:
I need to enforce a rule in order to prevent any one user to sign up for a class (which is one list) twice.  Since the list can handle multiple class dates (from a lookup column that looks up dates in another list), one user can sign up for multiple classes, as long as they're on different dates.
My current approach would normally enforce unique values in the email column, but this won't work, since one person is allowed to sign up for different classes.  So, I've created a calculated column that concatenates the email address and the class date into one text field.  HOWEVER, I can't enforce unique values in a calculated column...
Any ideas on how I can make this happen?
Answer: Per my knowledge this will be hard for you to create a system for registration only using SharePoint list. As I am not clear about your list, only providing some possible options.
Workflow
You can create a workflow runs when a new item is created. Check if there are duplicate items(user's application for class) depends on your scenario, then delete the newest one.
No need to create a calculated column. You can use the Email column value to find other list items having the same email and check for their date(or other field you tell if it is a duplicate.
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/e788b05c-8d4b-47bf-9846-e089fc8c8598/check-for-duplicate-record-using-sharepoint-disigner-workflow?forum=sharepointcustomizationprevious
InfoPath Form Rules
You can set InfoPath Rules to query list item data and check if the user has signed up already
https://social.msdn.microsoft.com/Forums/en-US/8aeeef0b-1902-4497-b85b-2e876f07399e/how-to-check-duplicate-record-using-infopath-to-submit-a-webform-to-sp2010?forum=sharepointcustomizationprevious


Is this Civil War era uniform?

Question: I have a photograph of a relative in uniform, likely from the 1800's. He's listed as a corporal. Any ideas as to the time period for this uniform. On the back of the photograph is written, "corporal Harry Adamson, K 4th o v
Comment: Buttons look like "General service" buttons, see https://images.app.goo.gl/dsVVBzCo81geCEKi7 and https://images.app.goo.gl/wWQfUrwy1HvKr6ks6 - "K 4th o v" may translate to "K Company, 4th Ohio Volunteers".
Answer: In the US Civil war there was 4th Ohio Volunteers, a 3 month regiment raised in 1861, and another 4th Ohio Volunteers, a 3 year regiment that served in 1861-65.
There was another 4th Ohio volunteers, also known as the 14 Ohio National Guard, During the Spanish-American War in 1898.
https://en.wikipedia.org/wiki/4th_Ohio_Infantry1
Thus you photo should be from either 1861-65 or 1898.  If you have any evidence of when your relative lived that should help you identify which war he was in.
You should be able to find and search databases of Cival war and Spanish American War soldiers.
Comment: Harry lived from 1876 - 1945. I should have put that in the original post. (Newbie mistake!) The Spanish American war is likely. Will do more research.
Answer:
Question:  Is this Civil War era uniform?

Short Answer:
No that particular sack coat,  I do not believe is a civil war era coat.  Probable the Spanish American War.  "K 4th o v"  refers to killed,  and 4th Ohio Infantry(volunteers) who saw action in both the civil war and spanish American war.  To me the buttons appear to be wrong for this to be a civil war era sack coat.
Detail Answer:
4th Ohio Infantry saw action in the Spanish American War in Puerto Rico.

4th Ohio Volunteer Infantry
  The 4th Ohio Volunteer Infantry saw service in Puerto Rico during the Spanish American War.

That appears to be a sack coat.  US enlisted soldiers during the Civil War were issued this blouse, commonly called a "sack coat".  These were the most issued and used garments during the civil war.  Invented, or first used?, in Europe 1857, they were a significant change from the more fancy frilly uniforms which preceded them. They were adopted by the United States during the civil war because they were easy to make and functional.  Warm made out of heavy 20 oz wool.  Necessary because the US army grew from 16,215 in 1860 to 1 million men in 1865.  That's a lot of uniforms.

 Notes on the Federal Issue of Sack Coat
  The Federal issue sack coat of ihe Civil War is a paradoxical garment. In its day it was cheap, common, utilitarian, and entirely lacking in military panache; in fact, it was rather homely. It was used.hard until worn out, issued out as second rate clothing during the Indian Wars, given out to reservation Indians, and finally ending up as moth fodder in great-greatgrandfather's attic. Yet no other 'common' Federal Civil War garment has generated such intense interest among 20th Centu~y collectors or commanded such premium prices as the humble fatigue sack coat.

The problem here is that there were multiple versions of the sack coat used by the US army over the years.  The 4 button used in the civil war and a five button used after 1874.  We don't have enough of the picture to tell which which we are looking at here.  From counting or positioning the buttons we can see.
Looking at the Buttons.  (Zooming in)..

It appears to me the blown up button on this blouse looks more like the button used after 1885.  Going by the angle of the eagle's head and neck forming more of a right angle than a curve.   Also the eagle's wings.

Survey of U.S. Army Uniforms, Weapons, and Accoutrements

I also found a Congressional record documenting the promotion of a Harry Adamson, to second lieutenant. here page 3357   But that's from 1917.
And in 1934, the Promotion of Major Harry Adamson see page 100 second column
Comment: This is very help information and gives me several new leads to explore!
Comment: That particular Harry Adamson was born in England on 6 Feb 1894 and entered service from Massachusetts.  Decorations included the SS, BS and PH.  Completed the Tank Sch 24, then the Infantry Co Off Course 25 and then QM Sch 35.  He was 2LT, Infantry, Mass NG 16 Dec 15 to 24 Jun 16; the same 12 Nov 16 to 9 Feb 17, specifically, 2LT, 2d Inf Mass NG 25 Jun 16 to 11 Nov 16.  Appointed 2LT, Infantry, USA 14 Jun 17 promoted 1LT same date.  CPT (temp) 4 Mar 18 to 20 Apr 20.  Appointed CPT QMC, 1 Jul 20; MAJ QMC 1 Aug 35; LTC QMC, 1 Jul 40.  COL AUS Ord, 1 Jan 42; COL USA retired 30 Apr 47

Is this Civil War era uniform?


How can we download Google Material Design Color Palettes?

Question: I've seen many users in YouTube tutorials that use Google's color palettes (see link below) for design in Illustrator. I searched similar things in Google search but found old links that don't have any download link now. Can it be that Google removed those links? Is there any other resource to download the color palette for Photoshop and Illustrator?
https://www.materialui.co/colors
Comment: [This](https://material.io/) could be interesting. In Tools see the [Color Tool](https://material.io/tools/color/#!/?view.left=0&view.right=0)
Comment: But it doesn't have option to download the palette.
Answer:
Download link: https://drive.google.com/drive/folders/1x_Ir5oTDzBIN8yBsHtPe_mTXks3oIUOO?usp=sharing
Update: added MaterialUI.ase file for illustrator.
You can open swatches in Illustrator: Swatches >> Open swatch library >> Other library >> Select downloaded file >> Done

Last update: Link updated, you can find all format swatches for adobe photoshop and illustrator.
Answer: You can download the material design theme editor plugin that comes with the pallets built in. It works for the Sketch app.
Link: https://material.io/tools/theme-editor/
Screenshot:
Comment: I need it for Photoshop and Illustrator.
Comment: Hannah Milan (https://dribbble.com/hannahmilan) did a very good job for Adobe XD pallet (https://www.xdguru.com/material-color-palette-xd/), I think it could work with other Adobe Softwares as well.
Comment: I transformed the XD pallet into an Illustrator File(https://www.dropbox.com/s/bv72kypm1grzqzc/Material%20Design%20Color%20Pallette.ai?dl=0) I hope it helps you.


How to set grub as the boot manager?

Question: I recently bought a new HP computer, it is running on Windows 10 and I installed Ubuntu 16.04, but everytime I turn on the PC it goes straight to Windows, so how can I fix this to set up grub at the boot time. I can access Ubuntu from Windows Advanced Restart settings, but that's the only way. I have disabled the secure boot on the bios and the fast startup for Windows but it didn't work.
Comment: See: Sony, HP & others:
http://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789
 And running Boot-Repair now does copy of shimx64.efi to bootx64.efi to boot fallback or hard drive entry. HPs do not let you directly boot Ubuntu entry in UEFI. Grub only boots working Windows, so have both Windows repair disk & Ubuntu live installer available as Windows updates may turn back on Fast Start-up. http://askubuntu.com/questions/843153/ubuntu-16-showing-windows-10-partitions Is Ubuntu in UEFI boot mode? Or are you rebooting into BIOS boot mode?
Answer: Run this from windows command prompt
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
Answer: This issue can be resolved by installing boot-repair package by following these steps:
1) Open a terminal and run these commands:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair

2) Then run boot-repair by sudo boot-repair and use "Recommended repair". Then boot-repair will scan boot paths and correct them and update your grub configuration and set grub as the default bootloader of your system.
Answer: If you run bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi, make sure "{bootmgr}" is inside quotes, otherwise it will not work
Answer: efi expects the default boot loader to be /efi/boot/bootx64.efi. windows is particular about making sure it boots.
fist off, from 8.1 on windows does not really shut down, it suspends to disk ( like a hibernate) so that it boots faster. second it changes EFI to make entry 0000 (windows) first in the boot order.
the work around: rename grubx64.efi to bootx64.efi then replace the file efi/boot/bootx64.efi.this makes grub the default boot loader.
second: when in ubuntu, use efibootmgr to delete all efi entries. and reboot your computer. Make sure the first system you boot into is ubuntu so that it is placed in entry 0000. then boot windows.
third: some bios updates look in MBR for a loader even though it is a gpt/efi disk. I assume this is a compatibility issue (upgrades from a MBR formated disk).  windows will have a loader there. Install grub to the MBR as well as doing the above.
Answer: I use dual boot in UEFI mode and when it boots directly to windows.
Type these commands in command promt as administrator in windows.
To change the boot manager from windows to ubuntu, use:
bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi
To change the boot manager from ubuntu to windows, use:
bcdedit /set "{bootmgr}" path \WINDOWS\system32\winload.efi
To change the boot manager, i always use windows to change these settings.
hope it works.

How to set grub as the boot manager?


What are some grammatical features found only in modern languages?

Question: By modern language I mean a language spoken since less than two thousands years. By grammatical feature I mean for example passive voice, which doesn't exist in PIE but is found in its descendants
Comment: "Active" amd "Middle" are just names for inflectional systems. There are no texts in PIE, so there are no sentences to see how the inflectional systems worked syntactically. Therefore, what is called "Middle" (because it led to what became the Sanskrit Parasmaipada, or Middle) could very well have been passive. Middle voice verbs are often used instead of passive verbs in Greek, for instance; the systems are connected with verb meaning.
Comment: Greek has separate active, middle and passive forms in the aorist system at least since Homer; that is a lot more than 2000 years.
Comment: What makes you think passive voice didn't exist in PIE?
Comment: I think I have read in Wikipedia that it only had active and medium voice.
Comment: @huehuehue: I would recommend changing the question to "Are there any known grammatical features found only in modern languages?"
Comment: This is both too speculative and too broad.
Answer: This really depends on how you think about grammar. Your question sort of implies that it's primary morphosyntactic features you're after.
And here, it's more likely to be the other way around. Things like dual and evidentiality seem to be disappearing as Trudgill has argued in a recent book (useful video overview here https://www.youtube.com/watch?v=rjy1CkH1FOE). And it is not really a question of 'modern' vs. 'ancient' but rather related to size of community and amount of contact. At least, that's Trudgill's argument. I don't subscribe to it fully but there's enough data there for the answer to the general question.
The whole question of 'modern' language is really problematic. The anthropologist in me would say that it's hiding a world of technological and developmental normativities. Meaning, that it thinks that somehow there's a directionality to language development and that direction is towards our language, the natural way of being. There's a world of argument and data in anthropology to show that we need to consider even supposedly isolated communities to be modern - and I think this applies to languages as well.
If you step outside of morphosyntax, however, you could talk about a lot of language uses that require certain linguistic tools. One of these is writing which requires stylistic, cohesive and other para syntactic devices not likely to be found in languages without a written culture of a certain kind (ie. it's not just about writing spoken words down). So many arguments have been made about hypotaxis being a 'modern' invention, etc.
I think there's good reason to be skeptical about any such claims as absolute because of the fundamental lack of evidence from the past. However, there's probably enough there to start thinking about some broad tendencies. I'm not aware of any critical synthetic account of this, though.
Answer: The hard, or perhaps impossible, part of the question is the implied "and did not exist in any language spoken more than 2000 years ago". That seriously restricts the testability of the claim since records of languages more than 2000 years old are rather sparse.
In a number of Bantu languages (especially in the Lacustrine group), there is a grammatical distinction between past tense of today vs. past tense of yesterday vs. past tense of longer-ago. This is a pretty rare grammatical distinction, and it does not reconstruct to proto-Bantu. I propose that this is an example. I don't mean that I think that languages were in principle incapable to making such a grammaticalized distinction 2000 years ago, but I don't have any evidence that any languages did.
Answer: One such feature is high divergence between the spelling and pronounciation as seen for instance, in English and French.


Shortest line segment whose endpoints fall on two known lines and passes through a known point

Question: As a land surveyor I'm commonly tasked with calculating "lot width".  Lot width is defined as the shortest distance between two side lot lines measured along a line segment that passes through a point on the principal structure.  When the side lot lines are not parallel, I've only been able to approximate this measurement through trial and error.  What is the mathematical solution?
Comment: (+$\bigstar$) I like this question really much: it is a geometry (with the archaic meaning related with *land measurement*) problem that does not have a solution through straightedge and compass, but still has an approximated very simple solution that can be implemented in real life.
Answer:
Interesting question. We may assume that $r$ and $s$ are two rays with common origin $O$, $P$ is a fixed point inside the $rOs$ angle and $P_r, P_s$ are the projections of $P$ on $r$ and $s$. We are looking for $R\in r$ and $S\in s$ such that $P\in RS$ and the length of $RS$ is minimal.
This is a simple minimization problem in one variable if we assume that $\widehat{RPP_r}=\theta$. Let $\widehat{SOR}=\alpha$.
We have:
$$ RS = \frac{PP_r}{\cos\theta}+\frac{PP_s}{\cos(\alpha-\theta)} $$
whose minimum is achieved at the angle $\theta$ such that
$$ {PP_s}\frac{\sin(\alpha-\theta)}{\cos^2(\alpha-\theta)} = PP_r\frac{\sin\theta}{\cos^2\theta}.$$
The exact solution is so dependent on the root of a cubic equation and it is, in general, not constructible through straightedge and compass only (to check this it is enough to consider the instance $\alpha=90^\circ$). For practical purposes, however, we may consider that:

The shortest $RS$ segment is approximately perpendicular to the line
$q$, given by the reflection of $OP$ with respect to the angle
bisector of $rOs$. It follows that $RS$ is approximately parallel to $P_r P_s$, but this approximation is good only if $\alpha\leq\frac{\pi}{4}$.

2021 addendum by Lagrange multipliers, the optimal configuration is reached when $R$ and $S$ have the same distance from the midpoint $M$ of $OP$. By lengths of medians, this is equivalent to $OR^2+RP^2=PS^2+SO^2$. It implies that the projection $Q$ of $O$ on $RS$ and $P$ are symmetric with respect to the midpoint of $RS$: this explains why the first part of the answer provides a practical, constructible approximation. The projection of $O$ on $RS$ always lies on the circle with diameter $OP$. At the same time, for any $R\in r$ the symmetric of $P$ with respect to the midpoint of $RS$ belongs to a hyperbola with asymptotes given by $r$ and $s$. It follows that the exact solution can be built by intersecting a hyperbola and a circle.

Post Scriptum: if $r\perp s$ the problem is equivalent to solving
$$ \left\{
\begin{array}{rcl} xy &=& 4ab \\
(x-a)^2+(y-b)^2 &=& a^2+b^2
\end{array}\right. $$
i.e. to the duplication of the cube.
Second Post Scriptum - a much better constructible approximation.  The vertex of the $PQ$ hyperbola (such that the areas of the red and blue parallelograms are the same) can be constructed with straightedge and compass, as well as the osculating circle at the vertex. By intersecting the osculating circle with the circle having diameter $OP$ we get a point $\widetilde{Q}$ pretty close to $Q$, such that the intersections of $P\widetilde{Q}$ with $r$ and $s$ provide an approximated solution $\widetilde{R}\widetilde{S}$. This is pretty much the same as finding the only root of a cubic through one step of Newton's method.
Answer: EDIT:
I should suppose a measurement method should be constructible  more as a convention nominally rather than be strictly found by calculation. Suggesting here is a simple construction to find distance connecting feet of perpendiculars to make an inner (red) line... lot-width as a minor diagonal of a cyclic quadrilateral can be found approximately from a formula:
$$ EF= (OF\cdot ED + OE\cdot DF)/OD $$
Comment: Not really a *logic*: that is not an accurate approximation of the shortest segment joining two points on the given lines and going through $D$. Try to compute lengths in Geogebra to figure that. The shortest segment, in general, is not perpendicular to the angle bisector of the given angle.
Comment: Another point is that the width could even be curved computable by variational approach, especially with the transversality constraints.


Have Workflow Change\Update an item on Infopath Form

Question: Is it possible to change the content of a field in a InfoPath form from a workflow in SharePoint. I have tried working with the "Update List Item" action but have been unable to to find a direct way of doing this.
Answer: You can always download the xml of the InfoPath form using SPFile and have the workflow modify the contents of the xml file, thus modifying the item. To download the item try something like this
<code>            using (var site = new SPSite(SPContext.Current.Site.Url))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    #region download an intake form and parse into xml

                    //this code lets you download an intake form, parse its xml and save it
                    SPFile file = web.GetFile(urlOfFile);
                    var sr = new StreamReader(file.OpenBinaryStream());
                    XDocument xdoc = XDocument.Parse(sr.ReadToEnd());
                    sr.Close();
                    return xdoc;

                    #endregion download ...
                }
            }
</code>
Then once it's download, grab the XElement of the field you want to modify, and change the value. Then convert the XDocument back to a Stream and save it back to the SPFile using SPFile.SaveBinary() method then use SPFile.Update() to save your changes to the SPFile object.
Answer: Easiest way to do this is just promote the column from your InfoPath form so that SharePoint can see it (make sure you allow editing) then you can modify just like any other SharePoint list item (and no need to use any managed code).
I like Meyer's answer though if you are worried about users entering bad values from a datasheet or something and can deploy custom code in your environment.


IIS 7.5: Can browse website from LAN but not from outside

Question: I have an MVC4 website set up in IIS 7.5. When I browse the website using my computer's IP address from a computer within my network, it works. But the website does not load when accessed from outside of the network.
I have a router and set up port forwarding on port 80 (also tried with others but I'll stick with this for the question), to forward to my PC's IP address. Also allowed incoming TCP requests on port 80 in my firewall.
In IIS 7.5 I am using the default website with the default bindings, which include a binding for port 80, all unassigned IP addresses and no hostname.
Locally I can browse my website using this address:
Local PC IP -xxx.xxx.x.xxx/LBSPrototype1

Shouldn't I be able to access my website from outside of the network using:
Router IP - xxx.xxx.x.x/LBSPrototype1

Since I forwarded port 80 to my local PC? Or alternatively if I use a different port:
Router IP - xxx.xxx.x.x:PORT/LBSPrototype1

I don't know what I am doing wrong, any ideas as to what I might have left out?
Answer: Tried disabling your firewall ? maybe some firewall rules are blocking you
Comment: Tried it, but doesn't make a difference :/


my iphone shows "sent as text message"

Question: messages I send from my iphone 4 are showing as "sent as text message" I've read all the responses but no one mentions if my messages are actually being received. How can I tell if receipient is actually recieving my message?
Answer: The "sent as text message" means your text message was sent using SMS, not iMessage. Because the message wasn't sent through iMessage, neither you or the person you are texting to have access to read receipts, which allow you to see whether or not the person you sent the text message to read your message.
This often happens if you're in an area with bad signal, with no access to wifi, 3G, or LTE coverage and the message can only be sent via SMS.
Answer: This happens with the phone is unable to send the message via iMessage, so it will fall back to standard SMS text messaging.
If they got the message? Only sure fire way is to call the recipient I suspect.

my iphone shows "sent as text message"


Can $p=mv$ be used for speeds close to $c$?

Question: Can I use the formula $p=mv$ for a particle which is travelling at a speed which is very close to the speed of light?
Comment: Why does this question has so many downvote. This question doesn't deserve that.
Comment: @RanjitKumarSarkar exactly, it is a clearly stated, and admits a yes or no answer. Just because the answer is obvious to non-beginners doesn't make it at poor question....even then it has a "yes" and a "no" answer, both of which are correct.
Comment: Hi Dylan Rodrigues. Welcome to Phys.SE. What is your definition of $m$?
Answer: No you can't.  You need to use $p = \gamma m v$ where $m$ is the rest mass.
For reference: https://en.wikipedia.org/wiki/Energy%E2%80%93momentum_relation
Comment: Adding a link https://socratic.org/questions/how-to-prove-m-m-0-sqrt-1-v-2-c-2 .
Answer: No, you can't.
Instead you need to use the relativistic momentum
$$p=\frac{mv}{\sqrt{1-\frac{v^2}{c^2}}}$$
where $m$ is the invariant mass (formerly also called rest mass).
You see, that this formula will result in $p\to\infty$ when $v\to c$.
Comment: Also note that when $v^2/c^2$ is small, you can Taylor expand and get $p = mv(1+v^2/2c^2+\cdots)$ which is neat.
Answer: Yes, but m is the relativistic mass.  In terms of the rest mass $m_0$, $m = m_0/\sqrt{1 - {v^2/c^2}}$.
Comment: "Relativistic mass" is a deprecated concept these days. We should not be encouraging students to you use it. It will not do them any favours come exam time.
Comment: It's easy to get in trouble, with, for example, relativistic kinetic energy ( https://physics.stackexchange.com/a/595075/148184 ) unless you are careful (https://physics.stackexchange.com/a/597577/148184 )


BB compatibility of EKAR crankset

Question: Are after-market BBs compatible w/ an EKAR crankset? I have a Niner RLT RDO frame w/a PF30 BB shell. Can I use a Wheels Manufacturing PF30 w/ the EKAR set-up? Thank uou!
Comment: What's the diameter of the spindle of that crankset?
Comment: The campagnolo bearings are usually considered extremely good by the industry and in my experience give an excellent service life. You don't need to feel there's any advantage to aftermarket bearings, is what i mean.
Comment: T U for your response!
Answer: No. With Ekar, the bearings are part of the crankset, and the Ekar BB simply consists of 2 cups that form an adapter between the frame's BB shell and the crankset's bearings.
"Regular" BB's like the Wheels Manufacturing's one have bearings too, so that's one set of bearing too many!
The Ekar BB does come in a PF30 variant, so you should be able to use that on your bike. If your bike uses internal cable routing through the BB shell, you also need the EPS cable guide/shell to put between the BB cups. Route the cables line around the cable guide to protect them from the spindle. The Niner RLT RDO's specs claim internal cable routing, but through a "fully sleeved guide tube", which might make the cable guide unnecessary, better check on your actual frame.
This is how the disassembled Ekar crankset looks like, you can clearly see the bearings:

These are the Ekar BB cups, which as you see don't contain any bearings or other moving parts:
Comment: @Kevin Glad to be of help! Please click the check mark if this answers your question.
Comment: Really comprehensive explanation!!! T U very much‼‼

BB compatibility of EKAR crankset


Factor analysis and Cronbach's alpha

Question: My research work is based on a questionnaire which includes all types of questions, ordinal as well as nominal, but 80% of the questions are based on Likert scale 1-5. My question is whether Cronbach's alpha can be calculated for all types of questions even if they are not on scale format? Secondly whether  Cronbach's alpha or reliability should be done before or after conducting factor analysis and what if it comes to be too low? Also, how do we select questions from the questionnaire for factor analysis, can it be random?
Comment: `whether Cronbach's alpha can be calculated for all types of questions even if they are not on scale format` No. Classic alpha - only for scale (metrical) data. Or binary (then it is called Kuder-Richardson).
Comment: @ttnphns: want to turn that into an answer?
Answer: As mentioned in the comments by @ttnphs, Cronbach's alpha $\alpha$ is not appropriate for ordinal$^1$ and nominal data, as it was designed for scale (or metrical data). Factor analysis, however, can easily accommodate ordinal and nominal data. When using factor analysis omega, $\omega$ is typically used as a measure of internal consistency. Unlike $\alpha$, $\omega$ is a model-based reliability estimate. Thus, it can only be calculated after the factor analysis has been run (and is returned by default in many software packages) regardless of your item type (just make sure the appropriate link function is used for each item).
I am not sure what you mean by item selection; if you could elaborate on the context, I may be able to help.
For more information, see McNeish (2018) and Raykov & Marcoulides (2019) for a discussion about the use of $\alpha$ in scenarios where factor analysis is the appropriate measurement model.
$^1$ For ordinal data in particular, a different version of Cronbach's $\alpha$ is available called ordinal $\alpha$ (Zumbo, Gadermann, & Zeisser, 2007) which I cover in more detail here.
References
McNeish, D. (2018). Thanks coefficient alpha, we'll take it from here. Psychological methods, 23(3), 412.
Raykov, T., & Marcoulides, G. A. (2019). Thanks coefficient alpha, we still need you!. Educational and psychological measurement, 79(1), 200-210.
Zumbo, B. D., Gadermann, A. M., & Zeisser, C. (2007). Ordinal versions of coefficients alpha and theta for Likert rating scales. Journal of modern applied statistical methods, 6(1), 4
Answer: Before conducting factor analysis you need to perform the KMO test or Bartlett's test of sphericity to check whether your data is suitable for factor analysis.
You need to perform Cronbach's alpha test after the factor analysis.
If you want to know how to select the items please follow this link (I find it very helpful)
https://www.promptcloud.com/blog/exploratory-factor-analysis-in-r/
Comment: you should provide some justification for the need of the KMO or Bartlett's test, rather than saying it must be done.

Factor analysis and Cronbach's alpha


How to use LIMIT [X] OFFSET [Y] with SQL Server 2005

Question:
Possible Duplicate:
Equivalent of LIMIT and OFFSET for SQL Server?

How to use LIMIT [X] OFFSET [Y] with SQL Server 2005, i see mysql, oracle, sqllite, postgre have it, microsoft dont realize we need it ?
Answer: Microsoft (for a change, you might say) chose to implement the ANSI standard instead of coming up with their own proprietary keyword like LIMIT. In the next version of SQL Server (code-named "Denali") you will be able to use OFFSET / FETCH (also see this post on simulating keyset).
In the meantime, you will need to use different methods with SQL Server (or switch platforms if you think that is easier than extra typing). A good article about a few methods for paging in existing versions is here:

SQL Server 2005 Paging – The Holy Grail

Be sure to click on "Join the Discussion" to read over the 60+ follow-up comments that discuss various aspects of the solutions provided.
Note that OFFSET / FETCH is not implemented for performance reasons; only for productivity. In other words, OFFSET / FETCH will perform about the same as the ROW_NUMBER() solutions typically in use today.
EDIT While some have demonstrated cases where Denali performs better on the first page (e.g. this one), this is not the intention, and I'm not convinced the delta remains true as you traverse the table and get to the latter pages (particularly on large tables).


The story of Lord Krishna's death

Question: I want to know the story of death of Lord Krishna. Please,somebody answer my question.
Answer: When Yuddhisthir was made the King of Hastinapur; Duryodhan's mother Gandhari had cursed Lord Krishna. As Pandavas had defeated Kauravas because of Krishna's help.
She curses Krishna that one day he will be killed by a hunter and his Dwarka city will be destroyed.
Lord Krishna accepts the Gandhari's curse.
After Pandavas and their wife Draupadi's death, one day Lord Krishna was playing his flute during his trip to nearby forest...
There was a hunter named Jara who thought that Krishna who was playing his flute was a rare bird.
Jara fires a poisoned arrow Krishna's foot.
Krishna laments loudly due to pain, and the poison spreads in him.
Jara at once recognizes Krishna's voice and goes running towards him.
Jara profusely apologizes and cries...
To which Sri Krishna replies:

I must go. My time has come.

Answer without source citation.
Comment: You should cite sources.
Comment: Hi, its wrong. Gandhari cursed Krishna that he and his kin will be destroyed but never mentioned how. Also, `After Pandavas and their wife Draupadi's death, one day Lord Krishna was playing his flute during his trip to nearby forest... ` - it was Krishna who died first, followed by Pandavas and Draupadi

The story of Lord Krishna's death


Dimension of a quotient ring

Question:
What is the Krull dimension of $B=A[x,y,z]/\langle xy + 1, z + 1\rangle$, given $A$ is a Noetherian commutative ring?
Comment: I feel that you have some misconceptions. First, why would you write $B$ as $A[x,y,z]/(xy+1,z)$ and not just as $A[x,y]/(xy+1)$? For the second, are you asking whether say $\dim A[x]/(x^2+1)=\dim k[x]/(x^2+1)$ for arbitrary ring $A$ and arbitrary field $k$?
Comment: I can write $B$ as $A[x,y]/\langle xy + 1\rangle$. And I was wrong when i said its the same as fields. I will edit right away. What I meant was $\mathrm{dim}(A) + \mathrm{dim}(\Bbbk[x_1, \ldots, x_n]/\mathfrak{a})$.
Comment: For your 2nd question to make sense, you need the ideal to be generated by polynomials with coefficients in $k$ or something — otherwise the quotient $k[x_1,\dots]/a$ does  not make sense. Also, 'leading coefficient' does not generally make sense for polynomials in several variables.
Answer: Your first ring $B$ is just $A[x^{\pm1}]$, the ring of Laurent polynomials with coefficients in $A$,  which is the localization of $A[x]$ at the powers of $x$. It follows from this that $\dim B\leq\dim A[x]=\dim A+1$.
On the other hand, if $\def\p{\mathfrak p}\p$ is a prime in $A$ then $\mathfrak pB$ is a prime of $B$, easily seen to be the set of Laurent polynomials with coefficients in $\p$. If $\p_0\subsetneq\cdots\subsetneq\p_r$ is a chain of prime ideals in $A$, then $\p_0B\subsetneq\cdots\subsetneq\p_rB\subsetneq \p_rB+(x-1)B$ is a chain of prime ideals of $B$ one prime longer.
Conclusion: $\dim A[x^{\pm1}]=\dim A+1$.
Comment: The relation $xy+1=0$ means precisely that $-y$ is the inverse of $x$.
Comment: how did we get that B is the localization of $A[x]$ at the powers of $x$?
Comment: @Zoey google for "krull dimension of tensor product of algebras"
Comment: What if the ideal, $\mathfrak{a} = \langle x^2 y + x + 1, y^3 + 2z + 1 \rangle \subseteq A[x_1, \ldots, x_n]$. Should I post this as a different question?
Comment: A especial case of computing the dimensión of rings like the ones you are looking at is computinf that of tensor products.
Comment: Google more, for papers and such. There's a masters thesis on the subject, for example.

Dimension of a quotient ring


Electrostatic field in a vacuum

Question: Can an electrostatic field, the direction of which is constant in space, but the magnitude varies in space, exist in a vacuum?
Comment: If the direction is constant doesn't that mean the field lines will all be parallel, in which case the magnitude can't vary?
Comment: if you put two parallel, oppositely charged plates on either side of a vacuum you would have a constant-direction electric field
Comment: @danimal Sorry i was confused of why you said yes ... Now its clear :P
Answer: No, this is not possible.
Consider a field which always points in the same direction, and put your $z$ axis in that direction. Your field can then be described as
$$\mathbf E=E_z(x,y,z)\hat{\mathbf z}.$$
As an electrostatic field, this must satisfy Gauss's law, which in vacuum reads
$$
\nabla\cdot\mathbf E=\frac{\partial E_z}{\partial z}=0,
$$
and means $E_z$ cannot depend on the $z$ coordinate. More intuitively, the electric field cannot change its magnitude along its direction in the absence of electric charge.
In addition, this electrostatic field must be curl-less (or it wouldn't be electrostatic). The $x$ and $y$ components of the equation $\nabla\times\mathbf E=0$ read
$$
\frac{\partial E_z}{\partial y}=\frac{\partial E_z}{\partial y}-\frac{\partial E_y}{\partial z}=0
$$
and
$$
-\frac{\partial E_z}{\partial x}=\frac{\partial E_x}{\partial z}-\frac{\partial E_z}{\partial x}=0
$$
so there can't be any variation along $x$ or $y$ either. More intuitively, if the field magnitude varied along $x$ then a rectangular loop with its edges along $x$ and $z$ would have nonzero circulation.
Taken together, these conditions imply a field in vacuum whose direction is constant must also have constant magnitude.
Answer: No. I'm going to assume you mean we can do things to the boundary of a space, but that inside the space has no charge. Let's say $\vec{E}$ is in the constant $z$-direction, and call it $E_z$. Then in vacuum Gauss's Law requires $\nabla \cdot E = \partial_z E_z = 0$. So you can't have a spatial variation in the same direction as this field, but maybe you could make an $E_z$ that depended on the other directions? Unfortunately, this is also no good--in this setup, the curl of $E$ looks like:
$$
\nabla \times \vec{E} =  \hat{x} \partial_y E_z - \hat{y} \partial_x E_z
$$
Since we require $\nabla \times E = 0$ in electrostatics, both of these components must vanish and therefore there can be no spatial variation.
Comment: This is not actually possible with an electrostatic field, due to the curllessness condition $\nabla\times\mathbf E=0$. (I'd be tempted to +1 for the chance to say curllessness in a sentence, though.)
Comment: Wow, you're right. Somehow I was confident there was a problem that avoided this but it looks like not. Answer edited and wholly reversed.
Answer: If what you mean by a vacuum, something like outer space then electrostatic fields and electromagnetic waves do not need a medium to exist, (unlike sound waves and air pressure).
In fact, the field from a proton from the solar wind in the vacuum of space would be constant in a reference frame moving with it, and there would be the inverse squared spatial variation.
Comment: Hi Rabi, and welcome to the site! This does not actually address the specifics of the question (i.e. whether an electrostatic field in vacuum can have constant direction but variable magnitude).

Electrostatic field in a vacuum


Implications of Galilei-Invariance on a time-independent potential

Question: I'm trying to compute a result shown in my classical mechanics lecture on my own. Namely, consider that a system composed of $n$ particles follows a law of force
$m_k\ddot{\vec{x_k}} = \vec{F_k}(\vec{x_i};\dot{\vec{x_i}};t)$, (1)
where we write $i$, but we are actually considering all positions and velocities of the system as arguments of $F_k$. Now, if the force can be written as a time-independent potential
$F_k = \frac{\partial}{\partial \vec{x_k}}V(\vec{x_1},\dots, \vec{x_n})$, (2)
we can write the Galilei invariance characterised by a rotation $R$ and a translation $\vec{b}$ as follows:
$R\frac{\partial}{\partial \vec{x_k}}V(\vec{x_1},\dots, \vec{x_n}) = \frac{\partial}{\partial \vec{x_k'}}V(\vec{x_1'},\dots, \vec{x_n'})$,  (3)
where $\vec{x_i'} = R\vec{x_i} + \vec{b}$ is the Galilei-Transformation of $\vec{x_i}$. In my lecture, it was stated that because of this we can write:
$V(\vec{x_1},\dots, \vec{x_n}) = V(\vec{x_1'},\dots, \vec{x_n'})$. (4)
Now, I'm struggling to prove why (4) follows from (3). I tried using a naive chain rule on the inverse Galilei-transformation $\vec{x_k'} \mapsto \vec{x_k}$ but I always end up with:
$R\frac{\partial}{\partial \vec{x_k}}V(\vec{x_1},\dots, \vec{x_n}) = R^T\frac{\partial}{\partial \vec{x_k}}V(\vec{x_1'},\dots, \vec{x_n'})$. (5)
And I haven't yet found a way to imply (3) using (5). Now, I'm not sure if my calculations are right, or if I have missed something to prove that (3) follows from (5). I'd rather say that I've been misusing the chain rule.
Answer: The potential $V$ is a scalar quantity, so it is invariant under coordinate transformations. As for why 3 implies 4, I think you have to be more careful about how you're defining your gradient.


How do you translate "to reel" while fishing?

Question: I tried to translate Reel it in, but I have no idea to express the idea of pulling the fishing line using the thing we have to turn.
Answer: If I trust Reta Vortaro, the 'reel' is bobenego, and 'to reel' bobeni (though it looks unnatural, because in that case bobeno would seem to me ago bobeni, and vindi actually has the same meaning while bobeni seems to be specifically for a reel). Bobentiri states it right, in my opinion, so, En/Al-bobentiru ĝin could work, eventually.


Gimp dpi changes upon saving work

Question: After I installed the latest version of GIMP 2.10.14 it keeps changing the size of my work the moment I hit save.
To see what what happening I opened a white A4 page and the size was 8.267 x 11.693(inches), 2840 x 3508 pixels at 300dpi. When I hit save as .xcf it then changed size and became 34.444 x 48.722(inches), 2840 x 3508 pixels @ 72dpi.
This is seriously mucking up my work but I have no idea why it's doing it or how to fix it. Any ideas please???
Answer: Known bug, fixed in 2.10.16. If it's a real bother and you can't way for 2.10.16, go back to 2.10.12 (bug is only in 2.10.14).
Note that this bug only changes the "print definition" metadata, there is no impact to the image pixels.

Gimp dpi changes upon saving work


What opinions on what types of bird's nests relate to Moshiach? Is phoenix sourced?

Question: I saw a Rav quote the Zohar as saying Mashiach's soul is in the bird's nest, but then the Rav made a comment, without a source, that it's like a phoenix, the way a phoenix resurrects. However, is there a source for this specifically either that Moshiach is likened to a phoenix, or that his soul is like a phoenix and the bird's nest in question where it is is a phoenix's nest? And what other opinions are there besides a phoenix on the type of birds Moshiach and the bird's nest relate to? I've probably learned most of the more popular opinions before (like the eagle, dove's nest, and so on) so the more unusual or minority the opinions are also welcomed. I always want to learn new teachings I never learned before, although memory refreshers are very worthwhile too. But my greatest interest in this question is a source for the phoenix representation to Moshiach and other opinions I have never learned before, as well as what the phoenix or other bird associations tell us about what Moshiach will be like and accomplish!
Comment: -hits edit -changes title to "have you heard about the bird" -almost hits save -hits cancel :(
Comment: Maybe the midrashical Ziz is related?
Comment: @RabbiKaii Hahaha
Answer: The Zohar does not elaborate on what kind of birds nest it is. See below for what I've found on the concept of Phoenix.
The concept of Moshiach being in the "birds nest" comes from the Zohar (2:7b:5):

בְּהַהוּא זִמְנָא, יִתְּעַר מַלְכָּא מְשִׁיחָא, לְנַפְקָא מִגּוֹ גִּנְתָּא דְּעֵדֶן, מֵהַהוּא אֲתָר (בלק ק''ד ע''ב) דְּאִתְקְרֵי קַ''ן צִפּוֹ''ר, וְיִתְּעָר בְּאַרְעָא (ויקרא רי''ב ב') דְּגָלִיל, וְהַהוּא יוֹמָא דְּיִפּוּק לְתַמָּן, יִתְרָגַּז כָּל עָלְמָא, וְכָל בְּנֵי עָלְמָא מִתְחַבְּאִין גּוֹ מְעַרְתֵי וְטִנָּרֵי, דְּלָא יַחְשְׁבוּן לְאִשְׁתְּזָבָא. וְעַל הַהוּא זִמְנָא כְּתִּיב, (ישעיהו ב׳:י״ט) וּבָאוּ בִּמְעָרוֹת צוּרִים וּבִמְחִלּוֹת עָפָר מִפְּנֵי פַּחַד ה' וּמֵהֲדַר גְּאוֹנוֹ בְּקוּמוֹ לַעֲרוֹץ הָאָרֶץ.
At that time the king, Messiah, will arise to go out of the Garden of
Eden from the place called the 'bird's nest' and he will become
revealed in the land of Galilee. On the day that MESSIAH goes there,
the whole world will tremble and all the people of the world will hide
in the caves and CRACKS in the rocks and will not expect to survive.
And concerning that time, it is written, "And they shall go into the
holes of the rocks, and in the caves of the earth, for fear of Hashem,
and for the glory of His majesty, when He arises to shake the earth
terribly" (Yeshayah 2:19). Translation from here

The birds nest is symbolic and refers to a place within Gan Eden, the Garden of Eden:

לְגוֹ לְגוֹ מִכָּל אִינּוּן הֵיכָלִין, אִית אֲתָר אַחֲרָא טָמִיר וְגָנִיז דְּלָא אִתְיְדַע כְּלָל, וְאִקְרֵי עֵדֶן. וְלֵית מַאן דְּיָכִיל לְמִנְדַּע בֵּיהּ. וּמָשִׁיחַ אַגְנִיז (ס''א יתגלי) לְבַר, סַחֲרָנֵיהּ דְּהַהוּא אֲתָר, עַד דְּאִתְגְלֵי לֵיהּ חַד אֲתָר. דְּאִקְרֵי קַן צִפּוֹר, וְאִיהוּ אֲתָר דְּכָרִיז עָלֵיהּ הַהוּא צִפּוֹר. דְּאִתְּעַר בְּגִנְתָא דְּעֵדֶן בְּכָל יוֹמָא.
Innermost from all these THOUSAND chambers OF PLEASURES, there is one
place concealed and hidden that is entirely unknown, called 'Eden.'
There is no one who can conceive it. Messiah is concealed outside
around that place, until a place called 'bird's nest' is revealed to
him. This place is announced by the bird, which awakens daily in the
Garden of Eden.

The idea of the Zohar is taken from a posuk in Devarim 22:6:

If a bird's nest chance to be before thee in the way in any tree, or on the ground, whether they be young ones, or eggs, and the mother bird sitting upon the young, or upon the eggs, thou shalt not take the mother bird together with the young.

Although it does not completely explain why that place is called a "birds nest", it can shed some light upon it. The Kedushas Levi on Devarim 22:6 explains that there are two kinds of animated awakenings. A spiritual, elevating one, a totally physical one:

Deuteornomy 22,6. "if you chance to come upon a bird's nest, etc.;" it is well known that there are two types of התעוררות, "animated awakenings;" one is a spiritually positive one, an urge to elevate one's spiritual potential; the other is a sometimes overwhelming urge to embrace everything physical.
It is forbidden to use one's spiritual urges in a manner that results in one's leaving one's livelihood and matters connected with it merely to G'd, i.e. to rely on miracles. Instead, one must strive to earn one's livelihood by the work of one's hands, leaving it to G'd to make one's efforts in this direction successful. If one pursues this path it is reasonable to expect that one will be blessed with Divine inspiration at critical times in one's life. G'd is in the habit of adding additional wisdom to those who use their common sense.
Still, as long as the child is very young, it is the mother's task to act as the child's immediate provider, whether by supplying milk from her body or from another source. It is only when a human being has not been equipped with any intelligence at all, that G'd will provide for such a helpless human being who cannot take steps in that direction himself. (emphasis mine)

My pshat is that Moshiach will be conceiled in "the birds nest" until time has arrived. Maybe this can be explained that until Moshiach comes, and "the whole world will be filled with G-ds knowledge", G-d will, as a metaphorical mother-bird, feed us, help us out etc...
Edit: I've found something concerning the phoenix. In Job 29:18, the focus lies on the word "sand", chol:

Then I said, I shall die in my nest, and I shall multiply my days like the sand.

Rashi on this posuk clearly mentions the name "phoenix" as the name of the bird that is called chol:

and I will multiply days as the phoenix Heb. וכחול. This is a bird named חול, phoenix, upon which the punishment of death was not decreed because it did not taste of the Tree of Knowledge, and at the end of one thousand years, it renews itself and returns to its youth.

This idea is echoed by the Malbim Beur Hamilot and by Rabbi Shimon in Bereishis Rabbah 19:5. The Lubavitcher Rebbe said the Phoenix can also refer to the Jewish People, who raised from the Holocaust to a new life.
Comment: Fascinating take, thank you.
Comment: @Shmuel great answer! Do you know if chol is ever used to refer to Moshiach elsewhere? We have a connection between Moshiach and the bird's nest, and we have a connection between the phoenix and chol, do we have any connection between chol and Moshiach or bird's nest?

Off topic but I'd also like to learn, how do you find sources so fast? Just good old Rabbi google or do you have an app or a method that works best? I know you can search terms in sefaria but I'm wondering what the best method with the current technology is to search these things oneself.
Comment: @Shmuel There are some good comments to the chabad article. I wonder if there is a midrash the Rebbe had in mind when he likened the Jewish ppl to the phoenix. A comment says the Beis Hamikdash being burned down and then rebuilt when Mashiach comes also fits. Yes! But, anything that burns and comes back can fit the comparison, I hope for sources that state it specifically.  Here are 2 other good comments, the Sefardim one especially do we know the source?

https://postimg.cc/NKQdVn5S

https://postimg.cc/Mv7s9wK1

The Shabbat one is confusing though, it says we work on Shabbat not rest
Comment: The Rebbe was most possibly referring ot Bereishis Rabbah 19:5 (see bottom of my answer)


Integrating zxing barcode scanner

Question: I want to integrate the zxing barcode scanner into my app. I have followed the steps described here http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/ . But the imported project won't build I receive errors that i should remove the @Override anottation and when I removed it says i should override. So is pretty confusing.The library project has these errors and i don't understand why because i followed the steps just as described in tutorial.
Comment: look into my answer in [this][1]. Its easier way. It may help you.

  [1]: http://stackoverflow.com/questions/8708705/how-to-use-zxing-in-android/8708784#8708784
Answer: It seems you have different JAVA compiler. May be 1.5 or 1.7
Zxing uses 1.6 Java compiler.
try this

Right click on project
Properties > Java Compiler > Enable Project specific Settings (Check it)
In front of "compiler compliances level" chose 1.6
Clean the project
and run again
Answer: You can download the ZXing Barcode code Scanner code from here.
Navigate to android folder for Android Zxing Scanner source.. After you import the Android Project , some Class file will be shows as missing you will get if you navigate to
<code>core ->src->com->google->Zxing
</code>

Integrating zxing barcode scanner


Bootstrap inference after multiple imputation

Question: What is the proper way to calculate bootstrap regression coefficients CI after MI? I mean is using a pooled bootstrap SE over imputed data sets with a pooled estimate of bootstrap regression coefficient across MI data sets better or using list of bootstrap SE and regression coefficients estimates for each MI data sets? The former approach gives one CI while later gives a list of CI for each MI data set.
Comment: Can you specify what CI, MI and SE stand for?
Comment: CI for confidence interval ,MI for multiple imputation and SE is standered error
Comment: @humera: See [here](https://stats.stackexchange.com/help/merging-accounts) for information on how to merge your accounts, & then you'll be able to edit your question.
Answer: I suggest looking at this recently published paper by Schomaker and Heumann, 'Bootstrap inference when using multiple imputation'. The published version in Statistics in Medicine is here. A freely accessible pre-print version on arXiv is here. Some comments I made on the arXiv version before it was published and discussion with the authors can be found here.
A somewhat different approach using bootstrapping with multiple imputation was described by von Hippel in this arXiv paper.
I recently published a paper which investigates a number of different ways of combining bootstrap and multiple imputation, and in particular how the order in which you do things affects validity when the imputation and analysis models are so called 'uncongenial' or misspecified.
Comment: Thanks Jonathan for comment. Actually i am following your R code that you  have  posted in discussion with the author of article u have mentioned. Can you extend your  code further and described how  to find bootstrap regression coefficients CI after MI?


Extracting metadata info of cardano tokens

Question: I am currently working with cardano-db-sync and I am doing research to extract the metadata of all the native tokens. I found out the policy id and asset name can be extracted from cardano-db-sync but the remaining metadata info should be queried from the metadata server. I am not able to find anything useful related to metadata server. I mean to say what metadata server should I use or setup?
Answer: The current off-chain metadata registry is hosted by the Cardano Foundation.
Their endpoint is https://tokens.cardano.org/metadata and you can find the registry itself along with the documentation hosted on github.com.
Right now, the software does not support setting up a mirror of the current registry, which might be annoying as their rate-limiting is pretty strict. At Blockforst, we have developed a tool to convert the current registry files to the output you are expecting - it is called metadada and is open source.
Comment: Thank you for your reply but i was trying to get the onchain metadata and i don't seem to get it from cardano dbsync. I need to fetch every data and stored it in a table.
Comment: In that case, you might refer to the NFT metadata according to CIP-25? If that is the case, your question is misleading as it talks about the metadata server for native assets , which is what I described in my answer. You might want to submit another question if it is about an SQL query in cardano-db-sync.


Is there a word similar to "in depth" but for width (in width)?

Question: For instance, there are different aspects of a topic. When you study "in width", you try to understand these different aspects just enough. Then, you may want to study one aspect in depth to fully understand this aspect. Is there a word with the "in width" meaning?
Answer: From WordNet (r) 3.0 (2006):
<code>  breadth
      n 1: the capacity to understand a broad range of topics; "a
           teacher must have a breadth of knowledge of the subject";
           "a man distinguished by the largeness and scope of his
           views" [syn: {breadth}, {comprehensiveness}, {largeness}]
      2: the extent of something from side to side [syn: {width},
         {breadth}]
</code>
Answer: There's an idiom that refers to broad but shallow knowledge of a subject: a mile wide, an inch deep.
For example, if you can say "Thanks" in 15 different languages, your knowledge is broad, but it's "an inch deep".
Perhaps in your case you could say something along the lines of:

I covered all these topics a mile wide and an inch deep. But I have studied some aspects in depth.


Calculated field formula to create an incremental number

Question: Hoping this will be easy. I'm starting at 900 at need a field to go up one when an item is added to a list. Is there a simple formula to achieve this?
Thanks in advance
Comment: Are you using SharePoint Online/Office 365?
Answer: A workflow would be needed to take a number that you have and add 1 to it.
Here is an article I found that may help. http://gihanmaduranga.blogspot.com/2012/09/create-auto-increment-number-column-in.html or this http://www.sharepointdiary.com/2014/11/create-autonumber-column-in-sharepoint-list.html
Answer: I'll second Chris G that a workflow makes the most sense, however in the interest of variety you might be able to get away with using a calculated column based on the list ID number. Say the first item in the list is the one you want to be 900, you could calculate the column as ID (1) + 899. Then ID 2 (+899) would be 901, and so on.
Where this would run into problems is when you delete items from the list, it would create non-sequential items. SharePoint does not reuse ID numbers, so if you deleted ID 2 this column would go from 900 to 902 without a 901. A workflow could add logic to account for item deletion.
Answer: You can use default ID field which is auto incremental and add 900. If you are on SharePoint online, it would be easier to use Flow. You can hide the field so user don't see this in the new/edit form if needed.   I have added the following expression in the MyID2 field.
<code>add(triggerBody()?['ID'],900)
</code>


Set background color without effecting scene colors

Question: When changing the background from it's default value to gray (0.5,0.5,0.5) I saw that the other object colors were effected (been brighter).
I must say that I didn't use nodes to change the background color.
What is the way to do it using python script?
I want the background and the plane to have the same color this way the scene will look like endless horizon but without effecting the colors of the current objects.
Comment: You can use a transparent background for the render and add the color in the compositor.
Comment: @rjg thank you for helping. can you read again the question I have added clearer description of the problem with an example.
Answer: As mentioned by @rjg, you will need to add the color in compositor. The reason, why the colors of other objects change, when you change background color is beacause the way light works. (And the fact that background is not just a color).
Now the way how to achieve what @rjg has mentioned is following.
Go to Propetries panel > Render > Film and tick the Transparent box.
Go to Compositor (Compositing workspace), tick Use nodes, add a Mix node and route RenderLayers Image output into the bottom Image input of Mix node and Alpha otput of RenderLayers into Fac input of Mix node. Set the desired color of the background on the first Image input of Mix node and finally route the output of Mix node to Image input of Composite node.

You can precisely set the color of the background by checking the color of a rendered image (right click on rendered image to see RGB values), or kind-of automatically (below).

You will notice the border line, where the plane ends, which is probably undesired and can be fixed by further utilization of the Compositor.
In the compositor you will need to apply a Feather (Dilatate/Erode - mode: Feather) filter to the alpha channel, before plugging it into the Mix node.

Feel free to adjust the Distance value (Note that it can be both positive and negative).
Here is a visualisation of what the Feather filter does to the alpha channel:

And the result:

Now each time you render, the background will be this color. Note however that the color of the plane might change if you add a light source or even an object (again due to the way light works).
Now for the last question, how to do this in python (I assume to automate this).
You could actually do this in python so that python script sets the color.
You would need to look at the rendered image, the way is described here, and determine what the background color is, then set the color on the Mix node to that value.
You can get very close to this behavior without using Python with this node setup:

You basically use the Translate node to move the pixel of the image, that you want to grab the background color from, to the middle of the screen. Then you scale the image by large amount (so that the whole image is made up of this one pixel) and you plug that into the first Image input of the Mix node.
Now the background color will adjust automatically.
Edit:
I found a way to setup the whole thing with Python and was eager to try it out, so here is the code.
import bpy

#select the point in pixels from which the background color will be selected
#note that it is not necessarily exact so it may be about +-4px (too lazy to do the math correctly)
target_x = 20
target_y = 50

render_p = bpy.context.scene.render.resolution_percentage/100.0
render_w = bpy.context.scene.render.resolution_x * render_p
render_h = bpy.context.scene.render.resolution_y * render_p

bpy.context.scene.render.film_transparent = True

#bpy.ops.node.add_node(type="CompositorNodeMixRGB", use_transform=True)
#bpy.ops.node.translate_attach_remove_on_cancel(TRANSFORM_OT_translate={"value":(-121.875, 273.423, 0), "orient_type":'GLOBAL', "orient_matrix":((1, 0, 0), (0, 1, 0), (0, 0, 1)), "orient_matrix_type":'GLOBAL', "constraint_axis":(False, False, False), "mirror":True, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":True, "release_confirm":True, "use_accurate":False}, NODE_OT_attach={}, NODE_OT_insert_offset={})

# switch on nodes and get reference
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree

# clear default nodes
for node in tree.nodes:
    tree.nodes.remove(node)

# create input image node
in_node = tree.nodes.new(type='CompositorNodeRLayers')
in_node.location = -400,0

#create mix node
mix_node = tree.nodes.new(type='CompositorNodeMixRGB')
mix_node.location = 400,0

#create alpha filter node
af_node = tree.nodes.new(type='CompositorNodeDilateErode')
af_node.mode = 'FEATHER'
af_node.distance = -50
af_node.location = 0,-200

#create translate node
t_node = tree.nodes.new(type='CompositorNodeTranslate')
t_node.inputs[1].default_value = render_w/2 - target_x
t_node.inputs[2].default_value = render_h/2 - target_y
t_node.location = 0,200

#create viewer
v_node = tree.nodes.new(type='CompositorNodeViewer')
v_node.location = 200,400

#create scale node
s_node = tree.nodes.new(type='CompositorNodeScale')
s_node.inputs[1].default_value = render_w
s_node.inputs[2].default_value = render_h
s_node.location = 200,200

# create output node
out_node = tree.nodes.new('CompositorNodeComposite')
out_node.location = 800,0

# link nodes
tree.links.new(in_node.outputs[0], mix_node.inputs[2])
tree.links.new(mix_node.outputs[0], out_node.inputs[0])
tree.links.new(in_node.outputs[1], af_node.inputs[0])
tree.links.new(af_node.outputs[0], mix_node.inputs[0])
tree.links.new(in_node.outputs[0], t_node.inputs[0])
tree.links.new(t_node.outputs[0], s_node.inputs[0])
tree.links.new(s_node.outputs[0], mix_node.inputs[1])
tree.links.new(t_node.outputs[0], v_node.inputs[0])

target_x and target_y is used to select the pixel from which a color for the background is picked. It isn't necessarily pixel precise so choose a general area.
I have also added a Viewer node. If you click it in the Compositor (and you have backdrop enabled and you have rendered the image already) you will see a cross on the screen, pointing to the selected pixel in the backdrop. At this moment, you can adjust the Translate parameters manually to select a different pixel (Alt+V and V to zoom the backdrop in and out).

So just paste the script into Blender and run it.
A tip: If you are having a problem with anything, it never hurts to try things on a new blank file and get a feel for how a thing behaves. When you encounter problem in your file then, you will notice the moment when it went wrong with more ease and find solutions faster.
Comment: Thank you very much for your response! this indeed look good (although I thought the solution would be easier). How can it be done using script?
Comment: I followed your steps using blender's UI but when I entered the composition tab and added the Render layers I didn't see the image of the scene as in your example but I kept going and nothing happend the background stull was the default checkerboard
Comment: When you go to Composition and tick **Use nodes** a basic node setup (Render Layers going into Composite) should appear. Then it's just adding things in between. It is easier to start small - first the mix node with Factor set to 1 and then build up. If you copied the final setup and the Translate node landed you on a transparent pixel, then the behavior is weird.
Comment: I have edited the answer to include Python script to set it all up, but have a look at the answer by @kremlas - it is actually smart and so simple.
Comment: I will try it out and let you know thanks! BTW, if I have a moving camera won't it be a problem? since I see some of the parameters are hard coded specially traget_x/y.
Comment: Well the x, y coordinate can be animated afterwards, but you could probably use a static color. Using answer by @kremlas will probably avoid all hassle.
Answer: If you don't mind me coming up with a 'somehow dirty' solution, I had to deal with the same situation a while back and this is what I used:
Basically every time you change the background color it also changes the global or ambient illumination of the scene (as was mentioned before). One of the solutions sure is to compose it later in the compositor, but I came with an idea (or maybe I've read or seen it somewhere and just passing it along) to divide illumination between foreground and background in the scene itself. In the node editor set your world nodes like this:

The shader above divides the background into two parts - the part that is shown in the viewport and the part that illuminates the foreground (the reason why this works is because the background would illuminate only the parts of objects that are not seen at that precise moment).
That way you can use two different colors or pictures to create and illuminate the scene (notice different colors on the World properties).

I must admit, though, that I haven't tested it with transparency/translucency, in which way the results may differ and would have to be tweaked. But this should work for your scenario as I believe you are working with solid materials. Anyway, thought I would chip in with my two cents.
Cheers,
Martin


Why does URDF use Euler angle to represent rotation?

Question: To describe the rotation between tow links, why does URDF use Euler Angle instead of quaternion or axis-angle to describe the rotation? Since there might be singularity issue or gimbal lock in the Euler Angle rotation.
Answer: Using Euler angles in URDF to represent rotation between two links primarily serves readability and simplicity in defining link connections in the robot's structure. Euler angles, despite their known issues such as singularities and the potential for gimbal lock, offer an intuitive and straightforward method for humans to understand and specify the orientation of robotic links in 3D.
In operational contexts, such as during motion planning, it's common to use more computationally robust rotation representations like quaternions and rotation matrices from TF2 and its utilities. These representations avoid the problems in Euler angles representation and are better suited for handling interpolations and complex/consecutive orientation calculations. Also, conversion between those representations is safer than conversion from Euler angles (when its singularities really show up in robotics).
I mean that each representation has its own advantages. It makes sense to use Euler angles for the static description of a robot URDF because we can imagine it. Then, at the time when objects move/rotate dynamically in space, we leverage quaternion and rotation matrices to represent frame orientations.
Comment: I see! Thank you for answering my question!!
Answer: Euler angles are easier and more intuitive as a human input and the singularity/gimbal lock issues aren't really a concern for static rigid transforms.
It would be an issue for a moving joint with a 3-degree-of-freedom rotation, like if you had a spherical ball joint or free-floating joint that was actuated. I don't think URDF supports spherical joints at all. It does support a floating 6DOF joint. If that were actuated and controlled then gimbal lock could be an issue, but resolution of that would be delegated to whatever library controls the joint and provides the interfaces to the user.
Libraries that do support actuated control of such joints do use quaternions or similar under the hood. See, for example:
https://rbdl.github.io/df/dbe/joint_description.html#joint_singularities
Comment: I see! Thank you for answering my question!!


How to install an older version of php (5.2.17) in Linux?

Question: I want to study some security vulnerabilities in php 5.2.17, but I can't install it from source, because then I need also all the older versions of all the other application which have something to do with php. How I can install an older version of php in the easiest way? For example in a virtual machine which is compatible with that?
Comment: Install an older OS that still has that version available for it or build it yourself.  I'm not sure what you mean about needing to install all the older versions when building from source because that's precisely what you're going to have to do if you try to force a package install of an old version.
Comment: you can compile php-5.2.17 from source and use it as cgi on any modern distro.
Answer: apt-cache policy php5 will show you the available versions on Debian systems.  Then you can install with apt-get install -y php5=whatever_version.
On Fedora deriviatives you can use yum --showduplicates list php does the same and you can install a specific version using yum install -y php-whatever_version
If the version you need is not available after running the first command then you need to find and add the repositories that contain the version you are looking for and try again.
After adding a software repository, make sure you do:
apt-get update (Debian)
or
yum check-update (Fedora_ to update your local package lists or your new software may not show up in the package lists still.
Thanks.
Comment: Here is link how to use two version of php on same ubuntu. http://askubuntu.com/questions/50344/how-to-have-two-version-of-php-installed-and-switch-easily
Another option is to use of Docker container instead of a virtual machine.
https://hub.docker.com/r/tommylau/php-5.2/
Comment: If you are running Ubuntu and want to use a container there is literally no reason to set up Docker since LXD is native now unless you just want to play with Docker.
Answer: Create a virtual machine with virtualbox or VmWare Workstation (paid) and download an older version of CentOS 5 then download PHP 5.2.17
and install it normally .


Can I use a 100AH battery instead of a 74AH battery in my Passat 2.0TDI, 2012

Question: I want to use a 100AH battery instead of a 74 AH battery in my car
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: Yes, you can use a 100AH battery in place of the 74AH battery as long as it fits in the physical location and the post location is in the same orientation. Most batteries which have more energy store are physically bigger than their weaker brother. This is because to store more energy, you have to have more space (in most cases). Double check to ensure there's no issues there and you should be golden. Having more energy reserve will cause absolutely no issues with vehicle or the electronics of the vehicle.


Proving that a union of countably infinite sets is countably infinite

Question: I am solving Real Analysis over the summer, and this is an exercise in the preliminaries. I need to start off with 2 countably infinite sets and prove that their union is countably infinite as well. I was hoping for some help with this. The book advises to replace the second set, $A_2$, with $B$, where $B=A_2$ \ $A_1$ since $A_1 \cup B$ = $A_1 \cup A_2$ but $A_1$ and $B$ are disjoint, which makes things easier. Can I just map all the odd elements to $\frac{n-1}{2}$ and even elements to $-\frac{n}{2}$? What if the members of the set aren't numbers but some objects, yet there are countably infinitely many of them? Thanks!
Comment: @Asaf: Could you elaborate on why, please? What if $A_1$ and $A_2$ are initially not disjoint, and after that operation both of them have the element {0, 1}, for example?
Comment: $A_1'$ and $A_2'$ contain *only* ordered pairs, and an ordered pair is equal to another if and only if both the coordinates are equal; since all the pairs in $A_1'$ start with $0$ and all the pairs in $A_2'$ start with $1$ they cannot share any ordered pair and therefore disjoint.
Comment: @Asaf: Hmm, but why do they start with 1? Did you mean to write $\{1\} \times A_2$?
Comment: Yes, I did intend to write that. I had to delete and rewrite my comment once. I guess it is time to do that again :-)
Comment: Since answers were given, I will only add a small comment about turning sets into disjoint sets: Take $A_1'=\{0\}×A_1$ and $A_2'=\{1\}×A_2$. It is easy to prove that $A_1'\cap A_2'=\varnothing$.
Answer: Even if the members aren't numbers, since the sets are assumed to be countable infinite, you can essentially label them with natural numbers. Here's how I would go about it. Let $X$ and $Y$ be disjoint, countably infinite sets. (You can prove to yourself that such sets exist.)
Now $X\sim\omega$ and $Y\sim\omega$, so there exist bijections $f\colon X\to\omega$ and $g\colon Y\to\omega$. You can define a new map $\pi\colon X\cup Y\to\omega$ by
$$
\pi(x)=
\begin{cases}
2f(x) &\text{if } x\in X\\
2g(x)+1 &\text{if } x\in Y
\end{cases}
$$
which is well defined since $X\cap Y=\emptyset$. But $\pi$ is injective, since no natural number is both even and odd. So $X\cup Y$ is in bijection with an infinite subset of $\omega$, namely the image of $\pi$, and is thus countably infinite. You can adapt this idea to sets that aren't disjoint with what you mention in your question.
Answer: The tip in the book is actually very good. We can assume that $A_1$ and $A_2$ are disjoint because otherwose, we can replace $A_2$ by $A_2\setminus A_1$: If $A_2$ becomes finite this way, we are done already. Otherwise, all conditions are the same and we have gained the additional assumption that the sets are disjoint. And then, your proof works fine, here is my version of it:
Let $E:=2\mathbb{N}={\,n\in\mathbb{N}\,\mid\,\exists k\in\mathbb{N}: n=2k\,}$  the set of even numbers and $O=\mathbb{N}\setminus E$. Since $\mathbb{N}\cong E$ by $n\mapsto 2n$ and $\mathbb{N}\cong O$ by $n\mapsto 2n+1$, you can find bijections $A_1\cong E$ and $A_2\cong O$. Hence, there is a bijection $A_1\cup A_2\cong E\cup O = \mathbb{N}$.


Absolute path from window handle

Question: I open a file in windows word and get a handle to the window. Can I get the absolute path of the file (the actual .doc file, not the winword.exe)?
Thanks a lot
Answer: You certainly won't be able to do this direct from the Windows API (where a program's document is stored and how it is manageded is not controlled / constrained by the Windows API)...
What you might be able to do is use the Word libraries to iterate through open documents and look for the document with a matching handle, but I doubt this will be simple - I'm not even sure if it will be possible...
Martin.

Absolute path from window handle