Is there a proof that no rational number splits the octave equally?

Question: In music circles, when the topic of tuning comes up, it is said that there is no rational number that splits the octave (the interval between a musical pitch and another with double its frequency, for example 440 Hz and 880 Hz) equally, but I have never seen a proof for this, so I wonder if it has been proven, or just universally accepted. Is it maybe that it's too simple to write down and it's expected that one can just do it themselves? I have only finished high school maths (SQA Advanced Higher mathematics) so I haven't got any experience constructing proofs, otherwise I would try it myself.
Comment: The ratio of the half octave interval would need to be the square root of $2$.  This is typically the first proof of irrationality that a maths student meets.
Comment: To split the octave "equally" into $n$ parts, you need a rational number equal to $\root{n}\of2$, which is impossible.
Comment: [Why it's impossible to tune a piano](https://www.youtube.com/watch?v=1Hqm0dYKUx4)
Comment: "How do you know that is has to be
2–√n"  That's pretty much the definition of what you are talking about, isn't it.  You want a note that vibrates and $x$ times 440, and then if you vibrate again at $x\times x$ and then vibrate again at $x\times x\times x$ and you do this $n$ times it vibrates and 880.  If each note vibrates at $x$ times the previous note then the $n$th not vibrates and $x^n$ times the first note.  For that to be a full octave we need $x^n = 2$.  That's the parameter of the question.
Comment: Are you familiar with any mathematical expressions that are connected to 'octave'? If so, can you also write those in the question?
Comment: [Here](https://www.math.uwaterloo.ca/~mrubinst/tuning/12.html) is basically a text version of the video linked above.
Comment: @Ken I added an explanation of what the octave is.
Comment: Right, but that sort of skipped the proof, no? How do you know that is has to be $$\sqrt[n]{2}$$?
Comment: You should add an explanation of what "splitting" an octave means.  The major fifth vibrates at $\frac 32$ (660 Hz)  the lower and the higher vibrates and $\frac 43$ over it.  DId you mean a note where it vibrates at $x$ times 440Hz, an 880 and $x$ times it?  That would, as others point out require $x = \sqrt 2$.
Answer: To prove a statement you must state it.
So....

Definition:  A musical interval is two notes where the higher note vibrates at a set frequency rate faster than the lower one.

An octave is an interval where the frequency rate is $2$.

Observation:  If you compound an interval upon itself so that you have a base lower note, and a second note that vibrates at the set frequency more than a note the vaibrates at a set frequency above the low note, this new interval has a frequency that is the original frequency squared.  That is to say if you have three notes: a base note $m$ a second note $n$ so that $m$ and $n$ is an interval of a frequency of $x$, and third note $u$ so that $n$ and $u$ is an interval of a frequency of $x$, then $m$ and $u$ is an interval of frequency $x^2$.
This should be clear as the vibration of $n$ is $x$ times the vibration of $m$, and the vibration of $u$ is $x$ times the vibration of $n$ then the vibration of $u$ is $x$ times $x$ times the vibration of $m$.  That is $x^2$ times the vibration of $m$.
If you repeat the procedure a positive integer $k$ times, the resulting interval will be an interval with a frequency of the original frequency to the $k$th power.

Definition: An interval with a set frequency rate between $1$ and $2$ is said to split an octave if compounding the interval some positive integers of times creates an interval that is a positive integer of octaves.

Claim:  There is no interval with rational frequency that splits the octave.

Pf:  Suppose we have an interval with a frequency of $x; 1< x < 2$, that when compounded $k$ times because an interval of $m$ octaves.
That means $x^k = 2^m$.  If $x$ is rational then there exist integers $a, b$ so that $x =\frac ab$ and $a$ and $b$ have now factors in common.  So $(\frac ab)^k = 2^m$.
So $\frac {a^k}{b^k} = 2^m$
So $a^k = 2^m b^k$.  This means $2$ is a factor of $a^k$ and therefore, because $2$ is prime, $2$ must be a factor of $a$.  Any other prime factor, $p$, of $a$ must be a prime factor of $2^mb^k$ but it can't be $2$ so it must be a prime factor of $b^k$ so it must be a factor of $b$.  But that's impossible as we assumed $a$ and $b$ had no factors in common.
So $a$ has no other prime factors but $2$.
Meanwhile any prime factor of $b$ must be factor of $a^k$ and thus of $a$.  But we assumed $a$ and $b$ had not factors in common.
So $b$ has no prime factors at all.  ANd $a$ has only $2$ as a prime factor.
So $b = 1$ and $a = 2^u$ for some positive integer $u$.  So that means $x = \frac ab = \frac {2^u}1 = 2^u$.  But then $x = 2^u \ge 2$.  So the interval of $x$ is not less than an octave.  In fact, $x$ must be $u$ octaves.
So no interval "splits an octave".
=========== old answer below =====
The major fifth vibrates and $\frac 32$.  And a major fourth ant $\frac 43$.
So a major fourth over a major fifth vibrates at $\frac 32\cdot \frac 43=2$ and forms an octave.
A major fifth over a major fifth vibrates at $\frac 32\cdot \frac 32 =\frac 94= 2\frac 14$ and is more than an octave.
The circle of fifths actually fails.  C to G to D to A to E to B to F sharp to C is 7 major fifths and it's supposed to be 4 octaves.  But it is actually $(\frac 32)^7 = \frac {2187}{128}=17\frac {11}{128}$ whereas 4 octaves are $2^4 = 16$.
Now to make a chord that vibrates at $x$ and have a chord above that vibrate and $x \times x$ and have that be a perfect octave is to have $x^2 =2$.  There is no rational frequency that does that.  (Although that is the frequency the news was broadcast on Futurama.....)
Answer: If $x$ split up the octave in equal parts then from 440Hz to the middle would be a step of $x$ and from the middle to 880Hz would again be a step of $x$. So the doubling would be two consecutive steps of $x$, so $x \times x = x^2$, and we'd have $x^2 = 2$.
No rational number can satisfy this equation: suppose $\frac{p}{q}$ did, where $p,q$ are integers without a common divisor (so the fraction is in its lowest terms). Then $(\frac{p}{q})^2 = \frac{p^2}{q^2}=2$ and so $2q^2 =p^2$. So $p^2$ is even (being $2q^2$) so $p$ is even and then $p^2$ is also disivible by $4$ so $q^2$ is even (divide $p^2=2q^2$ by two on both sides, and at least one factor $2$ remains in $\frac{p^2}{2}$) and so $q$ is even, but then we have a contradiction with $p$ and $q$ having no divisor in common... So $\frac{p}{q}$ cannot exist and $x$ with $x^2=2$ is irrational.


Book where the hero becomes telekinetic and sails ship through storm using telekinesis

Question: A book I read around 1995 or 1996. I don't remember much more than enjoying it and that the protagonist was discovering he had telekinetic abilities, and stabilized a sailship through a storm using telekinesis.
Comment: Welcome to Science Fiction & Fantasy! This question would be improved by going through the checklists here; [How to ask a good story-ID question?](https://scifi.meta.stackexchange.com/questions/9335/how-to-ask-a-good-story-id-question)
Comment: @dancer42 Definitely a storm, and not a series of river rapids?
Comment: @LAK might be river rapids. was long ago and i only have a vague memory of it.
Answer: Wild Seed (1980), by Octavia E. Butler
Wild Seed (1980), a novel by Octavia E. Butler, is part of the Patternist series.  The fourth book by publication date, it is set the earliest in the series' internal timeline.
Doro, the primary antagonist of the novel, has spent centuries refining human bloodlines for advanced abilities.  One such product of this breeding program is Doro's son Isaac, a strongly telekinetic supporting character who is a friend of the protagonist Anyanwu.
On a sea journey aboard a sailing ship, Isaac uses his talent to prevent the vessel from sinking during a hurricane.  The text describes how Isaac stands uncannily steady on the pitching deck in the blowing wind while he concentrates on telekinetically pushing the ship to safety:

[Anyanwu] could distinguish Isaac easily from the others. He stood apart, his arms raised, his face turned down and to one side to escape some of the wind and rain, his clothing and yellow hair whipping about. For an instant, she thought he looked at her—or in her direction—but he could not have seen her through the darkness and rain. She watched him, fascinated. He had not tied himself to anything as the others had, yet he stood holding his strange pose while the ship rolled beneath him.
The wind blew harder. Waves swept high over the deck and there were moments when Anyanwu found even her great strength strained ... She could see that other crewmen were holding on with fingers and line. She saw no one washed overboard. But still, Isaac stood alone, not even holding on with his hands, and utterly indifferent to wind and waves.
The ship seemed to be moving faster ... It seemed that the ship was sailing against the wind, moving like a spirit-thing, raising waves of its own.

(Source: Wild Seed, Chapter 5)

Goodreads.com shows examples of cover art for Wild Seed, such as this image of the July 1st, 1980 edition from Doubleday Books:

You can borrow Wild Seed as an e-book from the Open Library.
Comment: This seems more likely than mine, but I'll leave it just in case.
Comment: not sure it's the right one but seems like a good read. will check it out. thanks @LAK and @ Gaultheria for answering.
Answer: This is a very long shot, but in the absence of any other answers I'll give it a try.
In either The Many Colored Land (1981) or The Golden Torc (1982) by Julian May, there's a scene where a group of humans, rebelling against the 'elf-like' psychic overlords called the Tanu, travel down a river in ancient Europe.
The human captain of the boat is unwilling, so one of the characters, named Felice Landry (you say 'he' in your question, but she's a young woman), uses her new and imperfectly-controlled power of 'coercion' to force the captain to sail them down it.  He mentally struggles against the control, and dies just as the boat is traveling through some very dangerous rapids.  Felice is forced to save the boat by using her more powerful but still not fully developed or controlled power of 'psychokinesis' to lift and stabilize the boat to get them to safety.
Comment: thanks for the answer, this is not the book. i think in the book sailing the ship through the storm was a turning point in the development of the protagonists telekinetic force. and he discovered that he had the force, not knowing it in advance.


Zener diode - What voltage at the anode at breakdown?

Question: I'm designing a circuit where there is an analog switch that turns a load on.  I specifically need the load to turn on only when the voltage is above a certain level. The analog switch takes VCC and an enable pin that closes the switch when pulled high (0.7 x VCC) and opens the switch when low (0.3 x VCC.) Specifically, I want this switch to close when voltages are above 3.3V and open when below 3.3V.
A very simplified schematic is below, but effectively, I am using a Zener diode on the enable pin with a Zener voltage of 3.3V. My thinking is, when VCC > 3.3V, the Zener is in breakdown and the enable pin will see 3.3V (or around there accounting for minor voltage drop). When VCC < 3.3V, the pulldown will bring the enable pin low.

I'm definitely a bit iffy on this solution, though. I've not seen anywhere discussing the voltage at the anode of the Zener. I'm not sure if the Zener during breakdown will pass the full VCC voltage, or if it'll pass (VCC - 3.3V.)
I'm also aware that Zeners are not very accurate - but my application really does not need exactness, anywhere +/- 10-15% is fine. I just need some kind of "trigger" effectively.
Comment: By "analog switch" do you just mean "mechanical switch"? Or do you mean something else?
Comment: @MathKeepsMeBusy I mean an IC like the TI TS5A3159. https://www.ti.com/lit/ds/symlink/ts5a3159.pdf Seems kind of like a NC/NO relay that's not actually isolated and with very low enable current.
Answer:
I'm not sure if the Zener during breakdown will pass the full VCC voltage, or if it'll pass (VCC - 3.3V)?

The voltage at the anode of the Zener diode will be \$V_{CC}\$-3.3 V, assuming \$V_{CC}\ge\$ 3.3 V.


Using 32bit Java library with JavaFX 2 (OS X)

Question: I have written a small class using a 32bit Java library (http://bluecove.org/) to control a Lego Mindstorms NXT robot over Bluetooth. However, I would like to use this class now within a Java FX 2.0 application and Java FX 2.0 requires at least Java 7. The truth problem is that there is no Java 7 32bit JDK for OS X, so I can either run Java FX with Java 7 or the 32bit library with Java 6 but not both together.
My idea was now to write a small web service from where I have access to the 32bit library, however this is not very straight forward and for this reason I would like to ask if somebody has a better idea to solve this issue?
Answer: There's no other possibility that having 2 VMs like you describe one running java6 32bit as the server and the 2nd running java7 client, to create the UI.


How can a foreigner cash an American cheque in the US?

Question: What is the best way to cash a cheque I have received as compensation? We are from Britain.
Answer: The process is fairly simple:

The person that the check is made out to ("Pay to the order of ____") needs to sign the back of the check where it says "Endorse here".
Then, go to a US bank that you have an account at and cash the check.

If you do not have a US bank account then go to the bank displayed on the check or go to a retailer that can cash the check (for example, Walmart customer service). Bring a photo-ID as they will most likely ask for one.
This article has more information.
Comment: The article you linked also suggests "The bank or credit union that's on the check" if you don't have a bank account. While that bank may charge a fee, it may be less than other check-cashing services.
Comment: I think you should not sign the back of the check until you are at the teller window of the bank.  Otherwise it is too easy for someone else to cash the check if they find or steal it.
Comment: Be careful that the name on the  photo ID matches the name on the check (cheque) exactly. or they may refuse to cash it. There are lots of people who customarily use a variant of their first name rather than their legal name.
Answer: I had to deal with a similar situation earlier this year. I am a EU citizen living in the UK and I needed to cash a USD cheque issued by a US financial institution that doesn't have any retail branches.
TL;DR: Cashing such cheque in person in the US is highly non-trivial. I ended up depositing the cheque into my UK-based USD account at a significant cost (~10% of the cheque value).
Because of the fairly high fees associated with cashing a foreign cheque, I wanted to avoid cashing the cheque with a non-US institution. At the same time, opening an account in the US is troublesome and not really worth the hassle / costs in my case. As I travel to the US regularly, I did some research and I found that my best chance will be financial services counters in convenience stores / supermarkets.
Here's the list of institutions I visited in the US, all refused to cash my cheque.

Walmart: I tried two branches.

The first one didn't have a problem with my EU passport but asked me to enter my SSN. I didn't have any and admitted that, at which point they refused to cash the cheque for me. This was the closest to successful attempt, as I could have just entered a fake generated SSN number and the cashing would succeed, according to the Internet.
The second one double checked their guidelines about ID verification and found that non-US passports without a (visa/residence permit, don't remember exactly) can't be used to verify one's identity, and as a result refused to cash my cheque. I had several other proofs of ID (UK driving licence, national ID card, multiple bank cards) but none of them were sufficient proofs of ID.

A local store a fellow customer recommended after witnessing my second Walmart visit, stating that they'll accept the cheque, I don't remember the name. They refused to cash the cheque as I wasn't a US resident.
Local 7/11: Refused as non-US resident.

At this point I gave up on the cash-in-the-US plan and deposited the cheque to my HSBC Currency account in the UK. This ended up costing quite a lot of money, but was trivial process wise. If you go this way make sure you ask for the cheque to be negotiated rather than collected as the fees are lower.
Answer: I cashed my check but I did have to show my foreign passport plus enter my social.  I'm here on a permanent Green Card, and a Social Security Number was given to me upon entering the US. I recently lost my Green Card and it can take 8 months or more to receive a replacement.  I had to use the passport from my home country at Walmart! So if you are in the same boat, then having a social security number is key.


What is the difference between total installs and active installs in the Android market?

Question: What is the difference between total installs and active installs?
I have 90 total installs for my app and only 47 active installs. What does it mean?
Answer: Total installs is how many times your app has been downloaded. Active installs are how many instances of your app are on (actively used?) devices -- i.e. not uninstalled. I imagine that if a user uninstalls your app, then re-installs it, your total download count would go up by two and your active install count by one.
Advertise! Create an ad campaign with something like AdMob (result will vary), find niche forums and android-specific forums like xda-developers, droid-life, etc., that would help more people notice your app. Inside your other apps, ad links to the app you want to promote. Put a share button in your app, or add in social networking. Perhaps promote your app on a 3rd-party app store like Amazon app store.
And don't forget that a poorly designed and rated app is far less likely to be downloaded.
Comment: How can total installs number go down in the graph if it is cumulative? I think google is doing some strange logics there.
Answer: Here are the official definitions for these terms

Total user installs - the total number of unique users that have ever installed this app. We only count one install regardless of how many different devices they installed it on. It includes the users who have later uninstalled the app.
Active user installs - the number of users who have the app currently installed on at least one of their devices.
Comment: I can't find these in the link provided
Answer: Total Installs: Total number of times this app has been installed (Also counting those that later uninstalled the app).
Active Installs: Number of installs that are still installed on devices (These people have not yet uninstalled the app).
Answer: I don't know exactly about it. But, while observing one of my app statistics this was the observation:
Day 1 : 4 total user installs
        1 active device installs
Day 3 : 4 total user installs
        4 active device installs
According to the various discussion on web, active install may be related to total number of devices application is installed. But, there is something more to it, as pointed by john Active installs are how many instances of your app are on. So, even if the app is installed but not running it won't count!
Comment: There are so many people who have their internet switched off after downloading an app. So even if they are using the app, the phone will not be able to communicate. This is the correct definition -http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=139628
Answer: Sometimes i think that it may be something different.
For example my app has only 5 days being published...it's just a normal app(with no advertisement or promotion by me) so as anyone can understand only few friends of mine have downloaded it! So I have 4 total installs and only 1 active, still as I saw for myself my friends haven't uninstalled the app(4 of my friends downloaded). They have just downloaded it and used it for a couple of times. So i might be wrong, but my experience showed me that they just don't differ only between installations and uninstallations but between something else. Or what can I say they might hesitate to publish the totals :)
Answer: Update:
Google has changed these terminologies now.
INSTALLS BY USER - This count increases whenever an user installs the app.  This increases even if the user just updated the app to a newer version.
UNINSTALLS BY USER - This count increases whenever an user uninstalls the app.  This increases even if the user just updated the app to a newer version.
INSTALLS ON ACTIVE DEVICES - This is typically the difference between 'INSTALLS BY USER' and 'UNINSTALLS BY USER'.  As a rare case, if the device on which the app is installed is not active in the last 30 days, then those are excluded from this count.
Original Answer (No more relevant):
I understand this question is old but just wanted to share my experience.  I noticed the same behavior as Asterios has pointed out in his comments.
When i checked the app dashboard, i found the following:
By the term 'Active Installs', they actually mean Active "Device" Installs.
Whereas by the term 'Total Installs', they mean Total "User" Installs.
I think some of us are confusing "Active Device Installs" with the term "Active User Installs".  These 2 are totally different.
This page has all the terminology explanations: http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=139628
That said, I still couldn't make any meaning out of the numbers that I see in my dashboard even though I understand what they are supposed to explain.  So, I guess, there is something wrong somewhere in the calculation of those figures.
Answer: But We must consider that Google Play statistics has some delay, usually (on this case) of one day. You will only see tomorrow the number of today's downloads.
Evaluation, on the other hand, can be published almost instantly (numbers of 5, 4,... stars).
Answer: The Active Install figure can be wrong.
I just uploaded the app and installed it on my phone. The next day when I logged in to Android dev backend, I could see 1 Install and 0 Active Install.
I hadn't un-installed the app. This shows that the figure can be misleading.


Rotating in IE8: translation not working properly

Question: I have a need to rotate an image in a web application. In an earlier post it was explained to me that on rotation I need to 'translate' the image because the center point changes.
I'm using the HeyGrady 2D transfrom JQuery plugin for rotating and provide it the translation as was suggested, which works fine on FF/Chrome/Safari/IE9. However, on IE8 this does not work well.
Please have a look at the following link.
If you run this on FF/Chrome/Safari/IE9 the image rotates just fine (stays within the black border). However, if you run this on IE8 it will cross the black border boundary when rotating to 90 or 270 degrees.
The plugin project page mentions that "IE also lacks support for transform-origin and translate() [...] The jQuery Transform plug-in handles these calculations automatically". However, it does not seem to do so.
Anyone has any ideas what the problem may be?
Thanks!
Comment: I recently used [jQueryRotate](http://code.google.com/p/jqueryrotate/) with good results in IE8.
Answer: I also ran into this same issue in IE 8 using HeyGrady's jQuery transform plugin. Here's a fix by adding this to the execMatrix function, around line 290:
Replace this line:
<code>this.fixPosition(matrix, tx, ty);
</code>
With this:
<code>    // factor in the object's current rotation so translation remains straight up/down/left/right
    // otherwise, object will be translated along the rotated axis, which produces undesirable effects
    var rotation = parseInt(this.$elem.css('rotate')) * -1, // the current rotation in degrees, inverted
        radians = rotation * (Math.PI / 180), // convert degrees to radians
        newX = (tx * (Math.cos(radians))) - (ty * (Math.sin(radians))), // calculate new x
        newY = (tx * (Math.sin(radians))) + (ty * (Math.cos(radians))); // calculate new y
    this.fixPosition(matrix, newX, newY);
</code>


IIS - Detecting Brute Force Logins and Password Spraying

Question: TLDR;
What techniques are being used to detect brute force logins and/or password spraying on IIS hosted websites (including SharePoint, OWA, etc.)?
ModSecurity
There are many tools for other operating systems to address this with the primary being ModSecurity. While it has been ported to support IIS, it doesn't integrate with IIS as well as it does with other platforms. Besides, I would be surprised to hear of any SharePoint or OWA implementations using IIS ModSecurity. If you're out there, I encourage you to post your setup here.
Multi-factor or Captcha
Both are viable options to prevent these attacks but they don't necessarily detect and also fail in the following ways:

Steps are added to the login process for all users just to block these login abuses from a small subset of users.
Some implementations will only display the additional method after a successful username/password combination has been submitted.

Proxy
Placing a hardware device(s) or cloud service in front of an IIS pool is a viable option. However many identify a brute force login as successive POST requests during a short interval which can easily lead to false-positives.
SIEM / Splunk
Centralized logging works though it can be expensive both monetarily as well as time invested to build rules.
Rate Limiting
There are modules within IIS which block IP addresses based on connection rates. This is not the same thing as what I'm asking even if technically these login attempts would trigger a rate filter.
Answer: WebsiteFailedLogins is a PowerShell module available on GitHub and PowerShell Gallery which addresses these concerns.
The README has detailed information though here's a brief overview:

Only requires access to the IIS logs and can run from an entirely different system. No changes are needed to IIS.
Uses Microsoft Logparser to parse the IIS logs (required prerequisite).
Identifies failed logins based on the HTTP response code.
Configured via an .INI file allowing different configurations for each website.
Alerts generated via: Standard Out, Email, and/or Event Log
Automated via Scheduled Tasks

Being available on PowerShell Gallery, the following command will install this module :
Install-Module -Name WebsiteFailedLogins


Why is it so that the total torque about a given line is equal in the case described below?

Question: If the resultant force on a body is zero, why is it so that the total torque about any line perpendicular to the plane of forces is equal ?
Answer: The statement that you have made is true in general.
This is because if there is no resultant the only thing have left is a couple.
A couple is two equal, opposite and parallel (non co-linear) forces and has the property that its torque is independent of position about which the torque is evaluated.
In simple terms I can show you this in terms of three coplanar forces $\vec F_1, \vec F_2$ and $\vec F_3$ acting at points $A, B$ and $C$ as in the diagram below.

The resultant of these three forces is zero, $\vec F_1 + \vec F_2 + \vec F_3 = 0$
Just for ease of drawing set up some axes such that force $\vec F_1$ only have an x-component $F_{1 \rm x}$.
Noting that $F_{2\rm x} = F_{1\rm x} + F_{3\rm x}$ and $F_{2\rm y} =F_{3\rm y}$  there are three couples acting on this body with fixed magnitudes $F_{1\rm x}y_{12}, F_{3\rm x}y_{23}$ and $F_{3\rm y}x_{23}$.
With extra hand-waving you can extend this to any number of forces and into three dimensions.

Alternatively . .
Suppose that you have $n$ forces $\vec F_n$ acting on a body and the resultant force is zero then $\sum \limits_n \vec F_n =0$.
The torque about any point is $\sum \limits_n \vec r_n \times \vec F_n $ where $\vec r_n$ are the position vectors of the point of application of the forces.
Now move from the origin by $\vec r$ and the torque about that new point is
$\sum \limits_n (\vec r_n - \vec r) \times \vec F_n  = \sum \limits_n \vec r_n  \times \vec F_n -  \vec r \times \sum \limits_n  \vec F_n = \sum \limits_n \vec r_n  \times \vec F_n - \vec r \times \vec 0 = \sum \limits_n \vec r_n  \times \vec F_n$ as before.
Answer: I think there is a misnomer here. A pure torque (if net forces are zero) does not have a location associated with it. It is shared identically throughout the rigid body.
Only a torque (force moment) as a result of a force at a distance changes value with location (due to the distance to the force changing).
Torque transforms from point A to point B with the law $$\vec{\tau}_B = \vec{\tau}_A + \vec{r}_{A/B} \times \vec{F} $$
If the force $\vec{F}$ is zero then the torque is identical on all the points ($\vec{\tau}_B = \vec{\tau}_A$).

PS. The transformation law is identical to angular momentum $$\vec{L}_B = \vec{L}_A + \vec{r}_{A/B} \times \vec{p} $$ and also with velocities
$$\vec{v}_B = \vec{v}_A + \vec{r}_{A/B} \times \vec{\omega} $$


Is there an app that shows iPhone call alerts on iPad?

Question: Is there an app out there that will allow me to see who's calling my iPhone from my iPad? This seems so simple, yet there doesn't seem to be anything in the App Store, leading me to believe it's not possible.
Answer: As you figured out yourself, apps allowed on the AppStore can't do that.
Worst, I'm not even sure something like that exist for jailbroken iDevices, since I did not find things like that.
Also related : iPhone ring notification on the computer.


Dataset description AREA_OR_POINT

Question: What are the differences between these two options in satellite image  metadata?
Answer: It depends on your data provider really but https://trac.osgeo.org/gdal/wiki/rfc33_gtiff_pixelispoint has a nice note about the options in general:

RasterPixelIsArea defines that a pixel represents an area in the real
  world, while RasterPixelIsPoint defines a pixel to represent a point
  in the real world. Often this is useful to distinguish the behavior of
  optical sensors that average light values over an area vs. raster data
  which is point oriented like an elevation sample at a point.

Dataset description AREA_OR_POINT


Need assistance identifying new tire options for Fuji 4130

Question: Fuji 4130 bike with ARAYA Japan rim 26x1.50 HE VP-20  Old tires are dryrotted.  ( old tire code reads 26x1.80 c-863)  have no idea what to buy to fit. (rim measures 22" diameter, roughly)
Answer:
26x1.80

26 means 26 inch and is the nominal diameter of rim and tire. It basically means the smaller type of wheel used on older MTBs, with a rim diameter of 559mm. ('27.5' - 584mm and '29' - 622mm being the other sizes in more common usage now.) 1.80 is the nominal tire width in inches also.
Some MTB tire manufacturers still use the inch measurements, some use the ETRTO size system which uses millimeters.
You definitely need a 26'/559mm MTB tire, but you have choice in tire width as a range of widths will fit on a given rim width. The safe choice is to stay with 1.8", but you could go a little wider if you frame and rim brakes have enough clearance.
Comment: The measured diametre of 22" is also close enough to 559 mm (unless _roughly_ means +/- 1). Here it is quite certainly right. However, at some places 584 mm tyres are also labelled as 26 inch (A historical standard had tyres with 650 mm outer diametre mounted on such rims, that's a little under 26 in). This is not in every context so clear cut, and one always ought to measure the rim's diametre at the bead bed like @o-biker did.
Comment: Thanks for the #559 idea.  I ordered a 26" tire but it is way too big.  Then I read that the Fuji 26 does not match our 26", so I measured the wheel frame and it is shy of 22 inches in diameter, so I couldn't identify a tire to select to fit this diameter. (In my case roughly is 1/4-1/2 inch)
Comment: The rule of thumb is that inch sized tires with decimal and fractional inch widths do not fit the same rim even if the nominal diameter and width are the same. Did you order a 26 x 1 3/8 tire?


What if i do pee in the temple?

Question: According to hindu scripures one has to suffer for their bad karma .
When i was a child i did pee in a temple by mistake , what will happen to me , will god punish me for this. What should i do ?
The temple was Mohan temple and i was 3 years old and my parents were carrying me in thier lap and as soon as they kept me down i did pee in the floor of the temple .
I think that it is a sin and god will punish me for this bad karma
Comment: no paap under 12 years of age.
Comment: @siddhantkumar . Welcome to HSE! Since you're new, I'll just explain a bit. The most authentic answers are those that cite references from scriptures. Rickross' answer seems to meet the criteria and answers your question IMO. When the question asker (you) find the answer satisfactory, the answer is expected to be accepted by clicking the (✔) on the answer, below the voting arrows. Also if you like the answer please consider contributing an upvote by pressing the up arrow on the answer. Thank you :)
Answer: Scriptural position is that children can't accumulate sins. One becomes responsible for their Karmas once they receive initiation (or Upanayana in the quote given below).
Apasthambha Dharma Sutras say:

19 Children do not become impure until the first feeding with solid
food has taken place;
20 according to some, until they have completed one year;
21 or until they are able to distinguish the cardinal points;
22 or until they have undergone initiation, which is the superior
position,
23 for it is through this that they come under the jurisdiction of
the scriptures.
24 This last view is the authoritative one, 25 and it is the
traditional teaching.*

And, in any case, children below five years can't be punished for their actions probably because they are yet to develop the understanding of what is right and what is not.

From Yama Smriti's Chapter 1:

A father, brother, or any other relation should perform the penance
for a child whose age is below the eleventh year and above the fifth.
(15)
There is no offence or sin for a child younger than this. There is no punishment from the king for him, nor any penance.

In your case, the act was done when you were three years old. So according to Yama you have not committed a sin and do not require to be punished.
Comment: Ani Mandavya rishi argued with Yama and increased age of offense to 14 at end of Dwapara Yug. That was reason for Yama's cursed to be born as Vidura.
Answer: You were young and did it unknowingly. You will only be punished if you did out of disrespect purposely.
You won't be punished.
Comment: Welcome to HSE! Kindly visit the help centre on how to answer questions as well as [Guidelines for new users](https://hinduism.meta.stackexchange.com/questions/125/guidelines-for-new-users-answering-questions)

What if i do pee in the temple?


Install software to a windows PC through a linux live instance (e.g. Kali)

Question: A thought experiment.  If I had physical access to a PC that was switched off, but I didn't know the password, could I boot into a live linux image and install software on the windows box?  Software like netcat for example
Comment: This question looks off-topic here. It may acceptable on the Unix and Linux stackexchange (with the tag dual boot), but I'm not sure.
Comment: I disagree with the migration as its a physical security question, if someone had physical access to a switched off computer, (cleaner for example) could they install a backdoor in windows without having to boot into the windows OS
Answer: You have write access to the machine's hard disk, so you can add and modify files at will.
Running an actual installer would be tough, but decompiling the installer and then manually doing all of its work (copying files and editing the registry) is possible. Another option is to run the installer on a clean VM, compare the before and after state of it (which will list all modifications made by the installer) and then "replaying" these modifications on your target system is also possible.
From a security perspective though, malware usually doesn't come with an installer, it's either a single .exe that you put somewhere hidden and then add the corresponding registry entry to make it run at boot, or you completely replace critical system files with your own (malicious) ones.
Answer: You wouldn't be able to install anything, as the windows machine would be off. You could possibly mount the windows partition and copy a executable, script or anything else harmful on to the windows partition though.
Preventing something like this would be quite trivial and would only require bios encryption, password protection to prevent you booting to the live instance of linux and encryption of the windows partition.
Comment: "Preventing something like this would be quite trivial..." Not really. A BIOS password might help, but they're famously not hard to bypass. Encrypting the hard disk works, though. There isn't really another way.
Comment: @JustinKing-Lacroix FDE can be defeated, see "evil maid" attacks.
Comment: Okay maybe I shouldnt have said and/'or' encrypt the partition. Edited to just say 'and' now. Password protecting the bios is an extra layer of security, and is still a good idea. And it is quite trivial to encrypt the partition, you do not have to be a security or IT professional to do that, anyone with basic IT skill can.
Comment: True. There's actually a fun rabbit hole to climb down on that front -- preventing evil maid attacks is *possible*, but painful.


Is it okay to use law of attraction to get prayers answered from the Almighty or is it shirk?

Question: Is it okay to use law of attraction to get prayers answered from the Almighty or is it shirk? Because I have prayed and prayed and I didn't get any response? I was thinking maybe I was doing something wrong? Or should I just leave my prayers and be happy regardless?
Comment: It depends what you mean with "use of law of attraction". To think that the universe will somehow return whatever you wish just because you think about it (and somehow trick yourself that it will come true), that is an issue from an islamic point of view. But if you define it in a psychologically point of view, without the "universe will give you what you wish" talk, then you might come out clean from an islamic point of view, and this is while you understand that whatever you achieved is from God. **In order to get a better answer, please explain what you mean with "use law of attraction"**
Answer: First, I believe your question goes beyond "the law of attraction" whatever that means. Allah does not confine Himself to your/our wishes or wants; and yet, I have found all my prayers were answered (or at least that's what I noticed), albeit not necessarily at the time, place, or in the manner I had pictured it would be.
Bear in mind that Allah is Almighty. Beyond, way beyond, the scope of your imagination. And have a little more respect for that. At the same time, it is good that you believe He will answer your prayers because He will if you didn't ask for something harmful or wrong (maybe even unwittingly), and if He sees that as within the bounds of reason and religion. But not necessarily the way or time you expect. Your time frame is not the same as His. Also if your request is not good for you, it is always His discretion to grant it or not, and if not it will always be just.
How many times does the Quran ask us to be patient or promise great rewards for the patient? Be patient. There is always a wisdom and benefit regardless if He responded the way you wanted or expected...or not. And be always grateful for what Allah has given you and try to see His concern even if it is not obvious. Human beings are fully capable of this, of grasping subtleties, of patience, of gratitude. Feel free to ask for more and different requests. Perhaps you will notice another gift and response, giving you more patience for the first.
From Surat Al-e-Imran 3:200:

O you who believe, be patient and call for patience, and stand firm, and reverence Allah that you may succeed.

The Arabic word "tuflihoon" (translated here "succeed") is the same root as the word "fallah" used in the athan — meaning "Come to salat! Come to Success!" So the "success" here is not only of this world (such as being granted a du'a) but of the next, Hereafter.
And you are not alone in having to endure some passage of time before Allah's response arrives. The prophets also had to endure pain and be patient.
Surat Al-An'aam 6:34:

Rejected were the messengers before you: with patience and constancy
  they bore their rejection and their suffering (pain), until Our
  aid/victory did reach them: there is none that can alter the words
  (and decrees) of Allah. Already you have received some account of
  those messengers.

So if you are seeking a magic bullet or a way to expedite Allah's response time, the best advice is in the Quran: be patient. The best things come to those who wait. Instead of the "law of attraction," try the "law of stick-to-it-iveness" otherwise known as "don't give up so easily." Think larger than that. Look at the night sky. The Creator of this magnificence promised to reward the patient. Meanwhile, don't ignore all the good things He does and has done for us/you and free your mind from the idea of scheduling God. Let it happen in His time, His way, and Allah knows best, the Omniscient, the All-Merciful.


Extruding outwards from a cylinder

Question: Im trying to extrude points outwards like in this video at 24:50 https://www.youtube.com/watch?v=YbsYDOiph7U
This is what is happening.
Answer: It is most likely an issue with the normals of your faces (the way that blender thinks the faces are pointing). You also appear to have some duplicate vertices that are throwing things off.
I would do these steps (starting from before you extruded the faces shown in the image):
-Select everything with A
-Press W and select Remove Doubles
-With everything still selected press Ctrl+N which will force blender to recalculate the normals of the faces.
-Select the faces you need again and extrude with E and it should work.
Duplicated vertices are often caused when you extrude a face and then cancel the extrusion with right click. Despite it appearing that the extrusion has been cancelled, extra vertices will have been created that are in the exact same location as other vertices. This can get Blender confused about which way is out for some faces.
Comment: They still are extruding in the wrong directions
Comment: Try switching the menu at the bottom of the 3d view from Global to Normal, then after pressing E, press Z a few times to cycle through all the axes you can extrude along. After pressing Z 3 times it should be extruding along the proper axes. If not, can you upload your file and include it in your post to I can take a look?
Answer: You need to use "Extrude Individual" instead of "Extrude Region" - E - shortcut.
EDIT: NO, I was wrong. In your case you need to use "Extrude - Region (Vertex normals) from drop down menu "Extrude"
Comment: Using regular extrude as done in the video should work though. I'm curious as to why it doesn't for Sam. But you are right, I believe this option would work too. The keyboard shortcut is Alt-E, since doing it via the toolbar is usually pretty awkward.
Comment: @Brenticus Regural extrude doesn't work me too.
Comment: That is very interesting. I tested it and it worked fine for me (with individual origins as the pivot point as in the video). Did you use individual origins?

Extruding outwards from a cylinder


.profile edit in terminal log loop

Question: While following a guide to install unity so I can program for ouya it asked me to add a line into my .profile. After I did that and restarted I am no stuck at the login screen.
I'm not sure how to fix this or how to remove the line of code I added in.
Can any tell me how I can remove this line from the terminal?
At the log in screen I can hit ctrl alt f3 and log in to my account but when I switch back to the GUI it just keeps looping please help
I don't want to have to format my hard drive.
Comment: Welcome to Ask Ubuntu. Can you boot into the recovery-mode? You should be able to change the line back from there. http://askubuntu.com/questions/150367/how-do-i-boot-into-recovery-mode
Answer: If you can login in the third virtual console (Ctrl+Alt+F1 - also called tty1) this is a good thing because you can restore the file .profile to its default content only by running the following command in your virtual console:
cp /home/$USER/.profile /home/$USER/.profile.old
cp /etc/skel/.profile /home/$USER

Comment: I'd make a backup 1st and no need for user_name ;)

.profile edit in terminal log loop


Is there any plan to create a Squarespace integration for CiviCRM?

Question: sorry if this info is already available elsewhere but couldn't find it on the CiviCRM website or on here. I'm really hoping to use Squarespace for my organisation's website to make it as simple as possible for other people to make changes without breaking things/making them hideous. I know there is no Squarespace integration at the moment, but am wondering if this is something that might be in the pipeline given their increasing market share. I'm aware that we can do a Wordpress site to sit alongside the public Squarespace site to handle the Civi integration, but I don't have confidence that I could do this myself and we currently have zero (0) funding, so wouldn't be able to pay a Civi partner to do it until well into the future. Thank you for all your incredible work from a long-time Civi fan.
Comment: Done – I think? Thank you! Let me know if I clicked the wrong thing @petednz-fuzion
Comment: Hi Kristin and welcome. I v much doubt it is on any long term plans. i think the most applicable long-term plan would be if CiviCRM ever becomes a standalone platform again. there are some active conversations at the moment (for first time in some years as i recall) but i doubt anyone could give you a viable date for this. Happy to point you at the thread on it but it is fairly technical at this point
Comment: It isn't too difficult  to do some basic stuff with Squarespace & Civi - I set up donations and newsletter requests to come to Civi through a Squarespace website. BTW, the Squarespace website was really good, then the client ditched it for a website that was slightly better but cost far, far more, with no Civi integration... such is life
Comment: did that site also have a front-end of drupal or wordpress, Andy, and then you were using remote form or other options (exposed profiles) to show on squarespace
Comment: @petednz-fuzion thank you both for your response! that is very helpful to know. i ended up trying to install on wordpress without success and am absolutely tearing my hair out. i love civi and really want to use it but there might just be too many technical hurdles :/
Comment: what sort of hosting platform were you trying to set it up on?
Comment: thanks @petednz-fuzion, after a great deal of stress and time I've managed to get Civi plugin working on wordpress w VPS via Dreamhost. It has been a llooot of googling, a llooot of trial and error, a llooot of setting up new services and a llloooot of contacting support through my hosting provider, but slowly slowly i am getting there. am working through the configuration tasks bit by bit and no doubt will have more questions coming.
Comment: well done. could you +1/accept the answer below so SE knows it has been answered. thx
Answer: SquareSpace integration is not in any pipeline that I am aware of. The most common approach currently would be to set up civicrm on WP or Drupal as the admin access CMS. then use Remote Forms or other methods for embedding forms on external sites.
There are discussions that have reignited recently about civicrm working as a standalone crm which can be seen here


Tamper-evident audit logs

Question: I want to be able to detect tampering in a log file that is under the control of an untrusted party. I am not interested in secrecy, only the integrity of the contents in the file - so I want to detect if entries have been removed/changed. The solution that I seem to have found from a short google search is to use hash chains linking the current log entry to all other previous entries. The untrusted party publishes the hashes with some acceptable frequency such that any tampering after the time of publishing can be detected. Is there any technique that will accomplish something similar without the need for publishing the hashes frequently?
Comment: Where do the logs come from in the first place? Are you are sending them to an untrusted server from a trusted one, or do they originate in an untrusted location?
Answer: The verifier and logger start with a seed for a forward-secure pseudo-random number generator.

To denote a valid ending of a log, append the string of the next $b$ bits of the PRNG's output

to the end of the log. $\;\;$ To add a log entry, get the next $\:b\hspace{-0.03 in}+\hspace{-0.03 in}k\:$ bits of the PRNG's output,

use the last $k$ of those bits to mac the new content, append the concatenation of the new

content with its mac to the log, and then erase those $\:b\hspace{-0.03 in}+\hspace{-0.03 in}k\:$ bits and the previous PRNG state.
This allows you to replace "The untrusted party publishes the hashes"

with "The untrusted party erases the old PRNG state".

Tamper-evident audit logs


Get HTTP requests and responses made using HttpWebRequest/HttpWebResponse to show in Fiddler

Question: Is there any way I can hook Fiddler up to capture requests and responses made using .NET HttpWebRequest and HttpWebResponse?
Comment: Maybe I don't understand your question, but Fiddler is a web debugger (proxy). If your requests were send through the proxy, it captures it. Please describe, what you (really) want to do.
Answer: The Fiddler FAQ gives the answer to this.
You essentially route your HTTP traffic through Fiddler (i.e. Use Fiddler as a proxy).
Here's some links that will help:
Fiddler Web Debugging - Configuring Clients
Which in turn links to here:
Take the Burden Off Users with Automatic Configuration in .NET
You can achieve this via some configuration settings in the web.config file (for an ASP.NET application) like so:
<system.net>
  <defaultProxy>
    <proxy
      proxyaddress="http://[your proxy address and port number]"
      bypassonlocal="false"
    />
  </defaultProxy>
</system.net>

See here for complete details on the <defaultProxy> setting.
Alternatively, you can use a WebProxy object in your code using something like:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("[ultimate destination of your request]");
WebProxy myproxy = new WebProxy("[your proxy address]", false);
request.Proxy = myproxy;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse) request.GetResponse();

See here for complete details on the WebProxy class.
Also note the important "caveat" that is mentioned in the Fiddler FAQ:

Why don't I see traffic sent to http://localhost or http://127.0.0.1?
  IE7 and the .NET Framework are
  hardcoded not to send requests for
  Localhost through any proxies, and as
  a proxy, Fiddler will not receive such
  traffic.
The workaround is to use your
  machine name as the hostname instead
  of Localhost or 127.0.0.1. So, for
  instance, rather than hitting
  http://localhost:8081/mytestpage.aspx,
  instead visit
  http://machinename:8081/mytestpage.aspx.
...Or, if you're using Fiddler v2.1.8
  or later, just use http://ipv4.fiddler
  to hit localhost on the IPv4 adapter,
  or use http://ipv6.fiddler to hit
  localhost on the IPv6 adapter.  This
  works especially well with the Visual
  Studio test webserver (codename:
  Cassini) because the test server only
  listens on the IPv4 loopback adapter.
Lastly, you could Customize your Rules
  file like so:
    static function OnBeforeRequest(oSession:Fiddler.Session)
    {
      if (oSession.HostnameIs("MYAPP"))
      {
        oSession.host = "127.0.0.1:8081";
      }
    }

...and then just hit http://myapp, which will act as an
  alias for 127.0.0.1:8081.
Comment: in case it helps anyone, default value for http://[your proxy address and port number] is http://127.0.0.1:8888, you can check/change the port in Tools > Fiddler Options
Answer: If you can't, Wireshark is a similar tool that works at the network hardware level, so it can capture network traffic from any application.
Wireshark is a bit more complex than Fiddler, and more general, but it's a great tool to have in your toolbox, and worth investigating a bit of time into.
Comment: @Richie: I neutralized the downvote as I also cannot understand why.
Comment: @Charming Anonymous Downvoter: Did you miss the bit where I said "If you can't"?  Forgive me for trying to be helpful.
Answer: If you are able to modify the request URI, and it is localhost then there is a much simpler solution: change the hostname to localhost.fiddler.
This has no dependency on setting up proxies (whether setting HttpWebRequest.Proxy or the <defaultProxy> element in a .config file).
(From comment on this question.)


Show such finite sequence of random variables is exchangable

Question: Given random variables $X_1$,$X_2$,...,$X_n$ i.i.d, $Z$ is random variable which is independent of $X_1$,$X_2$,...,$X_n$, Let $Y_i = X_i + Z, i = 1,2,...,n$, are $Y_1, Y_2, ... , Y_n$ exchangable(I guess so)?If so, how to show it?If not, what about $Z$ is also iid with $X_1$,$X_2$,...,$X_n$?
Answer: One way is to use characteristic functions. We have $Ee^{i\sum_j t_jY_j}=\prod_jEe^{it_jX_j} Ee^{i \sum_j t_jZ}$ which clearly doesn't change under  any permutation of $t_j$'s. It is not necessary to assume that $Z$ has the same distribution as $X_i$'s.
Answer: Let $X,Z\colon (\Omega,\Sigma,\mathbb P)\to \mathbb R$ be two random variables and $X_1,\dots,X_n\stackrel{\rm i.i.d.}{\sim} X$ be i.i.d. random variables that are independent of $Z$. For $A\in\mathcal B(\mathbb R)$, let $A-z := \{a-z|a\in A\}$ denote the shift of the set $A$ by $z\in\mathbb R$.
It is easier to first think of $Z$ as being a discrete random variable. Then for $A_1,\dots,A_n\in\mathcal B(\mathbb R)$ we obtain (by the law of total probability and the independence of all random variables:
\begin{align*}
\mathbb P\big( Y_1\in A_1,\dots, Y_n\in A_n\big)
&=
\sum_z \mathbb P(Z=z)
\mathbb P\big( X_1\in A_1-z,\dots, X_n\in A_n-z\big)
\\
&=
\sum_z \mathbb P(Z=z)
\mathbb P\big( X\in (A_1-z)\big)\cdots \mathbb P\big( X\in (A_n-z)\big).
\end{align*}
Since $X_1,\dots,X_n$ are i.i.d., you obtain the same result for $\mathbb P\big( Y_{\sigma(1)}\in A_1,\dots, Y_{\sigma(n)}\in A_n\big)$, where $\sigma$ is some permutation of $\{1,\dots,n\}$.
If $Z$ is not discrete, we have to use integrals instead of sums:
\begin{align*}
\mathbb P\big( Y_1\in A_1,\dots, Y_n\in A_n\big)
&=
\int_\mathbb R
\mathbb P\big( X_1\in A_1-z,\dots, X_n\in A_n-z\big)
\, \mathrm d\mathbb P_Z(z)
\\
&=
\int_\mathbb R
\mathbb P\big( X\in (A_1-z)\big)\cdots \mathbb P\big( X\in (A_n-z)\big)
\, \mathrm d\mathbb P_Z(z),
\end{align*}
where $\mathbb P_Z$ is the distribution of $Z$.
Remark:

It is not necessary for $X$ and $Z$ to map into $\mathbb R$. It can be any space you like. In order to make your question well-posed, you have to be able to perform the addition $X+Z$, though, so probably they map into the same vector space $V$.
We used the fact that the product $\sigma$-algebra is generated by the sets of the form $A_1\times\cdots\times A_n$.


mysql --login-path connecting to the wrong database

Question: I have a strange problem with mysql and the --login-path option.
I have configurated multiple users and databases, some local and some remote using mysql_config_editor.
But since I had my last configuration it seems mysql --login-path=any_config_entry is always connecting to the last entered configuration as if I entered mysql --login-path=last_config_entry.
What could it be?
version is:
mysql  Ver 14.14 Distrib 5.7.36, for Linux (x86_64) using  EditLine wrapper
Answer: OK so I think I found the problem, I recently added an entry, and looking at my bash history I can see that I entered the information with set two times once without the --login-path resulting in creating an entry with the name client
after removing this entry with : mysql_config_editor remove --login-path client
all other configuration paths are working again.


Statistics based gambling

Question: I don't know if my question meets the criterion of the community or not.
Maybe my question has been asked many times, but I haven't found 100% covered answers.
In a few words my question is :
Is it mathematically possible to make regular profit in gambling (sport betting, online casino games, etc. ) ?
In a bit detailed version it'll sound like this:
There are a lot off statistics of football, tennis, and other sports. What I want is to find a way to combine mathematical skills, programming skills, sport skills and of course personal luck (as it is sport) to make some math based strategies to try to beat the bookies. So is there any source(e.g. academic paper, book) which mathematically gives the way how to use that data, what to expect from various strategies and so on and so forth ?
Comment: [Edward O. Thorp](https://en.wikipedia.org/wiki/Edward_O._Thorp)
Answer: Your question is indeed off topic here, but I'll do a short answer anyway.
The only way to beat the bookies is to be a lot better than the average better in the long run at predicting who will win and by how much. Mathematical, statistical and computer tools can help some with that, but can only help. To make a living you'd need a lot of capital and be able to absorb short run losses in order to make a long run average gain. Roughly speaking, you bet on long shots. The fact that most people don't is how some online sports and fantasy sports betting websites make their profit.
You can't win at the casino games that are pure luck (roulette, slots). You can win at poker if you're enough better than the other players to take home money even after the house takes its share of the pot. You could once win, slowly, at blackjack, by "counting cards" but the casinos have made that much harder in various ways.

Statistics based gambling


Is there validity to the claim of a scavenger hunting barter economy in the history of money?

Question: I've read in economics textbooks, and seen in videos like this, saying that before money, there was a barter economy was based on a coincidence of wants, and people would have to go on basically a scavenger hunt if they needed something that they didn't have the wanted exchange for. This sounds totally ridiculous that any society would be based off of this, let alone all societies before money, as it's being sold in economic texts. Nor I have ever heard of such a society that operates in such a manner, at least not locally. Maybe with some trade with other societies that local ones probably weren't totally dependent on, they would only be interested in certain products. It sounds like modern people projecting their norms on former societies, like the idea that one claims for themselves everything they use. Like the use of money, like wampum being thought of as the same as money. I read in People of the Deer by Farley Mowat that the Inuit had no concept of claiming things individually, people worked together and shared spoils together. I wouldn't think it would be totally black or white either, some things may be claimed individually, like horses, or by ruling elites, like titular ownership. Or is there ample evidence that such scavenger hunt barter economy societies were the general rule before money?
Comment: In [Debt the First 5000 Years](https://en.wikipedia.org/wiki/Debt:_The_First_5000_Years) Graber talks alot about this. I just noticed you are new to stack exchange. Welcome! I should have noticed that before.

This platform is somewhat different than other online forums. I think for SE History, you might need to polish your question a bit.
Comment: There is likely a distinction between how goods are shared at the tribal level and how goods are traded between tribes. People get weirded out by the notion of a tribe sharing everything in a "communistic fashion" when they themselves living in a nuclear family where 2-6 people share things in much the same way. The Inuit certainly [traded with the French](https://bit.ly/30hJtx1) in a barter economy. The thing to remember that the "coincidence of wants" was rarely random, but more often stable long-term. Also, and yes, paragraphs, formatting and more direct links to research would be good
Comment: (1) Barter is more common and perhaps less clear cut than you might be thinking. We've seen small scale barter economies emerge even in contemporary history, when fiat money is unavailable or lost its value. For example, prison, after a disaster, or under hyperinflation. In fact, early forms of commodity money were effectively bartering - you're exchanging goods for other goods that have intrinsic value. It only became "money" later, when the commodity was standardised and recognised as currency. (2) As others have said, better formatting for readability would improve this question.
Comment: @Mark C. Wallace I have done plenty of research, I give an example of a society that goes against the claim with a reference. The whole point is I can't find any evidence for the claims from the video and economics textbooks, how am I supposed to do research on something I can't find?
Comment: Since it's supposed to be commonplace before money, yet there are no quick simple examples given, that sounds like the answer, there weren't actually any. Something can be more believable the more far fetched it is, "they couldn't be all making it up about all societies". It sounds like something meant to sell the use of money, pretending it solves a made up problem, ignoring problems caused by ppl having to fight over everything they use.
Comment: The coincidence of wants page on wiki has no examples and links talk about stuff like island trade, which doesn't even sound common or local https://en.m.wikipedia.org/wiki/Coincidence_of_wants. Such barter economies coming after established ideas of claiming things for oneself is mentioned in the debt the first 5000 years link, make more sense and actual examples are given. But still, no evidence this was the norm before money.
Answer: There certainly were societies before money. It took thousands of years from the beginnings of agriculture to develop money, as of course people had no idea that they lacked money (it was an unknown unknown, rather than a known unknown, using the terminology of Donald Rumsfeld).
In subsistence societies where your neighbours grow much the same as you, and where artefacts are few and simple, there is little need for money. As elites formed (in Europe, in the Bronze Age), it became important to have prestige artefacts to differentiate themselves from the non-elites. They needed a means to acquire such artefacts, often from distant locations. The method devised was gift exchange. This was not barter, as there was no comparison of value for the gifts exchanged. Often there was no gift in return. Instead, the giver gained prestige, and the likelihood of a gift given in return some time in the future. Artefacts such as ceremonial axes made from special stone were passed from one chief to another, sometimes for hundreds of miles, gaining in prestige as they travelled further from the source of that stone. Archaeologists can trace such movements from the Bronze Age and earlier.
Barter is the next step along, when items are bartered so often that they acquire a known value. However, simple barter can be quite difficult. A simple fish-for-grain trade, repeated every few days, so easy, and the fish and grain soon have their relative values set. For an actual object rather than food, you have to find someone who has what you want, and wants what you have. This coincidence of wants is hard to achieve. In practice, the problem becomes simple with a triangular trade, and in particular where one of the items is something for which there is a high and constant demand. This is the origin of money. If you want a bow, and have an axe that you are prepared to trade for it, you find someone who wants that axe. You trade the axe for something that is very commonly traded, such as cacao beans if you are in Mexico, or a fur if you are in Russia, or a copper ingot if you are in Europe. You then find someone with a bow that they are willing to trade. They will accept your cacao beans/fur/copper ingot, as they know they can trade it on for something that they really want.
Almost all societies could use this type of barter, where you trade for something that you just want to trade on. For example, in West Africa in pre-colonial time, traders used to trade for salt in the Sahara, trade that salt for rubber or groundnuts further south, then head to the coast to trade the rubber/nuts for cloth. They then traded these goods on their way back. No money was involved, this was all just barter, one good for another. The traders knew from long experience that there was always a market for salt and cloth in the forest regions.
Many different items could be used as intermediate goods in such bartering, but one of the best was metal. Metal could be kept for a long time, could be carried, could be easily divided. Silver was particularly useful, as it was valuable. Long before coins, people in Mesopotamia used to weigh out pieces to silver cut off from a ring or bracelet to 'buy' something. The Vikings did them same, calling this hacksilver. Paying with silver was barter, one commodity for another.
Some references:
Lars Sundstrom: The Exchange Economy of Pre-Colonial Tropical Africa.
Leslie A White: The Evolution of Culture: The Development of Civilization to the Fall of Rome
Comment: You seem to be stating the theory, rather than presenting any evidence this is what happened.  If it really was that "almost all societies could use this type of barter" then would we not expect to find some physical evidence of it occurring prior to evidence of money existing?  As it is, most evidence is just that goods moved, not that the movement was motivated by something we would recognise as trade.
Answer: It used to be thought that was the case, that before money people simply bartered and it wasn't until money that there was a solution for coincidence of wants.
However, there is a recent thought that in early times, societies were small and local.  They exchanged credit and good will.  If someone in the community had a need, like didn't have enough food, someone with plenty of food might give them some.  It was all a "what goes around comes around" system.  Being stingy and not ever helping people who had needs would lead to an effect of others stopping helping you.  I don't know if this is any less ridiculous than matching up coincidence of wants.
Barter was used only for strangers such as traveling traders.
There are also always a small number of wheeler dealers, even today.  They will trade what they have that you want for things which they don't have a need for but has potential value to trade to someone else later.
Coins minted in what is now Turkey were used along the silk road.  Even before that, people traded in weight of gold and silver.  However those are very expensive and not on the small scale of minor purchases.  A gold coin might be too much for purchasing a chicken or a piglet.  There just might not be a way to make change for small purchases.  So even with metal coins and weighing precious metals, most day to day existence of the vast majority of people was without using that system.
It was most likely a combination of all these.  For a long time in the history of civilization, before industrialization, all but a few powerful people were peasant subsistence farmers.  A farm would have a variety of products to round out a balance of one's needs.  Primarily people farmed for themselves.  There was some gifting and cre


Java - adding to an inherited JOptionPane

Question: Good evening all!
I think there's something I don't understand here about either inheritance or JOptionPane, but basically I want to figure out how to actually use a new JOptionPane in the LuxuryCarRental subclass.
Currently it displays 2 dialog boxes if the choice is "l", one box from the parent class and a new one I added in the subclass. Ideally I would want only one dialog box. I think this is something that I can do without JOptionPane but I would like to try to make it work with JOptionPane if possible.
My code:
CarRental.java (parent class)
import javax.swing.JOptionPane;

public class CarRental
{
private String name;
private String zipCode;
private String size;
private double dailyFee;
private int rentalDays;
private double totalFee;

public CarRental(String name, String zipCode, String size, int rentalDays)
{
    this.name = name;
    this.zipCode = zipCode;
    this.size = size;
    if (size.equals("e"))
    {
        dailyFee = 29.99;
    }
    else if (size.equals("m"))
    {
        dailyFee = 38.99;
    }
    else if (size.equals("f"))
    {
        dailyFee = 43.50;
    }
    this.rentalDays = rentalDays;
    totalFee = dailyFee * rentalDays;
}

public void display()
{
    JOptionPane.showMessageDialog(null, "Car for " + name + " from zip code " + zipCode + "\n"
            + "Type = " + size + "\n"
            + "Daily Fee = " + dailyFee + "\n"
            + "Days = " + rentalDays + "\n"
            + "Your rental is $" + totalFee);
}
//includes getters and setters but I didn't include this in this post

LuxuryCarRental.java (subclass)
import javax.swing.JOptionPane;

public class LuxuryCarRental extends CarRental
{
    public LuxuryCarRental(String name, String zipCode, String size, int rentalDays)
    {
        super(name, zipCode, size, rentalDays);
        if (size.equals("l"))
        {
            this.setDailyFee(79.99);
            String includeChauffeur;
            includeChauffeur = JOptionPane.showInputDialog(null, "Include chauffeur? Y/N");
            if (includeChauffeur.equals("Y") || includeChauffeur.equals("y"))
            {
                this.setDailyFee(279.99);
                this.setTotalFee(this.getDailyFee()*this.getRentalDays());
                JOptionPane.showMessageDialog(null, "Chauffeur @ $200/day = $" + 200 * this.getRentalDays());
            }
        }
    }
}

UserCarRental.java (driver class)
import javax.swing.JOptionPane;

public class UseCarRental
{

    public static void main(String[] args)
    {
        String name = JOptionPane.showInputDialog("Enter name");
        String zip = JOptionPane.showInputDialog("Enter zip code");
        String size = JOptionPane.showInputDialog("Enter type of car" + "\n" + "e - economy" + "\n" + "m - midsize" + "\n" + "f - full" + "\n" + "l - luxury");
        int days = Integer.parseInt(JOptionPane.showInputDialog("Enter days to rent"));

        CarRental userInfo = new LuxuryCarRental(name, zip, size, days);

        userInfo.display();
    }
}

Any help would be greatly appreciated!
Comment: My apologies for my lack of understanding; what exactly are you trying to accomplish, and what exactly isn't working?
Comment: Right now the subclass LuxuryCarRental displays two separate JOptionPanes if size "l" is selected. I want it to display that comvined information one JOptionPane instead of 2 if that's possible.
Answer: I think that the lesson here is to not mix UI code with model code. Understand that your CarRental class and all of its subclasses are logical or model classes, and can be thought of here as classes that model a physical or logical reality. They should be used in this capacity, and should be written so information can be passed into them and extracted out of them, but they should not interact directly with the user. Instead that is the responsibility of the UI (user interface) classes, of which here it is quite simple and only your main method. So I suggest that you get your JOptionPane calls out of both CarRental and LuxeryCarRental, and instead display the JOptionPane in your main method after extracting state from your CarRental object.
Otherwise, if you absolutely must have the model classes display their information, then do it in a method that can be fully overridden. In fact you would have your child class override the display() method, and then print out its data there.
Comment: Hm I think I understand. Seems like JOptionPane is really complicating things based on how I attempted to do it. Thanks for the head up =)


How to draw circle or rectangle or arrow in blender video editor?

Question:
I am creating a tutorial and i want to create for example a rectangle to attract the viewers attention
Answer: Here is what I do (or something similar, as I use this tactic to position more videos for people to click on), you can create a simple box with transparency around it (though make sure that the image format you save it as has support for alpha, png should work):

Get your image onto your sequencer (drag in the image, or Shift + A).

Select your image (Right click), and press Shift + A , then choose Effect Strip, and then Transform.

Select the Transform block/strip, then over on the right, choose
Alpha Over instead of Replace.

Change the position and scale settings on the right, in the Effect Strip
Answer: Maybe you can simply create an transparent image with a rectangle or arrow and use alpha over to show that image on top of your image strip ?
Comment: I tried to do so, but every time i want to add a bordered rectangle for example i have to take screen shot of my video, go to my image editor and create a rectangle for that potion.


How can I copy text with face properties from an Emacs buffer, so that when I paste it to another application, the face properties appear?

Question: I have a fundamental-mode buffer with italics set. When I copy the buffer and paste it to an email compose buffer, the text appears but the italics don't. But if I open a .odt file with some italics in another application, copy its text, and paste it to the email compose buffer, the text appears, with italics. If there is a command that lets me promote my buffer to some other mode, so that when I copy/paste it elsewhere, the italics come along?
I don't want to use my fingers for anything. I have hooks that, on read-in, read a file and  clear the high bits it finds, but set the italic face property on those characters. Ideal would be a command that said write-out-this-buffer-and-make-a-.odt-file-out-of-it. If promotion to some other mode would have the effect I need, how could I cause that?
Comment: Italics in different applications are no doubt implemented differently. In Emacs different fonts are used. If you were able to process the copied text, to put an Emacs text property on its italics bits, then you could use option `yank-handled-properties` to make sure that gets transferred when you yank text. But who knows what the text you copy from some other application actually contains as characters information? Does it include chars with fonts, using different a different font for italics, for instance? How does it represent that copied info?
Comment: I see now that your question is the reverse of what I said in my previous comment. You want to copy Emacs text, with its fonts, and paste in another app. What does that app expect as input?
Comment: Is your "email compose buffer" in another app, or is it an Emacs buffer. If the latter, and if the italics etc. are the result of font-locking, try removing `font-lock-face` from option `yank-eyank-excluded-properties`.
Answer: I'm not sure this fix your particular problem, but the package highlight2clipboard allows you to copy highlighted text from an Emacs buffer to an external application.


How do sync programs get around the iOS sandbox?

Question: The various iOS sync programs (SugarSync, BitTorrent Sync, etc.) claim to be able to read files anywhere on the phone. I don't see how data from my application -- in my app's sandbox -- can be accessed. How is it that these programs are able to read/write outside their sandbox and get my app's data?
Comment: What data are we talking about? Here is the [developers guide for storage](https://developer.apple.com/icloud/documentation/data-storage/). With iOS 8 people will be able to sync using dropbox, one drive, or google drive instead of iCloud drive. But only the ones that are in the "syncable" in the application directory.
Comment: I think I didn't quiet understand your question. Is SugarSync or BitTorrent Sync a program on iPhone or PC/Mac, because on PC/Mac they can. I have the free iFunBox (i wanted to know what it can do), and with that I can access anything on my iPhone. All the app data, user data etc.
Answer: They can't as all 3rd-party apps on a non-jailbroken iOS device are limited by the sandbox, both installed from the App Store and from ad-hoc/enterprise distribution.
Either they are using public APIs to access data 'the iOS way' (structured and anticipated) such as accessing the Camera Roll to import/save photos, or are integrated with an app to share data in a way that the developers of both apps have worked together to make it happen (this doesn't necessarily mean they actually know each other as they could have used a framework, such as the Dropbox framework).


In tennis why does the ballboy/girl crouch on one side of the court and stand on the other?

Question:
I notice if the ballboy/girl is on the left they always crouch, and if they are on the right they always stand. Why?
Answer: Because the side they stand on is next to the Referee's stand and the ballkids blend into the shape of the stand. Whereas, on the side the crouch, they do it to minimize peripheal distractions to the players.
Comment: @Allure yes, but the chair has to be supported on something. We haven't invented anti-gravity plating required for a floating umpire's chair, and a chair extended out on a cherrypicker type arm would look weird and be impractical.
Comment: If there's peripheral distractions when standing then wouldn't the referee's stand itself be a distraction?
Comment: @Bohemian If the umpire's chair is a distraction, then wouldn't it be moved somewhere else for the benefit of the players? It's surprising to me that this kind of thing isn't done if it makes the players play better.
Comment: It also looks like at the French open, the ballboy/girl crouches on both sides of the court.
Comment: @allure the umpire must be positioned high and as near to the court as practical so (s)he can see where the ball lands near all lines so (s)he can overrule line calls, and to a lesser extent hear player dialog if required. Note that in the Australian Open just played, there were no linesmen because the tournament switched to all electronic line calls, so perhaps the umpires chair could be positioned back away from the court somewhat, given that overruling is no longer possible from the umpire.
Comment: @Bohemian That whole thing supporting the umpire's chair is black. If they want to minimize distractions, they should paint it the same color as the court.
Answer: The ball boys or girls crunch to reduce distraction to the players. If they stand, they have to blend into the referees stand.
Comment: You basically just copied Texist's answer.


Jewish table manners

Question: I want to know if it's proper for a Jew to spit out bones or anything he doesn't want to swallow on top of the table he sits at.
Comment: Welcome! Like Wikipedia, this site makes no guarantee of validity, and **[does not offer](//judaism.meta.stackexchange.com/q/1734)** professional (particularly rabbinic) advice. Treat information you find here as if it came from a crowd of your friends. [See more on why it's important to take personal questions of Jewish practice to your Rabbi.](/q/9146)
Answer: Indeed there is a prohibition called Bal Teshaktzu, not to be disgusting.
This is codified in the Shulchan Aruch (YD 116:6). In his commentary on this law, the Kaf Hachaim speaks of your case, writing it is forbidden to extract food from one's mouth.
The gemara in Chagiga 5a also refers to your case

Additionally, when Rabbi Yoḥanan reached this verse, he cried: "For
God shall bring every work into the judgment concerning every hidden
thing" (Ecclesiastes 12:14). [...] And similarly, Shmuel said: This is
referring to one who spits in the presence of another and his friend
is disgusted by his action.

More generally, one is forbidden to do things that others will find disgusting (see here for more details).

Jewish table manners


Circular Motion Explanation Of Normal Force

Question:
How can we prove that a particle (ball) moving along a circular path with the only forces acting being its weight and the normal force (forming the centripetal force) will result in uniform (constant speed) circular motion. Furthermore why is the normal force present in point D and why is it bigger in magnitude in point B compared to the y-axis component of the weight?
Comment: You can't prove uniform circular motion happens for those two forces.  Uniform circular motion is usually a constraint which the author of a problem imposes on a system.  In fact, for a vertical circle with only weight and normal force (from some track or rail), uniform circular motion isn't possible.
Comment: Please define "Natural force." I've not heard of it.
Comment: If for example the ball is moving along a circular path (road) the natural force is the reaction of the weight exerted from the ground to our ball. If we imagine the ball being tied by a string the role of the natural force would be the tension of the string.
Comment: @BillN The force of nature, I presume ;)
Comment: Oh, you mean the "normal force."  It's called normal because it is perpendicular to the tangent of the contact point/surface, not because it's "natural."
Comment: Let me correct it
Comment: The proposition to be proved is not true...
Comment: Physically how can we impose circular motion?
Comment: A circular track can impose circular motion.  Some type of propulsion system or motorized arm connected to the ball would be required for *uniform* circular motion.
Answer: You can't prove uniform circular motion happens for those two forces. Uniform circular motion is usually a constraint which the author of a problem imposes on a system. In fact, for a vertical circle with only weight and normal force (from some track or rail), uniform circular motion isn't possible.
The normal force acts perpendicular to the circular motion of the particle, so it does zero mechanical work on the ball. Only the weight does work, and we can account for that by considering a constant mechanical energy problem including the gravitational potential energy of the ball/Earth system:
$$ E_{\mathrm{top}}=E_{\mathrm{bottom}}$$
$$ \frac{1}{2}mv_{\mathrm{top}}^2+mg(2R)=\frac{1}{2}v_{\mathrm{bottom}}^2$$
where $R$ is the radius of the circle, $m$ is the ball mass, $g$ is the gravitational field strength, and the reference point for the gravitational potential energy is chosen to be a the bottom of the circle.
From this it's clear that the speed at the top is different from the speed at the bottom. We could generalize this to angular positions (you can do the maths if you're curious), but we clearly see this is not, nor can it be, uniform circular motion.
Comment: So it is not necessary for an object that has a circular trajectory to have $\sum_{}^{}F=F_k=\frac{u^2}{R}$
Comment: That is still necessary for curved motion. That is not restricted to uniform circular motion. $v^2/R$ is the required perpendicular acceleration for any curvilinear motion.
Comment: Does it also have to be constant the accelaration or can we have an object moving alonga a circular path with different speed at different times
Comment: Does not have to be constant.
Answer: Consider circle of radius $R$ with the origin at its center, where $\vec{r} = R(cos\theta \hat{i} + sin\theta \hat{j})$ is the radius vector of a particle moving on this circle.
If you differentiate this vector twice wrt time, you will find that the centripetal acceleration has to, at every instant be equal to $v^2/R$
Now if you can show that the net force on a particle is always directed towards the center and has a magnitude of $v^2/r$(which won't change because the net force is perpendicular to the disp) , it means that the particle will travel in a circle of radius $R$ with constant velocity $v$
Comment: How do you prove that $v$ is constant if it's a vertical circle as the OP originally assumes (see the diagram)? Velocity isn't constant because the direction is changing, and the speed isn't constant because the tangential acceleration is not zero.
Comment: If it is a vertical circle, then the magnitude of velocity simply isn't constant and it **isn't** uniform circular motion which the OP is trying to prove. I've simply shown him how to prove that a circular motion is uniform. He can apply this 'test' and easily prove that in a vertical circle, a particle doesn't undergo uniform circular motion


Why does the one-time pad not imply $P \not= NP$?

Question: I apologize that this is a rather trivial question, but I haven't been able to find an answer anywhere.  If the one-time pad is unconditionally secure and impossible to crack (with just ciphertext), why does this not imply $P \not= NP$?  If not the one-time pad, what properties would a cryptographic system need to exhibit in order to imply $P \not= NP$?
Comment: What properties?  Well, one possibility would be that a decision problem associated with the cryptographic system be provably within NP, and provably not within P.
Answer: A one time pad is secure regardless of complexity. When you have a ciphertext all plaintexts are equally likely and you have no way to verify a guess. Even an attacker which enumerates all possible keys will not learn anything he didn't know already. Thus it doesn't have anything to do with complexity.
A one way function on the other hand implies $P \ne NP$. Any function which is easy to compute in one direction but hard to find a pre image. Since finding a preimage of a polynomial time function is in $NP$.
Note it is possible that no one way functions exist and and still $P$ does not equal $NP$.
A one time pad is not a one way function. It is trivial to find a preimage We can find as many preimages as we want we can't tell them apart.
Comment: "Since finding a preimage of a polynomial time function is in NP." Strictly speaking that's not true, since a search problem cannot be in NP. The corresponding decision problem is in NP though.
Comment: Shouldn't $a = b\ mod\ p$ be a one way function? Because, for any $a$ then $b = k \cdot p + a$.
Comment: @shumy $a=b \bmod p$ is clearly not a OWF, since a itself is a preimage that's trivial to find.
Comment: I am unclear what you mean by it is easy to compute a preimage.  Do you mean it is easy because we just pick a random key and random message and they look the same?
Comment: If we look at the encryption as a function it's input is both message and key, and for any cipher text we can produce any number of plaintext,key pairs to match the ciphertext.
Comment: @MeirMaor ok, but if it was the case that such "preimages" could only be found with negligible probability then it would be a one-way function?
Comment: Yes. Think of a cryptographic hash function. It is trivial to calculate it in the forward direction e.g h(x)=y but given y we have no reasonable way of finding a preimage leading to it. We can brute force all possible values to find one, and with some negligble probability we will find a preimage in our first few guesses.
Comment: @MeirMaor but what if you added a random element to the one time pad so that a pseudo inverse could only be found with negligible probability?  Are one way functions that prove P does not equal NP deterministic so that the same input gives the same ciphertext every time?
Comment: The complexity class P is defined on a determinstic touring machine. If a function isn't determinstic the idea of preimage isn't even clearly defined.


Sitecore Rule Editor Regex syntax validation

Question: Is there any way to validate regex pattern input on the rule editor when the string operator condition is selected as match regular expressions? We would like to avoid typos on regex input.
Comment: Can you please add some more details?
Comment: For example, I added condition to rule where comparison is selected as `matches the regular expression` . Based on this condition, I would like to validate specific value entered on `Enter Value` prompt dialog box on Rule Editor
Answer: After investigating it on my local instance I found that this is not possible OOTB. However, when I tried to customize it I found where the functionality is given. Here is what I found.

When I searched for the textbox taking the input on the rule editor window, I found that it is coming from a file called Prompt.xml and the functionality is being handled using a JS file called prompt.js that exists on the below path.
\wwwroot\<your-site-root>\sitecore\shell\Applications\Dialogs\Prompt

I added a new function in the prompt.js file to validate the regex pattern.
Here is the code.
function isValidRegex(s) {
   try {
       const m = s.match(/^([/~@;%#'])(.*?)\1([gimsuy]*)$/);
       return m ? !!new RegExp(m[2],m[3]) : false;
   }
   catch (e) {
       return false
   }
}

In this file I called this function in the ok_click event like below.
 function ok_click(evt)
 {
     var inputValue = $("Value").value;

     if(!isValidRegex(inputValue))
     {
        alert("not a valid regex");
        return;
     }
     ....
     ....
     ....
  }

So now if you click on the OK button it will validate and show you a message that the regex is not valid.
But I analyzed that this is not the place where it should be customized. Because it will work for all types of rules as I didn't find a way to identify it with a particular rule to validate the regex.
After investigating it more, I observed that it should be validated after all the rules are set by the user. When the user clicks on the OK button on the Create Rule window it is handled by this function that exists in the Sitecore.Client DLL under class Sitecore.Shell.Applications.Rules.RulesEditor.RulesEditorPage. Here is the source code.
protected override void OK_Click()
{
  string rulesXml = this.Rules;
  if (string.IsNullOrEmpty(rulesXml))
    rulesXml = "-";
  else if (new RulesDefinition(rulesXml).GetValidationErrors().Count > 0)
    SheerResponse.Alert("This rule may not function correctly if you do not enter values for all the parameters in all the conditions and actions.");
  SheerResponse.SetDialogValue(rulesXml);
  base.OK_Click();
}

Finally, on the GetValidationErrors() function you will get all the rules added by the user and it should be customized here.
Now the answer to the question is you need to extend this more to handle your situation and then use this with your solution.
Hope this help you to understand what you are looking for.
Comment: Thank you @sumit-bhatia I was able to override `OK_Click` to customize validation for rule editor. I appericate your effort.

Also we can use `~/sitecore/shell/override` folder to place custom xml files and source control instead of replacing OOTB.

Out of the box Sitecore won't look for overrided xml files under this folder. so we have to include patch for `xamlSharp`.


Group By Cube on Related List

Question: I need to do a group by cube on a related list. What I want is to display a list of added services groups and the distinct count across all completed inspections by package, and the matrix should have the groups along the y axis with the packages along the x axis. I'm getting an error Expecting '}' but was : 'for'
public class AddedServices3 {

public list<Inspection__c> inspections = [SELECT Id, (SELECT Added_Services_Group__c, Inspection_Package__c, Id
                                   FROM Inspection_Services__r)
                                   FROM Inspection__c
                                   WHERE Status__c = 'Completed' AND Month_Since_Launch__c > 0];

for(Inspection__c i: [SELECT id(SELECT Id, Added_Services_Group__c, Inspection_Package__c FROM Inspection_Services__r) FROM Inspection__c]){
    for(Inspection_Service__c addedservices : i.Inspection_Services__r){
        public list<AggregateResult> listAr = new list<AggregateResult>(
                [SELECT Added_Services_Group__c AddedService, count_distinct(id) cnt, Inspection_Package__c Package,
                GROUPING(Added_Services_Group__c), GROUPING(Inspection_Package__c)
                FROM Inspection_Service__c
                GROUP BY CUBE (Added_Services_Group__c, Inspection_Package__c)]
            );
    }
}}

Comment: SOQL query within for loop is bad
Comment: May or may not be related (sometimes the compiler gets confused and gives the "wrong" error message), but `Inspection_Services__r` is not a type name (`Inspection_Services__r services`).
Comment: Actually nothing works after 'for.' If I remove everything afterward, as soon as I type 'for' I get the error.
Answer: The error you're getting is apparently because you confused the parser. Simply, you missed a comma:
for(Inspection__c i: [SELECT id,(SELECT Id, Added_Services_Group__c, Inspection_Package__c FROM Inspection_Services__r) FROM Inspection__c]){
                             // missing comma...

Group By Cube on Related List


Can we say " I'm craving to see you all."?

Question: I'm craving to see you all. Is this a correct usage?
Comment: Welcome to English Language & Usage. Would you please provide some references as to why it might or might not be correct? Offhand, I would say it is grammatical but not felicitous. I could *crave* ice cream or cigarettes, but perhaps better: *I'm longing to see you.*
Comment: Did you look for the meaning of 'crave' in a dictionary?
Comment: No. It is not idiomatic to say this. If you did, people might think that you have some unhealthy and unnatural desires.
Comment: @FelimiusRex why is it necessary to take craving as in here literally? In a non formal setting won't it convey a strong longing as if a person is craving?
Comment: @Kashmiri It is not necessary. It's just the way the the great majority of people would understand it. So don't use it unless you want to display your ignorance of English idiom.
Comment: I saw somebody used this somewhere. It also made me confused. Thank you all.
Answer: It is technically correct but strikes me as extremely odd -- perhaps jocular.
I would usually expect someone to say, "I'm looking forward to seeing you all again," or "I want to see you all again."  or for emphasis, perhaps, "I long to see you all again."
Answer: I've never heard "craving" used with an infinitive. "Longing" is usual.
Answer: In general, craving is used for food or drink.
It is mostly in the present simple, though continuous is possible:
I really crave a glass of ice water.
I crave an ice cream right now.
** I'm craving a swim in the ocean. It is so hot.**
The verb crave takes a direct object, so, one could say:
I'm craving or I crave seeing you all. [seeing is a noun]
It is not idiomatic to say: crave to [verb]
Common with the verb crave:

attention
recognition
many abstract nouns.
things, especially food


Why is dmesg called dmesg?

Question: Is there any explanation/history behind the name of the command dmesg (which prints out some kernel messages)?
Answer: I think it stands for "diagnostic messages", as per the older1 man page (referenced here too).
dmesg - system diagnostic messages
Dmesg looks in a system buffer for recent kernel diagnostic messages and reproduces them on the standard output

One of the oldest references appears to be a man page revision by Kirk McKusick  dating back from 1985.

1: the link doesn't always work - no idea why... I'm attaching a screenshot though you should still be able to access the page via Google's cache.
Comment: That's how I see it: 1. OSX man page stating "The dmesg command appeared in 4.0BSD" doesn't mean OSX devs used the original `dmesg` description for their OSX man page. 2. Regardless of whether `dmesg` prints, collects or displays messages, we're still talking about _kernel diagnostic messages_, no matter how you [phrase](http://docs.oracle.com/cd/E22985_01/html/E22986/z4000ca11330020.html) that. It is about **what** `dmesg` outputs, not about the meanings of _output_ (print, display etc). Anyway, it's your question so feel free to accept the answer that you consider the best.
Comment: The man page synopsis  in 3BSD (1979) has: _"dmesg - collect system diagnostic messages to form error log"_
Comment: AFAICT the command first appeared in the [7th Unix release](http://www.tuhs.org/Archive/PDP-11/Trees/V7/usr/src/cmd/), which gets you back to 1979, no man page, and the source references neither "diagnostic" nor "debug". The v8 man page in your first link is probably the best.
Comment: How to choose of the two the answer that will be accepted?.. I believe it should be the answer with a (verified) reference going to an earlier time in history. 1980 from the other answer is better than 1985 from this one, but it remains without a material source yet.
Answer: I think the dmesg command just stands for display messages. The FreeBSD manpages seem to share this view:

dmesg -- display the system message buffer
Comment: OS X shares this idea, with both "dmesg -- display the system message buffer" as well as "The dmesg command appeared in 4.0BSD." Unfortunately my Google-fu is failing - seems difficult to find source for 4.0 BSD these days...but that traces back to 1980, so 5 years earlier than referenced in the other answer.
Comment: I see, tank you! The Linux manpage is not so "explanatory": "dmesg - print or control the kernel ring buffer"
Comment: @MarkGlossop Thanks for mentioning these bits of history! How to choose of the two the answer that will be accepted?.. I believe it should be the answer with a (verified) reference going to an earlier time in history. 1980 from your comments is better than 1985 from the other answer, but it remains without a material source yet.
Answer: According to Wikipedia, dmesg is "display message or driver message"
Comment: Why was this down-voted?
Comment: @igal Related duplicate: [What does the 'd' mean in "dmesg"?](https://unix.stackexchange.com/q/340715/125388), which hinted that definition from Wikipedia is purely informational.

Why is dmesg called dmesg?