I am trying to connect with Xero using Named Credentials. I am using oAuth2.0 authentication protocol.   I have created a Auth. Provider and Named credentials as shown in the image below     The Named Credentials Authentication Status is showing as pending. How to make it authenticated?  I have checked "Start Authentication Flow on Save" but once i hit on save i am getting this url "" and error code 500.  I think i am missing some steps. Please help.  Quick Update : Call back url i have in auth provider in Salesforce and in Xero connected app are different. Can it be the reason?  Thanks, Soumen
I am trying to do the integration between Salesforce and Xero by using Named Credentials (Authentication Protocol is OAuth 2.0). I created an Auth provider -    Then created Named credentials of OAuth 2.0 type and authenticated with required scopes mentioned in the Xero developer document.    When I am trying to run the below code to get the Account details from Xero, I am getting "AuthenticationUnsuccessful".  HttpRequest req = new HttpRequest(); req.setEndpoint('callout:XeroDev/api.xro/2.0/Accounts'); req.setMethod('GET'); Http http = new Http(); HTTPResponse res = http.send(req); System.debug(res.getBody());   This is the response -      {"title":"Forbidden","status":403,"detail":"AuthenticationUnsuccessful","instance":"707450d8-b455-47ec-a1b4-85bcb2cf80c9"}   Any suggestion on how to make it work by using Named Credential?  Xero URL -
I have a Alcatel onetouch model 50540 running android 5.1.1 as in the title. it is rooted and began uninstalling pre-installed bloatware on my device. I do not have a complete list of uninstalled apps because I had only kept track after the first few, but ill list the ones I do know about    Download Manager Downloads Talkback Hangouts Cricket Wi-Fi Manager Camera Email Onetouch Launcher   That is the essence of what I did. I do have an edited hosts file as a makeshift adblock.  Play store gives me an error code 0 to which I removed app data and tried again, same problem.  I have tried installing local apps which brings up an "app not installed" box.  Lastly I have tried do directly extract the app into /data/app and rebooting which didn't work. Why are some genes dominant over others? What is the mechanism behind it? If I have a brown eye gene which encodes the protein that is responsible for the brown color and have a blue eye gene as well, what is the reason that my eye color is brown? How does one gene maintain dominance over the other? How to display the final value of a counter at the beginning of a document? How to get rid of navigation symbols in beamer? Solve $\frac1x+\frac1y=\frac1{pq}$ For $x,y\in\mathbb{N}$ how many ordered pairs $\left(x,y\right)$ satisfy   $\dfrac{1}{x}+\dfrac{1}{y}=\dfrac{1}{pq}$ where $p,q$ are distinct primes? Can I mix MySQL APIs in PHP? Light "diode" and 2nd law of thermodynamics If I had a light "diode" - an object that only allowed light (at least for a range of frequencies) to travel through it in one direction, would this necessarily allow violations of the 2nd Law of Thermodynamics?  Or would it be possible to restrict other properties of the device such that it could be okay.  Why I think it should violate 2nd law:   I can place such devices at temperature T in a bath of thermal radiation at temperature T, such that it forms a box which only lets the light in or out.  This would appear to always allow one to create a thermal gradient.  Once a thermal gradient is formed, useful energy can be extracted.  This seems to allow useful energy to always be extracted from a thermal bath and thus give perpetual motion. Release one such device at temperature T in a bath of thermal radiation at temperature T.  Since the photons are absorbed or reflected in one direction, and undisturbed in the other, the device will start moving.  It can use a thermal bath to directly generate useful motion.   Why I think I'm missing something and such a device could potentially co-exist with the 2nd Law:   The above arguments seem valid if the diode was only 'partially' rectifying as well.  However there exist sunglasses which largely reflect on one side, but not from the other side. Researchers have succeeded in using meta-materials to create a "blackhole" for microwaves.   Can anyone help sort this out? Block error on CMI I have two identical sites on Drupal 8 (A and B), on (A) I created a custom block(block/add), and then I export the configuration(drush config-export) and import this config on (B) (drush config-import), no error, but on the site (B) the block that I imported said on any region that I put "This block is broken or missing. You may be missing content or you might need to enable the original module." And I cant edit the content of this block. How I can fix that?  Site A:    Site B: When he was just a professor, Dumbledore taught Transfiguration. As Headmaster what was he doing all day? In the 6th movie he was diligently looking for Horcruxes, but what about the other times?  When Fred and George pass the Maurader's Map to Harry they note that Dumbledore is pacing in his office. "He does that a lot" one of them says. Did Dumbledore just endless pace in his office as Headmaster, afraid to leave it for fear someone would know that he produced no work?   Sure, every year he had to go find a new DADA teacher, but most of those it seemed he did through correspondence. Horace Slughorn was the only one that seemed to resist. Dumbledore's 6th year may have been the only one where he earned his paycheck. Let $a&gt;0$, show that for $x&gt;0$, $1&lt;f(x)&lt;2$, where $$f(x)=\frac{1}{\sqrt{1+x}}+\frac{1}{\sqrt{1+a}}+\sqrt{\frac{ax}{ax+8}}$$  I could take the derivative, find the maximum of the function and conclude. But that involves heady algebra and you have to solve a high degree polynomial. Is there an easier way simply using inequalities? Thanks, much appreciated Had it not been vs If it were not for I've just seen the following sentence on a band's biography:     Had it not been for a studio theft, the band might never have made that song.   Then I was wondering if I can change this sentence to:     If it were not for a studio theft, the band might never have made that song.   Is the second sentence correct? Are they interchangeable?   Thanks in advance. If you have the ability to cast a spell without a spell slot, can you cast that spell using a spell slot? A 10th level Drow warlock (for instance) has the following Drow Magic racial trait (PHB p. 24), in addition to its warlock spellcasting abilities:  You know the dancing lights cantrip. When you reach 3rd level, you can cast the faerie fire spell once per day. When you reach 5th level, you can also cast the darkness spell once per day. Charisma is your spellcasting ability for these spells.  Can the Drow warlock cast faerie fire (which is not on the warlock spell list) using a warlock spell slot? Can it cast darkness (which is on the warlock spell list) using a warlock spell slot?  The  says this about the Magic Initiate feat:  If you’re a spellcaster, can you pick your own class when you gain the Magic Initiate feat? Yes, the feat doesn’t say you can’t. For example, if you’re a wizard and gain the Magic Initiate feat, you can choose wizard and thereby learn two more wizard cantrips and another 1st-level wizard spell. If you have spell slots, can you use them to cast the 1st-level spell you learn with the Magic Initiate feat? Yes, but only if the class you pick for the feat is one of your classes. For example, if you pick sorcerer and you are a sorcerer, the Spellcasting feature for that class tells you that you can use your spell slots to cast the sorcerer spells you know, so you can use your spell slots to cast the 1st-level sorcerer spell you learn from Magic Initiate. Similarly, if you are a wizard and pick that class for the feat, you learn a 1st-level wizard spell, which you could add to your spellbook and subsequently prepare.  But this specifically requires you to pick the feat for one of your classes to be able to cast the spell learnt using your class spell slots, and does not seem directly applicable. A Warlock can use warlock Pact Magic spell slots to cast spells learnt from levels of another spellcasting class, per the multiclass spellcasting rules (PHB p. 164):  If you have both the Spellcasting class feature and the Pact Magic class feature from the warlock class, you can use the spell slots you gain from the Pact Magic feature to cast spells you know or have prepared from classes with the Spellcasting class feature, and you can use the spell slots you gain from the Spellcasting class feature to cast warlock spells you know.  Similarly, if the warlock has learnt the invocation Mask of Many Faces (PHB p. 112)...  You can cast disguise self at will, without expending a spell slot.  ...Can the warlock cast disguise self using a spell slot, e.g. to decrease the chance it can be dispelled? A required field that isn't really required? ...the email field in my clients data entry system is required but users of the system are allowed to enter na@na.com if the customer refuses or doesn't have an email address. Is this best practice? Have any suggestions or workarounds for their solution? The rules for the monk ability Tongue of the Sun and Moon state:     Starting at 13th level, you learn to touch the ki of other minds so that you understand all spoken languages. Moreover, any creature that can understand a language can understand what you say.   PHB, pp.79   The text says that this ability is something you learn to do, not something that simply happens to you, so it's not necessarily always on. Further, it seems logical to say that this is something you would do actively. That is, you could choose not to touch someone's mind, thereby excluding them from understanding you. You could also choose not to understand someone yourself, just in case they're telling , or using a subliminal trigger.  Assuming you can choose not to touch someone's mind, let's reason further. Suppose you're speaking and don't know that there is someone listening in nearby. Would they understand you, i.e. is the default that you are or aren't touching someone's mind? Similarly, if you are speaking to a large group of people, would you have to focus on all of them at once for them to understand you? Would this take effort? Is there a range?  My questions are:   Can you exclude some characters from understanding you while allowing others to do so? Can you decide not to understand someone who is speaking?   Basically, these boil down to: Can you choose not to touch someone's mind?  Then, assuming that the answer to the above is yes:   Do you have to know someone is listening in order for them to understand you? Is there a limit to the number of people you can affect? A range? If $p$ is prime, then $(x+y)^p=x^p+y^p$ holds in any field of characteristic $p$. However all the proofs I have seen use induction and some relatively nasty algebra despite how fundamental this fact seems.  What is the nicest, "highest level proof" you know? What is the perception of students who take a gap year between their graduation and starting graduate school? I am an undergraduate mathematics major, entering my fourth year. I plan on applying to graduate school, but I have not yet taken the GRE exams, and there a few key courses (Topology and Algebra in particular) that I have not taken yet, so I am hesitant to take the Advanced Math GRE too soon. (If you're wondering why I haven't taken Topology and Algebra yet, it's because I was trying to secure a CS degree, which sidetracked my mathematical studies last year. It was a healthy branching out experience, and one that helped me realize my true academic passion.)  My main question: what is the perception of students who take a gap year between their graduation and starting graduate school?  I think I will take the GRE tests this fall, a) for practice and b) if I score high, then I might as well apply sooner rather than later. However, I ask this question to gauge how much energy I should put into preparing for the tests this fall. If I hear, "You should really do your best to avoid any gap in your education," then I will work my butt off in preparation for the tests. But if I hear, "It's totally okay take a gap year before going into graduate school," then I would give myself more freedom in terms of my non-standardized-exam studies, extracurriculars, and in general social activities. I figure the answer to this question won't be as cut-and-dry as I hope, but any advice would be appreciated!  Just to clarify, my gap year would not consist of me sitting at my desk taking practice GRE exams all day... That would be a pitiful use of my time. I definitely plan working either as an intern or a research assistant at a successful organization. It seems like the general consensus is that taking time off is okay, and potentially beneficial, assuming you actually do something in that gap. Comparing and contrasting, p-values, significance levels and type I error I was wondering if anybody could give a concise rundown as to the definitions and uses of p-values, significance level and type I error.  I understand that p-values are defined as "the probability of obtaining a test statistic at least as extreme as the one we actually observed", while a significance level is just an arbitrary cutoff value to gauge if the p-value is significant or not. Type I error is the error of rejected a null hypothesis that was true. However, I am unsure regarding the difference between significance level and the type I error, are they not the same concept?  For example, assume a very simple experiment where I flip a coin 1000 times and count the number of times it lands on 'heads'. My null hypothesis, H0, is that heads = 500 (unbiased coin). I then set my significance level at alpha = 0.05.  I flip the coin 1000 times and then I calculate the p-value, if the p-value is > 0.05 then I fail to reject the null hypothesis and if the p-value is &lt; 0.05 then I reject the null hypothesis.  Now if I did this experiment repeatedly, each time calculating the p-value and either rejecting or failing to reject the null hypothesis and keeping a count of how many I rejected/failed to reject, then I would end up rejecting 5% of null hypotheses which were in actuality true, is that correct? This is the definition of type I error. Therefore, the significance level in Fisher significance testing is essentially the type I error from Neyman-Pearson hypothesis testing if you performed repeated experiments.  Now as for p-values, if I had gotten a p-value of 0.06 from my last experiment and I did multiple experiments and counted all the ones that I got a p-value from 0 to 0.06, then would I also not have a 6% chance of rejecting a true null hypothesis? Why didn't Umbridge succeed in Slytherin? The new information released about Umbridge on Pottermore on Halloween was interesting in that it demonstrated how insidiously Dolores Umbridge applied her ruthless ambition over the years. From making her half-blood family disappear from public view, to oozing her way through the Ministry and up the ladder of success, basically unfettered -- although no one liked her as a person, despite her saccharine demeanor -- this woman was over and again awarded significant positions of power where she could do tremendous damage to others.   Some might see these as Slytherin traits. Some. &lt; shifty eyes > So I was surprised to read that while Umbridge was a Slytherin student at Hogwarts, she was consistently overlooked for positions of power and prestige within Slytherin itself.   Why didn't Umbridge succeed in Slytherin?  RESOURCE: Pottermore on Dolores Umbridge:  , Why is using "for...in" for array iteration a bad idea? Proving surjectivity of $\cos(z)$ and $\sin(z)$ and find all $z : \cos(z) \in \mathbb R$ and all $z: \sin(z) \in \mathbb R$