Do electrons lose energy between the battery anode and cathode?

Question: In a battery circuit, does an electron leaving the anode carry more energy with it than an electron returning, from having been through a machine, to the cathode? If not, how does the battery deliver power to a machine to function by simply transferring electrons from anode to cathode via a circuit?
Answer: Electric current is not a flow of energy; it's a flow of charge. Charge and energy are two very different things.
An electric current is a flowing motion of charged particles, and the <code>*particles do not carry energy*</code> along with them as they move. A current is defined as a flow of charge by I=Q/T; amperes are coulombs of charge flowing per unit time. The term "Electric Current" means the same thing as "charge flow." Electric current is a very slow flow of charges, while energy flows fast. Also, during AC alternating current the charges move slightly back and forth while the energy moves rapidly forward.
Electric energy is quite different than charge. The energy traveling across an electric current is made up of waves in electromagnetic fields and it moves VERY rapidly. Electric energy moves at a completely different speed than electric current, and obviously they are two different things flowing in wires at the same time. Unless we realize that two different things are flowing, we won't understand how circuits work. Indeed, if we believe in a single flowing "electricity," we will have little grasp of basic electrical science.
In an electric circuit, the path of the electric charges is circular, while the path of the energy is not. A battery can send electric energy to a light bulb, and the bulb changes electrical energy into light. The energy does not flow back to the battery again. At the same time, the electric current is different; it is a very slow circular flow, and the electric charges flow through the light bulb filament and all of them flow back out again. They return to the battery.
Electric energy can even flow in a direction opposite to that of the electric current. In a single wire, electric energy can move continuously forward while the direction of the electric current is slowly backwards. In AC circuits the energy flows continuously forward while the charges are alternating back and forth at high frequency. The charges wiggle, while the energy flows forward; electric current is not energy flow.
for more information visit this website
http://amasci.com/miscon/eleca.html#current
William J. Beaty Electricity Misconceptions
Answer:
In a battery circuit, does an electron leaving the anode carry more
  energy with it than an electron returning, from having been through a
  machine, to the cathode? If not, how does the battery deliver power to
  a machine to function by simply transferring electrons from anode to
  cathode via a circuit?

Yes, electrons move from the negative terminal of the battery, through the device, to the positive terminal of the battery (in the opposite direction as current flow).  Since they end up at a location of higher electric potential, and they are negatively charged, they have each lost an amount of energy equal to
$$
|q\Delta V|\;,
$$
where q is the electron's charge and $\Delta V$ is the battery voltage.
Inside the battery, chemical energy is used to move more electrons back up to the higher energy region (the negative terminal) where they again "fall" back though the circuit to the positive terminal. Rinse. Repeat.
Comment: Thank you, hft, for your lucidity. May I now ask two more questions? Firstly, how does the electron lose its energy within the device? Secondly, what is happening when the device is putting energy into the battery ie recharging it?
Comment: It is not possible for me to enter into a detailed discussion of how battery powered devices work from within this comment thread. In fact, that question seems a bit too broad for this forum, even outside of a comment thread. This forum is for specific physics questions. A better way to acquire general/broad physics knowledge on this topic would be to grab an introductory physics text book from your local library.
Comment: Just a simple metaphorical explanation.Electricity is consumed by resistors or motors...- any device that exerts energy to the outer environment by performing work, emitting heat radiation, light, etc. I remember there are six major forms in which energy transfers between boundaries. If you think the entire circuit as a dam plus a pump, the consumer components are like water turbines which harness water's potential, while the battery is pump that raises water from a lower altitude to a higher altitude. The 'pumping' process in reality converts chemical energy into electric potential energy.
Comment: Your water analogy is helpful, user202531, although I'm not sure where the dam is on the circuit. Is the battery a dam letting "water" out in spurts which then turns the turbines to drive the device? Is the pump the battery sucking back the reduced-energy electrons into itself, its chemical contents?
Comment: The loss of energy of the electrons in the circuit is a result of collisions - the electron is trying to move in the direction of the electrical force, but finds itself hitting obstacles. Transferring part of its energy to these obstacles generates heat (in a resistor), and the electron loses speed (kinetic energy); it then accelerates again under the electric field, until it hits something else. This stop-start is how the electron loses energy.


Life insurance and declining medical treatment

Question: Suppose Bob gets a typical term life insurance policy and pays the premiums through the contestability period. Bob is then diagnosed with a terminal illness. There are treatments for this illness which have a probability p of keeping Bob alive for the rest of the policy's term. If Bob elects not to receive any such treatments and, as a result, dies of this illness in the policy's term, does the insurer have grounds to deny or reduce the claim? Do those grounds depend on p? Do they depend on whether Bob is unable rather than simply unwilling to undergo treatment? Assume that there are no misrepresentations by Bob and the policy does not specifically cover this situation.
Answer:
Suppose Bob gets a typical term life insurance policy and pays the
  premiums through the contestability period. . . . If Bob elects not to
  receive any such treatments and, as a result, dies of this illness in
  the policy's term, does the insurer have grounds to deny or reduce the
  claim?

No. This is not one of the reasons that an insurance company is allowed to refuse to pay a death benefit when an insurance policy has become incontestable. Once premiums have been paid through the contestability period, the only grounds upon which the insurer may deny or reduce the claim are:

Bob isn't actually dead. A life insurance company almost never disputes this issue if it is presented with an apparently authentic death certificate, and it routinely requires claimants to provide it with a death certificate if it doesn't already have one in its file. But, if Bob walked into the insurance company's office alive and well, with his own death certificate, and handed it to the claims adjuster for the insurance company, the insurance company wouldn't write him a check.
After the contestability period expired, Bob stopped paying the premium, was given a warning that the policy would terminate or have a reduced premium if he didn't pay the premium by the end of the grace period for doing so, and he didn't pay the premium. In the case of a term life policy this failure to pay would result in the insurance company having no obligation to pay the benefit. In the case of a whole life policy that has not already had all premiums contemplated by the policy paid in full, failure to pay the premium will usually only reduce the amount of the benefit that is payable by the insurance company upon death relative to what it would have been if the premium had been paid in full.
Bob has transferred the policy to someone else who will be entitled to the benefit instead (e.g. in a viatical settlement or a transfer of the policy to an ex-spouse or trust).
Bob died after the life insurance policy expires for reasons other than non-payment of a premium (usually because the death happens at an age older than the age covered by the policy). For example, my life insurance policy has a provision that states that no life insurance benefit is payable and the policy terminates upon my 75th birthday. This reduces the premium I pay and isn't a concern to me because after I'm that old I won't need to make up for any lost income in order to provide for my children. Another kind of life insurance policy that doesn't always pay a benefit when the insured dies is a "second to die" policy that pays a premium only when both of the insureds (typically a husband and wife who anticipate a large estate tax liability at a second death) have died.
Bob had an accidental death policy rather than a plain vanilla life insurance policy. In this case, Bob's death from a terminal illness would not be considered accidental unless, for example, he actually died because a tornado hit the hospital he was in before he died from his terminal illness. What constitutes an accidental death is sometimes the subject of litigation.

The whole point of an incontestability clause (which typically makes the policy not subject to contest after one to two years) is to prevent life insurance companies from refusing to pay a death benefit in situations including those like the one described in the question.
Generally speaking, state law requires that life insurance policies to be incontestable after one to two years.
An incontestable policy can also generally not be contested on the grounds that misrepresentations were made in the application for the life insurance policy, and preventing refusals to pay benefits in these situations is the other main reason that life insurance policies become incontestable.
Note that even in the case of an accidental death policy, after the incontestability period expires, the life insurance company may not refuse to pay a benefit on the basis of fraud in the life insurance application. Once an accidental death policy is incontestable, the only reason the insurance company may refuse to pay a premium other than the reasons that apply to any other life insurance policy (as described above) is that the death was not accidental. Because it doesn't cover all possible deaths of the insured, accidental death policies are generally very inexpensive relative to the size of the benefit, compared to term life policies covering the same period of time for the same insured.
Also, even if the insurance policy was still contestable, the insurance company could not refuse to pay the death benefit if Bob had been truthful in his insurance application at the time that it was made and Bob had kept his premiums current through the date of his death. For example, if Bob applied for his life insurance policy in January and answered every question on his application truthfully thinking that he was healthy, his application was approved in February, he was diagnosed with a terminal illness in March, and refused treatment and then died in April, the insurance company would not have a right to refuse to pay his death benefit, although in that situation, the insurance company would probably conduct an in depth investigation before agreeing to pay the death benefit.
One of the reasons that the law doesn't allow insurance companies to refuse to pay in these situations is that (1) everyone dies eventually, so dying sooner only modestly adjusts the timing of when the benefit gets paid, and (2) the vast majority of people try to stay alive, even when there will be a death benefit payable when they die, if there is any realistic chance of doing so. Therefore, the economic cost to the insurance company of allowing some people to decline medical treatment when faced with a potentially deadly illness is very modest.
The contestability period only exists at all to prevent people from applying for life insurance policies and lying about their lack of a known terminal illness when they apply for life insurance, which would allow people to avoid paying a life time of premiums and still receiving a life insurance benefit. But, since a terminal illness is pretty much defined as something that is expected to cause you death in six months or less, a year or two of contestability is usually sufficient to prevent this potential loophole from being exploited by unscrupulous terminally ill people.
Comment: @Patrick87 life insurance pays out on suicide after the exclusion period
Comment: Just to make sure I understand - are you saying that after the contestability period, the benefit must be paid on death? What if, hypothetically speaking, one were to commit suicide publicly immediately after announcing on the record he did so for the sole purpose of collecting the benefit? From your answer I deduce the answer is that the benefit is payable, but is there no concept of utmost good faith and fair dealing at play here (or is it merely eclipsed by practical considerations, like it being vanishingly uncommon)?
Comment: @Patrick87 DaleM is correct. Indeed, I had a case where a life insurance policy paid out in a suicide case just a couple of months ago. The good faith obligation falls pretty much entirely on the insurance company. The insured's duty is merely to pay the premium.


What does "compex" refer to in "complex queries" on unstructured overlays for P2P architecture?

Question: About P2P, I know that structured overlays are good for exact-match query. And I read that unstructured overlays are good at complex query. I didn't understand what "complex" refer to here, in what sense or logic ?
Answer: Make sure you understand what "structured overlays" means.
Structured p2p networks are actually distributed hash tables that work with KEY/VALUE pairs (like a simple hash table).
Ill try to make it much simpler, Lets say you are connected to a p2p network and you'd like to download a new song.
First you have to find resources, how do you do that?
In structured p2p networks (DHT) you have to take the filename and creates a key by passing it through an hash/checksum function - Now you got the key, the next step is finding the peer that stores this key => the network is organized, the routing process is based on the key.
Do you see the problem here?
These keys are uniqe, It means you need the EXACT key in order to reach the peer which stores the needed information.
For example, It makes keywords search operation quite difficult.
"New_song.mp3" and "new_song.mp3" will produce completely different keys.
Then if someone in the network shares the file - "New_song.mp3", you wont find it by searching "new_song.mp3".
In unstructured a peer just flood the network with a search query - It is not a key based routing which makes it alot easier to handle such search queries.
To solve this "problem", we can publish many keys of the filename's variations.
(lower case, upper case, without spaces / extension, etc)
Thats how Kademlia network solves this problem.


Why does the solar corona appear white?

Question: Look at this photo taken in France during the 1999 solar eclipse which I found on Wikipedia. Why does the corona appear white? It has a temperature of about $10^6\,$K so you would think that it would maybe look more like violet?
Answer: The light that is seen in the photo is white light from the solar photosphere that is Thomson-scattered from free electrons in the corona into the line of sight (see diagram below).

The hot, optically thin corona, hardly emits any visible light itself (just a few isolated emission lines, the brightest of which is in the green at 530 nm, and almost no visible continuum) in comparison to the scattered luminosity from the photosphere.
What you are seeing is essentially light with the same spectrum as the solar photosphere (which appears white to the human eye), since the Thomson scattering cross-section is wavelength independent and does not change the spectrum of the scattered light.
A statement from Rusin et al. 2010 from their paper "Comparing eclipse observations of the 2008 August 1 solar corona with an MHD model prediction":

While the white-light corona is essentially the light of the photosphere scattered on free electrons and dust particles in the vicinity of the Sun and is quite easy to observe, the radiation of the emission corona is associated with specific spectral lines (e.g. Billings 1966). It is the inherent radiation of the corona by highly ionized elements of iron, calcium, nickel, etc. A great majority of the corresponding lines lie in the extreme UV or X-ray part of the spectrum; in the visible region there are only about 28 lines, the brightest of them being Fe XIV at 530.3 nm

NB The pink light is intrinsic light from the solar chromosphere, which is denser than the corona and hotter than the photosphere. The colour arises from various bright ionic emission lines.
Comment: @Ruslan No it does not. The light **from the corona** is nothing like a blackbody. The light that is seen is not light from the corona it is merely scattered light.
Comment: @Ruslan The details are what matters here and explain why the corona appears white. You have clearly not understood where the light is coming from and instead have discussed  emission from a blackbody with "an extremely high temperature", thus reinforcing the misconception that the OP had in the first place.
Comment: @jpaugh I can't see what is ambiguous about my conclusion that the corona is white due to coronal electrons scattering photospheric light and that the intrinsic optical light from the corona is negligible and concentrated in a few bright spectral emission lines? The sky appears blue because of Rayleigh scattering, not Thomson scattering, but otherwise your summary is correct (though it simply rewords my first two paragraphs), so you must have learned something.
Comment: _"So what you are seeing is essentially light with the same spectrum as the solar photosphere"_ — this contradicts your comment to my answer, since if this statement is true, then the spectrum is not too far from black body emission, see [this comparison of solar spectra with a BB spectrum](https://en.wikipedia.org/wiki/File:Solar_spectrum_en.svg).
Comment: That's just the details of the mechanism of how the light comes to the observer. It's like saying that the light **from the sky** is not blue, because it's merely scattered sunlight (or, the light **from the clouds** is not white for the same reason, if you want to emphasize wavelength independence here).
Comment: OK, I see your point now.
Comment: @RobJeffries I can barely follow your argument, but is this the gist of it? "The wavelengths actually emitted by the corona are not white (because they're not equally distributed across the visible spectrum), and in fact, are mostly invisible. In fact, the white light we see is emitted by the photosphere, which is scattered by the corona, causing the corona to appear white --- via a similar mechanism to that which makes the sky appear blue."
Comment: @RobJeffries Your answer states a lot of facts, but draws few conclusions. That writing style is exceptionally robust against thoughtless comments, but is also robust against educating those less informed than you. Pick your poison, I guess. :-)
Comment: @RobJeffries Could you please explain the differences among the corona, photosphere, and chromosphere, particularly wrt their physical placement.  Without understanding that, I can't understand your answer.
Comment: @ttonon The photosphere would be where the black occulting disc of the Moon is. The chromosphere is the brightly coloured regions immediately around this. The corona is a much more extended region which is revealed by the scattered white light.
Comment: @ttonon Maybe a picture helps.
Answer: It's unreasonable to expect that any object with approximately-blackbody emission spectrum will have violet color at any temperature. Actual Planckian locus spans colors from red through orange to yellow, white and finally sky-blue, with the latter color achieved at extremely high temperatures.

Now, in addition to this, generally photos can't be relied on to judge the colors. In particular, a photo may have some unspecified white balance, which may be whatever the camera decided it should be, and additionally it may have been altered by post-processing. The actual color should be determined from the spectral power distrubution of the light source.
But, the above is not really relevant to the solar corona. The color of the corona, visible to an observer on the Earth, is mostly not the thermal emission from the coronal matter. Instead it's the light from the solar photosphere, scattered by the corona. Actual thermal emission from the corona consists of some 28 visible spectral peaks (see the answer by Rob Jeffries for details), and more peaks in the UV. They don't influence the color of the corona as much as the scattered light.
Comment: The spectrum of the corona is nothing like a blackbody and the light in the photo is not the intrinsic spectrum of the corona.
Comment: @RobJeffries yeah I guess so. But I've failed to find the actual SPD curve for visible region. All the data I've been able to find were either lists of specific spectral peaks, or curves for far UV range. But there should be quite a noticeable continuous background in the visible range. I'd appreciate if you (or someone else) could point me to the relevant data.
Comment: @RobJeffries the answer is now edited to address your concern.
Answer: The colours that you see in the image are not necessarily what you would see with the naked eye. The image colours will depend on the filter and the characteristics of the film used to capture the image. The information about this image on Wikimedia Commons also suggests that it has been "photoshopped" to enhance contrast.
Comment: Whilst the image may have had its contrast messed about with, the visible light that is seen around the Sun during an eclipse is indeed white.
Comment: Thanks. Does that mean it is still white, just a lot fainter than this picture would suggest?
Comment: Also, contrast is an issue. Whilst a detector outputs numbers, the eyes does not. A full moon up in a clear night sky looks white or yellow in spite of being more similar to a wheatered asphalt.
Comment: Also note: While I know nothing about the specific image in the OPs question, the colors in many astronomical photos are [_false colors_](https://en.wikipedia.org/wiki/False_color), possibly derived from images taken in other-than-visible light, that either are chosen to convey some specific information or, are chosen for aesthetic reasons.

Why does the solar corona appear white?


passive motion sensor

Question: I would like to get a microcontroller out of sleep when the board starts moving (or vibrating). If possible it should just be a passive switch (I only need a positive edge from a battery to get the board started, and I don't care about other behaviour).
I was first thinking of a TILT switch, but I think it is a bit too restricted (i.e. 15DEG in a predefined direction...).
Think of a bicycle light that should start shining when a bicycle starts moving. However, this is for a big machine.
Preferably surface mount.
Is there a proper name for those sensors (I keep on hitting on PIR sensors)?
Comment: I'm not sure if you want a PIR sensor - those detect movement in infrared, and the signal requires conditioning for proper detection. Along the lines of a tilt/vibration sensor, I came across this, which is SMT, simple, and small, https://signalquest.com/product/components/sq-sen-200/ (http://www.glynstore.com/signalquest-sq-sen-390-tilt-sensor/).
Comment: DigitalNinja, this is indeed what I am looking for, if you put your comment as an answer I will check it. Not digikey sourceable, but that is MY problem :)
Comment: I think PIR sensors would not help because it would detect humans only as far as I know...however I may be wrong so first if you would like...do some experiments with Pir sensor whether it would detect ur board or not.
Comment: no no no, no PIR sensors, this is really very different from what I look for. DigitalNinja sent a great link! That's my answer!
Answer: As I mentioned in my comment, PIR sensors work well for detecting movement in infrared (mainly used for human occupancy detection) and require signal conditioning.
I think a tilt/vibration sensor would work well for your application and this one happens to be small, surface mount, and acts like a simple open/close switch. Even one of the applications listed is for "motion trigger wake-up". They come in a few different part numbers which you can look over (there's a "mini" version which is even smaller!). They are kind of expensive when it comes to a board component, and a little hard to find, but you will probably get a price break if you are making a bunch of these boards. If not then it's a one time cost for something that seems to do exactly what you want. I didn't try very hard to find any other stores/distributors that carry it. Maybe you can find some more.
Manufacturer link: https://signalquest.com/product/components/sq-sen-200/
Store: http://www.glynstore.com/signalquest-sq-sen-200-omnidirectional-tilt-vibration-sensor/
Variations:
http://www.glynstore.com/signalquest-sq-min-200-omnidirectional-tilt-vibration-sensor/
http://www.glynstore.com/signalquest-sq-sen-390-tilt-sensor/
http://www.glynstore.com/signalquest-sq-sen-815-tilt-sensor/

passive motion sensor


Blocking Upload button on a modern site

Question: I have no access to SPFX, or any dev tasks , else this would be breeze. Has anyone at all successfully blocked the upload button and new button (not to be even seen) and allow a user to edit the document, rename the document and delete the document ? It would be miracle if anyone has successfully done this - I am banging my head with Sharepoint permissions and I cannot seem to be able rename without the Add document permission. And the add document permissions allows use of upload... any ideas what so ever ?
Answer: No, you are right. You will have to give up the ability to rename items if you wish to block Add item.
Comment: yes I have sorted it, but we cannot rename but we can do delete, and no add a nd no upload / new buttons. Just use contribute access and replicate it and remove the add tick.
Comment: Makes sense as a rename is an Add and Delete behind the covers

Blocking Upload button on a modern site


How to receive IR signal in PIC18F

Question: I need to receive signal from IR transmitter LED. I am not sure how to program the microcontroler. I am looking for some concept, how to do that. Whether I have to use A/D conversion? How to synchronize transmitter and receiver? What structure will be in coming data? Let's say that I assumed 600us for 0 (binary 0) and 1200 for 1 (binary 1) when I was programming a transmitter. What are the common steps to receive infrared transmission on PIC18F microcontroler?
Comment: Try http://electronics.stackexchange.com
Answer: It depends on the protocol you're trying to send over IR. If you can use RS232 and FM, then you just need an FM decoder (a PLL will do) and you can connect it to the PIC's serial port.

How to receive IR signal in PIC18F


Install ruby 2.2.3 via apt

Question: How to install Ruby 2.2.3 via apt on Ubuntu Wily? I tried sudo apt-get install ruby2.2-dev and sudo apt-get install ruby2.2 (What's the difference, btw) and both commands seem to have installed quite a bunch. However, there's no ruby executable afterwards.
Comment: @maetsoh Why would I install every single package with apt, _except_ ruby? I like package managers.
Comment: do you absolutely install want to install ruby 2.2.3 via apt ? The *-dev package contains headers and files that * may need to function correctly.
check the official https://www.ruby-lang.org it contains the information you need to install ruby 2.2.3 correctly
Comment: please refer if it is useful [https://gorails.com/setup/ubuntu/15.10]
Comment: Is Ruby part of the "alternatives" mechanism on Ubuntu? If not, it might be worthwhile using something like [rbenv](https://github.com/sstephenson/rbenv) to manage Ruby installs. Especially if you need to use different versions of Ruby at the same time. Soft-linking can get a little tiresome when doing Rails development, etc.
Comment: I use rbenv locally for switching versions, so it's worth the hassle.But on production I only need 1 ruby version, and then I prefer the standard package manager.

I'll read up on the "alternatives" mechanism. (http://manpages.ubuntu.com/manpages/vivid/en/man8/update-alternatives.8.html)
Answer: Ok, this worked for me on vivid at least:
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.2 ruby2.2-dev

On wily, I get an error because the URL http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/dists/wily/main/binary-amd64/ is missing, there's only http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/dists/devel/main/binary-amd64/.
Comment: same on debian jessie :/
Answer: apt-get install ruby2.2 does give you a ruby executable - it's just called ruby2.2.  Gem and irb are the same (i.e. gem2.2 install bundler will work, irb2.2 will give you an irb prompt.)
This is normal in Ubuntu and the alternatives system generally means you don't have to care about it, but for whatever reason ruby isn't managed by alternatives in Ubuntu.  But we can make it:
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby2.2 400 \
 --slave /usr/bin/rake rake /usr/bin/rake2.2 \
 --slave /usr/bin/ri ri /usr/bin/ri2.2 \
 --slave /usr/bin/rdoc rdoc /usr/bin/rdoc2.2 \
 --slave /usr/bin/gem gem /usr/bin/gem2.2 \
 --slave /usr/bin/irb irb /usr/bin/irb2.2 \
 --slave /usr/share/man/man1/ruby.1.gz ruby.1.gz /usr/share/man/man1/ruby2.2.1.gz \
 --slave /usr/share/man/man1/rake.1.gz rake.1.gz /usr/share/man/man1/rake2.2.1.gz \
 --slave /usr/share/man/man1/ri.1.gz ri.1.gz /usr/share/man/man1/ri2.2.1.gz \
 --slave /usr/share/man/man1/rdoc.1.gz rdoc.1.gz /usr/share/man/man1/rdoc2.2.1.gz \
 --slave /usr/share/man/man1/gem.1.gz gem.1.gz /usr/share/man/man1/gem2.2.1.gz \
 --slave /usr/share/man/man1/irb.1.gz irb.1.gz /usr/share/man/man1/irb2.2.1.gz

Running this will register ruby with the alternatives system and, as there's only one choice, set ruby 2.2 as default.  This will create symlinks and let you use ruby/gem/ etc. without adding 2.2 on the end.
This is a slightly updated version of instructions found at https://leonard.io/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/
Comment: update-alternatives: error: alternative gem can't be slave of ruby: it is a master alternative

Install ruby 2.2.3 via apt


How to position the 1.5 kΩ pull-up resistor on USB Type-C D+ connection?

Question: I am designing a TYPE C plug with STM32L432KC MCU and was wondering how to physically position the 1.5 kΩ pull-up resistor on D+ connection.
(male plug --- ft323 --- mcu)
Should it be next to the MCU or close to the receptacle or what?
Does it even make a difference?
Comment: Which exact FT232 model? The MCU is irrelevant if FT232 connects to USB. And what is the purpose of FT232 as the MCU has built-in USB?
Comment: its is FTDI chip i want to connect this product with a mobile so i need a transceiver and  d+ d- from male plug to ft232 and rx and tx from mcu to ftdi232
https://www.ftdichip.com/old2020/Support/Documents/DataSheets/ICs/DS_FT232R.pdf
Answer: The datasheet says FT232R chip has an internal 1k5 pull-up resistor on D+.
You don't need an external 1k5 resistor on D+.
Depending on what you want to achieve, you may not need the FT232R either. The MCU has a built-in USB, which in most cases could be used communicate USB directly without FT232R.
Comment: can I connect directly mcu with mobile using a type c male plug?
Comment: can I connect directly mcu with mobile using a type c male plug? i want to communicate mcu with mobile app that was I aim so i thought rx and tx from mcu is used for print the needed output and receive the command from mobile app and ft232 works as transreviver d+ and d- for  data from mobile and VBUS for power up the mcu
Comment: @BalajiNadar I believe ST provides an USB library to make an USB "virtual COM port" using CDC ACM and I believe phones support it. Feel free to correct me if I am wrong. But your original question is now answered.

How to position the 1.5 kΩ pull-up resistor on USB Type-C D+ connection?


Beginner with iOS UI Design

Question: I want to start designing iOS app UI in Photoshop but I can't find up-to-date tutorials and informations about document resolution, ppi of document, getting retina ready and complete guide for it. Does anybody know any good tutorials?
Comment: Why would PPI matter if you design for the screen?
Comment: PPI = Pixels Per Inch. Android has many different PPI across its devices, iOS has a few, it's still an issue. He's asking where he should start, in terms of a PPI, so he can assess the quality of the artwork in actual pixels. I think.
Comment: are you sure the [Apple Developer guidelines](https://developer.apple.com/ios/human-interface-guidelines/graphics/image-size-and-resolution/) doesn't cover that?
Comment: Tutorials on using Photoshop for UI design? I'm 100% sure it doesn't cover that. I'm answering the joojaa question about importance of PPI consideration.
Answer: This information is fragmented, like Android device resolution. Apple stopped caring about designers when they realised the iPod was way more successful than their pandering to the DTP community ever made them.
This, combined with a near pathological disdain for Adobe (largely warranted) means they don't provide useful templates or other resources to work in 1x, 2x and 3x at the same time.
And then there's the enormous fun of the scaling on the iPhone 6/6S/7 PLUS models.
As a starting point, that's not ideal, begin working in the lowest resolution of the smallest device you'll be targeting. Probably the iPhone 5/5S/SE's 4 inch display, which is 1136x640
This is a 2x screen. You don't really need 1x graphics anymore. But you do need 3x plus a scaling offset for the Plus series phones. All the iPads now run at 2x.

Beginner with iOS UI Design


Rabbi Shlomo Goren and the Langer Case

Question: I am trying to understand the Langer controversy. I have only have seen the Charedi side been explained. Are there any seforim/books/online articles which explain Rabbi Goren's position?
Comment: @pcoz Depending on who you believe, R. Yosef Eliyahu Henken.
Comment: @pcoz [אות כד](https://hebrewbooks.org/pdfpager.aspx?req=20022&st=&pgnum=210)
Comment: I heard from someone who worked in Ezras Torah at the time that Rav Henkin did not allow anyone to speak against R Goren but not that he agreed with him
Comment: There was a significant *posek* in America (can't remember who) who agreed with Rav Goren.
Comment: And if I'm not mistaken, R. Goren's decision did not occur in a vacuum. Had he not found a heter, there was very serious political pressure to massively curtail the Chief Rabbinate -- no?
Comment: The Artscroll Rav Ovadia biography has a whole chapter on it and is very strongly against the position of Rav Goren as per Rav Ovadia's stance.
Comment: As does the Artscroll book on Rav Elyashiv
Answer: R. Goren wrote a 200 page book explaining his position (linked in Joel K's answer). If you're looking for something shorter and easier, R. J. David Bleich discussed this topic in the first volume of Contemporary Halachic Problems (p. 167 - 176). He summarizes R. Goren's five pronged argument as follows:

Rabbi Goren, claiming to have had additional evidence not available to the rabbinical courts which had previously held hearings on the matter, bases his decision on the following considerations:

There exists no admissible evidence attesting to Avraham Borokovsky's conversion to Judaism.

In the event that a valid conversion ceremony did take place, the conversion was nullified by virtue of the fact that Borokovsky continued to live as a practicing Christian. Rabbi Goren cites Zofnat Pa'aneah, (a commentary on the Mishneh Torah authored by the late Rabbi Yosef Rosen, in which Rabbi Rosen interprets Rambam as maintaining that subsequent idolatry on the part of a convert is tantamount to proof that the original conversion was insincere and hence invalid.

The original wedding ceremony between Chava Ginsberg and Avraham Borokovsky took place in a church. There is no evidence, argues Rabbi Goren, that they were subsequently married in accordance with the law of Israel.

The conversion of Avraham Borokovsky, if it indeed did take place, was the result of coercion on the part of Chava Ginsberg's father hence is null and void.

Even if the conversion were to be accepted as valid, Borokovsky, since he subsequently reverted to the practice of Christianity, would have the status of an apostate. Ba'al ha-Ma'or maintains that an apostate is not biblically qualified to issue a bill of divorce; according to Ba'al ha-Ma'or, a divorce executed by an apostate is valid only by virtue of rabbinic decree. It is, however, axiomatic that rabbinic legislation cannot validate a divorce which is biblically invalid. The formula invoked in such situations is an annulment of the original marriage. Such annulment is within the province of rabbinic jurisdiction, since all marriages are conducted according to "the law of Moses and Israel." The term "law of Moses" refers to biblical law, while "law of Israel" encompasses rabbinic legislation. Rabbi Goren argues that since Borokovsky is to be deemed an apostate, the bill of divorce which he ultimately delivered to Chava Langer had the effect of retroactively annulling their marriage. As a result, she was yet an "unwed woman" in the eyes of Jewish law at the time of her involvement with Otto Langer and hence the issue of that union are not to be considered bastards.

(This should not be taken to mean that R. Bleich supported R. Goren's position. Indeed, much of the rest of the article consists of counterpoints to these arguments.)
Comment: For those unfamiliar with the case, even after having read the linked wikipedia article in the question, could you please clarify who Avraham Borokovsky is? My guess is it's the woman who married Langer's 'first husband'?
Answer: You can read Rav Goren's own explanation of his pesak din here.
Comment: @sabbahillel It took R. Goren 200 pages to explain his position, so it won't be that easy to summarize it in a paragraph.
Comment: @sabbahillel The question asked for "seforim/books/online articles which explain Rabbi Goren's position" so this is a valid answer without a summary and is not the ordinary case of "link only" answers. (I'm not saying a summary couldn't improve it, but it's not strictly necessary.)
Comment: You should summarize the psak.
Comment: +1 for this website reference, it's amazing to find the whole teshuva

Rabbi Shlomo Goren and the Langer Case


Should some questions be retired?

Question: In the computer/software world technologies advance fast.
Some questions that where answered in 2008/9 are no longer relevant, or will be none relevant in the future.
But SO still keeps them and Google will still fetch them as a high ranking result.
Should there be a mechanizem to retire or some how archive no longer relevant questions/answers?
Comment: How about some specific examples?
Comment: similar:  http://meta.stackexchange.com/questions/98589/automatic-visual-indication-of-old-questions
Answer: There are a couple of problems with retiring old questions.

They are too localized.  The problem is, moderators do not get involved in judging content; i.e. a flag indicating "This answer is wrong" is not actionable.  It's not the role of moderators to judge posts by accuracy of technical content or timeliness.
There still might be the off chance that some people are maintaining an old technology, so answers like this are still potentially useful to someone.
Comment: @ItayMoav: if that's the case, I believe you should comment to that effect and/or edit your question to explain that that previous question does not apply to version X.Y.Z of the framework/language/library you are using. I'm pretty sure a mod and/or 10k users would reopen the question if that is indeed the case.
Comment: Well, I'm probably in the minority, but I don't generally close a question as a dup if the original is very old, or has crappy answers.
Comment: The issue, and I am sorry I do not remember of the top of my head the exact example, it was not in my account, My team needed to ask some question which had an old duplicate with irrelevant answers for us (I believe it was answered with IE 6 in mind). But, our question was closed for being an exact duplicate.
Comment: Sadly, you are :-)
Comment: @Mat - but how will they know it is there among the hundred of questions opened each day? Is there a flag option for this case?
Comment: You can flag it (use the "Other..." reason and explain your case clearly but succinctly), or you could ask about it here (with a link to the question obviously) (that's been done a few times), or, if there is commenting activity on it, you might not need to do anything - if the question is good, it does happen that it gets sufficient views to get re-opened "organically". But the question has to be _good_.

Should some questions be retired?


Is there a good way of securing an ASP.Net web service call made via Javascript on the click event handler of an HTML button?

Question: The purpose of using a Javascript proxy for the Web Service using a service reference with Script Manager is to avoid a page load. If the information being retrieved is potentially sensitive, is there a way to secure this web service call other than using SSL?
Comment: Any reason for not using ssl?
Answer: I would use ssl it would also depend I suppose on how sensitive your information is.
Answer: If your worried about other people access your web service directly, you could check the calling IP address and host header and make sure it matches expected IP's addresses.
If your worried about people stealing information during it's journey from the server to the client, SSL is the only way to go.
Answer: I would:

Use SSL for the connection
Put a time and session based token in the request
Validate the inputs against expected ranges on the server

SSL prevents man-in-the-middle
Tokenized requests verify that the request is coming from an active and authenticated session, within a reasonable amount of time from the last activity within the session. This prevents stale requests being re-submitted and verifies that it came from the source of the session (store the IP address, user-agent, etc on the server for session management).
Validating that the inputs are within expected ranges verifies that the request has not been doctored by the party that you are talking to.
Answer: Though SSL would be best, there are a number of client-side cryptography libraries that could alleviate some of the security concerns - see https://github.com/jbt/js-crypto for a nice collection


How to calculate MAX server memory and MIN server memory?

Question: There is a total of 10GB of RAM. I want to set MAX server memory and MIN server memory for SQL Server. How do I set this? Would 20% of the total RAM for the MIN value and 80% of the total RAM for the MAX value be a correct calculation? Or would 60% of the total RAM for the MIN value and 80% of the total RAM for the MAX value be an accurate calculation? The question I want to ask is is there any method to calculate these values?
Answer:
Below powershell dbatools commands gets and sets automatically the instance max memory to the recommended, it uses calculations from Jonathan Kehayias's post about SQL Server Max memory

<code># Calculates SQL Max memory based on server configuration
Test-DbaMaxMemory -SqlInstance SqlInstanceName

# Gets current configured SQL Max memory
Get-DbaMaxMemory -SqlInstance SqlInstanceName

# Sets recommended SQL Max memory
Set-DbaMaxMemory -SqlInstance SqlInstanceName
</code>
Ref:
Test-DbaMaxMemory
Get-DbaMaxMemory
Set-DbaMaxMemory

For Min SQL memory, unless the host is a multi tenant instance it is recommended to leave it default value 0. If there are multiple instances of SQL Server running on a single host, it might be beneficial to set a minimum memory amount to ensure a base level of performance.


How does hunting instinct work?

Question: I had an enclosure going with a Triceretops and some other small, cheap herbivores. At some point I got a contract to hatch a carnivore, so I figured, why not introduce a Ceratosaurus in the habitat? I figured I'd have to occasionally replace a herbivore to keep the flock going, but otherwise did not expect what happened.
The Ceratosaurus has now butchered its way through roughly 20 dinosaurs, and does not seem to consider giving up its career as a psychopathic murder machine anytime soon.
I do have a live bait feeder as well, which claims it'll "help satisfy Dinosaur hunting needs", but it doesn't really seem like the dinosaurs even have a hunting need, they just kill everything they come across.
So is there actually a "hunting instinct"? Or are the dinosaurs just programmed to kill everything they come across, hunger be damned?
Answer: Carnivores will kill herbivores as their highest priority, regardless of whether they're hungry or not.

How does hunting instinct work?


Notation $\dot{=}$ Amann's book Linear and quasilinear Parabolic Problems

Question: Do someone knows this notation $\dot{=}$? I'm studying Amann's book and he uses this notation but I couldn't find a definition in his book. For example, he writes
$$E_1\cap E_0\dot{=}E_1\ and \ E_0+E_1\dot{=}E_0 \ if \ E_1\hookrightarrow E_0.$$
Comment: "approximately equal to" ? As far as I know. also see https://en.wikipedia.org/wiki/Equals_sign
Comment: In the abstract evolution equations literature, this is symbol usually means equivalence in the sense of Banach spaces (equal as vector spaces and having equivalent norms).
Answer: According to Wikipedia it is a symbol used for definitions like $\equiv$ or similar symbols.
Comment: I think that it. He also uses the symbol $:=$, so I believe that it means "is defined as" and as you said $\doteq$ means "is equivalent to ". Thank you.


Answer with explanation and patch removed from response

Question: Last week I came across an answer that helped me out immensely. Since the time of that post, the base code has changed making the "patch" within the answer a little difficult to apply, so I created my own patch and contributed it to the list of answers. Since I'm new to StackOverflow, I couldn't respond inline with the other answer. Therefore I posted a new answer below, referencing the previous answer, some context, and a link to the patch. However, user bluefeet removed my answer. I reached out to him to determine the reason, but he simply asked me to post my question here. Could someone please assist in this matter? Thank you.
Comment: A plain link to a customized patch of yours (even it originated in another answer) is likely not useful to other users without some amount of explanation.
Answer: The answer was flagged by another user as being a link-only answer. In general, the community frowns on answers that consist of little more than a link to an external site. These links have a tendency to go away after a while, leaving dead-ends here. We've been instructed to remove "see my tutorial" kinds of link-based answers.
However, something like a patch is difficult to express without a link. In your case though, your answer really wasn't a standalone answer but was an expression of another answer. As you don't have the reputation to leave it as a comment, I've converted it to a comment on the appropriate answer. That way, it can add to the value of the original answer yet not be too much of a problem if and when the link goes away at some point in the future.
Comment: Thank you for both moving my question to the correct location (I thought I had place it on meta.*, but obviously not), and moving my comment. I definitely appreciate it.


How to sub-divide a hexagonal grid reference system

Question: I have been using @amitp's excellent guide (and javascript library) to create a hexagonal grid system https://www.redblobgames.com/grids/hexagons/. I'm using flat-top, inverse-y cubic/axial system. However, I have elements that are located on the vertices, rather than "within" a tile. How would I refer to their position? I have considered using the index of the corner, but then the question is which  tile do I use as my base? I would also like to extend the concept so that I could precisely position an element anywhere within a tile. I am thinking of something relating to the Ordnance Survey's method of sub-division within the British National Grid (OSGB 1936) but I cannot get my head around how this relates to a cubic/axial coordinate system.
Comment: Maybe not the most elegant way, but if you refer the coordinate as a tripled of the 3 tiles, you dont have the problem of deciding which one is the base tile and you always can refer to the corner. For the side you just need to refer two tiles, for within a single tile with the offset
Comment: An interesting idea but effectively that results in a fairly complex and inconsistent data storage:
[q,r,s] for centre of tile;
[[q,r,s],[q,r,s]] for edge;
[[q,r,s],[q,r,s],[q,r,s]] for vertex.
And I'm still none the wise how to do the offset within a tile. And as for calculating distances between these...
Comment: Possible duplicate: https://gamedev.stackexchange.com/questions/167628/how-to-efficiently-no-pointers-store-hex-grid-with-shared-edges-and-vertices/167630#167630
Answer:
I have considered using the index of the corner, but then the question is which tile do I use as my base?

In an (infinite) hexagonal grid, every hex got 6 adjacent vertices and every vertex is shared by 3 adjacent hexes. That means that if you want each vertex to "belong" to one and only one hex, then each hex would have to "own" two vertices. That way every vertex would have an "owner". Which two vertices? That's up to you. If you choose the same two vertices of each hex (the upper pair, the lower pair, left&right, or any other), then you will notice that every vertex now clearly belongs to a hex.
Unless, of course, if you have a finite grid. Then you would have vertices at the border which would need to be owned by a "virtual" hex that's outside of the grid. But that's a problem you have with rectangular tiles as well.
That means you can address every vertex by the address of its owning tile, plus an additional bit for "left vertex" or "right vertex".

I would also like to extend the concept so that I could precisely position an element anywhere within a tile.

In that case I would use a sub-coordinate system for position within the tile. For consistency, I would recommend to use the same axis conventions as you are using for the tiles themselves. But that might depend on your requirements and personal preference.
Answer: Only regarding your first question

but then the question is which tile do I use as my base?

ANY as long as you use a consistent scheme.
For example ALWAYS find the leftmost tile (you need phantom extra ones for the edge of your map), and then (if applicable) the topmost of the two possible ones.
And then you only have one line (with a bent) on which to place any objects
Answer: An answer depends on a couple of facts: Can your elements only rest on vertices? If not can they move from a vertex of a hex to the center of that hex?
My first thought on this question was to set each vertex's coordinates to the average of the coordinates of the 3 hex' surrounding it, for instance, if a unit was on the vertex between the three tiles [0, 0], [0, -1] and [+1, -1] it would have the coordinate [0.5, -1].
But this results in two issues: one the vertex coordinates aren't unique when compared to the hex coordinates (There is a [-2, +1] tile and its rightmost vertex is also [-2, +1]) and two, referring back to my questions, if the elements can move from vertices to hex center's then when working out the distance becomes weird. Basically the distance from a vertex to an adjacent vertex is 1, from a vertex to one of the connected hexes' centers is also 1 and from a vertex to another vertex that is 2 vertices away (i.e. with flat top hexes from the left most vertex to the top right vertex) is a distance of 1.5 .
In other words the distance from hex to hex becomes equal to that from vertex to vertex with a couple twists.
Hopefully this helps, if you need images to show what I'm describing I can create them but  I would rather wait for you to ask for them first.
Comment: While exploring other questions I came across [this](http://www-cs-students.stanford.edu/~amitp/game-programming/grids/) link also on @amitp 's bog. If you scroll down to Hexagon Grids he gives an example of a hexagonal coordinate system with vertices
Comment: Isn't the average in your first example (⅓, -⅔),  not (0.5, -1)? If you calculate it this way, the coordinates are indeed unique at the vertices, and the distances are actually uniform. I think the technique shown at the link you shared would be worth summarizing in an answer.
Answer: Maybe I'm late, but I'm having similar problems, so here's my 6 cents
If you think about it, you can refer to the corners as neigbors of the center of the hexagon, and the actual neighboring hexagons then become diagonal neighbors. That is, you get a pointy top subdivided coordinate system. And you can easily make it by taking a (hex)vector, rotating it in some direction, and adding the rotated one to the original. You can simplify it to a very cheap calculation, and here's my implementation of it (c#):
GetSubdividedVector(HexVector v) =>
new(v.q - v.r, v.r - v.s, v.s - v.q);
This will work great. Take note, that the new vector will have a smaller Size, (Size * (sqrt(3)/3)) to be exact.
I'm using this system to consistently label corner verticies and check overlapping positions as floating point errors would make it impossible after converting to world space.
Now tho, good luck reversing the process, that's what I'm struggling with rn
Comment: Want to post a question about the part you're struggling with?
Comment: @DMGregory nah, I think I'm gonna manage. Maybe I will if it turns out that I don't


How to fill up the numbers in a set of empty discs drawing a pentagon? The target sum is 10

Question: Can anyone explain to me the math behind the problem? I want to convert the mathematical solution into an efficient algorithm. The target sum can be any given number. For reference please check the following link out- (solution found)
How to fill up the numbers in a set of empty discs drawing a pentagon?
Comment: Does this answer your question? [How to fill up the numbers in a set of empty discs drawing a pentagon?](https://puzzling.stackexchange.com/questions/90124/how-to-fill-up-the-numbers-in-a-set-of-empty-discs-drawing-a-pentagon) - the first answer already explains its math
Comment: If someone is informed enough to explain to me the math it will be really helpful. Downvoting the question does not help anybody.
Comment: Where is the math? The numbers are arranged with the help of a trial and error method based on guesses. Is there a formulated way to arrange the numbers? Or do you have to cherry-pick them? Here the target sum is not the issue, the technique to arrange the numbers matters.
Comment: There may be no generic math to directly target a generic solution, but there sure may be some math to help the search for a solution. Sometimes it's just like so. Proving in this case there is no such generic math is another challenge :-) Have a nice day.
Comment: Well is it possible to solve the problem for a target sum of 10? I really need to work on the algorithm. :(
Answer: Sum of all 10 numbers is $2+4+...+20=110$. Minimum sum of 5 numbers is $2+4+...+10=30$, maximum sum of 5 numbers is $110-30=80$. Let sum of angles is $2k$, then sum of side middles is $110-2k$. The sum of all sides is $2\cdot 2k+110-2k=110+2k$ (every angle participates in two sides). This number must be multiple of 5 (because every of 5 sides has equal sum), then $2k$ must be multiple of 5. Then maximum $2k$ is 80, which corresponds to sum of all sides equal $\frac{110+2k}{5}=38$.
Now we need to check existence of solution with sum of all sides equal $38$. When sum of angles is $80$ then angles must be 12, 14, 16, 18, 20 and side middles must be 2, 4, 6, 8, 10. Numbers adjacent to 2 must add up to $38-2=36$, then these numbers are 20 and 16. Numbers adjacent to 10 must add up to $38-10=28$, then these numbers are 12 and 16. Then we have sequence 20-2-16-10-12. Then two next numbers after 12 must add up to $38-12=26$, and one number must be not greater than 8 and other must be not greater than 18. Then these numbers are 8 and 18. Then we have sequence 20-2-16-10-12-8-18. Two next number must add up to $38-18=20$ and one of the numbers must be not greater than 6 and other must be not greater than 14. Then these numbers are 6 and 14. Then we have sequence 20-2-16-10-12-8-18-6-14. The only remaining number 4 closes the circle and $20+4+14=38$. This is the only possible solution (excluding reversing and shifting).
Comment: I attached a picture if it helps anybody.
Comment: If we consider numbers from 1 to 10, then minimum sum of each side is 14. It can be obtained from my answer if we take minimum possible $2k=30$, calculate $\frac{110+2k}{5}=28$ and divide result by 2, as all numbers are two times less.
Comment: I am reading your comment. If I understand it correctly I can come up with the algorithm. Thank you very much for the answer. You saved the day! :D
Comment: I tried to come up with an algorithm but it is hard to do so. I need a bit more explanation regarding the sequence. Is there any sort of way we can represent this sequence through an induction method? It will be a great help. For example, we have five corners and five sides. Let corners be c and sides be s. The sequence is kinda like- 2k1+s1+2k2+s2+2k3+s3 and so on. Conditions are sn!=kn, k1!=k2...kn and s1!=s2...sn (for n gons). The summation of every three-point has to be the same and can not overlap each other. Can it be structured in a specific pattern?


How can I view the history of what variable I've looked up before with describe-variable?

Question: Whenever I call
(describe-variable)

, there is no history of what variables I've recently viewed. Is there a way to enable it to have some kind of history?;)
Comment: You can do `l` in a `*Help*` buffer to go back in history, but you cannot select just variables: you'll get all of them (functions, keys, variables, anything). See `help-go-back` and `help-xref-stack`.
Answer: The short answer is "No", you can't do this out of the box, AFAIK.

C-h v (bound to describe-variable) uses completing-read with a nil value as its HISTORY argument.  That means it uses minibuffer-history as the history variable, and the value of that variable mixes in lots of minibuffer inputs that you've entered, for different kinds of commands (it's a catch-all).
You would need to advise describe-variable to change its interactive spec to use completing-read with a specific (new) variable as the HISTORY argument, e.g. my-C-v-history.  Then you could just use C-h v my-C-h-v-history, to see its value at any time.
Alternatively, you could define your own command my-describe-variable, which does that (just copy the describe-variable code and change that nil to my-C-h-v-history), and bind your command to C-h v.

FWIW, C-h M-n M-n... cycles through all of the variables, not just those you've entered as input to C-h v, but it may be worth knowing this fact.  They're not in a recognizable order, however (the order is their order as symbols in obarray).


Torque output from an electric motor, when a force is applied to it's movemet

Question: What happens to an electrical motor when a force is applied against it's movement?, an opposite force large enough to lower the rotational speed of the rotor to 0, or even larger. Will the motor continue applying a torque-force? will it have the same output torque than when it's spinning? And if the movement is stoped, but the voltage stays constant on the motor, will it burn up?
Comment: What type of motor?
Answer: If a force is applied against rotation, (induction motor for example) slip will increase, causing the current will increase, resulting in a greater magnetic force in order to drive the load.
If the same motor is loaded down to such a degree that the rotor cannot maintain near synchronous (minus slip) speed, and there is no overload device, then yes, it will burn up as the current will only be limited by the winding resistance without any counter EMF.  You don't have to get it to zero speed to burn it up, just to the point that it falls below the design synchronous speed minus the slip.
The torque is a different beast.  That depends on the motor and the method of control.
In a squirrel cage induction AC motor, across the line, maximum possible deliverable torque occurs at the design speed (synchronous minus slip).
The maximum deliverable torque is typically about 200% of the rated torque.  Induction motors are also typically designed for at least 110% starting torque.  The torque will drop off to zero at synchronous speed.
With a squirrel cage induction AC motor on a typical vector drive nowadays, the torque can be maintained pretty much constant over the entire speed range without damage to the motor (though a blower might be required).
A DC motor from zero to base rated speed will operate in a constant torque mode, and full torque can be delivered from zero speed.  Again, a blower is required.  Past base speed (field weakening), the motor will be operating in a constant horsepower mode; the deliverable torque will drop off as the speed increases above base in a linear relationship.
Comment: Oh wow thanks a lot for this answer, it's really helpfull.
Comment: DO you know if there's any way, or any type of electrical motor, that can have a Stall torque, meaning a torque produced while having a its output rotational speed lowered or zero, without damaging the motor? like with our arm we can hold a cup in the air, having the constant force output to hold the cup in its place, and we can even add water to the cup, increasing the necesary force output from our arm, without damaging the arm. Is this possible for any type of electric actuation?
Comment: Yes, a DC motor can easily, and an AC induction motor on a modern day vector drive can as well.  In both cases, external cooling may be required.


Teaching Clifford Algebra Instead of Imaginary/Complex Numbers

Question: For those unaware, Clifford Algebra (also known as Geometric Algebra) is able to generalize vectors and rotations in n-dimensional space, and simplifies a great many formulas.  However, I was curious if anyone had ever thought to skip complex numbers and move straight to Clifford Algebra, or create a Clifford Algebra textbook which assumes only a high-school level knowledge?
Comment: I find it difficult to imagine a high school student (or even an undergraduate in their first two years of college) sufficiently advanced to learn about Clifford algebras, let alone the extremely small percentage of these who would actually have the desire to learn about Clifford algebras (along with single and multivariable calculus, linear algebra, ODEs, discrete math, probability, intro to proofs course, elementary number theory, etc.), who would not already know about complex numbers (at least up to Euler's formula, De Moivre's formula, etc.).
Comment: Related: https://matheducators.stackexchange.com/questions/11436/why-do-we-teach-complex-numbers
Comment: You are a person who likes Clifford Algebra I think... what book do you recommend to start reading more about Clifford Algebra ?
Comment: This is akin to teaching students about prime numbers as a special case of prime ideals. If you happen to have a future Drinfeld in the room it may work for her.
Comment: @JamesS.Cook - what got me interested in it is the paper (and YouTube video, which actually has more content) "The Vector Algebra Wars".  The simplest, clearest introduction I've found is actually a game programming book.  "Foundations of Game Engine Development, Volume 1 (Mathematics)" by Eric Lengyel spends the first part of the book giving standard matrix math, but ends the book showing how geometric algebra removes all of the exceptions/special cases that were previously left as "just the way it is".  The explanation is very clear and straightforward.
Comment: However, on answer below was "New Foundations for Classical Mechanics", which I am planning on ordering to compare, though it is expensive.
Comment: @DanFox - the reason I think this is an interesting approach is that it is very natural for a student to think that since complex numbers work on a 2D plane, that if they needed 3D numbers, they could merely extend that.  However, complex numbers are kind of a dead-end, and they don't naturally lead to the "next thing," if anything they detract.  I'm not suggesting teaching Clifford Algebras as a full subject, but neither do we teach real analysis when we talk about real numbers. My hope is to make a foundation onto which more can be built, not one that requires tearing down first to add on.
Answer: One of the pinnacle goals in high school and basic college algebra is to be able to express the fundamental theorem of algebra, which is everywhere expressed in terms of complex numbers.
Complex numbers are the first and simplest algebraically closed field, so everyone mathematically literate should be familiar with them.
Thus, it's exceedingly unlikely that "skipping" complex numbers would be fruitful or justified in almost any conceivable curriculum.
Answer: There is a reason why mathematics is taught from more concrete to more abstract. Students need to figure out what the role of proofs, axioms, etc. is before they can start abstraction first. Some very few students have figured this out before university, while some go through their master thesis without really getting it. Or at least to the master-level courses. They will be difficult.
So, in general, there is a good reason to increase the abstraction step by step - first real numbers, than complex numbers, then into more abstraction. With the complex numbers the students have already learned some tools and intuitions about missing tools that they can take further, as well as routine for calculations and just plain general mathematical maturity due to the course happening later.
That said, in principle, there is no problem having a specialist course, or maybe an elite university could indeed hop over some stages in the step-by-step-progression. I was not at an elite university, but we had a first year course on abstract metric spaces as an alternative to a course on Euclidian spaces. Of the seven or so people taking that course, about five have doctor's degree.
Comment: @johnnyb: *it doesn't actually function well as a lead in to Clifford algebra* -- It sounds like you're actually interested in other ways of motivating Clifford algebras, and not seeking to replace high school level complex number work with Clifford algebras. Indeed, the latter seemed rather strange to me, as I'm wondering what we should do when teaching quadratic equations with non-real roots, this being where complex numbers usually enter the curriculum. You may want to revise your question so that it doesn't convey this unintended interpretation.
Comment: My issue with complex numbers isn't that it is a more concrete form that can be taught first, it's that it doesn't actually function well as a lead in to Clifford algebra.  What we are doing right now is teaching a variety of tricks kind of half-work, and then hope sometime in the future that they will learn a more systematic approach.  My hope was that someone had invented a way of teaching some form of Clifford algebra (even if simplified) so that it naturally leads into the larger picture.
Comment: @DaveLRenfro - Well, I guess that's part of my question, though.  *Is* there a way to teach part of Clifford algebra as a way of solving equations with non-real roots?  We teach kids so many different tricks - it would be helpful to find a unified way so that we can teach a unified approach for everything, even if we have to dumb some parts down for the audience/application.  But nonetheless I would be interested in a framework for a unified approach rather than the one we are currently using.  However, I'm getting the feeling no one else has really gone down this path.
Answer: Yes. David Hestenes has been pushing for this for many years, and wrote the textbook 'New Foundations for Classical Mechanics' with the idea of starting that process off. It's probably more advanced than high school level - I think it's intended as a first year university course - but the first few chapters probably wouldn't pose any great difficulty to a bright high school student.
One of the major selling points of geometric algebra is that it already includes the complex numbers as a natural part of the number system, and gives them a clear, intuitive, geometrical interpretation. Geometric algebra encompasses and unifies the reals, complex numbers, quaternions, spinors, vectors, pseudovectors, directed areas, directed volumes, reflections, rotations, scaling, points, lines, planes, circles, spheres, and more. You only have to learn one number system, and all the others are special cases or simple extensions of it. It also fixes a lot of the problems with vector algebra, which is valuable in itself.
It does not require a great deal of abstraction (at least to start with), being only a little more complicated than vectors. We start with the vectors, and we define a new sort of multiplication on them, that combines the dot product and something that works a lot like the cross product together (except that the cross product only works in 3 dimensions, while the geometric product generalises to any number of dimensions). This can produce scalars (like the dot product), but also produces new higher dimensional objects called bivectors, trivectors, etc. that correspond to directed areas, directed volumes, etc. in the same way that vectors represent directed lengths. If you start with the 2D vectors, then the combinations of scalars and bivectors they produce turn out to be identical to the complex numbers. If you start with the 3D vectors, then the combinations of scalars and bivectors produced turn out to be the quaternions.
So, you would start with vectors, introduce multiplication, look at the new sorts of geometrical objects you can get, and then point to this particular subset of them as a straightforward way to introduce the complex numbers. They're easily visualised geometrical objects, that you can apply your inbuilt geometric intuition to.
The principal advantage of geometric algebra is the deep intuitive insights the geometric interpretation provides in a lot of otherwise quite opaque and abstract topics. It is often criticised by mathematicians as not offering anything new, that was not already well known from the theory of Clifford algebras, and they're probably right about that. (Although I've not seen the generalisations of Cauchy's theorem for complex numbers to higher dimensions elsewhere.) Physicists, on the other hand, usually love it, because it provides simple pictures of things. And one of the particular things they like most is that it means you can do physics without needing complex numbers!
There are lots of introductions to geometric algebra around, although in my view most of them leap ahead too rapidly to the more advanced, abstract topics. Here is one by Lasenby, that specifically deals with complex numbers. The first third of the document is quite basic, introducing multiplication of vectors and showing how complex numbers arise, but then he suddenly accelerates and by the end is covering Maxwell's equations and advanced electrodynamics. The start demonstrates that there is no reason why you couldn't write a basic textbook for highschool students. It's just that most of the books on it are aimed at professionals who already know the standard vector methods, trying to persuade them to pick up a new and unfamiliar tool.
(For anyone interested in what else it is capable of, this is a more comprehensive introduction.)
Comment: Where is "Cauchy's theorem for complex numbers" generalized in the geometric algebra literature ? I am curious. I have a generalization of Cauchy's Theorem for many finite dimensional associative algebras ( I forget my terms and conditions off hand, but it wasn't much). But, then again, Cauchy has a lot of theorems.
Answer: If we want to solve the quadratic equation $az^2+bz+c=0$ where $a,b,c \in \mathcal{A}$ and $a^{-1}$ exists where $\mathcal{A}$ is a semi-simple associative unital algebra then since $\mathcal{A}$ is isomorphic to $\mathbb{R}^n \times \mathbb{C}^m$ the quadratic equation given translates into $n$-real quadratic equations paired with $m$-imaginary quadratic equations. Therefore, understanding the real and complex case is, well, basic. If the Clifford algebra viewpoint makes it easier, then I wait to see it.
For example, hyperbolic numbers $\mathcal{H} = \{ x+jy \ | \ x,y \in \mathbb{R}, j^2=1 \}$ are isomorphic to $\mathbb{R} \times \mathbb{R}$ and as such a quadratic equation in $\mathcal{H}$ amounts to a pair of real quadratic equations. It follows there is either no solution, one solution, two solutions, or four solutions to the quadratic equation in the hyperbolic number system. These correspond respectively to:

both underlying real quadratic equations have only complex solutions (no solution)
one or both of the underlying real quadratic equations have repeated root solution (one solution)
both of the underlying real quadratic equations have distinct real solutions (four solutions)

For the Clifford Algebra approach to be interesting to me, it would have to also allow for the natural demarcation into real and complex aspects of a semi-simple real associative algebra.
For what it's worth, I have similar gripes with algebraists who insist on always working over $\mathbb{C}$ since $\mathbb{R}$ are "easy" to derive from the $\mathbb{C}$ theory... this is little consolation when you're looking for a breakdown into what is possible over $\mathbb{R}$.


How to write good test?

Question: My idea on writing test is very low, i can't write test, teach me how to write test? It is so confusing for me. All i know is seeing what the function is doing and check it is working properly or not. Help me.
Answer: Writing good tests is an important aspect of software development as it helps you verify that your code is working as expected and helps catch any bugs early in the development process. Here are some tips on how to write good tests:
Test One Thing at a Time: Each test should test one thing, and only one thing. This helps you isolate the cause of any failures and makes it easier to understand why a test is failing.
Test Both Positive and Negative Cases: Test both expected and unexpected behavior. This helps you catch potential bugs and edge cases.
Use Test Data that is Easy to Understand: Use test data that is easy to understand and readable. This makes it easier to understand why a test is failing and also helps make your tests self-documented.
Make Tests Independent: Tests should be independent from each other and not depend on the order in which they are run. This helps prevent cascading failures and makes it easier to understand why a test is failing.
Test the Public Interface: Test the public interface of your code and avoid testing internal details. This makes your tests more robust and less prone to breaking when the implementation changes.
Avoid Hardcoded Values: Avoid hardcoded values in your tests and use variables instead. This makes it easier to change the test data as needed and also helps make your tests self-documented.
Write Tests that are Fast: Tests should run quickly so that you can run them often. If a test is slow, you might be less likely to run it as frequently as you should.
Keep Tests up-to-date: When changes are made to the code, make sure to update the tests accordingly. This helps you catch any bugs early and ensures that your tests continue to be effective.
Use Assertions: Use assertions in your tests to verify that the expected values are returned. Assertions are a way of checking that the code behaves as expected and will throw an error if the check fails.
By following these tips, you can write effective tests that help you catch bugs early and make your code more reliable.
Comment: Though this is the ChatGPT answer, all aspects are really well summarized.

How to write good test?


Why do jazz guitar players rarely bend strings?

Question: In pop, rock and blues guitar players very often use bending technique in their riff and solos.
Much more rarely it happens in jazz music, where guitar players prefer other techniques (e.g. hammer-on...).
Is there a particular reason for that?
Answer: It may come down to tradition, combined with historic technical limitations.
Guitar strings used to be considerably thicker than they are now, making them considerably harder to bend - I think it was Eric Clapton first got the idea of moving all the strings down one, discarding the low E string & substituting the top E with a thinner banjo string, allowing him to bend strings more easily.
As Jazz was pretty much well-formed by the late 60's that may simply have led to a stylistic reluctance to employ the new techniques being applied to rock music.
It may need a little investigation as to whether blues, also well-formed by that time, really employed bending earlier, or adopted it since… or if it was already used but less-frequently, or by particularly strong players.
In later years, Stevie Ray Vaughan was well-known for being able to bend strings like iron bars with little apparent effort.
It may, of course, be that Clapton was listening to blues players already bending & just wanting to make life a little easier. I very much doubt he could be credited with inventing bending ;-) he was just struggling to do it as much or as well as he would like.
Answer: It depends on the period of jazz history, and on the type of instrument the musician is playing.
Earlier jazz tended to make use of a hollow-body archtop guitar, which is acoustically very loud, but which has very little sustain, and which requires heavy-gauge strings, strummed or picked quite hard, to get a good sound. The hollow-body archtop guitar was originally designed and built to be an entirely acoustic instrument, and early jazz bands used them that way for strumming rhythm -- no pickup, no microphone, no amplifier. Bending notes on such a guitar is very difficult and does not work well.

The great Freddy Green, of the Count Basie Orchestra, came up in the 1930s. He only ever strummed chords, and only ever played a completely acoustic hollow-body archtop guitar, with very heavy round-wound strings and high action, in the middle of a big band with horns. He never plugged in, and continued to play that way until his retirement at the end of the 1970s.
The hollow-body archtop guitar was the first kind of guitar to have a pickup attached to them, going all the way back to the late 1930s. But even after pickups were added, players tended to continue to use very heavy strings (and flat-wound rather than round-wound strings, which produce a very different tone) and the same playing techniques they used when the instrument was purely acoustic.

Kenny Burrell on a really big hollow-body archtop guitar with really heavy strings, probably in the early 1960s
After the mid-1950s the solid-body electric guitar (Fender Stratocaster, Gibson Les Paul) and the semi-hollowbody guitar (Gibson ES-335) came into use in jazz, although many players to this day still use the older hollow-body archtop design. With solid-body electric guitars in jazz, players began to use the same light-gauge round-wound strings as the rock and country players, and to adopt some of their techniques in string-bending. A solid-body guitar with light-gauge round-wound strings enables playing notes with much longer sustain, and this in turn makes it feasible to hold notes longer and bend them. You can hear a lot of jazz fusion from the 1970s and 1980s where the players make use of string-bending.

Mike Stern in the 80s playing a solid-body electric guitar with light-gauge strings, and bending them, too.
Since that era, much jazz guitar has gone back to a more traditional 1950s and 1960s approach, using the hollow-body archtop and much heavier strings. But you can find exceptions to the rule among different players in every decade.
Answer: I've been a jazz saxophonist for 35 years, and am recently self-taught on jazz guitar.  I mainly play chord-melody, but also do some single-note soloing as well. I tend to doubt the accuracy of some of the other posts here, but I can tell you with good authority the reason jazz guitarists in general don't bend notes (I'm talking about real, straight ahead jazz, mainly bop and swing, not fusion, blues, "smooth jazz" or other rock/pop influenced and commercially watered-down varieties).
Here it is:  The modern jazz guitar solo style started with Charlie Christian in 1939, and the breakthrough that he made was to use the amplified guitar to play horn-like lines so the guitar could stand on it's own (volume-wise) as a solo instrument alongside the sax and trumpet front line, something that had never been done before. Unlike the (mainly) chorded, unamplified guitar solos that occurred in jazz up until then, Christian played long, looping boppish single-note lines in the manner of a saxophone.  This adaptation of the guitar to emulate horns did not include bends simply because most horn players did not (and still do not, especially modern players) bend notes.  Although it's easy to do on a guitar, it's much harder on a horn, especially a sax. (Besides this, the innovations of bebop included playing very FAST and clean. You can't play fast flurries of notes and have time to bend anything, even if you wanted to!)
The jazz guitarists who followed Christian (virtually all of them) continued this practice of trying to sound like a sax-- clean and precise with no bends. I've never heard Joe Pass bend a note! This continued to the current day.
Another poster here mentioned that jazz guitarists tend to use heavier gauge strings, which are harder to bend. Heavier gauge strings give a louder acoustic sound, provide a richer, fuller tone, are easier to intonate and stay in tune longer, but have nothing to do with jazz players not bending notes. Once the electric guitar became established as a viable jazz solo instrument (early-mid 1940's), it worked its way into blues, r&b and later rock & roll, and THOSE players expanded the amplified guitar's sound palette to include not only bends, but distortion and other sound effects achieved not only with the guitars themselves, but by use of electronic gadgets.
So while blues, r&b and rock guitarists bend, distort and use all kinds of echo, chorus, flange, fuzz and other effects (to the point where the original timbre of the instrument is all but completely obliterated), pure jazz players like to stick to the original formula of keeping it clean, straight and no frills, so it still sounds like a guitar! In fact, the best jazz guitars have carved tops, which allows the instrument to vibrate freely and thus add a measure of acoustical warmth to accompany the sound of the electronic pickup.
Answer: All other answers have good points. No one has yet mentioned the wound 3rd in most jazz string sets (either flat wound  or round wound) is very hard to bend compared to an unwound 3rd.


Can quantum entanglement cause nucleosynthesis to happen in stars?

Question: Even if there isn't enough heat and energy in the star to cause nucleosynthesis, could atoms quantum entangle to create a new atomic nuclei? Or would it be quantum tunneling - if this is possible?
Comment: I think what you're talking about is tunneling and not entanglement, and yes I think it's possible, in fact, it might even be fairly common.   I see no reason why, even with insufficient pressure, the occasional 2 hydrogen wouldn't tunnel their way into a deuterium, but as the pressure drops, the likelihood of those events would become extremely rare.    I'm half guessing though.
Comment: But could the newly formed isotope be 2 things at the same time, if quantum tunneling happened? Or does this only happen with things even smaller than atomic nuclei?
Comment: I would concur with @userLTK and state that although it is probably possible, it is unlikely. But, since the number densities we are talking about are quite large than maybe this improbability is sometimes surmounted. However, I doubt it could either recreate the vastness and energy output of nucleosynthesis that we see even in our own Sun.
Comment: I don't know what you mean by be "two things at the same time", I think that's an inaccurate definition, but maybe you should clarify what you're asking.
Answer: You are referring to pyconuclear reactions - these are reactions that are initiated even when the temperature is effectively zero. They are caused by zeropoint oscillations of particles that are trapped in a deep potential well and hence are purely a quantum mechanical effect.
This is far from just of theoretical interest. It may be that pyconuclear reactions occur in the condensed matter of white dwarfs; possibly even initiating the carbon burning that can destroy the star in a type Ia supernova.
Answer: I think you're referring to quantum tunneling. Well, quantum tunneling is actually essential in nucleosynthesis in stars. Usually quantum tunneling is a very rare occurence — but in a body as large as the Sun (whose diameter is 4 light seconds long), it is bound to happen quite frequently. This is what mainly allows atomic nuclei to collide.


How to find TAS, IAS, PPH and USG?

Question: Could somebody explain this task. I do not understand how to use this table :(
Comment: But how to find them from the table?
Comment: Each of the problems will have a separate table.  The table provided is for the **first** problem.  Notice it says `25.0 in HG (or full throttle) @ 2500 RPM`.  From there you can interpolate to get the answers.  I get a TAS of 168K, PPH of 75.4 and using 12.5 US gallons.
Answer: It's been 40 years since I did one of these, but here is how I would proceed (and hoping someone else will correct this if I've got it wrong). Let's start the first one: 25" @2500 rpm FL90 ISA+5°.
First, 25" is the first line of each of the 3 ISA deviations of the table: -20, 0, and +20. So, so you're going to have to get an answer for 0° and +20° and then interpolate between the two to get +5°.
Let's get the answer for 0°, which means we won't use the 25" line but rather use FL90, which is 9000 feet. In the U.S. we don't (or at least didn't) use FLs, Flight Levels, below 18000, but in other countries they do. There is no 9000 feet entry, so you're going to have to get the answer for 8000 and 10000 and interpolate between the two.
So there are a set of answers for 8000, which you will have to interpolate between those and the set for 10000.
And then you'll have to get the answers for +20° and then do that interpolation.
Lazy man that I am, the only time I actually used these kind of tables accurately (or at least attempted to do so) was in taking exams. In actual practice I never did. Ball-parking the answers was always sufficient until I got to the airlines, and then all that was taken care of by the dispatchers.
So, for the exams, work several of these (in spite of their frustrating, time consuming nature), and develop an approach to doing them. Your most likely errors may well be in interpolating, which is why one approach in real life usage is to simply not interpolate but use the most conservative of the two values you would otherwise have interpolated between.
Really, the important thing is to not run out of fuel, which is why some might have called me "Tanker Terry."
Comment: Thank you so much!! :)

How to find TAS, IAS, PPH and USG?


How can we distinguish "Si vis pacem, para bellum" translations?

Question: On Wikipedia it is said that Si vis pacem, para bellum means "If you want peace, prepare for war". But I think that It also seems like "If you want peace, prepare war". What makes these words to be distinguished with these two translations? (Because I think para = prepare?, here)
Comment: This might just be something that is ambiguous in Latin. Perhaps one would use a different phrase if they wanted to emphasize that one is the aggressor in a war. For example "Si vis pacem, neca hostes prius." "If you want peace, kill the enemy first."
Comment: In Latin, para is translated as "prepare" in this case (paro, parare). Bellum is the Latin word for "war" and is categorized in the second Latin declension (bellum, belli). The "-um" suffix denotes that the translation of the word in this sentence structure is that of the accusative case singular. Accusative is used when the word in question is the direct object of an action.
Comment: I think we might be able to go more deeply on this one: preparing for war and preparing the war in Latin mean the same thing. I don't think it means embrace yourself for war, but rather get what you need for war ready, i.e. ready the troops, gather equipment, etc.
Answer: To see what nuances a Latin word has, a list of translations to another language like English is not quite enough.
Examples, descriptions, and explanations help get a better picture.
The link you give is better than a mere list, but the entry in this online version of the dictionary by Lewis and Short is even better.
The phrase para bellum can be well translated as "prepare for war", "prepare war", "provide war", "acquire war", and perhaps even more along these lines.
It is unclear without context whether one should get ready for the possibility of war or actively seek war.
The distinction cannot be made well enough with this verb, so both translations you suggest are valid.
It is only the juxtaposition to si pacem vis (and perhaps further context) that suggests one should get ready in case a war breaks out.
Answer: The Romans used fewer words than ourselves to describe the same concepts. Therefore, "para bellum" may sound blunt/ terse to us; but, it is valid Latin, as Joonas has explained. The problem, here, is that the quote is incorrect. The original version can be found in some of the many "Latin Quotes/ Phrases/ Cliches"--type sites. The article on "Thought Co." is worth a look:
"igitur qui desiderat pacem, praeparet bellum" =
"Therefore, he who desires peace, should prepare for war."
[It was taken from the book: "Epitoma Rei Militaris" = "Examples of Military Matters", Liber III, 1, by Roman general, Vegetius (Publius Flavius Vegetius Renatus) late 4th. Century.]
The second verb, "praeparet" is a present-subjunctive--invoking the indefinite article--could/ would/ should/ might/ may; hence: "praeparet bellum" = "should prepare (for) war".
The nuanced meaning is a clear warning: a country wishing to live in peace, should develop strong armed-forces to dissuade potentially aggreessive neighbours from invading. Why did post-Communist Poland (and the Baltic States) rush to join NATO, while Russia was still weak? (Why didn't Ukraine do the same?) The "nuclear deterrent" is another example. A sad comment on the human condition, but valid nevertheless.
EDIT: 5/7/2020: Thanks to Seb (Comments): "si vis pacem..." is not so much "incorrect" as a more succinct alternative to Vegetius.
Comment: I have taken the liberty to edit in a link to the original book. The context is interesting. It makes it clear that Vegetius means it exactly like Tony says: If you are well-prepared, nobody will dare challenge you or make a strike against you. It also makes clear that by "preparing," Vegetius primarily means *learn the art of war* (by reading his book, I guess).
Comment: Having said that, to call it an incorrect quote is perhaps going too far. Vegetius may provide the closest we have to an actual ancient version of the quote, but the thought is older and exists in other versions (e.g. Nepos, Epaminondas 5, 4: *Nam paritur pax bello. Itaque, qui ea diutina volunt frui, bello exercitati esse debent.*) The familiar *Si vis...* can arguably be called a valid expression of the idea in its own right, with its own history and range of meaning, rather than a misquote.
Comment: I would just read this as a perfective use: *exercitati esse debent* literally: they must have been trained; but what does that mean? Having been trained, they are now in a trained state, and the participle can be read adjective-like: They must be well-trained, their training must be complete. The speaker (Epaminondas) is presumably the greatest orator in all of Thebes, although Nepos suggests that doesn't have to mean much. And nobody ever claimed Nepos himself was a great stylist, on the contrary.
Comment: @Sebastian Koppehel: Thank you. This one seems to have inspired your imagination. The translation: "For peace is born out of (from) war. Those who would want to enjoy this (peace) indefinitely, they are obliged to be in training for war". A bit clumsy in its repetition of "bello" and long-winded. These things hit home harder if they are succinct--giving, perhaps, the prize to "si vis pacem..."?
Comment: @Sebastian Koppehel: Thinking about it: "exercitati" = "(they) having been trained"; therefore: "....they (having been) trained for war, are obliged (committed) to war." Is that why Nepos repeated "bello"? The purpose of "esse"?


Half-duplex for Atmel SAMD21

Question: I'm using an Arduino MKR GSM 1400. I know this board uses the Atmel SAMD21 and the SAMD21 supports half-duplex (USART with full-duplex and single-wire half-duplex configuration). My question is, how can I configure one of the SERCOMs to use it as half-duplex (use one pin for rx and tx)?
Comment: what problem do you try to solve?
Comment: @Juraj So what is http://asf.atmel.com/docs/latest/sam0.applications.samba_bootloader.samc21_xplained_pro/html/asfdoc_sam0_sercom_usart_mux_settings.html ?
Comment: @Juraj "When TX and RX are connected to the same pin, the USART will operate in half-duplex mode if both one transmitter and several receivers are enabled."
Comment: so try it. the Arduino wrapper classes don't have clock pin configuration so you can't configure USART only UART.  so you must use registers or some other framework then Arduino
Answer:
Up to six Serial Communication Interfaces (SERCOM), each configurable
to operate as either:

USART with full-duplex and single-wire half-duplex configuration
I2C up to 3.4 MHz
SPI
LIN slave

It is an error in the overview of the SAM D21 features in the datasheet. The SERCOM is half-duplex for I2C. USART can't be configured half-duplex.
see Application Note about SERCOM configuration

1 Introduction to Serial Communication Interfaces (USART, I2C, and
SPI)
... The exchange of data can be half-duplex or fullduplex depending on
the serial module specification. ...
1.1 USART
... It is full-duplex in operation. ...
1.2 I2C
... It is half-duplex in communication. ...
Comment: as I write in the answer. no
Comment: Is there anyway to configure USART as half-duplex?
Comment: Is there any library like https://github.com/nickstedman/SoftwareSerialWithHalfDuplex for SAMD21?
Answer: You can use USART in half duplex mode.
SERCOMx.PAD0 or SERCOMx.PAD2 are available for this. Refer to document "AT03256: SAM D/R/L/C Serial USART (SERCOM USART) Driver" section "10. SERCOM USART MUX Settings".
Below is a piece of code for ATXMEGA32E5, SERCOM0, PAD0. I am tested - it works:
Pull-up will help keep the line at 1 when the device's transmitter is turned off and there is no other transmitter on the line, or it has not turned on yet. In the GPIO setup procedure:
// PA08 - SERCOM0/PAD[0]
PORT->Group[0].PINCFG[8].bit.PULLEN=1;    // Pull Enable
PORT->Group[0].PINCFG[8].bit.PMUXEN=1;    // Peripheral Multiplexer Enable
PORT->Group[0].PMUX  [4].bit.PMUXE=0x02;  // PMUX function C - SERCOM0/PAD[0]

In the SERCOM setup procedure, configure TX and RX on one pad:
while(SERCOM0->USART.SYNCBUSY.reg & 0x07) { ; }
SERCOM0->USART.CTRLA.bit.TXPO = 0x00;   // SERCOM PAD[0] Transmit Data Pinout
while(SERCOM0->USART.SYNCBUSY.reg & 0x07) { ; }
SERCOM0->USART.CTRLA.bit.RXPO = 0x00;   // SERCOM PAD[0] is used for data reception

If at the time of your transmission both the receiver and the transmitter are turned on at the same time, you will hear your echo.
When you get up for reception, do not forget to turn off your transmitter so that it does not interfere with reception:
SERCOM0->USART.CTRLB.bit.TXEN=0x00; while(SERCOM0->USART.SYNCBUSY.bit.CTRLB ) { ; }
SERCOM0->USART.CTRLB.bit.RXEN=0x01; while(SERCOM0->USART.SYNCBUSY.bit.CTRLB ) { ; }

Before transmitting, do not forget to turn on the transmitter:
SERCOM0->USART.CTRLB.bit.TXEN=0x01; while(SERCOM0->USART.SYNCBUSY.bit.CTRLB ) { ; }
SERCOM0->USART.CTRLB.bit.RXEN=0x00; while(SERCOM0->USART.SYNCBUSY.bit.CTRLB ) { ; } // If you don't want to receive your own transmission

Hope it helps.

Half-duplex for Atmel SAMD21


Arabic translation of content on sharepoint 2019

Question: We have Sharepoint Communication Site in Sharepoint Server 2019 hosted on our premises. We have enabled the language feature and the site interface is now displayed in Arabic. However, we want to know the options of providing the Arabic version of content for the same page. For example, on the English site, English content is displayed and on the Arabic site, Arabic content is displayed. Any options to achieve it please?
Answer: If you are using Modern Communication Site in SharePoint 2019, then as per my knowledge this is not possible,
If you are using classic publishing site, then you can use Variations feature but it's deprecated by Microsoft so you will not get any support from Microsoft.