Would Severus Snape be classified with ASPD?

Question: Given the standard definition (DSM, ICD), as well as the breadth of character info in canon, is there any solid basis in classifying Severus Snape as having Antisocial Personality Disorder (aka highly-functioning sociopath)?
Comment: Related: http://scifi.stackexchange.com/questions/40851/was-voldemort-a-sociopath/40883#40883
Answer: TL;DR: Being a Slytherin, of course Severus Snape has Antisocial Personality Disorder (ASPD)!
BUT SERIOUSLY: Snape may possibly meet the criteria for ASPD. He does exhibit some diagnostic criteria for ASPD. But it's certainly not clear cut.
CAVEAT: The answer, I believe, to this question is that it is clinically impossible to conduct an accurate forensic evaluation on a fictional character. The character's full mind is inside his/her author's head, and, in this case, we do not have access to J.K. Rowling to assist us with a comprehensive forensic deconstruction of Severus Snape.
Conversely, it is possible for a writer to construct a fictional character using certain psychological elements, criteria that becomes discernible to the reader (Hannibal, anyone?). Further, it is more challenging to evaluate a character when the character in question is written in the third person, rather than first person singular. In the former's case, we glean only the nuances of the author's choosing, rather than be allowed to fully view the character's personality from the character's own thoughts and point of view. Furthermore, no one has full insight into their psychology; to expect a fictional character to be a psychological open book is unrealistic at best. So, for me, answering this question should be considered an exercise in entertainment, and entertainment alone, although I will give it my best effort¹ ².
Okay, so all that said, we at least know Snape is no Voldemort, the latter who was indeed a psychopath.

Darchey: Did Voldemort ever love a girl?
J.K. Rowling: No, he loved only power, and himself. He valued people whom he could use to advance his own objectives.
The Leaky Cauldron - Webchat with J.K. Rowling - 07.30.07

That would be a description of classic psychopathy.

Lechicaneuronline: Do you think Snape is a hero?
J.K. Rowling: Yes, I do; though a very flawed hero. An anti-hero, perhaps. He is not a particularly likeable man in many ways. He remains rather cruel, a bully, riddled with bitterness and insecurity – and yet he loved, and showed loyalty to that love and, ultimately, laid down his life because of it. That's pretty heroic!
The Leaky Cauldron - Webchat with J.K. Rowling - 07.30.07

It occurs to me -- while Snape may be quick on the draw verbally and is able to slice someone to the quick with his verbal abuse and bullying, and has an inability to work through emotions, choosing instead to remain bitter over real or perceived slights (And not just a tad bit histrionic about James Potter!) -- is that J.K. Rowling indicates he is insecure, yes, but also has qualities he values in himself. His self-loathing is not whole.
As a reader, I certainly see Snape wearing his insecurities on his sleeve, yet, more so, I see Snape's bravery. Those with ASPD do not often harbor a great deal of insecurities -- indeed, quite the opposite: Grandiose, always-in-charge, toxic know-it-alls are typically more ASPD than someone who is just angry, hurt, or emotionally insecure. In my estimation, Snape lacks the genuinely calculated quality of ASPD, for how would his particular outbursts benefit him? Dumbledore, and once Lily, were the only two persons who understood Snape; to everyone else, his outbursts make him look a bit unhinged and out of control (See Prisoner of Azkaban where Fudge witnesses Snape have a meltdown; Fudge sure raised an eyebrow!). ASPD meltdowns are calculated and purposeful in the hopes of personal gain.

Hannah: Why was Snape so badly groomed?
J.K. Rowling: Hmm. Good question. Poor eyesight? Did he look in the mirror and believe he was gorgeous as he was? I think it more likely that he valued other qualities in himself!
The Leaky Cauldron - Webchat with J.K. Rowling - 07.30.07

CRITERIA: ASPD can be diagnosed by identifying significant impairments in personality functioning in self functioning (identity and self-direction) and interpersonal functioning (empathy and intimacy) and, as well, pathological personality traits in the domains of antagonism (manipulativeness, deceitfulness, callousness, and hostility) and disinhibition (irresponsibility, impulsivity, and risk taking).

SELF FUNCTIONING: I don't see ego-centricism as a source of identity in Snape; personally, I see self-loathing. That said, he certainly derived self-esteem from personal gain, power, and pleasure (joining the Death Eaters; his deep love for the Dark Arts). He did prioritize personal gratification; he did lack many, but not all, prosocial internal standards; these were associated with a failure on Snape's part to conform to lawful and culturally normative ethical behavior, as Snape prioritized the Dark Arts and the Death Eaters, neither of which were routinely encouraged or engaged.
INTERPERSONAL FUNCTIONING: Snape often demonstrated a lack of empathy for others, his biggest blunder being when he asked Dumbledore to save Lily -- and only Lily -- from Voldemort, causing Dumbledore to tell Snape, "You disgust me." In time, though, he gained some maturity in empathy and grudgingly protected Harry over the years. He was even disturbed when he learned Dumbledore had known all along that they were raising Harry to his death. Snape was very poor at intimate relationships; as far as we know, Lily was Snape's only friend ever, and he destroyed their friendship and potential romance through his alliance with the Death Eaters. But Snape did love Lily, a feat that most individuals with ASPD are unable to do in a truly meaningful way. He did not show an incapacity for intimacy, nor did he demonstrate continued coercion, deceit, or exploitation toward Lily.
ANTAGONISM: Surprisingly, Snape does not demonstrate outright manipulation very frequently in the series (He is what he is, he knows it, and he proceeds outright with impunity.). He does try, unsuccessfully, to manipulate Lily into accepting his penchant for the Dark Arts and his yearning to become a Death Eater. Later, as an adult double agent, deceitfulness became par for the course. Snape played his part and played it well, "dangling on the arm of Voldemort" for years while his true loyalty lay with the Order. He was callous -- a Death Eater had to be. I think it was part of his nature as well, though. Was he hostile? Incredibly. Whether his hostility rose from his upbringing, the bullying he endured, losing the girl he loved, or was just plain innate is for the reader to decide. The hostility was ingrained, though.
DISINHIBITION: It may surprise you when I say I don't believe Snape demonstrated irresponsibility per se, all the time. The scene with Snape taking his O.W.L.s in Order of the Phoenix shows us a conscientious boy who valued his studies and grades. Attention to studies and school is not always consistent with ASPD. On the other hand, I think it's fair to call Snape impulsive. His pernicious curiosity leads him close to a near fatal encounter with Remus Lupin when he is in werewolf form, in the tunnel leading from the Whomping Willow to the Shrieking Shack. It leads him to lash out at James Potter with what many believe to be Sectumsempra when James verbally taunts him following their O.W.L.s. He calls Lily, the love of his life, a "Mudblood" when embarrassed. He impetuously ends Harry's Occlumency lessons without Dumbledore's permission, leading Dumbledore to have to admit he was wrong in thinking Snape could put his feelings for James Potter and Harry aside in order to do the right thing. He runs to tell Voldemort the prophecy before he has heard it all. He can't control his tongue around Harry. He steals letters that don't belong to him and destroys photographs so that the object of his affection remains only for him to claim. Becoming a Death Eater was risky, dangerous, and potentially self-damaging (see Regulus Black and his demise). Did he think through the consequences of becoming a Death Eater? Probably not. He was too enamoured of the "dark glamour" that came with being with the group of pre-Death Eaters, and of the Dark Arts. Snape did not seem prone to boredom, nor is there evidence he engaged in thoughtless activities to relieve boredom (We do not know the circumstances under which he created spells such as Sectumsempra or perfected his potions-making abilities.). However, while canon doesn't show us at what exact point Snape knew he would have to die, when or how it would be that he would expend that personal limitation, he certainly was not in denial when it came to the reality of his personal danger. He begged Dumbledore not to kill him when he first left Voldemort; he pledged "anything" to protect Lily, which would presumably include his own life. At the end of his life, he walked into the arms of death, eyes wide open.
OTHER: Snape's personality traits were relatively stable across time and situations.
OTHER: Snape's personality impairments may have been better understood as normative for his developmental stage or socio-cultural environment, although clearly Snape's personality arrested before he could learn different coping skills. It is important to point out that Snape grew up in an abusive, neglectful home, with unengaged parents, domestic violence, and alcoholism. These factors would certainly influence the development of his personality, but not necessarily ASPD.
OTHER: Snape's personality traits were not due to either a general medical condition or substance abuse or addiction.
OTHER: Snape demonstrated concerning personality traits both prior to the age of 15 and after the age of 18, which is a criteria of ASPD.

Here's the rub: Many of the criteria used to diagnose ASPD are co-morbid with other personality disorders. Many of the traits I've listed above can be found in other personality disorders, such as Avoidant Personality Disorder, Borderline Personality Disorder, Narcissistic Personality Disorder, Schizotypal Personality Disorder, General Personality Disorder, Personality Disorder NOS, and, yes, even Obsessive Compulsive Disorder! Also, it's possible to have co-morbid personality disorders, meaning more than one personality disorder at a given time. Some personality disorders can "mellow" as the subject ages, such as ASPD and Borderline Personality Disorder. Some tend to be pervasive, such as Narcissistic Personality Disorder. Personality disorders, in general, are notoriously difficult to treat and often do not respond to therapeutic or pharmacological (or potions!) intervention. Snape did show an arc of change, albeit imperfect.
ANSWER: Snape may possibly meet the criteria for ASPD. He does exhibit some diagnostic criteria for ASPD. But it's certainly not clear cut.
¹I'm looking at the DSM-V (PDF); for those who are unsure what the DSM-V is, "DSM" is the Diagnostic Statistical Manual, and the "V" indicates it is version five. It is the book of guidelines and symptoms trained diagnosticians use to diagnose personality disorders and mental and behavioral illnesses.
²For an Abnormal Psychology class back in university, my lab partner and I were given the task of administering the MMPI to a fictional character of our choosing. We chose Spock, thinking Yes! Surely Spock'll be WAY effed up! He came out as totally normal, aside from a slight tendency toward paranoia.
Comment: Only read the first sentence but it was enough, really. _"Being a Slytherin, of course Severus Snape has Antisocial Personality Disorder"_ What do you mean by that? When you are selected as a Slytherin, you automatically are an antisocial person?
Comment: I am not sure I agree with the Lupin tidbit. I think it was more as fact that he was more obsessed with Potter and co and not irresponsibility *per se* that drove him (see your end note on OCD). Amazing answer otherwise
Comment: @DVK -- Yeah, I'll give you that. I think it's a fair assessment of the situation. TBH, I think what you say is what I was trying to with my example of Lupin, but you worded it better and more concisely. I definitely don't disagree with your correction. :)
Comment: @apollo Perhaps you should read the second sentence, which starts "But seriously". Also note the name of the person who answered.
Comment: @JanusbahsJacquet Lol, you got me there. Taken back!
Comment: Could a truly ASPD person love Lily as much as he did?  i guess you could characterize that as more "obsessive" than "loving"
Answer: NO.  I only say this because, although Snape does show many of the classic signs, he has at least three or 4 qualities that would rule out this diagnosis:

His unwavering loyalty to Dumbledore.  In my (admittedly somewhat limited) educational and practical experience, sociopaths are incapable of that sort of devotion to another person.
Near the end of the his life, he demonstrates remorse and a concern for how he is viewed by Harry.  What others think of them is of little to no concern to sociopaths.
I also cite his concern for Draco after Harry hit him with the Sectumsempra curse. Sociopaths haven't the ability to care for others' well-being. (Although that could have been faked, he still very easily could have let Draco die and Harry take the blame.)
Snape holds down a long-term job which places him in close contact with others.  Even high-functioning sociopaths would find that nearly if not completely impossible.
Comment: So he could still be ASPD but a sociopath and not psychopath
Comment: Sorry, I'm not sure I agree because of this article: http://blogs.psychcentral.com/forensic-focus/2010/07/sociopathy-vs-psychopathy/
Comment: Other differences between psychopathy/sociopathy, aside from origin,were cited. Capacity to feel attachment and empathy towards another and to feel guilt and shame after doing something wrong is not associated with psychopathy; however it is suggested that sociopaths can emotionally attach to others, and feel badly when they hurt those individuals that they are attached to. The sociopath will still lack empathy and attachment toward the greater society and will not feel guilt in harming a stranger, or rebelling against laws, but does not lack empathy entirely, as is typical with the psychopath
Comment: The only _real_ difference between the two is whether the behavior is inherent or learned.
Answer: No
The trait of a person with ASPD as listed in DSM-IV are

repeatedly performing acts that are grounds for arrest;
deception, as indicated by repeatedly lying, use of aliases, or conning others for      personal profit or pleasure;
impulsivity or failure to plan ahead;
irritability and aggressiveness, as indicated by repeated physical fights or assaults;
reckless disregard for safety of self or others;
consistent irresponsibility, as indicated by repeated failure to sustain consistent work behavior or honor financial obligations;
lack of remorse, as indicated by being indifferent to or rationalizing having hurt, mistreated, or stolen from another;

Because he did seem to show some kind of empathy or feelings, however limited, for others and he does seem to follow a moral sense of right and wrong, at least later in life.
He never used to manipulate or deceive people as is typical of functioning psychopaths. (He was deceiving Voldemort, but that doesn't count. It is not a general pattern of behaviour like with Dumbledore).
We have no real signs of hostility aggressiveness from Snape. He used spells like Sectumsempra as defence against the bullying marauders.
Snape never recklessly took risks.He acted in a very planned manner. Even with the werefolf incident, his objective was to expose Lupin werewolf and get the marauders expelled.
He was loyal to Dumbledore till the end and performed all his assigned tasks perfectly.This kind of responsibility is not to be expected from a psychopath.
Dumbledore on the other hand does qualify for the label of a psychopath in clever disguise.
Comment: +1 for your analysis of Snape, though I would disagree about Dumbledore.
Answer: Yes.* **
The Wikipedia article for antisocial personality disorder has a quote from the Diagnostic and Statistical Manual of Mental Disorders, which is the standard criteria for classifying mental disorders. Here's the relevant passage:

A) There is a pervasive pattern of disregard for and violation of the rights of others occurring since age 15 years, as indicated by three or more of the following:

failure to conform to social norms with respect to lawful behaviors as indicated by repeatedly performing acts that are grounds for arrest;
deception, as indicated by repeatedly lying, use of aliases, or conning others for personal profit or pleasure;
impulsivity or failure to plan ahead;
irritability and aggressiveness, as indicated by repeated physical fights or assaults;
reckless disregard for safety of self or others;
consistent irresponsibility, as indicated by repeated failure to sustain consistent work behavior or honor financial obligations;
lack of remorse, as indicated by being indifferent to or rationalizing having hurt, mistreated, or stolen from another;

B) The individual is at least age 18 years.
C) There is evidence of conduct disorder with onset before age 15 years.
D) The occurrence of antisocial behavior is not exclusively during the course of schizophrenia or a manic episode.

Snape clearly ticks quite a few of these boxes; certainly enough to be given a positive diagnosis.
To run through them briefly: B) is trivial, C) comes from his actions as a child with Lily (more on that shortly), D) seems to follow also.
We get a lot of information about Snape's childhood from Deathly Hallows chapter 33 The Prince's Tale. With that in mind, let's go through A) in a bit more detail:

Plenty of examples here:

Repeated violations of privacy (reading Petunia's letters, sneaking around after the Marauders).
As a child, using and developing Dark Magic.
Insulting Lily and Petunia for their Muggle parentage, despite clear awareness of what those insults mean.

Again, we have examples from both childhood and as an adult:

Lying to Lily about dropping a branch on Petunia's head.
Trying to convince the barman at the Hog's Head that he had a legitimate reason for eavesdropping.

Joining Voldemort might fall into this category. Beyond that, I can't think of any obvious examples.
Several minor instances:

He seems irritated with Lily at Hogwarts, especially when she doesn't seem to understand or appreciate his skill in Dark Magic.
He seems to get into fights with the Marauders, but we've never seen a balanced picture of these: was he always being picked on, or did he fight back?

Big tick for this one:

He develops dangerous spells like Sectumsempra, whose only purpose is to harm other people. The experimentation in his textbook margins suggest that this was a systemic practice, and not just a one-off.
Death Eaters probably don't have the best life or job security, but he signed up anyway.
He followed Lupin into the Whomping Willow, despite knowing that Lupin was probably a werewolf.

No clear evidence here. But we only need three, so it doesn't matter.
Another big tick:

He tries to dismiss Mulciber's attempts to use Dark Magic on another student as "nothing" and "a laugh, that's all". To be fair, we don't know what Mulciber actually did, but we meet a Death Eater of the same name in the Department of Mysteries, so this was probably some form of Dark Magic.
He doesn't seem to understand why Lily would be upset when he attacks or insults Petunia.

We only needed three of these to stick for Snape to have a positive classification, and we definitely have those.
Thus, I think we can safely say that there is canon evidence that Snape has ASPD.
*but I am not a psychiatrist, don't trust medical advice from the Internet, etc.**I've seen sufficiently much disagreement over the term "high-functioning sociopath" that I don't feel confident picking a definition, or even just saying whether it is a definable term. I'll stick to the definitions of ASPD.
Comment: Most of the examples you use take occur (arguably) before the age of 15, therefore, as per the criteria, should not be considered for the diagnosis.
Comment: @TGnat - To concur with you, the DSM-5, regarding the criteria of a subject having to be age 18 or older in order to garner an ASPD diagnosis almost removed this as a checkpoint for ASPD because it's so arbitrary. As you noted, the subject must also have been formally diagnosed with Conduct Disorder prior to the age of 15. I wanted to note that, under disinhibition, allowances are made for the subject's normative developmental stage and socio-cultural environment (such as being a wizard growing up in a Muggle neighborhood with domestic violence, a distant parent, alcoholism, and neglect).
Comment: I concur with TGnat, and also disagree in regard to Snape's dishonesty. In general he was honest to the point of being rude. He tried to be better around Lily, which was why he was not honest with her. Snape's Death Eater friends knew his usual self, however. And Snape's lie to the barman was connected with his work as a spy, which puts into a different category.
Answer: I honestly think Paranoid Personality Disorder is a better fit for Severus.

PPD is characterized by at least three of the following symptoms:

excessive sensitivity to setbacks and rebuffs;
tendency to bear grudges persistently (i.e. refusal to forgive insults and injuries or slights);
suspiciousness and a pervasive tendency to distort    experience by misconstruing the neutral or friendly actions of others    as
hostile or contemptuous;
a combative and tenacious sense of    self-righteousness out of keeping with the actual situation;    recurrent suspicions, without
justification, regarding sexual    fidelity of spouse or sexual
partner
tendency to experience excessive self-aggrandizing, manifest in a persistent    self-referential attitude;
preoccupation with unsubstantiated "conspiratorial" explanations of events both immediate to the patient    and in the world at
large.

I can definitely see PPD as being Severus. He is excessively hostile and defensive - his interest in dark magic may stem from that as well as the development of dark spells. Not to mention that he bears grudges persistently, that doesn't need explaining. He seems sensitive to setbacks and rebuffs - Lily's rejection would have destroyed him emotionally - even if it isn't obvious. Think about how he reacted when Harry saw his worst memory. All of his hostility is about him defending himself (in his eyes) against his foes - other people see this behaviour as bullying (not that they are wrong in this). He feels as if his vindictive behaviour is justified. He self aggrandises by asserting authority over his students - favouritising Slytherins and degrading the others.
He does display antisocial characteristics: disorderly conduct, violent behaviour, aggression, lack of empathy (but not devoid), etc. But not enough to warrant a diagnosis of AsPD. He has consciousness, ability to love and a sense of remorse. People with AsPD don't.
I honestly also think he suffers from depression/dysthymia. He is persistently bad tempered and irritable,  low mood, socially isolated, experiences little pleasure, feels excessive guilt, regret and hopelessness.
Answer: I would merely say... a severe depression, perhaps some personality disorder. Bipolar, schizoid, or "just" a depression. He was definitely not a psychopath (like Voldemort or Bellatrix, who both were classic cases), even if I see what makes you think so. But I dated a diagnosed sociopath, I know how they function and think. Snape is not one of them, even if he is a bordering case. But to be diagnosed as such, you cannot have any conscience. And boy, he does have it. He has a lot of it, otherwise he would not grieve so much after Lily´s death. He even blamed himself, even if it was not directly his fault! His behavior led to her murder by Voldemort, but Snape repented, and meant it seriously. A sociopath or a psychopath (sociopaths are MADE, psychopaths are BORN) would never be capable of any of this. They would blame Lily for being "too stupid to fall a prey to Voldemort" (that is how they think, they never blame themselves). Snape is not an ASPD case.
However, he seems extremely depressive (he even wanted to commit suicide after Lily´s death, only to be persuaded by Dumbledore into not doing so, and made into protecting Harry and thus Lily´s memory), and depression usually starts where there is a self-blame or conscience. Also, his moods are prone to change a lot (esp. when with Harry or Neville, who are his "berserk buttons"), even if most of the time his moods are pretty stable, which finally  rules out bipolar depression. Therefore, it is just a depression. And a schizoid PD (or not). He is much of a loner, but it CAN be also caused by his constant low moods. But the depression? Definitely, no doubt. At least for me.


More than three talaqs but in ignorance. Is the marriage valid? Can they remarry?

Question: My father used to believe that if the couple gets back together within iddah, that talaq does not count and he has to give three more talaq to end the marriage. Due to this belief, he gave my mother talaq 5-6times but used to get back together within iddah period. He says he never had an intention to divorce her but always wanted to threaten her to make her follow his conditions. He recently found out that his belief was wrong and that he has given more than three talaqs and the divorce is done. He is now in doubt if he can ask Allah for forgiveness and remarry my mother? Will this marriage be valid? It is matter of life of kids, marriageable age girls and small boys. Both husband and wife really want to remarry and live together.
Answer: he was right with his previous opinion, except "he has to give three more talaq to end the marriage".
even saying 3 more talaqs within iddah does not make it counted as one of the three talaqs, but waiting iddah is required. he can say talaq 100 times in a hour and take her back, and even 1 talaq of the 3 is not counted. but he can say 1 talaq and wait iddah fully, bring witnesses, and then he become divorced, 1 talaq of the 3 is counted, and his ex-wife can take decision to go away from him and he cannot take her back without her agreement.
proof: http://islam.stackexchange.com/questions/103/just-reciting-talak-thrice-commits-divorce/32792#32792 .
Answer: Obligation to divorce women when they are pure.
Any divorce uterred when husband has established physical relations after menses will not be counted.

"O Prophet! When you divorce women, divorce them at their 'Iddah (prescribed periods) and count (accurately) their 'Iddah " 65:1
What this means is when they are pure (not menstruating) and you have not had intercourse with them. This is what the scholars have said about divorcing them at their prescribed periods, they should be pure (not menstruating) and you should not have had intercourse with them, or they should be pregnant. This is what is meant by divorce at their prescribed periods. End quote from Fataawa al-Talaaq, p. 44
Fataawa al-Lajnah al-Daa'imah (20/58): There are several kinds of innovated divorce: where a man divorces his wife during her menses or nifaas, or during a time of purity when he has had intercourse with her. The correct view is that this does not count as a divorce.

If an individual is ignorant of a particular islamic ruling, he is not held guilty, Allah willing the couple is not divorced even once.
Ruling is applicable only when one becomes aware of it.
This man has to repent to Allah and ask his forgiveness.
Shaykh Ibn Baaz (may Allaah have mercy on him) was asked about a woman who has jewellery for adornment that stayed with her for years, then she came to know that it was obligatory for her to pay zakaah on it – did she have to pay zakaah for the past years? He replied: You have to pay zakaah from the time when you came to know that it is obligatory to pay zakaah on jewellery. As for the past when you did not know about that, it is not obligatory for you to pay zakaah, because the rulings of sharee'ah are only binding after one comes to know of them.
Fatawa Islamiyyah 2/84
https://islamqa.info/en/182868
Comment: If we applied this example in every matter we could make anything halal. I've seen a fatwa on the same site on this topic where it was said that the woman has to leave the house and not let her husband see her as they became non-mahrams. Zakat is something between you and your creator, talaq involves other humans so the analogy fails.
Comment: the rulings of sharee'ah are only binding after one comes to know of them. Fatawa Islamiyyah 2/84 it's general case
Comment: Once you know about you must apply the rule she knows she must apply her part. BTW before doing something we are asked to get to know the rulings, so basically the husband should ask a scholar about the rulings of talaq once he spoke it out.
Answer: This site is propagating extremely wrong information..May Allsh forgive them..Talaq takes place whether one know it or not..The hadith says,three things whether done in joke or jest or seriously will take effect: nikkah,talaq and taking back ones wife!


lower bound of majority function?

Question: If a circuit ({AND OR NOT} circuit) with depth d computes the majority function, what's the best lower bound for majority function?
I know the lower bound for parity function is $ 2^{\Omega (n^{1/d})} $
Answer: You haven't specified exactly what kind of circuits, but in general since parity $\oplus$ is in $\mathsf{TC^0}$ and majority $Maj$ is complete for $\mathsf{TC^0}$, you get a similar subexponential size lower-bound for majority.
A simple reduction would go through counting function $NumOnes$ that counts the number 1s in the input in binary. This would give $2^{n^{\Omega(1/d)}}$ where constant in the exponent comes from the size of $\mathsf{AC^0}[Maj]$ circuit computing $numones$. I don't know the best value of the constant but it shouldn't be big.
On the other hand, there are $2^{n^{O(1/d)}}$ circuits for majority as majority is in $\mathsf{NC^1}$ and any $\mathsf{NC^1}$ circuits can be converted into a subexponential-size bounded-depth $\mathsf{AC^0}$ circuit (by performing a layered brute-force).
Comment: Oh, thx. I need some time to think what you said. And If I have some questions, I will ask you again. thx.
Comment: @Sasho, yes, I think that is correct, it makes the class of circuits larger ($\mod_q$ gates) and replaces exactly computing majority with approximating it (however it doesn't change the bounds).
Comment: thx, may I get a better bound than $ 2^{\Omega (n^{1/d})} $?
Comment: I don't think you can get much better, I have updated the answer to explain why. However it might be possible to get a little bit better constants.
Comment: a lower bound for even approximating majority, and even with unbounded fan-in parity gates allowed, should follow from razborov-smolensky
Answer: The original paper by Smolensky, On Representations by Low-Degree Polynomials, actually contains a direct lower bound on majority. You can have a look at the original paper (behind a paywall) or at this writeup. For the converse, it is known that an NC$^1$ circuit of size $S$ can be simulated in AC$_0^d$ in size $2^{S^{1/\Omega(d)}}$. Majority has NC$^1$ circuits of polynomial size, and so you can't get a lower bound better than $2^{n^{1/O(d)}}$.
The state-of-the-art might well be Amano's paper for the upper bound, O'Donnell and Wimmer for the lower bound; the latter use Håstad's switching lemma. According to Amano, the minimum size of a depth $d$ circuit that $\epsilon$-approximates Majority on $n$ variables is $\exp(\Theta(n^{1/(2d-2)}))$.
Comment: Actually, Razborov's original paper was also concerned with the MAJORITY function.
Comment: Oh, thank you. I need to read the papers first. By the way, it's interesting.

lower bound of majority function?


Can I program for Arduino without having a real board?

Question: I would like to start the development of some basic Arduino projects but I don't own an Arduino board yet. Is there a way I can write my code and emulate/test it using a desktop computer so after my board arrives I just have to upload and run my project on it?
Comment: I'm interested too, did you find one that plays well with the [Arduino IDE](https://www.arduino.cc/en/Main/Software)? that is, detected by the IDE as if it was a board, with all its functionality.
Comment: I am interested in the [free online Wokwi Arduino Simulator](https://www.wokwi.com) for the reasons that it runs on both windows, MAC and mobile browsers. It runs on AVR8js based engine and is also made open-source. can you review this?
Answer: There are a whole slew of Arduino simulators out there, many free, and some paid products as well.

The CodeBlocks Arduino development environment includes a free Arduino simulator, still under development but functional.
Simuino simulates the Arduino Uno and Mega pins - not a pretty-looking realistic simulator, but it works.
The Python based Arduino Simulator is another option, that plays well with the official IDE
Virtronics Simulator for Arduino looks promising, but I don't see why I would pay $14.99 for it, when I could buy one or more actual Arduino clones for that price

Many other Arduino simulators are out there if you search, and new ones are being announced, even crowdfunded, all the time.
Comment: as a note, those are not *emulators* but *simulators*, the most important difference is that it does not run the code on a AVR virtual machine (like what *qemu* does), but binds the Arduino functions to native code. So basically they won't be able to run native AVR stuff and register/timer behavior will not be the same as on real AVR hardware. See the difference well explained in [that answer](http://programmers.stackexchange.com/a/134783/70303). It is, though, theoretically possible to emulate Arduino Due code with [qemu](https://github.com/myokota/qemu-cortex-m3).
Comment: The [Arduino Simulator](http://sourceforge.net/projects/arduinosim/) piqued my interest, but unfortunately appears to have no files related to it on the sourceforge site. Am I missing something, or has it become deprecated since you wrote your answer?
Comment: You "don't see why [one] would pay $14.99 for it, when [one] could buy one or more actual Arduino clones for that price"? I can tell you why: because the hardware doesn't have a built-in debugger with the features that can be provided by a simulator.
Comment: Simuino is terrible, unprofessional and useless.  They have no clue how to code.  Arduino Simulator has no releases.  CodeBlocks is Windows only. Simulator for Arduino isn't open-source.
Comment: As noted in above comment, there are no files in the arduino simulator source forge site. Is there a website for it or is there another simulator that works well in mac, with official IDE?
Answer: I like to use circuits.io aka TinkerCAD for this.
It's cloud based and has some nice features including PCB design and collaboration.
IMO the Arduino simulation and capability is impressive and intuitive.
Comment: It is very nice and clean and basic functionality is really impressive, easy to use and powerful. However many common parts (including LCD and temperature sensors) are not supported yet. I doubt you can test anything but very basic designs at this stage. I hope this will get better over time.
Comment: The electronic labs part of [circuits.io](http://circuits.io) site has moved to [tinkercad.com](https://www.tinkercad.com), where you can find it under **circuits**.
Comment: I have edited it and updated the links.
Comment: I gave it a quick try and found it _very_ impressive for a free product. I don't know its limitations in terms of simulation realism, but the editor is very friendly and just placing a led into the proper slot automagically created code with the correct pin and a blinking loop!
Comment: even my choice would be 123d but my only complain about this site is they don't add new components. It would be really great if they can have some new components on their list
Comment: The answer is outdated
Comment: [free Arduino simulator](https://wokwi.com) is **free**, based on open-source [AVR8js](https://github.com/wokwi/avr8js), and works on Android, iPhone, Windows and Linux. Can you please first check it out and then update your answer. This helps to reach so many Arduino users who are looking for a good arduino simulator with [examples](https://wokwi.com/arduino/libraries). In [many aspects](https://www.hackster.io/write2puneeth/tinkercad-versus-wokwi-arduino-simulator-5ab08d), it is better than Tinkercad.
Answer: Plenty of options exist in the world of electronics simulators, but circuits.io aka TinkerCAD is probably the most versatile one out there.

You can compose your circuit on a virtual breadboard which looks just like real.
You can actually watch a LED blinking or press a button during real-time simulation rather than struggling with abstract waveforms.
You can combine digital devices like a 555 timer or shift registers with (interactive) analog components like resistors and LEDs.
You can program an Arduino and simulate the microcontroller together with your analog circuit around it.
You can debug an Arduino: when the simulator reaches your breakpoint, the simulation is paused and you can easily check every variable in your code and every voltage or current in your circuit.
You can use and observe different communication protocols like UART, I2C and SPI.
You can pause the simulation in the middle of an I2C sequence by putting a breakpoint in the driver code (e.g. interrupt service routine for I2C events)
It's FREE!

This is an example circuit that has with an IR Remote and an LCD Screen.
Disclaimer: We are the makers of 123D Circuits
Comment: How does it play with the [Arduino IDE](https://www.arduino.cc/en/Main/Software)? would it be available to flash, debug, etc?
Answer: Be aware that no simulator will reproduce real-life situations. There have been plenty of posts on the Arduino forum about problems with code or electronics, which turn out to be something subtle, such as:

Timing issues
Race conditions (related/dependent events not always happening in the same order)
Voltage levels, eg. floating input pins
Driving motors which drop the Arduino voltage enough that it resets
Not having decoupling capacitors
Input pins being in an "undefined" state (eg. 2.5V on a pin where 2 or less V is LOW and 3V or more is HIGH)
Problems with interrupt handlers, such as variables not being declared volatile
Voltage spikes due to not having flyback diodes on motors
The processor resetting once more than 10 LEDs are turned on because the current draw exceeds the amount the hardware can supply
Interrupt handlers taking 10 µS to process an interrupt when only 9 µS is available.

By their nature simulators can't reproduce all of this. Even if they could, would you think to toggle the "insert random noise from motors" option?

As for getting ready for the board to arrive, download the IDE and start programming. You can get libraries installed, code written and free of syntax errors, organize it neatly, and be generally ready for the big day when the hardware is in your hands.

Have fun and enjoy experimenting with your Arduino!
Comment: This is a good troubleshooting checklist for when a circuit is misbehaving seaport appearit "logically" correct.
Comment: There is one point I would like to thank you for. The bounce effect of the pushbuttons creating so many problems for beginners unless addressed. inspired b your list, I had asked to add this feature in the [wokwi](https://wokwi.com) and now the simulator supports [bounce](https://wokwi.com/arduino/projects/288681423014986248) feature in the push buttons!
Answer: You can use Yenka (free for home use) to simulate Arduino, PIX, PIXACE and other boards with digital, analog and serial I/O. It provides a lot of components and sample projects.
Screenshot:
Comment: Can it be programed, debugged from the [Arduino IDE](https://www.arduino.cc/en/Main/Software)?
Answer: Edit 2:
Please hit the like button to support free Arduino simulator
I am working with the new Wokwi Arduino Simulator. Wokwi Arduino simulator is based on AVR8js engine which is made open-source. You can find the link here
Following are the main features of the simulator
•   Supports multiple file projects
•   Supports the Arduino libraries
•   Whatever compiles on the Arduino IDE will compile on the simulator
•   Supported by all browsers
•   Compiles with latest Arduino IDE
•   Supports FastLED and many other peripherals
•   No download or installation needed
•   Easy to share the code and project with just a single click
•   Smart - Code Autocompletion, Code auto-formatting are supported
•   Provides standard library demo examples
•   Project can be compiled on RUN on Mobile browsers as well
•   Tries to be closer to real circuits – Example – Button bounce like in real hardware
•   Supports Arduino Mega, Arduino Nano, Arduino UNO, ATtiny85
•   Supports assembly instruction execution
•   Provides LED power and FPS features for FastLED projects
•   Supports a plethora of Arduino peripherals for the project – Ultrasonic sensors, Slide switches, NeoPixel matrix, Potentiometer, Servo motors, SSD1306 OLED displays, temperature and humidity sensors, rotary dialer, membrane keypad and more
•   Serial monitor is supported as well
A few Arduino Examples
Simon game using ATTiny85, buttons, buzzer, and LEDs
Project link: https://wokwi.com/arduino/projects/285525640477671948
•   Note the use of the same pins for both output and input
•   The code can be written for ATTiny85 the same way how it is written for Arduino

Slide switch demo example
Project link: https://wokwi.com/arduino/projects/292033853022798344
The slide switch can also be used as an ON-OFF switch

Simple Piano Example
Project link: https://wokwi.com/arduino/projects/291958456169005577
Plays several notes based on Arduino built-in library support

Max7219 LED dot matrix Arduino UNO project Example
Project link: https://wokwi.com/arduino/projects/290144516831183368
Supports concatenation of the Max7219 modules

HC-SR04 Ultrasonic sensor Example
Project link: https://wokwi.com/arduino/projects/290056311044833800
A very useful project to build several interesting projects (RADAR 3D mapping and more  )

Bounce feature example in Arduino Simulator
Project link: https://wokwi.com/arduino/projects/288332630964830728
Bounce is the basic problem in most beginner projects. That can create multiple input triggers, unwanted noise and makes the project to misbehave. Sometimes can be difficult to identify without proper debug or measurement tools. Knowing about the bounce in switches and tips and tricks on how to solve it is an interesting study for every beginner hobbyist.

LCD1602 display example in Wokwi Arduino Simulator
Project link: https://wokwi.com/arduino/projects/287736345015616008
LCD1602 is one of the best HMI and has been here for a long time. It helps in debugging projects during run time, we can also use it along with a keypad to make a completely practical HMI (human-machine interface). Very easy to use, and easy to learn about programming.

FastLED example with FPS and LED power
Project link: https://wokwi.com/arduino/projects/287736345015616008
Second link: https://wokwi.com/arduino/projects/281176629596652040
FastLED is a second revolution in the history of LEDs. It was never easier than now to program multiple LEDs with just one Arduino Pin. With the growing FastLED community (reddit, wokwi-Discord, and others) and FastLED examples and libraries, This is one of the most important elements in the wokwi Simulator.

Temperature and humidity sensor, Real time clock module example
Project link: https://wokwi.com/arduino/projects/287736345015616008

Serial Monitor example
Project link: https://wokwi.com/arduino/projects/286653669554782732
The serial plotter is a very useful feature when working with analog peripherals.

Adafruit SSD1306 Library Adafruit SSD1306 Library
Adafruit DHT Sensor Library
Another DHT library from GitHub
FastLED example Library
SSD1306 GitHub example
Arduino Servo Library
Task Scheduler Library
Simon Game, Electronic Safe Example
LCDGFX on Arduino Example
SSD1306 Library Examples

The Arduino simulator is free for the Arduino Community to use. We are adding more elements one after the other. It is free and we invite you to try it as well.
Please leave a comment to add more libraries or features as well
Answer: Yes, you can, try using Proteus ISIS for simulating your code...
For full emulation of Arduino, there is a shareware program called VBB (Virtual BreadBoard), I tried it too and it was nice.
Edit: You can check my detailed tutorial here on how to simulate on Proteus ISIS
Answer: I believe this website has a list of both emulators and simulators along with their price and availability.
Update:
Since some users mentioned there are broken links in that website, here's a selection of emulators I found. Note that some descriptions may have been taken from the mentioned link:

Emulino: Is an open source linux based software in early development that emulates Arduino-specific MCUs.
Emulare: is a general purpose hardware emulator. It aims to provide a central interface to build electronic simulations for embedded software development. At present emulare focuses on the ATMega line of microcontrollers (Arduino UNO has the ATMega processor).
SimAVR: is a new AVR simulator for linux, or any platform that uses avr-gcc. The simulator loads ELF files directly, and there is even a way to specify simulation parameters directly in the emulated code using an .elf section. It supports emulation of many ATMega processors and it is mentioned that it's easy to even add new ones.
Amtel Studio: This doesn't seem to mention the term emulation, but it is a sophisticated IDE to debug your code for many platforms specially Arduino. Atmel Studio 7 features seamless one-click import of projects created in the Arduino development environment. Your sketch, including any libraries it references, will be imported into Studio 7 as a C++ project. Once imported, you can leverage the full capabilities of Studio 7 to fine-tune and debug your design. Atmel Studio 7 fully supports the powerful embedded debugger on the Arduino Zero board. For other Arduino boards, shield-adapters that expose debug connectors are available, or switch to one of the many available Xplained-Mini/PRO boards to fully leverage the Atmel HW eco-system.

You can still use simulators such as EasyEDA to test your code and in most cases be able to run it on the device. But note that given the nature of electronic components, you may have to provide external resistors, capacitors etc to get the expected results.
Comment: Link only answers not a good thing here because they will be useless when the linked site goes down. Please write a summary and also make sure that your answer adds value and not just repeating the ones we already have.
Comment: I agree with @totymedli - if that link goes dead the answer becomes useless. Please summarize, at least, the emulators mentioned and the current price. You can start lines with an asterisk to make bullet points, if that helps.
Answer: Virtualbreadboard has a new VBB4Arduino 'Two Arduino's' edition which includes BOTH a JVM Arduino emulator AND a AVR Instruction set simulator with examples that cover almost all of the Arduino distribution examples and a bunch of peripheral hardware - LCD's, WS2812 Neo LEDS, Motors, Servo's, Logic Analyser and more.
http://www.virtualbreadboard.com
Disclaimer: I am the author of Virtual Breadboard
Answer: You could e.g. use my simulator.
It is especially suitable for PLC-like applications, where multitasking is achieved by cyclic evaluation of interconnected circuit-like objects: Timers, Markers, Latches, Oneshots and Registers.
You can use it to simulate your controlled system as well, as becomes clear from the examples in the download. It has modest visualisation capacities, can draw timing charts, and allows you to access and alter c.q. force all variables in real time during a running simulation. Also you can freeze time. When you're satisfied with the behavior of your control it generates the C code to be uploaded to an actual Arduino.
https://pypi.python.org/pypi/SimPyLC
Answer:
a way I can write my code and emulate/test it using a desktop computer

If you mean being able to "unit test" using a desktop computer, I can offer a library I wrote called arduino_ci.
It doesn't offer emulation.  You would express your tests in code.  For example, here is a test pulled from the reference documentation that validates the data written to a port:
unittest(pin_history)
{
  GodmodeState* state = GODMODE();
  int myPin = 3;
  state->reset();            // pin will start LOW
  digitalWrite(myPin, HIGH);
  digitalWrite(myPin, LOW);
  digitalWrite(myPin, LOW);
  digitalWrite(myPin, HIGH);
  digitalWrite(myPin, HIGH);

  // pin history is queued in case we want to analyze it later.
  // we expect 6 values in that queue.
  assertEqual(6, state->digitalPin[1].size());
  bool expected[6] = {LOW, HIGH, LOW, LOW, HIGH, HIGH};
  bool actual[6];

  // convert history queue into an array so we can verify it.
  // we expect to find 6 values: the 5 we set, plus the initial LOW
  // and this is where/how we assert that
  int numMoved = state->digitalPin[myPin].toArray(actual, 6);
  assertEqual(6, numMoved);

  // verify each element
  for (int i = 0; i < 6; ++i) {
    assertEqual(expected[i], actual[i]);
  }
}

In practice, you would probably not be calling the digitalWrite functions directly -- you'd call a function in your library, then verify that the "world state" (represented here by the GODMODE construct) matches what you expected your library to do.
Answer: Yes you can, and fairly easily. There is a wonderful online simulation (completely free) called TinkerCAD. It has an excellent breadboard simulation, with parts like transistors, LEDs, ICs, and Arduino. You can program the Arduino and run it all in a live simulation that includes interactive inputs (pushbuttons, DIP switches, etc.).

[Edit: The following text refers to functionality that has been moved to Circuits.io, namely Eagle PCB]
That's not all. It also includes in a separate tab schematics for your circuit, and another tab for PCB design of your breadboard circuit! Or, you can just make your schematics from scratch and make your PCB from there.
You can have your circuit designs made and you can buy them. You can do all of this in circuits.io, and you aren't risking messing up your actual Arduino. It also has warning indicators in the simulation (for example, if you didn't use enough resistance on an LED, or an IC).
Answer: An alternative to simulators are services similar to online compilers like coliru, which allow users to build and run their code on a remote system. This approach has the same limitations as online compilers:

The hardware configuration and state cannot be altered remotely, except for explicitly defined interfaces.

The changes to the hardware state cannot be observed, again, except for explicitly defined interfaces.

Typically, most online compilers provide users with access to command line and process STDOUT. On Arduino, providing remote access to the serial port would provide a similar degree of control: users would be able to observe and control their running sketch through UART, but would not be able to connect/remove wires, push buttons, act on external sensors, etc.
Surprisingly, I couldn't find any such online services, so I ended up writing my own - HW Farm. If you have a web server and Arduinos you can connect to it, you can install HW Farm on it and let people access those Arduinos through a web interface. I also host such a server myself, which has a single Arduino Mega with a bunch of I2C devices connected to it. You can try it out, but don't expect it to be online and available all the time.


Slow Charging Battery!

Question: I have a Samsung galaxyS3 the battery has been charging really slow. It can take up yo 10 hours to charge 100%. I have tried every thing I can think of. I've tried a new charger, new battery, shut down all apps running in the backgrond, taken out the battery and held down the power, volume and home screen button, deleted junk apps. I've thought about reseting my phone but idk if that would help or just make more work for me. Also I put both my old and new battery in a friends phone and both batteries worked fine. Any ideas?
Answer: It might be worthwhile to invest in a charge only cable. I use one for my tablet at home and in my car.
The quality of the usb cable will also make a difference. Cables do go bad. It sounds like you have ruled out all the other options so this might be worth trying.
Comment: Also, make sure the charger is the right one for the phone. Things are still a bit fuzzy in how the chargers identify themselves to the devices, and if you've grabbed (for instance) an iPhone charger, the phone might not know it can charge at a faster rate.
Answer: Charging is a simple process and can be represented by the below (simplified) equation:
Rate of Charge = Rate of Electricity Flow - Rate of Depletion
To maximize the rate at which your phone charges at, you want to reduce the rate it's using up your battery as far as possible, and increase the speed at which current is flowing into your phone as much as possible.
Reducing Battery Usage
This is pretty standard stuff, turn off all unnecessary toggles and apps. Disable WiFi, Bluetooth, GPS, and any constantly running apps. If you happen to be charging your phone in an area with poor or no cellular signal, the constant searching for mobile networks could be a significant contributing factor.
Go to Settings->Battery Usage (or something similar, I don't own a Samsung device so I can't be sure), and look at what's using up your battery.
If possible, consider turning on airplane mode, or even turning your phone off completely to minimise battery usage.
Increasing Speed of Current Flow
Look at the thing you're plugging your USB cable into. If you're charging it via your computer, chances are the current flow is around 1A or lower. That's okay, but not great. Look around your house, or see if you can get your hands on a tablet charger. Those often provide current at 1.5A or even 2A at times. That's twice the speed of a 1A charger.
Also, look at where you're plugging your charger into. If the socket is already heavily overloaded, consider plugging it in somewhere else, for safety's sake at least
Still very slow...
If at this stage, it's still charging very slowly, your battery may be the issue. Since it seems to work fine in your friend's phone, it may simply be your phone providing inaccurate information. Try calibrating your phone's battery and see if that helps.
Comment: Thanks for the suggestions :) I also forgot to mention if I use my phone while it is on the carger the battery still dies.. :p
Answer: Take a tooth brush and clean off the battery connector points in the battery casing of your phone.
Answer: Using a 5v-2A charger will reduce the charging time. It works for me.
Answer: i just checked charging details of my phone through this app :
https://play.google.com/store/apps/details?id=com.playfulgeeks.chargingreport
Comment: And? How did that prove useful? What did the app tell you?

Slow Charging Battery!


Does a cancer survivor have a higher than average risk of future cancer?

Question: With no recurrence five years after treatment, does a person have average risk of a future cancer ( considered in context of the persons demographics )? Would the risk be affected by the type of treatment of the original cancer ( chemo, radiation, surgery, etc.) ?
Comment: Interesting question, but I'm unsure whether the combined data of all cancers exist. *Cancers are a large family of diseases that involve abnormal cell growth with the potential to invade or spread to other parts of the body* (Wilipedia says that nicer than I could), so a generalization might be dangerous - and isn't really telling you much. As an example: A third occurrence of skin cancer is probably more likely than a third breast cancer.... If there is a kind of cancer you're interest in particularly, maybe focus on that?
Comment: So for a stage 4 HPV induced head and neck squamous (chemo,radiation,surgery) , two subsequent , minor skin basel cells may not be too bad. Apparently one should keep monitoring.
Comment: @blacksmith37 Yes always. Although the exact causes for a cancer type are unknown, there are risk factors.And if they were present the first time (e.g. genes), the probability of getting a cancer is obviously greater than without risk factors. Also, some common cancers like breast and Prostata are supposed to be checked out regularly anyway
Answer: The first part of your question is very difficult to answer for the reasons mentioned in Narusan's comment: Specifically, comparing cancer incidence rates between many different groups of cancer survivors and people from matched demographics who have never had cancer is going to be very difficult, especially since these sets of data would be sourced from varied studies without the same controls. However, the second part of your question—whether the original type of treatment plays a role in new cancer formation (secondary malignancies)—has been investigated.

"The calculated risk of fatal secondary malignancies from intensity-modulated radiation therapy." Kry et al. International Journal of Radiation Oncology Biology Physics. 2005.
Results: Depending on treatment energy, the IMRT treatments required 3.5–4.9 times as many monitor units to deliver as did the conventional treatment. The conservative maximum risk of fatal second malignancy was 1.7% for conventional radiation, 2.1% for IMRT using 10-MV X-rays, and 5.1% for IMRT using 18-MV X-rays.
Conclusion: The risk of fatal secondary malignancy differed substantially between IMRT [intensity-modulated radiation therapy] and conventional radiation therapy for prostate cancer, as well as between different IMRT approaches. Perhaps this risk should be considered when choosing the optimal treatment technique and delivery system for patients who will undergo prostate radiation.

Here, IMRT was shown to deliver a higher "out-of-field" dose (raditation  to untargeted parts of the body) and had a greater associated risk of secondary malignancies than conventional radiation.

"Risk of Developing Second Cancer From Neutron Dose in Proton Therapy as Function of Field Characteristics, Organ, and Patient Age." Jarlskog et al. International Journal of Radiation Oncology Biology Physics. 2008.
Results: The main contributors (>80%) to the neutron-induced risk are neutrons generated in the treatment head. Treatment volume can influence the risk by up to a factor of ∼2. Young patients are subject to significantly greater risks than are adult patients because of the geometric differences and age dependency of the risk models. Breast cancer should be the main concern for females. For males, the risks of lung cancer, leukemia, and thyroid cancer were significant for pediatric patients. In contrast, leukemia was the leading risk for an adult. Most lifetime risks were <1% (70-Gy treatment). The only exceptions were breast, thyroid, and lung cancer for females. For female thyroid cancer, treatment risk can exceed baseline risk.
Conclusion: The risk of developing a second malignancy from neutrons from proton beam therapy of a brain lesion is small (i.e., presumably outweighed by the therapeutic benefit) but not negligible (i.e., potentially greater than the baseline risk). The patient's age at treatment plays a major role.

Like the IMRT, neutron bombardment from proton therapy was shown to have off-target effects and contribute to new cancers.
Hopefully, these papers serve as decent representations of different secondary malignancy potentials with respect to primary cancer therapies. In the article "Understanding Your Risk of Developing Secondary Cancers," the National Comprehensive Cancer Network reminds readers to prioritize their care without regard to comparatively low-probability secondary malignancies:

...patients should not cause themselves undue worry about this possibility. "The biggest risk to patients with cancer is the cancer that they are battling. They should follow the treatment plan designed by their oncologist and not worry about other factors. The vast majority of patients are not going to develop a secondary malignancy because of cancer treatment for the original cancer."

Finally, some medical imaging techniques are similar to those cancer therapies that are more likely to cause secondary malignancies. The BEIR VII report "Health Risks from Exposure to Low Levels of Ionizing Radiation" includes risk estimates for different imaging and radiology techinques (although some academic debate exists on whether it's an appropriate estimation tool for this, the table below uses data from BEIR VII). Keep in mind that any amount of ionizing radiation is not good for your dividing cells!

(XR: x-ray; NM: nuclear medicine; CT: computerized tomography; IR: interventional radiology)
Answer: This is a big topic and there is a huge amount of medical literature and research on the effectiveness of treatments and survival rates, so I will try to give a general overview and take a different slant to the other answer.
Many factors affect recurrence rates, including the type of cancer, treatment, family history and the passage of time. Cancer is not just one disease but a very wide range of conditions, so it is hard to generalise.
This can be considered from two aspects:

Cancer that returns after treatment
New cancers that develop separately from a previous one

Cancer that returns after treatment
Having one type of cancer does make you more likely to have a second cancer of that type in future, as it may suggest an underlying genetic or environmental susceptibility. For example, some people carry mutations of the BRCA genes that are linked with breast, ovarian and prostate cancers. If these gene mutations are present, there is an increased risk of several types of cancer (and probably a significant family history). Fundamentally, all cancers arise from damage or mutations to DNA. BRCA is normally involved in repair of DNA damage, so mutations that prevent this increase the likelihood of DNA damage causing a cancer.
However, most times that cancer "comes back" are because it never went away fully in the first place. Even a single malignant cell escaping treatment can cause a recurrence some time later. This varies greatly on the type of cancer, grade (how aggressive the cancer is, tested by histology and immunohistochemisty for example) and stage (how far the cancer has spread, measured by imaging such as MRI). Here is a link to further explanations of grading and staging cancer.
Another source: Cancer Research UK - Why some cancers come back
We do not have technology that can detect just a few malignant cells that might remain after treatment, which is why people are monitored for years post-treatment.
This is where the term cancer survivor is a little misleading. There is actually an XKCD cartoon that has a good visual representation of this.

New cancers that develop separately
As mentioned above, certain genetic susceptibilities may mean someone with one type of cancer is more prone to another separate one at baseline. For example, someone who has breast cancer and a BRCA mutation is at increased risk of ovarian cancer as well.
I was going to talk about the carcinogenic effects of treatments like radiotherapy and chemotherapy and the risk of cancer arising solely due to these treatments, but this has been covered excellently in the answer by Bruce. If that was the intended focus of the question you should definitely accept that answer :)
Source: Second cancers after breast cancer


Is Ultra Instinct a Super Saiyan transformation or can anyone attain it?

Question: We know that Super Saiyan, Super Saiyan 2, Super Saiyan 3, Super Saiyan God, Super Saiyan Blue, Super Saiyan Rage, Legendary Super Saiyan, Super Saiyan Berserker, Super Saiyan Evolution, etc. are all Saiyan transformations, they can only be achieved by Saiyans. But what about Ultra Instinct? Could a human, a Namekian, a frost demon, etc. attain it?
Answer: The answer to this question can be drawn from a few scenes from Episode 110 of Dragon Ball Super:

Lord Beerus saying what transformation Goku might have gone through:

Lord Champa in shock after hearing what Beerus said:

The Supreme Kai realizing how Goku's movements linked to what he knew:

The Supreme Kai doubting Goku's ability to reach that transformation:

The Gods being pressurized by Goku's transformation:

All this would mean that it's not an exclusive Saiyan trait or transformation, but an extremely powerful and difficult ability that the Gods and other Omega level fighters are known to use.
Comment: And we see Whis fanboying in the background. Also, note that Ultra instinct is the technique that Whis was training Goku and Vegeta to use, Where each part of your body thinks and reacts for itself. Wondercricket's answer does an excellent job of pointing that out.
Comment: @Ryan: True. I thought it was obvious enough from just that scene that it wasn't Saiyan exclusive, since the question deals with the usability of that technique.
Answer: I am not very keen on the Dragon Ball franchise, but based on the Ultra Instinct wiki, there are three individuals who use the Ultra Instinct - Only 1 of them is a Sayian

Ultra Instinct (身勝手の極意 Migatte no Gokui, lit. Key of Egoism) is a mental state used by Whis and his disciples, Beerus and Goku.

According to each individuals wikis, Whis is of the Angel race, Beerus is of the Beeru's Race, and Goku of the Sayian race. Seeing how the ability is a mental state of the individual, it is quite possible that other races are able to obtain this ability as well - although the prerequisites are not entirely clear, even to Goku

It is not completely clear how this form is attained, not even to Goku himself.

However, this ability is also apparently extremely hard to master, even for gods

It is notorious among the Supreme Kais and Gods of Destruction for being exceptionally difficult to master, even for gods. Goku attains this state during the Tournament of Power
Comment: I'm not sure how necessary it is, but a small improvement might be to note that the 3 are the only confirmed users of ultra instict, but not nessecarily the only ones capable of using it. There are 12 universes, and likely all 12 angels in them (Whis included) can probably use it, and several of the Gods of Destruction (Beerus included) too can probably to some degree use it. Not including the higher ranked individuals. Those 3 are just the only 3 we have direct proof of it being used, Goku in the anime only, Beerus in the manga (also mentioned in both), and Whis in both.


Does taking levels in a prestige class cause XP Penalty?

Question: In D&D 3.5, does taking levels in a prestige class cause the XP penalty like multiclassing does? Please provide the source of the answer so I can show it to my players.
Answer: According to the srd, no, taking a prestige class does not cause an XP penalty. To grab the quote:

Taking a prestige class does not incur the experience point penalties normally associated with multiclassing.
Answer: Very few tables use the multiclass XP penalty.
No table ever should use the multiclass XP penalty.
In hypothetical discussions around the multiclass XP penalty and favored classes, in my experience, the unanimous consensus is that prestige classes don't count towards the XP penalty.
As IgneusJotunn's answer shows, the SRD indicates that prestige classes do not count towards the XP penalty. And I have confirmed that this line appears in Wizards of the Coast's original publication of the SRD section on prestige classes. The 2012 premium edition of Dungeon Master's Guide also includes this line, apparently a bit of stealth erratum.
But I can find no discussion of this in any of the books themselves prior to that 2012 edition of Dungeon Master's Guide. I specifically checked Player's Handbook, Dungeon Master's Guide (and its errata), and Rules Compendium:

Player's Handbook only mentions prestige classes a couple of times as a thing you can find in Dungeon Master's Guide,
neither Dungeon Master's Guide nor its errata make any reference to the multiclass XP penalty—the line in the SRD is not found at all, and in its place is an example rogue becoming an assassin—, and
Rules Compendium doesn't even use the phrase "favored class," much less discuss the multiclass XP penalty.

I have no idea where the SRD got the line from—it seems to have originated in the SRD itself. Rules-as-written, that's kind of dicey—the primary source on prestige classes is Dungeon Master's Guide, not the SRD, which means the errata would have us rule this "conflict" in favor of the book. The 2012 edition reprinting would be valid, so with that we have solid ground to stand on, but the issue certainly existed prior to 2012. So if we ignore that line and use just the books, that leaves us with a synthesis of disparate rules that may or may not have been intended to be used together:

XP for Multiclass Characters
[...]
Uneven Levels: If any two of your multiclass character's classes are two or more levels apart, the strain of developing and maintaining different skills at different levels takes its toll. Your multiclass character suffers a −20% penalty to XP for each class that is not within one level of his or her highest-level class.

(Player's Handbook, pg. 60)

Prestige Classes
Prestige classes offer a new form of multiclassing. Unlike the basic classes found in the Player's Handbook, characters must meet requirements before they can take their first level of a prestige class. The rules for level advancement (see page 58 of the Player's Handbook) apply to this system,

(Dungeon Master's Guide, pg. 176)
Now, the "rules for level advancement [on] page 58 of the Player's Handbook" presumably refers to the section entitled Experience and Levels that begins on page 58—and ends on page 59, when the Multiclass Characters section begins (that is, Multiclass Characters is a new section, not a subsection of Experience and Levels, at least going by the heading style). So Dungeon Master's Guide page 176 is not explicitly directing us to use the rules for multiclass characters, including the XP for Multiclass Characters section on page 60. But it does refer to prestige classes as a "form of multiclassing," and prestige classes are certainly "classes." Rules-as-written, barring the line that seems to have originated in the SRD (which is, again, dubious from a RAW primacy perspective), there seems to be little ground to stand on for freeing prestige classes from multiclass XP penalties.
Of course, as poorly-designed as the multiclass XP penalties are in general (Seriously, why is this so taxing? Even just reading the quoted description in Player's Handbook makes no sense to me), applying them to prestige classes is even worse—no race in the game has a prestige class as a favored class, and you can't enter a prestige class without multiple levels in something. Unless you play a character has no more than 2 levels in any one class, the XP penalty is inevitable—which seems like the sort of thing that should be mentioned as a major drawback if it was intended. That lack of mention (seriously, nowhere in the book are multiclass XP penalties mentioned) stands out to me as a strong, albeit circumstantial, case for claiming that the authors intended prestige classes to be exempt from multiclass XP penalties. And the line that showed up in the SRD goes a long way towards confirming that.
Of course, these are the same authors who, presumably, intended the multiclass XP penalty to be applied at all, so, ya know, grain of salt and everything. Their opinion on this subject should be ignored anyway.
Comment: The premium edition of the *Dungeon Master's Guide* (2012) says, "Taking a prestige class does not incur the experience point penalties normally associated with multiclassing" (176). Stealth erratum FTW! (That added text causes the left column's text to extend 1 more line past the arcane archer's foot to accommodate it when compared to the original *DMG* (2003).)
Comment: (There's a brief *FAQ* entry on this subject, too, and it sounds like it's originally from a *Dragon* magazine Sage Advice column.)
Comment: In particular, according to the FAQ, the omission of the relevant line (which appears in the SRD, but not the DMG nor the DMG errata IIRC) is an error, rather than an intentional omission. Thus while the rule __doesn't__ appear in the core rules, the author insists that it was supposed to.
Comment: @HeyICanChan Good god... All right, will revise this answer next time I take a break from packing. Nice find.


NJ driving license with expired UK license and French passport

Question: I live in New Jersey, I have a Green Card, a French passport, and an expired UK driver license. (I lived there for many years.) I was initially told by the local DMV  that all I needed to get a NJ license was to pass the knowledge test. I just did today, and another employee told me that because my UK license has expired I am not allowed to drive without another adult present for the next 3 months AND I need to take the road test. I live in the suburbs with kids, just got a job I need to drive to, and this would really wreck my life. Every employee gives me a different answer. So -- is there ANY WAY I can get a basic US license without all the supervised driving and road test ringmarole? Could I renew my UK license without a UK passport, and if so would it solve the problem? Loads of thanks.
Comment: Although inconvenient, lack of a full driver's license for three months will not wreck your life. For different reasons, I didn't have a car for the first few months I lived in California. I walked a lot. I used public transportation - which was not quite at the standards I was used to living in central London. I made carpool arrangements with a colleague who lived nearby to get to and from work.
Comment: @PatriciaShanahan where did you live in California?  I know several people who've lived in San Francisco and LA in parts of town where they could walk to supermarkets.  I also know a few people who live in New Jersey where the nearest place to buy food is probably 5 miles away -- well more than an hour's walk.  How many children did you have when you lived in California?  How old were they?
Comment: @phoog I lived in Escondido, and worked in Rancho Bernardo. No, I didn't have children, but if I had, I would have been working with parents of other children going to the same schools. The OP specified suburban, not rural. I know it will be a lot more convenient if the OP gets an actual answer, but failing to get one should not be considered the end of the world, but a challenge to be overcome.
Comment: And without a UK passport, residence, addresses where you've lived in the last three years and national insurance number, you would not be able to renew an expired UK license, according to https://www.gov.uk/renew-driving-licence. I'm with @Patricia Shanahan: arrange carpools to both job and schools, very common, particularly in the suburbs.
Comment: I feel sorry for the OP, but moving to a place where you needed to drive without a valid driver's license from somewhere may have been short sighted. Could you swap the expired UK license for a valid French license?
Answer: It seems unlikely you will be able to avoid the supervised driving and road test, so the objective should be to prevent that from wrecking your life. Here are some potential solutions to sub-problems. I am sure you will be able to think of others that fit your specific situation:

Carpool to work. You need to find at least one colleague living reasonably near you who is willing to help out. Assuming the colleague is a licensed driver, it can operate as a normal carpool, except that, when it is your turn to drive, the carpool has to leave from, and return to, your house.
Delivery services. Depending on your area, you may be able to get groceries delivered. Amazon has an amazing range of non-perishable stuff that can just appear on your doorstep with no driving required.
Joint shopping trips. Go shopping with a friend or neighbor.
School carpool. If at least one child can neither walk nor use school buses, you will need to work with parents of other children at the same school.
Special cases and emergencies - there is always Uber.

One key to getting the help you will need from friends and neighbors is to be willing to help others. Be the driver for any group social outings that include at least one adult licensed driver. Offer rides to any adult licensed driver in your social circle who is temporarily disabled. You don't necessarily have to repay directly the people who are helping you, if you are seen to be helping others as much as you can.


Responsibilities of common muslim in spreading Islam

Question: What are the responsibilities of common muslim to spread Islam? A common person is one that is not a scholar in Islam and does not hold any position within the government.
Please give references from Quran and Hadith
Answer: In the name of Allah
This field is very critical because you are not allowed to spread the facts which you don't know well, on the other hand you are responsible to invite others and reflect the facts of our religion Islam as much as you can and know. Because now a days "As we have seen, the mass media is spreading falsehood and legitimizing slanderous and scientifically inaccurate terms like "fundamentalism," intégrisme, integrismo and "radical Islāmism. A believer is allowed to move to non-Muslim countries for purpose of inviting non-Muslims to Islam provided that he is sure or has confidence that the journey would not have a negative impact on his faith and the faith of those who are related to him. And it should be considered that it is haram to travel to non-Muslim countries in the East or the West if that journey causes loss of the faith of a Muslim, no matter whether the purpose of that journey is tourism, business, education, or residence of a temporary or permanent nature, etc.
The subject may be discussed from the viewpoints of both Quran and hadith.
Quran
According to the holy Quran book, not only the Prophet (S) was made responsible for spreading and propagating Islam, but also all the believers were held responsible for the propagation of its message and teachings. God says in the Qur'an:

قُلْ هَٰذِهِ سَبِيلِي أَدْعُو إِلَى اللَّهِ ۚ عَلَىٰ بَصِيرَةٍ أَنَا
  وَمَنِ اتَّبَعَنِي ۖ وَسُبْحَانَ اللَّهِ وَمَا أَنَا مِنَ
  الْمُشْرِكِينَ "Say: `This is my way; I call to Allah with sure
  knowledge, I and those who follow me. To Allah be glory! And I am not
  one of the polytheists." (12:108)

It is emphasized in this verse that the followers of the Prophet (S) would continue his mission, irrespective of the fact that they belong to the age of the Prophet (S) or any later age. The committed Muslims in the course of performing this Divine mission had to suffer all kinds of hardships; they were tortured, imprisoned and even assassinated, but never gave up. Without such effort of Muslims, Islam would not have emerged victorious."
In another verse we have:
…

And those who treasure up gold and silver, and do not spend them in
  the way of Allah; inform them of a painful chastisement." The
  above-mentioned holy verse has clearly prohibited treasuring up wealth,
  and commands Muslims to utilize their properties actively in the way
  of Allah and in a profitable path for Allah's servants

We may conclude that for spreading the religion having the required knowledge is not the most important factor, because we may sometime be able to help the religion of Allah by our wealth. The well-known example for this case is khadijatol kobra. Seyed A.A Razwy writes in his "Khadijatol Kobra, A Short Story of Her Life":

Khadija, the first wife of Muhammad Mustafa, the Messenger of Allah,
  (may Allah bless him and his Ahlul-Bayt), and the first Believer,
  evokes a most extraordinary personality. She played a stellar role in
  the history of nascent Islam. She was, with Abu Talib, one of the two
  greatest benefactors of Islam and the Muslims. At a time when Islam
  was under unremitting predation pressure; and was, for three years, in
  a state of unrelenting siege, she bailed it out, by her incredible
  sacrifices. Her constancy, her tenacity, her vision, and her
  indomitable faith in Allah, and in the mission of Muhammad Mustafa -
  His Last and the Greatest Messenger - were the sine qua non as the
  underpinnings of Islam during the first ten years of its existence.

Hadith
Spreading the religion is also advised in hadith. The believers are responsible to invite others to religion.

The Prophet said to Imam 'Ali, "If Allah guides a person from among His servants through you, then that is better than everything between the east and the west on which the sun shines."1 When asked by a person for a counsel, he said, "I advise you not to associate anything with Allah...and to call the people to Islam. You should know that [the reward] for you for each person who answers [your call] is [equal to] emancipating a slave from the children of [Prophet] Ya'qûb."2>

References:
http://www.al-islam.org/shiite-islam-orthodoxy-or-heterodoxy-luis-alberto-vittor/author's-preface
1-Al-Hurr al-'Amili, Tafsilu Wasa'ili 'sh-Shi'a, vol. 16, p. 188.
2-Ibid
Comment: I am hoping to get an answer in form of a list, with reference from Quran or Hadith. In its current form, it is not very useful.


What's the effect of playing with high action?

Question: I have guitar, the action is really high. My question is: what's the affect of learning and practicing in high action in the long term? Is this an advantage or not? Is high action something that'll keep me as an intermediate-beginner from moving forward?
Answer: It depends.
How high is high? And what is the cause of the high action? If it is an improperly cut (too high) nut, it will make barré chords in the first few frets difficult, and open chords will be out of tune. If it is too high because of a bridge that is too high, or too much neck relief, it will be increasingly difficult to play the higher up the neck you are, as well as cause problems with intonation.
On the other hand, I can see how a high action will help a player develop hand strength, at the cost of slowing you down. A guitar with high action will also have better tone and dynamic range (this may be a subject of some debate) since the string has more room to vibrate and can be struck harder before "hitting the frets". (This mostly concerns acoustic instruments.)
All in all, if the instrument is playable, use it! But perhaps be on the look-out for a better one, or investigate the possibility of having the action lowered/corrected. Will it keep you from moving forward? Again, it depends on what you want to be able to do. At some point you will probably feel the need for a better instrument, but until then, keep on playing!
Answer: If the guitar is playable, then it shouldn't cause any major issues and may actually help build hand and finger strength.  Unless it's so difficult to play that it results in excessive stress.  If playing your guitar necessitates too much muscle tension to overcome the high action, playing it could potentially lead to over use/stress injuries.   So it really depends on how difficult your instrument is to play.
It will slow your progress as you attempt to develop speed and add more barre chord formations to your chord vocabulary.  But if it's temporary with an eye towards a lower action guitar in the future, it could help with your progress in the sense that you will be forced to adapt to greater challenges.  It would be the same concept of an athlete training while wearing a weight vest.  It would slow him/her down but potentially accelerate strength building by forcing the muscles to overcome greater resistance.  But again - too much added weight could lead to injury.
I would encourage you to consider either having the action of your existing guitar lowered to a comfortable playable level or acquiring a guitar with lower more playable action fairly soon.  As a beginner to intermediate player, you could become frustrated if the action of your guitar makes it difficult for you to play some things you want to play.  My personal philosophy is that at the beginning stages, you want to make playing your instrument as easy as possible.  You want the learning process to be rewarding and not frustrating.  Later, a high action guitar can be used periodically to maintain and increase finger strength.
Answer: It depends on ergonomics and tone.
In general, you want your action to be as low as possible without string buzz; otherwise your intonation will be off, it will be hard to get strings to sound cleanly and you will do physical damage to your finger joints and also possibly get carpal tunnel syndrome.  I'm speaking from experience here.
On the other hand, Stevie Ray Vaughan used thick strings and played with a very high action because he liked the tonal characteristics of his guitar when it was strung that way.
Answer: Yes! I practice with a high action cause I'm crazy like that! It definitely increases hand strength. But most of all, I love the sound of pressing hard and getting that nice Jazzy tone. I use .14 .18 .26 .26 .36 .47 .56 flat wound gauge. Nevertheless, I probably would play faster for up tunes with less tension. I have to have another guitar with lower action. Especially when I use my thumb like Wes Montgomery. When I play other guitars with lower gauge I can really rip, but it does depend on the guitar. For instance, I cannot play comfortable with very low action. Maybe because I'm so used to the high action. On the other hand one "cat" plays with 12's on an Ibanez archtop.  I can rip on that guitar. Now, you go figure!
My students still call me crazy Dave and my guitars usually need adjustments. My repair men always tell me I should stop putting heavy gauge strings with high actions. They could be right, but I don't care. Play what feels good and sounds good if you like high action. But practicing Jazz chops! Go on and raise that action! Rock and roll chops and R&B etc... low action only! Might as well stick to your guns.


How to issue machine certificates to Android devices trying to connect to L2TP VPN (L2TP/IPsec with Certificate)?

Question: I are trying to find a way to connect Android devices to our VPN box running Windows Sever 2008.  We manage to configure a couple Android devices to connect via PPTP. However, I would like to be able to connect using L2TP/IPSec with certificates instead. I've managed to export and apply the Enterprise CA's certificate on the Android phone, but are totally lost on how to issue a machine certificate to the Android phone. Is it even possible? If so, what are steps I should take to issue the machine certificate and enable the Android phone to connect via L2TP/IPsec with certificates?  Thank you for your help!
Comment: what version of Android?
Answer: To my knowledge there is no android support for SCEP or NDES enrollment... we need to have a way to open enroll these devices through an application, but none exist to date.  To my knowledge, android only supports the certificates to be installed from the SD card.  It is odd to me that iphone supports NDES but android does not.
Answer: Google has this link posted about how to install certificates.On a nexus running jellybean, I used the instructions at the link below to generate the certificates and install them using adb.These instructions worked well for me to get the certs installed and test a vpn connection to a linux server running strongswan 5.0.
http://support.google.com/android/bin/answer.py?hl=en&answer=1649774
Answer: Looks like the Android implementation of L2TP certificate auth may not be compatible with most L2TP/IPSec VPN's: http://www.astaro.org/astaro-gateway-products/vpn-site-site-remote-access/35861-asg-doesnt-work-android-l2tp-ipsec-certificates-remote-vpn.html
You may have to resort to PSK, ech.  Let us know if you make headway!
Answer: Posted the same question on Microsoft Technet and received a suggestion on trying to enroll the Android device using Windows 2008's Network Device Enrollment Service. Unfortunately, I am unaware of any device administration software on Android that will allow me to create RSA public/private key pair and submit them for enrollment request to my CA.  Any suggestions, or is this a dead end?  I am testing this is HTC EVO 4G, Android 2.2.
Answer: I've managed to get certificates onto an Android running FroYo by emailing the cert to an address the phone can access.  Opening the attached certificate from the mail client resulted in installation.
Unfortunately, Android FroYo doesn't properly support Cisco VPN, so I didn't get a sucessful test however - but the certs certainly appeared to be there.