I have an API in JSON.  I want to use JS to, parse it via its url, get one value from one of the objects in JSON, and save them into a string variable. My API  {"code": 1000, "data": {"page-name": [{"link": "rules", "order": 0, "title": "\u91d1\u5e01"}], "InfinitePage": [{"sort": 14, "category": "Infinite", "DownloadUrl": "http://hot.haima.me/infinite/201611/1618/com.ea.sims3deluxe.ipa", "IdnAme": "com.ea.simsdd"}]}}   Basically I want a variable in javascript to get the value of DownloadUrl  var link="http://hot.haima.me/infinite/201611/1618/com.ea.sims3deluxe.ipa"   How to achieve this?? Sorry, but I am extremely new to this Already tried     var scmAPI = "http://theurl.com/..."  $.getJSON(scmAPI, function(json) {     document.getElementById("testjson").innerHTML = "Prie: " + json.DownloadUrl; });    But I get undefined I don't want a http request, or whatever, I want to use an external api to get data!
I need to do an  request in JavaScript. What's the best way to do that?  I need to do this in a Mac OS X dashcode widget.
A few days ago I was recalling some facts about the $p$-adic numbers, for example the fact that the $p$-adic metric is an ultrametric implies very strongly that there is no order on $\mathbb{Q}_p$, as any number in the interior of an open ball is in fact its center.  I know that if you take the completion of the algebraic closure of the $p$-adic completion you get something which is isomorphic to $\mathbb{C}$ (this result was very surprising until I studied model theory, then it became obvious).  Furthermore, if the algebraic closure is of an extension of dimension $2$ then the field is orderable, or even real closed. Either way, it implies that the $p$-adic numbers don't have this property.  So I was thinking, is there a $p$-adic number whose square equals $2$? $3$? $2011$? For which prime numbers $p$? How far down the rabbit hole of algebraic numbers can you go inside the $p$-adic numbers? Are there general results connecting the choice (or rather properties) of $p$ to the "amount" of algebraic closure it gives? Multiplicative inverse in $\operatorname{GF}(2^8)$? I know how to do multiplication over ${\rm GF}(2^8)$:  uint8_t  gmul(uint8_t  a, uint8_t  b) {     uint8_t p=0;     uint8_t carry;     int i;     for(i=0;i&lt;8;i++)     {         if(b &amp; 1)             p ^=a;         carry = a &amp; 0x80;         a = a&lt;&lt;1;         if(carry)             a^=0x1b;         b = b&gt;&gt;1;     }     return p; }   So, I tried to create a ${\rm GF}(2^8)$ multiplication table using this code. I've given below the values in the 3rd row of the table, but I don't think they're correct:      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F 0 1 2   0  2  4  6  8  A  C  E  10 12 14 16 18 1A 1C 1E  3 . . E F   I don't know what went wrong. I built the table by multiplying the values in the first row with those in the first column.  E.g. in the third row, I multiplied 2 &times; 0, 2 &times; 1, &hellip;, 2 &times; E, 2 &times; F.  How can I create a multiplication table for arithmetic in ${\rm GF}(2^8)$?    Also, how can I find the multiplicative inverse of a number in ${\rm GF}(2^8)$?  For example, how can I determine that the inverse of 95 is 8A?  I tried to do this using the multiplication table above, but when I took 9th row and the 5th column in the multiplication table I got 2D, not 8A. How can I create light trails without a blurry subject? What is the best way to randomize the order of a generic list in C#? I've got a finite set of 75 numbers in a list I would like to assign a random order to, in order to draw them for a lottery type application. Auto update specifick plugin I've created a plugin and I want to auto-update this plugin.  I've been looking in the WordPress Codex and found this following piece of code:  add_filter( 'auto_update_plugin', '__return_true' );   I added this code into a new Must-have Plugin but it doesn't work. It does not auto-update all my plug-ins..  Anyone that have experience with auto updating? Let $p$ be prime and $(\frac{-3}p)=1$. Prove that $p$ is of the form $p=a^2+3b^2$ Let $p$ be prime and $(\frac{-3}p)=1$, where $(\frac{-3}p)$ is Legendre symbol. Prove that $p$ is of the form $p=a^2+3b^2$.   My progress:  $(\frac{-3}p)=1 \Rightarrow$ $(\frac{-3}p)=(\frac{-1}p)(\frac{3}p)=(-1)^{\frac{p-1}2}(-1)^{\lfloor\frac{p+1}6\rfloor}=1 \Rightarrow$ $\frac{p-1}2+\lfloor\frac{p+1}6\rfloor=2k$  I'm stuck here. This is probably not the way to prove that.  Also tried this way:  $(\frac{-3}p)=1$, thus $-3\equiv x^2\pmod{p} \Rightarrow$ $p|x^2+3 \Rightarrow$ $x^2+3=p\cdot k$ stuck here too.  Any help would be appreciated. How to add a Login / Logout link in Main navigation menu? How can I add a Login link to the "Main navigation" menu?  When a user clicks on the link, it should take them to the /user/login page. Once they login, the link should change to say "Logout" instead of "Login".  Is there any way to add such a link? How do I calculate someone's age based on a DateTime type birthday? Given a DateTime representing a person's birthday, how do I calculate their age in years? I've been battling the following two questions for more than a day today.  Write a regular expression (comprised of {a, b}) that contain at least two b and do not contain abb. Write a regular expression (comprised of {a, b}) that contain abba and do not contain baa.  For the first part I wrote a basic one to start off with that doesn't handle the must two-b: b* OR a* OR (a+ AND b)* OR a*  I ran a few &quot;truth tables&quot; inputs over it and it seems ok. But the moment I add the requirement, things go haywire. Mostly because when pushing in those &quot;b&quot;s, you can suddenly use the OR to break things up. Same thing on the second one.... Any help would be greatly appreciated! Norah Sort a Map by values I am relatively new to Java, and often find that I need to sort a Map&lt;Key, Value&gt; on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way? Do superheroes/villains like Quicksilver or Flash with super speed get tired due to running? How to center a listing? I'm trying to get some console output in my homework. I put it in a listings environment but I want it to be centered horizontally on the page.  The only thing I get centered is the caption ;-/  \begin{minipage}{1\textwidth} \begin{center} \begin{lstlisting}[caption={Ausgabe des C-Programms},label={ggt_c_ausgabe}] a  |  b  |  q  |  u  |  s  |  v  |  t   ---------------------------------------- 78 |  21 |   1 |     |   1 |   1 |  -1  21 |  15 |   3 |   1 |  -3 |  -1 |   4  15 |   6 |   1 |  -3 |   4 |   4 |  -5   6 |   3 |   2 |   4 | -11 |  -5 |  14   3 |     |   2 | -11 |  26 |  14 | -33  ---------------------------------------- \end{lstlisting} \end{center} \end{minipage} How to get multiple selected values of select box in php? How do I get an XBOX 360 controller working? I have a Microsoft XBOX 360 gamepad with the wireless adapter and I was wondering what I would have to install to use them with Ubuntu I do know that when using this on Windows I have to manually install the drivers for the wireless receiver (if that is relevant.) In which way does quantum mechanics disprove determinism? I've heard this pop up in a discussion with my physicist/engineer roommates, but didn't care to ask at the time.  Now I'm mighty curious about it.   doesn't really seem to say much on this issue.  From what I understand about the Uncertainty Principle, it says that there are certain properties of electrons and stuff that cannot be measured, and are therefore uncertain.  Then Wikipedia (under ) states that Sir Arthur Eddington says that the Uncertainty Principle isn't really so because we can't measure these properties, but because turns out nature is indeterministic.  At least that's what I took from those paragraphs.  Even without my biased wording, it sounds more like an assertion than evidence.  I've also read a few things about how other scientific conventions perceive the issue, like how a ball on the peak of a perfect mound might randomly roll down in any direction, and I'm still unconvinced.  My belief of determinism is generally that if you knew every single variable that existed as a factor at the very beginning and birth of the universe, you could correctly determine all properties of any individual particle at any point in time.  Could anyone provide some more background about this?  Especially regarding quantum mechanics? I've just recently started playing D&amp;D 4e through the Red Box, and I am confused about how to fill in the power cards.  So, take Nimbus of Holy Shielding for instance. I understand the Target and Hit components as well as the effect, but my question is about the Attack component. It reads:     Attack: Wisdom vs Will.   Does the mean whatever my Wisdom score is, without the modifier, is compared to the Will score of the enemy? Would I then not even have to roll a d20 to see if it works? I'm trying to write a script which creates a Nurbs path curve, bevels it, and then stores the location of each vertex/point in that curve. I've been writing it based on the code displayed in the info panel, but it doesn't show what the vertices are supposed to be called - so I can't refer to them in the script.  Update: After following Ratt's links, I modified  for Nurbs Path and am now stuck again, though it's still progress. Below is one version I tried out, but the error message says that Curve has no attribute path_points. Of course it doesn't, because I made that up because I don't know what the Nurbs Path equivalent for bezier_points is.  import bpy import random  def pathPointLoc(cu, typ, points):      for (n) in enumerate(points):         nurb = cu.path_points[n]         print(nurb.location)      return  cu = bpy.data.curves.new("MyCurve", "CURVE") ob = bpy.data.objects.new("MyCurveObject", cu) scn = bpy.context.scene scn.objects.link(ob) scn.objects.active = ob  cu.bevel_object = bpy.data.objects["BezierCircle"] cu.taper_object = bpy.data.objects["BezierCircle"]  pathPointLoc(cu, "NURBS", [(0,0,0,1), (0,0,1,random.randint(1,4)), (0,1,1,1), (1,4,1,1)] ) Money from my parents from abroad to my bank account in UK I am from Japan. I have moved to UK recently on a spouse visa.   I still have my Japanese bank account which I have been using even before I came to UK. I have saving in that account and also my parents transfer me some money per month in my bank account in Japan. I have an International Debit Card on this account.  I am withdrawing this Money in UK via ATM / Debit Card.  In this case, do I have to pay taxes in UK or declare this as income in some form. I need to create a request for a web page delivered to our web sites, but I need to be able to set the host header information too.  I have tried this using HttpWebRequest, but the Header information is read only (Or at least the Host part of it is).  I need to do this because we want to perform the initial request for a page before the user can.  We have 10 web server which are load balanced, so we need to request the file from each of the web servers.    I have tried the following:  HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://192.168.1.5/filename.htm"); request.Headers.Set("Host", "www.mywebsite.com"); WebResponse response = request.GetResponse();   Obviously this does not work, as I can't update the header, and I don't know if this is indeed the right way to do it. Given that   $x^x = y$; and  given some value for $y$   is there a way to expressly solve that equation for $x$?