OP answering his/her own question right after posting it

Question: I'm referring to what are the essential aspects of the Keynes revolution in economic theory are?
The question is asked on 2018-04-30 14:58:50 and the OP supplied an answer to it less than three minutes later at 15:01:21. It appears that OP's answer is a direct copy-and-paste from an article by Hyman Minsky (the 3rd paragraph of the Introduction section).
It also appears that the OP is an unregistered user. All these suggest that the particular Q&A initiated by the OP is somewhat disingenuous.
Would the community find such disingenuous behavior acceptable? Should it be encouraged/discouraged? The question itself seems legitimate (though it could be better formatted) and OP's answer is largely valid. And I'm not against answering one's own question in general. It is the disingenuity, as well as the apparent lack of interest/commitment to this site, that bugs me a little.
Comment: I was considering if we should have standards with regards to the quality of content on the site.Though its within my power to just delete and ban posts like this i don't know if other senior users would agree with me. Seems like plagiarism to me.
Comment: @EconJohn: Yes, using other's work without proper citation is precisely plagiarism. I refrained from using that term because i) it is only a secondary concern for me, and ii) I'm afraid there's not much to be done about it here.
Comment: The site's resident troll has a fixation on Keynes. He resurfaces every now and then. See [this question](https://economics.stackexchange.com/questions/16582/does-keynesianism-increase-the-incentive-to-invest). I think this is just another incarnation. The meta question is still valid, but this instance is probably disingenuous.
Answer: General practice on the SE network seems to be to take a permissive attitude to users who answer their own questions. Our FAQ says:

Can I answer my own question?
Yes! Stack Exchange has always explicitly encouraged users to answer their own questions. If you have a question that you already know the answer to, and you would like to document that knowledge in public so that others (including yourself) can find it later, it's perfectly okay to ask and answer your own question on a Stack Exchange site.
To encourage people to do this, there is a checkbox at the bottom of the page every time you ask a question. If you have more than 15 reputation and already know the answer, click the checkbox that says "Answer your own question" at the bottom of the Ask Question page. Type in your answer, then submit both question and answer together.
Alternatively, you may go back and add an answer to your own question at any time.
You can also accept your own answer, but you must wait 48 hours to do so. After all, someone else may come along with an even better solution to your problem!

The site also incentivises this behaviour with the award of a badge.
It seems like the bottom line is whether the question/answer brings good quality content to the site or not. It looks like the post in question might fail this test given the plagiarised answer and the lazy copy-paste question. Self-answers should be held to an equally high standard as all other answers on the site.


Is making things over-complicated a common mistake for new songwriters?

Question: I've never seriously tried writing a song until this week but I have tried putting interesting progressions together and I noticed I always end up doing something a bit different.
Obviously, interesting music is great but should a brand new songwriter, used to playing 4-chord songs on an acoustic guitar, stick to something simple musically? Is it a common rookie mistake to be throwing in dozens of 'cool' chords?
Obviously there are untold amazing songs which prove you don't need to be 'clever' so when starting out, should one deliberately keep things as simple as possible so there's less to get in the way?
Comment: It is a common mistake for experienced songwriters as well.
Comment: You need to read about Mark Rosewater and how he creates Magic the Gathering cards. Each pack of cards has 15 cards in it, and 10 of them are common. So most cards people see will be common cards. Common cards have to be simple. Turns out, these simple ones are the hardest to make because they have to be *elegant*. Simple enough to be understood immediately by every player, and yet powerful enough to be worth looking at a second time. They are very, very hard to make. I cannot imagine writing elegant music is any different.
Comment: That's an interesting argument.
Comment: It shouldn't be a common rookie mistake. Rookies at anything don't have experience in that game. So they need to keep things simple, otherwise they trip themselves up. As with most things, start simple, and then 'get cleverer'. Or stay simple, just like so many songwriters. Simple often equals successful.
Answer: It's somewhat like writing a story, or a book. One of the first things to consider is - what is the audience, who am I writing this for? A lot of the best known/loved songs are quite simple. That's because they appeal to a bigger cross-section of the listening public, who can understand and appreciate them. Songs with lots of cool chords, etc., appeal to me, as a muso, but leave my other half, who loves music, rather flat. "It's all too complicated and messy".
There's nothing at all wrong with putting all sorts of clever stuff in, but your listeners will be more appreciative with the simpler renditions, by and large. It's the old adage - jazz players play a hundred chords/notes to 3 people; blues players play 3 chords/notes to a hundred people. Sad/funny, but true...
Comment: Reminds me of: Rock: playing for 20000 people on $20 instruments. Contemporary music: playing for 20 people on $20000 instruments.
Comment: Does 'better' or 'more important' equal more or less popular? I'm not sure if it's either!
Comment: It's true but that implies more niche music is somehow better or more important. I think that's a bad approach. After all, lots of the music _I_ like is popular music from household name bands!
Answer: You have been advised by Tim to consider your audience. That is one reason to write a song. Another is to practice and develop your craftsmanship of songwriting. Finally, you may a write a song to express feelings or thoughts of your own, a reflection of your ideas, of your personality.
I have written songs for all these purposes, and they are all perfectly legitimate. However, for me the purpose of self-expression drives all the rest.
So when you question whether or not your song is getting too complicated, ask yourself, "What am I trying to express?" Let that be your guide. You may find yourself writing a song about writing songs that are too complicated. I would like to hear that tune.
Maybe most important of all, quiet your critic while you are at work. Just let the song out. Judge it after you make it, not in the middle of the process.
Comment: I've always wanted to write a song about having no idea how to write a song. But I'm not sure where to start.
Comment: +1. Interesting take on it. If you were writing a love song to a particular individual, you'd probably tailor it so that it was at least in a style palatable to that lucky person,maybe?
Answer: This is an excellent question, I do not think it is a 'common' mistake for songwriters. I do however, think that a good handful of songwriters think that their compositions must be complex in order to be good, which I think is quite far from the truth.
If you're songwriting, do not actively think about trying to do something different and unique. Write the music that makes sense to you. Come up with progressions without actively thinking that you must do something unique to set it apart. Good songwriting takes a lot of practice. Songwriting is a skill that can be learned and improved upon, like all other skills.
This isn't saying that your first songs will be or should be simple, for you to improve your skills, but I do strongly believe that if you actively search out 'unique' things to do with your music, the songs will probably sound awkward, especially if you're a novice songwriter. Do not force your tunes to be different or contain cool chords. Again, write the music that makes sense to you, and if the opportunity arises to utilize a cool chord, use it!
Answer: Commercial songwriters who are writing for a particular target market, tend to use a trusted formula to produce songs that are very similar to what their target audience is buying.  There is a chance that the target audience is buying a certain formula, because it is being force fed to them by the media outlets that have the deep pockets to get the "airtime".
That is one reason we keep hearing the same chord progressions in the same type music, song after song.  Another reason is that there may actually be a reason that certain chord progressions work.  See this explanation for example Why are 4 chord songs so popular
But one of the best reasons to write music, is for your own enjoyment and to share with your friends and family. For this - there is no reason to follow any particular prescribed formula, just because it has proven successful in terms of the number of popular songs based upon that formula.  The songs you write because YOU want to write them, should be a reflection of who you are and what is in your heart and soul.  Not a reflection of how well you can follow the "rules and formulas".
Many great composers were more appreciated long after they were gone than when they were still living - so even if you are composing music that nobody other than you seems to like today (perhaps they have not been conditioned to like it yet), who's to say that 100 years from now, you will be known as the father of modern music.  Maybe your ideas can become revolutionary.
You can certainly read about theory, and why you should or should not do this or that or stick to a certain formula or learn the so called "rules" before you try to break them.
But I believe you should embrace your ability to create music outside the norm.  Make no attempt to squelch this ability by trying to fit in box or conform to certain ideas, concepts or principles.  You might be just beginning to discover the musical genius that has been locked up in your brain since your were very young.  Don't stifle it. Don't twist it. Don't kill it by trying to follow what someone else "thinks" you "should" do.  Let it flourish.  See what happens.
If you like what you end up creating, by embracing your unique way of arranging your music, then don't let anyone tell you what you composed is wrong or too deviant from the "norm".  Maybe your music can become the new norm.
I am actually quite envious of your apparent creative proclivity to compose based on what you feel and hear in your heart, and your willingness to try interesting musical ideas that come to you - as opposed to following a certain formula.
I started writing the easy way, followed the simple tried and true formula.  Now I am seeking devices on Music and Theory; Stack Exchanged, to try to break free from the composing rut I fell into by following the simple route and sticking to the rules. I became conditioned to following these formulas - much the same way you develop muscle memory by practicing certain pieces of music on your instrument.
Go with the flow. Don't force anything one way or another.  See where your unique and individual creative juices lead in the absence of external influence (other peoples ideas).  If you are not happy with the end result, Keep tweaking until you get something you are happy with.  If all else fails, take some of what your creative mind produced organically - that you do like, and use the rules and formulas to mold the rest of the song into something more typical or more traditional.
But please don't be trying to fix it if it ain't broke.  What is coming from within your untrained (read un-tainted) musical mind, may one day be recognized as nothing short of brilliant!
Answer: I would call this common, but not a mistake. When I try to compose a new song, I cannot stick to just a couple of chords; that's boring for me. I try to add more and more stuff.
The advice I should give you is not to play just 4 chords; play as many as you want, but not more than you can handle.
What I'm trying to say is that don't go out of the way just to add more chords that 'sound cool'. These will come after some time of songwriting. Stick to what you can easily play and work (expand) on that.
For instance: Let's say you can easily play the chords from the C major scale. Don't try to add more chords as of yet. Explore all the combinations of those chords and see what you can get. When you feel that you need a different sound, then it is time to add more chords.
Since you are a beginner, I can understand your excitement about adding a lot of new stuff you've learned about; most people have it. But you have to combine that excitement with restraint. Like when you see a girl you like on the road; you won't ask her at that precise moment to sleep with you.
Also, you will see that if you work really hard just to add some cool sounding chords, the result might not be what you expected. You want the song to have a nice, natural sounding progression; if you keep adding chords, you might lose that. Sometimes the result might be 'trying too hard'.
Comment: Agreed. My hubby wrote a great and very memorable song which only uses 3 chords, though i can fill it in with I7 here and there.
Answer: When I was writing my first few songs, after a while, I remember that I got very ambitious. I think it's not something happening to musicians only, but to almost every skill you can learn... As soon as you understand the basics of something, you want to go further and do more than what you did before. Every rookie wants to do everything at once and even more, which is a good thing!
Unfortunately, if you're not a very skilled writer yet, the result could be disappointing, because the idea in your head was probably a thousand times better. Yet I don't believe that you should limit yourself, absolutely not!
I've been writing songs for about two years now and I've made too many mistakes to count. But making mistakes is a part of the whole learning process, if you just limit yourself to the same 4 basic chords over and over again, I don't think you'd learn how to write good songs very quickly.
As long as it is not frustrating, keep going over boundaries, but don't forget to know the basics as well. It would be impossible to write a good song with complex chord progression, if you didn't write countless songs with the same basic chord progression.
Best thing is to write as much as you can. Stay focused on the basics you know, but don't be afraid to go further!
One advice I can give you, would be to write a simple song in a basic chord progression, and then rewrite or expand the same song in a more complex and experimental context. So at least, if the new song is bad, you still have the old basic song, which you can always improve later on, if you want to.
<code>"Learn the rules like a pro, so you can break them like an artist." -Pablo Picasso
</code>
Comment: I write melody-first, then fill in harmonies later, so I've effectively written several songs with complex chord progressions (at least one of which is good, I hope) while writing far fewer songs with the same basic chord progression.
Answer: I think I read somewhere that somebody ran a sizable corpus of Beatles songs through computational analysis with the result that each song had pretty much exactly one chord that stood out as unusual in its chord progression.
Basically, you don't want to wear down your listeners with earcatchers.  They need something to focus their anticipation on.
Comment: Yes, there is an answer about this on the site already: http://music.stackexchange.com/a/7673/9198
Comment: My reaction when the Beatles stopped thrashing three chords and got a bit more harmonically adventurous was "So they've discovered Burt Bacharach then"  :-)
Answer: You have to develop your skills, and you can't do that unless you exercise them. If complex harmonies excite you, then by all means learn to work them in to your songs. The skill is to do so in a way that doesn't sound contrived.
A couple of pop artists to listen to who spring to mind are Steely Dan and Paul Simon. Many of their songs are built around quite a simple 'core' progression - sometimes for long sections just riding along on the tonic chord - but then move through a complex sequence quite quickly in a way that often follows the melody closely, so it doesn't seem like a gratuitous addition.
Another route to go would be to try to work out what's going on in some jazz standards. Many of these are familiar enough that by doing something along similar lines, you'd hopefully manage not to offend with your cleverness!
Of course cleverness isn't always about complexity. Some of the very best music of all genres takes simple, familiar elements, and weaves them into something more than the sum of its parts.
Answer: Much of the current Top 40 consists of a very few notes chanted over very simple harmony.  So if the aim is money and success, maybe you should restrict your musical horizons rather than trying to expand them!
Don't throw wild curve balls just to be clever. They won't bounce the way you expect :-)
You maybe started off with 3-chord songs in C major.  Then you discovered that Dm7 is an alternative to F, that Fm has an interesting flavour, that Bb is perfectly "allowed" in C major, that major 7ths and flat 5ths can be pretty...   Then you maybe notice the tricks common to the Great American Songbook - a phrase in C repeated a minor 3rd higher in Eb, the unprepared leap to a remote key then a journey home through the cycle of 5ths... and lots more.  As these techniques become part of your vocabulary, use them.  A less sophisticated musician may see it as "way out", but YOU'RE just writing within your comfort zone.
Then go back and write a really catchy 3-chord song!
Comment: It's not about money/success and I don't buy into snobbery "that's just chart music". My thought was that so many great songs - classics by anybody's standard - are so simple, that I shouldn't _need_ to be complicated to make a good song.
Comment: "I've never seriously tried writing a song until this week" :-)
Come back when you've written the first dozen.  No, they don't have to be complicated, but they can be if you like.
Answer: First off, you can't really call anything you do in a creative platform a mistake.  Sure, you can make a mistake in the sense that you did not do what you intended but to call an approach to creatively expressing yourself a mistake is to undermine what creative expression is.
I come from a background of trying to write something you've never heard before and it has not really been the easiest of paths, and not just because it is hard to write something completely new.  Often times I come up with a chord progression that I find to be really awesome but it is rather foreign due to it's less than conventional progression.  The complicated nature of what I try to write makes it much harder to compose the rest of the material for it.  For instance, a chord progression that is constantly changing keys to relatively unrelated tonal centers requires a melody that has lots of chromatic notes.  This not only makes it harder to find a melody that fits but harder to find a melody that seems to be cohesive.  Intuitive melodies tend to be mostly diatonic, so having chords from multiple tonal centers basically prevents an intuitive melody from working, shy of lots of dissonance.  So I end up coming up with this idea that I love but have a hard time moving forward with it and turning it into an actual song.  This ends up getting a bit easier as you do it more frequently but with that approach, the next song I would write could very well have the same issues.  I've ended up having a lot of song ideas or interesting rhythm section ideas that don't actually go anywhere.
Eventually I started writing some more stuff with more standard sorts of approaches but focusing on specific styles that I love, such as Funk/Fusion, and now have significantly more songs that are fully fleshed out.  I find that my experience in trying to write incredibly complicated, unique sounding songs has a place in my more standard songs.  I tend to utilize something more standard as the driving force of the song and place more complicated passages selectively, like throwing an unexpected chord at the end of a phrase to create a sort of dissonance that a dominant chord might offer in a more standard approach.
In considering where this music might land, I feel that the songs that are less complicated are more likely to be well received by an audience.  I would like to be a successful musician and I would love it if that success came from the most unique and creative expression I have but that is not so likely.  The general public tends to appreciate more simple approaches and relative repetition much more than something unique and new, hence the seemingly endless amount of songs that all sound (and are) incredibly similar.  But every once in a while someone comes along with something rather unique, maybe or maybe not theoretically complicated, and changes the game, which people then end up imitating endlessly, so originality can still be of value.  Bands like Primus, who basically sound like nothing else, are a rarity but a beacon of hope for people like myself.
I might suggest combining your approaches.  Write something beyond the full scope of your knowledge/experience/proficiency and see what the best thing you can do with that is.  Then write something that is entirely 'in the box'.  By working both sides of the fence, you can really gain a catalog of songs by not getting stuck on the complicated songs, while still pursuing a more unique or complicated approach.  Hopefully in the end you will end up more proficient at less intuitive ideas and more able to spice up a relatively standard song.
As I mentioned in a recent answer to Rockin Cowboy's question on writing new melodies, it is important to practice songwriting and composition in the same way you would your playing.  By practicing the act of writing, you can try new things without worrying about whether or not they will create the best song.  This lets you work out ideas in a place that doesn't matter so that you can apply the skills you are practicing to other songs that you consider important.
Answer: To answer you question I would say yes it is a common mistake. But you learn through the process. If you breakdown many songs, you will discover common chord progressions everyone uses. Not asking you to follow rules and break them, but you will naturally gravitate towards chords that express your thoughts because that is what we hear all the time in music.
Chords are the building blocks and melody is the decorative feature on top of it. Many composers have ability to get very creative over common progressions. How many songs follow the standard progressions?  Check: http://www.hooktheory.com/theorytab/common-chord-progressions
and
http://www.musictheory.net/lessons/57
Answer: If you're just starting out, you should write what appeals to you --trying to fit into a preconceived box will just cramp your creativity.  It some ways, as well, it's easiest to produce something truly original before you internalize all the "rules."
With that said, one common pattern that has proven successful in many songs is to give the chorus the simplest chord structure, and the bridge section the most complex chords.  Ben Fold's "Annie Waits" is a pretty decent example of this structure.  Bob Dylan's "This Wheel's on Fire" doesn't have a bridge, but it has plenty of minor and even diminished chords in the verse, versus almost all major chords in the chorus.
Answer: Using complicated chords for the sake of it or because they are "cool", as you say, is definitely a mistake. You should use whatever chords suit the song you are writing. If that is complicated, cool chords then so be it. using them because you feel you're supposed to is a fools errand.
Songs are successful or not based on many things, but the complexity of the chords used would be way way.... way... down that list.


Prove that if $A^*+A=AA^*$ then $A$ is normal

Question: Prove that if $A^*+A=AA^*$ then $A$ is normal.
I've tried some basic algebraic operations with no luck.
Comment: Hint: rewrite this as $(A-I)(A^*-I)=I$
Answer: \begin{align*}
&A^*+A=AA^*\\
\implies &(A-I)(A^*-I)=I\\
\implies &A-I=(A^*-I)^{-1}\\
\implies &(A^*-I)(A-I)=I\\
\implies &A^*A=A+A^*=AA^*\tag*{$\blacksquare$}
\end{align*}
Comment: Edit the typographical mistake at last line.
Comment: @AVISEKSHARMA, thank you for pointing it out, done.
Comment: How can you know for sure that (A*-I)^(-1) does indeed exist?
Comment: @JuvalBechar, on taking the determinant on both sides of the equation $(A-I)(A^*-I)=I$, we get, $|A^*-I|\ne0$.
Answer: for arbitrary $A \in \mathbb C^\text{n x x}$  if you compute
$\big\Vert A^*A - AA^*\big \Vert_F^2 $
and recall the positive definiteness of a norm, you get a well known trace inequality
$\text{trace}\big((A^*A)^2\big)\geq \text{trace}\big((A^2)^*A^2\big)=\text{trace}\big((A^*A)(AA^*)\big)$
with equality iff $A$ is normal.
(i) for this problem,  multiplying the original equation on the right by $AA^*$ and taking traces
$\text{trace}\big((AA^*)^2\big)= \text{trace}\big(A^*AA^*\big)+\text{trace}\big(AAA^*\big) = \text{trace}\big((A^*)^2A\big)+\text{trace}\big(A^2A^*\big)$
note that $\text{trace}\big((AA^*)^2\big)= \text{trace}\big((A^*A)^2\big)$
ii) multiplying the original equation on the right by $A^*A$ and taking traces
$\text{trace}\big((AA^*)(A^*A)\big)=  \text{trace}\big(A^* A^*A\big)+\text{trace}\big(AA^*A\big)=  \text{trace}\big((A^*)^2A\big)+\text{trace}\big(A^2A^*\big)$
thus
$\text{trace}\big((A^*A)^2\big) = \text{trace}\big((AA^*)(A^*A)\big)\longrightarrow A \text{ is normal}$


Which document describe the result class of every api call in microsoft graph php sdk?

Question: $user = $graph->createRequest("GET", "/me")
                      ->setReturnType(Model\User::class)
                      ->execute();

How can I know the return type of /me call is Model\User::class?
Answer: To determine endpoint entity type the following approach could be considered. Set Accept header to odata.metadata=full to return @odata.type property along with data in response payload(refer OData spec for a more details)
Example
$resp = $client->createRequest("GET", "/me")
    ->addHeaders(array(
        "Accept" => "application/json;odata.metadata=full;odata.streaming=true"
    ))
    ->execute();

$entity = $resp->getBody();
$entityType = $entity["@odata.type"];

Result
For the provide example $entityType returns  #microsoft.graph.user which corresponds to Microsoft\Graph\Model\User type from msgraph-sdk-php


Propriety of a spectral family on a Hilbert space

Question: Let $\{E(\lambda)\}_{\lambda \in \mathbb{R}}$ be a spectral family on a Hilbert space $\mathcal{H}$, meaning a collection of orthogonal projectors satisfying, for any $f \in \mathcal{H}$
$ \quad (i) \ \lim \limits_{\lambda \to -\infty} E(\lambda)f = 0 \quad $ and $\quad \lim \limits_{\lambda \to +\infty} E(\lambda)f = f$
$ \quad (ii) \ \ (E(\lambda)f,f) \le (E(\mu)f,f) \ \ $ for $\lambda \le \mu$
$ \quad (iii) \ \lim \limits_{\epsilon \to 0^+} E(\lambda + \epsilon)f = E(\lambda)f$
Then, $E(\lambda)E(\mu) = E(\mu)E(\lambda) = E(\lambda) \ \ $ for $\lambda \le \mu$
My attempt
Since $E(\lambda)$ is a projector, $f \in \mathrm{Ran} \ E(\lambda) \iff f = E(\lambda)f$. $\\$ Also, from $(ii)$, one gets $\mathrm{Ran} \ E(\lambda) \subseteq \mathrm{Ran} \ E(\mu)$. Using these two: since obviously $E(\lambda)f \in \mathrm{Ran} \ E(\lambda) \subseteq \mathrm{Ran} \ E(\mu)$, it follows $E(\mu)(E(\lambda)f) = E(\lambda)f$, so $E(\mu)E(\lambda) = E(\lambda)$.
I am however having trouble proving the other half of the statement, $E(\lambda)E(\mu) = E(\lambda)$. Maybe I am missing something obvious
Comment: Try taking the star on both sides.
Comment: @Ruy Oh wow, thank you! It really was that simple. How do I accept this comment as a correct answer? If not possible, maybe you could convert it into an answer so that I can close the question as resolved?
Answer: Upon request, here is the answer contained in my comment above:
Once the OP has already proven that $E(\mu)E(\lambda) = E(\lambda)$, and observing that orthogonal projectors are self adjoint, we have
$$
E(\lambda)E(\mu) =
\big(E(\mu)E(\lambda)\big) ^* = E(\lambda)^* = E(\lambda).$$


How to force clang use llvm assembler instead of system?

Question: I'm working on LLVM/Clang fork (for AVR). How can i force Clang Driver to use LLVM assembler instead of system one?

MBA-Anton:bin asmirnov$ ./clang++
  -I/Applications/avr.app/Contents/Resources/Java/hardware/avr/cores/avr -I/Applications/avr.app/Contents/Resources/Java/hardware/avr/variants/standard
  /var/folders/64/fwfkm1k51zbd4_c5lwpsbljh0000gn/T/build5450310618632673119.tmp/Blink.cpp
  -o /tmp/Blink.avr.hex -I /Applications/avr.app//Contents/Resources/Java/hardware/tools/avr/avr/include/
  --target=avr -O1 -v

And it uses LLVM clang compiler (not system, correct):
clang version 3.6.0 (https://github.com/4ntoine/clang.git 0d08deedd548d964f63cf896ae9acb8d878a5fd8)     (https://github.com/dylanmckay/avr-llvm.git 447b58bced825fa7bea31f3882f277535cc9fca6)
Target: avr
Thread model: posix
"/Users/asmirnov/Documents/dev/src/llvm_dylan/installed/bin/clang" -cc1 ...

But system assembler (incorrect):

"/usr/bin/as" -o ...

It should use LLVM's llvm-as as it "knows" AVR target (opcodes, etc). How can i force it use LLVM's assembler?
Comment: Can you try passing the `-integrated-as` option and check again? If it works, I will post it as an answer.
Comment: with `-integrated-as` it starts using `g++` and system linker (`ld`) after clang compiler for some reason: `"/usr/bin/g++" ...
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" ...` and it's completely incorrect
Comment: after further investigation i've found using integrated assembler was correct answer. The only difference i had to override toolchain method to use integrated assembler by default
Answer: You can use clang to emit LLVM IR code by using the option -emit-llvm.
Let's say you want to compile a C file into LLVM IR:
clang -emit-llvm -c file.c
It will create a LLVM bytecode file file.bc. You will be able to compile the file with llc.
Comment: You're right but i need not only produce IR, but compile machine-code for the target CPU


Is it easier to play "softly" on a grand piano?

Question: As I live in an apartment complex, I'm limited to playing on digital pianos; something I can plug headphones into so I don't disturb my neighbors. I recently purchased a Yamaha P95 and have been blown away by the quality of the instrument. However, I found that when I went to play the pieces I had learned on an acoustic Yamaha upright, I had extreme difficulty getting the instrument to sound soft and melodic, something that my keyboard makes effortless.
The keys on my keyboard are weighted very heavily, and the advertising suggests that it tries to mimic a grand piano. I can't verify this in the near future as I don't have access to a grand, so I'm asking the general audience. Are grand pianos "heavier"? Is it easier to play notes softly on them? I felt like the upright was very light compared to my keyboard, and I don't know if this is a universal trait, or just the way this particular upright was designed.
I guess, to state it as briefly as possible: are uprights and grand pianos different enough that certain styles of music prefer one or the other? Or am I just inexperienced? (Do I need to re-learn the "feel" on the upright to play it softly?)
Comment: You absolutely need to practice a bit on a grand.  The feel is very different, enough that it could very well trip you up.
Comment: YOu can have easy access to a grand piano. Just find one in a public place (e.g. hotel lobby) which says "do not touch". Look both ways and when the coast is clear, go ahead and touch it.
Comment: @Nicholas, if the people organising the audition are sensible people, they will let you practise on the very piano your audition is on. Ask them. This is a usual thing.
Whenever I performed at a piano competition or a concert at my college, I was given twenty minutes to an hour of practise.
Comment: I guess I should point out: I will soon be auditioning for the music program at my college on piano, and although I'm not sure, I *think* the audition is on a grand piano. If that's the case, and there's a big difference, I suppose I need to go straight to that and avoid trying to adapt to the upright.
Comment: A music school piano audition will almost certainly be on a grand. You _should_ get some warm-up time on a similar instrument when you go for your audition, however; that may be enough time to adjust. Pros rarely know what instrument they'll be playing until they get to a gig, so they've got to be ready to adjust in whatever warmup time they have.
Comment: Depending on the piano, the pedals might help you out. Check whether any of them might allow you to change either which strings (there are I believe two per key) are struck or change the distance the hammer is from the strings. These might be stops instead.
Comment: Uprights and grand pianos are different, although some uprights claim grand piano action. Well-adjusted action is important. A nice take on soft playing: http://jamesboyk.com/?p=351 Good luck!
Answer: Modern, large grand pianos still give the best feeling when playing.
Upright pianos normally require more force and often don't allow soft notes to be played easily. The quietest note on an upright piano will normally be louder than the quietest note on a grand piano. Therefore, when practising soft pieces or fast, repetitive (Toccata-like) pieces, a grand piano is a great advantage.
This is not necessarily because the keys are heavier, but because of fundamental design differences, for example the length of the key.
Every key extends into the interior of the piano. The length of the lever part of it is important: The longer, the easier to control the sound. Big grand pianos usually have very long keys and therefore are playable very well.
I have a 120 years old upright with a quite peculiar action. After years of practise, I can somehow play softly on it, but I can play softer on a good grand after a minute of practise.
However, a good, modern upright might still have a bit better action than a small, very old grand.
If Yamaha says that their electric piano tries to mimic a grand piano, then this is a bold promise.
On the other side, improving over an average upright should not be too hard for an electric piano.
Conclusion: Big grand pianos are the best pianos to play. Your ability to play soft on it will be much better than on a regular upright. A good electric piano might already be better than an average upright.
Comment: That's being done with the middle pedal in many modern uprights. It's called a practice rail or practice pedal (http://en.wikipedia.org/wiki/Practice_Rail)
Comment: What if you pop the top off and drop in a wool blanket?
Answer: I agree with Turion's answer. I would add a few additional points:

I found that when I went to play the pieces I had learned on an acoustic Yamaha upright, I had extreme difficulty getting the instrument to sound soft and melodic

Acoustic Yamaha upright pianos are notably (or notoriously, depending on who you ask) "bright". That is, they consistently have a bell-like, piercing tone to them rather than a more soft, mellow, rounded sound. So first off, I would say that your experience probably has much to do with the sound itself.

Are grand pianos "heavier"? Is it easier to play notes softly on them?

Generally, yes and yes. A couple things come to mind.
I would note that if you are accustomed to using the "soft pedal" to assist playing very quietly, you should be aware that the soft pedal action on a grand is completely different than the soft pedal action on an upright.  An upright assists your playing softly by moving the hammer fallback rail closer to the strings, so that less of the force applied by the key to the action actually translates into hammer velocity.
By contrast, the soft pedal on a grand actually moves the entire action slightly to the right which has two effects on the tone. First, the notes where the hammers strike two or three strings normally now only strike one or two strings, thereby producing less sound. (The remaining not-struck strings are of course still free to vibrate sympathetically.)  This of course explains why the soft pedal on a grand is called the una corda -- the "one string" pedal. Second, hammers are made of felt which gradually gets grooved as it repeatedly strikes the strings. Hitting the soft pedal changes the intersection of the hammer head and the strings such that the ungrooved portion of the felt strikes the strings. This typically produces a more dull tone.
Leaving the soft pedal aside, there are also big differences in the grand action compared to the vertical action. The different mechanical advantage of a longer key was already mentioned. An obvious difference is that the hammer is being propelled upwards, against gravity, instead of sideways in a vertical action, which certainly has an effect upon how well you can control the velocity with which the hammer strikes the string. Grand actions also have an additional escapement which vertical actions lack, which allows for faster repetition at a given volume.

Are uprights and grand pianos different enough that certain styles of music prefer one or the other?

It's complicated. Obviously if you know a particular piano well then you'll be a lot better at playing any piece in any style on it, and you'll be a lot better at knowing what sorts of pieces sound best on that piano. There are some pianos that call out to have ragtime played on them, and those are maybe not the best pianos for Rachmaninoff, and vice versa.
You'll also find as you play more pianos that different manufacturers make pianos with different characteristics. Every Yamaha upright I've ever played had exactly the same bright tone and crisp touch. Yamaha approaches piano building as an engineering discipline; everything from the way they cast the iron plates to the assembly of the action parts is tightly controlled to narrow tolerances.  Steinway by contrast builds pianos of extremely high quality but with a great deal more variation in them; two Steinways of the same model can come out of the same factory and have quite different tones to them.
Comment: I think I used some uprights with true una corda pedals (the keys were slightly moved to one side by pressing the pedal).
Comment: @ysdx: It is quite rare to find a true una corda pedal on an upright, but apparently some do exist. I have never personally seen one.
Comment: @ysdx, I think this is a thing seen on older uprights with a different action mechanism (dampers above hammers). Mine is 120 years old and behaves as described by ysdx. However, I've never seen a modern upright with that mechanism.
Answer: While I agree with the previous answers, there is one point that must be made; the action of a piano's keyboard is dependent on the manufacturer, the setup, the age, and the level of maintenance.
For example, my church recently purchased a new (to us, it's actually 15 years old but in immaculate shape) Yamaha C3 baby grand (6'1"), to replace an older Kawai 5'10" grand in the sanctuary. The Kawaii had been the mainstay of service for about 15 years with our church, during which time very little maintenance was done on it. As a result, the Kawai had flattened hammer felts making the velocity of the note produced by the same key press different from key to key. It also had a very heavy action, and as is the nature of Kawais, the tone was very bright, almost harsh in a stone vault like our sanctuary. As a result, despite the skill of our music minister, the piano had to be played with the sostenuto pedal pressed almost all the time, and the shortcomings of the instrument were obvious during talent shows and recitals when student players and even professional-level guest players sat at the instrument.
The new Yamaha has a much lighter action, and since it's in such good shape the action is very consistent across the keys, allowing for the player to be more dynamic when playing it without worrying that a particular key will or won't sound when pressed at a particular velocity.
So, the statement that a digital keyboard mimics the feel of a grand piano with "100% accuracy" is a highly dependent statement at best; dependent on not only the brand and model, but the exact instance of the instrument used for comparison. 9 times out of 10 any such statement is marketing fluff. I'm not saying that weighted keys in any given digital keyboard are bad, per se, but you will definitely develop a preference and if the digital keyboard does not fit it, you won't like it.
If you want a lighter touch, try a Roland; I've plunked around on their Fantom-G series a bit and the weighting of the keys is noticably lighter than some other brands I've tried. Be advised they make unweighted-key versions of the same model line, and I am talking about the piano-weighting instead of the "organ-weighting".
Answer: There are many factors that can affect the final result of one's playing. When it comes into one's dynamic range, one should pay attention chiefly to the lever system length: as Turion pointed before, grand pianos have longer key mechanisms, augmenting the range of velocities that can be applied to the overall movement. Other points that could be of interest are the build quality, type of wood used, and overall string length. Usually, most budget upright pianos will be made of stiffer, less mature wood, which include the very hammers (hence most uprights produce a less-than-quiet "thump" when hammers strike the strings). Furthermore, the shorter strings of upright pianos tend to present more traction, lending another stiff component to the sound quality of such piano.
Beyond this, one have to pay attention to the build quality of the piano's soundboard, and never forget the size of the resonance box (much bigger/greater in the grand). These factors will influence directly the richness and warmth of the sound, allowing in direct proportion for a much wider range of harmonic mixtures, attacks and response (both tactile and aural).
Normally, digital pianos tend to mimic the touch of a grand piano. One should notice, however, that the vast majority of digital pianos are limited to internal memory and (127) MIDI velocity levels when sampling the notes and compressing the resulting sound files. This way, while having a possibly faithful simulation of the mechanical aspect, aural response is limited from the start, as subtler nuances and transitions through the full dynamic range are not totally achievable. Sound richness and harmonic mixture will be, in most cases, illusory and artificial even when compared to most budget upright pianos.
To wrap up this reasoning, I should say that every musical instrument lends its own personality to the music to be played. It is the duty of every accomplished musician to try using and knowing the instrument beforehand. Even some minutes of previous practice can help on finding the overall touch that said instrument can give you. This way, one can at least try the hardest to produce the most rich and adequate dynamic range, as suitable for the moment/style/genre in question.


Para que serve o $scope.$apply ?

Question: Eu vi em um código o $scope.$apply que utiliza AngularJS, para que ele serve ? No contexto em que se encontra está desta forma:
var a = function(param){
            $scope.$apply(function(){
                var image = document.getElementById('img');
                image.src = "data:image/jpeg;base64," + param;
        });
    };

Answer: No Angular 1.x, versão corrente, alterações feitas "por fora" do angular não são identificadas por ele, $scope.apply() ou $scope.digest() fazem o trabalho de solicitar ao angular que revise suas variáveis em busca de modificações externas. Note que ai neste exemplo de código, a função dentro do apply busca na estrutura da página com o document.getElementById (que é um meio por fora do angular), um elemento que possivelmente é gerenciado pelo angular e o altera.
É importante alertar, que $scope.apply() diz ao angular, "Hey, alterei algo! Se vire para descobrir o que foi." então ele irá buscar em toda a raiz de elementos gerenciados pelas possíveis alterações, o que pode ser bem ruim em questão de performance. O $scope.digest() faz a mesma coisa, mas apenas do scopo atual para baixo.
Mais informações aqui na documentação: https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply
Apenas para complementar, eu citei Angular 1.x pois no Angular 2, segundo a documentação essas modificações fora do scope, serão detectadas automaticamente.

Para que serve o $scope.$apply ?


Not enough images in validation set in AutoML when done automatically

Question: I'm trying AutoML from GCP and I'm stuck at training: I get an error message saying there is not enough images having the "Italy" tag in the validation set. I have uploaded the images manually, and so I did not specify which image goes to which set (training, validation, test).
The weird thing is, "Italy" has more images than the other tags, so why is there a problem with it ? Can I fix it from the AutoML interface or do I really have to upload a CSV to fix the bug ?
I already tried to add some new images with the "Italy" tag and it didn't change, I still get "0" in validation...
If it helps, an image can have multiple tags (in my example: one sport + one country).
Answer: You can resolve that issue by manually reassigning some images to the VALIDATE dataset, see this answer.


Autolayout - Freeform View

Question: I have a UIViewController with a UIView in which I am adding UIViewController views in as subviews. i.e
UIViewController *vc = [[MyViewController alloc] init];
[my_view_in_xib addSubview:vc.view];

The ViewControllers view and the subviews have AutoLayout enabled. The top level does resize correctly (changing background color to red) I can see it is the right size. However in the subviews in the XIB file I have set the view to be "Freeform" or "None" on the "Size" and pinned the tables to top & bottom and made them pin on the width but the height does not seem to auto resize?
Any suggestions?
James
Answer: Every time you resize, you should send setNeedsLayout to the superview. Otherwise, the layout system will not recalculate the frames of the subviews.
In Apple's own words:

View resizing primarily occurs when the orientation of your
  application's interface changes but it may happen at other times as
  well. For example, calling the setNeedsLayout method forces your view
  to update its layout.

Autolayout - Freeform View


Find $L$ such that $L^*=LL$ but $L \neq LL$

Question: I need example for a language that $L^*=LL$ but $L \neq LL$
I tried $L=\{w| |w| \text{ is even}\}$
but I cant find example
Comment: Could you provide more context and definitions?
Comment: I'm assuming $L^*$ is the Kleene closure of $L$. What is $LL$?
Comment: @R.Burton Yes...
Comment: I assume $LL$ is the Cartesian product of $L$ with $L$; e.g. if $L = \{"a", "b"\}$ then $LL = \{"aa", "ab", "ba", "bb"\}$
Answer: How about the set of all words over $\{a,b\}$ that are either empty or have a different number of $a$'s and $b$'s.  So $LL=L^*$ would be all words over $\{a,b\}$, but $L$ itself is not.
Or even simpler, $L=\{w\mid |w|\neq3\}$
Answer: Take $L = 1 + a + a^3a^*$. Then $L^2 = L^* = a^*$, but $L \not= L^2$.


Get accurate coordinates within JPanel in a JFrame

Question: How does one get accurate xy coordinates from a JPanel placed within a JFrame.
I tried figuring this out on my own but the coordinates are slightly off and I dont know why.
I know this probably isn't efficient code. I'm still learning and just trying out different things for fun.
I used a Mouse event within the windowpane to change the title of the window to the coordinates of the mouse.
The overall goal is to make it easier for me to get the xy coordinates of the place I want to place a component.
Despite not needing it, also made a inner class for the Rectangle because I wanted to play around with inner classes.
I am not sure if thats what is messing it up.
<code>import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import javax.swing.*

public class GetCoordinates extends JFrame {
    private Dimension size;

    public GetCoordinates(int x, int y) {
        size = new Dimension(x, y);

        setTitle("Click to get coordinates");
        setSize(size);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPanel windowPane = new JPanel();

        windowPane.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {

                int x = e.getX();
                int y = e.getY();

                setTitle(String.format("x: %s, y: %s", x, y));
            }
        });
        GetCoordinates.Rect rectangle = new GetCoordinates.Rect(100, 100);
        windowPane.add(rectangle);
        add(windowPane);
    }

    public class Rect extends JComponent {
        private int x, y;
        private final int SIZE = 50;

        public Rect(int x, int y) {
            this.x = x;
            this.y = y;

            setPreferredSize(size);
        }
        @Override
        protected void paintComponent(Graphics g) {
            Graphics2D g2d = (Graphics2D) g;

            Rectangle2D.Double r = new Rectangle2D.Double(x, y, SIZE, SIZE);
            g2d.setColor(Color.BLUE);
            g2d.fill(r);
        }
    }
    public static void main(String[] args) {
        GetCoordinates gc = new GetCoordinates(640, 480);
        gc.setVisible(true);
    }
}

</code>
Comment: "The overall goal is to make it easier for me to get the xy coordinates of the place I want to place a component."  That is not the correct way to build a window.  Use [layouts](https://docs.oracle.com/javase/tutorial/uiswing/layout/) to arrange components.  Your pixel coordinates **will not work on other computers.**  Fonts on other computers may not use the same number of pixels;  a "12 point font" means every line of text is ¹²⁄₇₂ inch high, and exactly how many pixels are needed to do that will depend on the dot pitch of the monitor on which your application is being viewed.
Comment: You have other fundamental issues. For example you attempt to make the "size" of the frame and the panel the same. How is this possible? The frame includes the title bar and borders.  So the size of the panel will be truncated by these values. Also read the tutorial on [Top Level Containers](https://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html).
Comment: `JPanel windowPane = new JPanel();` creates a panel with 5 px insets from each side (this constructor automatically installs `FlowLayout` as LayoutManager with these insets). I would suggest you to use another layout manager, For example `BorderLayout`: `JPanel windowPane = new JPanel(new BorderLayout());`. BorderLayout is also better here because it automatically resizes the content of windowPane.
Comment: *The overall goal is to make it easier for me to get the xy coordinates of the place I want to place a component* - you have no logic in your code to "place" a component. Painting a rectangle at (100, 100), is not the same as putting a component at location (100, 100). You need to understand the difference between using components and doing custom painting on a component. Read the Swing tutorial on [Custom Painting](https://docs.oracle.com/javase/tutorial/uiswing/painting/index.html).
Answer: Getting the mouse location for a component will deliver the coordinates relative to the component's top left location. If you ask the container's location you may get different coordinates for the same point, and this continues up to the root.
If you want to translate coordinates from one component to another, it is best to go via absolute coordinates (the screen). There are a few methods that help you with that:

MouseEvent::getLocationOnScreen() - helps to go absolute
Component::getLocationOnScreen() - helps to go relative to a known component
Container::getComponentAt() - but this works in relative coordinates and helps to find the component

But looking overall it seems you want to use the coordinates to place components on absolute coordinates. Would this kind of involve your window is not resizable, and the whole layout is very static? Usually you would offload the calculation of coordinates to LayoutManagers, and you just pass on the rules how to place components (as in 'this component will be on the bottom of the window, from the very left to the very right. Grow as needed/possible).
Comment: *it is best to go via absolute coordinates* -  That is extra work. The question is to `to get the xy coordinates of the place I want to place a component.` In a Swing context this means you want to add a child component to a parent component. Therefore you need to know the xy coordinate on the parent component so you can set the location of the child component. So you add the MouseListener to the parent component which the code is currently doing. The issue is that the OP doesn't understand how custom painting and layout managers work.


add elements into the list in Java

Question: Here is the code:
class Test {
    public static void main (String[] args) throws Exception {
        java.io.File fail = new java.io.File("C:/Users/Student/Desktop/Morze.txt");
        java.util.Scanner sc = new java.util.Scanner(fail);
        while (sc.hasNextLine()) {
             String line = sc.nextLine();
             String[] lst = line.split(" ");
             int[] letter = new int[26];
             int[] sumbol = new int[26];
             for (int i = 0; i < lst.length; i++)
                 System.out.print(lst[i] + " ");
             System.out.println();
                     // How to add?
        }
    }
}

Please, explain how can I add all letters into list Letter and symbols into list Sumbol?
Content of the file Morze.txt:
A .-
B -...
C -.-.
D -..
E .
F ..-.
G --.
H ....
I ..
J .---
K -.-
L .-..
M --
N -.
O ---
P .--.
Q --.-
R .-.
S ...
T -
U ..-
V ...-
W .--
X -..-
Y -.--
Z --..

Thanks!
Answer: You don't have a list, you have an array(s). It appears you want to add the values to two arrays. However you appear to have some code in your loop which should not be in your loop.
Additionally your data is text/String not numbers/int values.
String[] letter = new String[26];
String[] symbol = new String[26];
int count = 0;
while (sc.hasNextLine()) {
    String line = sc.nextLine();
    String[] lst = line.split(" ");
    letter[count] = lst[0];
    symbol[count] = lst[1];
    count++;
}
for (int i = 0; i < count; i++)
    System.out.println(letter[i] + " " + symbol[i]);

Answer: I'm going to offer a solution that fixes your implementation because I think it might help you understand a few concepts.  However I would recommend once you get it working that you go back and read about the Java List interface and re-write your code.  Lists are much cleaner way of maintaing sequences that may grow or shrink in length and will greatly reduce the complexity of your code.
You should start by moving your letter and symbol array declarations out of your while loop.  Variables within a block in Java are scoped to its bounds.  In other words, no statement outside the while loop has visibility of either array.  This has the side-effect of creating a new array for every line you parse using your scanner.
    int[] letter = new int[26];
    int[] sumbol = new int[26];
    while (sc.hasNextLine()) {
         String line = sc.nextLine();
         String[] lst = line.split(" ");

Next you'll need to know where to put your current symbol/letter in the array, an index.  So you'll want to keep a count of how many lines/symbols you've processed so far.
    int[] letter = new int[26];
    int[] sumbol = new int[26];
    int numberOfSymbolsProcessed = 0;
    while (sc.hasNextLine()) {
         String line = sc.nextLine();
         String[] lst = line.split(" ");

Now you have two arrays and an index into each, add the symbol and letter to the array as follows...
    int[] letter = new int[26];
    int[] sumbol = new int[26];
    int numberOfSymbolsProcessed = 0;
    while (sc.hasNextLine()) {
         String line = sc.nextLine();
         String[] lst = line.split(" ");
         letter[numberOfSymbolsProcessed] = lst[0];
         sumbol[numberOfSymbolsProcessed] = lst[1];
         numberOfSymbolsProcessed = numberOfSymbolsProcessed + 1;

Answer: This would be an excellent usecase for the List interface.
   List<String> list = new LinkedList<String>();

   while (sc.hasNextLine()) {
         String line = sc.nextLine();
         list.addAll(Arrays.asList(line.split(" ")));
   }

Answer: If you know that your file will either have letters or symbols, then, what you can do is to use the Pattern class and use a regular expression such as
^[a-z][A-Z]+$

to check if the given string, in your case it will be lst[i] has one or more letters. The ^ at the beginning and $ at the end ensure that you have only letters in the string.
If the string matches the pattern, than you know that it is a letter, so you can add it to the Letter list. If it does not, you can add it to the symbol data structure.
I recommend that you do not use arrays,  but rather dynamic data structures such as an ArrayList for your lists since this will grow dynamically as you add elements to it.
For more information regarding the pattern class, you can check this tutorial

add elements into the list in Java


Lie derivative of a scalar and PDE

Question: I posted this on the physics stackexchange, but they told me to post here, as it may be more relevant.
I am reading about differential geometry, and in particular the Lie derivative and its relation to (relativistic) hydrodynamics. In particular, I was wondering if, given two scalar functions $f(\mathbf{x}),~g(\mathbf{x})$, it is possible to solve the following equation:
$$\mathcal{L}_Z[f]=Z^\mu\partial_\mu f=g,$$
where $Z=Z^\mu\partial_\mu$ is an arbitrary vector field. Since I am thinking of hydrodynamics here, I am considering the manifold associated to $Z$ to be Euclidean space, but I would be interested to know how it works for arbitrary manifolds.
Is their a theorem that guaranties the existence of a solution? I am okay with existence, I don't necessarily need a way to find the solution. If there is no such proof, what are the restriction one needs to impose on $Z$? If there is a proof, is it also valid for tensor quantities, ie is there a solution to
$$\mathcal{L}_Z[f^{\mu_1...\mu_n}_{\nu_1...\nu_m}]=g^{\mu_1...\mu_n}_{\nu_1...\nu_m}.$$
Comment: Solve for what,  given $f,g$ do you want to solve it for $Z$?
Comment: Knowing $g,Z$ I want to solve it for $f$
Comment: Cross-posted from http://physics.stackexchange.com/q/98281/2451
Comment: I posted a related question here: https://math.stackexchange.com/questions/4554988/solutions-of-a-differential-equation-with-lie-derivative Please have a look.
Answer: The zeros of $Z$ form an obvious obstruction, as $g$ must vanish there also, to order no less then $Z$. Consider for example, in one variable,
$Z=x^2\partial_x,$ $g(x)=x.$
Away from the zeros of $Z$, your equation can be solved, locally, for any $g$, as $Z$ can be ''rectified'', i.e. one can find coordinates $x_1, \ldots, x_n$ so that $Z$ is the partial wrt $x_1$, and the equation is solved by integrating $g$ wrt $x_1$.
Globally, even away from zeros of $Z$, there might be obstructions, if $Z$ has closed integral curves. Consider for example in the plane, $Z=-y\partial_x+x\partial_y$.
Comment: I posted a related question here: https://math.stackexchange.com/questions/4554988/solutions-of-a-differential-equation-with-lie-derivative . Could you please have a look at the slightly different conditions?

Lie derivative of a scalar and PDE


Share AsyncStorage from iOS react native app with Apple Watch

Question: I'm developing the main app with react native and the Apple Watch with Swift.
The main app (react native) uses AsyncStorage to store some values, that then are used as params for a fetch that shows a list.
After running the simulator, I found manifest.json inside
<code>~/Library/Developer/CoreSimulator/Devices/D10E869B-040B-446F-9B8B-754F111442EC/data/Containers/Data/Application/AC837AFE-312B-4861-906D-EC9EEE7D029B/Document
s/RCTAsyncLocalStorage_V1</code>
with the data inside.
I need to access those values in the Apple Watch in Xcode to do the same job as the iOS app. How do I access that data?
Comment: If the phone and Watch app use the same Apple user account you can sync the app data using iCloudKit: https://developer.apple.com/icloud/cloudkit/
Answer: Since Apple Watch apps run independently from iOS app since watchOS 2, there's really no way to directly access the data stored locally on iPhone — you'll need to maintain some form of communication between your iOS and watchOS apps.
The framework intended for this is called WatchConnectivity. I see two more-or-less suitable solutions for your case:

Using transferFile to transfer your file from an iOS device to an Apple Watch whenever it got updated. The viability of this option highly depends on how big your file is.
Or you can just use updateApplicationContext to pass an already serialized data instead of transferring a raw JSON file — again, highly depends on your specific needs.

Unfortunately, I don't know how WatchConnectivity is supposed to work with ReactNative. If you want a deeper introduction to this framework — I highly recommend watching this amazing video from WWDC 2015.


p-values from `t.test` and `prop.test` differ considerably

Question: Testing a difference in hits (ones versus zeros) between two independent groups $X$ and $Y$ should be possible with a t-test, according to the following considerations:

$x_i\in\{0,1\}$ is the measurement for the $i$-th item im group $X$, and $y_i\in\{0,1\}$ the same for group $Y$
the proportion in each group is the mean value of the measurements, i.e. $\mu_X=\sum_i x_i/n$ and $\mu_Y=\sum_i y_i/n$
the difference of mean values $\mu_X$ and $\mu_Y$ in two groups can be tested with a t-test

In this particular case, a proportion test (function prop.test in R) is an alternative test option. Interestingly, the results are quite different:
> x <- c(rep(1, 10), rep(0, 90))
> y <- c(rep(1, 20), rep(0, 80))
> t.test(x,y,paired=FALSE)
t = -1.99, df = 183.61, p-value = 0.04808
> prop.test(c(10,20), c(100,100))
X-squared = 3.1765, df = 1, p-value = 0.07471

Note the higher p-value of the prop.test. Does this mean that a t-test has a higher power, i.e., can distinguish between $H_0$ and its alternative already for smaller $n$? Is there a reason why a t-test should not be used in this case?
Addition (Edit: resolved in a comment under the answer by Thomas Lumley below): The result of the t-test is even more surprising in the light of the observation that even the asymptotic ("Wald") 95% confidence intervals of both measurements overlap (0.1587989 > 0.1216014):
> library(binom)
> binom.confint(10, 100, method="asymptotic")
      method  x   n mean      lower     upper
1 asymptotic 10 100  0.1 0.04120108 0.1587989
> binom.confint(20, 100, method="asymptotic")
      method  x   n mean     lower     upper
1 asymptotic 20 100  0.2 0.1216014 0.2783986

As confidence intervals based on the t-distribution should be even wider than those based on the normal distribution (i.e. $z_{1-\alpha/2}$), I do not understand why the t-test reports a significant difference at the 5% level.
Comment: Most of the difference is the continuity correction which was applied in the chi-squared but not in the t-test. The remainder of the difference is the same as the difference between z-test and t-test. If you use `correct=FALSE` in the chi-squared you will see the p-value is fairly close to that of the t-test, or if you compute the continuity-corrected t-test and compare with the above chi-squared, you'll see the two fairly close again.
Comment: @glen-b Ah yes, this makes the difference. And the continuity correction makes the test overly conservative. I have found simulations by Agostino et al. (Am. Stat. 42, pp. 199-201, 1988) that show that the t test or the *uncorrected* chi square test (`correct=FALSE`) has an actual $\alpha$ probability much closer to the nominal level than the corrected chi square test. The t test is thus perfectly ok in this case, and my question is answered.
Answer:
A difference between p-values of 0.048 and 0.074 is not large. This can easily happen between tests that don't do exactly the same but a similar thing.

The theory of the t-test is for normally distributed data, which your data obviously are not. You're right that the t-test can be justified as an approximation, but there's no reason to use an approximation if a more precise test (namely the proportion test) is available. For sure there is no reason to expect the t-test to have a better power, or only in case that it is anticonservative, which is not a good thing (being an approximation, one would probably need to simulate what its finite sample characteristics are in this situation).

Edited after looking up the reference Agostino et al. ("The Appropriateness of Some Common Procedures for Testing the Equality of Two Independent Binomial Populations", Am. Stat. 1988) given by cdalitz. This reference states that prop.test with continuity correction is too conservative whereas the t-test as well as the prop.test without continuity correction are normally closer to the nominal level, if occasionally anticonservative (which in may view not necessarily justifies an overall recommendation). This was also mentioned in the answer by Thomas Lumley.
If we're ignoring the continuity correction for a moment, there are two differences between the t-test and prop.test (which is not fully documented but I think it does the z-test based on normal approximation).
(a) prop.test uses the knowledge that the variance of the Binomial is $np(1-p)$ rather than using a sample variance based on normality. In my view what prop.test does here should clearly do better, as it is based on information about the specific setup used here.
(b) prop.test uses a normal approximation whereas the t-test uses a t-approximation. Now both of these, applied to the Binomial situation, are asymptotic in nature (the t-distribution is only precise if the underlying data are normal which they aren't here), and actually they are asymptotically equivalent. Although the normal approximation looks more intuitive based on the Central Limit Theorem, this doesn't imply by any means than the normal works better than the t in the finite sample situation (and the t is as well justified by the CLT, if only indirectly). The t-distribution is motivated by the normal assumption, but in fact it may also be the case that the asymptotic normal distribution of prop.test underestimates the finite sample variability because it ignores the variability in the variance estimation, and the t-distribution, despite here not precisely justified, may do a better job at that.
So I now believe that potentially (as could be confirmed by simulations, maybe somebody has done that?) the best thing to do could be using the test statistic of prop.test, i.e., the "correct" variance estimation, but replacing the asymptotic normal distribution by a t-distribution, which in some sense may put together the advantages of them both.
Comment: +1 @Alexis A difference between p=0.048 and p=0.074 is trivial if you are using p-values as indices of evidence against the null hypothesis within the statistical model chosen. The difference _may_ be interesting if you are using a cutoff of p=0.05 to distinguish between a 'significant' result and a 'not significant' result, but you probably shouldn't be doing that. See here: for a start https://stats.stackexchange.com/questions/16218/what-is-the-difference-between-testing-of-hypothesis-and-test-of-significance/16227#16227
Comment: @lewian "If somebody would use the t-test in a submission and I were reviewer, I wouldn't accept it" Although a reviewer has the power to do so, I would not reject an arcticle because the authors use a different test method than I prefer. After searching more about this problem, I found a paper by  Agostino et al. ("The  Appropriateness of  Some Common Procedures for Testing the  Equality of Two Independent Binomial  Populations", Am. Stat. 1988), who made this investigations and eventually recommended the t-Test or the uncorrected chi squared test (`prop.test(...,correct=FALSE)`.
Comment: –1 "A difference between p-values of 0.048 and 0.074 is not large." This statement depends on the context, and is not always true.
Comment: "I don't know how to do paragraphs within an item of a numbered list" -- find a post with a numbered list that does it and look at the markdown for that post. There's an example here: https://stats.stackexchange.com/questions/485348/constant-information-scale-transformation/485392#485392
Comment: Fair enough, but the continuity issue is the same with the t-test, except there it's not "corrected". If somebody would use the t-test in a submission and I were reviewer, I wouldn't accept it unless the author would run the simulations themselves to convince the reader that the t-test is better. Until that happens I believe strongly that it isn't.
Comment: According to the output of prop.test, it uses a "continuity correction" and the test statistic is 2. These indicate that the proportional test also uses approximations. Which approximation is better might not be obvious, but as this is an old problem, I would guess that someone already has done a thourough analysis and simulations.
Comment: @Alexis The difference may make a large difference to how people interpret it (but they probably shouldn't, see @MichaelLew), however it is not large in the sense that it is very hard to imagine any distribution (from H0, alternative or elsewhere) and any test for which one of 0.048 and 0.074 is realistic to expect and the other one is not.
Comment: "The Difference Between "Significant" and "Not Significant" is not Itself Statistically Significant" https://www.tandfonline.com/doi/abs/10.1198/000313006X152649
Comment: @Lewian "however it is not large in the sense that it is very hard to imagine any distribution (from H0, alternative or elsewhere) and any test for which one of 0.048 and 0.074 is realistic to expect and the other one is not." This is false in epidemiology and population health.
Comment: @Alexis My statement was maybe not totally clear. I mean something like this: Find any test and any distribution of interest for that test so that for given small $\epsilon$ the probability of observing a p-value in $0.048\pm\epsilon$ is substantially different from having the p-value in $0.074\pm\epsilon$. If you can give or cite a counterexample, I'd be very interested. (Generally the null hypothesis won't do, because under $H_0$ the p-value is uniformly distributed, so both these probabilities will be the same.)
Comment: @cdalitz As a reviewer one can ask to do a certain thing differently without rejecting the paper.
Comment: @cdalitz Thanks by the way for the reference. Very interesting. I'm not quite sure though whether the results fully back up the recommendation, they seem quite ambiguous in my view, and power was not investigated. Anyway I have to admit that a case for the t-test can be made in one way or another. But surely using the knowledge of how the Binomial variance relates to the parameter, which is used by prop.test but not by the t-test, shouldn't hurt!?
Comment: @cdalitz Edited my answer.
Answer: The t-test can be quite robust to deviations from the normality assumption, particularly when sample sizes are large, so I understand why one might want to use a t-test for this task.
However, you know the parametric family; since the outcome is either $0$ or $1$, the distribution is completely characterized by the relative proportion, thus Bernoulli. Consequently, you can rely on a parametric test designed for a Bernoulli variable, which the t-test is not.
Methods that are robust to deviations from parametric assumptions are wonderful, since we typically do not know the type of population distribution. (If we did, why did we not determine the population parameters when we had the chance!?) However, the case of a binary variable is unique in how it is completely defined by the relative proportion and must be Bernoulli (or easy to represent as Bernoulli, such as calling "heads" and "tails" of a coin $0$ and $1$, respectively).
Comment: I think for investigating the power one would need to sample from the alternative, but I advise against it because I'm pretty sure that the only way a better power can arise is bias/being anticonservative. (Edited after the earlier comment was deleted.)
Answer: You're correct that the tests should be more similar.  They are tests of means, and for a light-tailed distribution, so you should expect them to agree.  What's more, the estimated variance $\hat p(1-\hat p)/n$ for a binomial distribution is extremely close to $s^2/n$
> var(x)/100
[1] 0.0009090909
> .1*(.9)/100
[1] 9e-04
> .2*(.8)/100
[1] 0.0016
> var(y)/100
[1] 0.001616162

What you're seeing is the continuity correction. If you try it without, the $p$-values are almost identical
> t.test(x,y)

    Welch Two Sample t-test

data:  x and y
t = -1.99, df = 183.61, p-value = 0.04808
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.1991454034 -0.0008545966
sample estimates:
mean of x mean of y
      0.1       0.2

> prop.test(c(10,20),c(100, 100),correct=FALSE)

    2-sample test for equality of proportions without continuity correction

data:  c(10, 20) out of c(100, 100)
X-squared = 3.9216, df = 1, p-value = 0.04767
alternative hypothesis: two.sided
95 percent confidence interval:
 -0.197998199 -0.002001801
sample estimates:
prop 1 prop 2
   0.1    0.2

The continuity correction for the chi-squared test is a bit controversial. It does dramatically reduce the number of situations where the test is anti-conservative, but at the price of making the test noticeably conservative. Not using the 'correction' gives p-values that are closer to a uniform distribution under the null hypothesis.  And, as you see here, not using the correction gives you something closer to the t-test.
Comment: Non-overlap of 95% confidence intervals is a much stronger criterion than a 95% confidence interval for the difference overlapping zero.  With equal variance and sample size, a 95% ci for difference overlaps zero if the difference is smaller than $1.96\sqrt{2}\sigma/\sqrt{n}|$ and two intervals overlap if the difference is smaller than $2\times 1.96\sigma/\sqrt{n}$. Each interval overlapping the other point estimate is much closer to a 5% threshold.
Comment: Thanks, this explains the difference! What I still do not understand is why the t-test reports a significant ($\alpha=5\%$)difference although the classic 95% confidence intervals $\pm z_{1-\alpha/2}\sqrt(\hat{p}(1-\hat{p})/n}$ (and, of course, also with $t$ instead of $z$) overlap.
Comment: Ah yes, thanks.!This follows from $Var(X-Y)=Var(X)+Var(Y)$ for independent $X$ and $Y$. The continuity correction seems to be indeed controversial in this case: Agostino et al. ("The Appropriateness of Some Common Procedures for Testing the Equality of Two Independent Binomial Populations", Am. Stat. 1988) investigated its application in this particular use case of comparing proportions and came to the conclusion that the *uncorrected* chi squared test or the t test should be used.


Arbitrary length full-measure rests in LilyPond

Question: In LilyPond one can make long full-measure rests with:

    \compressFullBarRests
    R1*12

which outputs:

Is there an engraver I can turn off, or some other way to remove the number from above the rest (for a multi-measure rest of arbitrary length)?
Also, is this the preferred way to engrave this, or is there some better way to specify arbitrary length rests?
To clarify, this is for a section in which another instrument has an improvised solo of arbitrary length.
Comment: If there is an improvisation going on, maybe consider using a fermata over a single R1 rest.
Comment: jTab (for producing guitar tab diagrams) processes indented code blocks on this site.
Answer: I've stumbled up on the answer to my own question. Either of the following should work:

    \set restNumberThreshold = #1000 % Some large number
    \override MultiMeasureRestNumber #'stencil = ##f

The first is a bit hackish and not very robust (it sets the number of rests required to display the number extremely high), but the second may have unintended consequences in some older versions of Lilypond.
Here is the final result:
Comment: Of course, `\compressFullBarRests` should be used as well.
Answer: Leaving out the number is an approach I have never seen in classical orchestral scores. Typically the last tutti note has a fermata, followed by a one-bar rest also having a fermata above the text "Cadenza". Of course, this leaves open, when to start again, which is the reason, why classical cadenzas end with a trill to be easily recognized. In smaller ensembles a glimpse or nod will also do.
Comment: Thanks, I may do that instead. I'll leave the question open though because I'd still like to know how to hide the text over full-measure rests.
Answer: In newer versions of LilyPond
<code>\override MultiMeasureRestNumber #'stencil = ##f
</code>
can be expressed as
<code>\override MultiMeasureRestNumber.stencil = ##f
</code>
or even shorter as
<code>\omit MultiMeasureRestNumber
</code>
All of that does exactly the same.  It's just syntactic sugar.


Sequence of odd and even partial sums of alternating harmonic series.

Question: Given the alternating harmonic series: $$ \sum^{\infty}_{n=1}{\frac{(-1)^{n+1}}{n}} $$
and if we let the sequence of its partial sums be $s_n$ then how can we express the sequence of even partial sums $s_{2n}$ and odd partial sums $s_{2n+1}$?
I did the following but am not completely sure if it is valid:
$$ s_{2n}= \sum^{2n}_{i=1}{\frac{(-1)^{i+1}}{i}}$$
$$ s_{2n+1}= \sum^{2n+1}_{i=1}{\frac{(-1)^{i+1}}{i}}$$
Then to show the first is increasing and the second is decreasing, can we just take $s_{2n+2}-s_{2n}$ and show that this is $> 0$? Similarly then taking $s_{2n+3}-s_{2n+1}$ and showing that this is $< 0$?
And to go one step further, how could we show that each of these sequences of partial sums has a limit? And then show that the limits are the same?
Comment: https://en.wikipedia.org/wiki/Alternating_series_test
Comment: $s_{2n} = \sum_{i=1}^n \frac{1}{2i-1}-\frac{1}{2i}=\sum_{i=1}^n  \frac{1}{2i (2i-1)}$
Comment: I don't quite get where the formula you've written comes from?
Answer: What you have done is fine.  Showing the increasing/decreasing nature works well.  You can invoke the alternating series theorem to show the whole series has a limit because the terms are alternating in sign and decreasing monotonically to zero.  If the whole series has a limit, every subseries converges to the same limit and you are done.
Comment: Ah okay I see, is there a way to directly prove that $s_{2n}$ and $s_{2n+1}$ have limits?
Comment: The subseries argument works fine.  Also they are monotonic and bounded above/below so have limits.
Comment: Ah yes okay I think I've got it now, thanks so much for your help!
Answer: Yes, you are correct on how to show that the first is decreasing and the second is increasing.
Now, since you know they are monotone, if you can show they are bounded, you will demonstrate that they have limits. For instance you can show that $$ 1>s_{2n+1} > 1/2$$ for all $n$.
That the limits are the same follows from the fact that the difference $$ |s_{2n+1}-s_{2n}| = \frac{1}{2n+1}\to 0. $$
Comment: Thanks, so we can show boundedness and then use the monotone convergence theorem?
Comment: Yeah. As others have said the alternating series test proves it all in one fell swoop but it seemed like the point of the exercise was to prove a special case of the alternating series test.
Answer: Since
$s_{2n}= \sum^{2n}_{i=1}{\frac{(-1)^{i+1}}{i}}
$,
$\begin{array}\\
s_{2n+2}
&= \sum^{2n+2}_{i=1}{\frac{(-1)^{i+1}}{i}}\\
&= \sum^{2n}_{i=1}{\frac{(-1)^{i+1}}{i}}+{\frac{(-1)^{2n+1}}{2n+1}}+{\frac{(-1)^{2n+2}}{2n+2}}\\
&= s_{2n}-{\frac{1}{2n+1}}+{\frac{1}{2n+2}}\\
&= s_{2n}-{\frac{1}{(2n+1)(2n+2)}}\\
&\lt s_{2n}\\
\end{array}
$
so $s_{2n}$
is decreasing.
Similarly,
$\begin{array}\\
s_{2n+3}
&= \sum^{2n+3}_{i=1}{\frac{(-1)^{i+1}}{i}}\\
&= \sum^{2n+1}_{i=1}{\frac{(-1)^{i+1}}{i}}+{\frac{(-1)^{2n+2}}{2n+2}}+{\frac{(-1)^{2n+3}}{2n+3}}\\
&= s_{2n+1}+{\frac{1}{2n+2}}-{\frac{1}{2n+3}}\\
&= s_{2n+1}+{\frac{1}{(2n+2)(2n+3)}}\\
&\gt s_{2n+1}\\
\end{array}
$
so $s_{2n+1}$
is increasing.
Since
$s_{2n+1}
=s_{2n}-\frac1{2n+1}
\lt s_{2n}
$,
all the
$s_{2n+1}$
are less than all the
$s_{2n}$.
Since
$|s_{2n+1}-s_{2n}|
=\frac1{2n+1}
\to 0
$,
the sequences
$(s_{2n})$
and
$(s_{2n+1})$
must approach
a common limit.


How to deny access on assets

Question: I have a static website, something simple, but everyone have access to my assets, and that don't like me, example:
www.mysite.com/assets the browser shows me:
Index of /assets

Parent Directory
css/
img/
js/

How can i render for every access to that url a 403 error page? I tried writing a .htaccess inside assets/ with "deny from all", and "Works fine for me", but that disable my css, img, js, everything on that directory, so this is not a solution.
Answer: You can simply add this line in your htaccess
<code>Options -Indexes
</code>
Comment: @anubhava sometimes lucky to look when a new question arrives

How to deny access on assets


The Category of Small Categories: a Zoo of Functors.

Question:
Wouldn't it be great if there was some website or something that visualized (some small portion of) the category of small categories(*)?

Imagine you click on some categories from a list, say, then "pop!" - they appear as dots in a digraph (that's not necessarily a commutative diagram) you can reshape and move around, where each arrow is a (standard) functor. If you click on an arrow, it gives you some details about the functor.

Does such a thing exist?

If not, someone please make it! I haven't found anything like it so far and I don't understand why. It could be quite appealing if done properly. It might even be useful, like the OEIS, as something to explore the subject with :)

Something like this would be spectacular! :D

(*) . . . or the quasicategory of all categories.
Comment: "Regardless of someone's level of experience with Number Theory, I think having a little popup telling you "did you know that there's a sequence of the numbers of trees with $n$ unlabeled nodes?" is nowhere near as useful as *actually knowing the Number Theory surrounding that construction*. In other words, simply looking at sequences of numbers doesn't teach you anything about the actual math. I think I can also safely say that there are no revelations, for the beginner or the expert, obtainable solely by stringing together known constructions between sequences."
Comment: Is possible that a map like this can help someone that is researching in some field and then he can discover that the category he is studyng has links with total different fields. This work can be maybe usefull like a pratical map of mathematics.

In my opinion can be usefull and if not really useful, can be really a curious and beautiful thing.
I don't know if someone will do (did) this but it need more attention without any doubt:I will add another 50 reps bounty if the user's one will be useless.
Comment: I didn't downvote, but I'm not really sure why one would want such a site.
Comment: Regardless of someone's level of experience with categories, I think having a little popup telling you "did you know there is a functor from $\mathsf{Top}_{*}$ to $\mathsf{Grp}$ called the fundamental group functor" is nowhere near as useful as *actually knowing the algebraic topology surrounding that construction*. In other words, simply looking at a diagram of categories doesn't teach you anything about the actual math. I think I can also safely say that there are no revelations, for the beginner or the expert, obtainable solely by stringing together known constructions between categories.
Comment: I'm not really sure why anyone *wouldn't* . . .
Comment: @Shaun Try asking the question on https://forum.azimuthproject.org/discussions - there are many category-lovers.
Comment: Why the downvotes?
Comment: Can you give an example of how it would be useful?
Comment: As an introductory tool, functioning something like an encyclopedia or dictionary; to *explore*; maybe to customise; to organise one's thoughts; to be something *beautiful* . . .
Comment: @Shaun: Excellent, I'm glad we agree on that.
Comment: **Thank you**, @MphLee :)
Comment: Somewhere in the noughties, Scott Aaronson started one for complexity classes. Enough people seem to think it's still a good idea: https://complexityzoo.uwaterloo.ca/Complexity_Zoo
Comment: @Shaun Do you mean _creating a dataset of categories_ (database, wiki, manual compilation, anything...) or they way of presenting it? Because these are 2 different questions. I can help with the second (just mail me), but not much with the first (I mean, I can suggest tools or, good places to look at like [The n-Category Café](https://golem.ph.utexas.edu/category/) and [Baez's blog](https://johncarlosbaez.wordpress.com/), but I am not much a category guy myself).
Comment: @Shaun If you get data for (at least a tiny set of) categories (and tell me what you want to see, e.g. with MS Paint), I would be happy to make a visualization.
Comment: This doesn't seem like such a silly idea. I really don't understand why it's being downvoted. Please tell me so I can learn from it.
Comment: I like the idea, but what's the question that we could answer here that's worth no more than 50 points?
Comment: @EnjoysMath Whether or not there's such a website. I think this is worth more than 50 points to answer, especially if someone has taken the time to actually make it because of this question.
Comment: I made the bounty only bevause i want to draw more attention.
Comment: @Shaun what about crossposting this on meta?
Comment: @MphLee Maybe, but I'm not sure that's appropriate. It might not be welcome :/
Comment: @PiotrMigdal, ah, yes, that is an important distinction. Thank you. Is it too much to ask for both? (That is not a rhetorical question.) The latter is most relevant here at any rate. I'm willing to help create something like this but I doubt I've the time nor the expertise to lead the project :)
Answer: I've had fantasies of a similar general "math explorer" project that mathematicians can go to to look up theorems, definitions, vote on elegant proofs, etc.  It would also have a 3D viewer to view all related theorems in an area and and you can see the areas that "need work" (for instance).  I also want it to implement a fuzzy parser that understands through typos and even word substitution and can be updated with new input-to-output mappings very easily (ie. you don't have to write a grammar of valid input, but merely provide an example and what you want the output to be, or map it to another valid fuzzy input).
As you can see your project if left open to innovative features, which I think it should, will have a few non-trivial computer science & engineering challenges.
These links should get us started if anyone else is serious:

Project:

GitHub Repo For Hosting Code
Project Brainstorm Concept Map

Algorithms:

Levenshtein Automata
Earley Parser
Graph Drawing

Libraries & Tools:

MonoDevelop (all OS)
Visual Studio 2010 C# Express
OpenTK (3D Graphics, Audio, etc.)

Related:

Group Explorer App

First thing we need to decide is a primary development language (for the explorer gui), or even if we're going to make a standalone app at all.
Please email me for editing privelages on the concept map:
enjoysmath at gmail.
Let me know if you'd like to contribute and need help setting up any of the tools.
Comment: +1 I upvoted this as soon as I saw it! (I was on my phone when I commented about an hour ago.) This answer might give anyone serious about it the leg-up they need. Thank you! It's up to @MphLee what he does with his, of course, but I think this has earned *a* bounty (but not an accept).
Comment: I seem to be the only interested coder (no one's emailed me yet), so I will work on it when I get time soon.
Comment: I will just use VS 2010 + WinForms + OpenTK.  The cross-platform dev environments are commercial so we'd have to raise money before having it work on anything (eg. Xamarin & Xojo).
Comment: Corrections: "he *or she*", "his *or hers*" - sorry! :)
Comment: He* was ok @Shaun
Comment: Well, now I know, @MphLee :)
Comment: I might use MonoDev + GTK# + OpenTK since it boasts Win + Lin + Mac.
Comment: (I'm terribly sorry, @EnjoysMath, that I forgot to award my latest bounty to you; I was at a conference all day!)


On proving that a compact metric space is bounded

Question:
I am trying to prove the above claim. My question is on the bolded part and if I am correct in making that statement. A metric space is bounded if there exists an $M \in \mathbf{N}$ such that $\rho(x, y) \leq M$ for all $x, y \in X$. The negation would be, a metric space is not bounded if for every $n \in \mathbf{N}$, there exist $x, y \in X$ such that $\rho(x, y) > n$.
I'm not sure if what I have written in my proof is correct.
Edit: The $X$ should be an $E$.
Comment: You haven't defined $X$ anywhere in your proof, so no, I would not call it correct.
Comment: The $X$ is a typo. It should be $E$. I will edit the OP.
Answer: Here is a more direct proof. Pick $x \in E$, and let $U_n = B(x, n)$. Then $U_n$ is an open cover, and so has a finite subcover. In particular, $E \subset B(x,n)$ for some $n$. Hence $\rho(x,y) < 2n$ for all $x,y \in E$.
Comment: Nice proof!! +1
Comment: Oh, I think I understand. The proposed collection is *all* the open balls $\{ B_d (x, r) | r > 0 \}$, and compactness of $E$ guarantees some finite subcollection $\{ B_d (x, r_1), ..., B_d (x, r_m) \}$ that covers $E$, in which case we can take a maximum $n = \max_{1 \le k \le m} \{ r_k \}$. Makes sense!
Comment: This argument seems to assume that there exists $B (x, n)$ that contains $E$. $\{ U_n \}$ only has a finite subcover (that is itself) if it indeed covers $E$, but we don't know *a priori* if such $U_n$ exists, right? What am I missing here?
Answer: Let $e\in E$ be a point and let $f:x\in E\mapsto d(x,e)\in\mathbb R$, with $d$ the distance function. This is continuos, so Weierstrass' theorem tells that $f$ is bounded. This means, exactly, that $E$ is bounded.
Comment: The argument in the image is really needlessly elaborate!
Answer: An equivalent definition of a bounded subset $E$ of a metric space $X$ is that there exist $x \in X$ and $\epsilon > 0$ such that $E \subset B(x,\epsilon)$, that is, $E$ is contained in some ball. The negation would be that for any $x \in X$ and any $\epsilon>0$ there is a $y \in E$ such that $\rho(x,y)>\epsilon$, that is $y \notin B(x,\epsilon)$ (that means $E$ is not contained in any ball). Fix $x \in E \subseteq X$, choose a $y$ (call it $x_n$) for every $\epsilon=n$ and you get what you want.


O que significa o operador "=>"?

Question: Eu estava vendo algumas soluções em JavaScript e em um caso eu vi esta linha de comando: return args.reduce((s, v) => s + v, 0);. Porém não sei o que significa o operador =>.
Qual a função dele?
Answer: É conhecido como  Arrow functions.
Uma Arrow function é exatamente como uma função/callback normal, só que menos verbosa e referências de instâncias como this são tomadas dos "arredores" (o que evita .bind() ou aqueles var that=this).
Então:
var numbers = [1,2,3];
squares = numbers.map(x => x * x);

que é equivalente a:
squares = numbers.map(function (x) { return x * x });

Eu não quero escrever uma extensa resposta com todos os detalhes porque isso é redundante. Há tanto sobre isso lá fora que não vale o esforço. Como exemplo, aqui há um EXCELENTE conteúdo sobre isso:
http://exploringjs.com/es6/ch_arrow-functions.html
Comment: @Gabe Eu discordo. Isso é mais válido para assuntos pouco abordados e com escasso conteúdo. Aqui no SOpt há uma cultura muito estranha de ser redundante demais e escrever respostas tão longas e enfadonhas quando tudo que é preciso é apenas uma resposta direta. É exatamente o caso aqui: Há excessivo conteúdo sobre o assunto lá fora.
Comment: @felipsmartins concordo em partes, mas o que o Gabe disse não foi pra escrever uma "resposta longa" e sim talvez pra colocar no inicio mais direto e separar um sub-topico para outros detalhes que podem vir a ser interessantes, ninguém disse que é obrigatório, isso é apenas uma dica, visto que o link esta em inglês. Entenda como uma critica construtiva e não uma obrigatoriedade, a resposta já esta ótima do jeito que esta +1.
Comment: Boa resposta mas, sobre o seu comentário no final, acho que mesmo tendo muito conteúdo disponível em outros lugares, sempre vale a pena adicionar o máximo possível de detalhes e informações na sua resposta. Principalmente se a maior parte do conteúdo externo está em inglês.
Answer: Isto é uma função lambda, ou como costuma ser chamada, função flecha. É uma função anônima com uma sintaxe mais simples. disponível desde EcmaScript 6.
Os parênteses à esquerda são os parâmetros e o que está à direita é o corpo da função que já é a expressão que gera o resultado que será retornado na função.
Coloquei no GitHub para referência futura.

O que significa o operador "=>"?


Age word problem

Question: Adam is now one quarter of his father's age and in $5$ years time, his age will be one-third the age of his father. How old is Adam now?
I have trouble with these kind of questions and I've spent half an hour trying to figure it out but I still don't know how to get the answer D:
Comment: How did you approach it? Can you show your thoughts in that half hour, and what exactly it is that is giving you trouble?
Comment: Try to designate ages as certain variables then "translate" these words into equations to solve
Comment: This is not a linear algebra question!
Answer: Let $x$ be Adam's current age, and let $y$ be his father's current age. The statement

Adam is now one quarter of his father's age

means $$x=\frac{1}{4}y,$$ and the statement

in 5 years time, his age will be one third the age of his father

means $$(x+5)=\frac{1}{3}(y+5),$$ because in $5$ years, Adam's age will be $x+5$, and his father's age will be $y+5$.
So, you have the system of equations
$$\begin{align*}
x&=\frac{1}{4}y\\\\\\\\
(x+5)&=\frac{1}{3}(y+5)
\end{align*}$$
which can be rewritten as
$$\begin{align*}
4x&=y\\\\\\\
3x+15&=y+5
\end{align*}$$
and then further rewritten as
$$\begin{align*}
4x-y&=0\\\\\\\
3x-y&=-10
\end{align*}$$
Do you know how to proceed from here?
Answer: Let Adam's current age be $x$ years so that the current age of his father is $4x$ years
According to the given condition $x+5=\frac{4x+5}3\implies 4x+5=3x+15\implies x=10$

Age word problem


Understanding less trivial integration by trig substitution.

Question: In less trivial integration problems, using trig substitution (1.1), I keep fumbling over when and what trig identities to use.

One trig identity I need help proving/understanding is how/why $\left[9-9sin^2\theta\right]=\left[9cos^2\theta\right]$ (?)

Once I've establish the original variables in terms of $\theta$, was is the best way, or maybe a general way if there is one, for dealing with the numerator equation?
For example, after the trig substitution, is the common next step another form of integration or is it merely simplification using identities. (etc.)
In general it seems I keep drifting into harder, longer integration, so I'd like help getting a better understanding of 'the next step' following the substitution.

(1.1) Example problems for reference:
$$\int\frac{8u+4}{(u^2-u)-2}du \qquad \int\frac{6z-3}{(z^2+2z)+2}dz \qquad \int\frac{\sqrt{9-x^2}}{x^2}dx$$
Comment: For the trig identity, $sin^2(\theta)+cos^2(\theta)=1$. Therefore multiply by $9$ and move the $sin^2(\theta)$ to the other side. Or are you asking for a proof of $sin^2(\theta)+cos^2(\theta)=1$?
Comment: @DonAntonio The reason the given problems are in this form is to emphasize the need to complete the square. It's trivial and could as easily be omitted, it's just a form of habit and convention I use.
Comment: Those parentheses in the first two integral's denominators are completely useless. Did you mean otherwise?
Comment: @George1811 I didn't realize how obvious that was haha. That's exactly what I was asking for, thanks.
Answer: One example quick, without substitution or stuff:
$$\int\frac{8u+4}{u^2-u-2}du=4\int\frac{2u-1}{u^2-u-2}du+\frac83\int\left(\frac1{u-2}-\frac1{u+1}\right)du=$$
$$=4\log(u^2-u-2)+\frac83\left(\log\frac{u-2}{u+1}\right)+C=\ldots\text{(continue simplifying if you will)}$$
Comment: I don't understand how you got the "$+ 8/3\int\dots du$" part. Could you explain where this came from?
Comment: @ChongWaldo, you should try to do the algebra: $$\frac1{u-2}-\frac1{u+1}=\frac3{(u-2)(u+1)}$$ The $\;8\;$ comes from $$8u+4=4(2u-1)+8$$
Answer: I'd say the only example out of the 3 for which the use of trig substitution is highly recommended is the integral $\int\frac{\sqrt{9-x^2}}{x^2}dx$.
$\int\frac{\sqrt{9-x^2}}{x^2}dx$
$\sin\theta=\frac{x}{3}$
$x=3\sin\theta$
$dx=3\cos\theta\ d\theta$
$\theta=\sin^{-1}\left(\frac{x}{3}\right)$
$\cos\theta=\frac{\sqrt{9-x^2}}{3}$
$\sqrt{9-x^2}=3\cos\theta$
$=\int\frac{3\cos\theta}{9\sin^2\theta}\times3\cos\theta\ d\theta$
$=\int\cot^2\theta\ d\theta$
$=\int\left(\csc^2\theta-1\right)d\theta$
$=-\cot\theta-\theta+c$
$\cot\theta=\frac{\sqrt{9-x^2}}{x}$
$=-\frac{\sqrt{9-x^2}}{x}-\sin^{-1}\left(\frac{x}{3}\right)+c$