The Interview: The Front Nine

Question: The Interview: The Front Nine
This is the first of a series of challenges inspired by programming job interview questions.
You walk into the office where your potential future boss sits. "Come on in and sit down", he says. You nervously sit down, making sure your snappy yet professional attire is free of wrinkles. He asks you many questions, about your education, previous work experiences, and so on. You answer them mostly honestly, adding a little embellishment here and there to make yourself sound better. He leans forward and begins to speak again.
"Have you ever heard of code golfing?" Why, yes, you love to golf code, and do it frequently in your free time. "Great. The last part of the interview is a technical examination. You will be tasked with writing code to solve a series of problems..." He hands you a sheet of paper. You quickly glance over it. Easy peasy. Now why did he ask about code golfing?
"You will be graded based on the total size of your solutions to these problems. If you can score lower than all the other candidates, the job is yours." Oh. "Like golf, there are 18 problems, broken up into two sets of 9. Feel free to use any language you like to solve them; we have compilers and interpreters for every language you've heard of, and certainly a few that you haven't. Good luck!"
The Tasks
Task 1: Multiplication Table
Given a number n as input, output a multiplication table for positive integers in the range [1, n]. n will be in the range [1, 12]. All numbers should be left-aligned in the table. Use the character x for the top-left corner.
Examples:
n=4
x   1   2   3   4
1   1   2   3   4
2   2   4   6   8
3   3   6   9   12
4   4   8   12  16

n=10
x   1   2   3   4   5   6   7   8   9   10
1   1   2   3   4   5   6   7   8   9   10
2   2   4   6   8   10  12  14  16  18  20
3   3   6   9   12  15  18  21  24  27  30
4   4   8   12  16  20  24  28  32  36  40
5   5   10  15  20  25  30  35  40  45  50
6   6   12  18  24  30  36  42  48  54  60
7   7   14  21  28  35  42  49  56  63  70
8   8   16  24  32  40  48  56  64  72  80
9   9   18  27  36  45  54  63  72  81  90
10  10  20  30  40  50  60  70  80  90  100

Task 2: Ordinal RMS
Given a string of ASCII characters, output the root-mean-square average of their ASCII ordinals. The string will never contain a NULL byte (ordinal 0).
Examples:
Input: The Interview: The Front Nine
Output: 95.08290393488019

Input: `1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./
Output: 91.38101204135423

Task 3: Projectile Motion
Given the initial velocity and angle with the horizon of a projectile fired from ground level, output the horizontal distance it will travel before landing. The initial velocity will be given in meters per second, the angle will be given in degrees, and the distance shall in meters. Assume Earth gravity (g=9.81 m/s/s), and ignore relativistic effects. For the sake of this problem, you may assume the Earth is flat (you will not need to consider the curvature of the Earth when making your calculations). The given angle will be in the range [0, 90]. Your answer should be accurate to at least two decimal places (rounding is allowed).
Examples:
velocity=50, angle=45
Result: 254.84 (rounded)

velocity=10, angle=60
Result: 8.82798576742547

Task 4: etaoin shrdlu
Given a string of non-null printable ASCII characters (ordinals in the range [32,127]), output the string, with its characters sorted by their frequencies in descending order. In the case of a tie, order by ASCII ordinal, ascending.
Examples:
Input: "Hello, World!"
Output: "llloo !,HWder"

Input: "Programming Puzzles and Code Golf"
Output: "    oooPPaaddeeggllmmnnrrzzCGfisu"

Task 5: Fibonacci Index
Given a number, determine if it is a Fibonacci number, and if it is, output its index (starting from 1) in the sequence. If it is not a Fibonacci number, output 0. In the case of 1, which is in the sequence twice, output the earliest occurrence (index 1).
Examples:
Input: 1
Output: 1

Input: 144
Output: 12

Input: 4
Output: 0

Task 6: Anagrams
Given three strings of lowercase English letters ([a-z]), output a string that uses all the letters in the first string, begins with the second string, and ends with the third string. If such a string cannot be constructed, output an empty string. The input strings will always be at least one letter long. The "middle" of the output string (between the prefix and postfix string) may be empty, if the prefix and postfix strings together use all of the letters in the source string.
Examples:
Input: geobits bi es
Possible output: bigtoes

Input: mariatidaltug digital trauma
Output: digitaltrauma

Input: mego go lf
Output: (empty string)

Task 7: Filling In The Blanks
Given a list of strings and a fill character, output the result of padding all of the strings to the length of the longest string with the fill character, sorted in ascending order by the original lengths of the strings, preserving the original order in the case of a tie. You should be able to handle lists of any finite length, containing strings of any finite length, bounded only by memory constraints.
Examples:
Input: ["hello","world","this","is","a","test"], 'x'
Output: ["axxxx","isxxx","thisx","testx","hello","world"]

Input: ["I'm","a","lumberjack","and","I'm","okay"], '!'
Output: ["a!!!!!!!!!","I'm!!!!!!!","and!!!!!!!","I'm!!!!!!!","okay!!!!!!","lumberjack"]

Task 8: Making Change
Given a number in the range [0.01,0.99], output the number of each of the 4 standard US coins that should be used to represent this value such that the total number of coins is minimized. The input will always have exactly 2 places behind the decimal.
Coin value reference:
Penny: 0.01, Nickel: 0.05, Dime: 0.10, Quarter: 0.25
Examples:
Input: 0.75
Output: [0,0,0,3]

Input: 0.23
Output: 3 pennies, 0 nickels, 2 dimes, 0 quarters

Task 9: Merging Ranges
Given a finite list of 2-tuples containing integers that represent ranges, output the result of merging all overlapping or adjacent ranges. All ranges will be at least of length 1, and the starting value will always be less than the ending value. The order of the output does not matter.
Examples:
Input: (2,3), (4,5), (6,9), (0,7)
Output: (0,9)

Input: (-3,4), (2,5), (-10,-4)
Output (-10,-4), (-3,5)

Input: (2,3), (5,6), (6,8)
Output: (5,8), (2,3)

Rules

This is code-golf, so shortest answer (in bytes) wins.
Your score will be the sum of the byte counts for all of your solutions.
Standard loopholes are forbidden.
Input and output may be performed in whatever manner is considered standard for your language.
You may write full programs or functions for each challenge, and may interchange between the two across challenges.
You must use the same language for all the challenges. If version differences are significant enough for them to be usually considered separate entries in challenges, you must use the same version throughout. For example, if you use Python, you must use either Python 2 or Python 3 for all challenges.
You must solve all of the challenges. Answers that only solve some of the challenges will be considered non-competitive.
You may use language builtins or standard libraries.

Leaderboard
The Stack Snippet at the bottom of this post generates the leaderboard from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:
## [><>](http://esolangs.org/wiki/Fish), 121 bytes

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Comment: although i would love to have such an interview i doubt if it ranks people well. eh, whatever. still fun
Comment: @pppery, this question is older than the link you provided, so I don't think that it applies to this question.
Comment: Are we allowed to output numbers in scientific notation in task 1?
Comment: Do we have to print results or can we return them from functions? If the latter is permissible, for task 1 can we return a matrix or similar?
Comment: Task 8 seems to have 2 output formats, can we just use the first one?
Comment: @aditsu Those are two example output formats. You may use any format within reason.
Comment: @AlexA. You can return results from functions. I'm guessing your matrix question is about #1 - yes, that is acceptable.
Comment: This is an awesome challenge!
Comment: How add `imports` to the byte count? Let's say 4 of the tasks need the same import (e.g `import math`), does it count 4 times? Or can I answer with a single source file with 9 functions for the 9 task with some imports at the beginning counting only once? Same for helper functions that can be used in several tasks.
Comment: Is crashing with an error and printing nothing to STDOUT considered "output the empty string" for task 6?
Comment: In task 8, can counts be printed in the order `quarters, dimes, nickels, pennies`?
Comment: @nimi The solutions to each of the challenges are considered separate - if you need to import something for multiple tasks, each task's answer must have the import.
Comment: @isaacg Re: crashing: No. As per our usual requirements, the only allowed output besides what is specified in the task is anything the compiler/interpreter outputs that cannot be suppressed and color codes. Re: task 8: Yes, but you should mention in your answer what the order is.
Comment: @Mego: All right. However, I think  you're wasting  a good golfing opportunity. This way it's just 9 standard tasks, no difference to 9 separate questions, no added value. If we can combine them into a single challenge there's much more room for golfing. Please reconsider this for the next part.
Comment: @nimi With the (admittedly few) multiple-holes challenges so far, the requirement has been that the individual answers should be independently-runnable. The point of this challenge was to enforce the one-language requirement - some of these tasks are short in a given language, but the others are much longer. I will keep your suggestion in mind for the Back Nine, though.
Comment: For task #1, since you said we can return a matrix, does that matrix need to include the `x` and ranges, or just the multiplication results?
Comment: @mbomb007 You need the headers and the `x`.
Comment: I'm voting to close this question as off-topic because it's a [multi-part challenge with insufficient interaction between the parts](https://codegolf.meta.stackexchange.com/questions/8463/should-multi-part-challenges-be-allowed)
Answer: CJam, 162

25 bytes • qi),0Xt_ff{*s4Se]}N*s0'xt
12 bytes • q_:i:mh\,mq/ (© Dennis)
18 bytes • q~P*90/ms\_**9.81/
12 bytes • q$e`{0=~}$e~ (© Dennis)
16 bytes • 1_{_2$+}99*]qi#)
22 bytes • qS/(1+1$s{1$#Lt}/)@@**
18 bytes • q~{,}$_z,f{W$e]}p;
16 bytes • q2>i25A5]:md]W%p
23 bytes • q~${_0=2$1=>{+$3%}|}*]p

Dennis agreed to join forces :)
Answer: Pyth, 155 153 149 142 141 131 130 bytes
4 bytes thanks to @FryAmTheEggman
1, 5 and 4 bytes thanks to @Jakube

24 bytes: J+1SQp\xtjmsm.[`*dk\ 4JJ

Construct the multiplication table from the list [1, 1, 2, 3, ...], which is +1SQ, then print a x and remove its first character.

10 bytes: @.Om^Cd2z2

Straightforward.

18 bytes: c*.t.tyvw7Z*QQ9.81

Uses the formula sin(2 theta) * v^2/a, where theta is the angle, v is the initial velocity and a is 9.81

7 bytes: o_/zNSz

Straightforward.

15 bytes: hxeM.u,eNsNQU2Q

Generate fibonacci pairs, find the index of the input in them, add one.

14 bytes: IqSzSJj.-zsQQJ

Use bagwise subtraction to remove the prefix and suffix from the word, then put the remainder of the word in the middle. If the result of this is not a permutation of the input, don't print it.

8 bytes: C.tolNQz

Sort by length. Filled transpose. Transpose again.

18 bytes: Jsttz/L~%Jd[25T5 1

Output coin counts are in the order [quarters, dimes, nickels, pennies].
Remove first 2 characters of input and cast to int to get cents. Save to J. For each number d in the list [25, 10, 5, 1], post-assign J%d to J, then generate the value /Jd with the original value of J. Print.

16 bytes: C-M.p,JS{srMQhMJ

Turn the tuples into ranges, combine into one list, deduplicate and sort. Save this to J. Form J, hMJ and hMJ, J, where hMJ is J with every element increased by 1. Perform subtraction in both cases. The former is the lower ends of the ranges, the latter is the higher ends. Transpose them into pairs and print.
Answer: CJam, 223 bytes
Task 1, 35 bytes
ri_)_,0Xt2m*::*0'xt:s@s,2+f{Se]}/N*

Try it online.
Task 2, 12 bytes
q_:i:mh\,mq/

Try it online.
Task 3, 27 bytes
rd180/P*_mc\ms]rdf*~4.905/*

Try it online.
Task 4, 12 bytes
q$e`{0=~}$e~

Try it online.
Task 5, 17 bytes
XXri:R{_2$+}*]R#)

Try it online.
Task 6, 25 bytes
re!_rf#:!.*r:S;{N+SN+#)}=

Try it online.
Task 7, 19 bytes
{:C;{,}$_W=,f{Ce]}}

Try it online.
Task 8, 33 bytes
A4m*{:+}$r2>i:R;{[X5A25].*:+R=}=p

Try it online.
Task 9, 43 bytes
{{~1$-,f+}%:|$__,(%a\2ew{:-W<},+e_$2/2,f.+}

Try it online.
Answer: Haskell, 650 bytes
Task 1, 88 bytes:
f n="x   "++unlines(map(take 4.(++"   ").show=<<)$[1..n]:map(\a->a:map(a*)[1..n])[1..n])

Task 2, 76 bytes:
g s=sqrt(sum(map(fromIntegral.(^2).fromEnum)s)/sum(s>>[1]))

Task 3, 28 bytes
v?a=v*v/9.81*sin(2*a*pi/180)

Task 4, 60 bytes:
import Data.List
i x=concat$sortOn((0-).length)$group$sort x

Task 5, 64 bytes
j=(%zip[0..]z);x%((i,h):t)|x<h=0|x==h=i|1<2=x%t;z=scanl(+)0(1:z)

Task 6, 93 bytes
import Data.List
k a b c|q b a&&q c a=b++((a\\b)\\c)++c|1<2="";q=(.sort).isSubsequenceOf.sort

Task 7, 81 bytes
import Data.List
s!f=map(take(maximum$map r s).(++cycle[f]))(sortOn r s);r=length

Task 8, 73 bytes
m x=floor(x*100)#[25,10,5,1];x#[]=[];x#(h:t)|(d,m)<-divMod x h=(m#t)++[d]

Task 9, 87 bytes (a shameless copy of @MtnViewMark's answer from a similar challenge)
n i=foldr(&)[]i;p@(a,b)&(q@(c,d):r)|b<c=p:q&r|a>d=q:p&r|1<3=(min a c,max b d)&r;p&_=[p]

Answer: Mathematica 10.3, 465 bytes
All of these are anonymous functions. Also, thanks to Martin for help golfing, since I'm a noob at Mathematica.
Task 1, 69 bytes
Grid@Join[{Join[{"x"},r=Range@#]},Flatten/@({r,Outer[1##&,r,r]}\[Transpose])]&

\[Transpose] is the 3 byte "transpose" symbol.
Task 2, 13 bytes
Mean[#^2]^.5&

or
√Mean[#^2]&

(√ is 3 bytes). The RootMeanSquare built-in isn't quite short enough...
Task 3, 18 bytes
Sin[2#2°]#/9.81#&

Task 4, 57 bytes
""<>SortBy[c=Characters@#,{-c~Count~#&,ToCharacterCode}]&

Task 5, 33 bytes
Tr@Position[Fibonacci@Range@#,#]&

or
Tr[Fibonacci@Range@#~Position~#]&

or
Tr[Fibonacci~Array~#~Position~#]&

Task 6, 178 bytes (currently has a bug)
({s,a,b}=Characters@{##};q=If[#2~SubsetQ~#,List@@(Plus@@#-Plus@@#2),{}]&;i=If[#!={},##]&;x=i[q[s,a],{}];y=If[x!={},i[q[x,b],{},Null],Null];Echo[If[y!=Null,""<>Join@{a,y,b},""]])&

Less golfed:
({s,a,b}=Characters@{##};
q=If[#2~SubsetQ~#,List@@(Plus@@#-Plus@@#2),{}]&;
i=If[#!={},##]&;
x=i[q[s,a],{}];
y=If[x!={},i[q[x,b],{},Null],Null];
Echo[If[y!=Null,""<>Join@{a,y,b},""]])&

String manipulation is horrid...
Task 7, 39 bytes
#~SortBy~StringLength~StringPadRight~#1

Task 8, 46 bytes
FrobeniusSolve[{1,5,10,25},100#]~MinimalBy~Tr&

or
{.1,.5,.10,.25}~FrobeniusSolve~#~MinimalBy~Tr&

Task 9, 12 bytes
Interval@##&

Intervals passed to the constructor are automatically union-ed. Beat that.

The Interview: The Front Nine


Was Leto really gunning for the Emperor's throne?

Question: In an answer from a previous question, the Padishah Emperor conspired against the Atreides because he saw Leto as a threat to his reign- but were the Emperor's suspicions justified?
Comment: Popularity in houses of the landsraad was also significant.  Power fears power, and Leto had a trajectory of growing power.
Answer: As far as I know, there isn't any evidence either way.  Part of the problem is Leto suspects the emperor of conspiring with the Harkonnens from the very beginning, so we don't know what he thought before he was aware of this danger and there just isn't much on Leto in the book period.
This is considering just the original novel.  I don't know if the prequel novels go into more detail, but I would be reluctant to consider them even if they do.  In the original novel all we have is Leto's popularity in the Landsraad and that he was beginning to train soldiers that could individually match the Sardaukar but no evidence either way that he planned to use either or both to overthrow Shaddam.
Answer: To Duke Leto, gaining the Imperial Throne for House Atreides was a possibility.
For Shaddam IV, losing the Throne for House Corrino was an inevitability. The threat to his reign came from Primogeniture, The Emperor knew his dynasty was ending because he had no male heir. Duke Leto wasn't just another suitor, who could ascend through marriage, he was one whom the emperor disliked.
information from the "Prelude to dune" prequels:
Shaddam IV would be the last Corrino Emperor due to the Bene Gesserit taking control of the imperial seed through marriage and contraceptives. The Corrino heiress, Irulan Corrino, was of marriable age to either Leto or Paul, among a great number of other potential suitors. So why not arrange a marriage to Duke Leto the just? Because the Emperor can hold a grudge. Duke Leto and Shaddam IV have a complicated history involving:  public opinion following Military campaigns, supporting different sides in a proxy war on IX, and the Duke used blackmail to receive an imperial pardon during a trial. The sordid past  between Shaddam IV and Leto is what lead the Emperor to conspire with the Harkonnens.
Comment: Isn't it true that the House Corrino ruled the empire for 10,244 years before Shaddam IV ascended the throne.  And membership in a house descends by agnatic (male only) descent.  So if Shaddam IV had only daughters the throne would pass to a brother, nephew, first cousin, second cousin, etc. who was the closest relative agnatically and not to the husband of Shaddam's daughter.


VLC streaming with ip camera - reconnect when camera resets

Question: I am using VLC to get the video stream from my ip cam and stream it to the network, in order to save the limited wifi band that reaches the cam. The command I use to do this is as follows:
<code>cvlc [cam stream] --sout "#standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:[chosen port]}"
</code>
The problem is that when the camera restarts neither VLC quits nor it reconnects to it, so I cannot run it again. Does anyone have an idea on how to sove this? Any help will be very appreciated.
Answer: Got it working by writing a script that periodically connects to the vlc instance via TELNET, checks the ammount of bytes received and saves it into a log file. In case the ammount of bytes is equal to the last time it checked, it sends a stop then a play command to VLC and, if the camera is back online it will work again. If anyone wants more details about the implementation, just ask!


Labelling chords in Bach's chorale

Question:
The image is a part of Bach's chorale BWV 94.8 or R. 291 (image taken from www.bach-chorales.com). I want to confirm the harmony of the 2 chords marked with a star. Is the chord with a blue star A7/C# with the D as an accented passing note? And the chord with the orange star, Dsus E (or Dsus2, Dsus9 as some call it, if I am not wrong)?
Answer: You are correct for the first chord. It's a A7 in first inversion (A7/C#) or the V6 5 in your Dmajor scale. The D in the bass is a accented passing tone, like you mentioned.
The second chord is simply a D major chord with a E as a suspended note (because it was played in the previous chord) or appogiatura (because it was not held); either way, it's a non-chord tone that resolves to the chord note D. It's pretty common in Bach after the V chord to play the I, and that is what is happening here.
Bach didn't use sus2 chords per se. He might use like he did in this example, were the 2 was just a non-chord tone that is resolved in the chord note, so don't go looking for sus chords in Bach's chorales.
Comment: Yes there are lots of sus notes in Bach's music. The modern use of sus chords has evolved from a very long tradition, a tradition which is very alive in Bach's music. The term "sus" comes from the usage of suspended notes, notes played in the previous chord and prolonged when the chord changes. The modern usage of "sus" where a sus chord sometimes can appear without the note being played in the previous chord is an example where the term "sus" actually has lost its real meaning.
Comment: *don't go looking for sus chords in Bach's chorales.*
I think there are lots of sus chords by Bach. sus 4->3 and sus 2->1 (9->8).  Do you interprete them all as passing tones? Coming from the horizontal perspective of counterpoint? I wonder what other users think. Anyway it is an interisting point to discuss and it would demonstrate to Grace that there are always different points of view in analysis.
Comment: @AlbrechtHügli yes, I would consider them as passing tones or appogiaturas or delayed resolutions or something
Comment: @Shevliaskovic a delayed resolution is precisely where the "sus" in sus4 and sus2 comes from.

Labelling chords in Bach's chorale


Can I load a C++ shared library built with address sanitizer from Rust?

Question: In tree-sitter, grammars are compiled from C and C++ to shared libraries. These libraries are then dynamically loaded by the tree-sitter CLI, which is a rust program. The tree-sitter CLI is usually responsible for compiling the grammar, although it does so without -fsanitize flags. I manually compiled my grammar with -fsanitize=address (eventually want to add undefined) to help with debugging some C++ code I wrote as part of the external scanner. However, when I try to load it with the tree-sitter CLI rust program I get:

Error opening dynamic library "~/.cache/tree-sitter/lib/tlaplus.so"
Caused by:
~/.cache/tree-sitter/lib/tlaplus.so: undefined symbol: __asan_report_store4

So rust isn't loading ASAN. I tred rebuilding the tree-sitter CLI with the nightly rust toolchain and:
RUSTFLAGS="-Z sanitizer=address" cargo build --target x86_64-unknown-linux-gnu --release

But this still gives the same undefined symbol error. Is there any way to load a C++ library compiled with ASAN from rust, or should I just write my own C++ front end to the grammar?
Answer: According to https://maxammann.org/posts/2021/06/sanitize-rust-sys-crate/
RUSTFLAGS="-C link-arg=-lasan"


Pressing palms together in respect for the lotus sutra - a boddhisattva?

Question: I listened to the lotus sutra as an audiobook. There I heard that when one presses the palms together in respect for the lotus sutra, it means that one has paid already homage to myriads of Buddhas in the past. Does that mean if I do this I am eligible to become a Buddha?
Comment: If you're making the effort to listen to the sutra in the first place, you're paying plenty of homage already.
Comment: What does 'eligible to become a Buddha' mean to you? I am not sure what you have in mind.
Comment: Will I be able to? Because from what I've read/listened to you have to have paid homage to myriads of Buddhas before you are able to become a Buddha yourself. Correct me if I'm wrong.
Comment: @MalikA - Don't worry. No need to pay homage to anyone. Somewhere along the line in your practice you might find yourself wanting to pay homage but that'll be your decision and by then you'll have some idea of the reason for it. You are definitely already eligible and have no choice in the matter.   .    .
Answer: The greeting with joined palms is mentioned throughout the suttas. In general, the entire Sangha is worthy of such greeting:

DN33:1.11.105: 'The Saṅgha of the Buddha's disciples is practicing the way that's good, straightforward, methodical, and proper. It consists of the four pairs, the eight individuals. This is the Saṅgha of the Buddha's disciples that is worthy of offerings dedicated to the gods, worthy of hospitality, worthy of a religious donation, worthy of greeting with joined palms, and is the supreme field of merit for the world.'

Note the clarification about four pairs and eight individuals. The fourth pair comprises those perfected or practicing for perfection. But it takes more than simply paying homage. All of these eight individuals have undertaken the Noble Eightfold Path: Right View, Right Thought, Right Speech, Right Action, Right Livelihood, Right Effort, Right Mindfulness and Right Immersion.
Even Gautama Buddha had to be encouraged to pay homage to a living Buddha. He had to be grabbed by the hair:

MN81:8.16: Then Ghaṭīkāra grabbed Jotipāla by the hair of his freshly-washed head and said, 'Dear Jotipāla, the Buddha Kassapa's monastery is not far away. Let's go to see the Blessed One Kassapa, the perfected one, the fully awakened Buddha. For I regard it as holy to see that Blessed One.'

It is good that you are paying homage to the Buddhas already. But perhaps more attention to the entire Noble Eighfold Path would be more effective than such simple observances?
Comment: Thanks but that is not Mahayana.


jQuery popstate event handling in firefox

Question: I have got something like this:
<code>jQuery(document).ready(function () {
    jQuery(window).bind('popstate', function () { do sth;});
});
</code>
It works like a charm in chrome, but doesn't work in FF (event handler is not fired). When I take this code outside the ready block, the event can be handled, but I don't like it being outside ready block.
Do you know any solutions?
Cheers.
Answer: Problem solved, just did window.onpopstate = function () {} :)


Does posting my computer name publicly make my system vulnerable?

Question: I am wondering if it is paranoia and/or privacy overkill to block out one's computer name when posting terminal output in public forums? I don't know enough about networking to know if it's possible that this information could make one's system vulnerable somehow (though I suspect not?) and was hoping someone could shed some light.
Answer: Generally, no. Your computer should not be reachable from outside your local network, with the name or without.
However, it can leak info like your real name, or allow people who know your computer name to match your online username to the real you. Whether this is a major concern is up to you.
Comment: @MarkBuffalo *Outside* the local network. \\computername will not work if you are not on the same local network as that computer - and if it's posted to the internet, the vast vast majority of viewers are not going to be on your local network.
Comment: @MarkBuffalo One can pretty easily get a list of all the computers in a local network, so hiding it from them is pretty irrelevant anyway.
Comment: How can it not be reachable without on the local network? You can do `\\computername` via network.
Comment: I should've worded it better. If you're on the same local network, it can be used to access the device if the permissions are appropriate. Then again, you did say, "generally."
Comment: Agreed. It's not too difficult.


Book covering differential geometry and topology for physics

Question: I'm interested in learning how to use geometry and topology in physics. Could anyone recommend a book that covers these topics, preferably with some proofs, physical applications, and emphasis on geometrical intuition? I've taken an introductory course in real analysis but no other higher math.
Comment: I like Messer, Topology Now! It's easy and fun, and it gets you going on nontrivial stuff without a lot of prerequisites or worrying about what a physicist would consider pathological cases.
Answer: The first thing that must be said is that the question is not really specific enough: Applications to what exactly are you looking for? To me, a book on algebraic geometry and mirror symmetry, and how it relates to mirror symmetry as physicists know it, is very relevant and interesting. However, I have the feeling that this is not exactly what you're looking for.
Therefore, I will mostly stick to "basic stuff", that seems relevant to anyone really interested in e.g. high energy physics (on the theory side of things, obviously), without assuming the reader is really interested in advanced stuff. However, I'll include a section of "specialized" books, where some more esoteric and/or difficult topics are included, as well as books that completely focus on one specific branch of physics (e.g. general relativity), rather than developing the general mathematical tools.
Finally, note that I'm omitting standard introductory texts for both topology & geometry if I feel the text is not really aimed specifically at physical applications, since there are so many that even with this stringent criterion there is enough left. Here we go (in alphabetical order):
Basics
Baez & Muniain - Gauge Theories, Knots and Gravity
Interesting book that develops the mathematics along with the relevant physical theories: The first chapter is on E&M and the relevant mathematical notions such as forms, the second chapter is about gauge theory, both from the physical and mathematical perspective, and the last chapter is about general relativity and Lorentzian geometry.
Bleecker - Gauge Theory and Variational Principles
Starts with a very brief treatment of tensor calculus, fiber bundles etc, quickly moving on to physical topics such as Dirac fields, unification (of gauge fields) and spontaneous symmetry breaking.
Bredon - Topology and Geometry
After seeing the added message by QuanticMan, requesting answers not to shy away from going beyond the intentions of the OP and to recommend books with geometrical intuition, this book immediately sprang to mind. In the preface, Bredon states:

While the major portion of this book is devoted to algebraic topology, I attempt to give the reader some glimpses into the beautiful and important realm of smooth manifolds along the way, and to instill the tenet that the algebraic tools are primarily intended for the understanding of the geometric world.

This seems to perfectly fit the bill, and I can personally recommend it. Note, however, that it purely a book about mathematics: No applications to physics are presented, though the tools are of course relevant in physics, too.
Burke - Applied Differential Geometry
Starts with about 200 pages of mathematical tools (from tensors to forms) and then delves into applications: From the heat equation to gauge fields and gravity.
Cahill - Physical Mathematics
This is a really basic book, that does much more than just topology and geometry: It starts off with linear algebra, spends a lot of time on differential equations and eventually gets to e.g. differential forms.
Fecko - Differential Geometry and Lie Groups for Physicists
Develops the basic theory of manifolds (the focus is not on topology), and eventually treats a bunch of topics including classical mechanics (symplectic geometry), gauge theory and spinors. There is also a (much shorter) set of lecture notes by Fecko on the same topic.
Frankel - The Geometry of Physics: An Introduction
This is a big book that covers a lot of group mathematically, but does not really focus on physical applications. The topics include differential forms, Riemannian geometry, bundles, spinors, gauge theory and homotopy groups.
Gilmore - Lie groups, physics and geometry
Subtitled "An Introduction for Physicists, Engineers and Chemists", this book could be a good starting point for someone who is really only interested in simpler, down-to-Earth topics. Includes a chapter on "hydrogenic atoms", which sounds interesting.
Hamilton - Mathematical Gauge Theory: With Applications to the Standard Model of Particle Physics
I personally attended professor Hamilton's lectures, corresponding to approximately the first 450 pages of this book, and can vouch for the fact that everything in this book is presented with great care. It might be a bit overwhelming for someone who really only wants to focus on the physical applications, but many of the technical details of the background material that are often omitted in other texts are presented here in full. The second part is focused on physical applications, mostly to classical gauge theories. The text assumes some basic familiarity with manifolds, but not much else.
Isham - Modern differential geometry for physicists
A "standard introductory book" on differential geometry, translated to the language of physicists. Isham is careful to point out where mathematical notions that he introduces are used in physics, which is nice for those who prefer not to lose track of the physical relevance of it all. Covers all the basics up to fiber bundles in about 300 pages.
Jost - Geometry and Physics
Quickly gets to more advanced topics including moduli spaces, spinors and supermanifolds (all within the first 100 pages) in the first part, dedicated to mathematics. The second part is dedicated to physics and includes e.g. sigma models and conformal field theory.
Mishchenko & Fomenko - A course of differential geometry and topology
Though this is pretty much a "general introduction" book of the type I said I wouldn't include, I've decided to violate that rule. This book is Russian, and the style of Russian textbooks is very physical and interesting for physics students, in my opinion. Furthermore, the book does not focus on either differential geometry or topology, but covers both (briefly), which is also good for physics students.
Naber - Topology, Geometry and Gauge Fields (two volumes)
The first volume has a cute motivational chapter which introduces advanced notions (sadly, those are usually the ones that turn out to be relevant in physics), and first discusses homology & homotopy (in reverse order?!) before moving on to manifolds and bundles (also in reversed order?!), ending with (physical) gauge theory. The second volume covers more advanced topics such as Chern classes.
Nakahara - Geometry, Topology and Physics
The go-to book for mathematical prerequisites for e.g. gauge theory, string theory etc. if you ask 90% of physicists. I personally think it's terrible because it doesn't explain anything properly, but I guess it's good to learn buzzwords.
Nash & Sen - Geometry and Topology for Physicists
This book is not very physical, but seems very nice if you're really trying to get a good grip on the math. It takes its time to (properly, I hope) develop all the theory in order: fundamental group, homology, cohomology and higher homotopy groups are all introduced, before fiber bundles and then Morse theory and (topological) defects are treated (!!). The final chapter is on Yang-Mills theories, discussing instantons and monopoles.
Von Westenholz - Differential Forms in Mathematical Physics
After about 400 pages of preparatory mathematics (including, besides the standard topics, Frobenius theory and foliations, which is nice!), the book treats classical mechanics and relativistic physics (including fluid mechanics), each in about 50 pages.

Specialized and/or Advanced Texts
Booss & Bleecker - Topology and Analysis: The Atiyah-Singer Index Formula and Gauge-Theoretic Physics
Advanced topic---very analytic, with lots of information on elliptic differential operators.
Cartan - Theory of Spinors
Couldn't resist putting this in: The original classic on spinors, by the discoverer himself. Kind of outdated (in e.g. notation) and therefore probably not very useful to modern students.
Deligne et al. - Quantum Field and Strings: A Course for Mathematicians (two volumes)
The two volumes cover about 1500 pages, with contributions from famous mathematicians and physicists alike (Deligne, Witten...). Covers lots of advanced topics in physics from a mathematical perspective, and includes exercises.
Dunajski - Solitons, Instantons and Twistors
Because the OP mentions solitons I thought this might be interesting to mention: Basic topology and geometry is assumed to be known, and a lot of physically interesting topics are covered (such as monopoles, kinks, spinors on manifolds etc)
Levi-Civita - The Absolute Differential Calculus
Another classic, and one of the first books on tensor analysis.
Nash - Differential topology and quantum field theory
This book seems fascinating for those who are really trying to get into the more difficult parts of gauge theory. Topics covered include topological field theories (knots invariants, Floer homology etc), anomalies and conformal field theory.
O'Neill - Semi-Riemannian Geometry With Applications To Relativity
A well-known textbook on the mathematical underpinnings of general relativity.
Sachs & Wu - General Relativity for Mathematicians
Same as the previous book
Ward & Wells - Twistor geometry and field theory
This book is completely dedicated to the theory of twistors: The last part is about applications to gauge theory.
Comment: Which of these books did you like? Upon first sight, i really liked Frankel's Geometry of physics
Comment: @TheQuantumMan Frankel looks like one of the more serious books in the list. I think it could be nice.
Answer: If you want to learn topology wholesale, I would recommend Munkres' book, "Topology", which goes quite far in terms of introductory material.
However, in terms of what might be useful for physics I would recommend either:

Nakahara's "Geometry, Topology and Physics"
Naber's "Topology, Geometry and Gauge Fields: Foundations"

Personally, I haven't read much of Nakahara, but I've heard good things about it, although it may presuppose too many concepts. I've read selections of Naber and it seems fairly well written and understandable and starts from first principles, but again, it may not focus as much on the fundamentals, if that's what you're looking for.
Comment: A reason for studying Naber's book -- If you want to delve into the subtleties of Dirac monopole, i.e. Hopf fibration of $S^3$ (which describes the geometry of the Dirac monopole), I would recommend you this book for sure. Nash and Sen is a good book, too. However, my personal favourite (apart from Nakahara) is "The Geometry of Physics," by Theodore Frankel.
Comment: I enjoyed reading Nash and Sen, It suited my taste, being less formal, and more intuitive. Nakahara is nice. Schwarz seemed good at first glance, but I havent read it.
Comment: Sorry, I haven't heard anything of that book. However, judging by the absolutely ridiculous price on Amazon...
Anyway, I was also flipping through Nash and Sen's book, and it seemed to treat topology in a very intuitive and clear manner, although at a mathematical price - Amazon reviewers claim that it isn't too mathematically rigorous/comprehensive.
Comment: You also asked about topics in topology relevant for physics. Apart from the basic definitions and so on, one of the most applied concepts is Homotopy. It is beautiful in itself, and it formalizes the concept of winding numbers to higher dimension. In physics it is commonly used to enumerate the topological solitons present in your theory.There are others, but I found Homotopy to be very important and useful.
Comment: Here is the table of contents of Frankel's book from nLab written by Prof. Schreiber: https://ncatlab.org/nlab/show/The+Geometry+of+Physics+-+An+Introduction
Answer: For a new, concise, and very complete text with applications to many fields of physics, see Differential Topology and Geometry with Applications to Physics, by Nahmad-Achar (IOP Publishing).
This book presents, in a concise and direct manner, the appropriate mathematical formalism and fundamentals of differential topology and differential geometry together with essential applications in many branches of physics.
Answer: Upon visiting this post when I needed some guidance, I am revisiting to maybe offer some baed on my insights.
After some trial and error, I found that a good combination that works for me is the following:
I used Nakahara's "Geometry, Topology and Physics" because its thorough. It's a good read overall but not terribly exciting since it doesn't provide some extra intuition. For that, I supplied myself with Frankel's "the Geometry of Physics". Frankel contains a lot of illustrations and sometimes cover topics in a more intuitive manner. Finally, I found Baez's and Muniain's "Gauge Fields, Knots and Gravity" to be superbly written, so that it can be read very easily and gives a very strong intuitive (and physical) image of what's happening.
So, a combintation of those three was ideal for me.
As a side note, I briefly used Fecko's "Differential Geometry and Lie Groups for Physicists" but found its overeliance on exercises to be big negative. I love it when there are many exercises to go through, but the author sometimes relies on the reader to go through very important points through exercirses and sometimes the timing is off; when a new concept is introduced, it sometimes requires a change in the way of thinking about it, so to delegate the fundamental understanding of a new concept to an exercise that the reader might not be able to solve is not a very good idea. I use it from time to time to find alternative explanations and to solve exercises (many of which are excellent), so it's not all bad.
Another that I liked is Isham's "Modern differential geometry for physicists". It doesn't get into advanced topics such as those covered in the later chapters of Nakahara, but I found it very pedagogical and it excels at getting to the point fast and efficiently.
Answer: Don't hurry ramanujan, learn basic mathematical methods first (from Sadri-Hassani's "Mathematical Physics" for instance). Then the standard reference for you to learn grad-level mathematics would be Nakahara's "Geometry, Topology and Physics". If you think it's too much, you're right; this is a very serious advanced topic. But if you want to quickly pick some basic ideas, check out the 10th chapter of Ryder's "Quantum Field Theory". An advanced and physically oriented discussion would be found in Coleman's "Aspects of Symmetry".
Comment: What about Topology for physicists by Schwarz?


In which real life application is BPM actually used?

Question: What is the role of BPM (BussinessProcessManagement) in a realtime application?
I mean in which cases or where is BPM actually used?
I could get the documentation from the net, but where actually is it used?
Answer: One definition of BPM is that is combines workflow management (humans interacting) with enterprise application integration (EAI, systems interacting). You can get applications and tools for those applications - sometime embedded - which you can use to define you business process. Then, in a staging process, you can roll out the business process to that system or a set of applications. To execute a business process (BP) you can use a business process engine (e.g. jBPM), and each step of a business process can be represented by a user interaction, a user task, a system task or variations of these. You can have parallel business steps that only once all of these complete can go to the next business process step. And there is much more to that.
Once you have rolled out a business process you can monitor it and collect data for a number of parameters. Often you will be interested how long a business process took and what the limiting factors are, e.g. how many manual steps are required. Then you can go back to the designer tool and modify the process. With data taken from the production system you can then simulate whether your changes are actually an improvement. And if they are you roll it out replacing the previous version.
On a smaller scale you can workflow designer or business process designers to allow user changing a particular part of a process. Often applications have hard-coded business process support with only limited parameterization/configuration. Take an approval process. Which purchases need approval? By whom? Could multiple people approve in parallel thus shortening the purchasing process? You application may offer your users to design the approval process as needed. It would no longer be hard-coded and allow for much better adaptation to the needs of your customer.
These are just a few thought and definitely not a full coverage of this subject. But maybe it already gives some idea.
Answer: BPM can be used in Health care application for integrating various systems and in banking field for loans aplication processing where human involvement is involved in different steps for loans approval, and in health care industry it is used mostly used for bundle of claims which we receive every day for cliams processing and for business state in which state to know.
and in The airline Reservation System for ticket booking process how the process moves one one level to another ex: adding passenger to flight.


Does independent two sample t-test suffice for comparing the percent of female in two groups?

Question: I have two groups of an experiment, and I want to show first that they are similar in terms of demographics. One of the demographic factors is gender. I've looked for the most recommended way to compare the proportion of females in the two groups - I found some mixed answers about proportions comparison and wondered - why can't I just treat the IsFemale variable as a numeric (0/1), and than run independent 2 sample t-test on the groups (which will provide the differences between the %female)? Are there any risks in this method?
Comment: https://stats.stackexchange.com/search?q=t-test+proportion
Answer: The two-sample t-test will allow you to assess whether there is a significant difference in the means of the two groups.
However, if you are using a t-test, you are assuming the distributions of both groups are close to normal. With your binary variable, this assumption will not hold.
Comment: Thanks, do you have a recomendation for this type of comparison?
Comment: Because your data doesn't have a distribution (and an associated variance), finding a valid statistical test is problematic...


can a switch participate in STP without MAC?

Question: I was wondering if my switch that doesn't have MAC addresses assigned to any of its customer ports can even pareticipate in spanning tree protocol negotiations?
Answer: Switches don't normally have MAC addresses assigned to the access ports because switches are transparent devices. The switch itself has one or more MAC addresses internally that it will use for things like STP.
If this is a layer-3 switch, and you can change an access port into a router port, then the switch supervisor will assign a MAC address to the port.
Comment: Thank you, and hence the answer to my question is, yes it can, correct?
Comment: But even if the switch just lives in L2 land, will it still be able to properly participate in STP?
Comment: STP is a layer-2 protocol. Layer-3 devices/ports don't participate in STP.
Comment: Yes, this was just in regards to the paragraph in your answer that starts with "If this is a layer-3 switch..." - even if this switch is not a L3 router/switch, it will be able to do STP (independent of the Mac it may or may not get assigned)
Comment: A layer-3 switch is still primarily a layer-2 switch. The layer-3 part is just a routing module, and that and any ports set to be layer-3 ports do not participate in STP. The layer-2 ports will participate.


Is it possible to create a text list of all my apps on the (Mac) App Store?

Question: Since I can't copy the list of my 'Purchased' Apps on Apple's App Store, I'm wondering if there's any other way to do this. I have little computer savvy, so if there's a solution it'd have to be step-by-step. Thanks.
Answer: In systems up to 10.11.6 you can save the "Purchased" page as html file to disk:

Quit App Store.app
Open Terminal.app in /Applications/Utilities
Enter defaults write com.apple.appstore ShowDebugMenu -bool true and hit the Return/⏎ key to show the debug menu in App Store.app.
Open App Store.app (check that the "Debug" menu is available!)

If you have some hidden purchases and want them to be listed also, unhide them in your account.
Open the "Purchased" page - log in with your Apple ID if required.
Hit cmdU
Quit App Store.app
Bring Terminal.app to the front and enter:
cp ~/Library/Containers/com.apple.appstore/Data/Library/Documentation/pageSource.html ~/Desktop/pageSource.html

and hit the Return/⏎ key. The pageSource.html file is now on your desktop and can be opened with a browser
(Enter defaults write com.apple.appstore ShowDebugMenu -bool false and hit the Return/⏎ key to remove the debug menu in App Store.app again.)
Enter exit and hit the Return/⏎ key.
Quit Terminal.app
Comment: Nice answer! :) Do you happen to know either way what the story is with this solution on macOS Sierra?
Comment: @Monomeeth You probably know that the debug menu doesn't exist anymore in Sierra's App Store.app. I tried to dive into the various cache/database files in ~/Library/Containers/com.apple.appstore/Data but haven't been able to find anything useful until now...
Comment: D'Oh, I'd forgotten about the removal of the Debug menu. As an aside, I've just tested PeterVP's answer on both El Capitan and Sierra and that works nicely too. It's quick and produces nothing but a text file.
Comment: Unfortunately I updated fm Yosemite to Sierra a month ago (only because the iPod to Photos transfer was giving me problems). I wish I hadn't, not only because I keep getting the 'spinning ball', but because this beautifully clear solution may have been what I was looking for, as the list is created from the App Store, rather than my computer. Thx!
Answer: Both Klanomath and PeterVP provide suitable answers. If all you want is a list of the apps, I'd refer you to those. However, if you'd like other details included (such as Version etc) or you just don't like using Terminal, you can achieve what you want with these steps:

Go to Apple > About This Mac
Click on the System Report... button on the window that appears
In the lefthand pane you'll see a list of headings and subheadings
Expand the Software heading
Select the Applications subheading
After a while you should see a list of all Apps appear on the righthand side
Now click on the Obtained From column heading (this will sort your apps)
Scroll down till you see all the apps labelled as obtained from Mac App Store
Click on the first app from the Mac App Store and then press and hold the shift key down while you also select the last app from the Mac App Store
As you do this, the bottom half of the righthand side window populates with details of each of your selected apps
Once you've selected the apps, click on the bottom half and use the commandA shortcut to select all
Now copy (or commandC) your selected items
Now you can paste these into TextEdit or your text editor of choice

I know this is a little messy, and it probably gives you a lot more detail than you wanted, so hopefully someone comes up with a better solution. But in the meantime it may get you where you wanted to be.
Comment: Another example of how to write an answer for a novice! Thank-you for this extremely NON-messy answer. I am saving it too, for occasions when I DO want more info, but as I commented to PeterVP, I was hoping for a list of all purchases from the App Store, as I haven't downloaded them all.
Answer: I use a shell script, in Terminal enter:
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##'

This will list all applications you bought on the Mac App Store.
If you redirect the result to a text file like so:
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##' > ~/Desktop/PurchasedApps.txt

you will create a plain text file on your desktop named PurchasedApps.txt.
This will list all applications downloaded from the App Store, bought and free. It will not show applications you once downloaded, but have since deleted from your Mac.
Comment: Nice answer! And it works on Sierra as well. :)
Comment: Thank-you for this answer, which I found easy to implement, but I'd prefer a solution that included ALL my Apps on the App Store (some of which I never have installed).
Answer: These are great answers but I'll mention the mas command line tool here too because it's a single command for what you want (once you install it) and quite often Apple's App Store app simply doesn't work, and mas always works.
Download the app here https://github.com/mas-cli/mas/releases (select mas-cli.zip).  Developers can use brew install mas which is easier ...
Open a Terminal in the same folder where you unzip it, then type "./mas list".
You probably have to do "./mas signin" first, I can't remember the workflow.
Comment: Hi and thanks for the response. I tried this to no avail. I imagine this is likely due to my inexperience, rather than your solution. I unzipped **mas-cli.zip** in my Utilities Folder in Applications + then removed **mas-cli.zip** from the folder, leaving **mas** behind (in the same folder as the **Terminal** Application). I then typed **./mas list** and got
**-bash: ./mas: No such file or directory**. When I typed **./mas signin** it said **-bash: ./mas: No such file or directory**
Comment: Yeah it sounds like your Terminal prompt is in a different folder from the `mas` binary.  Your can find which folder your Terminal is in by typing `pwd` (present working directory) then navigate to the correct directory using `cd` (change directory).
Comment: Ah! That was it. After typing pwd, I realized where **mas** needed to be, and installed it there. I then typed **./mas list** in the Terminal window and a list appeared. Unfortunately, it too, does not include uninstalled App Store apps, so I am still searching for a solution which works with Sierra.   p.s. as per your instructions in the comments above, after trying **pwd** I then typed **cd**, but as I didn't understand the result (which to my inexperienced eyes, appeared to be nothing) I carried on as I've described. Is it necessary for me to **"undo"** the cd 'command' (and if so, how? Tx)
Comment: This probably isn't the place for a command line tutorial but here's a link to get you started https://www.davidbaumgold.com/tutorials/command-line/
Comment: Tx That IS an excellent tutorial (although I also had to look up the definition of a Directory! :) anyway...I am no longer worried.
Answer: Create a new Smart Search. See this Macworld article for help
http://www.macworld.com/article/3165624/os-x/how-to-create-spotlight-searches-to-store-as-smart-folders-in-macos-sierra.html

kMDItemAppStoreHasReceipt != 1
Comment: not ignoring your possible solution - but it IS a long article :)
Comment: The article is there for anyone that wants more detail. The screenshot is all you really need. I added the text for the Raw Query to make it easy to paste into the search.


Do professional massages have any health benefits or do they merely feel good?

Question: Are there any studies that support some type of health benefit associated with receiving a massage of any type?
Comment: Massage relaxes mucles, this is surly unquestionable, and must be very helpful in many medical areas, for example removing nearly all pain for a significant amount of time to enable movement to aid recovery from pain and/or injury. But even the aspect of good feeling can be beneficial to health. A lack of good feeling for an extended length of time can lead to the worst possible self inflicted side effect of injury, and freeing up of a patients body to move and recover is very likely to prevent this. ...
Comment: ... Massage, either in its most raw form, or, for example, in a more involved manner by a physician such as an osteopath, can be essential. I feel that I should add these two comments despite my lack of sources, and welcome feedback to the sentement I pose, with an acceptance that I could be wrong.
Answer: As a pragmatic approach I would suggest the following. Back pain and neck pain are the most common reasons why people seek for massage therapy. Most common reason for back and neck pain are muscle spasms. They are painful which cause more spasm a so a vicious circle is ready. Reason why people suffer from muscle spasm is multifactorial. Static working postures, poor muscle strength or generally bad posture leads to unfavourable muscle strains and spasms.
Massage can be really effective for the treatment of these muscle spasms. Massage relieves tension, boosts the blood flow in muscle and helps to remove lactic acid stored in muscles. However, the spasms will definitely appear again if one does not to anything to treat the fundamental reasons why muscle spasm occurs. As so there is no long term effect with massage therapy.
There are two Cochrane reviews published in this topic (1), (2):

Massage might be beneficial for patients with subacute and chronic non-specific low-back pain, especially when combined with exercises and education (1)

There is no explicit evidence for the benefits, but what is important is that there is basically no adverse effects related to massage therapy. So in that sense massage can be helpful also for your mind and wellbeing. Exercise and education indicates the same thing I said in the beginning, in addition to relieving the spasms in your back you should also focus on the overall situation, "why do I have backpain".
With regard to neck pain the evidence is much more controversial. My personal opinion is that this might be related to etiology of the pain and spasm. Lower back in more common is obese people with poor physical condition (3) whereas neck pain is associated to overuse and bad postures (4).
Answer: There are a couple of studies that show massage will help with delayed onset muscle soreness (DOMS) after exercise, but that it doesn't really impact range of motion (ROM) or peak maximal force.
This study used a small cohort of 5 males, 5 females, doing arm exercises designed to produce DOMS. One arm got massaged, the other didn't. They self reported less DOMS in the massaged muscle, but it showed no impact on ROM or peak force.
This study followed a similar path, examining hamstring contractions with a slightly larger group of 18. Each leg was exercised, and only one was massaged with similar results to the first study I cited.
So yes, massage can reduce some of the after effects of intense exercise sessions, it hasn't been proven to actually improve performance.
Comment: How is reducing DOMS a health benefit above just feeling good? Is DOMS a health risk? This does not answer the question asked.
The studies cited are good beginning points, but their sample size is too small to prove your claim that "massage can reduce some of the after effects of intense exercise sessions" and leaves all the legwork of determining truth or fiction to the original asker's knowledge of sample size. Implying that this is a complete answer ignores the more pertinent health benefits of massage, and leaves the reader to assume that there are no other benefits.
Comment: @Dr.Duncan - Pain reduction is one of the most common and important functions health care providers provide. If you have other valid objections (it seems to me there's a bit of a peeve in your comment), please state them objectively.
Answer: Quality research on massage is exceptionally hard to find
Most studies you'll find have questionable methods or very small sample groups. You have to be very careful searching for studies, as the conclusions are often not justified by the methods and/or numbers
What are medical benefits of massage?

It feels good. This is a good thing in and of itself, especially for stressed people, as it lowers e.g. neurogenic muscle tone and cortisone levels.
It lowers local pain. This is often a treatment goal so there's that.
It helps building a therapeutic alliance between patient and therapist. And it gives time for e.g. assessing medical history etc. while doing so.

Insofar it does not hurt to do that as an entry-point for further therapeutic interventions as it allows the patient to arrive there, focus on what is about to come and lowers their immediate stress and pain levels.
What massage does not do
The physiological results are limited to what I wrote above and skin perfusion.
The effects last no longer than some hours max. So pain relief, for example, is comparable to a common pain killer pill in effect and duration.
For a good therapy and a lasting success, people need to be empowered for self-management and need education, no matter whether we speak about pain or functional muscle problems. Therefore, massage as the sole intervention has to be considered a bad therapy. Only exception here is lymphatic drainage massage for some acute or chronic problems, like lipo edema.
Sources
Boitor M, Gelinas C, Richard-Lalonde M, Thombs BD. The effect of massage on acute
postoperative pain in critically and acutely ill adults post-thoracic surgery: Systematic review and
meta-analysis of randomized controlled trials. Heart Lung 2017;46:339–346.
Boyd C, Crawford C, Paat CF, et al. The impact of massage therapy on function in pain populations
—A systematic review and meta-analysis of randomized controlled trials: Part III, surgical pain
populations. Pain Med 2016;17: 1757–1772.
Crawford C, Boyd C, Paat CF, et al. The impact of massage therapy on function in pain populations — A systematic review and meta-analysis of randomized controlled trials: Part I, patients
experiencing pain in the general population. Pain Med 2016;17:1353–1375.
Furlan AD, Giraldo M, Baskwill A, et al. Massage for lowback pain. Cochrane Database Syst Rev
2015;9:CD001929.
Guo J, Li L, Gong Y, et al. Massage alleviates delayed onset muscle soreness after strenuous
exercise: A systematic review and meta-analysis. Front Physiol 2017;8: 747.
Qaseem, Amir, et al. "Noninvasive treatments for acute, subacute, and chronic low back pain: a
clinical practice guideline from the American College of Physicians." Annals of internal medicine
166.7 (2017): 514-530.
Shin ES, Seo KH, Lee SH, et al. Massage with or without aromatherapy for symptom relief in
people with cancer. Cochrane Database Syst Rev 2016;6:CD009873.
Smith CA, Levett KM, Collins CT, et al. Massage, reflexology and other manual methods for pain
management in labour. Cochrane Database Syst Rev 2018;3: CD009290.
Wei X, Wang S, Li L, Zhu L. Clinical evidence of Chinese massage therapy (Tui Na) for cervical
radiculopathy: A systematic review and meta-analysis. Evid Based Complement Alternat Med
2017;2017:9519285.
Foster NE, Anema JR, Cherkin D, Chou R, Cohen SP, Gross DP, Ferreira PH, Fritz JM, Koes BW,
Peul W, Turner JA, Maher CG; Lancet Low Back Pain Series Working Group. Prevention and
treatment of low back pain: evidence, challenges, and promising directions. Lancet. 2018 Jun
9;391(10137):2368-2383. doi: 10.1016/S0140-6736(18)30489-6. Epub 2018 Mar 21. PMID:
29573872.
Hutting N, Johnston V, Staal JB, Heerkens YF. Promoting the Use of Self-management Strategies
for People With Persistent Musculoskeletal Disorders: The Role of Physical Therapists. J Orthop
Sports Phys Ther. 2019 Apr;49(4):212-215. doi: 10.2519/jospt.2019.0605. PMID: 30931733.
Kongsted, A., Ris, I., Kjaer, P., & Hartvigsen, J. (2021). Self-management at the core of back pain
care: 10 key points for clinicians. Brazilian Journal of Physical Therapy.
Lewis J, O'Sullivan P. Is it time to reframe how we care for people with non-traumatic
musculoskeletal pain? Br J Sports Med. 2018 Dec;52(24):1543-1544. doi: 10.1136/bjsports-2018-
099198. Epub 2018 Jun 25. PMID: 29941618.
Lewis JS, Stokes EK, Gojanovic B, Gellatly P, Mbada C, Sharma S, Diener I, O'Sullivan P.
Reframing how we care for people with persistent non-traumatic musculoskeletal pain. Suggestions
for the rehabilitation community. Physiotherapy. 2021 Apr 20;112:143-149. doi:
10.1016/j.physio.2021.04.002. Epub ahead of print. PMID: 34102533.
Jackson T, Wang Y, Wang Y, Fan H. Self-efficacy and chronic pain outcomes: a meta-analytic
review. J Pain. 2014 Aug;15(8):800-14. doi: 10.1016/j.jpain.2014.05.002. Epub 2014 May 28.
PMID: 24878675.
Martinez-Calderon J, Flores-Cortes M, Morales-Asencio JM, Fernandez-Sanchez M, Luque-Suarez
A. Which Interventions Enhance Pain Self-efficacy in People With Chronic Musculoskeletal Pain?
A Systematic Review With Meta-analysis of Randomized Controlled Trials, Including Over 12 000
Participants. J Orthop Sports Phys Ther. 2020 Aug;50(8):418-430. doi: 10.2519/jospt.2020.9319.
PMID: 32736497.
Vibe Fersum K, O'Sullivan P, Skouen JS, Smith A, Kvåle A. Efficacy of classification-based cognitive functional therapy in patients with non-specific chronic low back pain: a randomized controlled trial. Eur J Pain. 2013 Jul;17(6):916-28. doi: 10.1002/j.1532-2149.2012.00252.x. Epub 2012 Dec 4. PMID: 23208945; PMCID: PMC3796866.
Lin I, Wiles L, Waller R, Goucke R, Nagree Y, Gibberd M, Straker L, Maher CG, O'Sullivan PPB.
What does best practice care for musculoskeletal pain look like? Eleven consistent
recommendations from high-quality clinical practice guidelines: systematic review. Br J Sports
Med. 2020 Jan;54(2):79-86. doi: 10.1136/bjsports-2018-099878. Epub 2019 Mar 2. PMID:
30826805.
Fredin K, Lorås H. Manual therapy, exercise therapy or combined treatment in the management of
adult neck pain - A systematic review and meta-analysis. Musculoskelet Sci Pract. 2017 Oct;31:62-
71. doi: 10.1016/j.msksp.2017.07.005. Epub 2017 Jul 21. PMID: 28750310.
French HP, Cusack T, Brennan A, Caffrey A, Conroy R, Cuddy V, FitzGerald OM, Fitzpatrick M,
Gilsenan C, Kane D, O'Connell PG, White B, McCarthy GM. Exercise and manual physiotherapy
arthritis research trial (EMPART) for osteoarthritis of the hip: a multicenter randomized controlled trial. Arch Phys Med Rehabil. 2013 Feb;94(2):302-14. doi: 10.1016/j.apmr.2012.09.030. Epub 2012
Oct 16. Erratum in: Arch Phys Med Rehabil. 2013 Mar;94(3):600. Fitzpatrick, Martina [added]. PMID: 23084955.
Abbott JH, Wilson R, Pinto D, Chapple CM, Wright AA; MOA Trial team. Incremental clinical effectiveness and cost effectiveness of providing supervised physiotherapy in addition to usual medical care in patients with osteoarthritis of the hip or knee: 2-year results of the MOA randomised controlled trial. Osteoarthritis Cartilage. 2019 Mar;27(3):424-434. doi: 10.1016/j.joca.2018.12.004. Epub 2018 Dec 14. PMID: 30553932.
Mintken PE, Rodeghero J, Cleland JA. Manual therapists - Have you lost that loving feeling?! J Man Manip Ther. 2018 May;26(2):53-54. doi: 10.1080/10669817.2018.1447185. Epub 2018 Mar 26. PMID: 29686478; PMCID: PMC5901426.
Longtin C, Décary S, Cook CE, Tousignant-Laflamme Y. What does it take to facilitate the integration of clinical practice guidelines for the management of low back pain into practice? Part 1: A synthesis of recommendation. Pain Pract. 2021 May 17. doi: 10.1111/papr.13033. Epub ahead of print. PMID: 33998769.


Attack Titan holders

Question: If Eren was the one who instigated Grisha to retake the Founding Titan then why was he shocked to learn that his father slaughtered the Reiss family in season 3 ?
Moreover  Eren didn't have the abilities of Attack Titan  when Grisha did this . So does the Attack Titan have the ability to peek into future and past memories of other Attack Titan holders even when it isn't possessed by its destined holder ( here Eren ) ?
Answer: I am not completely sure, as I have not read the manga but from watching the anime, people who have the titan power inherit the memories of their predecessors. I think they only have the memories of their immediate predecessor, as they never showed Eren to look back past Grisha's memories. When Grisha had slaughtered the Reiss family, Eren was not born. However, he inherited all of Grisha's memories because Eren got the Attack Titan from Grisha. When Eren was having flashbacks of Grisha's memories, he had no clue about why Grisha was doing this. He had not been to the basement under their house with all the information yet. So to him, he saw his father murdering a whole family with unclear intent.
Answer: The Attack titan makes it so that the owner can see thru the future owner's eyes, not teleport there.
I think that in s3, when Eren saw Grisha's memories he only saw the part when he killed the Reiss family, not the part where he moarned their death and regretted everything. Plus, I'm pretty sure Eren's flashbacks are limited, so he cannot see everything because he does not have royal blood

Attack Titan holders


load cell continuously monitor load

Question: I want use 50 kg of load cell of weighing machine to measure 30 kg of load for an one or two months,and load continuously decreases because of consumption on daily basis. my question is that the weighing machine is continuously display accurate load or not? Is there chance of creep or fatigue ? no temperature phenomena acting on load cell, load show accurate result at every consumption?
Comment: Maybe local gravity fluctuations?
Comment: If anything, the spec may hold the answer.
Comment: Biggest question, what level of accuracy do you require? There may be fluctuations, but whether those are large enough to exceed your accuracy requirements, only you can say.
Answer: Load cell creep is a problem, and generally is most pronounced early in the life of the cell as the adhesive or weld binding the element to the material under strain relaxes or moves.  This will vary depending on the bonding technique and the temperature cycling that the load cell experiences.  It is most prominent in the offset; the gain generally remains stable.  We have good luck "ageing in" load cell transducers at temperature to allow the bond to approach some type of equilibrium.  You generally will see the offset changes decrease over time.  You probably will want a tare feature to adjust for small changes that will occur over system life.
Comment: here temperature phenomena is negligible, no temperate acting on load cell.

load cell continuously monitor load


Multi-touch gestures in webapp on desktop

Question: I'm developing online map(like google maps) of cool fantasy world.  I'm also use OS X on my main computer. Since OS X(especially Lion) are focused on different multi-touch gestures because almost of all mac users have a multi-touch input device(magic mouse or trackpad) I want to add support of pinch gesture to my online map(two-finger scroll would be cool to add too). Is it possible to do it? It's not bad if it will work only in some specific browser or web engine.
Comment: http://scripty2.com/demos/touch/ - it's open source, works on handheld devices (tested on my Android), but doesn't seem to work on desktops (they talk about some fallback techniques, but I have no way to check it).
Comment: Unfortunately (if I'm right) it uses touch API which available only on mobile device with touchscreen.
Answer: According to this question, it looks like firefox offers some support for multitouch gestures (see here), but other major browsers do not.
Answer: recently I've been developing webapplication for iPad using my PC and Chrome, it used a pinch feature. I found a way how to emulate touch and multi-touch feature on a desktop browser, posted my results on github here https://github.com/dgolovanev/mxTouch still does not supports predefined gestures but can handle touch and multi-touch events, hope it will be helpful


How come rollover the futures maintain the risk position?

Question: I am still wondering about the risk difference between offsetting a position and rollover. As I know, both offsetting and rollover are involved in selling the initial futures contract ( which gives you the profit or loss) so how come rollover maintain the risk position?
I am new in market trading. Examples would be appreciated. Thank you so much!
Answer: Lets imagine a flat term structure (i.e. forward curve), all the contracts have the same price, and they all move in tandem. You bought the June contract for $10 a few weeks ago, and now you're faced with either one of these two scenarios.

You want to lock in your gains so far without getting out of the contract, so you offset your position by selling the July contract. This makes you risk neutral since our curve is flat and everything moves together. The next day, the curve moves down by $1, so you lost $1 on your June position and make $1 on your July position. Your pnl for the day is zero.
June contract is about to expire, but your trade thesis has not yet played out and you want to remain in the game so you rollover your position. You sell June, and buy July

Note: In the offset scenario above, our simplistic example eliminates your risk because we assume the curve is flat and moving together. In reality, an offset is simply an imperfect hedge...very close to being perfect, but not so since you still have spread risk i.e. the difference in moves between both positions. In our example, if we assume the curve moves in a correlated fashion, but not exactly the same, June could have fallen by $1 while July would fall by $0.90 giving us a pnl of -$0.10 for the day (our spread risk quantified for one day).


PHP "php://input" vs $_POST

Question: I have been directed to use the method php://input instead of $_POST when interacting with Ajax requests from JQuery. What I do not understand is the benefits of using this vs the global method of $_POST or $_GET.
Comment: I used to use "hacks" for receiving ajax calls on PHP side before stumbling upon this post and reading its awesome answers! For other people having the same issue in the future, I hope search engines will read my comment too! :)
Comment: You would only need to use php://input if your jQuery AJAX request sent JSON, instead of URL encoded key/value pairs. By default, jQuery does the latter. If the former is the issue (your data is in JSON), then yes, you must use `php://input`.
Answer: The reason is that php://input returns all the raw data after the HTTP-headers of the request, regardless of the content type.
The PHP superglobal $_POST, only is supposed to wrap data that is either

application/x-www-form-urlencoded (standard content type for simple form-posts) or
multipart/form-data (mostly used for file uploads)

This is because these are the only content types that must be supported by user agents. So the server and PHP traditionally don't expect to receive any other content type (which doesn't mean they couldn't).
So, if you simply POST a good old HTML form, the request looks something like this:
POST /page.php HTTP/1.1

key1=value1&key2=value2&key3=value3

But if you are working with Ajax a lot, this probaby also includes exchanging more complex data with types (string, int, bool) and structures (arrays, objects), so in most cases JSON is the best choice. But a request with a JSON-payload would look something like this:
POST /page.php HTTP/1.1

{"key1":"value1","key2":"value2","key3":"value3"}

The content would now be application/json (or at least none of the above mentioned), so PHP's $_POST-wrapper doesn't know how to handle that (yet).
The data is still there, you just can't access it through the wrapper. So you need to fetch it yourself in raw format with file_get_contents('php://input') (as long as it's not multipart/form-data-encoded).
This is also how you would access XML-data or any other non-standard content type.
Comment: +1 for "This is also how you would access XML-data or any other non-standard content type"
Comment: It is worth noting that use of the XMLHttpRequest object in an AJAX request to PHP does not mean one must post JSON. It is extra overhead, but your client-side JavaScript can convert to application/x-www-form-urlencoded format. However, the translation may not be datatype *pure*.
Comment: @Quasdank I am sending JSON from Android app to php xampp server in the cloud(http://stackoverflow.com/questions/36558261/json-sent-from-android-to-compute-engine-server-returns-null) but I couldn't get it to work when I tried file_get_contents('php://input'), which simply returns string(0). This used to work in my local machine but it doesn't work when I deployed it to the cloud. Could you help me please?
Comment: It is necessary to say that the limit of two recognized content-types is largely historical. Nothing stops PHP from recognizing i.e. `application/json` as valid data source for `$_POST` array. And there's even published requests for specifically that support.
Comment: Hi @quasdunk can you please help me on this https://magento.stackexchange.com/questions/296960/how-to-fetch-post-method-xml-data-in-magento2-controller
Answer: First, a basic truth about PHP.
PHP was not designed to explicitly give you a pure REST (GET, POST, PUT, PATCH, DELETE) like interface for handling HTTP requests.
However, the $_SERVER, $_COOKIE, $_POST, $_GET, and $_FILES superglobals, and the function filter_input_array() are very useful for the average person's / layman's needs.
The number one hidden advantage of $_POST (and $_GET) is that your input data is url-decoded automatically by PHP. You never even think about having to do it, especially for query string parameters within a standard GET request, or HTTP body data submitted with a POST request.
Other HTTP Request Methods
Those studying the underlying HTTP protocol and its various request methods come to understand that there are many HTTP request methods, including the often referenced PUT, PATCH (not used in Google's Apigee), and DELETE.
In PHP, there are no superglobals or input filter functions for getting HTTP request body data when POST is not used. What are disciples of Roy Fielding to do? ;-)
However, then you learn more ...
That being said, as you advance in your PHP programming knowledge and want to use JavaScript's XmlHttpRequest object (jQuery for some), you come to see the limitation of this scheme.
$_POST limits you to the use of two media types in the HTTP Content-Type header:

application/x-www-form-urlencoded, and
multipart/form-data

Thus, if you want to send data values to PHP on the server, and have it show up in the $_POST superglobal, then you must urlencode it on the client-side and send said data as key/value pairs--an inconvenient step for novices (especially when trying to figure out if different parts of the URL require different forms of urlencoding: normal, raw, etc..).
For all you jQuery users, the $.ajax() method is converting your JSON to URL encoded key/value pairs before transmitting them to the server. You can override this behavior by setting processData: false. Just read the $.ajax() documentation, and don't forget to send the correct media type in the Content-Type header.
php://input, but ...
Even if you use php://input instead of $_POST for your HTTP POST request body data, it will not work with an HTTP Content-Type of multipart/form-data This is the content type that you use on an HTML form when you want to allow file uploads!
<form enctype="multipart/form-data" accept-charset="utf-8" action="post">
    <input type="file" name="resume">
</form>

Therefore, in traditional PHP, to deal with a diversity of content types from an HTTP POST request, you will learn to use $_POST or filter_input_array(POST), $_FILES, and php://input. There is no way to just use one, universal input source for HTTP POST requests in PHP.
You cannot get files through $_POST, filter_input_array(POST), or php://input, and you cannot get JSON/XML/YAML in either filter_input_array(POST) or $_POST.
PHP Manual: php://input

php://input is a read-only stream that allows you to read raw data
from the request body...php://input is not available with
enctype="multipart/form-data".

PHP Frameworks to the rescue?
PHP frameworks like Codeigniter 4 and Laravel use a facade to provide a cleaner interface (IncomingRequest or Request objects) to the above. This is why professional PHP developers use frameworks instead of raw PHP.
Of course, if you like to program, you can devise your own facade object to provide what frameworks do. It is because I have taken time to investigate this issue that I am able to write this answer.
URL encoding? What the heck!!!???
Typically, if you are doing a normal, synchronous (when the entire page redraws) HTTP requests with an HTML form, the user-agent (web browser) will urlencode your form data for you. If you want to do an asynchronous HTTP requests using the XmlHttpRequest object, then you must fashion a urlencoded string and send it, if you want that data to show up in the $_POST superglobal.
How in touch are you with JavaScript? :-)
Converting from a JavaScript array or object to a urlencoded string bothers many developers (even with new APIs like Form Data). They would much rather just be able to send JSON, and it would be more efficient for the client code to do so.
Remember (wink, wink), the average web developer does not learn to use the XmlHttpRequest object directly, global functions, string functions, array functions, and regular expressions like you and I ;-). Urlencoding for them is a nightmare. ;-)
PHP, what gives?
PHP's lack of intuitive XML and JSON handling turns many people off. You would think it would be part of PHP by now (sigh).
So many media types (MIME types in the past)
XML, JSON, and YAML all have media types that can be put into an HTTP Content-Type header.

application/xml
applicaiton/json
application/yaml (although IANA has no official designation listed)

Look how many media-types (formerly, MIME types) are defined by IANA.
Look how many HTTP headers there are.
php://input or bust
Using the php://input stream allows you to circumvent the baby-sitting / hand holding level of abstraction that PHP has forced on the world. :-) With great power comes great responsibility!
Now, before you deal with data values streamed through php://input, you should / must do a few things.

Determine if the correct HTTP method has been indicated (GET, POST,
PUT, PATCH, DELETE, ...)
Determine if the HTTP Content-Type header has been transmitted.
Determine if the value for the Content-Type is the desired media
type.
Determine if the data sent is well formed XML / JSON / YAML /
etc.
If necessary, convert the data to a PHP datatype: array or
object.
If any of these basic checks or conversions fails, throw an exception!

What about the character encoding?
AH, HA! Yes, you might want the data stream being sent into your application to be UTF-8 encoded, but how can you know if it is or not?
Two critical problems.

You do not know how much data is coming through php://input.
You do not know for certain the current encoding of the data stream.

Are you going to attempt to handle stream data without knowing how much is there first? That is a terrible idea. You cannot rely exclusively on the HTTP Content-Length header for guidance on the size of streamed input because it can be spoofed.
You are going to need a:

Stream size detection algorithm.
Application defined stream size limits (Apache / Nginx / PHP limits may be too broad).

Are you going to attempt to convert stream data to UTF-8 without knowing the current encoding of the stream? How? The iconv stream filter (iconv stream filter example) seems to want a starting and ending encoding, like this.
'convert.iconv.ISO-8859-1/UTF-8'

Thus, if you are conscientious, you will need:

Stream encoding detection algorithm.
Dynamic / runtime stream filter definition algorithm (because you cannot know the starting encoding a priori).

(Update: 'convert.iconv.UTF-8/UTF-8' will force everything to UTF-8, but you still have to account for characters that the iconv library might not know how to translate. In other words, you have to some how define what action to take when a character cannot be translated: 1) Insert a dummy character, 2) Fail / throw and exception).
You cannot rely exclusively on the HTTP Content-Encoding header, as this might indicate something like compression as in the following. This is not what you want to make a decision off of in regards to iconv.
Content-Encoding: gzip

Therefore, the general steps might be ...
Part I: HTTP Request Related

Determine if the correct HTTP method has been indicated (GET, POST,
PUT, PATCH, DELETE, ...)
Determine if the HTTP Content-Type header has been transmitted.
Determine if the value for the Content-Type is the desired media
type.

Part II: Stream Data Related

Determine the size of the input stream (optional, but recommended).
Determine the encoding of the input stream.
If necessary, convert the input stream to the desired character
encoding (UTF-8).
If necessary, reverse any application level compression or encryption, and then repeat steps 4, 5, and 6.

Part III: Data Type Related

Determine if the data sent is well formed XML / JSON / YMAL /
etc.

(Remember, the data can still be a URL encoded string which you must then parse and URL decode).

If necessary, convert the data to a PHP datatype: array or
object.

Part IV: Data Value Related

Filter input data.

Validate input data.

Now do you see?
The $_POST superglobal, along with php.ini settings for limits on input, are simpler for the layman. However, dealing with character encoding is much more intuitive and efficient when using streams because there is no need to loop through superglobals (or arrays, generally) to check input values for the proper encoding.
Comment: Oh wow! This answer should have much higher rating. Thank you so much for bringing flood light into the dark.
Comment: In the final analysis, PHP would do well to update the base defaults. However, it is a logically fallacy to couple an HTTP request method with a data structure of the same name ($_GET, $_POST). What matters is (1) the desired HTTP request method, and (2) is there request data with that request (Content-Type). Hence, as with Perl, you begin to see that you can be the willing victim of the opinions of language creators / maintainers. –
Answer: php://input can give you the raw bytes of the data. This is useful if the POSTed data is a JSON encoded structure, which is often the case for an AJAX POST request.
Here's a function to do just that:
  /**
   * Returns the JSON encoded POST data, if any, as an object.
   *
   * @return Object|null
   */
  private function retrieveJsonPostData()
  {
    // get the raw POST data
    $rawData = file_get_contents("php://input");

    // this returns null if not valid json
    return json_decode($rawData);
  }

The $_POST array is more useful when you're handling key-value data from a form, submitted  by a traditional POST. This only works if the POSTed data is in a recognised format, usually application/x-www-form-urlencoded (see http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4 for details).
Comment: It's worth noting that if you pass `true` as the second parameter to `json_decode`, it will return an associative array.
Comment: Be wary of pulling data directly from `php://input`. Learn about stream filters and make sure you are getting UTF-8 encoded data.
Comment: Don't do this without using an input filter to ensure you are dealing with UTF-8. `'convert.iconv.UTF-8/UTF-8'`
Comment: Can you show an example of the code above using the UTF-8 filter applied?
Answer: If post data is malformed, $_POST will not contain anything. Yet, php://input will have the malformed string.
For example there is some ajax applications, that do not form correct post key-value sequence for uploading a file, and just dump all the file as post data, without variable names or anything.
$_POST will be empty, $_FILES empty also, and php://input will contain exact file, written as a string.
Comment: $_REQUEST will also be empty.
Answer: if (strtoupper($_SERVER['REQUEST_METHOD']) != 'POST') {
  throw new Exception('Only POST requests are allowed');
}

// Make sure Content-Type is application/json
$content_type = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : '';
if (stripos($content_type, 'application/json') === false) {
  throw new Exception('Content-Type must be application/json');
}

// Read the input stream
$body = file_get_contents("php://input");

// Decode the JSON object
$object = json_decode($body, true);

Answer: Simple example of how to use it
 <?php
     if(!isset($_POST) || empty($_POST)) {
     ?>
        <form name="form1" method="post" action="">
          <input type="text" name="textfield">

          <input type="submit" name="Submit" value="submit">
        </form>
   <?php
        } else {
        $example = file_get_contents("php://input");
        echo $example;  }
   ?>

PHP "php://input" vs $_POST


Anti-kernelmode functions (specifically zwquerysysteminformation)

Question: I'm working on a program that has lots of checks, and I've decided to start by disabling their anti-kernel mode, as it'd surely be more easy to isolate than normal anti-debugging. After poking around a little, I found that ntdll.zwquerysysteminformation runs in a loop in the main thread called by several .vmp addresses. Since I can't make memory changes, even in DLLs (or debug it normally), I was thinking about setting up kernel mode breakpoints until I have a bit more to go off of, but to do that, I'd need the offset from the base structure containing the byte. Microsoft doesn't seem to provide this, so would anyone happen to know? Or maybe have general pointers on getting past kernel mode detection in obfuscated targets? I know this is pretty broad, but I'm pretty sure they'd only have used the most basic of methods.
Comment: What is being detected by the check you're trying to disable? Sorry, your question seems a bit unclear about this. Also, when you say "the base structure" and "the byte", what base structure and what byte are you referring to?
Comment: The check I'm trying to disable detects the presence of kernel mode debuggers. I hope to patch it by patching ZWQuerySystemInformation and I'm not sure how
Answer: I think the check you're talking about (NtQuerySystemInformation with SystemKernelDebuggerInformation) simply checks KdDebuggerEnabled and KdDebuggerNotPresent under the hood (both are single bytes exported from ntoskrnl.exe). You could simply patch those two to get past that particular check. Alternatively, you could go for hooking NtQuerySystemInformation either in usermode (you've mentioned that you can't make memory changes, but that's usually not true - if a memory change at some location is detected, then make the change somewhere else) or in kernelmode (requiring a PatchGuard bypass on 64-bit systems).
However, your kernel debugger might still be detected by its window/driver name.
Comment: Sorry for not knowing much about this, but what offsets are those bytes from the structure returned? Their integrity checker uses dynamic regions including a few DLLs, so making edits REALLY isn't favorable and certainly isn't future proof based on the growth of security in the last few months. I've changed the driver name after enabling unsigned drivers and patched all threads that use GetWindowText(A), so I think it should be realistically impossible to see its presence with the patching of the bytes.
Comment: If you try calling NtQuerySystemInformation with SystemKernelDebuggerInformation and a 0-byte buffer, the function will tell you that it needs exactly 2 bytes for its output (ie. the returned structure has a size of 2), so we can infer that those two bytes are KdDebuggerEnabled and KdDebuggerNotPresent. An answer at http://stackoverflow.com/questions/14791901 confirms that  this is the correct order. Also, you may want to take care of FindWindow and EnumWindows as well.


What should be the testing type for a new version of an automated test case if edited manually

Question: I have created a test case that was created via automation. The testing type for this Test case is Automated. Now I make some changes to the steps of this Test case by adding some more or removing some. This will create a new version of the Test case. The question is what should  be the testing Type of this new version as the original was created via automation and the new version was edited manually to create a version.
Comment: Why does it matter? What does the testing type mean to you or your organization?
Comment: As Mate said, it's highly contextual. A written test case is only a communication tool - and how to communicate with other people will depend on your and other people preferred ways of talking to each other.
Answer: It depends.
Some of the factors I would consider are:

If the new version of the test case will primarily be executed by automation, the type should probably be Automated.
If the new version of the test case will primarily be executed manually, the type should probably be Manual.
If the new version of the test case is going to be executed both manually and by automation, and your tool has an option of "Manual and Automated" for test type, that should probably be the choice.
If your organization has a policy that requires any test case executed by automation to be labeled as an Automated test case, then test type should be Automated.

Factors I don't consider relevant:

Whether the test case was generated automatically or manually. How a test case is created matters less than how it is executed, which in turn matters less than the results it reports.
Whether the test case was edited. What matters about the edit is that it is either tied to a version of your product - which happens if you are working with desktop software and need to maintain different versions for your customers because you may need to run the old version if a customer is receiving an update to an older version (such as a patch fix for a serious bug) - or is tied to a feature update or other change. If the edit was simply improving the flow or the stability of the test then it doesn't matter that it was edited.

In short, if the information saved with the test case accurately describes its purpose and execution, then it does what it needs to.
Answer: This is almost certainly going to depend on your team's or organization's process.
Some teams and organizations that I have worked with require that new or modified test cases be executed manually before the automation results can be accepted. That is, the series of test steps are documented as a test case, the test case is executed manually, and if it passes, the test is scheduled for automation. Once it is automated, the results are acceptable.
Sometimes, teams and organizations require a review of the changes. Once the test case and associated automation code or scripts are updated, the automation is run in a way that can be observed by a human. This can be capturing screenshots or watching in real-time as the test scripts interact with the application. A code review of the automation code and the observation of the way the code interacts with the application is sufficient to call the test case automated.
Other times, teams may opt to deprecate test cases and create new ones, especially if the changes are significant. This may help with tracing test executions to test cases via a unique identifier. It would be up to the team or organization to define what it means to make significant changes to a test case.
Without knowing the valid "testing types" for a test case, what those testing types mean, and the context in which the organization works, it's difficult to say what you should do.


Why is my 2005 chevy impala engine knocking?

Question: My 2005 chevy impala has been sitting since March. When i went to start it, it cranked up just fine. But when i rev on the gas i hear a ticking sound. It does it in park and drive. Thought it was oil, so put 4 quarts in. Still hear the ticking. It sounds perfectly normal until i hit the gas. Any ideas?
Comment: Does this sound appears all during cruise? Or does it end when engine warmed up?
Comment: are you saying it was so low on oil you needed to put 4 quarts in??? That kind of answers the question doesn't it? It only holds maybe 4 and a half..
Comment: Is it ticking or knocking, big difference.
Answer: Could be that the lifters just bled down since it sat for so long.Make sure you have the proper amount of oil.  Start the engine, let idle until normal operating temperature is reached.  Raise the idle to about 1500rpm and hold for about 3mins. Let idle again and repeat if needed. You also may need to take it for a gentle drive once or twice.
Answer: Could be piston slap. Some Chevy engines are notorious for the piston slap, which can appear even without any form of misuse such as running low on oil.
If this is piston slap, you have several options:

Replace the bottom end of the engine. Usually not worth it unless you truly hate the sound.
Demand the dealership to replace the engine bottom end that started piston slapping early. Trouble is, you cannot expect to succeed in this for over 10-year old car.
Just continue driving the ticking car.
Get rid of the car by selling it. Unfortunately, nobody wants a piston slapper so the amount of money you will be offered will be very, very low indeed considering the car is over 10 years old.
Get rid of the car by scrapping it.
(If you have enough land area) Buy a new(er) car and then you have two cars.

I would however say that if you added 4 quarts of oil, the engine is either over-filled now or alternatively was under-filled before you added the oil. Both of the options are bad. If it was under-filled, that can definitely cause piston slap.