Chopin op. 28 no. 4 - bar 16 symbols

Question: There are two symbols I do not recognise below the stretto in this excerpt:

What are these symbols?
And also, form what I read the stretto here should be interpreted as an accelerando, am I correct?
Answer: This is an Turn, an ornament consisting of four notes. The double-sharp symbol indicates that the lower note to be performed is a g double-sharp rather than a natural g, so the sequnce to be performed is b, a sharp, g double-sharp, a sharp.
Answer: I wouldn't interpret stretto as accelerando. My guess is that Chopin put it there to prevent the other natural interpretation of the passage, which is to slow down, from happening. So, instead of doing an accelerando, the passage under the dashes should just be generally faster/flowing, probably slowing down during the last hairpin (>). You'll need to experiment to find a natural way to do it.
Comment: Do you have sources?
Comment: @Luke: No, as I said, it's a guess. I do have a master's degree in classical piano performance so you could say it's an educated guess. I don't believe you could ever actually know what Chopin *really* intended, even if he himself wrote a detailed description, because it's practically impossible to describe every relevant detail accurately. That's the reason for my last sentence. However, an accelerando doesn't seem to make much sense here, and neither does a noticeably faster tempo so I must conclude that it must be just slightly faster or *at least not slower*.

Chopin op. 28 no. 4 - bar 16 symbols


ReactTransitionGroup code explanation

Question: I'm new to react and I am trying to get my head around the code in ReactTransitionGroup and I am confused as to Why performEnter is called in componentDidUpdate and not componentDidMount.  My understanding of componentDidUpdate is that it is called after render and when the state has altered.
So I'm confused as to why it is called here.
Answer: performEnter animates the child, and children are animated in and out when they appear in or disappear from the parent component on subsequent renders—they're not animated if they're already contained in the parent upon the first render.

ReactTransitionGroup code explanation


Best note format for Yousician Piano for starters

Question: I have recently started learning piano using Yousician. On its documentation, it mentioned Yousician's new note format (color bars) helps to learn faster. But honestly, I'm wondering if I actually learn piano using that. Because it's almost like a game.
Also, it would be great if tell me about common problems and mislearning that can happen to learner if he learns using Yousician.
Comment: A lot of learning processes work well when 'played as games'.
Comment: In my experience, yousician and other like apps only help with things such as simple sight reading and coordination. Just like how I can get better at typing using typing games.
Answer: According to an article in the APA's Monitor on Psychology, Psychologists don't think there's enough research yet on whether games help us learn or not:

But despite the growing popularity of such games, research has yet to determine whether they really help children learn, says University of California, Santa Barbara, educational psychologist Richard Mayer, PhD.
"When you look at the research reviews and meta-analyses that have been done, the evidence is not all that convincing yet that digital games are going to revolutionize education," says Mayer, author of the 2014 book "Computer Games for Learning: An Evidence-Based Approach."

Asking about common problems when learning using Yousician is really a separate question, but I think you should be aware that a major aspect of teaching a musical instrument in person is addressing the exact ergonomics, posture, positioning, etc. of the body parts involved in making music, and no game, tool, system, video, etc. can do that.
Comment: @Some_Guy If you're implying that ergonomics and technique are less demanding on the piano, you are dangerously misinformed. And I mean *dangerously*. Repettative motion injuries are highly likely on keyboard instruments just as they are on computer keyboards. I honestly can't think of an instrument where physical technique is not fairly demanding to get the best tone and avoid injury, and I've learned many instruments and dabbled in many more.
Comment: Instruction about ergonomics, playing technique etc. is more or less of an issue depending on the instrument. I'd probably put piano on one end of that scale, and violin on the other.  Piano is a good candidate for "gamification" as opposed to, say, the armenian duduk.
Comment: I had a feeling I'd be controversial here, perhaps I should have taken more care, but comments in their nature are brief. What I meant is that different instruments have a different *initial* learning curves (irrelevant to mastery of course) from physical considerations. This roughly corresponds to the control a player has over the sound of the instrument itself (although there are **of course** other factors). This makes the piano a more accessible instrument for novice than say an oboe, but does not mean to diminish the importance of ergonomics or technique in a pianist's development.
Comment: @Some_Guy Ok I see what you mean. That makes sense.
Comment: Not wanting to go on and on and detract from your answer, but finding it hard to compress my thoughts to little comments, I've gone into more detail in chat.
 Essentially my point is that, if any instrument can be effectively taught by a game, then piano must surely be it.
 https://chat.stackexchange.com/rooms/69398/conversation-between-todd-wilcox-and-some-guy
Answer: I would say the Colored Sheet notation works better because you see/learn the actual notes and also helps you with the fingering. After you learn a song you can switch to the plain black sheet notation as you use it only for remembering the notes.
That works bet for me anyway.
Answer: Neuroscience has it that you can't learn through computers and video games. Learning is simply a person-to-person thing.
I'm currently in the same situation as you are: I'm trying to learn piano without a teacher but I know how a chord is built so I can easily find a chord on the keyboard. I played the drums for years when I was a teenager and those rhythm sticks have ingrained a good sense of time into my brain somehow. I can comp over a tune but I know that I'll have a hard time improving after that, even though I can read music and the reason is you always need someone who has the musical acumen to guide you... You need to understand what you are doing when you play. It's human.
I can't tell you if Yousician could cause you to stall but I really think you should go and look for a human teacher with all their drawbacks and qualities.
Comment: Citations needed.
Comment: Your quote only indicates that learning is **more effective** when there is personal interaction, which I don't think is disputed at all, and certainly I agree with that very strongly. In your answer you wrote "...you **can't learn** through computers and video games", which is not at all what Dr. Cohen said. I myself have learned many things without any interaction with a teacher, via non-responsive media such as books, videos, and video games. In fact I learned heel-toe kick technique from a great youtube video just three weeks ago.
Comment: Ok. I agree. "Can't" was a bit too peremptory or preconceived. My mistake.
Comment: Laurent Cohen, Pr. of Neurology at La Pitié-Salpétrière. Interview in a French weekly, L'Express, on 9/6/17. I'll translate his words as best I can: "When learning, there is nothing like social and pedagogical interaction. For example, the American scientist Patricia Kuhl has tried to train American 9-month-olds to recognize sounds in Chinese. First she had a Chinese lady play with them in Chinese. After a few tries, the babies managed to improve and discriminate sounds in Chinese. But babies who were placed in front of a screen to watch passively the same lady did not learn anything."


Interesting fact related to matrices

Question: I am beginner and I want to know some facts about limit as we know them for checking the convergence of a series by ratio test.
If the ratio is greater than $1$ then it is convergent but my point is to know if instead of finding ratio we could find the difference of the $n+1$ and $n^th$ terms then, is there any relation of convergence for that?
Please help.
Comment: You really should use points and commas. It is very hard to undestand your question.
Comment: @klirk sorry I remember next time
Answer: No. For $\sum_{n=1}^{\infty} a_n$ to converge, we must have $a_n \to 0$ so if the series converges we will also have $a_{n+1} - a_n \to 0$. However, if $a_{n+1} - a_n \to 0$ we can't even conclude that $a_n \to 0$ and even if we could, it wouldn't tell us anything about the convergence of the series.

Interesting fact related to matrices


curl and wget not working with https sites after upgrade to ubuntu 18.04.1

Question: Seems to be a openssl related issue. Anyone have any ideas as to what this is?
Note that the url works in a browser.
With wget:
# wget -d https://deb.nodesource.com/setup_8.x

DEBUG output created by Wget 1.19.4 on linux-gnu.

Reading HSTS entries from /home/user/.wget-hsts
URI encoding = 'UTF-8'
Converted file name 'setup_8.x' (UTF-8) -> 'setup_8.x' (UTF-8)
--2018-09-02 19:54:06--  https://deb.nodesource.com/setup_8.x
Could not seed PRNG; consider using --random-file.
OpenSSL: error:2406F07A:random number generator:RAND_load_file:Not a regular file
Disabling SSL due to encountered errors.

With curl:
# curl -v -L https://deb.nodesource.com/setup_8.x

*   Trying 22.214.171.124...
* TCP_NODELAY set
* Connected to deb.nodesource.com (126.96.36.199) port 443 (#0)

<hangs>

Comment: This works fine in this vagrant box [benno/ubntu-18.04](https://app.vagrantup.com/bento/boxes/ubuntu-18.04) which is 18.04.1 as well. What is the exact version of the OpenSSL libraries these commands are using in your environment?
Comment: What is the version showed when doing `strings /usr/local/lib/libssl.so.1.1 | grep ^OpenSSL`?
Comment: Forget about my answer for a moment, could you check out this link [Could not seed PRNG; consider using --random-file.](https://help.directadmin.com/item.php?id=227) and try the recommendation?
Comment: libssl.so.1.1 => /usr/local/lib/libssl.so.1.1
Comment: OpenSSL 1.1.1-dev  xx XXX xxxx
Comment: BTW one thing I realized is that wget linked with gnutls (instead of openssl) works fine. But the standard package that comes from the bionic archives is linked with openssl, and that fails in my environment.
Answer: You seem to be running into this OpenSSL bug/feature: 1.1.1 -> RAND_load_file() does not accept special files.
Checking out the source code op wget, you can see that it invokes RAND_load_file() in the function init_prng(). That function also explains some options you could use to point to a different file (which should be a regular file):
  /* Seed from a file specified by the user.  This will be the file
     specified with --random-file, $RANDFILE, if set, or ~/.rnd, if it
     exists.  */

You could try any of these, or otherwise use a 1.1.0-version of OpenSSL. Or use gnutls, like you already do :-)

By the way, I was not able to reproduce your problem, so I can not tell for sure this is the cause. However, I do not think that your problem is caused by the upgrade to 18.04.1. Your current OpenSSL installation seems a bit messed up by something else. The version number indicates that this a build from an untagged OpenSSL repository state. I would not expect those libraries to be in your LD_LIBRARY_PATH before the "standard" OpenSSL libraries which reside in /usr/lib/x86_64-linux-gnu.

Based on the comments back and forth, the final conclusion is that you have built and installed a version of OpenSSL 1.1.1 in the past and at that time it worked fine. But after updating to 18.04.1, the bug mentioned was exposed. It would be interesting to figure out which exact changes in that update caused it, but I suppose knowing the immediate answer to your question is good enough for now :-)
Comment: OK, I added a conclusion -- feel free to edit to your liking. This was probably the last time that you installed an un-official version of OpenSSL, no?
Comment: Yes, I saw that issue on the openssl github as well. The suggestion on there didn't seem to help though. And in any case, I'd really like to understand why this is broken for us here (there are other people with the same problem). Also, I am not sure what you mean by "build from a untagged repo". The openssl package is what came with Ubuntu (I am pretty sure). What makes you think otherwise?
Comment: I do not think this particular openssl package came with Ubuntu. The version number `OpenSSL 1.1.1-dev xx XXX xxxx` is not something you would see in a normal distro and the location of where you get your OpenSSL libraries from does not seem to be the standard location. Do you see OpenSSL libraries in `/usr/lib/x86_64-linux-gnu` as well?
Comment: All I have there is: /usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines.
Comment: I do not know much about Ubuntu packaging but my clean 18.04.1 install looks different. Maybe you should manually instal the openssl package(s). This confirmed but unassigned bug report might be another indication that your OpenSSL 1.1.1 version is not part of the official distro: [Please provide ED25519 support in 18.04 OpenSSL](https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1780807)
Comment: Thanks for pointing that out. Saw a post from openssl folks saying something similar, and couldn't make sense of it.
Comment: That was the problem - openssl-1.1.1. Seems like, at some point, we built and installed it, and most of us have it on our machines. And upgrade to bionic was exposing the "bug" in there. If you reflect this in your answer, I'll accept it.


Effect of regularisation error

Question: Following is the formula to estimate parameters
w =(λI+ΦTΦ)−1* ΦTt

lambda is the regularization coefficient and w are the parameters of our model. fi are the features. And in order to compute the error
E= SSE + (λ/2)*wTw

SSE is the usual sum of squared errors but here the additional term is regulariser error.It is said in theory that as we increase lambda, the effect of wTw is reduced. But considering it, if lambda=0 then wTw will have no effect. Is it not a bit contradictory?
Moreover, addition of regulariser should decrease the overall error but it is actually increasing it by small numbers and it is increased.
Answer: What regularization does is to bias your parameter estimates to a certain regularization target. We select this target based on some prior knowledge or beliefs that we have about the parameters we're trying to estimate. For example, a common regularization target is 0, because in many situations we can assume that most of our parameters have relatively small values (i.e. are close to 0).
When the assumptions behind our choice of regularization target are correct (e.g. when the true parameters really do tend to be close to 0), this leads to more accurate parameter estimates. We have used our prior knowledge to decrease our uncertainty about the parameter estimates, and these estimates therefore follow a more narrow distribution around their mean. This decreases the amount of random error in your parameter estimates.
The decreased random error comes at a cost however, and that cost is a larger systematic error (or bias). The prior assumptions we have imposed on our parameter estimates are "pulling" them towards the regularization target. As we increase the regularization strength $\lambda$, this pull will become stronger and so we see a larger bias.
So we have a trade-off between random and systematic errors; also known as "variance" and "bias". In your formula, these correspond to the SSE and the $\frac{\lambda}{2}w^Tw$ terms, respectively. And you are right that the bias term will increase with the value of $\lambda$. However, your formula is hiding the fact that the SSE (or random error) term will actually decrease with increasing values of $\lambda$.
The trick with regularization is to find the right value of $\lambda$, with the optimal trade-off between systematic and random error, such that the overall error is minimized.

Effect of regularisation error


Can one use a whole note to span a full 5/4 measure?

Question: I'm transcribing a piano passage in 5/4 time here, and I think I'm doing well so far.

I find myself mildly annoyed by having to notate the chords that span the whole measure (first in right hand, then in the left for the last two measures of the passage), with a whole note + a quarter note, tied together. It looks a bit unwieldy to me.
Now, I know you can use a whole rest to signify any fully empty measure, no matter the time signature. Can you do the same with whole notes? Will I be understood if I use whole notes for these chords, without an attached fourth note? Do real composers or engravers do that?
Comment: I can't find any proof to support it but I am sure I have seen and heard of a [breve/double whole note](https://en.wikipedia.org/wiki/Double_whole_note) being used to denote duration equal to the length of the bar (regardless of time signature, similar to multi-bar rest notation)
Comment: To be really unambiguous about a triplet, you can write "3:2" above a group of notes, instead of just "3". This generalises, so you can write "4:5" above a whole note to make it last 5 quarter notes. In theory, anyway.
Comment: I actually find your notation method slightly confusing. 5⁄4 notation is usually either 3 + 2 or 2 + 3. Bar 73 and 75 implies that in this case it is the latter, 2 + 3. Therefore, a better notation would reflect the pulse of the bar, as per Schultz's answer below. You should use tied half notes and dotted half notes in the order required by the bar's pulse.
Answer: I would like to add a detail to Richard's answer.
The bars sometimes has a 3+2 rhythm and other times a 2+3 rhythm. You could notate the long held chords in synchronization with that.
So when it is 3+2 the chords can be notated with a dotted halfnote tied to a halfnote, and when it is 2+3 a halfnote tied to a dotted halfnote. Try it out and decide whether you like it better that way or not.
Comment: @KeizerHarm - I generally meet 3+2, or 2+3. 4+1 is a strange concoction.
Comment: I think it is somewhat more common in pop music to have a 5/4 or 7/4 that doesn't follow the "traditional" rhythmic groupings but is more like a "standard" 4/4 pop beat just with one beat added or taken away. In such cases, notating as 4+1 or 4+3, respectively would make sense, I guess. Genesis' *Turn It On Again* is an extreme example of either 13/4 or 6/4+7/4 depending on how you look at it, where the keyboard and guitars play a 6/4 + 7/4 chord progression, whereas the drums play a straight 4/4 with just one duplicated snare hit at the end of every third bar, thus making it 4/4+4/4+4/4+1/4.
Comment: @KeizerHarm 3+2 or 2+3 is the standard approach.
Comment: Hard for me to judge which one it is, when I'm transcribing someone else's performance :) I think 4+1 can be interpreted as "agnostic" of the subdivision of the compound measure?
Comment: @JörgWMittag The usual significance I get from a notation of M+N beats is it tells me there is a downbeat on the first of M beats and then on the first of N beats. So 4+1 tells me the first and last beats are both downbeats. Is that what you meant?
Comment: @DavidK (4 + 1)/4 means that beats 1 and 5 are the strong beats of the measure and 2-4 are the weak beats. 1 is still the downbeat; 5 just happens to be the next strongest. It's not quite the same as (4/4) (1/4), where you genuinely have two measures in [distinct, alternating meters](https://thelistenersclub.com/2014/07/02/america-in-simple-and-compound-time/), one in 4 and one in 1.
Comment: @Bladewood That's what I would expect. Something like 8/4 without the last three beats. I'd be interested in examples.
Answer: You're correct that a whole rest is used for this purpose, but I've never seen actual note values used in that way. The whole+quarter construct seems to me the smart way to go.
This is especially important when multiple voices occupy a single staff; in such a case, using a whole note only would lead to certain confusion on the part of the performer as to what was intended.
I guess you could, at the start of your score, create a special notehead with a clarification that it is equivalent to a whole+quarter. But that seems overkill; I've seen plenty of 5/4 pieces with the whole+quarter (or half+dotted-half) construct.
Comment: Might make a little more sense to count the tied notes to co-incide with the underlying rhythm.  If it's **1**23 **1**2, then a dotted minim followed by a minim is what I'd write. A count of 4 and 1 seems quite weird.
Comment: @Tim:  Yeah, it'd be analogous to writing a full-measure note in 6/8 time with a half note tied to a quarter note (if you somehow forgot that dotted half notes exist.)
Answer: In chanted music there are two notations for "notes held as long as you need to."  One is to put vertical bars on either side of the whole note, as shown here
https://hymnary.org/hymn/LH1941/page/32
Another is to use the double whole note as shown here
http://llpb.us/psalmody.htm
Answer: "Whole notes" are four beat notes, "whole" or expressing one whole measure if you are in a time signature whose "fractional expression" (reading a time signature like it was a regular fraction) equals one (four quarter notes or one whole note, hence the name). So, 4/4 time or 2/2 or but not 3/4 or 2/4 or 6/8 or 5/4.
"Whole" is a little unfortunate. "Compared to what?" "Compared to a semi-arbitrary but-you-have-to-start-with-some-standard of reference 4/4 measure in which One measure equals Four quarter notes in a . . . you got it, in a 4/4 measure.
A half note does not cover half a 3/4 measure. It's two beats out of a three beat measure. I'm saying this by way of analogy for why you can't (aren't supposed to, would be misunderstood) use a "whole note" for a whole five-beat measure in a song or piece which is, at least part of the way, in 5/4. (Like the chorus of "White Room" by Cream. I mean the "bolero" drums.)
In a 5/4 measure, you clever beat changing musician, you write "whole note, ligature, quarter note," to express the whole five beats of a 5/4 measure. That's if you are really holding the note or chord for "the five."
There's are no standard "fill the space, whatever size" notations in simple, everyday western musical notation from the so called common practice period of euro-anglo-western music . . . or especially standard western music notation, although in orchestral scores there is a way to say "silent throughout" with a "whole measure rest," regardless of whether the measures are 4/4, 8/4, 12/4 or more.
Don't worry, when your musicians will see "whole note, ligature, quarter note," they will know that the bendy arch connecting the whole note and quarter note are meant to be played as one five-beat note, not a separate four beat note followed by a distinct one beat note. If they are alert, they will see the 5/4 signature and expect some unusual combinations of notational values, and so will be counting, and discover that, yes, four plus one equals five, just as you intended.
Hey! I didn't even see the score until just now, and you got it exactly right! Whole note, ligature, quarter note. Like saying, "FI-I-I-I-IVE" "FI-I-I-I-IVE" etc. where each syllable or I is a beat. The beats are felt, but not expressed.
But I strongly disagree, if I may, with what was said about writing a 3-2 sometimes and a 2-3 other times. If a " 'whole-in-quotation marks " five-beat note is really just that, it should be written the same way each time. If there are "inners rhythms" then the rhythm instruments should have their syncopation expressed. If the beat changes, these cats read and play and change the beat. But a five-beat note is a five-beat noter and you will make your session musicians ask themselves, "is this five beat note different from the other? If so, how?" You don't need to have phantom rhythms expressed inside real, solid five-beat "whole plus one" notes.
You, or the rhythm notation or the rhythm players will "cue" your whole-measure guys about the inner subtleties, and if they can swing at all they will feel your swing. They will feel it, their sheet music does not need to have "special swing encoding." At least, not for the whole-plus one notes -- if that is really what they are meant to play. "Feel" comes from somewhere else.
So, yes (I belatedly read) it IS unwieldy to use ligatures for odd-valued long notes. Maybe our notation could and should better reflect that, and maybe some Indian (from India) or Iraqi (they have a ten-beat rhythm that goes 2-3 3-2 and I think is meant to drive you crazy) -- maybe some other notational systems express longer rhythmic patterns better than ours. Our system is descended from a "church" mode in which a standard, chantable long measure used something like our whole note, half note, quarter notes, and then triplets, so, like, a 12/8 pattern or something like it.
When some secular composers borrowed unusual time signatures from traditional folk dances, they found a way to make beats and measures more or less any size and shape they needed. But the "legacy" is that a whole note means four beats, not "A measure of whatever size."
To quote your post:

Can you do the same with whole notes? Will I be understood if I use whole notes for these chords, without an attached fourth note?

No, you are not supposed to do that, and no, you will be misunderstood. The "best practice" is to consistently stay with four-one ligatures, knowing that by four plus one all you really mean is five.
The awkwardness actually has one benefit. It looks unusual, and it will remind whoever is playing, "Hey, wake up, remember, this is in FI-I-I-I-IVE" ! Odd notes for odd music.
Answer: For the sake of clarity, I would recommend: minim + dotted minim. Especially if you consider the rhythmic quality of br 73,75 and 77
Answer: There is a notational curiosity in Mussorgsky's Pictures at an Exhibition (composed in 1874) in the last (5/4) measure of the Promenade before N.7 "Limoges." I've found three different notations, with six, five, and four beats in the upper staff:
(1) Manuscript:

(2) A reprint of the First Edition keeps the doted half:

(3) The notation was later corrected to what is generally printed. A 1914 London edition:

(4) The Kalmus reprint of the Complete Works:

(5) The Henle edition (1992):

(6) My 1952 International Music Company edition (which boasts "Authentic Edition") screws things up again here. The last measure (still governed by the 5/4) has just an undotted whole note with a fermata. On the plus side, it does have black and white reproductions of the pictures.
Note the confusion in sources (2) and (3) in assigning quarter- or eighth-note flags to the F and A in the r.h. of the 2nd and 4th beats of the 6/4 measure. Source (6) has the same flagging as (2).

The "kosher" notation with a tied quarter after the fermata does make you smile from the performer's view. It would appear that Mussorgsky's thought the dot was OK in 5/4. Perhaps you could make a case that the dot is correct and the last measure was meant to revert to 6/4; however, leaving out the time signature seems like a bigger oversight than the imprecise dot.  It's a moot but curious point because of the fermata. The piece wasn't published until after Mussorgsky's death. Snippet (5) is from the publisher's website; all others are from sources available at IMSLP.
Comment: Please refrain from constant edits to a post. Edits are fine, but try to do as many as you can at once. Over 20 edits in 24 hours is a bit much.
Answer: Just thought of another idea. A whole note with a following dot (sorry, I grew up around musicians but never went to School for Serious Musos, so I call them "dots") -- a following dot means "plus one half again." So, Whole note, four beats, plus dot adding two beats equals six beats.
Maybe a dot after the other dot could be accepted or explained to mean "the second dot means make the first dot only half as much longer." So, conceivably, a double dot of this sort could mean, "Four plus Half of Two, or One," or "This means Five."
But you'd have to explain it and I think I've just shown why the standard notation with all its drawbacks is the one to use -- for Mutual Intelligibility.
Done.
peace to each and all.
<{: )}>
Comment: The double dot is already in use and it's add half as much again, so, a whole double-dot note means 7 beats (4+2+1). A double-dotted quarter is 1 3/4 beats.
Answer: The whole bar rest is not a normal whole note rest: the whole bar rest is positioned in the middle of the bar.


Powershell Where-Object doesn't seem to filter

Question: I'm trying to do some reporting on Azure Policies. I'll eventually be filtering on dates, but having trouble filtering on anything, so present the following sample.
PS C:\>$defstrings = az policy definition list --management-group "mgsandbox"   # returns an array of strings
PS C:\>$def = ConvertFrom-Json -InputObject ($defstrings -join "`n") -depth 99  # converts to an array of PSCustomObject
PS C:\>$def.count
2070
PS C:\>$sel = Where-Object -inputobject $def -FilterScript { $_.displayName -eq "Kubernetes cluster containers should not share host process ID or host IPC namespace" }
PS C:\>$sel.count
2070
PS C:\> $def[0].displayName -eq "Kubernetes cluster containers should not share host process ID or host IPC namespace"
False

While I might possibly find more than one hit on the displayName, there are clearly a non-zero set of displayNames that do not match the filter, yet the selection is getting all of them.
Any suggestions what's wrong with my syntax? It seems straightforward.
Answer: Do not use an -InputObject argument with Where-Object; instead, provide input via the pipeline:
# Use the pipeline to provide input, don't use -InputObject
$def | Where-Object -FilterScript { $_.displayName -eq "Kubernetes cluster containers should not share host process ID or host IPC namespace" }

In most cmdlets, the -InputObject parameter is a mere implementation detail whose purpose is to facilitate pipeline input and cannot be meaningfully used directly; see this answer for  more information, as well as GitHub issue #4242 for a discussion.

As for what you tried:
When you use -InputObject, an argument that is a collection (enumerable)  is passed as a whole to the cmdlet, whereas using the same in the pipeline cause its enumeration, i.e. the collection's elements are passed, one by one.
A simplified example:
# Sample array.
$arr = 1, 2, 3

# WRONG: array is passed *as a whole*
#        and in this case outputs *all* its elements.
#        -> 1, 2, 3
Where-Object -InputObject $arr { $_ -eq 2 }

That is, the script block passed to Where-Object is executed once, with the automatic $_ variable bound to the array as a whole, so that the above is in effect equivalent to:
if ($arr -eq 2) { $arr }

Since $arr -eq 2 evaluates to $true in a Boolean context (the if conditional), $arr as a whole is output (although on output it is enumerated), giving the impression that no filtering took place.

The reason that $arr -eq 2 evaluates to $true is that the -eq operator, among others, supports arrays as its LHS, in which case the behavior changes to filtering, by returning the sub-array of matching elements instead of a Boolean, so that 1, 2, 3 -eq 2 yields @(2) (an array containing the one matching element, 2), and coercing @(2) to a Boolean yields $true ([bool] @(2)).[1]

Conversely, if the implied conditional yields $false (e.g., $_ -eq 5), no output is produced at all.
By contrast, if you use the pipeline, you'll get the desired behavior:
# Sample array.
$arr = 1, 2, 3

# OK: Array elements are enumerated, i.e.
#     sent *one by one* through the pipeline.
#     -> 2
$arr | Where-Object{ $_ -eq 2 }

Alternatively, you can bypass the pipeline by using the intrinsic .Where() method:
Note: This requires collecting all input in memory first; however, especially with data already in memory, this approach performs better than the pipeline approach:
# OK:
# -> 2 (wrapped in a collection)
@(1, 2, 3).Where({ $_ -eq 2 })

Note: .Where() always outputs an array-like collection, even when only a single object matches the filter. In practice, however, that usually doesn't matter.

[1] For a summary of PowerShell's to-Boolean coercion rules, see the bottom section of this answer.


User authentication handled by a web service

Question: I seek your help and advice. By default, Drupal manages user authentification using the user module that resides in the "core/modules" and through the main Drupal Database. In my case, the user is authenticated through an external webservice, the process is as follow:
1- The user enters his credentials and click submit
2- the credentials are then sent to the webservice
3- the webservice checks the data(credentials) to the one he has in his database
4- upon validation the webservice sends a token (JWT) otherwise it sends 401 Unauthorized
PS: the admin will have normal login (through Drupal Database)
The question is how can I proceed to elaborate this process of authentification?

Is there some existing modules that could help with this?
should I override the existing user module or create a new module?

Any info will be of great help.
Answer: Remote authentication can range from moderately complex to major complex.
In general, you will need Drupal users that match your external DB users.  Drupal security and coding is tied to this.  The easiest way is to create users that match your remote DB and then only do authentication.
How you syncing the remote to the local can quickly add complexity.
Other things you will need to deal with are overriding the password reset functionality.  Changing it in Drupal will not change it in your remote DB.
Some reference material / modules to look at:
Authentication API (incomplete)
The LDAP Project - A full featured implementation with dynamic provisioning (creates local Drupal id's if user authenticated) and other stuff.
The External Auth Module - Just ran across this.  May or may not be applicable.
Comment: Thank You so much @CG Monroe for the guidness. I'll be sure to give the provided materials a try.
Answer: You have a few options depending on what you are trying to do with your webservice.
A good tutorial I've used to set this up is http://www.mediacurrent.com/blog/using-json-web-tokens-jwt-authenticate-endpoints
It sounds like you are already successfully returning a JWT. Congrats I found that to be the difficult part between CORS and restui.
I'm using React as my front end and use this code to then store the token.

axios.post(apiLoginUrl, data, headers)
      .then(response => {
          console.log(response);
          let jwt = '';
          localStorage.setItem(jwt, response.data.token);
          console.log(localStorage.getItem(jwt));
        })
        .catch(error => {
            console.log(error);
        });

So a breakdown of what this does is as follows. It reaches out to your end point for the JWT and then stores it in localStorage.
I would then pass the token in with each of your subsequent post requests using localStorage.getItem(jwt)
You could then pass it in with all with all posts...
So with Axios - axios.defaults.baseURL = 'https://api.example.com';
axios.defaults.headers.common['Authorization'] = localStorage.getItem(jwt);
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Or with something like Apollo -

const networkInterface = createNetworkInterface ({
    uri: 'http://examplesite.com/graphql'
});
networkInterface.use([{
  applyMiddleware(req, next) {
    if (!req.options.headers) {
      req.options.headers = {};  // Create the header object if needed.
    }
    // get the authentication token from local storage if it exists
    let jwt = '';
    const token = localStorage.getItem(jwt);
    console.log(token);
    req.options.headers.authorization = token ? `Bearer ${token}` : null;
    next();
  }
}]);
const client = new ApolloClient({
    networkInterface,
});

Basically the JWT becomes your Authorization part of the Post request.
Hope this helps.
To handle signing up new users your could use something like this... after exposing the user endpoint via RestUI.

  handleSignup(event) {
    console.log("running handleSignup")
    event.preventDefault();
    const apiSignupUrl = "http://example.com/user/register?_format=json";
    const headers = {
      "content-type": "application/json",
    }
    let data =
    {
      "name": {"value": this.state.username},
      "mail": {"value": this.state.username},
      "pass": {"value": this.state.password},
      "field_name" : {"value:": "Name"}
    }
    axios.post(apiSignupUrl, data, headers)
      .then(response => {
        console.log(response);
        if (response.data.uid.length > 0) {
          console.log("Awesome!");
          this.handleLogin();
        }
        else {
          console.log("Back to the drawing board");
        }
        //If we return a successful creation log the user in.
        //handleLogin();
      })
      .catch(error => {
        console.log(error);
      });
  };
Comment: Please note. I think you are talking about a Drupal based external webservice. If you are talking about a completely external webservice written in something else this won't make any sense. My apologies if that is the case.
Comment: Unfortunately the webservice is complete PHP, However, I thank you a lot for the help. there is a lot of information that will be so useful to me.
Answer: I thought to share my solution hoping it may help some of you :D
In my case all users(agents/clients) needed to be authenticated through the web service in order to have a token with which they will authenticate all their future requests.
So for the agents i used the default login form that comes with drupal and tweaked it abit (ostensibly and internally), the way i tweaked it is that before the normal authentication process of drupal's happens i made sure that the agent authenticate first via the webservice and if it goes OK i let drupal's authentication process happens otherwise i raise an exception and therfore i cut the authentication off and display a login error. As for the client that have accounts within the website and all their data reside within the webservice, i created another page that has another login form and i authenticate them through the webservice and logged them into the site using sessions.


How to find what is in unmanaged memory in Dump by WinDBG

Question: I run for Dump File in WinDbg command
!address -summary
I results are something like this
Usage Summary   RgnCount    Total Size  %ofBusy %ofTota

    Free            3739    7ff5`dbbae000 ( 127.960 Tb)                 99.97%
    <unknown>       1677    5`680a1000 (  21.626 Gb)    53.31%       0.02%
    Heap            20349   4`0049f000 (  16.005 Gb)    39.45%       0.01%
    Stack           230 0`a3e90000 (   2.561 Gb)    6.31%        0.00%

How can I find what in in Heap? What are objects or what are types?
Is  Managed Heap, and Heap is managed heap?

It is very hard to ask Questions Like this, so I added more info

Here is my C# Sample Code
class Program
{

    public static int[] arr;
    public static AllocateUnmanagedMemory cls;

    static void Main(string[] args)
    {
        const int GBSize = 1 * 1024 * 1024 * 1024/ sizeof(int);

        Console.WriteLine("Allocating");

        arr = new int[GBSize];

        cls = new AllocateUnmanagedMemory();

        cls.UnmanagedAllocation();

        Console.ReadLine();
    }
}

Here is Unmanaged Allocation Code:
using System;
using System.Runtime.InteropServices;

public class AllocateUnmanagedMemory
{

    static IntPtr pointer;

    public void UnmanagedAllocation()
    {
        pointer = Marshal.AllocHGlobal(1024 * 1024 * 1024 );
    }
}

And results from WinDbg Preview in Windows 10
-- Usage Summary RgnCount ----------- Total Size -------- %ofBusy %ofTotal
Free             59          762f7000 (   1.847 GB)           46.17%
<unknown>        98          4493e000 (   1.072 GB)  49.76%   26.79%
Heap             15          40158000 (   1.001 GB)  46.50%   25.03%
Image            174           2db2000 (  45.695 MB)   2.07%    1.12%
MappedFile       15           1c51000 (  28.316 MB)   1.28%    0.69%
Stack            24            800000 (   8.000 MB)   0.36%    0.20%

I should be able find somewhat that code for Unmanaged Allocation, allocated 1Gb memory.
Answer: The basics
The command !address operates on a very low level, barely above the operating system. However, it will recognize a little bit of the memory manager that comes with Windows: the Windows Heap Manager.
So, what you see as Heap that is memory which was allocated through the Windows Heap manager. On your level of understanding, that's the native heap.
Any other heap managers will implement their own memory management. Basically they all work similar: they get large blocks of memory from VirtualAlloc() and then try to do a better magement of the small blocks within that large block. Since WinDbg doesn't know any of these memory managers, that memory is declared as <unknown>. It includes, but is not limited to the managed heap of .NET. For other potential uses, see this answer.
Free is memory that can potentially be claimed from the operating system. This may include swap space, not only physical RAM.
Stack, well that's obvious I think.
The heaps

How can I find what in in Heap? What are objects or what are types?

The answer to this question heavily depends on which heap you're talking about.
The Windows Heap Manager ("native heap") just manages memory and does not manage types. It's not possible on that level to distinguish two objects of the same size but different type. If you have a memory leak, you can only give a statement like "I have a leak of n bytes". To find our more about the native heap, start with !heap -s and look up the other !heap commands.
The .NET managed heap retains a type system. To analyze the managed heap, you need an extension for WinDbg called sos. Usually you load it by .loadby sos clr. It has a command !dumpheap -stat which may give you a first impression of its capabilities. (Run the command twice if you get an error message)
This should give you enough hints to do further research and find more details in your crash dump.
Strange?
You seem to have 230 stacks with a total of 2.5 GB of memory. That is about 11 MB of memory per stack. Usually that's limited to 1 MB.
Your updated example code
I compiled the following program
using System;
using System.Runtime.InteropServices;
namespace SO55043889
{
    class Program
    {
        public static int[] arr;
        static IntPtr pointer;
        static void Main()
        {
            const int GBSize = 1 * 1024 * 1024 * 1024/ sizeof(int);
            Console.WriteLine("Allocating");
            arr = new int[GBSize];
            pointer = Marshal.AllocHGlobal(1024 * 1024 * 1024 );
            Console.ReadLine();
            Console.WriteLine(pointer.ToInt32() + arr[0]);
        }
    }
}

I ran the application and I attached to the process with WinDbg. I took a dump using
0:000> .dump /ma SO55043889.dmp

and now we can analyze it like this:
0:000> !address -summary
[...]
<unknown>                               106          474f4000 (   1.114 GB)  51.58%   27.86%
Heap                                     13          401e1000 (   1.002 GB)  46.38%   25.05%
[...]

So we see 1 GB of (potentially) .NET memory and 1 GB of native memory.
0:000> .loadby sos clr
0:000> !dumpheap -stat
c0000005 Exception in C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dumpheap debugger extension.
  PC: 04f6fa73  VA: 00000000  R/W: 0  Parameter: 00000000
0:000> *** This is normal, just do it again
0:000> !dumpheap -stat
[...]
70d20958       12   1073742400 System.Int32[]
Total 335 objects

There are 12 int[] on the .NET side, taking a total of ~1 GB from the managed heap. Looking at the details, we see that there's only one big array and some smaller ones:
0:000> !dumpheap -type System.Int32[]
 Address       MT     Size
020e1ff8 70d20958      300
020e2130 70d20958       24
020e2184 70d20958       40
020e2228 70d20958       80
020e2d9c 70d20958       16
020e2dac 70d20958       16
020e2df8 70d20958       16
020e386c 70d20958       24
020e3d54 70d20958       16
020e3d64 70d20958       16
020e3d74 70d20958       16
04811010 70d20958 1073741836

Statistics:
      MT    Count    TotalSize Class Name
70d20958       12   1073742400 System.Int32[]
Total 12 objects

That's not what you wanted know. I just showed you how easy it is on the .NET side.
Now the native side:
0:004> !heap -s
LFH Key                   : 0x7f8d0cc6
Termination on corruption : ENABLED
  Heap     Flags   Reserv  Commit  Virt   Free  List   UCR  Virt  Lock  Fast
                    (k)     (k)    (k)     (k) length      blocks cont. heap
-----------------------------------------------------------------------------
Virtual block: 80010000 - 80010000 (size 00000000)
00550000 00000002    1024    504   1024     14    17     1    1      0   LFH
002d0000 00001002      64     16     64      2     2     1    0      0
00820000 00041002     256      4    256      2     1     1    0      0
00750000 00001002      64     20     64      7     2     1    0      0
00710000 00001002     256      4    256      0     1     1    0      0
001e0000 00041002     256      4    256      2     1     1    0      0
-----------------------------------------------------------------------------

We can't see the 1 GB here. And there's a reason for that.
As explained before, heap managers are good at dividing large blocks from VirtualAlloc() (which are 64kB) into smaller pieces. They do that because it would be a big waste to allocate 64kB just for a 4 byte int. However, there's no need to create heap management stucture for large blocks. For an allocation of 2^30+1 byte, the OS would return 2^30+64kB, which means the overhead is just 0.006%.
That's why you will find allocations >512kB not inside the usual heap management structures but as a Virtual block, which means that the Windows Heap Manager has simply forwarded the request to VirtualAlloc().
There's another issue here: the output for the size is broken. It says
(size 00000000)

which obviously is not true. Let's look at it ourselves:
0:004> !address 80010000
    Usage:                  Heap
    Base Address:           80010000
    End Address:            c0011000
    Region Size:            40001000
    [...]

    0:004> ? c0011000-80010000
    Evaluate expression: 1073745920 = 40001000

What we see here is that End Adress - Base Address equals the Region Size and the size is 1 GB.
At this point, it's worth noting that the user mode stack trace database is useless. It only applies to items on the heap, but not VirtualAlloc(). You'll not figure out who allocated the 1 GB block.
And I forgot to enable the user mode stack trace database anyway. Let's do that and cross check
0:000> !gflag
Current NtGlobalFlag contents: 0x00001000
ust - Create user mode stack trace database

And now, there should be stack traces for smaller pieces of memory. In this example, I use an arbitrary block of size 0x208:
0:000> !heap -flt s 208
    _HEAP @ 2a0000
      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
        002c9818 0044 0000  [00]   002c9830    00208 - (busy)
        002cd1e8 0044 0044  [00]   002cd200    00208 - (busy)
        002d5ad0 0044 0044  [00]   002d5ae8    00208 - (busy)
        002f0c48 0044 0044  [00]   002f0c60    00208 - (busy)
        0032c210 0044 0044  [00]   0032c228    00208 - (busy)
        00351c90 0044 0044  [00]   00351ca8    00208 - (busy)
0:000> *** Use any UserPtr number, I use the last one
0:000> !heap -p -a 00351ca8
    address 00351ca8 found in
    _HEAP @ 2a0000
      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
        00351c90 0044 0000  [00]   00351ca8    00208 - (busy)
        779dd909 ntdll!RtlAllocateHeap+0x00000274
        71e18bc7 clr!EEHeapAlloc+0x0000002c
        71e18c0a clr!EEHeapAllocInProcessHeap+0x0000005b
        71e18ba6 clr!ClrAllocInProcessHeap+0x00000023
        71e2dd26 clr!StackingAllocator::AllocNewBlockForBytes+0x00000082
        71e2dd76 clr!operator new+0x00000063
        71e93ace clr!MethodTableBuilder::BuildMethodTableThrowing+0x00000059
        71e94590 clr!ClassLoader::CreateTypeHandleForTypeDefThrowing+0x0000083a
        71e2e956 clr!ClassLoader::CreateTypeHandleForTypeKey+0x000000ad
        71e2e99a clr!ClassLoader::DoIncrementalLoad+0x000000c2
        71e2e418 clr!ClassLoader::LoadTypeHandleForTypeKey_Body+0x00000505
        71e2e5a7 clr!ClassLoader::LoadTypeHandleForTypeKey+0x000000b5
        71e2f723 clr!ClassLoader::LoadTypeDefThrowing+0x00000318
        71e2a974 clr!ClassLoader::LoadTypeDefOrRefThrowing+0x0000024c
        71f57811 clr!Assembly::GetEntryPoint+0x0000022f
        71f856e0 clr!Assembly::ExecuteMainMethod+0x000000b3
        71f855ed clr!SystemDomain::ExecuteMainMethod+0x00000631
        71f858d3 clr!ExecuteEXE+0x0000004c
        71f85819 clr!_CorExeMainInternal+0x000000dc
        71f55a0c clr!_CorExeMain+0x0000004d
        7251d93b mscoreei!_CorExeMain+0x0000010e
        72597f16 MSCOREE!ShellShim__CorExeMain+0x00000099
        72594de3 MSCOREE!_CorExeMain_Exported+0x00000008
        77999802 ntdll!__RtlUserThreadStart+0x00000070
        779997d5 ntdll!_RtlUserThreadStart+0x0000001b

Just one more note: if you modify the program to have smaller blocks of memory, e.g.
for (int i = 0; i < 1000; i++)
{
    pointer = Marshal.AllocHGlobal(3*1024 );
}

You will see the allocation in the heap:
0:004> ? 3*0n1024
Evaluate expression: 3072 = 00000c00
0:004> !heap -flt c00
cound not parse flt criteria -flt c00
0:004> !heap -flt s c00
    _HEAP @ 67c0000
      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
        0686b668 0183 0000  [00]   0686b680    00c00 - (busy)
        0686efa8 0183 0183  [00]   0686efc0    00c00 - (busy)
[...]

And you will see stack traces
0:004> !heap -p -a 4d0fdf18
    address 4d0fdf18 found in
    _HEAP @ 67c0000
      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
        4d0fdf00 0191 0000  [00]   4d0fdf18    00c00 - (busy)
        779dd909 ntdll!RtlAllocateHeap+0x00000274
        768f5aae KERNELBASE!LocalAlloc+0x0000005f
        70c6ad4f mscorlib_ni+0x003fad4f
        7138c4da mscorlib_ni+0x00b1c4da
        71e0ebb6 clr!CallDescrWorkerInternal+0x00000034
        71e11e10 clr!CallDescrWorkerWithHandler+0x0000006b
        71e17994 clr!MethodDescCallSite::CallTargetWorker+0x0000016a
        71f85026 clr!RunMain+0x000001ad
        71f85707 clr!Assembly::ExecuteMainMethod+0x00000124
[...]

But you won't see the managed method calls. That's because the USt database was built for native only. It's the same reason you have different stacks in .NET using k or !dumpstack.
Comment: I added sample code,  your answer absolutely correct, if we don't know what is in  , it is just bytes. But in real word we always have some DLL(s) referenced, and code which allocate Unmanaged memory, It is just very hard to identify this DLL(s) and code. And this is what I am looking for. Find who allocated 1GB code in sample.( or 14 Gb in first example)
Comment: So it works! I am eager waiting to check it real life. Thank you a lot!
Comment: @justromagod: I just added another note regarding the NET stack
Comment: it seems without gflag enabled, all my dumps are useless.
Comment: @justromagod: yes
Comment: All I see is unknown noop everywhere
Comment: @jjxtra: sorry, I have no context. Please post your own question if this answer does not give what you expect. If you have many NOPs, someone might have tried heap spraying.


Concern with Multiple mixed repeated measure analysis/ Ancova

Question: I can't understand what type of graphical analysis is this in the attached figure.

The statistical analysis conducted was a MMRM or ANCOVA?  How can they combine control and treatment in one line (MMRM one)
[the picture is from donanemab study)
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: The figure didn't come through.  Please try uploading again.
Comment: Apologize  for this, now it should be present. Many thanks
Comment: Hello! Please could anyone help me?
Answer: Assuming the following:
MMRM = Mixed Model for Repeated Measures, and
DPM = Disease Progression Model

The statistical analysis conducted was a MMRM or ancova ?

It is a MMRM. There are presumably repeated measures within participants / subjects so a mixed model would be a fairly typical approach.

How can they combine control and treatment in one line (the MMRM one) ?

I don't know what you mean by combine them "in one line" ? For example, the first MMRM point estimate in the figure, for iADRS Score, is approximately 20. Since this is greater than zero, it means that the treatment is protective.


background color disapears when i declare a doctype with YUI reset.css

Question: When running in quirks mode, this works as expected however when I declare HTML 4.01 strict the background color disapears. If I remove the YUI reset.css, it seems to work as it should. Anyone know what YUI is doing?
I am using
<code> body{
      background-color:#000;
 }
 .wrap{
      width:60em;
      min-height:100%;
      position:absolute;
      top:0px;
      background:#666;
      left:50%;
      margin-left:-30em;
 }
</code>
The HTML:

                anything
Comment: Why strict?  Why not transtional?
Answer: The reset is setting the background colour for html to white. Can't tell what's going in your HTML without seeing it, but the chances are the body is collapsed around the content. To get the desired black background you'll need:
<code>html{
      background-color:#000;
}
</code>
Answer: Are you declaring the style AFTER you include reset.css? If not, you could be resetting your changes.
Answer: Yep. Deleting the background rule from html { } in the YUI CSS reset sorts it. Thanks! Not sure why they put it there in the first place tbh.
Interestingly enough, doing this makes most (all?) browsers give full height to body as well, so even a repeating background set there will render over the whole page.


After changing a webform multi-select field to single-select, submissions made pre-change show only the first selection

Question: I've created a webform in Drupal 7 with a component drop-down list.  I selected 'multiple' for multiple selections.  Now, I need to unselect 'multiple' giving users just one choice of the drop-down list.
Now, when viewing the submission data, the past data w/ multiple choices only show the topmost choice.  How can I have the past data show the multiple choices despite I'm allowing only one choice in the component?
Comment: For the component, if I switch back to 'multiple', the data chosen reappears in the submission view.  So..., the data is still there.  When 'multiple' is turned off, it just shows the 'top' choice, only one.
Comment: Depends on if the webform submissions in the database has been updated, if they have, then it's not possible.
Answer: You can keep the field set to single choice, and use hook_webform_submission_render_alter() to display the values as if it was still a multi-select field.
You can use the hook in a module or the template.php of a theme. If you are thinking about implementing it in a theme, keep in mind that the Webform Results view is displayed through the Administration theme. So, the hook must be implemented in the default administration theme for it to work in that view. By implementing it in a module, you shouldn't have to worry about which theme the submission results are being shown.
You will need the nid for the webform, and the form Key for the select field. The nid is in the url of the webform's edit page. The form key can be seen in the webform's Form componentspage.
The following code is implemented in the "my_module" module, for a webform with a nid of "100", and a field with the form key "my_select_field".
/**
 * Implements hook_webform_submission_render_alter().
 */
function my_module_webform_submission_render_alter(&$renderable) {
  if ($renderable['#node']->nid == '100' && isset($renderable['my_select_field'])) {
    $renderable['my_select_field']['#multiple'] = 1;
  }
}

The isset($renderable['my_select_field']) in the if statement may seem redundant, but it's there to prevent an exception if someone changes the form key for the field.
Comment: Excellent solution, we'll give it a try...
Answer: You could instead create a new component for the single choice option, and disable the multi-option one.


spring aop not firing for annotation

Question: I am using an annotation on a method. and whenever that annoation is present I want to intercept it using aop. What am i missing.
<bean id="emailAdvice" class="com.merc.spring.aop.advice.MultiThreadEmailAdvice"/>

<aop:config>
    <aop:aspect ref="emailAdvice">
        <aop:around
            method="fork"
            pointcut="execution(* org.springframework.mail.javamail.JavaMailSenderImpl.send(..))"/>
    </aop:aspect>
    <aop:aspect ref="emailAdvice">
        <aop:around method="sendEmailAdvice" pointcut="@annotation(sendMailAnnotation)" arg-names="sendMailAnnotation"/>
    </aop:aspect>
</aop:config>

@SendMailAnnotation()
public void testAnnotationEmail() {
    System.out.println("send an email");
}

@Aspect
public class MultiThreadEmailAdvice {
    public void sendEmailAdvice(ProceedingJoinPoint pjp, SendMailAnnotation sendMailAnnotation) throws Throwable {
        System.out.println("before method execution");

        pjp.proceed();

        System.out.println("after method execution");

        System.out.println(sendMailAnnotation.from());
    }
}

Answer: Try to change
@annotation(sendMailAnnotation)

To
@annotation(<package>.SendMailAnnotation).

in your bean definition.
Ex
<aop:around method="sendEmailAdvice" pointcut="@annotation(com.merc.spring.aop.advice.SendMailAnnotation)" arg-names="sendMailAnnotation"/>

Comment: If I do that I get the following error java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
Comment: `` has to be replaced with your annotations package ex `com.merc.spring.aop.advice`, Updated the answer
Comment: That is exactly what I had
Comment: Can you share the stack trace
Answer: It turned out that the service class that call the annotated method was not spring managed. Once making in spring managed, it worked fine

spring aop not firing for annotation


Why $\frac{\log4}{\log b}$ can't be simplified to $\frac4b$?

Question:
I want to know why $\frac{\log4}{\log b}$ can't be simplified to $\frac4b$.

I am a high school student. Please do not quote some theories that are too advanced for me. Thank you!
Comment: Why do you think it could be simplified?
Comment: Because "log 4" is not the product of "log" and "4".
Comment: What you _can_ simplify it to is $\log_b4$.
Comment: Have you tried it with numbers? Have you asked your calculator what $\frac{\log4}{\log5}$ is and noticed that it's not $.8000$?
Comment: To make it a better question, what do *you* know about $\log 4$? More generally, what did you learn about this $\log$ function? How do you *define* it?
Comment: @ParclyTaxel That is true $\iff$ you assume that both $\log$'s here are in the same base.
Comment: @Bacon Yes, the original expression in a reasonable person's interpretation would have both logs at base 10 or base e.
Comment: @ParclyTaxel I agree with you, I was being a little unfair I know, but since it wasn't specified :-)
Answer: $\require{cancel}$ It looks like you are thinking of doing this
$$\frac{\cancel{\log}4}{\cancel{\log}b}=\frac4b$$
But don't make the mistake of thinking of "$\log 4$" as "$(\log)\times(4)$". It isn't multiplication (which is what it would need to be if you were to cancel), but it's applying a function. In other words, "$\log 4$" is like "$f(4)$", so $4$ is the input to the function called "$\log$". Unfortunately, it is customary to omit the usual parentheses for functions like $\log$.
If it makes you understand it better, think of it as really meaning
$$\frac{\log(4)}{\log(b)}.$$
Comment: try not to do this one either $\frac{16}{64}=\require{cancel}\frac{1\cancel{6}}{\cancel{6}4}=\frac{1}{4}$
Comment: Even with the parenthesis, $\log$ still seems to be multiplying the numbers with the parenthesis notation, which is also misleading.
Comment: @Jam Is there a system in which that is possible?
Comment: @OFRBG No lol. Unless you had some horrible system of notation but that would be a very strange thing to do
Answer: Assuming you don't have a good professor and something of the sort, remember that $\log$ is the name of an operation. It's like $\cos(x)$. You can't, in general, simplify quotients of functions. So $\frac{\cos30º}{\cos45º}$ is not $\frac{30º}{45º}$. Same thing happens with logarithm.
There are other relations you can use, but you cannot "simplify".
For further information, dividing $\log$ by another $\log$ changes the base of the one above. (I'm not sure if you know this, but when we write $\log$, we usually asume it is logarithm base $e$.) The thing together is:
$$
\frac{\log(A)}{\log(B)}=\log_B(A)
$$
where $\log_B(A)$ is no longer base $e$ (or the original one), but base $B$ instead.
Answer: You have $\log{4}$ and lets set it equal to $X$.
$$\log{4}=X$$
and this has the equivalent exponential form of $10^X=4$.
Similarly, if $\log{b}=Y$, then $10^Y=b$.  Thus,
$$\frac{4}{b}=\frac{10^X}{10^Y}\neq\frac{X}{Y}=\frac{\log{4}}{\log{b}}$$
Answer: The cancellation rule you know, $$\frac{ab}{ac}=\frac{b}{c}$$ is only true if $ab$ means "$a$ times $b$."
But $\log 4$ doesn't mean multiplying something called "log" by the number $4$. It means we are applying an operation, "logarithm," to the value $4$.  As notation, it looks similar, but it does not mean the same thing as multiplication.
So the rule you know is, verbosely, written as:
$$\frac{a\times b}{a\times c}=\frac{b}{c}$$
When we write $ab$ to mean $a\times b$, then we can cancel like this.
But $\log 4$ does not mean $\log \times 4$, which is meaningless.
Now, as to why $\frac{\log 4}{\log b}\neq \frac{4}{b}$, specifically, the two are equal when $b=2$ or $b=4$, but not for any other $b$. $\frac{\log 4}{\log b}$ is not even defined when $b=1$, since $\log 1 = 0$.
If $0<b<1$, then $\log b<0$ and thus $\frac{\log 4}{\log b}<0$, but $\frac{4}{6}>0$.
Answer: The operation $\log\square$ is a black box that eats up the number you write into the square, processes it somehow, and outputs some other number as a result. At the moment you have no big idea what happens in the interior of that box.
There is no reason to assume that for arbitrary $a$ and $b$ one has
$${\log[a]\over\log[b]}={a\over b}\ ,\tag{1}$$
because the inner workings of the black box are much too complicated in order to allow for such a simple "general law".
Imagine for a moment that $(1)$ holds for all $a$ and $b$. Then we would have
$${\log[a]\over a}={\log[b]\over b}\tag{2}$$
for all $a$ and $b$ as well, and this means that ${\log[x]\over x}$ has the same value $c$ for all $x$. This value $c$ could be computed and ISO-certified once and for all. This would further imply that
$$\log[x]= c\>x$$
for all $x$, so that in the end the black box $\log\square$ would not be needed at all. Hm?
Answer: $$\frac{\log 4}{\log b}=\frac{\log(4^{1/4})^4}{\log(b^{1/b})^b}=\frac{4}{b}\frac{\log\sqrt[4]{4}}{\log\sqrt[b]{b}}$$
so
$$\frac{\log 4}{\log b}\neq \frac{4}{b}\quad{\text{(except when b=4 and b=2})}$$
Comment: Also, when $b=2$ they are equal...
Comment: It should be $\log \sqrt[b]{b}$ in the far right, although I don't this answer is much use.
Comment: @ThomasAndrews I have corrected it. Thanks
Comment: @ThomasAndrews thanks again
Answer: Well, suppose you could do such simplification:
$$
\frac{\log 4}{\log b}=\frac{4}{b}\tag{1}
$$
You would end up with (do you know why?)
$$
b\cdot \log 4=4\cdot\log b,
$$
which implies (do you know why?) that
$$
\log 4^b=\log b^4\tag{2}.
$$
If (1) were true for every $b>0$, then (2) must also be true for every $b>0$ and in particularly true for $b=1$ which is $\log 4=\log 1$. But it is impossible.


What is formal power series intuitively?

Question: I read Wikipedia article about formal power series, but I don't get an intuitive idea...
I had several doubts regarding this topic
1)Why we need formal power series
2)Formal power series does not give any significance to convergence, then why we used a diverging mathematical entity?
3)I read formal power series as a set of coefficients, I don't get what it means?
4)Can we represent a converging function($1+x$) by a formal power series?
5)Can we represent a function with a pole ($1\over{1+x}$) for $x>>1\&x<<1$ by a formal power series?
Please help me to get an intuitive idea rather than some mathematical formulae
Comment: Wilf described a generating function (a formal power series) as "a clothesline on which we hang up a sequence of numbers for display" https://www.math.upenn.edu/~wilf/gfology2.pdf
Comment: They present an interesting algebraic structure.  You can add and multiply them the way you would polynomials.    To some extent one can perform the operations of calculus on them without worrying about limits or anything like that.
Answer: It extends the concept of polynomial to an infinity of terms. And it has nothing to do with convergence or divergence, since it is not a sum of functions. You're confusing formal power series and functions defined by power series. Formal power series are defined for any commutative ring of coefficients.
Answer: A formal power series is indeed formally equivalent to a sequence of numbers.
$$a_0,a_1,a_2,\cdots\leftrightarrow a_0+a_1x+a_2x^2+\cdots$$
because you easily turn one into the other.
They are useful in that

they coincide with an entire series where the latter converges,

they are compatible with the logics for adding or multiplying polynomials and entire series (term-wise addition and convolutions),

they can convey non-converging generating functions and draw combinatorial properties.
Comment: "they coincide with an entire series where the latter converges," Is that statement your opinion or is it a mathematical theorem? I'm also curious about that. You're expressing this idea, right?
Answer: One application of generating functions is to solve counting problems like with Rook Polynomials. In this setting the coefficients will count a slight variant of the general problem and there are often infinitely many. This is useful because we can often calculate the coefficients in isolation without having to calculate the other terms to solve these problems.


Somar valores de resultados no mysql

Question: Estou dando manutenção em um banco e estou encontrando dificuldade em fazer um select.
Estrutura da tabela descontos_taxas:
      id | valor | cliente | data_criado
Meu cenário: Essa tabela guarda tanto taxas quanto descontos na mesma tabela. As taxas são valores positivos e os descontos valores negativos.
Eu preciso pegar todos os valores de todos os clientes, porém, se um cliente tiver recebido uma taxa e um desconto no mesmo dia preciso obter apenas um resultado com a diferença entre os dois.
Até agora fiz o seguinte:
SELECT
     *
FROM
    descontos_taxas as dt
WHERE
    YEAR(dt.data_criado) = 2014 and MONTH(dt.data_criado) = 04 and dt.valor < 0
GROUP BY
    dt.data_criado, dt.cliente
ORDER BY
    data_criado asc;

Como retornar apenas os valores negativos do resultado da soma entre taxas e descontos aplicados ao mesmo cliente? (Os clientes que não tiverem taxas aplicadas no mesmo dia do desconto o valor seria somado a 0).
Tenho este resultado no select:
 valor |    cliente    | data_criado
-19,90 | Erlon Charles | 2014-04-01
  9,90 | Erlon Charles | 2014-04-01
-19,90 | Erlon Charles | 2014-04-05
-19,90 | Erlon Charles | 2014-04-19

Preciso que este resultado seja igual a este:
 valor |    cliente    | data_criado
-10,00 | Erlon Charles | 2014-04-01 //aqui estão os dados das tuplas 1 e 2 somados
-19,90 | Erlon Charles | 2014-04-05
-19,90 | Erlon Charles | 2014-04-19

Comment: o que acontece se você usar a função `SUM()` do mysql?
Comment: Não obtive o valor correto, verifiquei em alguns clientes e era retornado apenas o valor do desconto e não o valor da diferença. Exemplo: uma taxa de 19,90 e um desconto de -19,90, o *select* retorna -19,90 quando era pra retornar 0,00.
Comment: Importante, no banco os valores são gravados com sinal . Senão sera preciso usar um case, algo como (case when tipo='D' then valor * -1 else valor end)
Comment: Sim os valores são gravados com sinal.
Atualizei a pergunta inserindo um exemplo de o q eu tenho e de o que eu preciso retornar.
Comment: Já foi feito isso na minha resposta, qual é a sua dúvida outra coisa o id nem pode aparecer ai !!!
Comment: Ainda vou reproduzir sua resposta @FCCDias, estava respondendo a pergunta dos outros antes de testar sua resposta, assim que eu conferir eu posto minhas considerações e se estiver correto eu marco, tudo bem?
Comment: Claro @ErlonCharles, mas, o meu intuito não é pontuação foi ajudar e minha preocupação é se você tinha testado ok!
Comment: Eu sei, mas marcar como correto vai ajudar a direcionar quem abrir essa pergunta no futuro
Comment: Agora eu não sei pra quem q eu marco como correta, fiz os teste e precisei usar o `HAVING` sugerido pelo @bacco e as somas sugeridas pelo @fccdias para solucionar meu problema
Answer: Adicionei o having para filtrar após o group, e a separação de taxas e descontos:
SELECT
    SUM( IF( valor > 0, valor, 0 ) ) AS taxas,
    SUM( IF( valor < 0, -valor, 0 ) ) AS descontos,
    SUM(valor) AS total,
    cliente,
    data_criado
FROM
    descontos_taxas
WHERE
    YEAR(data_criado) = 2014 and MONTH(data_criado) = 04
GROUP BY
    cliente, data_criado
ORDER BY
    data_criado asc
HAVING
    total < 0;

Comment: é `data_criado` mesmo
Comment: da forma simples ele me retorna o seguinte erro `Error Code: 1111. Invalid use of group function`, quando eu vou filtrar apenas os negativos.
Comment: ooops, vacilo meu.
Comment: Eu entendo a dificuldade em entender o que eu estou pedindo, eu mesmo passei uma manhã para consegui interpretar o que o financeiro queria no relatório antes de tentar.
Comment: @ErlonCharles e o pior é que corremos o risco de o financeiro dizer "não era nada disso" depois :D Mas pense no lado bom, se fosse o RH, seria mais complicado ainda. Nunca vi departamento mais perdido que RH.
Comment: KKKKKKKKKKKKKKKKK
Comment: O financeiro pediu um relatório dos descontos dos à todos os clientes em um mês, mas alguns descontos aplicados errados foram corrigidos aplicando uma taxa de valor igual (o sistema é burro e isso foi necessário ser feito), então eu tenho q mostrar todos os descontos dados aos clientes excluindo da lista a soma dos descontos e taxa que forem 0 da lista.
Comment: isso sendo q os desconto e taxas estão na mesma tabela sendo diferenciados apenas pelos descontos serem valores negativos
Comment: Ah sim, aí pode colocar o HAVING total = 0. De qualquer forma, acrescentei as somas separadas na query pra vc ver como faz, pra não precisar complicar com subquery.
Comment: Fiz o teste e ainda tem uma coisa, os clientes q tem desconto e taxa no mesmo valor, não podem entrar no relatório, pois essa taxa é uma forma de cancelar o desconto e vice versa, não posso mostrar os clientes onde a soma entre taxa e o desconto seja 0, tenho que mostrar apenas os q são menores que 0, ou seja, os que tem desconto real aplicado. Tô tentando fazer aqui e já tô ficando com dor de cabeça.
Comment: vamos [continuar esta discussão no bate-papo](http://chat.stackexchange.com/rooms/14534/discussion-between-erlon-charles-and-bacco)
Answer: Se eu entendi bem seria a Soma das Taxas, as Somas dos Descontos e depois a Diferença das duas, agrupados por cliente e data_criado:
SELECT a.cliente,
       a.data_criado,
       a.taxas,
       a.desconto,
       (a.taxas - abs(a.desconto)) diferenca
FROM (
SELECT cliente, data_criado,
    sum(CASE WHEN valor > 0 THEN VALOR ELSE 0 END) taxas,
    sum(CASE WHEN valor < 0 THEN VALOR ELSE 0 END) desconto
FROM descontos_taxas
GROUP BY cliente, data_criado) as a

Se ainda precisar filtrar:
SELECT a.cliente,
       a.data_criado,
       a.taxas,
       a.desconto,
       (a.taxas - abs(a.desconto)) diferenca
FROM (
SELECT cliente, data_criado,
    sum(CASE WHEN valor > 0 THEN VALOR ELSE 0 END) taxas,
    sum(CASE WHEN valor < 0 THEN VALOR ELSE 0 END) desconto
FROM descontos_taxas
GROUP BY cliente, data_criado) as a
WHERE date_format(a.data_criado, '%Y-%m') = '2014-04'

Conforme solicitação a resposta
SELECT a.cliente,
       a.data_criado,
       (a.taxas - abs(a.desconto)) valor
FROM (
SELECT cliente, data_criado,
    sum(CASE WHEN valor > 0 THEN VALOR ELSE 0 END) taxas,
    sum(CASE WHEN valor < 0 THEN VALOR ELSE 0 END) desconto
FROM descontos_taxas
GROUP BY cliente, data_criado) as a

Answer: Você precisa agrupar o resultado pelo cliente e pelo dia, e precisa remover a condição dt.valor < 0 da consulta. Ela precisa entrar como um having (que é processado após as operações). Veja:
SELECT
     dt.cliente, dt.data_criado, sum(valor) AS resultado
FROM
    descontos_taxas as dt
WHERE
    YEAR(dt.data_criacao) = 2014 and MONTH(dt.data_criacao) = 04
GROUP BY
    dt.cliente, DATE_FORMAT(data_criado, "%d/%m/%Y")
ORDER BY
    data_criado asc
HAVING
    resultado < 0;

Não testei a consulta, é apenas um direcionamento.
Comment: @ErlonCharles Isso não bate com o que você disse na pergunta. Você pode editar a pergunta para esclarecer? E Arivan, considerando o texto da pergunta neste momento, parece que você só esqueceu de agrupar também por cliente.
Comment: Além da data preciso também listar apenas os valores negativos (referentes a desconto)
Comment: @bfavaretto o último paragrafo diz isso "Como retornar apenas os valores negativos do resultado da soma entre taxas e descontos aplicados ao mesmo cliente no mesmo dia?"
Comment: @ErlonCharles Então acho que é só trocar `DAY(data_criacao)` por `data_criacao` nesta resposta e você consegue o resultado que quer.
Comment: isso a diferença é com agrupamento
Comment: O agrupamento não pode ser feito apenas por "data_criacao", pois ele pode ser um datetime. Pra assegura, melhor usar um DATE_FORMAT() :-).

Somar valores de resultados no mysql


Error while wrting data into file using Applescript

Question: am using the below script for writing the file, but sometimes am getting errors like mentioned below, pls suggest..
set filepath to POSIX path of "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
try
    tell application "System Events"
        if file filepath exists then
            set myFile to open for access file filepath with write permission
            set fileData to read myFile
            set eof myFile to 0
            write "blah blah" to myFile
            close access myFile
        else
            return "File Not Found"
        end if
    end tell
on error
    return false
end try

Error:
 "Network file permission error." number -5000 from file "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"

Also some times i will get this error, am unable to close the opened file
"File file Macintosh HD:Library:Application Support:Macromedia:mms.cfg is already open." number -49 from file "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"

When i tried to close the ofile am getting this eror:
on openAFile(filepath)
    try
        set fp to open for access filepath with write permission

    on error errstr number errNum
        if errNum = -49 then
            close access filepath
            set fp to open for access filepath with write permission
        else
            display dialog errstr
            return false
        end if
    end try

    return fp
end openAFile

set pointer to openAFile("Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
set fileContents to read pointer

Error
"Can't make \"Macintosh HD:Library:Application Support:Macromedia:mms.cfg\" into type file." number -1700 from "Macintosh HD:Library:Application Support:Macromedia:mms.cfg" to file

Answer: I cannot explain the "Network file permission error" that you are receiving.
The "File file Macintosh HD:Library:Application Support:Macromedia:mms.cfg is already open." error happens when you script stops in the Script Editor without closing the file.  This happens if there is some other logic error that prevents AppleScript from reaching the close access command in your on error block (or you press the Stop button at an inopportune time).  Apple's AppleScript Editor does not close leaked file references for you when a script stops.
Your workaround of trying to close the file before opening it may work, but you are passing a string rather than a file or alias for the filepath.  Use open for access file filepath and close access file filepath.
Comment: is their any way to solve the Network file permission error??


How do I get this very simple pageAction Chrome Extension ported to run on Firefox and Safari

Question: This is a very simple Chrome Extension that uses pageAction. It evaluates the current URL, places an icon in the address bar if the URL matches a condition (location, really) and changes the URL (using a bit from the original location) to a new location when the user clicks the icon.
This was simple and straightforward to build the Chrome Extension. The docs are simple and Google provide some code examples that could be adapted and built upon. Finally, the CWS is easy to deploy to and from.
However, I have no experience whatsoever trying to do the same in FF or Safari.
Can someone please give me some guidance with some code examples and packaging advice?
Thanks!
Background.js
function checkForValidUrl(d, c, e) {
    if (c.status === "loading") {
        var b = e.url.split("/")[2];
        var a = e.url.split("/")[3];
        if (b === "www.somewhere.com" && a === "unfiled") {
            chrome.pageAction.show(d)
        }
    }
}
chrome.tabs.onUpdated.addListener(checkForValidUrl);
chrome.pageAction.onClicked.addListener(function (b) {
    var a = b.url.split("/")[4].split("+").slice(0, 1);
    chrome.tabs.update(b.id, {
        url: "http://www.somewhere.com/filed/" + a
    })
});

Manifest
{
  "name": "MyExtension",
  "version": "1.0",
  "description": "This is nifty",
  "background": { "scripts": ["background.js"] },
  "page_action" :
  {
    "default_icon" : "icon-19.png",
    "default_title" : "Click to do your stuff"
  },
  "permissions" : [
    "tabs"
  ],
  "icons" : {
    "48" : "icon-48.png",
    "128" : "icon-128.png"
  },
  "manifest_version": 2
}

Answer: This answer is for Safari only.
For a Safari version of this extension, the raw materials you will need are:

a "global" HTML page (Safari's equivalent of a Chrome extension's background page)
a script that runs on the global page, provided either as an inline


How to disable onclick on whole row if user clicks on a collapse button on that row?

Question: How can I prevent that window.location from invoking after clicking on button?

    Toggle Button

        <button class="btn btn-link text-info" data-toggle="collapse" data-target="#firstname.lastname@example.com">
            Details
        </button>

            items
            items
            items

Comment: The best way to prevent `onclick` from invoking is to understand what exactly [onclick](https://www.w3schools.com/jsref/event_onclick.asp) do. If you need to invoke a website, use `click me`.
Comment: @hcheung - Except of course, you can't wrap a link around a table row. (In the general case, I strongly agree that using links rather than faking them is better, though.)
Comment: @T.J.Crowder Right, but I'm not suggesting that.
Comment: @hcheung - You're suggesting having a link in one of the cells? Rather changes the UX (but improves accessibility, open in new window, ...). :-)
Comment: @T.J.Crowder Oh please, the OP not mentioned anything of UX, nor providing any JS code. I'm merely trying to provide a direction and hoping for some clarification on OP's clarification.
Comment: @T.J.Crowder my apology for misunderstood your intention and the signs at the end of your msgs.
Answer: The minimal-changes way would be this:

...which says that if the event passed through a button with a data-toggle attribute en route to the tr, you don't do anything, but if it did you do the window.location thing (note the fix on the string there).
But I wouldn't do it that way. I'd use a proper event handler, probably a delegated one of the table, and do the check in that event handler.
For instance:
theTable.addEventListener(function(e) {
    var tr = e.target.closest("tr");
    if (tr && this.contains(tr)) {
        var btn = e.target.closest("button[data-toggle]");
        if (!btn || !tr.contains(btn)) {
            window.location = "//www.google.com";
        }
    }
});

In both cases, the code makes use of Element#closest, which you may need to polyfill on outdated browsers.


SSH key based authentication working intermittently

Question: We have a dev server running jenkins with various jobs that run shell scripts that connect to our live server via SSH (using key-based authentication).
This doesn't seem to work reliably.
If I test the SSH connection on its own by logging in to the dev server as the "jenkins" user and then SSH'ing to the live server, the authentication works and logs me in without the password prompt.
If I run one of the jenkins jobs manually it works most of the time (although one failed this morning prompting me to write this ticket) but if I automate the job to run nightly it fails most of the time (I think it has worked once).
The point of failure each time is at the SSH connection:
> ssh -T nepton@xxx
> Permission denied, please try again.
> Permission denied, please try again.
> Permission denied (publickey,password).

Any help would be greatly appreciated as I'm completely stuck and Linux is definitely not my area of expertise.
Additional Information:

I generated the public key on Dev (whilst logged in as "jenkins" user) using:
ssh-keygen -t rsa
I copied the key to the live server using: ssh-copy-id -i ~/.ssh/id_rsa.pub nepton@xxx

Permissions of /var/lib/jenkins/.ssh/ on Dev are:
drwx------  2 jenkins jenkins 4096 Apr  4 13:31 .
drwxr-xr-x 13 jenkins jenkins 4096 Apr  4 13:38 ..
-rw-------  1 jenkins jenkins 1679 Apr  4 13:31 id_rsa
-rw-r--r--  1 jenkins jenkins  400 Apr  4 13:31 id_rsa.pub
-rw-r--r--  1 jenkins jenkins 1338 Apr  4 13:33 known_hosts

Permissions of /home/nepton/.ssh/ on the Live server are:
drwx------ 2 nepton nepton 4096 Mar 20 17:37 .
drwx------ 4 nepton nepton 4096 Apr  2 10:52 ..
-rw------- 1 nepton nepton 2005 Apr  8 10:23 authorized_keys
-rw-r--r-- 1 nepton nepton 1106 Apr  1 10:39 known_hosts

I'm running the latest LTS version of Ubuntu and the standard SSH package on both servers.

Debug information
ssh -v -T -i /var/lib/jenkins/.ssh/id_rsa nepton@xxx
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xxx [xx.xxx.xx.xxx] port 22.
debug1: Connection established.
debug1: identity file /var/lib/jenkins/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /var/lib/jenkins/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA xxx
debug1: Host 'xxx' is known and matches the ECDSA host key.
debug1: Found key in /var/lib/jenkins/.ssh/known_hosts:7
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /var/lib/jenkins/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).
Build step 'Execute shell' marked build as failure

Comment: Yeah, I've tripped over the accept server key (known hosts file) a few times in the past.
Comment: Could you check your server logs if you find something. DNS issue ?
Comment: Edit the scripts to use `ssh -v -T nepton@xxx`. That will give you a lot more information; add the output to your question.
Comment: Make sure you make the first connection logged in as jenkins, that way you can confirm the acceptance of the key.
Comment: @Dom I had a look in /var/log/syslog and /var/log/jenkins and found nothing useful
Comment: @JennyD Good idea, thanks. The automated script runs overnight so I will post the information tomorrow.
Comment: @NickW The connection works logged in as jenkins. I am wondering if the scheduled jenkins job uses the same user though, I'll add an "env" command to the script to see what it says.
Comment: @JennyD I've added the -v you suggested and put the dump in the original post. I think it's looking in the wrong place for the private key "Trying private key: /var/lib/jenkins/.ssh/id_dsa"
Comment: Also I can no longer type "ssh nepton@xxx" and connect to the Live server without the password, it's like it forgets the key overnight or something
Answer: As you say in comments, it's not using the key you want it to. You can point out the correct key like this:
ssh -T -i /path/to/real/id_rsa nepton@xxx

Comment: This worked the day I tried it but no longer works today. I have updated the debug information in my original post. Thanks.
Answer: I had this same issue and found a solution that may be related here. If the system you are attempting to SSH to is behind a load balancer (or something similar) it's possible that sometimes your SSH can succeed, and sometimes it will fail if the machines that are being load balanced do not have a shared home directory (or at least your .ssh information such as the public key).
From your side, it will look like you are logging into a single host, but actually it is intermittently a different actual host, which could explain this odd behavior.


Mathematics in French

Question: I am pretty good at Français. But I learned mathematics in English. Trying to translate mathematical statements from English to French can often be accompanied with many errors because the way mathematical statements are expressed is very different than the way usual statements in a particular language are expressed. Moreover, exact translation may often lead to errors.
For instance, one may be successful at finding the correct translation of "subset": "sub" is "sous" and "set" is "ensemble" $\rightarrow$ "sous-ensemble". However, if with the same logic, one wishes to translate "division ring", it would look like: "anneau de division", while the correct word for that is "un corps", which is totally unpredictable by the way.
What is the best way to learn French Mathematical words and expressions other than reading Wikipedia articles in "another language".
I thought about buying elementary school, high school and college level math books and read them as if I'm learning the concepts for the first time. This looks like a perfect plan from a pedagogic point of view, but it is very time-consuming.
Any suggestions? Perhaps people who had the same problem can tell me about some techniques which worked for them?
Thank you.
Answer: I would pick a (light, well depending on your level) French math book/paper and start reading it with this wonderful French mathematical glossary. Better yet, if the book (say Serre's) has an English version, you can cross check your progress with it.
Answer: As someone who studied math first in French then in English then in Chinese, I can say that mathematical language tends to be surprisingly uniform.  It helps to keep in mind that most mathematical terms are translations from other languages, and it's easier to make sense of differences in expression if one keeps in mind the origin of the term.  Your division ring example, for instance, in French is a direct translation of the original German term for field, with the idea of commutativity not strictly attached to the definition.  Even within the same language some terms will have different appellations, division ring and skew field for instance.
But to address what seems to be your question, how to learn domain-specific vocabulary and idiom without investing a lot of time into it, you essentially already know the answer and there really aren't any shortcuts to it.  You don't need to start with elementary math texts.  Pick a subject you've already studied and wish to review, find a book on that subject and read the definitions and proofs.  Elementary concepts will be used all throughout and can be learnt through context.  You can also make notes in Anki as you go along if you want a structured way to review what you've learnt.
It will likely take less time than you envision since English and French share a ridiculous amount of vocabulary and the formation of math terms is virtually analogous.  Even in Chinese where there are no Latin borrowings whatsoever, math terms are still remarkably similar and are easy to learn through context.  Take some time to review math texts in French or study new material in French and you'll pick it up fairly quickly.

Mathematics in French


iOS 8: unicode of death, how does it work?

Question: Once sent by message to an iPhone, the victim's device will turn off. (I was skeptical about it but I tried it and the code worked.)
This is the an image of the message from Cult of Mac:

Can someone tell me how does it work and why?
Comment: You fool, you just opened the doors of Minas-Morghûl! We're all doomed!
Comment: It's not malware. It's just a bug in the unicode encoding. But this is off-topic.
Comment: See [Cult of Mac](http://www.cultofmac.com/323949/unicode-of-death-got-you-down-heres-how-to-fix-it/) for details.
Comment: what are the outcomes? @Huey
Comment: this doesn't work anymore.
Answer: Dont give me credits for the answer, see the source from where I got the info at the bottom.
From I what have read, basically happens at machine code, there is a Null value pointer validation on a OS X base library that renders text, which by the the way of the unicode characters are ordered (not completly sure), the pointer ends up containing a low address out of the boundaries of the application, which causes the OS or kernel to detect the exeption and terminating the process that was trying to render the text.
Check the source that I have read for a more detailed answer:http://www.theregister.co.uk/2015/05/27/text_message_unicode_ios_osx_vulnerability/
Also, something similar happened at 2013. If you are also interested on the previous issue, see this small article: http://m.hexus.net/tech/news/software/59497-simple-arabic-text-string-instantly-crashes-os-x-108-ios-6-apps/


How to use "IS NULL" and "IS NOT NULL" Operators in JSON API Collections?

Question: I am creating an API with Conditions and Operators. For '=' and '<>' operators its working fine. But for "IS NULL" and "IS NOT NULL" operators the response is 400: Bad Request.
{{URL}}/jsonapi/node/CONTENT_TYPE?filter[filter1][condition][path]=TAXONOMY_FIELD.drupal_internal__tid&filter[filter1][condition][value]={{TID}}&filter[filter1][condition][operator]=IS NULL

Request:

Response:
The error says: Filters using the 'IS NULL' operator should not provide a value.

Should the operators be encoded ? If yes, then which encoding should be used and what is the encoded string for these operators ?
Comment: Paameters are correct , I think the path which you have given is wrong.Also why you are not giving tid value directly ?
Answer: You don't need this line, because value is supposed to be null
&filter[filter1][condition][value]={{TID}}


React Native Integration with Android Pay(android) and Apple Pay(iOS)

Question: There is no official documentation around Android and Apple Pay integration with RN.
Some of the libraries that are present are not been up to date. I'm afraid those will fail with RN 0.61.
Any leads/suggestions on how to go about:

integrating Android and Apple Pay with RN 0.61
handling cancellations/refunds under a certain time limit.
Answer: ive used react-native-iap library to implement the in -app purchases i.e android and apple pay integration. It's pretty easy. Just follow the article and voila, it will be done.
RN-IAP
Below is the package of library ive used.
rn-iap-library
Hope it helps, feel free for doubts.
Comment: For anybody looking into this in 2023 - The iOS implementation in rn-iap-library uses StoreKit under the hood which differs from PassKit, the underlying API for Apple Pay. If you want Apple Pay, you won't get it with rn-iap-library.