I am trying to parse json data from online database with a php file link and i dont know how to do it. Generally i know that parsing json data is something like this.  &lt;script&gt;        var data = '{"name": "mkyong","age": 30,"address": {"streetAddress": "88 8nd Street","city": "New York"},"phoneNumber": [{"type": "home","number": "111 111-1111"},{"type": "fax","number": "222 222-2222"}]}';      var json = JSON.parse(data);      alert(json["name"]); //mkyong     alert(json.name); //mkyong      alert(json.address.streetAddress); //88 8nd Street     alert(json["address"].city); //New York      alert(json.phoneNumber[0].number); //111 111-1111     alert(json.phoneNumber[1].type); //fax      alert(json.phoneNumber.number); //undefined &lt;/script&gt;      But what if i create a json file with php and it has the link  www.example.com/parse.php   and i want that link to connect it with another html file in another server like  www.example2.com/parsehere.html   which has the above code without putting the json data inline, but to load it from the link of php?? Is that possible?  All im trying to do is to make inside this script to load data from a url and NOT from raw json data like the above script.  &lt;script&gt;          //here something to load data from a link and parse it below.          var json = JSON.parse(data);          alert(json["name"]); //mkyong         alert(json.name); //mkyong          alert(json.address.streetAddress); //88 8nd Street         alert(json["address"].city); //New York          alert(json.phoneNumber[0].number); //111 111-1111         alert(json.phoneNumber[1].type); //fax          alert(json.phoneNumber.number); //undefined     &lt;/script&gt;
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.
Live USB data gets lost on Restart I am crawling some data using Apache Nutch and storing it on my USB Drive. The OS itself is Ubuntu Live Boot OS. But for every restart or shutdown I am losing my data. I also tried suspending my Ubuntu user still data was not visible when I reinserted my live USB.  Is there any way I can keep the data intact and does not loose and application settings installations when I do restart Ubuntu.  Used USB installer provided by pendrivelinux.com at What is your favorite method to handle errors in Bash?  The best example of handling errors I have found on the web was written by William Shotts, Jr at .   He suggests using the following function for error handling in Bash:  #!/bin/bash  # A slicker error handling routine  # I put a variable in my scripts named PROGNAME which # holds the name of the program being run.  You can get this # value from the first item on the command line ($0).  # Reference: This was copied from &lt;http://www.linuxcommand.org/wss0150.php&gt;  PROGNAME=$(basename $0)  function error_exit {  #   ---------------------------------------------------------------- #   Function for exit due to fatal program error #       Accepts 1 argument: #           string containing descriptive error message #   ----------------------------------------------------------------       echo "${PROGNAME}: ${1:-"Unknown Error"}" 1&gt;&amp;2     exit 1 }  # Example call of the error_exit function.  Note the inclusion # of the LINENO environment variable.  It contains the current # line number.  echo "Example of error with line number and message" error_exit "$LINENO: An error has occurred."   Do you have a better error handling routine that you use in Bash scripts? How do I find the caller of a method using stacktrace or reflection? Why does the max aperture change when use Nikon 60mm AF-D Micro on D90 camera? I have found that my Nikon 60mm Micro AF-D changes aperture from 2.8 to 3.2 when used with a D90. I have tried both A and M mode. Is it by design? Why?  I intend to buy  and it will lock the maximum aperture at 2.0 (my guess) instead 2.8. So should I buy it or not, or would it be better to buy the newer 50mm 1.4 AF-S version? How to solve 5x5 grid with 16 diagonals? Show that  $A \setminus ( B \setminus C ) \equiv ( A \setminus B) \cup ( A \cap C )$  This is an exercise I was trying to do ( not homework ) and I got stuck as follows:  Working from $A \setminus ( B \setminus C )$:  $x \in A \wedge x \notin ( B \setminus C )$ $x \in A \wedge ((x \in B \wedge x \in C) \vee (x \notin B \wedge x \in C) \vee (x \notin B \wedge x \notin C) )$  At this point I'm not sure how to proceed.  Working from the other side $ ( A \setminus B) \cup ( A \cap C ) $:  $ x \in ( A \setminus B) \cup ( A \cap C ) $  $ x \in ( A \setminus B) \vee x \in ( A \cap C ) $  $ ( x \in A \wedge x \notin B ) \vee ( x \in A \wedge x \notin C ) $  $ x \in A \wedge (x \notin B \vee x \notin C ) $  $ x \in A \wedge x \notin ( B \cap C ) $  $ A \setminus ( B \cap C ) $  I could also use some formating tips like how display logical not and how to get the lines to display properly without blank lines inbetween. :-) How do I get add-apt-repository to work through a proxy? I'm trying to follow the  (on my Ubuntu 10.04 VM).  The first step is:  sudo add-apt-repository ppa:linaro-maintainers/toolchain   But when I run that I get:  Error reading https://launchpad.net/api/1.0/~linaro-maintainers/+archive/toolchain: &lt;urlopen error [Errno 110] Connection timed out&gt;   I'm guessing the problem is with my configuration for my employer's proxy server, particularly for HTTPS.  When I opened  in Firefox, I got "The connection has timed out".  I then went into Firefox Preferences -> Advanced -> Network -> Settings... and set HTTP Proxy to "gateway" and Port to 8080, and checked "Use this proxy server for all protocols".  Then the page loaded.  This supports my theory.  I've tried setting the http_proxy and https_proxy environment variables (both lower and upper case):  $ set | grep -i proxy HTTPS_PROXY=https://gateway:8080 HTTP_PROXY=http://gateway:8080 http_proxy=http://gateway:8080 https_proxy=https://gateway:8080   I also tried changing them to:  $ set | grep -i proxy HTTPS_PROXY=gateway:8080 HTTP_PROXY=gateway:8080 http_proxy=gateway:8080 https_proxy=gateway:8080   And I tried adding this second line to /etc/apt/apt.conf:  Acquire::http::proxy "http://gateway:8080/"; Acquire::https::proxy "https://gateway:8080/";   But I continue to get the same error.  How do I troubleshoot this?  Update: I followed the instructions in the  to  and got further:  $ sudo add-apt-repository ppa:linaro-maintainers/toolchain Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com gpgkeys: HTTP fetch error 7: couldn't connect to host gpg: no valid OpenPGP data found. gpg: Total number processed: 0   I wonder if the "HTTP fetch error" means I also need to add "Defaults env_keep = http_proxy" to /etc/sudoers...  Update #2: I added:  Defaults env_keep="http_proxy" Defaults env_keep="https_proxy"   ...as in , but I still get the same "gpgkeys: HTTP fetch error 7: couldn't connect to host" error.  And this is curious:  $ sudo env | grep proxy https_proxy=https://gateway:8080   ...because http_proxy isn't there.  Any advice is appreciated.  Update #3: Since the host of my VM is a laptop, I took it home and tried there (with no proxies):  $ sudo add-apt-repository ppa:linaro-maintainers/toolchain Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com gpg: key 7BE1F97B: public key "Launchpad Linaro Overlay PPA" imported gpg: Total number processed: 1 gpg:               imported: 1  (RSA: 1)   It worked.  So problem is related to proxy configuration.  But I suppose I have a workaround. Extend a filesystem when adding HDD without using LVM? Are there any method to extend a filesystem when i adding more hdd to it without using LVM? What are those ? why does files (nautilus) open a new window although there's one already open? When I click on "files" in the launcher it opens another window although the normal action is to maximize the window already open. It doesn't always do that. Is it a bug? What Percentage Makes Someone a Half-blood? Using apostrophes correctly I've read a great article about the . But there are still some points that are unclear.  Why do we say...   school project but not school's project? car service but not car's service or even cars' service (plural form)? apostrophe usage but not apostrophe's usage or apostrophes' usage? When is "to" a preposition and when the infinitive marker? Unique quadratic subfield of $\mathbb{Q}(\zeta_p)$ is $\mathbb{Q}(\sqrt{p})$ if $p \equiv 1$ $(4)$, and $\mathbb{Q}(\sqrt{-p})$ if $p \equiv 3$ $(4)$ If $\sigma_n=\frac{s_1+s_2+\cdots+s_n}{n}$ then $\operatorname{{lim sup}}\sigma_n \leq \operatorname{lim sup} s_n$ This is a question from the book Methods of Real Analysis by R. R. Goldberg.     If $(s_n)$ is a sequence of real numbers and if $$\sigma_n=\frac{s_1+s_2+\cdots+s_n}{n}$$ then prove that: $\operatorname{{lim sup}}\sigma_n \leq \operatorname{lim sup} s_n$.   I don't have any idea how to start working on this problem. Please help. Thanks. Possible Duplicate:          I am trying to troubleshoot my webcam and make it work with skype.  One workaround that is often suggested is to LD_PRELOAD the v4l1compat.so file. But when trying that, I get an error message:  fdr@maggie:~$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so skype ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.   and I am rather sure the path is correct:  fdr@maggie:~$ ls /usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so  /usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so   and the kernel and skype have matching architecture:  fdr@maggie:~$ uname -a Linux maggie 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux fdr@maggie:~$ dpkg -s skype | grep Architecture Architecture: amd64   So my question is:  What is causing the "... from LD_PRELOAD cannot be preloaded: ignored" error message? Let $\alpha(t)$ be a regular curve. Suppose there is a point $a$ in $R^3$ such that $\alpha(t)-a$ is orthogonal to $T(t)$ for all t. Prove that $\alpha(t)$ lies on a sphere.  So, I let $\alpha(t)=(x(t), y(t),z(t))$ and $a=(a,b,c)$.  Since, $\alpha(t)-a$ is orthogonal to $T(t)$,  $&lt;\alpha(t)-a,T(t)&gt;=0$.  But I don't know how to solve this.. I've read through the elementary proof of why there exists a solution $x$ to $x^2\equiv -1\pmod p$ iff $p\equiv 1 \pmod 4$ for $p$ an odd prime. Is there a group theory generalization for this fact as well? Why the first moment is standardized before computing higher moments, but higher moments are not? I’ve recently purchased a new Mac Mini, and I’ve been importing my old pictures into the Photos app.  I want to have these photos backed up to iCloud, along with the photos currently on my iPad. I then want everything synced to my Mac Mini, but not to my iPad, which has limited storage capacity.  Is it possible to have the Mac Mini and iPad set up to backup to iCloud, but only download backed-up photos to the desktop? I am a little at a loss.  A couple years before my mother-in-law passed away she signed her house over to my wife and her sister via a quitclaim deed.    After she passed we sold the house for $80,000. The money was used to pay off the mortgage, some other funeral expenses, and sent $15,000 to other family members.  All the money was dispersed at the closing of the house.  My wife and her sister each ended up with about $20,000.  How do we go about claiming this income?  Since there was a quitclaim deed I guess we technically owned the house for a few years prior to its sale.  How does that affect our tax and what is the basis?  Is the basis the selling price(fair market value) or something else?  How much does each sister claim for gains?  Sorry it this is a jumble of questions I am just trying to get this straightened out before tax is due.