import math def hexToDec(hexi):     result = 0     for i in range(len(hexi)-1,-1,-1):         if hexi[i] == 'A':             result = result + (10 * math.pow(16,i))         elif hexi[i] == 'B':             result = result + (11 * math.pow(16,i))         elif hexi[i] == 'C':             result = result + (12 * math.pow(16,i))         elif hexi[i] == 'D':             result = result + (13 * math.pow(16,i))         elif hexi[i] == 'E':             result = result + (14 * math.pow(16,i))         elif hexi[i] == 'F':             result = result + (15 * math.pow(16,i))         else:             result = result + (int(hexi[i]) * math.pow(16,i))     return result   Even after reversing the range order and reimporting I still get the same results.
How do I convert a hex string to an int in Python?   I may have it as "0xffff" or just "ffff".
jQuery :first vs. .first() In Season 6, we find out the following about the magical properties of the wall:     BENJEN: This is where I leave you.   BRAN: You're not coming with us?   BENJEN: The Wall is not just ice and stone. Ancient spells were carved into its foundations. Strong magic to protect men from what lies beyond. And while it stands, the dead cannot pass. I cannot pass.   —"Winds of Winter" (Game of Thrones, S06E10)   So why would the men of Westeros need to worry about the Night King and his army? Couldn't they sit back and enjoy the wall's protection? I've been at this for almost two hours and no one seems to have the same problem as I and I doubt this will be solved but I'll try anyway.  this is the code  /tellraw @p ["Would you like to teleport?",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tp @p ~ ~4 ~ "},"hoverEvent":{"action":"show_text","value":{"text":"Confirm"}},{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p{"text":"Come back when you want to teleport"}"}}}]   this part is fine  /tellraw @p ["Would you like to teleport?",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tp @p ~ ~4 ~ "},"hoverEvent":{"action":"show_text","value":{"text":"Confirm"}}   it's just when I add this  ,{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p{"text":"Come back when you want to teleport"}"}}}]   Minecraft gives me the error:     Invalid JSON at line 1 column 203   I've tried to space it out and figure out what column 203 is but I can't, I don't know what I did. Anyone got any ideas? Why does "for good" mean "forever"? A very recent and similar  was closed asks what "for good" means.  While general reference can answer the question, I became curious as to the etymology of the idiom.   around got me nowhere, which is unusual.  The closest I found was a thread in :     OED   for good (and all): as a valid conclusion; hence, as a final act, finally.    15.. Parl. Byrdes Aij, Than desyred al the Byrdes great and smal to mewe the hauke for good and all. 1603 in Crt. &amp; Times Jas. I (1849) I. 25 D’Auval.. is gone for good and all. 1687 CONGREVE Old Bach. I. i, Ay, you may take him for good-and-all if you will. 1711 SWIFT Jrnl. to Stella 4 July, This day I left Chelsea for good, (that’s a genteel phrase). a 1732 T. BOSTON Crook in Lot (1805) 37 He was obliged for good and all to leave his country. 1850 J. H. NEWMAN Diffic. Anglic. 324 Throw off, for good and all, the illusions of your intellect. 1882 W. E. FORSTER Let. To Gladstone 10 Apr. in T. W. Reid Life (1888) II. viii. 421 This morning we released Parnell—not for good, but on parole.   However, this only traces some historical usages, and suggests that for good and all used to be a more popular version of the current idiom.  Is there anything more substantial?  Why did "for good" come to mean "forever"? converge and converge absolutely of a series $f(x)$ is a continuos fuction in $[0, 1]$ and differentiable twice on $0$.  $U_n=(-1)^{n}f(\frac{1}{n})$. I need to prove that:   $1.$if $\sum_{n=1}^\infty U_n$ converge then $f(0)=0$.  $2.$if $f(0)=f'(0)=0$ then $\sum_{n=1}^\infty U_n$ converge absolutely.  Now, from the detail that $f(x)$ is differentiable twice on $0$ I think I need to write $f(1/n)$ with Maclaurin series with 2 degree but it doesn't work very nice. can you guide me please? thanks! Can sudo be reinstalled after being removed? bash: ./program: cannot execute binary file: Exec format error How to determine the most likely reading frame of a DNA sequence? This question is from a past exam paper for an introductory bioinformatics module. I'm a computer scientist doing biology for the first time.  "A short bacterial gene has been sequenced, giving the following DNA sequence. Write out the 6 possible reading frames for this sequence and indicate which is the most likely protein translation of this sequence. Explain your reasoning for picking the given translation, and write all the translations in single letter amino acid code form.  5' - ttattcatccgccagcgccatgcgcgccat - 3'  "  I think I understand the 6 possible reading frames: three from the 5' end starting tta, tat and att; and three from the 3' end starting tac, acc and ccg.  I could also write out the translations for a given reading frame with a codon usage table. It's the most probable reading frame part I don't get. I thought perhaps I was looking for the longest open reading frame. I can only see one start codon (atg). What is the correct way to recognize the most probable reading frame?  I can't find this problem exactly on Biology Stack Exchange. I did find:     It made me wonder if I'm getting confused between "reading frame" and "open reading frame", this question only asks or the former.  Thanks! I don't know much more about SEO, but it's interesting to learn about it. When I tried to search my website with an associated keyword or you can say with the exact name of the domain, I got some suggestions by Google. Here's .  First of all, I don't want to spamming here, I just want prove my question and want to give a hint about what I am talking here. The above link display the Did You Mean, I know the specific reason why Google shows this, but I want to know the Google's guidelines and some guidance by you experts so that if someone search for the particular keyword then Google hide that Did You Mean and display the result. How do I change the plymouth bootscreen? How does gravity work on Serenity? When the good ship Serenity is traveling in deep space, the crew experiences what looks like an Earth-normal (or Earth That Was-normal) level of gravity. Is it ever explained how the ship is able to generate artificial gravity? The ship doesn't spin, so  is out.  is a possibility, but I think the gravity in the ship pulls in a direction that is perpendicular to the direction the ship is usually traveling in, not opposite, like this method would require.   So: how does she pull it off?   Extra credit: how does she pull it off in the episode ? Serenity's engine is totally dead, to the extent where not even life support systems are online. Yet Mal still has to valiantly haul himself around on the floor to replace the compression coil, so whatever creates the artificial gravity on Serenity is clearly still going. How? I'm trying to perfectly overlap two images, one complementary of the other, but apperas a white stripe in the conjunction of the path, all points are perfectly aligned how can I fix? Continuous versus differentiable A function is "differentiable" if it has a derivative. A function is "continuous" if it has no sudden jumps in it.  Until today, I thought these were merely two equivalent definitions of the same concept. But I've read some stuff today which seems to be claiming that this is not the case.  The obvious next question is "why?" Apparently somebody has already asked:    Several answers were given, but I don't understand any of them. In particular, Wikipedia and one of the replies above both claim that $|x|$ has no derivative. Can anyone explain this extremely unexpected result?  Edit: Apparently some people dislike the fact that this is non-obvious to me. To be clear: I am not saying that the result is untrue. (I'm sure many great mathematicians have analysed the question very carefuly and are quite sure of the answer.) I am saying that it is extremely perplexing. (As a general rule, mathematics has a habit of doing that. Which is one of the reasons why we demand proof of everything.)  In particular, can anyone explain precisely why the derivative of $|x|$ at zero is not simply zero? After all, the function is neither increasing nor decreasing, which ought to mean the derivative is zero. Alternatively, the expression  $$\frac{|x + a| - |x - a|}{a}$$  becomes closer and closer to zero as $a$ becomes closer to zero when $x=0$. (In fact, it is exactly zero for all $a$!) Is that not how derivatives work?  Several answers have suggested that the derivative is not defined here "because there would be a jump in the derivative at that point". This seems to assert that a continuous function must never have a discontinuous derivative; I'm not convinced that this is the case. Can anyone confirm or refuse this argument? DateTime "null" value I've been searching a lot but couldn't find a solution. How do you deal with a DateTime that should be able to contain an uninitialized value (equivalent to null)? I have a class which might have a DateTime property value set or not. I was thinking of initializing the property holder to DateTime.MinValue, which then could easily be checked. I guess this is a quite common question, how do you do that? Working with large numbers in PHP To use  as you would require when using the  with large numbers (100,000+), it calls for some very large calculations.  When I multiply two large numbers (eg: 62574 and 62574) PHP seems to cast the result to a float. Getting the modulus value of that returns strange values.  $x = 62574 * 62574; var_dump($x);          // float(3915505476) ... correct var_dump($x % 104659); // int(-72945)  ... wtf.   Is there any way to make PHP perform these calculations properly? Alternatively, is there another method for finding modulus values that would work for large numbers? Killing form on $\mathfrak{sp}(2n)$ I have the same question as  from a long time ago. Is there an easy way to see that the Killing form on $\mathfrak{sp}(2n)$ is $\kappa(x,y) = (4n+2) \mathrm{tr}(xy)$?  For example, the Killing form for $\mathfrak{sl}(n)$ can be found from the easier to calculate case of $\mathfrak{gl}(n)$ using the decomposition $$\mathfrak{gl}(n) = \mathfrak{sl}(n) \oplus \mathbb{C}.$$ I don't know a similar argument for $\mathfrak{sp}(2n)$ though. How to get rid of update notifications for a given app in Google Play Store? General question I have an app X installed on my device in version Y. I don't want to update it to any newer version (Y+z) for some reason. Still, the Google Play Store app always lists updates for X, which keeps me from a simple &quot;update all&quot;. My question, put to a single sentence:  How to hide updates for X permanently from the &quot;available updates&quot; list?   Specific examples First, I know there are alternatives as e.g. the , which can handle this quite well (skip this update, skip all future updates). I prefer a &quot;generic solution&quot;, which does not depend on a 3rd party's market app. Second, I know that  includes a &quot;Market doctor&quot;, which can be used to disconnect an app from Google Play.1 However, in my specific case that only worked for a few hours: I disconnected GTalk, as I don't want it replaced by Hangouts. The update notification disappeared for a few hours, then it was back. No idea what restored the &quot;link&quot;. Third, just to make sure: I'm not talking about the &quot;auto update&quot; feature as discussed e.g. in . I was rather hoping for something close to , but without the need to &quot;freeze&quot; the app in question (which I still want to use, but in the version installed, not in a &quot;future version&quot; available). Fourth: No, uninstalling the app in question is no option here, though it would perfectly hide any future updates from being displayed :) Nor is &quot;freezing&quot;, as the app is used regularly. Fifth: There is a related question for my GTalk example:  However, I want the opposite: No update.  It might very well be that &quot;Google Apps&quot; (and other pre-installed apps) are handled in some specific way, and restore their &quot;market links&quot; themselves somehow. For this case, my question includes: How to prevent that from happening?  Update There's a  discussing the very same issue. Until recently, a work-around for &quot;user installed apps&quot; was to uninstall them and then sideload the .apk – but even that stopped working. Well, re-signing the .apk with a different key might work for user-apps. But both would fail for pre-installed apps (can't sideload them to override; different signature would refuse that install completely). Moreover, there's an  on this by some &quot;joel.bou..&quot;. Not hard to guess, though blanked out: that would be Joël Bourquard. If it's really him, then that's really an issue (for those who don't know: Joël is the dev behind Titanium Backup). Let me quote from the issue:  For the record: in the Android Market days it was possible to &quot;Attach&quot; or &quot;Detach&quot; apps (on rooted devices) with a system tool such as Titanium Backup. But nowadays (with the Google Play Store app) this has become nearly impossible to do, because the complete app list seems to sync from Google's servers and the user has no control over that.  Which explains why detaching with apps like Titanium Backup is no longer permanent. And I'm afraid I've asked the impossible. But I thought the same in the past with other questions, and surprisingly got solutions here. So I do not yet give up hope on this one!  1: what that does is explained by eldarerathis  (thanks to  for digging that up!) Probability that a quadratic polynomial with random coefficients has real roots When I check for updates, I get a "Failed To Download Repository Information" error.   This is what comes up under details:   W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_natty_main_source_Sources  Hash Sum mismatch,  E: Some index files failed to download. They have been ignored, or old ones used instead. Is there any significant difference between Nikon and Canon?