Looking for a proof check. I've written out the argument as it reads most easily to my own eyes.  Let $S$ be a set and suppose by contradiction that $\exists f:S \to P(S)$ with f surjective. Define $B = \{x \in A: x \notin f(n)\}$. $f$ surjective $\implies B = f(x_0)$ for some $x_0$. $x \in B \iff x \notin f(x)$ but $B = f(n_0)$ so $n_0 \in f(n_0) \iff n_0 \notin f(n_0)$ which is a contradiction. Therefore $\nexists f$.
$\DeclareMathOperator{\card}{card}$From Problem-Solvers Topology  Prove the following: CANTOR'S THEOREM If $A$ is a set, then $$\card A &lt; \card \mathcal{P}(A)$$ where $\card A$ stands for the cardinality of set $A$.  My Answer If $A = \emptyset$, then $\card A =0$ and $\card \mathcal{P}(A)=1$. If $A = \{a\}$, then $\card A=1$ and $\card \mathcal{P}(A)=2$. So suppose that $A$ has at least two elements. Define a function $f: A \rightarrow \mathcal{P}(A)$ such that $f(x) = \{x\}$ for all $x \in A$. Then $f$ is injective. But it cannot be surjective, because for any two distinct elements $a,b \in A$, there is no element in $A$ that is sent to the set $\{a,b\}$ in $\mathcal{P}(A)$. Therefore, there is no bijection, and $\card A &lt; \card\mathcal{P}(A)$. Do you think my answer is correct? Thanks in advance
Why can't Mathematica integrate this? TTY doesn't wait for password I upgraded from 16.04 to 18.04. When I press Ctrl+Alt+F3 I get the terminal which prompts for the username. When I type my username and press Enter, it doesn't wait for my password (its as if I pressed Enter without entering anything). Even if I enter something, the text shown in plaintext and then it keeps on saying my password is wrong. After few times, the screen is cleared and it prompts for my username again and the same loop goes on. Let $A$ , $B$ be topological spaces such that there for some subset $D$ of $B$ there is a homeomorphism form $A$ to $D$ and for some subset $E$ of $A$ there is a homeomorphism form $B$ to $E$ ; then must there exist a homeomorphism from $A$ to $B$ ? In some books the word "if" is used in definitions and it is not clear if they actually mean "iff" (i.e "if and only if"). I'd like to know if in mathematical literature in general "if" in definitions means "iff".  For example I am reading "Essential topology" and the following definition is written:     In a topological space $T$, a collection $B$ of open subsets of $T$ is said   to form a basis for the topology on $T$ if every open subset of $T$ can be written as a union of sets in $B$.   Should I assume the converse in such a case? Should I assume that given a basis $B$ for a topological space, every open set can be written as a union of sets in $B$?  This is just an example, I am not asking specifically about this sentence. What is the next perfect square of the form 14444... in decimal notation? We know that $12^2 = 144$ and that $38^2 = 1444$. Are there any other perfect squares in the form of $\frac{13}{9} (10^n - 1) + 1$ (i.e. $1$ followed by $n$ $4$'s), and how would we prove it? Is the expression      All women who are mothers of daughters are here.   correct? I mean every woman who has at least one daughter is here. Alternatives to one-way ANOVA for heteroskedastic data I might end up teaching philosophy in Finnish lukio/gymnasium. I will not get an opportunity to practice teaching it - I do get to practice teaching mathematics a fair deal, though. (The situation is somewhat unfortunate.) I have taken subject studies in philosophy at university. They amount to around 60 credits (ECTS).  Suppose I give the students an exam, which asks them to write an essay or two. After that my task is to grade the exams in a fair way and comment them in such a way that the students can learn from the feedback.  -  Suppose the task was to write an essay on the problem of universals - nominalism and realism, say. Let us say 6 points is the perfect score for this task.  I would expect the students to define nominalism and realism (2 points, maybe?) and explain the problem (2 points). Remaining two points for taking some stance and arguing for it - realism is more reasonable because so and so. Partial credits for demonstrating only partial understanding.  -  Am I missing some important aspects of philosophical thinking? Should I emphasize the different parts of an answer in a different way? I suspect my perspective is influenced by fairly extensive mathematics education - is there something particular I should watch out for? Rolling back a completely changed question was originally asked August 9, and received answers. A month later, the OP  the question, invalidating the existing answers. I rolled it back, and left a comment to say that a new question should be opened, but the OP changed it back saying "There is no rule about it, so you can't edit my post."  There is also a bounty on this question, making things more interesting.  What are the guidelines on completely changing a question or rolling back changed questions? Was I out-of-line rolling back the question?  I have no desire to get into an edit war, so I'm not going to touch the question again. If a moderator wants to get involved, great. I came across a  where a comprehensive example would be very useful. So I wrote an example program showing one way to solve their problem.  My problem is that when I was done creating it, and testing to make sure it worked, it was over 400 lines in 18 files. My example included source code, header files, and scripts for building the example in a variety of circumstances.   It's a working and tested, so it's of huge value to illustrate the tricky solution, but because it's all there, my response was huge! Is there a better way of posting my code dump?  Edit:  I guess there isn't a current "best way" to include a large chunk of code, so I made this a feature request and tried to add some ideas.  Perhaps code entries that are longer then a certain number of lines, or ones that have been specifically marked could initially be displayed as "collapsed", and someone could expand them if they want to see them?  Or maybe, like attaching images, users with enough reputation could attach an archive of files. They could be displayed as "attached code" (initially collapsed also).  Some problems have simple answers that unfortunately touch disproportionately large parts of the program, or can be solved in slightly different ways depending on the environment. I feel that stackoverflow needs a way of capturing these large solutions. Sometimes, they're large chunks of code. In my case, the code was small, but there were many files.  Using github or a similar code repository is great, but we risk linkrot (even for big guys like github) and loose the community editing, commenting, and voting abilities.  I understand the problems that could come from with people dumping whole "I can't get this to work" packages, but surely we already have a solution for that in moderation.  Edit again:  I'm starting to see that this may have been already addressed in posts like    , and    If you feel this a dupe, I'm open to having it "closed as already addressed" What's a way to implement a flexible buff/debuff system? Overview:  Lots of games with RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit."  The specifics of each type of buff aren't really relevant.  I'm looking for a (presumably object-oriented) way to handle arbitrary buffs.  Details:  In my particular case, I have multiple characters in a turn-based battle environment, so I envisioned buffs being tied to events like "OnTurnStart", "OnReceiveDamage", etc.  Perhaps each buff is a subclass of a main Buff abstract class, where only the relevant events are overloaded.  Then each character could have a vector of buffs currently applied.  Does this solution make sense?  I can certainly see dozens of event types being necessary, it feels like making a new subclass for each buff is overkill, and it doesn't seem to allow for any buff "interactions".  That is, if I wanted to implement a cap on damage boosts so that even if you had 10 different buffs which all give 25% extra damage, you only do 100% extra instead of 250% extra.  And there's more complicated situations that ideally I could control.  I'm sure everyone can come up with examples of how more sophisticated buffs can potentially interact with each other in a way that as a game developer I may not want.  As a relatively inexperienced C++ programmer (I generally have used C in embedded systems), I feel like my solution is simplistic and probably doesn't take full advantage of the object-oriented language.  Thoughts?  Has anyone here designed a fairly robust buff system before?  Edit: Regarding Answer(s):  I selected an answer primarily based on good detail and a solid answer to the question I asked, but reading the responses gave me some more insight.  Perhaps unsurprisingly, the different systems or tweaked systems seem to apply better to certain situations.  What system works best for my game will depend on the types, variance, and number of buffs I intend to be able to apply.  For a game like Diablo 3 (mentioned below), where nearly any bit of equipment can change a buff's strength, the buffs are just character stats system seems like a good idea whenever possible.  For the turn-based situation I'm in, the event-based approach may be more suitable.  In any case, I'm still hoping someone comes along with a fancy "OO" magic bullet which will allow for me to apply a +2 move distance per turn buff, a deal 50% of damage taken back to the attacker buff, and a automatically teleport to a nearby tile when attacked from 3 or more tiles away buff in a single system without turning a +5 strength buff into its own subclass.  I think the closest thing is the answer I marked, but the floor is still open.  Thanks to everyone for the input. Clarification on maps in Salesforce I know this might be a very basic question but i'm pretty confused by this:  Map&lt;Id,Account&gt; accountWithOpportunities =      new Map&lt;Id,Account&gt;([SELECT Id,(SELECT Id FROM Opportunities) FROM Account]);   I have no clue on to where the Opportunities are relevant at all in this map and how they are stored or can be accessed?   Can anyone clear this out for me? Separable Hilbert space have a countable orthonormal basis I want to show that every an infinite-dimensional separable (contains countable dense set) Hilbert space has a countable orthonormal basis.  I know that every orthogonal set in a separable Hilbert space is countable, it is help me with the proof? Regex for numbers only I haven't used regular expressions at all, so I'm having difficulty troubleshooting. I want the regex to match only when the contained string is all numbers; but with the two examples below it is matching a string that contains all numbers plus an equals sign like "1234=4321". I'm sure there's a way to change this behavior, but as I said, I've never really done much with regular expressions.  string compare = "1234=4321"; Regex regex = new Regex(@"[\d]");  if (regex.IsMatch(compare)) {      //true }  regex = new Regex("[0-9]");  if (regex.IsMatch(compare)) {      //true }   In case it matters, I'm using C# and .NET2.0. Option + click in iTerm In Terminal, Option + click allows me to place my cursor at any point on the current line-- great for editing really long commands.  How can I do this in iTerm2?  Update: According to , the feature has been around since 0.7.0 (2003). I've also noticed that if I hold Command+Option, the cursor changes into the familiar cross like in Terminal...  but clicking still does not reposition my cursor. Indian passport threading coming off How should a family with young children apply for UK visas? We are sponsoring a family to visit us in UK as friends from Madagascar for two weeks. They have a 6 year old and a 16 month old.   Do the kids need their own visas, and are they the standard visitor visa or a special child visa?   Also, when I try and apply on the website I can only apply for one person so how do I apply for all the individuals in the family?   I have looked on the Immigration website and can't find the answers I need. Appearing on the second page (under the section Digression: Size worries) of the following paper about the Yoneda Lemma:     It says that $a$ $priori$ $[\mathcal C^{op},Set](H_A,X))$ is a class. I don't understand why this is the case.  My understanding is that $a$ $priori$ each member of $[\mathcal C^{op},Set](H_A,X))$ is a class.  So it seems to me that $[\mathcal C^{op},Set](H_A,X))$ could be a collection of proper classes.  I've looked at this , but it hasn't helped me much.  Any help is appreciated -Thanks How do the Hat Dash points work? Alright, I'm toying around with converting a PIL image object back and forth to a numpy array so I can do some faster pixel by pixel transformations than PIL's PixelAccess object would allow.  I've figured out how to place the pixel information in a useful 3D numpy array by way of:  pic = Image.open("foo.jpg") pix = numpy.array(pic.getdata()).reshape(pic.size[0], pic.size[1], 3)   But I can't seem to figure out how to load it back into the PIL object after I've done all my awesome transforms.  I'm aware of the putdata() method, but can't quite seem to get it to behave.