Why should we expect the connection between complex arithmetic and geometry?

Question: I realized that I take it for granted that properties of complex numbers have clear geometric interpretations. Visualizing complex numbers with the help of the complex plane really helps to understand complex arithmetic better and those mysterious properties of holomorphic functions (conformality, Maximum-Modulus Theorem, Argument Principle to name a few) make perfect sense once one knows that complex multiplication is simply a rotation and scaling. But lately I have been asking myself why there should be a connection between complex arithmetic and geometry at all? Of course there is nothing stopping us from interpreting these numbers as points in the plane (after all they are pairs of real numbers) but I am still bewildered by the fact that once we think of them this way, everything else related to complex numbers seems to find a perfect geometrical explanation! For example without a geometrical picture, the only way to understand complex multiplication is the distributive law. But the geometrical interpretation of complex multiplication turns out to be much more elegant and it is almost like it was always meant to be thought of that way. I am really curious to hear your thoughts about this.
Comment: Historically this was not the case. There were different attempts to geometrically visualize complex numbers when they were first being studied.
Comment: On the other hand, open unit disk (or any half plane) is a model for the hyperbolic geometry, plane has the Euclidean geometry, and the Riemann sphere (one point cmpactification of the plane) models the spherical geometry. Hence complex plane is naturally very very geometric. This is basically why we see conformality and Mobius transformations.
Comment: You may enjoy [this video](https://www.youtube.com/watch?v=mvmuCPvRoWQa) on $e^{i\pi}$ in terms of group theory
Comment: A part form these relations on the surface, Cauchy's integral formula is the Stokes' theorem on the plane (domain of a holomorphic function) and it connect to holomorphic/meromorphic functions with (co)homology. For example, one can think of residue theorem as computing de Rham cohomology of a punctured disk. Analytic continuation and Riemann surfaces as construction of the (universal) covering space etc.
Comment: In the elementary level, a complex number has Cartesian, polar, exponential, matrix and polynomial representations (I bet you can add more in to this list). Hence blend algebra and geometry together. By the Cauchy completeness of the plane, it has a nice theory of analysis as well.
Comment: The complex numbers appear naturally in the 2D geometric algebra, just as the quaternions appear naturally in the 3D geometric algebra. See my answer [here](https://math.stackexchange.com/a/3245650/472818).
Answer: We can start way earlier to get a geometric interpretation, at the real numbers. Multiplication by a real number is a combination of scaling and mirroring. Multiplying by a a positive number is scaling the real line, multiplying by $-1$ is mirroring it at the origin. On an abstract level, a core feature of mirroring is that doing it twice returns the original picture. This gives rise to the interpretation that multiplication by $-1$ is a mirroring, since $(-1)^2=1$, so multiplying by $-1$ twice is the identity.
The complex numbers give rise to a similar interpretation. We can still view multiplication by $-1$ as mirroring the plane at the origin, but in a 2d context, we can also see it as a $180^\circ$ rotation. They are really the same. But we also get a new element, $\mathrm i$. Its basic feature is that $\mathrm i^2=-1$, that is, multiplying by $\mathrm i$ twice is rotation by $180^\circ$. But that's also a core feature of rotation by $90^\circ$: rotating by that amount twice is the same as rotating by $180^\circ$ once. So that's a good hint that complex multiplication can have something to do with rotations. We just need to find a fitting topology (a scalar product to describe angles, most importantly) which makes multiplication by $\mathrm i$ an actual $90^\circ$ rotation. And it turns out that the scalar product wrt which $1$ and $\mathrm i$ form an orthonormal basis does just that. So it's a good idea to choose those as a basis of $\mathbb C$ as a real vector space, making them span the coordinate axes. In this picture, multiplication by $\mathrm i$ will be guaranteed to be a $90^\circ$ rotation. And using some algebra, all other complex multiplications can then be shown to also be rotations and scalings.
Comment: Indeed, this is Viewpoint 2 in [this post](https://math.stackexchange.com/a/1847519/21820) regarding real multiplication.
Answer: From the point of view of group theory there is a deep reason : the group of similitudes ( ratio-of-lengths preserving maps) of a (Euclidean) plane is isomorphic to  the group of affine (or anti-affine) transformation of a complex line $(z\to az+b$ or $z\to a \bar z+b$). This (exceptional) isomorphism enables us to do geometry by using complex numbers.
This is even more clear if we go to the projective line (the Riemann Sphere). The group of projective transformations of a projective line $PGL(2,C)$ is isomorphic to Möbius group of conformal maps of a sphere $PSO(3,1)$.
Comment: I would not yet call that a reason but just a deeper level of the phenomenon. The reason would be why the group of similitudes is isomorphic to the group of affine transformations.
Comment: From this point of view you can argue that it is all just shades of the exceptional Lie isomorphisms. Forexample, the projective Quaternionic line has transformation group PSL(2,H) isomorphic to the mobius group PSO(5,1). Picking a neutral signature Hermitian form on H^2 then gives you "SU*(2)" and PSO(4,1). Thus we have the conformal geometry of S^4 and S^3
Comment: If you accept that group=geometry, you accept that if two geometries are the same, this is because the two groups are the same...
Answer: You can arrive at complex arithmetic from geometric intuition if you start with transformations of the plane.
It is well known that matrices which preserve angles (i.e. map shapes to similar shapes) and orientation are of the form $cR(\theta)$, where $c$ is a positive number and $R(\theta)$ is a rotation matrix. That is,
$$cR(\theta) = c\pmatrix{\cos \theta & -\sin \theta\\ \sin \theta & \cos \theta}. $$
Since $c$ and $\theta$ are arbitrary, these are all matrices of the form $$\pmatrix{a  & -b \\ b & a}$$ for $a, b \in \mathbb R$ (except for the null matrix).
Now, after adjoining the null matrix, this set becomes a vector space of dimension two, closed under matrix multiplication, and where all non-null elements have a multiplicative inverse ($c^{-1} R(-\theta)$).
The interesting part is that we can choose a basis like this:
$$ \pmatrix{a  & -b \\ b & a} = a \pmatrix{1  & 0 \\ 0 & 1} + b \pmatrix{0  & -1 \\ 1 & 0} = a I + b J,$$ where $I$ is the identity matrix and $J=\pmatrix{0  & -1 \\ 1 & 0}$ is a matrix which, under matrix multiplication, has the property $J^2=-I$. That is, it is in some sense the "square root" of $-I$. It also represents rotation in 90º (like the complex $i$ does). Indeed: $J = R(\pi/2)$ and, as expected, $J e_1 = e_2$ and $J e_2 = -e_1$.
Moreover, if you work out the product rule, it is exactly the one that arises in complex numbers:
$$ \pmatrix{a  & -b \\ b & a} \cdot \pmatrix{c  & -d \\ d & c} \\ = \pmatrix{ac-bd  & -(ad+bc) \\ ad+bc & ac-bd} \\ = (ac-bd)I + (ad+bc)J.$$
Furthermore, we can define subtraction, division, and all arithmetic operations for them in a way parallel to how they are defined for complex numbers.
Finally, add to this that the subspace generated by $I$ is an algebraic copy of $\mathbb R$, so you can view the full space as an extension of $\mathbb R$.
To sum up

Angle and orientation preserving linear transformations carry great geometric meaning (similarity).
They form a two-dimensional space, which you can think of as an algebraically compatible extension of $\mathbb R$.
They have two components, one in the direction of the identity/unit and one in the direction of a $\pi/2$ rotation.
This space can be constructed from $\mathbb R$ just by adjoining an outside element $J$ such that $J^2$ is minus the identity (and extending the usual algebraic rules).
This is essentially the same recipe as the one for constructing the complex numbers.
Comment: What I understand is that any nonzero complex number corresponds to a transformation composed of a scaling and a rotation. (I knew of this and like it.) Thus the product of two complex numbers $z_1z_2$ corresponds to the composition of two such transformations. What I don't understand is what geometric operation the sum of two complex numbers represents: $z_1+z_2$ corresponds to the sum of the transformation matrices but is itself a new scaling-rotation constructed from two other ones. Algebraically we can add the matrices, but is there a geometric construction of the sum?


Layered navigation not working with search results?

Question: a little help if possible, please.
I cannot get layered navigation working with search results i.e. no filters?
Works perfectly when browsing the website with all filters showing the correct results etc...
I checked through the settings including the obvious "Use in search results layered navigation" which is set to "Yes" for all appropriate attributes.
Any ideas???
Magento 2.4.3 | Amasty Improved layered Navigation and several others from Amasty.
Comment: Could anyone suggest how to fault find a problem like this? I assume something is blocking the filters being diplayed and would like some advice on where to look?
Answer: A couple of months ago I had the same issue. Make sure that default search is set to Elastic search (I used Sphinx which caused the issue).
If you are on a development server you might also consider disabling Amasty Improved layered Navigation and see if layered navigation works with search results.
Comment: Thank you for the info. I have tried disabling the Amasty module but sadly it made no difference. Regarding the Elastic search setting, that is interesting? I currently use Amasty Elastic search but could try switching it back to normal?
Comment: No dice with the Elastic Search settings either :(
Answer: Set Enable Ajax to No in Amasty - Improved Layered Navigation extension.
https://nimb.ws/QB4RpO
If you are using Porto Theme then disable Mageplaza Ajax & Mageplaza Layered Navigation extension.


Lost fform design view in MS express 2010

Question: Working on a windows forms project in MS C++ express 2010. It builds fully with no errors, runs correctly as a forms based application but in the solution explorer the icon for form1.h shows it as a header file - with the h icon, rather than with the form icon. The only answer I can come up with is I've changed/deleted something while trying to solve another problem - but what - I need to add more buttons!
Answer: ymptom - no form icon next to .h file in solution explorer even though Express had created the file.
Somewhere, some how, I must have clicked on come setting/option/switch/something that caused Express to change the catagory fo the file.
The fix was found by looking in the vcxproj file. For somereason the following code was
<ClInclude Include="Form1.h" />

rather than
<ClInclude Include="Form1.h">
  <FileType>CppForm</FileType>
</ClInclude>

How that change happened is a mystery! any suggestions of what caused that would be much appreciated!


What is the best EXIF library for .Net?

Question: I am looking for simple straightforward solution for accessing EXIF information of jpeg images in .Net.  Does anybody has experience with this?
Answer: If you're willing to use an open-source library, may I humbly suggest one of my own creation?
The metadata-extractor project has been alive and well since 2002 for Java, and is now available for .NET.

Open source (Apache 2.0)
Heavily tested and widely used
Supports many image types (JPEG, TIFF, PNG, WebP, GIF, BMP, ICO, PCX...)
Supports many metadata types (Exif, IPTC, XMP, JFIF, ...)
Supports many manufacturer-specific fields (Canon, Nikon, ...)
Very fast (fully processes ~400 images totalling 1.33GB in ~3 seconds) with low memory consumption
Builds for .NET 3.5, .NET 4.0+ and PCL

It's available via NuGet or GitHub.
Sample usage:
IEnumerable<Directory> directories = ImageMetadataReader.ReadMetadata(path);

foreach (var directory in directories)
foreach (var tag in directory.Tags)
    Console.WriteLine($"{directory.Name} - {tag.TagName} = {tag.Description}");

Answer: If you're compiling against v3 of the Framework (or later), then you can load the images using the BitmapSource class, which exposes the EXIF metadata through the Metadata property
Answer: A new and very fast library is ExifLib - A Fast Exif Data Extractor for .NET 2.0 by Simon McKenzie. I ended up using this one and the code is easy to use and understand. I used it for an app to rename according to the date taken. I wonder how many times such an app has been written.
My tip: Make sure to call Dispose on the ExifReader objects once you've finished with them or the files remain open.
Comment: It doesn't support raw files! only works with JPG !
Comment: Since its latest version seems to be from 2015 (see [on nuget.org](https://www.nuget.org/packages/ExifLib)), version 1.7 only supports EXIF 2.3, none later.
Answer: I like Atalasoft's DotImage Photo, but its a closed source solution and costs about 600 per dev license.
You can also check out DTools at Codeplex, which is an open source framework designed to supplement the standard Fx.  It includes some Exif related classes.
Answer: the one I have saved in feeddemon for me to check out more when I have time (when is that for a programmer? LOL) is below
ExifTagCollection - EXIF Metadata extraction library
Mike
Answer: Check out this metadata extractor. It is written in Java but has also been ported to C#. I have used the Java version to write a small utility to rename my jpeg files based on the date and model tags. Very easy to use.
Comment: Cheers Dave. I've now [ported this library to .NET](http://stackoverflow.com/a/31329551/24874).
Answer: Several years ago, I started a little JPEG EXIF app with Omar Shahine to work on JPEG EXIF files, called JpegHammer.
He extracted from that project a library and called it PhotoLibrary, it was an easy .NET wrapper for the EXIF 2.2 tags. Unfortunately, the GotDotNet site is gone, CodePlex doesn't have it, Omar's web site links don't work, and I don't have a copy anymore.
But, if you can dig around Google, maybe you'll find it and it'll do the trick for you.

What is the best EXIF library for .Net?


Rishonim/Achronim time period differentiation

Question: When was the end of the Rishonim time period and the start of the achronim time period? Who, what, why, and how did this come about? What caused this abrupt change in deemed mental and halachot significance/intelligence?
Comment: Why do you assume anything changed abruptly?
Comment: Duplicate of (part of) http://judaism.stackexchange.com/q/31574? (Pinging @DoubleAA just because you're pingable.)
Comment: I've heard two answers but I have never heard any sources for them: The Inquisition and the Shulchan Aruch
Comment: The [European Enlightenment](http://en.wikipedia.org/wiki/Age_of_Enlightenment); see also [Baruch Spinoza](http://en.wikipedia.org/wiki/Baruch_Spinoza).
Answer: RISHONIM
In Seder HaDoros HaKotzair by Rabbi Shlomo Benizri (starting p.135) he dates the period of Rishonim from 1040-1515 and writes as follows:

לאחר שקיעת הגאונים בבבל, גלגלה ההשגחה שגדולי התורה יעברו למקומות נוספים בעולם ששם לא היו גדולי תורה בעלי שעור קומה שיוכלו לפתח את התורה ביתר שאת
הגאונים שחיו אז בבבל סבלו רבות מהפרסים שנטלו את ממונם ובטלום מלימודם. חלק מהם יצאו בספינות אל ארצות שונות לערוך מגביות עבור הכנסת כלה וכדומה
בשנת 4723 (962 לספה"נ) מספר גאונים מבבל, הפליגו להם בספינה אחת למטרת הכנסת כלה כשבראשם היה רבי משה בר חנוך. ספינה זו נפלה בידי שודדים שלקחו את השבויים והציגום בפני קהילות ישראל במקומות שוניםם, במטרה שיפדו אותם
After the fall of the Geonim in Babylon, providence beckoned that the Torah greats would move to other places in the world where there were no Torah greats of equal stature who could develop the Torah even more.
The Geonim who lived then in Babylon suffered a lot from the Persians who took away their money and deprived them of their studies. Some of them went on ships to different countries to make donations for the bridegroom and the like.
In the year 4723 (962 CE), a number of Geonim from Babylon sailed for them in one ship for the purpose of hachnosas kallah, led by Rabbi Moshe bar Chanoch. This ship fell into the hands of bandits who took the captives and presented them to the communities of Israel in various places, with the aim of redeeming them.

He writes the four captives were:

Rabbi Moshe bar Chanoch
Rabbi Chushiel ben Rav Elchonon
Rabbi Shemariah ben Rav Elchonon
Not named

What followed was the proliferation of new Torah centres.
He continues that the Torah centers of the Rishonim were mainly: Spain, Germany, France, Provence and Italy. The period of the Rishonim began after the fall of the Geonim in Babylon (actually with the death of Rav Hai Gaon), and the transfer of Torah centres to the rest of the world and especially to Spain.
The first were scattered in all the lands of the Diaspora. They were called so by the latter to distinguish them from the Geonim. Like their predecessors, they often wrote interpretations/explanation, halachos, responsa, and chiddushim but in greater number than the Geonic period.
The period of the Rishonim, from the spiritual point of view, was one of the periods of great splendour for the Jewish people, during this period great works were composed such as Rashi's Commentary, Ibn Ezra, Rambam, Tosafos, Radak, Ramban, Rashba, Ralbag, Rosh, Ran, Maharil, the Terumas Hadeshen, and many more who in the course of time became fundamental to Jewish learning. But compared to the spiritual aspect, this was one of the most difficult periods in which the Jewish people suffered many losses in atrocities, crusades, and bloodshed, burning the Talmud, expelling them and pogroms etc.

ACHARONIM
Starting on p.166 Rav Benizri details the period of the Acharonim.
He writes that the Acharonim were scattered throughout the diaspora and unfortunately are still scattered today. They also wrote many books of halacha, mussar and more in great volume. The period of the acharonim began after the expulsion from Spain. Until the time of the expulsion, there lived in Spain a large community numbering hundreds of thousands of Jews, which flourished and prospered both spiritually and physically. The centers of Torah were in this country, but following the Expulsion of Jews from Spain that took place in 1492CE, in which thousands were killed, the majority of the Jews of Spain emigrated to other countries, with 60% of them emigrating to Portugal and the rest scattered around the world.
He writes:

דבר זה הביא לפתיחת מרכזי - תורה חדשים בכל רחבי העולם ולהפצת התורה בכל רחבי תבל. לאחר גירוש ספרד, הסתיימה תקופת הראשונים והחלה תקופת האחרונים.
This led to the opening of new Torah centers all over the world and the spread of the Torah all over the world. After the expulsion from Spain, the period of the Rishonim ended and the period of the Acharonim began.

more to follow...
Comment: I am just quoting from the sefer which has haskomos from Rav Ovadia Yosef and Rav Reuven Elbaz...
Comment: The (hi)story of the four captives is from [R. Abhraham ibn Daud ha-Lewi](https://plato.stanford.edu/entries/abraham-daud/) in his Sefer ha-Qaballah (starting p. 45 in the Cohen edition).
Comment: https://judaism.stackexchange.com/questions/9153/why-the-split-between-sefardim-and-ashkenzim/9163#comment167565_9163
Comment: @DoubleAA can you elaborate please
Comment: I can't, as I'm not knowledgeable enough, but the Wikipedia page you cite has the same claim that the story of the "four captives" is a fable and didn't really happen
Comment: Haskamos that say the history is all verified? There are lots of stories of rishonim that aren't necessarily historically accurate (and lots of haskamos that don't touch at all on the content of the book)
Answer: Really the distinction is one between the medieval period and the modern period. The Shulchan Aruch was written at the very end of the medieval period and was one of the first Jewish books to be printed during its author's lifetime. The printing aspect is hugely important; before that any Jewish work (any work in general) was competing for scribal time & effort.
Answer: The shift happened from the Shulchan aruch.
Before the Shulchan Aruch, halacha was decided by each posek looking towards the Talmud and Geonim, or being influenced by other Rabeim, and coming to their own decision about an issue, based on what made sense to them and their community.  (Using many many factors)
The Shulchan Aruch however, decided to take a 2 out of 3 approach (best of Rif, Rosh and Rambam)  This was a new method of psak halacha.
I imagine there is also a shift due to the Arizal, but I have no source for that.
Comment: Re your last few words: do you have a source for the rest of your answer?
Comment: @msh210 did you not look at the link?
Comment: Correct, I didn't. Sorry.
Comment: Sorry but this isnt strictly correct.  The trend of paskening based on poskim and not based on the gemara directly is discussed by the Ri Migash, was prevalent  in the 15th century, before Shulchan Aruch.  THe opposite is also true, later writers such as the Gra R. Moshe and the Chazon Ish sometimes brought proof dirctly from Gemara; not poskim.
Comment: @mevaqesh Treating poskim as if they are judges and taking the best 2 out of 3, was discussed by the Ri Migash?
Comment: He has a tshuva cited in the popular book makings of a halachic decision where he says that a Rov who is fluent in Gaonic responsa is preferable to a Rav who "known how to learn" but doesnt know the Gaonim, because we can rely on the Geonim and however well this second rabbi knows how to learn, it isnt as well as the Gaonim.
Comment: Yeah, that doesn't contradict what I wrote. Gaonic learning of a sugya isn't a formula for deciding between number of sources.
Answer: The Chida (Eruvin 21b) writes:

אפשר לפרש דהא דכתיב ולהג הרבה חוץ מדרשא דבסמו' הוא טעם שני למה לא נכתבו דעל ידי שהם בע"פ וצריכי רבנן למגריסינהו תדיר ולא פסיק זה גורם להתקדש ולהשתעבד שעבודא דאורייתא כי חיים הם למוצאיהם ומרחקתו מן החטא וז"ש ולהג הרבה שהוגה בהן עי"ז יגיעת בשר על דרך שאמרו שיגיעת שניהם משכחת עון וזה טעם גדול לתורה שבע"פ. והוא טוב טעם לקדושת התנאים והאמוראים מלבד תוקף עילוי נשמתם שעל ידי שהיו מוכרחים תדיר לחזור על לימודם בעל פה היה מזדכך גופם ותורה אגוני מגנא ואצולי מצלא לא כן אחר שנכתבה הגמרא דבטלה הגירסא בהתמדה ושרו חכימי' למהוי כעמא דארעא וזה מפתח גדול להבין האי דאחסור דרי וסדר הבדלות בין חכמי ישראל ודי בזה:

In brief, he says that when the Torah Shebaal Peh was unwritten, the effort needed to memorize it made people holier. Once it was written down (with the closing of the Talmud) and it was no longer necessary to memorize it, "the sages began to become like the amei haaretz."
In his closing words he notes that "this is an important key to understanding the descent of the generations and the distinctions between Torah sages." He may mean that the distinction between the Rishonim and the Acharonim is associated with the codification of the basics of halachah, such that less effort was needed to memorize the basics - which would then point to the publication of the Shulchan Aruch as the dividing line, as pointed out in other answers. Alternatively, he might be alluding to the invention of printing (also as noted in other answers), which put many more sefarim within reach of Torah scholars and sages, but at the same time reduced the amount of effort needed to learn those sefarim.

Mention should also be made of Mattis Kantor's Codex Judaica, where he suggests that in fact there's a transitional period between the Rishonim and the Acharonim. He calls the sages of this period the "Kov'im" (the "fixers" of halachah), and dates that era to 1492-1648 (thus spanning the period in which the Shulchan Aruch and its first major commentaries were written), with the Acharonim proper following that.
Comment: Is Rabbi Kantor's "Kov'im" period, his own suggestion or are there other scholars that refer to the period as such as well?
Comment: @Deuteronomy I don't have the book with me now, but I think it was his own idea.
Comment: thanks, if you end up confirming one way or another, please tag me again :)
Answer: This is a great question that is hard to answer succinctly; just about every statement below needs to be challenged, circumscribed, and/or clarified more. But I will do my best to cite some of the "theories" explaining what is essentially a sociological observation: by some time in history, rabbinic authors imagined themselves as belonging to a different historical era than that of their predecessors although the nature of this perception is itself complex (see the Havlin article listed below). Your questions asks about the Rishonim/Acharonim divide, but I will just throw out this podcast about the Savoraim/Geonim/Rishonim divide, because a lot of the sources and discussion there is also relevant here: The Rishonim Podcast Episode 2.
So first, here are two rabbinic theories I've sees as to how/why this split occurred:

R. Elchanan Wasserman quotes his teacher R. Yisrael ha-Kohen (the "Chofetz Chaim"), who says that even though every generation decreases in greatness, sometimes there is a discontinuity in the flow of generational decline. He adds that this would be something evident to all the living rabbis of the time, when a particular person passes away who towers over his contemporaries so completely that all who remain recognize that an epoch has passed. He says that this occurred with the death of R. Hai Gaon to end the time of the Geonim, and "Rabbi Akiva Eiger said about the Vilna Gaon".

R. Yaakov Kamanetsky (Emes L'Yaakov Bamidbar Ch 9, cf also Shemos Ch 24 and Emes L'Yaakov Avos 1:1) writes sort of similarly, saying that the last member of the "era" is the greatest, but puts the emphasis on codification, saying that the end of an era comes when this great rabbi will compile all the teachings of the previous generations into a code of some kind to signify the era's conclusion. Both of these sources are available on the above-linked podcast sourcesheet, here.

Among academics, I believe that the predominant historical theory for this phenomenon (detailed in an article available here) is that 'periodization' occurs due to some crisis within a society that creates the perception that the post-crisis society cannot recreate the conditions that existed previously. It has been variously proposed that this could be applied to the "end of the Rishonim" due to either (1) the Rindtfliesh massacres (around 1300AD) and other associated persecutions up to and including those in the wake of the Black Death (a few decades later) in Central Europe, (2) the century of Spanish persecution leading up to the Inquisition (1391-1492), or (3) the social upheaval precipitated by the rise of printing (or some combination thereof). This complicated theory would mean that the "end of the Rishonim" did not occur all at once and likely occurred in different places at different times (i.e., there were still "Rishonim" living in Spain in the 15th century, while the rabbis of Poland thought that the last Rishonim were the Rosh and his sons). In fact, the 1972 Encyclopedia Judaica article on "halakha" by Louis Jacobs states that the Rishonim ended in the 16th century with the printing of the Shulhan Aruch, while the article on "Rishonim" by Yisrael Ta-Shema says that it ended a century earlier with the deaths of the Maharil and Terumas haDeshen.
There is so so much nuance here (like, did you know the Ramban thought of the Rif as the last Rishon and himself/the Rambam as "Acharonim," and R. Saadiah ibn Danan thinks that the Rambam is the last "Rishon," and the Hagahos Maimonios implies that his teacher Maharam of Rothenburg is the "last of the great ones", etc. etc.) and so I encourage you to keep poking at it. Here are some articles related directly or indirectly to the topic with lots of interesting sources to consider:

Havlin, S.Z. (1983)."Al ha-Hatimah ha-Sifrutit ki-Yesod ha-Haluqah li-Tequfot ha-Halakah," Mehqarim be-Sifrut ha-Talmudit. The Israel Academies of Sciences and Humanities, Jerusalem.
Dimitrovsky, H.Z. (1984) "ha-Yesh Yemei Beinaim Yehudiim?", in M. Bar-Asher ed., Mehkarim be-Madaei ha-Yahadut. Jerusalem
Soloveitchik, H. (1987). Religious Law and Change: The Medieval Ashkenazic Example. AJS Review, 12(2)
Yuval, I. (1992). Rishonim and Aharonim, Antiqui et Moderni Periodization and Self-Awareness in Ashkenaz). Zion, 47.
This online article (associated with the Rishonim podcast): The Heavy Weight of the Jewish Bookshelf
Comment: Re: generational decline, interesting to note this [Hayom Yom](https://www.chabad.org/therebbe/article_cdo/aid/3315374/jewish/6-Shvat.htm).
Answer: rishonim were the leading rabbis  before the shulchan aruch and
achronim after  shulchan aruch (5323-5324)
Comment: A source would be helpful.
Answer: The time of the shulchan aruch is about right; there is also a shift in rabbinical names about the same time.
many(but not all) rishonim went by acronyms...rashi, rashbam, rambam, ramban, or by their own names .... ibn ezra,sforno, abarbanel
acharonim often wrote their comments under a pen name....chafetz chaim, gur aryeh, etc.
Comment: Also, the examples of acharonim are not pen names, these are the names of their books which they became known for.
Comment: Exactly: like the or zarua, kol bo, ittur, eshkol, maharsham, maharsha, r akiva eiger and the gra.
Comment: +1 for time of Shulchan Aruch (though no source), -1 for second half, so 0
Comment: ראי"ה, גרי"ז, רידב"ז, רמח"ל, רמ"ז, אדר"ת, חיד"א, מהר"ם שיק, מהרש"ם, מלבי"ם


Why is problem sets not available as a tag?

Question: Problem sets as a concept is widely used in academics. There is also a Wikipedia entry to moot. Will someone add this as a legal tag for use across some of the Stackexchange sites?
Comment: @MartijnPieters - they need `problem-pets`.
Comment: After all the work to [get rid of the homework tag](http://meta.stackexchange.com/questions/147100/the-homework-tag-is-now-officially-deprecated), this is the last thing we need on SO.
Comment: Why would you need a 'problem-sets' tag on Pets.StackExchange.com?
Comment: @Oded: No thanks, I have plenty of those at home..
Comment: Fair enough, the tag is required in *some* of the sites.
Comment: @lifebalance: Which ones do you have in mind (not that I'm in agreement with this)?
Comment: SO and http://programmers.stackexchange.com/
Comment: So, what's with this down voting of -8? Isn't that a bit harsh for such a legitimate question? Or is there another meta-meta site that I should be posting this?
Comment: @lifebalance: [Voting is different on meta](http://stackoverflow.com/help/whats-meta): it can be used to express agreement or disagreement with a feature request.
Answer: Sure. Because our cooking site really needs it.
Or the lego site.
Or the pets site.
I think you are getting my drift here.
Tags are easy enough to add - you just create them if you have enough reputation - there is no need to add a default one that will not be relevant to most sites.
Comment: @lifebalance - There are 7 such questions on programmers. 5 of which are closed. You linked to one of the two remaining questions.
Comment: @lifebalance - what question would benefit from it? I don't necessarily think we _need_ another **conceptual** "meta" tag, not after trying to get rid of them.
Comment: I don't have enough reputation on Stackoverflow.com - would you do the honours?
Comment: If practice-problems exists, what's wrong with problem-sets?
Comment: @lifebalance - there is no such tag on [so]. And [programmers.se] only has 7 of those. Clear sign that it is not actually needed.
Comment: [This](http://programmers.stackexchange.com/q/147794/46808) question has it.
Comment: Oops! So, they are going to get closed as well?
Comment: @lifebalance - don't know. Depends on the questions themselves and whether they _fit_ Programmers.
Answer: There used to be a homework tag on StackOverflow, but it was officially deprecated and then removed in a long cleanup process. The reasons for removing the homework tag all remain true. To quote from that discussion:

homework is a meta-tag. It describes the status from which the question is being asked, not the content of the question.
homework might be factually incorrect - for example, it is possible to ask a basic question yet not be a student or otherwise completing
  an assignment.
Copied assignments (verbatim) with no attempt at solving the problem are not real questions and should be closed anyway.
Someone, somewhere, will feel the need to say "is this homework? is it? is it homework? Really?" then somebody else will "USE THE HOMEWORK
  TAG11!!11" (and I'm mildly fed up of it).

How would a problem-sets tag differ from the homework tag? Even if there were some distinction, people would be sure to use it the same way.
Comment: @lifebalance: That sounds like it might be off topic for Programmers. It would certainly be off topic for SO. It would likely be on topic for academia.stackexchange.com (which [does have a homework tag](http://academia.stackexchange.com/questions/tagged/homework)).
Comment: [This](http://programmers.stackexchange.com/questions/147794/language-agnostic-programming-problem-sets) (which has been just removed!) is asking about how to go about finding or defining problem-sets as practice problems.
Comment: Fair enough. By the way, instead of removing that question, is there a process by which it can be "deported" to academia.stackexchange.com?
Comment: @lifebalance That's called migration: you can flag a post for migration by a moderator, though now that it's been deleted it's too late
Comment: I guess the question would have been off-limits to SO. But between Academia and Programmers, the question belongs in the latter. IMHO.


How can I avoid an underbake in a bundt pan?

Question: I've made a Cardamom Cream bundt cake twice now and both times it's dense and under baked after an hour baking time.  I'm thinking of whipping the egg whites to lighten the batter/cake than folding into the dry ingredients and cream.  Any thoughts or advice would be appreciated.
Comment: Please post your recipe and method.
Comment: The recipe is here; https://www.nordicware.com/recipe/cardamom-cream-bundt-cake#.VhxysWuDXIU and I'm using nordicware Heritage bundt pan.  I hadn't thought about the baking powder being old. I'll get a fresh supply. I always think of the spices but not the components.  I do have an oven thermometer and adjusted the oven.  Thanks for the input.
Comment: Please be sure to include whether you have checked to be sure your oven is the proper temperature by using an oven thermometer, and describe the appearance and composition of your Bundt pan (light/dark metal, aluminum etc).
Comment: Recipe and method will help, but some early thoughts: are you sure your oven temperature is accurate? An oven thermometer can help to check. Are you sure your baking powder (if using) is fresh? After about 6 months it gets less effective and eventually it loses pretty much all its powers of leavening (by about a year old). Are you using the size of pan recommended by the recipe?
Answer: If in doubt, a cake, unless it has a very sticky filling (fruit+sugar, chocolate...), can almost always be tested by pushing a toothpick/skewer right through the center (while in opened oven - oven gloves advised if inexperienced :), and checking whether the stick comes out clean - if not, give it extra baking time. If the exposed surface would brown too much by doing that, cover with aluminium foil.


Primefaces and ajax onsuccess event

Question: I use ajax remoteCommand component with Primefaces and this component updates inputHidden field with boolean value.
I call JS function on the onsuccess event of remoteCommand but it seems that my function is called before DOM update because when I test inputHidden value, this is not the right value but if I set interval to test 3s after, I have the right value...
Code :

First JS test :
function hideOrShowNotification(){
   alert($('#tabView\\:register_form\\:hiddenNotification').val());
}

Second JS test :
function hideOrShowNotification(){
  setInterval(function(){alert($('#tabView\\:register_form\\:hiddenNotification').val());}, 3000);
}

In first case I receive false value and in second case I receive true value. The expected value is true.
So my DOM is not fully loaded when my JS function is called.
How can I call JS function after full loading of DOM ? I believed onsuccess event would do that but no apparently.
Answer: Ok...it's the oncomplete event. I tested it before but perhaps I have forgotten to clear browser cache to reload new JS file.
EDIT : link to primefaces tag documentation

Primefaces and ajax onsuccess event


Exchange FSA K-Force Light chainset with a SRAM RED

Question: I'm the lucky owner of a  Fuji SST 1.0 from 2010 (mounted with a Shimano press-fit bottom bracket). I would like to exchange the front chainset from a FSA K-force 53/39 to a SRAM RED 50/34. Can you help me to what bottom bracket I need to purchase and get fitted?
Comment: You might want to double-check since I'm not 100% but I think maybe your current bb will be ok. I have a Shimano press-fit bb and am happily running Hollowtech 2 cranks. I'd make sure on the sram site. Note that press fit bb's are a pita - special tool to remove, another special tool to insert. Each tool costs more than the bb itself.
Comment: Thanks PeteH, when trying to fit it, the fit is fine, but the SRAM's starshaped end (sorry, I don't know how else to explain it) is 1cm longer, which makes the BB unstable. Thanks Frank
Comment: star-shaped = splined. But unfortunately that's my limit! Sorry.
Answer: If you have the GXP Red cranks (more normal) you want a Pressfit GXP Bottom Bracket.
If you have the BB30 Red cranks you want a Pressfit 30 BB
However not all press fit systems are created equal. I would have your LBS check compatibility, and supply and fit a suitable part.
SRAM make both of these in the whole range of series from Red down to non-series Truvativ-branded versions.


Why doesn't my chopper have electrical power?

Question: I have a Custom Chopper with a 1992 1340evo, my voltage regulator rectifier came unplugged from the starter.  I plugged it back in and it started and ran.  The next day, I started the bike and it ran for a few seconds and then lost all electrical power and shut off.
Answer: So, my guess is that it ran purely from the battery, without receiving any charge from the stator, and then it stopped when the battery was depleted. This can be confirmed from measuring the battery voltage with a multimeter, with the engine running - you should see around 14v if it's being recharged, and from 12 to 13v if it's running on its own. For that you'll have to start your bike again - you probably will need to recharge your battery for that, or maybe just wait a couple hours - sometimes batteries will recover a little bit after some time, enough for starting the bike.


Simple linear model with autocorrelated errors in R

Question: How do I fit a linear model with autocorrelated errors in R? In stata I would use the prais command, but I can't find an R equivalent...
Answer: In addition to the gls() function from nlme, you can also use the arima() function in the stats package using MLE. Here is an example with both functions.
x <- 1:100
e <- 25*arima.sim(model=list(ar=0.3),n=100)
y <- 1 + 2*x + e

###Fit the model using gls()
require(nlme)
(fit1 <- gls(y~x, corr=corAR1(0.5,form=~1)))
Generalized least squares fit by REML
  Model: y ~ x
  Data: NULL
  Log-restricted-likelihood: -443.6371

Coefficients:
(Intercept)           x
   4.379304    1.957357

Correlation Structure: AR(1)
 Formula: ~1
 Parameter estimate(s):
      Phi
0.3637263
Degrees of freedom: 100 total; 98 residual
Residual standard error: 22.32908

###Fit the model using arima()
(fit2 <- arima(y, xreg=x, order=c(1,0,0)))

Call:
arima(x = y, order = c(1, 0, 0), xreg = x)

Coefficients:
         ar1  intercept       x
      0.3352     4.5052  1.9548
s.e.  0.0960     6.1743  0.1060

sigma^2 estimated as 423.7:  log likelihood = -444.4,  aic = 896.81

The advantage of the arima() function is that you can fit a much larger variety of ARMA error processes. If you use the auto.arima() function from the forecast package, you can automatically identify the ARMA error:
require(forecast)
fit3 <- auto.arima(y, xreg=x)

Comment: What is the 0.5 for in "corr=corAR1(0.5,form=~1)?"
Comment: It gives a starting value for the optimization. It makes almost no difference if it is omitted.
Comment: +1 The `arima` option looks more different from Stata's `prais` at first glance, but it's more flexible and you can also use `tsdiag` to get a nice visual of how well your AR(1) assumption actually fits.
Comment: How do I use arima() if I regress y on a constant only?
Answer: Have a look at gls (generalized least squares) from the package nlme
You can set a correlation profile for the errors in the regression, e.g. ARMA, etc:
 gls(Y ~ X, correlation=corARMA(p=1,q=1))

for ARMA(1,1) errors.
Comment: Can I use the "predict" function on a new dataset, and retain the same error structure?  How does the gls command know what order the observations are in?
Answer: Use function gls from package nlme. Here is the example.
##Generate data frame with regressor and AR(1) error. The error term is
## \eps_t=0.3*\eps_{t-1}+v_t
df <- data.frame(x1=rnorm(100), err=filter(rnorm(100)/5,filter=0.3,method="recursive"))

##Create ther response
df$y <- 1 + 2*df$x + df$err

###Fit the model
gls(y~x, data=df, corr=corAR1(0.5,form=~1))

Generalized least squares fit by REML
  Model: y ~ x
  Data: df
  Log-restricted-likelihood: 9.986475

 Coefficients:
 (Intercept)           x
   1.040129    2.001884

 Correlation Structure: AR(1)
 Formula: ~1
 Parameter estimate(s):
     Phi
 0.2686271
Degrees of freedom: 100 total; 98 residual
Residual standard error: 0.2172698

Since model is fitted using maximum likelihood you need to supply starting values. The default starting value is 0, but as always it is good to try several values to ensure the convergence.
As Dr. G pointed out you can also use other correlation structures, namely ARMA.
Note that in general least squares estimates are consistent if covariance matrix of regression errors is not multiple of identity matrix, so if you fit model with specific covariance structure, first you need to test whether it is appropriate.
Comment: What is the 0.5 for in "corr=corAR1(0.5,form=~1)?"
Answer: You can use predict on gls output. See ?predict.gls. Also you can specify the order of the observation by the "form" term in the correlation structure.
For example:
corr=corAR1(form=~1) indicates that order of the data is the one they are in the table.
corr=corAR1(form=~Year) indicates that the order is the one of factor Year..
Finally the "0.5" value in corr=corAR1(0.5,form=~1)? is generally set up to the value of the parameter estimated to represent the variance structure (phi, in case of AR, theta in case of MA...). It is optional to set it up and use for optimization as Rob Hyndman mentioned.
Comment: Predicting or fitted values will be far different though correct (gls() versus Arima())? As gls will only use fixed effects while Arima will include the arima errors to the fitted values.


Get database after sql crash

Question: One of the hard drive in my office's NT server was crashed two weeks ago.  I had installed MS-SQL in c: and the data was stored in d:.  The hard crased was c:.  Thus I replaced the crashed hard drive and re-install NT server and SQL server again.
The problem now is how to restore the data from the .mdf files located in d: (there's no other backup).  I've tried to "restore" but MS-SQL server reported that it was not a valid backup file format and not allowed me to restore the database.  Could anybody help?  Thanks!!
Comment: belongs on DBA or serverfault.
Answer: Important note: before trying to get your databases back, make sure you have a copy of all your .mdf and .ldf files somewhere safe.
An .mdf file is a file which contains the actual data. You cannot "restore" anything from them, because they are not backups, thus Microsoft SQL Server tells you they are not valid backup files.
What you can do is to recreate the databases and bind them to the actual .mdf files. This is done by right-clicking on the database in SQL Server Management Studio and going to:
Properties > Files > Database files > Path/File Name
Microsoft SQL Server uses two types of files: .mdf contains the data, and .ldf contains the logs. It is crucial to recover the log files side by side with the data files, especially in the circumstances where the database engine couldn't be shut down correctly, such as when the server crashes. The fact that it's the C:\ disk which crashed while the data files were on D:\ is irrelevant here: what matters is that the SQL Server engine wasn't terminated correctly.
Once you get the databases back, there is an additional step that you might have noticed now is crucial: configure regular backups on a NAS/SAN, as well as off-site. You do that by going to:
Management > Maintenance Plans > New maintenance plan
and adding Back Up Database Task to the plan. Configure several maintenance plans with different options (for instance one complete backup once per month and one incremental one twice per day, as well as a weekly off-site backup) depending on your needs.

my office's NT server

Windows NT support ended twelve years ago. It is about time to upgrade to a more reliable version of Windows or move to an open source operating system if money is a concern. By keeping an unsupported version which doesn't receive security patches any longer, you are introducing a security threat, as well as potential compatibility issues with other products (and thus management nightmare).

Get database after sql crash


What readers are available at the 1,000 word level?

Question: I want to improve my reading and grammar skills by finding interesting things to read. What graded readers, basic textbooks, magazines, and other reading materials are available for adult students who can recognize the first 1,000 words from the HSK? I would prefer material which includes a CD or MP3 files, but without is okay too.
Comment: @Alenanno - This is very close to being a dup. but that question is for 2k - 3k. I think 1k words is a good distinction for someone who has gone past the beginner level.
Comment: @Village,
This doesn't feel like the right place to talk about this, but I'm working on a website that might be just what you're looking for. It's going into private beta this weekend, and I'll need learners like you to test it out, so if you're interested, please [sign up to be a beta tester](http://3000hanzi.com/).
Comment: @stevendaniels - that looks interesting - I've added my name to the list as well, so feel free to sign me up when it comes out :-)
Comment: My teacher at Copenhagen University told me that at the level of 2000 characters you can read a Chinese newspaper. So guess you can read half a newspaper!
Comment: Can you read an English newspaper with a vocab of 2000 English words? I'll say yes.
Answer: You can try 读者 which is like Reader's Digest. I don't know if one with 1000 words can understand every article in it, but I think you can find some interesting essays.
Answer: Anna mei Banfa! (an early level 2 reader) may be excruciatingly repetitious, but it's a good way to pound those most frequent characters into your head. It's used in high school classes in the US. Make it a bit more interesting by making up a parallel story in your mind about another girl who's a lot more interesting (using the same vocab, or looking up just a few more "colorful" expressions!)


How to change shape in GIMP

Question: I would like to take any shape, and drag its edges wherever I want, distorting the image in the process. How do I achieve this ?
Perspective isn't what I am looking for, nor is Filters>Distortions>Curves.
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer: Perhaps you are looking for the Unified Transform Tool Shift+T.
In the toolbox it looks like this:
It's a multi-functional transform tool. Hold down Shift as you click and drag an edge handle to distort the image, squishing or stretching it. Moving the edge without Shift resales proportionally. The corner handles can distort like perspective, and the white diamond handles are for skewing.
Comment: With this, dragging a corner inward provokes a deformation on the opposite side of the image, as if the image is being rotated along an axis in 3D. I would need for the image to only get "squished" on the corner I'm dragging.
Comment: @oui - so essentially you are looking for some kind of non-uniform deformation. This isn't really possible in raster image editors as far as I know.  If you had a vector shape, then it could be done. But GIMP isn't a vector image editor.
Answer: This looks like the Cage tool, once you have put nodes around the shape.
Comment: I did try to use it and it seems to be the right tool for free transformation as I desire, however it leaves weird artifacts behind, as if the image is being redrawn above the original. As an example, dragging the corner of a square inwards leaves behind a piece of the original corner. How do I avoid this behaviour ?
Comment: Did you try the "fill original position" option?
Comment: Ah, that is indeed way better. I'll mark this as the answer, since it's as close to what I am trying to achieve as it gets.

How to change shape in GIMP


Is space elevator a reasonable idea?

Question: I read today that Japan is trying to build space elevator by 2050. To me, it sounds like making a super skyscraper. There are so many challenges building skyscraper that exist today. It is an ecosystem in itself and require lots of maintenance. How feasible is the idea of space elevator, considering various parameters i.e. terrorist attack, maintenance, etc.?
Comment: ...and even 2050 is overly optimistic. It's a date when we might possess all necessary technology to build it - add another 50 years to give it a chance to become economically viable, said technology cheap and ubiquitous enough.
Answer: There is a lot of information already that has no need to be duplicated here, hence the down votes
https://en.wikipedia.org/wiki/Space_elevator
https://en.wikipedia.org/wiki/Space_elevator_safety
Short answer: until recently the the concept was provably impossible on material strength grounds, this is no longer the case but that does not automatically make the concept viable, sensible or safe.
Comment: A thing worth mentioning IMO, that is regularly omitted when talking about space elevators and material strength is active support, so I would add provably impossible on material strength grounds, without using active support, on Earth. Also, there are different designs and variations like skyhooks e.g.

Is space elevator a reasonable idea?


Which plugin is used to copy file from different environment in jenkins

Question: I want to copy file from different environment in jenkins. Can you please guide me to choose the plugin for copying
Comment: Can you please expand on what you mean by "different environment in Jenkins"? Are you trying to copy files between agents? Or between predefined environments, as defined by labels or environment variables?
Comment: copy files between remote desktop servers.
Comment: @user18589 Are these remote desktop servers being used to as Jenkins Agents to run builds on? If they are, then there are ways to copy files between them in Jenkins. If not then you need to use something external to Jenkins like SCP, FTP, etc.
Answer: You are probably looking for something like the Config File Provider. Its plugin page describes it as a plugin which:

Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job's workspace.

If you need something more like a script (as opposed to the configuration file scenario above), you may be interested in the Managed Script plugin. This allows jobs to consume scripts which are centrally stored and defined by the Jenkins admins:

Managed scripts are shell scripts which are managed centrally by an administrator and can be referenced as a build step within jobs.

If these do not suit your needs, try looking at the Jenkins plugins list


How to perform simple zooming with calabash-android

Question: I have a simple application consisting of a custom chart with enabled zooming. What I want to do is to write a test which will perform some zooming of the chart and will check that the app doesn't crash after the zooming. Is that possible (I looked over the performAction method but the only zoom I found was for the google maps) ?
Answer: Without knowing how your app is made.
You might be able to solve this using recorded touch events.
So record an event, in your steps play it, and after you have played it verify some part of the UI is still active. Then you will know if the app did not crash.


Comparative size of lattice of subgroups and lattice of the intermediate fields

Question: If an extension of fields $E/F$ is normal and separable, Galois theory tells us that the intermediate fields $E \supset M \supset F$ are in 1-1 correspondence with the proper of the Galois group $\operatorname{Gal}(E/F)$. But if the extension is for instance not normal, then which lattice is in general bigger? The one of the subgroups or the one of the intermediate fields? Are there easy example for the case "the latice of the intermediate fields is bigger"/"the lattice of the subgroups is bigger"?
Answer: For a purely inseparable normal extension
(for instance, $k(X,Y)$ over $k(X^p,Y^p)$ for $k$
of characteristic $p$), the Galois group is trivial
but the lattice of intermediate fields isn't.
In general distinct subgroups of the Galois group will determine
subfields as fixed fields, but one need not get all subfields.


Magnetization in Paramagnetism

Question: I have a question regarding the magnetization of an object. Let's say this object has magnetic moments pointing in random directions, such that the total magnetization is null. If we apply an external magnetic field, the magnetic dipoles will align themselves with the field to cause a magnetization field. This magnetization field is in the same direction as the applied field, and thus causes an increase in the total magnetic field strength inside. My question is: if the dipoles always want to point in opposite directions, e.g. north to south, why would the dipoles align themselves with the field, and not against it? In electric polarization the negative side of the dipole is attracted to the positive side of the field, this decreasing the total $\mathbf{E}$ field strength inside the material. Why is this not the case with magnetic fields?
Comment: Shouldn't this have something to do with the fact that there is no magnetic monopole, i.e, magnetic field is solenoidal, i.e., $0=\nabla\cdot \vec B\neq \nabla\cdot \vec D=\rho_{f}$?
Answer: If we apply an external magnetic field, the magnetic dipoles will align themselves ... in the same direction as the applied field, describes the behavior of ferromagnetic materials.
the dipoles always want to point in opposite directions describes the behavior of antiferromagnetic materials.
Antiferromagnetism has to do with the process during solidification of magnetic materials from the liquid phase. At the beginning of solidification, neighboring atoms permanently influence each other and form magnetic domains, i.e. permanent magnets. Since this occurs simultaneously and independently, these spatial alignments of these domains are random.
It is clear that a permanent magnetization of such Weissian domains by an external magnetic field is difficult.
Ferromagnetism has to do with the existence of unpaired electrons in atoms.
Electrons are the smallest detectable permanent magnets (Electron magnetic moment) and tend to be aligned in pairs in the atom (Pauli Exclusion Principle). Atoms with an odd number of electrons therefore also have a magnetic moment.
The alignment of these magnetic moments under the influence of an external field succeeds much easier than in the crystalline domains of antiferromagnets.
In electric polarization the negative side of the dipole is attracted to the positive side of the field,... Why is this not the case with magnetic fields?
Magnets are always diople, breaking the dipole into two monople is impossible.  Therefore, macrosocopic magnetic fields do not result from the separation of charges but exclusively from the common alignment.

Magnetization in Paramagnetism


Controlling op amps amplification ratio by arduino

Question: Is there any option how to control amplification ratio of operational amplifier by some logic signal which can be produced by arduino? I am talking about some clasic op amp like lm356 or ui741 in basic inverting or non-inverting circuit (i would like to use non-inverting circuit in my application). I know only about digital potentiometer like solution but i think that it isn't profesional and most eficient solution, so I want to know your opinion. Thanks for reply.
Comment: There's nothing wrong with digipots...  I made a whole mixer system using digipots and op-amps once.
Comment: not a question about Arduino
Comment: Could you provide more details on your requirements? Do you need gain adjustments in fine tuning or just large steps, like the scales of a multimeter? What are the characteristics of your input signal?
Answer: The basic principle is easy to implement.  A non-inverting configuration has a resistor Ri from the inverting input to ground, and a feedback resistor Rf from the same input to the output.  The signal is applied to the non-inverting input.  The gain is 1+Rf/Ri.  You can control the gain by changing Ri, which can be done via a CD4016 quad analog switch and 4 resistors.
HOWEVER, the Arduino is a 0-5V device.  The CD4016 can handle 15V, but to switch it the digital input must pass through half the supply.  The op-amps you mention will require bipolar supplies to handle AC signals (which I assume is what you want), so you could run them with +/-7.5V, with the CD4016 powered between them.  Then to get the Arduino 0-5V to toggle the CD4016 you'd need some level-shifting transistors to get it to +/-7.5.  The upshot is that this is surely going to be more trouble than it's worth.
However, if you are willing to drop the ancient op-amps and use a modern single-supply type (MCP6021, LT1013, etc) that runs on 0-5V, you can use input and output capacitors to convert the signal to AC, then just use the CD4016 as-is. Or JFET transistors, or even bipolars to switch the gain resistor under Arduino control if you don't need audiophile quality.


How critical is it if a pebble blows into a propeller?

Question: How critical is it if a pebble blows into a propeller while taxiing and leaves a small abrasion in the leading edge? It wasn't noticed during flight and there was no apparent change in performance of the airplane, it was only noticed after parking. This is on a single engine piston aircraft.
Answer: This sort of FOD is often not an immediate problem, however introducing any slight knick or gouge to a propeller could be the beginning of a stress fracture. The last thing you want is a catastrophic prop failure whilst flying!
The correct course of action, much like any minor damage to the airframe, is to note it in the logs, have a mechanic look at it, and make the call if a repair is necessary.
Comment: What sort of repair options are typically available? Can individual blades be repaired? A weld bead deposited  followed by careful machining? The original blades are they typically cast / forged or machined into shape?
Comment: @curious_cat I'm not sure i'm qualified to answer that, however I suppose it would depend a lot on the type of propeller, specifically what it is made out of. Carbon fibre can be patched, wood can have an extra layer lamenated on top, metals may be harder I don't know. This prop overhaul company has a [video of them repairing a prop](http://propeller-overhaul.com/propeller-overhaul.html)
Comment: For completeness...  [Foreign Object Damage](https://en.wikipedia.org/wiki/Foreign_object_damage) (FOD).
Answer: Based on the description provided; it will have little aerodynamic (thrust, drag etc) effects, which is negligible and will not notice much in terms of performance.

small abrasion in the leading edge

After parking, maintenance guy has to check it up and take decision based on the impact, maximum allowed damage in propeller, repair availability in the current airport etc...
Answer: In case of any hesitations you should refer to the documentation of your propeller manufacturer. They contain criteria for defects, which ones can be ignored, which ones can be fixed by the aircraft owner, and which ones must be fixed by the manufacturer.
Any other action (or inaction) may cause damage to the prop, engine, and consequentially to the aircraft (be it from a crash land, or a glide land).


How to get feedback on a paper most effectively

Question: Suppose that a PhD student is writing a paper by themself. A person who is an expert in the area offers to read the paper and give feedback. The expert explicitly mentions he is fine with getting unpolished paper for feedback. When should the student send the draft for feedback. Specifically, is it better to get it relatively polished before sending it, or should I send it earlier? Or when it is completely finished? The expert is only going to read it and give advice once, so it's not possible to do multiple iterations.
Comment: Is this the first time you're writing something for publication?
Comment: No, I have published a few papers before.
Comment: I would send a polished paper -- to the best of your ability.  I've offered such help before.  However, the student's level was way too low, so I said no after receiving the paper.
Answer: The answer is really "it depends".
What kind of feedback do you need? If you're worried about the overall structure and the correctness of the results, sooner is better, but don't make your reader struggle with fragmentary work. Make your best guesses, write a draft, and provide marginal questions ("do I need more detail here?", "should this section be omitted, or merged with an earlier one?").
If you're comfortable with your second or fourth draft and want just polishing, send the paper when you think you are nearly finished.
If you know the potential reader well enough you might ask what kind of feedback they are willing to provide.
Comment: Also a good idea to ask how much time they're able to spend - it's always harder to read a very rough draft than something that's nearly ready to go out.


Using NHibernate in Asp.Net MVC

Question: HI All,
What are the steps to use NHibernate from the model component of MVC?
Answer: the Models folder in ASP.NET MVC should be for View Models (return complex objects to the controler=>view), NHibernate ISessionFactory should be started in the Application_Start event in your global.asax for the MVC project. The Mapping and Entities themselves I would recommend to live in a different project, normally with a combination of folders called Mappings/Domain/Persistence to keep it simple. For a more structured solution I would look at the DDD layers, but that is alot of complexity for small implementations and doesn't works for every project.
Answer: Nothing is different you add the hibernate.cfg.xml in the root of the web project and add your  mapping files and you are good to go
Answer: Have a look at SharpArchitecture, this is best practice for MVC with NHIbernate.
http://code.google.com/p/sharp-architecture/
Answer: I guess, the only thing specific to nHibernate in MVC is the way you handle the session life cycle. Most people prefer the session-per-request implementation pattern where for each http request a new session is created (sessions are cheap to create in nHibernate). In contrast, session factories are rather expensive in terms of creation and should be created once for the whole application.
... and I strongly suggest you read ASP.NET MVC 2 in Action by Jeffrey Palermo. It handles specifically nHibernate with Asp.net MVC.

Using NHibernate in Asp.Net MVC


How can you find a way through "scum" in a very long question?

Question: Even though Stack Overflow has an excellent system of upvoting and downvoting, we still need to find a way to get past unwanted answers easily. Can navigation systems be designed specifically for sites such as Stack Overflow? Users should be able to set their own policies/filtering rules. Can AI and data mining be of any use here? Will the data mining and AI experts provide some points on this?
Comment: This post is a perfect example of mentioned "scum". FYI: http://meta.stackoverflow.com/
Comment: I use Tilex, it gets rid of soap scum and hard water stains with almost no effort. Not sure what happens if you spray it on your monitor, though.
Comment: Definatley a question for meta.

The upvote downvote system works fine, and with the accepted solution jumping straight to the top its not hard to find a solution to a problem.
Comment: I'm not really sure what he's asking. My head hurts.
Comment: Sounds like the user's looking for the answer-filtering equivalent of http://meta.stackexchange.com/questions/55372/could-we-benefit-from-a-stack-exchange-prize.
Answer: You can sort by vote. Was "AI" enough for me during the last year.
Comment: +1, Also by Newest, if you want to see Answers people thought added something to the existing discussion.
Comment: +1, any other kind of 'squelch' would be self-defeating as far as the purpose of using a Q&A site goes.
Answer: As already mentioned, you can sort by votes. But there's actually a much more interesting deeper question here.
Anyone who follows the community knows that votes don't always reflect 'correctness' nor 'applicability' nor 'effort'. The "It sounds right to me" upvote is well-known, and it is followed closely by "Well, it's upvoted by others and it sounds right, so I'll upvote it too" phenomenon. In my experience, it is much easier to get a second vote than it is to get the first.
There is also the Fastest Gun In The West problem, whereby the earlier the post was made the more chance it has to get upvotes. This reinforces itself because the sort order will drive it up the list thereby giving it more exposure.
This means that if you have an example question with 5 upvotes, and 10 answers on it, with 10,9,8...1 votes on them respectively. With such an even spread, you don't necessarily know which answer is in fact the best, because there are too many factors.
Datamining
Here are some of the factors which datamining could use (not all are necessarily possible right now)
Question/Answer Only

votes per minute since posted
votes per unique pageview
SortOrder of each PageView
"currrent" place in the sort order of each individual pageview
Number of votes on other posts at time of each vote

Voter Information

average reputation of upvoters
average reputation of downvoters
average score of posts that voter votes on
average reputation of poster of posts that voter votes on
all of the above cross referenced by tags

Answerer Information

reputation
average reputation per previous answer
average reputation per previous answer/reputation at time of answer
reputation / days-since-joined
Average reputation of the POSTER of the questions they answer
Average score of the questions they answer
Score of Answers/Score of question
Average time between question posted and answer posted.
all of the above based cross referenced by tags

Obviously, to generate one of these reports would take a foolishly long time, for each individual answer, because it requires parsing the entire history of the DB. But it would be fun. With that kind of information you could theoretically tease out a new sort order which would be the "ideal" sort order.
Now, here's the major problem with this.
It is a reinforcing system. Once you've been identified as a "strong user" then you will continue to be identified as such and will get more and more upvotes based on it.
That is not as troubling as the fact that any users who are identified negatively by this system will almost certainly never get any upvotes. This means that users who are active in helping newbies will usually be sorted low in this system. Users who are active in low-view tags will be sorted low by this system. Also, it would be wildly skewed by 'poll-style' questions where individual users can gain hundreds of votes on a single question.
Ultimately, although such information would be interesting to look at, any attempt to include past performance will end up wildly skewing the data. It also goes against the purpose of the site.
The site is about content not about users. Any attempt to use datamining would only be able to include information about users, and nothing about content. It would therefore never work correctly.


How is folklore different from mythology?

Question: What is the difference between folklore and mythology?
Answer: Those are quite proximate terms: Mythology, folktales, legends, fairytales.
Generally this:

Mythology is a sacred text about the creation of the world, usually by a god/God, the creation or not of subsequent generation of gods, and the creation of the human race (insert any random accident here). Common examples are: The Holy Bible, Hesiod's Theogony, The Babylonian creation myth (enuma elish), the Rig Veda, etc.
Folktales are collection of tales from common people, so you will usually find animals, farmers, woodcutters, common people confronted to common problems. I lost my axe, let's pray Thor. We are lost in a forest how to find the way out. A princess is asleep an nothing can awaken her. I am only a common servant bullied by other people. You can find there elements of magic, sometimes gods, but not always. Folktales also comes in LOTS of versions. Even if common ones are known by a specific one as Perrault's or Grimm's. Folklore also tend to encompass lots of things. Especially the dreaded 'oral tradition'.
Legends: Generally speaking start with an historical fact transformed heavily. King Arthur is the easiest example in mind. There is a king Arthur in history but he has nothing to do with the legendary Arthur. Richard Lionheart is another fair example. Both a totally historical figure and also a kind of legendary paladin.

One of the major difference is mythology even if bearing incredible trace of magic is supposed to be true. This is how the world came to be, how the god(s) created the world and the human beings, and thus how the human beings are placing themselves (slaves, servants, sons, etc.) On the contrary folktales are supposed and expected to be that: tales. No one think seriously that a guy named Jack got a magical bean. Or a witch is leaving in a gingerbread house.
There is a fine line here between myths, legends, folktales. Dracula gives you good example of someone who can be easily identified as common folk knowledge when it is at first a precise character in a precise novel. He is part of the modern folklore even if the image of him in modern folklore is far appart from Dracula in the novel. Which also make Vlad, his human model, a fair legend.
In general, mythology is considered a subset of folklore. Most universities will put mythology in their folklore courses. And considering the Antique, the line can be very very thin. The Babylonian Gilgamesh is an historical character, a true legend, a national hero, a character in a story, and a god, all at the same time.
Comment: Can you support anything in this answer?  Not saying it's wrong, but it is rife with phrases like *"most universities will put mythology in their folklore courses."*  Are your definitions of Mythology, Folklore and Legends the formal definitions in the field, or are you proposing them?  It's hard to know when the answer provides no citations.
Answer: A myth is a true, or seeming, knowledge of the world, accepted by the bearer of mythological consciousness as valid and unquestionable, unlike folklore, which is not obliged to be perceived as something true and life-like. Folklore is an artistic and aesthetic representation of the world and, being a kind of product of mythology, it retains some of its features, but does not become equal to it.


How can I defend Ruby on Rails against customers' not technical opinion?

Question: My customer, a translations business owner, just told me that he has been reading about Ruby on Rails and told me that "there are more PHP guys around there" and "it seems the community prefers it".
What would you, as software engineer and freelancer, say to the customer to achieve these goals:

Sell
Make him see that the technology is my expert decision and Rails
is as good or better than PHP (+ whatever framework) for this
particular project.

UPDATE:
Thank you all for the suggestions! Tomorrow I've got another meeting with him, let's see how it goes, I will update again :)
UPDATE 2:
Finally I told him to read this thread and the result has been fantastic: He gave me the project and we are going to start right now. Thank you all for the help, you have free beer in my charge if we see someday :)
BTW: I learned the lesson: be as transparent as possible, because if you believe in yourself and your work, there is no question compromising enough to beat you.
regards
Comment: Voting to move this question... However, I would consider using examples of industry use such as shopify.com, twitter.com, etc. and also explain that development in Rails tends to be faster than development in PHP (this is my opinion).
Answer: I think you make a mistake in assuming that the choice of technology is a purely technical decision.
The customer seems to be concerned about the business implications of picking a particular technology.  Given that, you need to present a case that addresses his business concerns at least as heavily as your technology opinions.

Employers have to recruit from a particular geographic area and certain areas have particularly active communities around particular technology stacks.  If you're starting a business in the Pacific Northwest of the US, for example, there would be a strong bias towards a Microsoft stack simply because Microsoft is very influential in the area so most of the developers you'd be looking to hire would have experience with that stack.  Other geographical regions have very different profiles.
Talk with your customer and understand why and how he formed his opinion.  Perhaps he read that the local PHP community is particularly active or that the local college teaches a lot of PHP and no Ruby.  Perhaps he's got a trusted developer that he can call in for the occasional emergency that is a PHP pro and a Ruby neophyte.  Of course, it's also possible that he's using poor metrics like the number of job ads or resumes that mention various keywords.
Employers have to be concerned with the long-term sustainability of technology stacks.  Years ago, for example, lots of companies invested a great deal of time and effort building PowerBuilder apps (and other languages of that genre).  PowerBuilder often made it very easy to build line of business apps and developers at the time were often quite enamored with it.    Unfortunately, the PowerBuilder community more or less collapsed leaving companies in a situation where they had a lot of existing code in a language no one really wanted to use where they had difficulty getting competent developers to maintain the existing code and expensive, time-consuming projects to migrate those apps to other technology stacks.  The relative technical merits of PowerBuilder were vs. Java or C++ or C# or whatever they migrated to at that point; it was a death spiral since developers didn't want to get stuck working in a language that companies wanted to migrate away from and companies saw the lack of developers as a sign they should redouble their migration efforts to ensure they had the capacity to do the development the business needed.
Relatively niche languages like Ruby absolutely have the potential to create these sorts of legacy problems for companies who can't predict whether the language is going to fizzle out in a few years when people move on to the next fad or if it has real staying power.  You can certainly mitigate this by pointing out that Ruby isn't dependent on one company or organization so no one can decide it is no longer a strategic product for the company.  If your customer has been burned in the past by having applications developed in languages that became business headaches, you'll need to make a case that Ruby is more like Linux and other open source technologies that flourished without a company backing them than languages that have died out over the years.
Employers want consistency in the environment so choosing a language for one project forces a choice for many others.  Even if Ruby is technically ideal for the project you're pitching, you have to explain why it's appropriate for every other application this customer is going to need developed or explain what mix of technologies you believe are appropriate (i.e. Ruby for X, something else for Y).  Dealing with heterogeneous technologies, however, inevitably translates into extra cost for the business.
Comment: +1 I find many people on this forum focus on the academic reasons for a choice and seem to ignore the economics
Comment: +1 for bringing up the real business-related issues (and for writing most of what I was going to say, thus saving me the time :))
Comment: Ok, thank you for the realism lesson Justin and the effort writing the answer, I really appreciate it.
Comment: I would point out something that is hedged a bit in this answer: Your customer may be right. It may not be the technically superior answer, but as is pointed out his concerns may be valid, and RoR _could_ fizzle and die, however unlikely it seems. It is certainly good to provide your technical opinion, as a customer needs it to make an informed decision as well.
Comment: I could add a couple more business reasons or several technical reasons why Ruby is not the answer to every pet project around. But you nailed it pretty good, so two thumbs up!
Answer: For starters, you can direct you client here for a look at the ecosystem that exists around Rails. You can also point to the successful startups like LivingSocial, Shopify, 37signals, etc. that built their businesses with Ruby and Rails.
You can mention that massive enterprises like AT&T, SAP, and Symantec are using Rails, too (they were all heavily recruiting at RailsConf last year).
You can point out that a translations business has a lot to gain by using a language/framework that makes Unicode support and i18n relatively painless.
Ultimately, I think you need to sell the idea that being able to use Rails is a premium feature he gets by hiring you: "Of course all those other guys are using PHP. But you have the opportunity to have a modern stack powering your application."
At the end of the day, it also needs to be clear that what he's ultimately buying is your skill and expertise; if he was that knowledgeable on server-side web technologies, he wouldn't need you. Language and framework are implementation decisions, not requirements.
P.S. Don't mention Twitter. We're still trying to undo the bad PR Rails took from that.
Answer: He's talking about people, you're talking about a language and framework. He is not going to hear any reasons that are purely technical, so you should focus on what people are doing with the language. You can talk about people-power under Rails, how it's easier for one person to do more than a PHP person, faster (if this is what you believe). You can ask whether the prevalence of Honda drivers means it's a better car than a Rolls Royce, which is rarely seen. You can talk about what the community is actually comprised of, whether there are too many cooks in the module soup (gems vs. modules, etc.), whether everybody has NIH syndrome, and so on.
Regardless, it needs to be in terms of people because he wants to know that he can replace you. Help him to know this, because he (probably) won't want to switch away anyway. Your "expert decision" has absolutely no bearing when he gives much less care to what a given person knows. He just wants there to be "more people" who know the same thing.
At the end of the day, there's no shame in calling his bluff. "Fine, go with PHP. Good luck!"
Comment: It's always important to remember that firing the client is always an option.
Answer: I'd explain that it's basically a "Coke" vs. "Pepsi" choice.  Both are widely accepted, both have people that will fight and die for each, and they're both perfectly adequate.  Point out the reasons you prefer RoR.
Comment: I don't think that will be helpful in this situation. If it's truly a matter of personal taste, the likely response will be along the lines of "Well I'm buying, so use PHPepsi because the maintenance programming consultants will be cheaper for me down the road." Using Ruby needs to be a value-added proposition, and native multilingual support is a definite plus for a translation business.
Answer: Point out that the PHP crowd has more members because its the lowest barrier to entry and has been around longer. Make sure to point out that smaller communities have higher percentages of programmers worth hiring, PHP may have 10,000 good programers compared to 5,000 rails programmers, but the PHP programmers are hidden in a block of 100,000 compared to 20,000 for rails programers. (These numbers are made up, but it gets the point across.) Then you need to explain that the community really doesn't have a preference between PHP and Rails.
You can't use technical reasons on a non technical person, you can't explain why the iPhone is inferior to other smartphones to someone who only knows about what phones look like. You need reasons they understand.
Comment: The fact the numbers are made up kind of leads to the conclusion that the point is made up too. It may be true or false but that would require the facts to prove or disprove, which are absent. Without the facts, it's just "you suck because you play in another team", which is not very professional.
Comment: +1 for pointing out the importance of signal-to-noise ratio in dev communities.
Comment: I agree and have used this argument with technical superiors as well.  Chances of high quality PHP developers having jumped ship for Python or Ruby that have a working RFC and community contribution process increase each year.  PHP is the most copy and pasteable, low barrier to entry language, attracting the kind of developer you do not want.
Answer: Your customer hired you, so presumably he trusts your expertise. Explain that different professionals may prefer different tools, and your preferred tool happens to be RoR. Point out the presence of the community and the community acceptance that exists for RoR and successful companies like 37signals using it, to remove his concern that you are recommending some arcane technology that nobody but you knows about. Point out that you will be more productive using the tools you prefer (thus lowering his costs and improving his changes on success) and that if you or him ever need to find more RoR experts it won't be hard to do. If he's more technical you may point out how RoR can be successful in the tasks he needs compared no less than his preferred solution.
Avoid repeating FUD and generally disparaging PHP - if you're not an expert in PHP, there's a high probability you'll say something that is not accurate, wrong or highly controversial, and if your customer learns you were wrong on that it may hurt your credibility with him in other aspects.
Answer: Your boss has a point.  PHP is much more popular than RoR accoding to several sites that endeavor to keep track of such things. For example, see http://lang-index.sourceforge.net and http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html>.  I think it would be foolish to ignore the facts.
I suggest you acknowledge he has a point and then remind him that RoR is has a strong following too.  It wouldn't hurt to have a few links to popular sites built with RoR that you can show him.
After all, he is really looking for your assurance that he is making the right business decision and wants the evidence to back it up.  As the old saying goes "No one ever had arrows shot at them for recommending Microsoft."  Same goes for PHP in web development.  Give him solid facts and eschew opinions.  You'll do fine.
Comment: The original adage was "No one ever Got fired for buying IBM."  Perhaps they should have been, but...
Comment: Oh, I've been known to shoot arrows at people for picking PHP...  :-)
Answer: Translate your beliefs into quantifiable economic terms (if possible/valid). The fact that his business is translation specific suggests that RoR (or any language with native multilingual support) is technically superior to PHP - but this has to be offset against the costs of developers and server provisioning associated with those respective platforms. Their business is likely to last longer than your relationship, they will want reassurance that they are laying the right foundations.
IME, admitting the cons (as well as the pros) of your strategy is more convincing than any amount of evangelism - it suggests that you are more interested in solving their problem than using your favourite hammer.
Answer: Your customer could have a valid point.  Supply and demand affects prices.  If the supply of developers with a particular skill in the customers geographic area is low, the price for maintaining software requiring that rarer skill set could increase more over time than if the software were developed using a more popular language for which there was a significantly larger local pool of skilled developers.  So the issue could also be one of long term cost risk management.
Answer: When I have a client who is wanting to use a particular tool because it's "industry standard," has a "consensus," or is "what everybody's using," I point out to them that all those terms are code for "industry average."  That is, what most of the other people in the area are doing.  The "average" business fails.  Pick your tools based on the job requirements, not on what everyone else is doing.  There being fewer RoR programmers doesn't matter if the system doesn't need as much tinkering with when it's done.
Answer: Surely this is a business decision for both of you.
For you the questions are:

How much will it cost me to implement my customers requirements using Ruby on Rails?
How much will it cost me to implement them in PHP?
What value do I place on using my preferred environment?

For your customer, the question is

How much are the perceived benefits of PHP over Ruby on Rails worth to me?

If you provide your customer with a quotation with a Price for implementation using Ruby on Rails and a separate Price for implmentation using PHP, both based on the answers to your own questions, then your customer can make their own judgement call as to whether the extra cost now is worth possible future savings.
This is no different to them making a decision as to whether they should give the contract to you, or to another developer who would implement it using PHP as requested.
Answer: The best real world analogy I can come up with is "Would buy a Ford rather than a BMW just because BMW's market share is smaller?".
Comment: A strong possibility if all the BMW service mechanics were too far away, too costly, or very poorly rated by the consumer agencies for the buyers locale.
Comment: @hotpaw -- fair enough, but that is a rational consideration, market share on it's own is meaningless.
Answer: Ultimately, PHP programmers are half the cost of Rails programmers, and what you if you find a better job tomorrow? Your boss would be totally screwed and scrambling to find a Rails developer, and that takes time and money since Rails developers are in short supply.
The only reason your boss would agree to it is if it feels like it would make YOU happier, and that by allowing to make the decisions that you want you would be happier working for him, and thus be more productive.


could someone explain or prove the chain rule in first principles

Question: I understand that the derivative of a function can be evaluated from first principles. However I do not understand why dy/dt x dt/dx = dy/dx. Surely these terms cannot be treated in the same way in which you would multiply fractions. Could somebody please explain this intuitively?
Comment: You are right that they are not fractions. However, they behave like fractions so much that Leibniz thought they _were_ fractions, and that is reflected in his notation. Back to the question (at least the first principles part): have you tried just applying the definition and see what you get?
Comment: I have tried, but did not get very far
Answer: To explain the chain rule intuitively, we first need an intuitive notion of derivative, and to aid that, I will introduce an intuitive notion of function.
In this answer, a function is a mechanism that takes input by some manner of indication (I like to think about pointing) on one number line, and gives output by indicating (I like to think about a red dot appearing) on a second number line. As one moves the input, the output moves correspondingly in real time.
A derivative at a point $p$ in this model can be thought about the following way: first point at $p$ on the first number line, and note where $f(p)$ appears on the other number line. Then point at somewhere relatively close to $p$, and note how much the function moves its point on the second number line. As you choose your second point closer and closer to $p$, $f$ will indicate points closer and closer to $f(p)$ (this is what continuity means). These two distances are approximately proportional (this is the definition of differentiable), and they will get closer and closer to being proportional the closer to $p$ you move about. The proportionality constant that this almost-proportional relationship tends towards, is the derivative of $f$ at $p$, which we write $f'(p)$.
In other words, $f'(p)$ is the real number so that for any small number $q$, if we point at $p+q$, then the function indicates a point very close to $f(p)+f'(p)\cdot q$. ("Very close" does have a precise definition, but I'm leaving it out for now.)
Now let's look at the chain rule. Say we have the function $h(x)=f(g(x))$, and we're interested in the derivative of $h$ at $x=p$, expressed using $f$ and $g$.
First, how does the chaining work in our interpretation of functions? First, we indicate our input on one number line, and then $g$ indicates its output on a second number line. Then, $f$ uses that indication to produce its own output on a third number line. This entire mechanism is how $h$ takes input on the first number line and produces its output on the third line.
Finally, we come to the chain derivative. Let's start at a point $p$. On the intermediate second line, $g$ indicates the point $g(p)$, and on the final, third number line, $f$ (and therefore $h$) indicates $f(g(p))$. Then, we point to $p+q$ for some small $q$. By definition of derivative, on the second number line, $g$ indicates a number very close to $g(p)+g'(p)\cdot q$. Since $g'(p)\cdot q$ is still a small number, this means that $f$, again by our definition of derivative, indicates a point very close to $f(g(p))+f'(g(p))\cdot g'(p)\cdot q$.
Rereading the last point in terms of $h$, that means that if we give it $p+q$ as input, then $h$ gives us something very close to $f(g(p))+f'(g(p))g'(p)q$. But by definition of the derivative, it is supposed to give us something very close to $h(p)+h'(p)q$. We easily see that $f(g(p))$ corresponds to $h(p)$, add $q$ is still $q$. That means that $f'(g(p))g'(p)$ must correspond to $h'(t)$.
Comment: This is very nice. +1
Answer: I do not think I can do nearly as well as Arthur's answer in the way of intuition. However, one can prove it from "first principles:"
$$\lim_{x \to a}\frac{f(g(x))-f(g(a))}{x-a}=\lim_{x \to a} \frac{f(g(x))-f(g(a))}{g(x)-g(a)} \cdot \frac{g(x)-g(a)}{x-a}$$
where the second expression becomes $f^{\prime}(g(a)) \cdot g^{\prime}(a)$ since limits "distribute" over multiplication (since it is continuous), and then applying definitions.
My way of thinking about this is via "co-ordinates." If we "normalize" the $x$-axis to really be a function, then the chain rule says "the first is how fast something is moving with respect to this new function" and then you multiply by "how fast" (or sloped) our function was with respect to the stand-still $x$-axis.
Another less geometric way is to think of the graph $(x,f(x))$ of a single function and then define a function on this graph to merely be an output, a number associated to $g:f(x) \mapsto g(f(x)) $. With respect to $f(x)$, the derivative is just $g^{\prime}f(x)$, but relative to the axes, you also want to see how "sloped" or "fast" $f(x)$ is growing and multiply said rates.


Why do the guns in Battlestar Galactica have two barrels?

Question: In the re-imagined Battlestar Galactica series, the handguns that the military use seem to have two barrels. What are the reasons behind this?
Comment: One of the reasons could be identical to the reason as to why they have paper pages with cut corners. To differentiate our world and their's.
Answer: If you watch the season 2 episode where the Galactica has been boarded by a group of Cylons, Apollo is seen to load an armour-piercing round into the lower, larger bore, barrel of his sidearm. I guess that most other weapons are also dual-load with standard rounds and armour-piercing.
Comment: You can read more in this weird site: [Internet Movie Firearms Database](http://www.imfdb.org/index.php/Battlestar_Galactica). _"the weapon has an under barrel explosive launcher"_.
Answer: In addition to the advantages that Pearsonartphoto mentions, there are a variety of aesthetic reasons. As a TV show it is really important to have visual elements that identify the world when you see them. Being instantly recognizable, in this case via the double-barreled weapons and various uniform, makes it so casual fans of the show will be more likely to stop and watch as they are flipping through channels. It also helps to make the universe of the show feel more distinct, which encourages suspension of disbelief.
When a TV show is first 'broken' the creators will put together art bibles and other resources that help tie the show's visual aspects together into a cohesive unit. Not only does this help brand the show, but it sets a standards bar that helps the visuals of a show maintain a certain visual appeal.
That appeal could be intentionally slip-shod, which is the case with a lot of the syfy original movies that are striving for a B-movie quality. Or it could be a high bar meant to keep the setting of a show realistic, such as in a lot of HBO programs. It also can define a setting where low tech flotsam and high-tech marvels come together, like in Firefly.
Comment: Why is this the "right answer?" Anyone that has seen the whole series would know that the second barrel is a grenade\mini-rocket launcher. [Battlestar Wiki handguns](http://en.battlestarwiki.org/wiki/Pistol). "After that it was redesigned again and, starting with the early second season, the original sidearms have been nearly completely replaced by the Fabrique Nationale Five-seveN, also dressed up with an underbarrel explosive launcher." The handguns were aesthetic for the MINI-SERIES and parts of season 1, but always used 2nd barrel for armor piercing rockets.
Comment: @erdiede: This is the accepted answer because of historical reasons. The site was new, the now implicit "in universe" assumption to questions wasn't yet established. So an out-of-universe this is why they do things like this answer was acceptable back then. This answer speaks to why they designed it that way. Not to an in-universe explanation for the purpose of the second barrel.
Comment: That said. Add an answer. I'll upvote it. And @tonylo can come change the accepted answer if they wish.
Comment: DampeS8N it was actually @HorusKol answer that made me ask the question. I was under the impression from seeing the show that his was the "right" in-universe answer and I'm still fuzzy as to whether common sense or in-universe answers should take precedence... I guess I'll have to go lurk meta for a while
Answer: Double barrel guns have a number of advantages, they have quicker firing rates, reduced maintenance, and accuracy. Presumably they have some kind of a material that reduces the weight, but the double barrel still gives advantages. For more, see this Wikipedia article.
Comment: @BenVoigt I'm not seeing anything to indicate that the hand weapons on BSG were energy weapons - they appear to be projectile weapons, albeit with a different firing sound from modern weaponry. They also use other projectile weapons from machine guns, to the ship-mounted rail-guns. There's no energy weapons used in the BSG universe that I recall.
Comment: How would having 2 barrels instead of 1 increase accuracy? It should decrease accuracy since you're firing from 2 different positions and there's twice as much recoil/movement.
Comment: @Lèsemajesté: Reduced heating.  And two different paths through the atmosphere.  An energy bolt ionizes as it passes through the air, causing violent turbulence in its wake.  A second barrel allows a slight delay before the follow-on shot from the same barrel, allowing the turbulence to dissipate somewhat.
Comment: @Will: Sufficiently energetic kinetic projectiles also cause ionization and eddies.  Although turbulence is likely to have less effect on the following rounds, it will still have some.
Answer: The upper barrel of the sidearms is for regular ammunition, and the lower barrel is for high-explosive rounds.  In Vally of Darkness, the entire final battle is predicated on the use and reloading of these single shot HE rounds to defeat the cylon boarding party.  High explosive rounds have been used other times in the series, but this is the only time they are covered by the plot.
Comment: This is the only correct answer.
Answer: Because two is better then one. ;)  I should point out that many of rifles of our current armed forces have "two barrels" as well--the barrel for the "normal" ammo and one for the grenade launcher.
Comment: not "many", usually only about 10-20% (1-2 per squad) are so equipped :)