Programming
FIRST PROGRAMMABLE QUANTUM COMPUTER CREATED
Using a few ultracold ions, intense lasers and some electrodes, researchers have built the first programmable quantum computer. The new system, described in a paper to be published in Nature Physics, flexed its versatility by performing 160 randomly chosen processing routines.
Earlier versions of quantum computers have been largely restricted to a narrow window of specific tasks. [...]
Sending a HTTP request from Java code
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
public class HTTPRequest {
public static void main(String[] args) {
String requestUrl = “http://www.google.com.hk“;
try {
URL url = new URL(requestUrl.toString());
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
System.out.println(“—–RESPONSE START—–“);
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
}
in.close();
System.out.println(“—–RESPONSE END—–“);
} catch (IOException e) {
e.printStackTrace();
}
}
}
