What does play with feeling mean?

Question: When I used to take music exams I'd pass them but it often says "could have played with more feeling".
Now, I played all the notes in the right order. Made them louder when it says ff. And quieter when it says pp. Faster when it says fast and slow when it says slow. And it sounded pretty nice to me.
Thefore I was following exactly what was written.
Now when I see people play instruments with "feeling" I see them do all sorts of things like being expressive with their arms and swaying. (Think of a concert pianist). But none of which has any affect on the sound.
So my only conclusion is that they didn't want me to play what was on the page. (Like my music teachers taught me to do and didn't tell me otherwise). But put in my own interpretation of when to get loud and when to speed up and slow down. But then surely I would fail my exam for reading the music wrong? (I guess it is subjective on which examiner you get.)
I don't believe in something called "putting feeling" into music. There is only musical technique. You can feel what you like in your head but it is the technique which makes the sound come out of the instrument.
What do you think? How do you achieve (or fake) this?
Comment: Listening to someone who plays from the heart is rather different from listening to someone who plays *exactly* what's on the page. It is indeed almost intangiable, and very difficut to quantify, but nevertheless it exists. Somewhat like someone who reads from a book, and someone who is a raconteur - you know which it is. It's the *human touch*. And, yes,it can and does have an effect on the sound - whatever one plays.
Comment: A friend of mine used to say... "An electric guitar is played with your hands...and with your balls". I thinks that extends to every musical instrument.
Comment: Two things arise in my mind, if you don't feel music, why did you choose to play to start with? (I bet you feel something, maybe you just don't realize what) Music is really about emotion, joy, sadness, even more trivial things as "motivation" (dance music). Second, don't fake it. It will be felt by people. If for you music is like an informatic program to follow, that can be fine, for example some metal musicians perform like this. Being expressive with your arms is because you're "inside" what you do, not the other way round. Don't analyze to create feelings, focus on your emotions instead..
Comment: https://www.reddit.com/r/Guitar/comments/1sp1ab/how_to_play_with_feeling_or_emotion/
Comment: You seem to be a musical behaviorist.
Comment: The things people are saying aren't wrong, but I wouldn't be surprised if watching someone move their arms around influences your perception of the music.
Comment: It's like hearing an audiobook read by a good voice actor, vs reading an audiobook read by machine (or a bad actor). The text they are reading may be exactly the same story, but a good actor would add their interpretations to the text, resulting in a totally different experience than just reading what's written down. Music sheet only approximates the sound that the music should sounds like, just like a novel only approximates how you should play out the scenes in your head (or out loud, for voice actors).
Comment: I can't tell if your question is about how you could have done better on a test in the past, or if you now want to learn how to play with feeling... even though you don't believe in it.
Comment: One thing to consider is that your teachers will have heard the music you're playing **time after time after time**. They're so familiar with it that a perfectly executed song produces no excitement from them. If you do make some small, novel subtle changes, timing variations, different emphases and such, this will pique your teachers' interest.
Comment: If "following exactly what was written" is all that is required, why couldn't we just replace you with a machine? What is a human in the loop for at all?
Comment: > *it often says "could have played with more feeling"*   Grader is a rock/blues guitarist, that's all. You know the how many of them does it take to screw in a light bulb joke, right? One to do it and twelve others to say they could have done it faster or with more feeling.
Comment: One day I came back mad from school and had a music lesson right away. My music teacher told me it was the first time she actually heard me *play music*. This is not restricted to being angry though, it just happened that it actually helped me letting flow my feelings into my music. I know my music sounds different when I'm sad, angry or joyfull, without it being outside from what's written on the sheet
Comment: If you don't have feelings, it's hard to play with them.  You at least have to *understand* feelings and how they relate to music.  If you're the type of person who doesn't have much for feelings, the understanding of them can come with time and maturity if you make an honest effort to do so.  If you end up stuck in a Vulcan-like mindset that stubbornly condescends feelings, though, then you probably won't succeed.  Maybe stick to baroque instead.
Comment: You might want to reconsider if you really were playing "exactly what was written". Many musical pieces consist of the notation _and_ instructions about how to _interpret_ the notation such as "Rubato" (free in tempo), "Espressivo" (expressively), "Alla Marcia" (in the style of a march) etc. If you don't follow these instructions, which indicate the "feeling" of the music, you aren't playing it exactly as written.
Comment: Find a feeling and play with it, of course :)
Comment: Even if it seems irrelevant in principle to you, I think it would be interesting if the question said what instrument you were playing.
Comment: What does "pretty nice" mean?
Answer:
So my only conclusion is that they didn't want me to play what was on the page.

Correct.
Standard notation is very flexible, but it often only allows for an approximation of how the piece might be expected to sound. What you may need to do is put in very slight timing and dynamics variations that, if notated accurately, would make the page a hideous mess of tied notes and accent markings.
Try to work out what genre/style the piece is (or what styles it alludes to), and listen to renditions of pieces in that style to work out exactly how the notes are being subtly shifted and accented. Some styles might need you to slightly delay the eighths or sixteenths. Some styles might require you to accent different beats in a way that isn't obvious from the time signature. Some styles might require some sections to be played in quite free time, getting away from the 'grid' implied by the time signature. Or you might have a slightly extended rest between phrases. And so on and so forth.
You're right, of course, that "play with feeling" on its own doesn't give you enough information to tell you what to do. You need to be familiar with the style in order to understand what's expected and appropriate. To an extent, this is where the 'feeling' comes in - if you enjoy and are 'into' a style, you're more likely to understand exactly what timing and accenting variations are right for the style.
But when it comes down to it, it's not really about 'feeling' at all. A good session musician will be able to look at a part that they think is thoroughly boring, and still play it 'with feeling' - because they understand the style.
Comment: @zooby Classical music teachers almost always focus on technique, and traditionally *aim for* synthesiser-like accuracy. It's notable that improvisation isn't any part of the classical syllabus until grade 8, for most systems. Compare this to grades for electric guitar or drumming, where improvisation is taught from the start. Playing with feeling as Topo describes is a form of improvisation, and it needs to be practised. Try listening to some folk fiddle players and playing yourself - the tunes are simple, giving the players (who have great technique BTW) a framework for playing around.
Comment: @zooby some musicians who are familiar with a limited range of styles of music may not actually *know* exactly what they are doing to achieve a certain 'feel', even though they may be doing so very successfully. Unfortunately this probably includes some teachers!
Comment: OK this answer makes the most sense to me. Funny how my music teachers never told me this!
Comment: It's like in other forms of art such as painting or drawing or writing.  You need instructors to first teach you the rules so you understand why and how to break the rules.  It can be hard to comprehend as a student because the great works of art in any of these areas are made by people who seemingly break all the rules you are learning.
Comment: Good answer. I think of printed music as a set of constraints.  What is and is not notated shows what must and must not (by implication) be played - but the player is free to shift any and all variables as far as possible without breaking what's written.  I.e. between mf and f there is room to play softer or louder, while still remaining firmly in that band of volumes.  A given tempo can vary by a couple bpm and nobody will be the wiser.  Many pieces don't even give a numeric tempo so there's even more room to bend it.  Intonation can be adjusted (on many instruments) to change timbre or mood.
Comment: @Graham that's just not true. Every good classical teacher will also teach "feeling" aspects of the music. Not improvisation, no, but _interpretation_, which unlike you say is _not_ considered a form of improvisation. And maybe it's not in focus in the first couple of years, because on most classical instruments there is a certain minimum of technique before it makes sense to go into this, but eventually it'll sure enough come up. — Of course, some teachers may never get to that point, either because they're themselves not on that musical level or the students are unmotivated. Thus my "good".
Comment: @zooby - Music teachers have to work to time restraints as much as anything. Possibly you weren't at the point of adding that aspect to your pieces at the time of the exam. It is the 'icing on the cake' and the 'cherry on the top'. Getting the notes right is more important. No-one can *play with feeling* if they can't even get the notes right. Start preparing earlier for the next one, to add 'feelings' into the performance!
Comment: @leftaroundabout I did say "traditionally". Things are getting better. :) Interpretation and improvisation *are* closely linked though - you can interpret a bit differently if you feel differently at that point, and conversely much "improvisation" actually doesn't vary much on the night (rock guitar solos, for instance). I do think interpretation is the gateway to improvisation, getting you used to being in that moment. As you say, it comes up eventually, but it's much further down the line.
Answer:
I don't believe in something called "putting feeling" into music.

Can you tell the difference between a human and a midi sequencer performing the same piece? Yes, of course you can.  The difference is feeling.**
Allow me to elaborate.  If you were to program the score into a midi sequencer, meticulously following all dynamic (via velocity), articulation (via duration and velocity), and tempo markings, you'd end up with a midi performance which does "what is on the page" by following these instructions. Despite following the same set of instructions, this midi performance can still be differentiated from a human performance because the human will be adding extra detailing and shaping to their performance, thereby imbuing it with an emotional quality which cannot be strictly notated, ie this elusive "feeling". There is an emotional meta-layer to the human's performance which the sequencer's performance lacks.
This "feeling" is achieved by varying the envelopes of the various parameters of sound, such as by adding vibrato, pushing or pulling the tempo, or by shaping each note dynamically.  To a certain extend, a human will do this naturally without thinking, but a big part of your job as a performer is knowing when and how much. This is where interpretation comes in.  You need to see through the limitations of notation and identify what the composer is trying to convey, and then fill in the gap. (As an aside, a skilled composer will make this easier for you.)
(Yes, this extra detail can be added to a midi performance, either by simply "recording" a human's performance or through meticulous editing, but that is not what I'm talking about.)

my only conclusion is that they didn't want me to play what was on the
  page

You are supposed to play what is on the score, but you're supposed to play more than that.  Musical notation has its limitations.  Your job as a performer is to interpret the score and turn it into an emotionally compelling series of sounds.  You will not fail your exam unless you grossly misinterpret the score and the composer's intent.  This expectation of interpretation isn't obvious to english speakers because 'performer' and 'interpreter' generally mean different things.  But in other languages (I'm thinking Romantic languages specifically) 'performer' and 'interpreter' are in fact one word.
So, if an adjudicator has told you to "play with more feeling", what they're saying is that your performance sounded mechanical, perhaps technically correct or skillfully executed, but no more than that.  You did not 'breath life' into the piece.  You didn't 'sell it'.  It's hard to explain this without using fluffy metaphorical terms.
Perhaps the problem is that you're too focused on the technical execution, which isn't leaving enough processing power for interpretation.  You should know your material so well that you don't need to think about it at all.
An anecdote: When I studied classical guitar in university, I learned a piece which was call "tears", but in a language I didn't know so I didn't get the obvious suggestion from the title.  Just like you, I played all the right notes in the right order at the notated tempos and durations, but my teacher kept telling me that the feeling was wrong.  After spending most of an hour-long lesson playing the piece over and over, with seemingly no progress, I was visibly frustrated and demoralized.  Finally, he sang the piece to me, using his voice to convey the feeling that my performance lacked.  It seemed exaggerated to me at first, but suddenly I could hear how the music was heaving and sobbing, dripping with sadness.  The feeling was visceral.  Then I played it again, aping his expressiveness, and instantly it was better.  He sang along with me and it got better still.  I continued to practice it this way and soon I could perform with convincing feeling.  You need to do this with each and every piece you learn.  Get inside it, see what the composer is trying to convey, and then bring that out by exaggerating certain aspects of your performance.  Tastefully.
Comment: Slight quibble: MIDI sequencers sound different from humans, but that's due to a large number of factors, some of which are not entirely due to the human execution of the inputs.
Comment: This answer seems only comprehensible to people who already understand what "playing with feeling" means. It seems too vague and circular to be much help to anyone who doesn't. It doesn't seem to have any additional informational content beyond what little "with feeling" already conveys; it's mostly rephrasing, restating, and using equally-vague substitute terms.
Comment: @user45266 We know what the answer is getting at here - if not MIDI, consider [Compressorhead](https://en.wikipedia.org/wiki/Compressorhead), or a player piano, organ grinder, etc.
Comment: @user45266 No examples? If a midi file contains all the dynamics and tempo markings that are found on a score, and is played back with world-class samples, it will sound just like a human performer minus the feeling. Alternatively, how about a diskavier? No samples required.
Comment: @user45266 can you give an example?
Comment: Piano is one of the few instruments that can be quite perfectly recorded and reproduced as a MIDI sequence.
Comment: To echo the sentiments displayed here, "Playing with feeling" is where you a) know the tune so well you don't need the music, and b) when you allow yourself to go off-script a little, it's _where_ you put the vibrato, the crescendo and the diminuendo. Once you know a piece to a certain level, when it's automatic, allow yourself to feel the things the piece is conveying, and 'mix that in'.
Comment: @ibonyun *"minus the feeling"* I think that's what I'm saying.
Comment: @J... I thought of the player piano too, but as someone who had a relative with one of those, that isn't quite right. Player pianos are more like playing a recording of a performance, but using a live piano to do so.
Comment: @T.E.D. of course MIDI Sequencers can do that too - If you record into them with 'feeling', they'll play back with 'feeling'. It's only when you program/play in something with inappropriate timing that it will play back with inappropriate timing.
Comment: The old player piano my relative had would also work the pedals, so it was a hair more than just notes and timing. They were also sort of an analog recording scheme. But to attempt to drag this back on-topic, yes in as much as MIDI sequencers play back more than just frequencies and timings, that also would be more than the OQ said they were doing perfectly.
Comment: @user45266 So why the "quibble"?  It sounds like you're agreeing with my premise.
Comment: @user45266 can you give an example of one of the "large number of factors" which are not "due to the human execution of the inputs" which makes a MIDI sequencer sound different to humans?
Comment: @ibonyun I do in fact agree, I just wanted to point out that one little bit of information. As one example, sequencers have perfect rhythm, where humans are inaccurate to a small extent. Another thing is that humans playing real pianos have different timbres than MIDI sequencers; even something as inconsequential as the sound of fingers striking the keys may affect perception of the performance.
Comment: @user45266 Most DAWs (which are sequencers) allow you to "humanize" your performance, which involves adding subtle random offsets to the rhythm and/or velocity domains.  While it sounds less mechanical, it still doesn't really sound human, because humans are actually quite awful at creating randomness.  You can also control for differences in timbre by making the human play a synthesizer, or by playing back the midi with realistic samples (although good modern samples usually come with human expressiveness baked in).
Comment: I have edited and expanded my answer to address concerns raised in the comments.
Answer: Have you ever seen a bad actor perform?  Someone who has memorized all of their lines and goes through the appropriate motions on stage, but you just don't feel anything from their performance?
Imagine taking a script from a play showing a highly emotional scene -- say, an argument, or a romantic scene.  Now imagine reading all of the lines in a monotone -- you observe all the commas and periods and pronounce every word clearly with good diction, but otherwise you put no rises or falls in your voice, no subtle changes in speed or inflection.  You read just like a robot.  But, you follow the script meticulously.  When you see a stage direction -- "(turn to her)" or "(puts arm around him)" or "(points at her)" -- you perform the action requested, but do so deliberately and mechanically, as a robot might.
Would this be a good performance of that emotional scene?  Probably not.  A script for a play simply can't contain all the details necessary to bring the words to life.  There are the words, and punctuation, and suggestions like stage directions, but the details need to be filled in by an actor to transform the blueprint on the page into a living, breathing human performance.
That's exactly like a musical score.  The notes on a page are not "music," even though we often call them that.  They are a blueprint, just like a script to a play.  Yes, you need to play the right notes.  Yes, you need to hold them the correct durations.  Yes, when the score says to play louder or softer, you should do so.  But doing all that correctly can still be like the robotic monotone reading of a script.  Maybe you hold some notes a couple milliseconds longer and others a couple milliseconds shorter.  (This is called microtiming, and recent studies show skilled performers make a lot of such miniscule adjustments, even as they are "playing what's on the page.")  Maybe when it says to get louder, you create a phrase by gradually emphasizing certain notes.  Maybe, depending on your instrument, you make subtle changes in timbre or tone or articulation at moments that enhance the performance.
Suddenly a string of 4 bars of individual notes becomes a phrase.  16 bars of individual notes are shaped into a theme.  It's no longer a robotic monotone execution of the script, but a living romantic scene, or an intense argument, or whatever.
You seem to think that you need to gesticulate wildly or move your body around to show "feeling."  But you said, "think of a concert pianist," and the first person I always think of is Vladimir Horowitz.  There is someone who played with intense "feeling," but his head and shoulders and torso would be very quiet and at ease, while his hands were flying around the keyboard doing the most amazing things.  He wasn't a showy performer like some pianists, but his interpretations brought the music to life.  For music, it is about the sound and the technique -- you don't need to flap your arms around or rock about like you're in some sort of religious ecstasy.  But producing a good sound and good technique in a musical performance is more than simply playing "what's on the page."
Take note of that last sentence.  What your judges in your exams were really telling you is that you weren't playing musically.  Music is about creating a flowing experience in time, about connecting notes and phrases and themes, about sensing a coherent interpretation that transforms the "script" into the "romantic scene."  But saying you weren't playing "musically" is vague and perhaps insulting.  So people talk about playing "with feeling," because the process of interpretation for music is much like telling the actor who is reading the script during the love scene that it needs to be performed with more sense of emotion/feeling.  It needs to be acted, to be interpreted, to have a sense of more than just a collection of words -- to feel like a scene.
A piece of music is the same.  Some performers literally do experience intense emotions and feelings as they perform, which help them to interpret music.  Others recognize the subtle interpretive decisions necessary to bring the music "to life" even without invoking emotions in themselves.  Just like different kinds of actors -- some who really want to feel and inhabit the character they are portraying, while others are bit more "distanced" about their roles -- there are different kinds of performers.  If flapping your arms around helps you to "feel" the piece start to come together, maybe you do that.  Some performers find that helpful; others don't.
But the point is transforming the musical "script" on the page into the nuanced, musical experience of sound moving through time.  The notation is only a rough blueprint, an approximation, a starting point.  Like an actor, you need to figure out how to "bring it to life."
Comment: This is a cool analogy. I think what OP should take from this however is what topo Reinstate Monica's answer details: that the actor's script simply doesn't have enough information as to how to deliver the lines. If the actor's script were detailed enough, the brainless actor could deliver a performance with "feeling". But the scripts aren't detailed enough, so it's the actor's job to interpret its intricacies.
Comment: I was hoping someone would use that analogy :-)  Good actors don't think only about the words they're saying, but also about the _meaning_ behind them: they're trying to convey what the character's thinking and feeling, and that affects how they deliver the lines.  Music doesn't usually have the same sort of meaning, of course, but the principle is similar.  Different styles/genres/periods expect more or less blatant expression, but a good performance will always be about more than just the notes.
Comment: This is appropriate analogy and it shows how vain is "play with feeling" in music. Just like a bad actor has a crappy execution, bad musician does the same.
Comment: Upvoted for the "bad actor" analogy.
Answer: If you want the nuts and bolts of it, expressivity in music is probably boiled down to variations in the amplitude, timbre (how hard/soft you're hitting the strings, though this is obviously mingled with amplitude) of each note, and the time you put in between each note. Vary those and you'll have more expressive music.
To put it in terms of playing "from the heart", take a song or piece of music. I find this much easier to do with classical pieces. Then, play through it a few times. Try to get a sense of the emotion the music is portraying. Are some parts happy? Are some parts sad? Are some parts suspenseful, surprising, or somewhere in between? How do you express that? You could get louder and brighter at the happy parts, and softer and more quiet at the sad parts. You could slow down the notes of the sad part slightly, or speed up the happy part. You could do a dramatic shift in your amplitude from low to high to express 'surprise!' or 'intense!'. You could also go from high to low, to express 'sorrow', or 'shock'.
Timing is immensely important as well. As a processor of music, your brain does many things while a melody is playing. The important one to note here, is that every brain has a tendency to try to predict a pattern in music, and expect certain notes to follow others. Have you ever played through a scale and left out the last note, or the last two notes? Try it now. Feel the sense of anxiety, the tenseness your body feels when those notes are unfinished. These are feelings you can evoke in your listener. Start a phrase, but end it slightly later than you've been ending others. Your listener will feel anxious, but you'll resolve that anxiety for them in a second. Or you won't. Maybe leave it hanging in the air, just like what you were trying to express with your lyrics. Maybe bring it on at a speed that's faster than the listener expected. That'll provoke an emotion too, maybe surprise, or unease, or even satisfaction.
When people say you're playing with emotion, they really mean you're playing with their emotions as well. You're evoking emotional responses beyond the notes in the scale. You're varying timbre, timing, and amplitude to elicit feelings that a guitar playing machine, for example, could not. To make it clearer, play with some variation that humans can put into it, and not just the notes that a music box could play just as well.
Furthermore;
You have to get to the point where you're not thinking about playing the song. If you're having to say "Ok, I go to the 5th fret after this ..." etc., then you can't play with emotion.
Once all the technical aspects are on auto-pilot, and you can play the arrangement without having to think "that complicated bridge comes after this ..." and play every part without having to count anything, then your brain will be able to simply focus on how you play something, it will focus on *expression." Am I playing this aggressively, softly, am I holding this note longer than usual, bending it at an interesting spot because that's what I'm feeling at this exact moment, etc.
You'll probably start out by thinking about how to play it with emotion, which still doesn't put you where you want to be, but it's kind of what you have to do. Eventually, once you play it enough times, and have the rhythm count stamped into your brain, and a pool of "ways to express" this part and that part, your brain will pull from them automatically based on how your feeling, or how you want to convey something in a particular moment ... and it will be able to do it naturally.
source: reddit
Answer:
it sounded pretty nice to me.

...

I don't believe in something called "putting feeling" into music.

Bzzzt! Self-contradiction detected. ;) "It sounded nice" is a description of a feeling. What other feelings might there be, besides "nice"? Have you ever heard music that's ... passionate? Threatening? Sad? Irritating? Hopeful? Miserable?
However, there's something you haven't understood yet (assuming that you aren't just trolling). Music is performed in order to deliver feelings to people. It's essentially acting, like in a theater or movie. If you just read text from a script mechanically, you're being a lousy actor and story teller, even if you are able to speak louder when you see an exclamation mark! The movie's director and producer should demand better and maybe fire you and hire a proper actor.
Playing written music, particularly if you're the soloist, is supposed to work like this:

(1) read a segment
(2) interpret what you read, so that you're able to imagine some feelings and a "plot", i.e. you have an idea what the story is about and what the segment could be in the big picture
(3) act according to your interpretation, delivering the feelings to your listeners

All three parts are separate skills, and you can be good in each one, or you can suck at it. For example you might be a bad reader - but that can be compensated by improvising. Make up your own details, something that you can say and deliver in a credible way. Good actors can do this - they might know that they can't make the written lines sound credible, so they improvise something different than what's literally in the script. An illiterate actor might do that just because they can't read. ;) Or maybe they don't remember the exact details. You have many degrees of freedom. You could, for example, try and deliver unexpected feelings. If a well-known piece is always made joyful, can you play the same but so that it becomes sad instead?

How do you achieve (or fake) this?

Do you feel things strongly and emotionally? Is there music that makes you emotional when listening to it? Do you know a song that makes you feel like crying or jumping for joy? If this is a completely foreign idea to you, then maybe it's just your personality, and it's perfectly OK to be that way. People are different! I wouldn't claim that anyone can even learn to do it, just like some people cannot pretend or act in a credible way even if they try.
If you do know songs or musical performances that make you emotional, try to recreate the musical elements that affect your feelings. There are many musical parameters and dimensions - pitch, tone/timbre, timing/tempo, dynamic variation, phrasing, legato/staccato, overall "arcs" of these, repetitiveness vs. change, expectations vs surprise, ... The things that can be written in notation like "loud" or "softly" are really coarse and approximate.
You could also ask your teacher to guide you in things you find challenging. Ask your teacher to provide recordings of performances of the same piece, but with more "feeling". Compare with your own playing. If you disagree about there being any more feeling, then you can just say that in your opinion the example recording is not more emotional. And then you just agree to disagree.
Being able to feel and induce emotions in other people is a part of the art, and even though one could say that it's a part of someone's personality, it is still something that is expected and judged.
Comment: There's no contradiction there. The fact that someone experiences emotion when listening to music or has an opinion about whether it sounds nice does not imply that emotion was involved in the music's performance. I think MIDI playback sounds nice, but the synthesizer definitely isn't putting any emotions into it.
Comment: Getting emotion *out of* a piece of music does not mean that its performer put any *in*.
Answer: There are great answers in this topic. Here is some more input:

So my only conclusion is that they didn't want me to play what was on the page.

Oh yes, you can play what is on the page, but a forte section or a piano section is not just about playing all the notes at an equal volume in that section.
Focus on phrasing. Like you can go up and down in volume within a piano section, but you are still playing an overall piano and similar with forte and other dynamics. You can sometimes make a slight increase or decrease in tempo, it can be quite subtle, the overal tempo is still intact.
Sing or hum the melodic lines because then you can directly feel the melody, then play similar to the way you sing or hum.
Phrasing includes articulation, like you can play a staccato very pointy or less pointy. Or you can play some notes a tad longer or shorter than other notes meaning releasing the key sooner or later unless they are supposed to be played legato of course.
Just like you can utter a word or a sentence in a lot of different ways you can also play in a lot of different ways and yet play what is written in the sheet music.
You can play a piano section in a similar way you would pat a cat, softly and gently and there you are already playing with feeling.
You can play so it feels like a thunderstorm, of course only if the music is in a style that would give inspiration for that. It might give a better forte expression if you feel it is like a thunderstorm instead of just thinking about a dry forte.
So work with phrasing, get the hang of phrasing or the feel of phrasing and include some metaphors now and then, like the metaphors I mentioned above (patting the cat and the thunderstorm) and you might discover a new and fantastic dimension and experience of music.
Answer: Watch the first five minutes of this demo by Evelyn Glennie of the difference between "reading the music and doing what it says" and "interpreting the music". There's not much "being expressive with her arms and swaying" involved.
If you still don't "get" the difference, watch it again.
The following 30 minutes are also well worth watching, of course
Comment: Well exactly what I mean. She is kind of moving her body around like an expressive dance. Which I contend you could get exactly the same sounds by not doing that.
Comment: I think you should watch it again and _not look_. Just listen to the difference. The dynamic of the crescendo as she moved out on the rim was much larger in the second performance, for instance. Yes, it takes a greater physicality to get that difference! The performance on the marimba is also illustrative. Again. Don't _look_. _Listen_ to the subtle changes in tempo and emphasis and phrasing.
Comment: @zooby - You probably know how much easier something is to 'visualise' with your eyes shut. Try *listening* to the music instead of watching the video. Alternatively compare a boring lecturer to one who is animated - both saying exactly the same thing.
Comment: @zooby - if you can play 'with feeling' without *feeling* it, then you're a musical prodigy. As a drummer that had to use all four limbs separately, why would I be bobbing and swinging my head around as a fifth thing to do if it didn't help me *feel* the rhythm? Which was important because I have zero classical training.
Answer: I have been in similar situations in my youth, competing in state wide music competitions, and performing at gigs.  In my opinion this is a hard thing to get right because it is not a quality of you and your playing only, but a quality of the relationship between you and the audience.
For the moment let's not discuss what "feeling" really means.
I choose to play a certain way. A way that makes me feel good as a performer.  I play the music the way I want (sometimes exactly as written). I play the same way in every performance (at least I think I do). There will be times when the audience is completely drawn in by my playing and I get complements on how much "feeling" I project in the music and other times I get the comment or reaction that I play robotically and have no feeling.  When I was younger it killed me, especially  since I was trying to get placed in division 1 or pass an audition and I couldn't tell what I was doing wrong (or what I was doing RIGHT).  At this point in my life I don't care and I am convinced that this is a subjective assessment that cannot be quantified, and is sometimes used as an excuse to put players in the pass or fail (good or bad) bucket based on whether or not the listener "likes" them.  In other words, like I stated before, I think it is about the relationship between the player and the listener and not a thing that any player can replicate for every audience member.  There are many players who are constantly put on a pedestal as being great performers and always playing with "feeling" yet they put me to sleep, I hear nothing great and feel absolutely nothing when they play.  The opposite occurs too, players who are criticized as not having feeling make me feel!  I think it's more on the listener than the player to feel.  It is possible that a listener is in a bad mood and simply not open to feeling what the player is trying to project.
Now on to the issue of "feeling".  There are several aspects of music performance that can be used to translate feeling to an audience.  Several have already been mentioned like dynamics, tempo, etc.  But as you pointed out these are indicated in the sheet music.  So, in theory if you played the music as written the intended feeling would be there.  One way performers project feeling is via body movement and facial expressions.  I personally find this very distracting and frankly fake.  I'd equate it to being "affected" which is usually a bad thing, like over acting.  Music is aural and I listen with my eyes closed, even at a live performance.  So the wild body movement and contorted facial expressions are lost on me.  I would stay away from a Gestalt approach to describing this as I do not believe is such things.  It is possible that this is quantifiable (even thought I indicated otherwise above) but it may be too difficult to quantify as there are too many variables.  One thing I see mentioned in answer related to timber.  Volume and speed are both part of feeling or help create feeling but the way you attack an instrument changes the harmonic content of the notes.  Also, vibrato is very important on instrument that are capable of creating it.  On the violin and guitar families of instruments this is one of the most effective ways of adding more feeling to a tune.  This device is indicated in the sheet music too but players often add more as they "feel" the need.  And when you add vibrato you add the ability to change the speed and force of the vibrato and that really opens up the door to a many variations on tone and sound.  Of course it could be overdone and I cannot cite a formula for perfect vibrato.  I am not sure how a piano player could emulate this.  Based on these comments I would say that I agree with some of the other answers in that you are not expected to play down the sheet music exactly as written but you are expected to apply techniques that help project an interpretation of what is written and that is perceived as feeling.
As a final note I doubt that even a well trained musician could tell the difference between a human player and a very well designed computer simulation that used AI to emulate all these subtle features of a player's technique.  In other words "feeling" in music, in the traditional sense, may be slightly a case of self delusion.
Answer: I think many beginner musicians struggle with this issue, myself included.
The point is, music is an art, and art is a form of communication, a form of expression. We need a way to share music, so we've came up with this music notation, which is interesting in  its own regard, but is not enough to convey emotion, and conveying emotion is the very point of the art.
But what this emotion mean for music is very hard to pinpoint. A much simpler example is in theater. Pick any play, let's say Hamlet, and give it a read. Loudly. You can try learning a passage and saying. You might actually start to believe what's there or not, but you probably look to others like you simply recite something (unless you have some theatrical skills, case in which I recommend you to ask a friend's help for this experiment). The very point of training for actors is to learn to convey credible feelings along with the words they say. And the director needs to make sure everything comes together nicely.
Coming back to music, simply producing correctly every note on the music sheet is not enough. Actually, it might very well be the case that it doesn't really convey much emotion, just as simply reading correctly Hamlet does not make you an actor. You need to act, you need to add emotion to those notes, just how actors add emotion to their words.
Answer: I hope you're not a troll :trollface:.
You just can't play music without feeling .. maybe your teacher wanted you to play more involved into the piece (not mechanically stumping on and pressing buttons like a robot or a bored student).
Your feeling is your internal state and it can be conducted via the activity you perform, especially like playing music.
Music is all about feeling, so when you play music you always feel something and it is better to be constructive with this at least regarding to the piece you play.
Answer: Simply put, it means to improvise rather than to play plainly according to the notation.
"Feel" is really a subjective concept. What might make me cry might bore the hell out of someone else.
For example, consider a simple (yet beautiful) piece like I Giorni by Einaudi. The tune is really simple and even an amateur can play it; however, there would be a huge difference between an amateur version and a professional version. The former would be more mechanical. (This is considering that a given version of the notation doesn't have enough dynamics and other changes marked in it for someone to consider it to have enough "feel".)
In Einaudi's (or a professional) version, however, there would be some added effects - like slowing down at some parts, playing some notes soft and some hard, playing staccato somewhere, etc.
Note: I AM NOT SAYING that it's not possible to strictly follow the notation and have some feel to the music (as ggcg has been implying in the comments) but I think it goes without saying that when someone is seeking more feel than the dynamics of the notation can produce, it calls for improvisation.
There's a superb TED talk given by Benjamin Zander on classical music. At one part of the video, he explains the difference between an amateur playing a classical piece and a pro doing the same. This illustrates my answer to some extent, and might be worth checking out:
The transformative power of classical music (why classical music is for everyone)
Comment: @ggcg I was exploring this old answer and the comment thread and realised that back then I failed to word my thoughts properly: my point was that feel is quite subjective (which I failed to mention before) and if someone is looking for more feel than the notation can produce then there's no option but to get creative. Contrary to what a previous comment might suggest, I wasn't actually trying to define feel as something objective, rather I was talking about what it means in the context of this post.
Comment: Though this is a nice example it doesn't really address the question.  For example if the changes in tempo are added in the score will it still have "feeling" when played?
Comment: @ggcg I'm obviously talking about changing the tempo when not written in the notation.
Comment: That doesn't address the case where it is.  What I mean is that if the tempo and dynamics changes are written (which the OP indicated) is that enough to produce "feeling" or is more than the written instructions required?
Comment: @ggcg If the changes were to be made just as in the notation, then I think the whole point of the discussion is rendered void. I think I've pretty much established that feeling means to improvise and add other dynamics that aren't in the notation.
Comment: Then it also seems that you are saying that the written music cannot ever have feeling when played, i.e. w/o "improv".  I respectfully disagree.
Comment: @ggcg the standard notation doesn't allow to specify enough precise detail to annotate that feeling. E.g. a simple 4/4 rock drum pattern would need many notes offset from the "ideal" timing by some milliseconds to have a proper "groove", and the intensity of sequential non-accented hits should be slightly (non-arbitrarily!) different for each note. Things like MIDI can (try to, roughly) annotate this, but a standard notation score-sheet, no matter how detailed, won't (and can't) specify all the detail *for every single note separately*, and that's what's required to have proper "feeling".
Comment: That assumes 4/4 has no feeling.   Yet it does.
Answer: A music is a sentence of notes.
If you were to give a presentation would you let Siri or Alexa read the words instead of you?
What is on the page is the language part ... the CONVENTIONAL part ... the letters, words, phrases and sentences of music.
How that music gets interpreted and expressed by the player is the meaning part ... the EXISTENTIAL part.
Comment: I think this answer is hinting at what I'm also thinking, but presented in a somewhat superficial way. If you were to delve into how music is an artistic expression, and how it, as an art, derives its artistic value from two separate entities (the composer and the performer), you could easily improve this answer by explaining how a bland (or even machine-driven performance) leaves out "half of the art" of the musical piece.
Comment: I'm curious to know what description of  "artistic value" or number of examples changes the (superficial) distinction I made?  Are you thinking simple equals superficial? ... like saying E=mc^2 isn't important because it's needs only a half-dozen characters instead of pages of equations.
Comment: For the record, I did not downvote you. I'm merely holding onto my upvote until the answer is more fleshed out. To answer your comment: while saying E=mc^2 is beautiful in its brevity, it's also a meaningless answer to somebody who asks "What is the relationship between Energy and Mass?" -- its the pages of equations and exposition describing the theory of Special Relativity that somebody who is asking such a question would want. OP is asking "what is playing with feeling" and your answer is a very brief one that makes sense only to those who already know what playing with feeling is IMO.
Comment: If someone asks me "What is the relationship between Energy and Mass?" my reply is that they be more specific because they may indeed just want the equation. If they said "Explain the relationship..." then they're more clearly asking for narrative.

You say you want a longer answer. Why? What's not clear about my brief one? What point did another longer answer make that mine did not?

What does play with feeling mean?


Criando um retorno linq com uma sublista

Question: Estou tentando escrever uma query em linq para resolver o seguinte problema:
Eu tenho uma Lista Alunos que tenho os dados dos alunos como Id, Nome, Matricula, cpf...
Em outra entidade tenho as notas onde esta o AlunoId, MateriaId, Nota...
quero um retorno onde a entidade retorne:
Nome,
Matricula,
Cpf,
Notas  <- Lista de notas
E que consiga fazer filtros no conjunto como retornar os alunos que tiveram notas abaixo de 7.
No entity montei
var query = contexto.Aluno
            .Include(i => i.Notas)
            .Select( s => new { s.Nome, s.Matricula, s.Cpf, s.Notas})
            .AsQueryable();

// O que estou tentando fazer algo como:
**query = query.Where(q => q.Notas.Where(qq => qq.Nota < 7))**

Se eu trazer as notas fora da lista consigo realizar o filtro, porém o nome, matricula, cpf se repetem. Agora desta forma que está o select não consegui realizar o filtro.
var query = from aluno in contexto.Aluno
            join nota in contexto.Nota  on aluno.Id equals nota.AlunoId
            where (nota.Nota < 7)
            select new { aluno.Nome, aluno.Matricula, aluno.Cpf, **s.Notas** }

Existe alguma forma?
Answer: Lembrando que, dentro da sua model, você precisa ter uma propriedade de uma lista para este seu objeto (Nota), algo como:
public List<Nota> Notas { get; set; }

Tente assim:
var query = (from aluno in contexto.Aluno
            join nota in contexto.Nota on aluno.Id equals nota.AlunoId
            where (nota.Nota < 7)
            select new { aluno, nota }).ToList();

return query.Select(x=>x.aluno);


Arquivo POM.xml do Maven iniciando com erro no Eclipse

Question: Olá, sou novo no mundo Java e tenho enfrentado diversos problemas para criar um projeto Maven com o eclipse. Abaixo, colocarei o erro, seguido do meu arquivo Maven e a descrição das tecnologias que estou usando e o que já tentei fazer:
Erro: Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer (aparece assim que crio o projeto)
Maven:
<code><project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
    child.project.url.inherit.append.path="">
    <modelVersion>4.0.0</modelVersion>
    <groupId>br.com</groupId>
    <artifactId>helloWord</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <project.build.sourceEncoding>
            UTF-8
        </project.build.sourceEncoding>
    </properties>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

</code>
IDE: Eclipse EE Version: 2021-03 (4.19.0)
JRE 1.8 (Também tentei usando a 16 default do meu sistema)
Linux Fedora 32
Não instalei o Maven na minha máquina, somente instalei o eclipse e comecei a usar.
Já tentei:
Trocar a versão do JRE;
Criar outro projeto;
Reinstalar o eclipse algumas veze;
Apagar o diretório .me2 com os plugins do Maven para ele recriá-lo
Estou lendo a documentação mas não consigo resolver isso. Alguém pode, por favor, me ajudar?
Answer: Tente o seguinte, baseado na documentação.
No POM.xml dentro de properties, adicione:
<code>    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</code>
Já no plugin, deixe apenas:
<code>        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
        </plugin>
</code>
Ficaria:
<code>... trecho anterior ...

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
            </plugin>
        </plugins>
    </build>

... trecho seguinte ...
</code>
Answer: Para resolver este erro adicione a propriedade abaixo no final de eclipse.ini e reinicie o eclipse:

--illegal-access=permit

Após isso se persistir o erro faça "Close Project" e em seguida "Open Project" no projeto desejado.


Describe using polar coordinates the contour line of $f(x,y)=\frac{2xy}{x^2+y^2}$

Question: Describe using polar coordinates the contour line of $f(x,y)=\frac{2xy}{x^2+y^2}$ for $(x,y) \neq (0,0)$ and $0$ if $(x,y)=(0,0)$
I did $\frac{2xy}{x^2+y^2}=k$ the contour line
then $\frac{2(r \cos\theta)(r \sin\theta)}{r^2  \left(cos^2(\theta)+\sin^2(\theta)\right)}=2 \cos\theta \cdot \sin \theta=k$ is the countourr line in polar coordinates is right?
Comment: why $\cos^2 * \sin^2$ in the denominator, it should be plus..
Comment: @GCab yes, sorry it was a typo
Answer: Correct. Equivalent forms such as $\sin2\theta=k$ may also be useful.


Question related to Graph isomorphism.

Question: Determine whether the given pair of graphs is isomorphic with reasoning.
My try:1st pair is isomorphic but not second pair .
Comment: Where's the reasoning?
Comment: For 1st pair there are 7 vertices with degree 2 and for an edge between two vertices there also  exist an image edge.
Comment: That would also be true of a graph with four vertices in a square and three in a triangle, no? (It's not clear what you mean by,"for an edge between two vertices also an image edge.")
Comment: For 2nd pair they also have 7 vertices with each has degree 2 but there is an edge between $u_1 $ and $u_2$ but not between $v_1$ and $v_4$.
Comment: How many components does a(left) have? How many does a(right)?
Comment: 7 components each
Comment: :) I meant https://en.wikipedia.org/wiki/Connected_component_(graph_theory) not vertices...
Answer: The graphs in the first pair are isomorphic because there is a one-one correspondence between the vertices that induces a one-one coreespondence on the edges: $u_1\leftrightarrow v_1$, $u_2\leftrightarrow v_3$, $u_3\leftrightarrow v_5$, $u_4\leftrightarrow v_7$, $u_5\leftrightarrow v_2$, $u_6\leftrightarrow v_4$, $u_7\leftrightarrow v_6$.
The graphs in the second pair are not isomorphic because the first graph has a vertex, $u_3$, of degree three adjacent to two vertices, $u_2$ and $u_5$, of degree two, while the second graph has no such vertex.

Question related to Graph isomorphism.


Question about stability of a nonlinear dynamical system

Question: Let $A(x) \in \mathbb{R}^{n\times n}$ with $x(t) \in \mathbb{R}^{n\times 1}$, $B(x) \in \mathbb{R}^{n \times m}$ $m \leq n$ and $F \in \mathbb{R^{m\times 1}}$ I have the following dynamical nonlinear system:
$$ A(x) \ddot{x} = B(x) F$$
Let $k(x) \in \mathbb{R}^+$ be such that $-k(x)\mathbb{I} + A(x)$ has negative eigenvalues.
The above system can be written:
$$ \left(-k(x)\mathbb{I} + A(x)\right) \ddot{x} - \dot{x} + k(x) \ddot{x} + \dot{x} - B(x) F = 0$$   My question regards the following observation:
The dynamical system
$$ \left( -k(x) \mathbb{I} + A(x)\right) \ddot{x} - \dot{x} = 0$$ is asymptotically stable ($\dot{x},\ddot{x} \to 0$), because the system matrix is Hurwitz.
If also a control $F = F(x,\dot{x})$ is found such that
$$ k(x) \ddot{x} + \dot{x} - B(x) F(x,\dot{x}) = 0$$ is stable ($\dot{x} \to 0$ and $\ddot{x} \to 0$).
Can I somehow prove that the above system is stable with $F(x,\dot{x})$ control law?
Answer: Consider a simple (linear) counterexample, take $A(x)=a> 0,k(x)=k\in \mathbb{R}^+,B(x)=b\neq 0,F(x,\dot{x})=f\dot{x}$, all scalars, but further assume no signs. It follows from $\ddot{x}=(-k+a)^{-1}\dot{x}$ that for stability we want $k>a$. Then over to the next equation, we have
\begin{equation}
\ddot{x} = \frac{bf-1}{k}\dot{x},
\end{equation}
so for stability we want $(bf-1)/k<0$. Since $k\in \mathbb{R}^+$ we can for example take $f:=\frac{1}{b}(1-\varepsilon)$, $1\gg\varepsilon>0$. Then finally consider your system $\ddot{x}=(bf/a) \dot{x}$, plug in $f$ and get
\begin{equation}
\ddot{x} = \frac{1-\varepsilon}{a}\dot{x},
\end{equation}
which is definitely not stable.
So finding an $F(x,\dot{x})$ which stabilizes your second equation is not sufficient. Which intuitively makes sense since both equations contain $(x,\dot{x},\ddot{x})$, so approaching them separately is rather difficult.
Comment: Thank you for your work sir! Indeed this seems to be the case. I will accept your answer! But I am wondering what other conditions are necessary to have stability of the whole system ... In the example you've provided, if one taker $f\cdot b < 0$ then the systems are stable separately  and also together ...
Comment: Yes, it would be interesting to see what the minimal set of constraints/assumptions is to make this work!


OAuth: Client revoking access of several access tokens

Question: Suppose I am a client application and I request resource owners to share their resources using Authorization servers(and resource servers) like Facebook and Google. Lets assume that some of my access tokens were compromised. In that case, Can I request Facebook or Google to revoke all those tokens?
(I already know that tokens are short lived. But can we revoke access. I tried looking it up on Facebook developer section/ Stack Overflow and did not stumble upon anything on this)
Answer: Access tokens are short lived normally an hour.  There is an expiration within the access token
<code>{
  "nbf": 1528875493,
  "exp": 1528875793,
   .......
}
</code>
Exp tells you when the access token will expire.  The are not actually stored on the servers anywhere. So no there is no way for Facebook or Google to revoke an access token.    because access tokens are short lived it is assumed that they are reasonably secure because if someone does get a hold of your access token there is a very limited amount of time where they can use it.


geolocalização quero pegar dados do java script e passar para um hidden

Question: veja o codigo a baixo queria pegar as 2 infomações em passar para uma variavel ou para um input.

Clique no botão para receber sua localização em Latitude e Longitude:

<button onchange="getLocation()" onclick="getLocation()">Clique Aqui</button>

Answer: Para realizar o desejado, você deve colocar 2 inputs hidden no seu html e depois adicionar o código abaixo dentro da função showPosition dessa maneira:

Clique no botão para receber sua localização em Latitude e Longitude:

<button onchange="getLocation()" onclick="getLocation()">Clique Aqui</button>

<input type="hidden" id="latitude">
<input type="hidden" id="longitude">

Comment: mais os 2 inputs estao sem value nao retorna nada.
Comment: @RomarioOliveira mesmo depois de passar pela função no javascript seus inputs tem value vazio??? Você tem certeza de que o script está chegando dentro do `showPosition`?
Comment: sim estou passando em Metho POST
Comment: resolvido funcionou obrigado deste ja
Comment: Tranquilo @RooOliveira feliz em ter ajudado, se puder marcar a resposta como respota correta :)
Answer: Eu sugiro que você use o document.getElementById, você cria um input com o tipo hidden e com algum id, por exemplo:
<input type="hidden" id="latitude" name="latitude">
<input type="hidden" id="longitude" name="longitude">

Agora, depois de usar sua função, você seta o dado pra dentro desse input, seria algo assim:
if (navigator.geolocation) {
    // essa successFunction vai receber os dados da posição
    navigator.geolocation.getCurrentPosition(successFunction, errorFunction);
}

function successFunction(position) {
    var lat = position.coords.latitude;
    var lng = position.coords.longitude;
    document.getElementById("latitude").value = lat;
    document.getElementById("longitude").value = lng;
}

Agora é só colocar esses inputs dentro de um form e enviar para o PHP. Sugiro usar um ajax ou axios da vida para enviar para o PHP


Ratio of area slices under an exponential function

Question: I am trying to prove this:

I started by defining $A$ and $B$. Since $A$ is the area under $f(x)$ from $n$ to $n-1$:
$$A = \int^n_{n-1} a^x \, dx \\= \frac{a^n}{\ln(a)} - \frac{a^{n-1}}{\ln(a)}$$
and since $B$ is the area from $n-1$ to $n-2$:
$$B = \int^{n-1}_{n-2} a^x \, dx \\= \frac{a^{n-1}}{\ln(a)} - \frac{a^{n-2}}{\ln(a)}$$
so:
\begin{align}
\frac{A}{B} & = \frac{\frac{a^n}{\ln(a)} - \frac{a^{n-1}}{\ln(a)}}{\frac{a^{n-1}}{\ln(a)} - \frac{a^{n-2}}{\ln(a)}}\\[10pt]
& = \left(\frac{a^n - a^{n-1}}{\ln(a)}\right)\left(\frac{\ln(a)}{a^{n-1} - a^{n-2}}\right)\\[10pt]
&=\frac{a^n - a^{n-1}}{a^{n-1} - a^{n-2}}\\[10pt]
&=\frac{a(a^{n-1} - a^{n-2})}{(a^{n-1} - a^{n-2})}\\[10pt]
& = a
\end{align}
so:
$$\frac{A}{B} = a$$
Is this proof correct?
Comment: It seems to be correct.
Comment: Yes. It's neat. If a criticism is badly needed, then I would just point out that you need to mention: $a > 0$ and $a \neq 1$, and $n > 1$.
Answer: It is correct but it's overkill in that it can be done without finding the antiderivative:
\begin{align}
A = \int_{n-1}^n a^x\,dx = a\int_{n-1}^n a^{x-1}\,dx = a\int_{n-2}^{n-1} a^w\,dw = aB.
\end{align}
Here we have $w=x-1$, so that $dw=dx$ and as $x$ goes from $n-1$ to $n$, then $w$ goes from $n-2$ to $n-1$.
Answer: Yes, your proof is correct.
Also note the following:
$$f(n)-f(n-1)=a^{n-1}(a-1)$$
$$f(n-1)-f(n-2)=a^{n-2}(a-1)$$
$$\therefore\dfrac{f(n)-f(n-1)}{f(n-1)-f(n-2)}=a$$


Confused with local effectiveness of etale equivalence relations

Question: Knutson's Algebraic Spaces book have the following two theorems (we assume that $R\rightarrow U\times U$ is quasi-compact in the following Props):

Let $R\rightarrow U\times U$ be an etale equivalence relation where both map $R\rightarrow U\times U\rightarrow U$ are finite (we take the projections here) and $U$ is affine. Then the equivalence relation is effective.
Let $U_I$ be a Zariski open covering of $U$ and for each $i\in I$ let $R_i\rightarrow U_i\times U_i$ be the induced equivalence relation. Then if each $R_i\rightarrow U_i\times U_i$ is effective, so is $R\rightarrow U\times U$.

This seems to imply that if $R\rightarrow U\times U\rightarrow U$ is finite then it is effective. Is this true?
Answer: No, it is not true.
The reason is that you can't always apply (2) to reduce to the situation of (1).
The basic example is as follows: if $G$ is a finite group acting freely on a variety $X$ (over $\mathbb C$, say), and if the orbit of each (closed) point is
contained in an affine open subvariety, then the quotient variety $X/G$ exists.
But if the condition on orbits doesn't hold, then the quotient variety
won't exist (and there is a famous example of Hironaka illustrating this).

In terms of etale equivalence relations, we are considering the equivalence relation $G \times X \hookrightarrow X \times X$, where $(g,x) \mapsto (x,gx)$.
The argument you have in mind is that you want to reduce to the situation of (1) to get an effective equiv. rel'n, by applying (2).  But to apply (2) in this context, amounts to being able to find an affine open cover $U_i$ of $X$ such that each $U_i$ is stable under the equivalence relation.  (In particular, I think your phrasing of (2) is a little off, and this may be a source of the confusion: in general, if we take a random open cover of $X$, the equivalence relation $R$ won't restrict to an equivalence relation on each $U_i$, because the individual $U_i$ won't contain the full equivalence class of each of their points; so to be able to form $R_i$ as an equivalence relation on $U_i$, you need the additional hypothesis that each $U_i$ is indeed closed under formation of equivalence relations, or equivalently, that the pull-back of $R$ from $U \times U$ to $U_i \times U$ actually lies in $U_i \times U_i$, so that it defines an equivalence relation $R_i$ on $U_i$.)

If $X$ is a quasi-projective variety, then any finite set is contained in an affine open subset, and by a little extra argument, one can show that actually each $G$-orbit is contained in a $G$-invariant affine open subset of $X$.  Thus (2) applies, and we may form $X/G$.  (I've discussed this here, for example).
But there are non-quasi-projective varieties containing finite sets that don't lie in any single affine open, and then the above argument does not apply.  Indeed, as I mentioned, there is an example due to Hironaka of a group $G$ of order $2$ acting on a proper (non-projective variety) $X$ such that $X/G$ does not exist as a variety.
Indeed, this was one of Artin's motivations for introducing algebraic spaces: Hironaka's example shows that the Hilbert "scheme" of $X$ need not exist as a scheme when $X$ is not projective, but Artin showed that it does exist as an algebraic space.
Comment: Thanks for the answer. There is always an induced equivalence relation for $U\rightarrow X$, namely I take $S=R\times_{X\times X}(U\times U)$. In the book there is no additional assumption for Prop 2. The example you gave is exactly why I am very confused.
Comment: @Marci: Dear Marci, If $U_i$ is an open cover of $X$, and you form the $R_i$ according to your formula for $S$, then you typically can't recover $R$ from the $R_i$ (because under the $R_i$, the equivalence classes are being forced to be contained in individual $U_i$'s, whereas this just may not be true for $R$).  Related to this, the projection $R_i \to U_i$ will typically not be finite, even if the projection $R \to U$ is.  Regards,
Comment: @Marci: P.S. Just rereading your statement of (2), I guess the result will be true *if* we assume that $R$ is glued from the $R_i$.  Certainly if we start with compatible $R_i$, we can glue them to get an $R$.  But if we start with $R$, then form the $R_i$, and then glue them to get $R'$, there will be an inclusion $R' \subset R$ which is typically a proper inclusion (i.e. typically *not* an equality).  Regards,
Comment: Dear Matt, can you give me an example which shows that $R_i\rightarrow U_i$ is not finite but $R\rightarrow U$ is?


Using 9v 2000mA power supply for pedal using low current

Question: I have Mooer 9V 2000mA power supply and pedals, such as MXR Carbon Copy requiring 26mA at 9V or EHX Pog Nano requiring 25mA at 9VDC. Is it safe to use this power supply with these pedals? Is it safe to use this power supply with these power supplies simultaneously (fx using Mooer Daisy Chain)?
Comment: See also: https://music.stackexchange.com/questions/38697/how-to-choose-a-guitar-pedal-power-supply?rq=1
Answer: If the voltage rating is correct, it is perfectly safe to use a power supply with a higher current rating than you need. The pedals will only take as much current as they actually use.
Of course an over-rated supply may be bigger, heavier, etc, which might make it less convenient to carry around, but it will work just fine.
Comment: Another reason for using more expensive power supplies is that some of them provide much better filtering of 50/60Hz hum than cheaper supplies. Cheap switchmode supplies can also insert a lot of higher frequency buzz into the audio chain, which isn't ideal.
Comment: @MaksimSorokin That's a bit of a separate question but the short answer is that the overall voltage and current rating of a power supply is **not** the only important aspects of that power supply. For example, the Voodoo Labs Pedal Power supplies feature transformer isolated outputs, which is more expensive to manufacture and offers different advantages and disadvantages.
Comment: Thanks for the swift supply. But then I do not understand, why everyone is using super-expensive power supplies for their pedal boards. If I have 5 pedal, each requiring 9V and say 100mA, can I use a single power supply (such as abovementioned Mooer 9V 2000mA) to charge them all? It costs 10 times less then a regular pedal board power supply with multiple outputs (e.g. Cioks).
Comment: Also keep in mind that if something goes wrong with a higher than specification supply it can probably fry and cook your pedals much better. Thus it is advisable to place a fuse of required strength in line when using overkill. A 5 cent fuse can save a $500 pedal easy.
Comment: Also, bad things might happen if one pedal connects the negative side of the power supply to audio ground and another pedal connects the positive side of the power supply to audio ground.
Comment: The hum is likely to be 100Hz/120Hz as power supplies delivering higher currents would most likely use full wave rectification.  Earthing one side of the 9V DC or allowing both +ve and -ve sides to float together is important in stage set-ups where different power supplies and earths have the potential to interact in a range of technical ways.  Solving these problems under time pressure of a gig without electrocuting a band member is what the sound engineer gets paid for.
Answer: If the supply has a voltage regulator it is safe, and store-bought power supplies usually do (and I'd guess this one does). However, some cheap power supplies (mostly ones that come with a particular piece of equipment) depend on the resistance of whatever you're plugging into it to regulate the voltage, so connecting a device with lower current draw could cause the supply to produce considerably more than 9 volts. I fried a scan converter this way once.
See also (emphasis mine):

For example, a regulated power supply is one that maintains constant output voltage or current despite variations in load current or input voltage. Conversely, the output of an unregulated power supply can change significantly when its input voltage or load current changes."
Answer: Your power supply should deliver 9v to all of your pedals. The only thing you should worry about is overloading the power supply. If the sum of all your 9v pedal's current ratings exceeds 2000 mA, then you could have a problem. It doesn't sound like you will ever have that problem. At 25 mA per pedal, you would have to try to power 80 pedals to reach 2000 mA (2 amps).
If you tried to use your 9v power supply with a pedal with a different voltage rating, that would be bad.
Answer: If you are using the same power supply (which doesn't provide several potential-separated outputs) with several pedals simultaneously, you get ground loops.  It depends on the overall size of your setup and the magnetic fields in its placements whether this will or will not buy you significant levels of hum.


Simulate Ctrl-C keyboard interrupt in Python while working in Linux

Question: I am working on some scripts (in the company I work in) that are loaded/unloaded into hypervisors to fire a piece of code when an event occurs. The only way to actually unload a script is to hit Ctrl-C. I am writing a function in Python that automates the process
As soon as it sees the string "done" in the output of the program, it should kill the vprobe.
I am using subprocess.Popen to execute the command:
lineList = buff.readlines()
cmd = "vprobe /vprobe/myhello.emt"
p = subprocess.Popen(args = cmd, shell=True,stdout = buff, universal_newlines = True,preexec_fn=os.setsid)
while not re.search("done",lineList[-1]):
        print "waiting"
os.kill(p.pid,signal.CTRL_C_EVENT)

As you can see, I am writing the output in buff file descriptor opened in read+write mode. I check the last line; if it has 'done', I kill it. Unfortunately, the CTRL_C_EVENT is only valid for Windows.
What can I do for Linux?
Comment: FYI: `re.search` with a constant string can be better expressed as `while 'done' not in lineList[-1]: ...`
Answer: I think you can just send the Linux equivalent, signal.SIGINT (the interrupt signal).
(Edit: I used to have something here discouraging the use of this strategy for controlling subprocesses, but on more careful reading it sounds like you've already decided you need control-C in this specific case...  So, SIGINT should do it.)
Comment: Well, if it works on Windows, then hopefully that means the signal is going to the right place.  So, try something stronger.  Give SIGTERM a try, and if that doesn't work, SIGKLL.  If SIGKILL doesn't work, then nothing will -- you'll have to look at different ways of handling the subprocess altogether.
Comment: hey Andrew. Thanks for the answer. But actually, the SIGINT kills only the subprocess function while the vprobe continues it's execution.Do you have an idea of how to kill that too? Thanks
Comment: Did you try `Popen(['vprobe ', '/vprobe/myhello.emt'], shell=False, ...)`? @Core_Dumped
Answer: Maybe I misunderstand something, but the way you do it it is difficult to get the desired result.
Whatever buff is, you query it first, then use it in the context of Popen() and then you hope that by maciv lineList fills itself up.
What you probably want is something like
logfile = open("mylogfile", "a")
p = subprocess.Popen(['vprobe', '/vprobe/myhello.emt'], stdout=subprocess.PIPE,  buff, universal_newlines=True, preexec_fn=os.setsid)
for line in p.stdout:
    logfile.write(line)
    if re.search("done", line):
        break
    print "waiting"
os.kill(p.pid, signal.CTRL_C_EVENT)

This gives you a pipe end fed by your vprobe script which you can read out linewise and act appropriately upon the found output.
Comment: This is almost exactly what I want to do,except that I want the output to get printed in some file as well (along with getting into the PIPE for checking purposes). How can I do that? (I hope I am grammatically correct this time :))
Comment: The above code seems well and good but when I use the stdout as an attribute of the object p, it gives me Broken PIPE error.
Comment: @Core_Dumped Where exactly do you get that? At the sending side (in `vprobe`), or in your own program?
Comment: cmd = "/sbin/vprobe /vprobe/myhello.emt"
p = subprocess.Popen(args = cmd, shell = True, stdout=subprocess.PIPE, preexec_fn=os.setsid)
print p.stdout

gives:

', mode 'rb' at 0xffd36758>
vprobe: [Errno 32] Broken pipe
Comment: This is clear. You don't read the `p.stdout` as provided in my answer, and when the reading side of the pipe dies, `vprobe` gets a `SIGPIPE`. You should do as written in my answer.
Comment: let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/18456/discussion-between-core-dumped-and-glglgl)
Answer: In Linux, Ctrl-C keyboard interrupt can be sent programmatically to a process using Popen.send_signal(signal.SIGINT) function. For example
import subprocess
import signal

..
process = subprocess.Popen(..)
..
process.send_signal(signal.SIGINT)
..

Don't use Popen.communicate() for blocking commands..


Gödel's Incompleteness Theorem - follow up question

Question: I recently rewatched the great video that Numberphile created about Gödel's Incompleteness Theorem (https://www.youtube.com/watch?v=O4ndIDcDSGc) and I had a follow up question of similar nature. It essentially addresses the objective truth of a statement, outside of whatever system we impose to try and prove it. So, is it true that "every true statement can be proven true in SOME system"? Or on the other hand, do there exist statements that can never be proven true no matter what system is used, aside from paradoxes.
I'm a junior studying mathematics and physics so feel free to be somewhat technical in responses :) Thanks!
Edit: let's assume that the statement isn't an axiom and can't just be made one
Comment: @Minnella In that case you need to make the question more precise - part of the issue is exactly pinning down what this should mean.
Comment: Not taking it as an axiom is not a reasonable restriction.  Instead of taking it as an axiom, take the conjunction of it with something else.  Or take a couple axioms that allow you to derive it.  As long as the statement is not self-contradictory, there is a system it is derivable in.  Also, what do you mean for a statement to be true?  You seem to think that has meaning independent of the axioms you are using.
Comment: We can always just assume the statement as an axiom, so your question taken literally has an easy but boring answer. But there's not nothing there. This issue is subtle and just as much about philosophy as math. See for instance http://logic.harvard.edu/koellner/QAU_reprint.pdf
Comment: How about we say for the sake of this question, in the system, the statement hasn't been taken as an axiom. This is a great point though thank you for pointing this out!
Comment: @RossMillikan Even if it is self-contradictory there are systems that will derive it  :)
Comment: @spaceisdarkgreen: True enough, though any system that will derive it will derive anything else, obviously.  Perhaps not what the OP had in mind. :-)
Comment: Numberphile is well-known by mathematicians to be full of junk. Best not to attempt to learn anything from there unless you want to fill your head with junk that is hard to clean out later.
Answer:
So, is it true that "every true statement can be proven true in SOME system"?

Yes, at least under intuitionistic logic or any extension of it, including classical logic:
Let $\phi$ be our statement. Let $T$ be any theory such that
\begin{align}
T &\vdash \bot && \text{$T$ is inconsistent}
\end{align}
By explosion, $T \vdash \phi$.

Fine, let's assume $\neg (T \vdash \bot)$. You say

let's assume that the statement isn't an axiom and can't just be made one.

Let $T$ be any theory such that
\begin{align}
\neg (T \vdash \neg \phi) && \text{$T$ is consistent with $\phi$}
\end{align}
Let $\psi$ be any statement such that
\begin{align}
T \vdash \psi && \text{$\psi$ is a theorem of $T$} \\
\neg(\vdash \psi \leftrightarrow \phi) && \text{$\psi$ is not tautologically equivalent to $\phi$}
\end{align}
Let
$$T' = T \cup \{\psi \rightarrow \phi\}$$
be $T$ with $\psi \rightarrow \phi$ added as an axiom. By modus ponens, $T' \vdash \phi$.
Comment: I think I follow, thanks!


How to get a specific string near a static text?

Question: I've a list of links that contains the id of a country, an example is this.
/national/italy/serie-a/20172018/regular-season/r42011/?ICID=PL_3N_01

essentially I need to get the number 42011 that is near the "r" character, unfortunately I'm not a regex expert so I need a bit help to achieve this target.
Comment: Please specify language in tags
Answer: You never told us what tool/language you are using, but the typical way you would use regex here would be to capture the r42011 term in a capture group.
The following pattern should work:
.*/(r[0-9]+)/.*

The r42011 term (or whatever variant might appear) will be available in the first capture group.  The coding/tool details again depend on what you are using, but hopefully this pattern sets you on the right track.
Demo


opengl es texture atlas for text

Question: I need help on understanding the workflow for rendering text in opengl es using a texture atlas. This is for an iphone game.
I've read this already:
Is there a decent OpenGL text drawing library for the iPhone SDK?
What tools do I use to generate the texture atlas image? Do I need freetype for this part? What file format should the image be?
In my iphone code...besides the texture atlas image, what else do I need to correctly render the text? Does freetype need to be included in my iphone source code? Am I generating an XML file with the glyph data as it relates to my texture atlas so that I don't have to load freetype into my iphone source code?
Answer: There are many ready solutions in open-source engines.
I use .fnt format. It has texture atlas with prerendered chars and configuration file with mapping info.
For example it is integrated in Cocos2d:

CCLabelBMFont - usage of .fnt fonts
GlyphDesigner.app - font creation tool (there is also free
Hiero tool, but it's buggy and simple)

opengl es texture atlas for text


Setting messages from classes in Drupal

Question: How do we set messages now in 8.x? Do we still use drupal_set_message? Not a fan of mixing procedural calls within classes if it can be avoided.
Comment: You could define/create your own service and put the drupal_set_message() inside of it.
Answer: Prior to 8.5.x, drupal_set_message is the way.
For >=8.5.0-alpha1, there's a new messenger service, with a note (and example which I won't bother copying):

The procedural functions drupal_set_message() and drupal_get_messages() have been deprecated and replaced with a dedicated Messenger service.
You should now inject this service as a dependency for your own services and controllers:
Answer: Interesting post by Clive, I didn't know about 8.5 having a new messaging service. That's great.
In the meantime, I add the call in a protected method of the class:
protected function sendMessage($message, $type = 'success') {
  drupal_set_message($message, $type);
}

While it is still calling a static function from a class, the advantage is that when doing unit tests, this method can be overridden, so that tests are not broken.

Setting messages from classes in Drupal


include only attributes of a record which are not null

Question: Dear people from stackoverflow
I'm currently working on a mechanism to export data out of a database. Every record  has roughly 30 attributes and I only want to export those attributes which do have an actual value.
If the explanation is not precise enough, here's an example:
+----+-----------+------------+---------+--------+
| ID | Name      | Profession | Country | Salary |
+----+-----------+------------+---------+--------+
| 1  | John Doe  | NULL       | USA     | 5000   |
+----+-----------+------------+---------+--------+
| 2  | Jane Doe  | Painter    | NULL    | NULL   |
+----+-----------+------------+---------+--------+
| 3  | Jonas Doe | Butcher    | England | 8000   |
+----+-----------+------------+---------+--------+

Expected outputs:
John Doe: John Doe, USA, 5000
Jane Doe: Jane Doe, Painter
Jonas Doe: Jonas Doe, Butcher, England, 8000

These outputs should be generated in an XML file.
This should be possible with every record in the database if possible.
I was looking for a function that would check if an attribute has a value and depending on that, adds it to the export file or not. Sadly I couldn't find anything like that.
Edit:
What i did until now is just writing the query to get all the possible attributes:
CREATE PROCEDURE export @id int AS
BEGIN
SELECT Name,Profession,Country,Salary FROM Employee
WHERE ID = @id;
END
GO

Comment: select   Name, concat(Name,',', Profession ,',', Country,',',Salary) from table
Comment: I was thinking about this too, but the export format should be in an xml format if possible... So i don't really know how to apply for that.
Comment: Then update your question to show what really are you after. You can simply add `FOR XML`.
Comment: you can convert comma separated value  to XML also but please post what you want...
Comment: Did so, thanks you very much. I'll give it a try and let you know how it worked out
Comment: by removing NULLs from your CSV, you are also losing the context of what the thing is - so it might become hard to know if a column referred to profession or country.  So if the entry was simply 'Chad' is he called Chad, or from the country Chad?
Answer: You can just select everything from the table you want, using FOR XML PATH.
WITH Employee (ID, [Name], Profession, Country, Salary) AS (
SELECT 1, 'John Doe', NULL, 'USA', 5000 UNION ALL
SELECT 2, 'Jane Doe', 'Painter', NULL, NULL UNION ALL
SELECT 3, 'Jonas Doe', 'Butcher', 'England', 8000
)

SELECT *
FROM Employee
FOR XML PATH

would return
<row>
  <ID>1</ID>
  <Name>John Doe</Name>
  <Country>USA</Country>
  <Salary>5000</Salary>
</row>
<row>
  <ID>2</ID>
  <Name>Jane Doe</Name>
  <Profession>Painter</Profession>
</row>
<row>
  <ID>3</ID>
  <Name>Jonas Doe</Name>
  <Profession>Butcher</Profession>
  <Country>England</Country>
  <Salary>8000</Salary>
</row>

EDIT
WITH Employee (ID, [Name], Profession, Country, Salary) AS (
SELECT 1, 'John Doe', NULL, 'USA', 5000 UNION ALL
SELECT 2, 'Jane Doe', 'Painter', NULL, NULL UNION ALL
SELECT 3, 'Jonas Doe', 'Butcher', 'England', 8000
)

SELECT ID, (SELECT * FROM Employee S WHERE S.ID = M.ID FOR XML PATH) [XML]
FROM Employee M

Would return a row per ID with it's XML data.
Comment: That seems pretty straight forward, but sadly I need to get a file per record. I appreciate your answer though! Thanks a lot!
Comment: @capojere You could generate a row per ID returning `XML` for each ID, which would at least provide you with the data needed to generate the files.


when i click on the p:selectBooleanCheckbox, it works but for the second click it doesn't work,why?

Question: I have a "p:selectBooleanCheckbox" in my xhtml page.
I have inserted this code selected="true" to make it checked by default.
SO when i run the page, and click for the first time it becames "unchecked" ,
but since then when i click on it it still unchecked , it doesn't change.
So to reseume =>my p:selectBooleanCheckbox is clickable just once after that when i click on it, it doesn't change (it still unchekeced)
this is the code in my xhtml page:

i'm using eclipse sts , and i run my application on InternetExplorer.
Comment: first of all edit your question to make it more confortable to read, after that give more detail about your problem like the output that you have after double click
Answer: <ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    xmlns:evoice="http://ccs.tn/taglib/evoice">
    <ui:include src="CloseTicketDialog.xhtml" />

                        <f:validateRegex pattern="[0-9\s]*" />
                        <f:validateLength minimum="8" maximum="32" />

                        <f:validateRegex pattern="[0-9]*" />

                        <f:selectItem itemLabel="Séléctionner Motif" itemValue="#{null}" noSelectionOption="true" itemDisabled="true"/>
                        <f:selectItems value="#{ticketSubjectLoV.subjects}" var="subject"
                            itemLabel="#{subject.subject}" itemValue="#{subject}" />

                        <f:selectItem itemLabel="" itemValue="#{null}" noSelectionOption="true" itemDisabled="true"/>
                        <f:selectItems value="#{storeLoV.stores}" var="store" itemLabel="#{store.name}" itemValue="#{store}" />

                        <f:selectItems value="#{ticketCategoryLOV.categories}"
                            var="category" itemValue="#{category}"
                            itemLabel="#{category.name}" />

                        <f:attribute name="collectionType" value="java.util.ArrayList" />

                                                #{cat.name}

                        <f:selectItem itemLabel="Séléctionner Sous Catégorie"
                            noSelectionOption="true" itemValue="#{null}" itemDisabled="true" />
                        <f:selectItems id="selectSubCategoryList"
                            value="#{ticketCategoryLOV.subCategories}" var="subCategory"
                            itemValue="#{subCategory}" itemLabel="#{subCategory.name}" />
                        <f:attribute name="collectionType" value="java.util.ArrayList" />

                                                #{subCat.name}

                        <f:selectItem itemLabel="#{i18n['no_response']}" itemValue="NA" />
                        <f:selectItem itemLabel="#{i18n['yes']}" itemValue="YES" />
                        <f:selectItem itemLabel="#{i18n['no']}" itemValue="NO" />

                        <f:validateLength minimum="15" maximum="15" />

                    <evoice:loyaltyCard ticket="#{ticketController.ticket}" />
                    <h:graphicImage name="#{jsfProp.img_png_cartefid}"
                        id="moreInfoPopup" onclick="PF('moreInfoDlg').show()"
                        styleClass="img-responsive" />

                        <f:selectItem itemLabel="Select Satisfaction" itemValue="${null}" />
                        <f:selectItems
                            value="#{satisfactionRatingLoV.openSatisfactionList}"
                            var="satisfaction" itemLabel="#{satisfaction.lookupValue}"
                            itemValue="#{satisfaction}" />

                        <h:outputText id="displayRemainingOpenCmnt" />

                        <f:param id="NotificationParam" name="mail_box_active_tab"
                            value="edit_notification_tab" />
                        <f:param id="NotificationTicketIdParam"
                            name="INIT_NOTIF_TICKET_ID_PARAM"
                            value="#{ticketController.ticket.ticketId}" />

</ui:composition>


execute the global variable generation part of a library in an executable project

Question: My application is consists of two projects which one of them create the executable file and the other generates the library that executable is going to use. I have tested the library before using some Main test. There are some global variable definitions in the library project which should be executed (to create some default options) before my executable project started to work. For example in my library project, I have code like this:
<code>const ifxFactoryProductInitializerNew<ifxComplexResultContainer, ifxResultContainer<1, ifxComplexVector3f> > fp_r1("1");
const ifxFactoryProductInitializerNew<ifxComplexResultContainer, ifxResultContainer<2, ifxComplexVector3f> > fp_r2("2");
const ifxFactoryProductInitializerNew<ifxComplexResultContainer, ifxResultContainer<3, ifxComplexVector3f> > fp_r3("3");
</code>
How can I use this library while the global part of it executes before my executable projects run?
Answer: As I look for it, it is not possible.
I have to put the global definitions in a function and call that function in the beginning of the executable project.


Only pass to then, if axios request is not cancelled?

Question: I have an axios call that I cancel, this is then caught using catch to display a message.
After this, I have chained a then(), but then() is called even if I cancel the request.
How can I make it so that then() is called only if the request is not cancelled?
Comment: Does your `catch` callback propagate the error? If not, of course the downstream `then` callback will be invoked.
Comment: Please provide a minimal code sample.
Comment: I think duplicate https://stackoverflow.com/questions/42013104/placement-of-catch-before-and-after-then
Answer: Your question is hard to answer without much context. But if I understand you correctly I think what you are looking for is to delay the axios request and wait a few seconds to ensure it hasn't been cancelled before sending the request. This is called a concurrency method. Using setTimeout() will wait a certain amount of time before running any code inside of it. It is also very good to ensure users do not spam requests to your end point and wait for the newest and most recent request and return that back (if you decide to wrap your whole request in a timeout):
return axios.get('your-end-point').then(response => setTimeout(response, 1000)));

Note: 1000 here is 1000 m/s. You can change this value to be longer or shorter depending on how long you wish to wait for.
See more about setTimeout and concurrency here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop
Comment: Absolutely nothing to do with the question.
Comment: Maybe try providing more context to your question. I assume that's why you have no other answers and I was just going out on a limb. Have a look at this link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/yield Does this answer your question? If so I will create a new answer explaining how to implement. Just a tip for future, code samples are really useful to fully visualize your issue


Assign Window Height to Document Height

Question: Any ideas as to how this is accomplished?
$(document).css('height', $(window).height())

$('body, html').height($(window).height())
alert('$(document).height(): ' + $(document).height() + "\n$('body').height(): " +   $('body').height() + "\n$('html').height(): " + $('html').height() + '\n$(window).height(): ' + $(window).height())

Answer: $("html,body").css("height", screen.height);

My fiddle
Answer: To get get screen width and height.
alert ("screen W = " + screen.width );
alert ("screen H = " + screen.height );

Answer: Try this css:
body {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

Assign Window Height to Document Height


When is a disjoint union of topological spaces realcompact?

Question: Let $X = \bigsqcup_{i\in I}X_i$ be a disjoint union of non-empty topological spaces $X_i$.
Is there any condition on spaces $X_i$ which would imply that $X$ is realcompact?
A Tychonoff space is realcompact when it can be embedded as a closed subspace of $\mathbb{R}^\kappa$ with product topology for some cardinal $\kappa$.
Comment: You should add the condition that the spaces are non-empty.
Comment: This is exercise 3.11.D. (b) in Engelking, General topology. See also there for a reference and fairly easy proof.
Comment: I thought this is a cool theorem that I could share. Other properties of realcompact spaces of this kind: They are closed under arbitrary products, and under closed subspaces.
Comment: @Ulli thank you, the proof laid out in that exercise is indeed easier than the answer I originally gave if someone is not familiar with the concept of Hewitt realcompactification
Answer: In proofs below we can assume $X_i$ are disjoint and $\bigcup_{i\in I} X_i$.
Theorem 1. Let $X = \bigsqcup_{i\in I} X_i$ where $X_i$ are non-empty. Then $X$ is realcompact iff $X_i$ is realcompact for all $i$ and $|I|$ is a (Ulam) non-measurable cardinal.
Proof: Suppose that $X$ is realcompact. Since closed subspaces of realcompact spaces are realcompact, $X_i$ is realcompact for all $i$. Take $x_i\in X_i$ for all $i\in I$, then $D = \{x_i : i\in I\}$ is a closed discrete subspace of $X$. Since a discrete space is realcompact iff it has non-measurable size, and $D$ is realcompact discrete space (as a closed subspace of $X$), it follows that $|D| = |I|$ is non-measurable.
Conversely suppose that $X_i$ are realcompact and $|I|$ is non-measurable. Equip $I$ with discrete topology, then $I$ is realcompact since it has non-measurable size. Since products of realcompact spaces are realcompact, $I\times \prod_{i\in I} X_i$ is realcompact. Fixing $y\in \prod_{i\in I} X_i$ and letting $X_i' = \{(i, x) : \forall_{j\neq i} x_j = y_j, x_i\in X_i\}$, each $X_i'$ is closed in $I\times\prod_{i\in I} X_i$ and homeomorphic to $X_i$, and $X_i'$ are pairwise disjoint. Consider the subspace $Y = \bigcup_{i\in I}X_i'\subseteq I\times\prod_{i\in I} X_i$. Since $\{i\}\times \prod_{j\in I} X_j \cap Y = X_i'$ is open in $Y$ for all $i\in I$, we see that $Y\cong \bigsqcup_{i\in I} X_i$. Because $I\times\prod_{i\in I} X_i\setminus Y = \bigcup_{i\in I} \{i\}\times X_i\cap (X\setminus X_i')$ is a union of open sets, $Y$ is closed. Since closed subspaces of realcompact spaces are realcompact, $Y$ is realcompact. $\square$
The converse of above theorem can also be proved via the following, where $\upsilon Z$ denotes the Hewitt realcompactification of $Z$:
Theorem 2. If $X_i$ are Tychonoff spaces, $|I|$ is non-measurable and $X = \bigsqcup_{i\in I} X_i$ then $\upsilon X = \bigsqcup_{i\in I} \upsilon X_i$.
Consider map $f:X\to I$ given by $f[X_i] = \{i\}$ and equip $I$ with discrete topology. Since $|I|$ is non-measurable, $I$ is realcompact, so there is an extension $g:\upsilon X\to I$ of $f$ to the Hewitt realcompactification $\upsilon X$ of $X$. Since $X_i\subseteq g^{-1}(i)$, we have $\overline{X_i}\subseteq g^{-1}(i)$, and since $\bigcup_{j\neq i} X_i\subseteq g^{-1}[I\setminus\{i\}]$ we have $\overline{\bigcup_{j\neq i} X_j}\subseteq g^{-1}[I\setminus\{i\}]$. Because $X$ is dense in $\upsilon X$ we have $\overline{X_i} = g^{-1}(i)$. Since $X_i$ are clopen in $X$, they are $C$-embedded in $X$ so that $\overline{X_i} = \upsilon X_i$. $\square$
Thanks to @Ulli for directing me to a conceptually easier proof for the converse of theorem 1.


Custom Scalar Type in graphql-spqr

Question: I graphql-spqr, java.util.Date is defined as Scalar. Is it possible to overwrite the serialization/deserialization of java.util.Date to get a different String representation of the date?
The ScalarStrategy mentioned in this answer was removed with the latest release.
public class Order {

    private String id;
    private Date orderDate; //GraphQLScalarType "Date"

    public Order() {
    }

    public Order(String id, String bookId, Date orderDate) {
        this.id = id;
        this.orderDate = orderDate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }
}

GraphQL Response:
{
  "data": {
    "createOrder": {
      "id": "74e4816c-f850-4d63-9855-e4601fa125f4",
      "orderDate": "2019-05-26T08:25:01.349Z", // --> 2019-05-26
    }
  }
}

Comment: Added a code sample to my answer. Not perfect, but the best I can do on my phone.
Answer: ScalarStrategy isn't the proper way to achieve what you want. When you want to change how a Java type gets mapped to GraphQL, you normally provide a new (or customize an existing) TypeMapper.
Take a look at the existing Date scalar implementation and implement your own in a similar way. Then implement a custom TypeMapper that simply always returns a static instance of that scalar from both toGraphQLType and toGraphQLInputType methods.
public class CustomTypeMapper implements TypeMapper {

    private static final GraphQLScalarType GraphQLCustomDate = ...;

    @Override
    public GraphQLOutputType toGraphQLType(...) {
        return GraphQLCustomDate;
    }

    @Override
    public GraphQLInputType toGraphQLInputType(...) {
        return GraphQLCustomDate;
    }

    @Override
    public boolean supports(AnnotatedType type) {
        return type.getType() == Date.class; // This mapper only deals with Date
    }
}

To register it, call generator.withTypeMappers(new CustomTypeMapper().
That said, since you're only trying to cut off the time part, you'd ideally use LocalDate here. You can make SPQR do that transparently by registering a TypeAdapter (which is nothing but a mapper + converter) but a simple mapper as explained above is a more efficient solution in your case. If you still decide to go the adapter way, you can inherit AbstractTypeAdapter<Date, LocalDate> and implement the conversion logic (should be trivial). Register via generator.withTypeAdapters or by registering it as a mapper and converters separately.

Custom Scalar Type in graphql-spqr