The document discusses how to programmatically make URL requests in Java. It covers using the URL and URLConnection classes to (1) parse URLs, (2) retrieve URL contents by opening connections or streams, and (3) get header information. It also provides examples of how to fake GET and POST form submissions by encoding parameters and sending requests via URLConnection.
Async/await is a new language feature that will ship with Swift 5.5 this year. There’s no doubt it will have a significant impact on how we write asynchronous code.
In this talk, we’re going to look at some use cases for async/await, how we can call existing Swift APIs using this new feature, and why your decision to write your SDK in Objective-C might turn out to have been a very clever move.
We’ll also have a look at the refactoring support Apple is adding to Xcode and how it will help you migrate your existing code base.
Async/await is a new language feature that will ship with Swift 5.5 this year. There’s no doubt it will have a significant impact on how we write asynchronous code.
In this talk, we’re going to look at some use cases for async/await, how we can call existing Swift APIs using this new feature, and why your decision to write your SDK in Objective-C might turn out to have been a very clever move.
We’ll also have a look at the refactoring support Apple is adding to Xcode and how it will help you migrate your existing code base.
Jeff Scudder, Eric Bidelman
The number of APIs made available for Google products has exploded from a handful to a slew! Get
the big picture on what is possible with the APIs for everything from YouTube, to Spreadsheets, to
Search, to Translate. We'll go over a few tools to help you get started and the things these APIs share
in common. After this session picking up new Google APIs will be a snap.
Jeff Scudder, Eric Bidelman
The number of APIs made available for Google products has exploded from a handful to a slew! Get
the big picture on what is possible with the APIs for everything from YouTube, to Spreadsheets, to
Search, to Translate. We'll go over a few tools to help you get started and the things these APIs share
in common. After this session picking up new Google APIs will be a snap.
Chude01 nhom10_TỔNG QUAN VỀ ELEARNING_VERSION2Tuyen VI
NỘI DUNG TRÌNH BÀY:
Sự hình thành và phát triển của E-learning
Các khái niệm về E-learning
Các thuyết của hệ thống E-learning
Các kiểu trao đổi thông tin trong E-learning
Đánh giá ưu điểm và hạn chế của E-learning
Các hình thức của elarning trong giáo dục và đào tạo.
Các loại của elarning trong giáo dục và đào tạo.
Nguồn lực của elearning
So sánh giữa PPDH truyền thống và E-learning
Thành phần và cấu trúc của một hệ thống E-learning
Chuẩn trong E-learning
Mhst- 2013 14 Nghiên cứu triển khai hệ thống MOOC cho Việt Nam dựa trên...Vu Hung Nguyen
Theo thứ tự bắt thăm, đội Trường Đại học Duy Tân, Đà Nẵng là nhóm đầu tiên bảo vệ. Với lợi thế sân nhà, lại là đội đầu tiên trình bày và có đầy đủ sự góp mặt của các thành viên trong nhóm nên nhóm khá tự tin trong việc thuyết trình trước hội đồng giám khảo. Tuy nhiên do việc trình bày hơi thiếu tập trung nên việc demo sản phẩm chưa được nhiều. Bất ngờ ở chỗ giám khảo, không rõ bằng sự tinh ý và kinh nghiệm chấm giải hay kinh nghiệm phát triển phần mềm mà ngay tại phần bảo vệ của thí sinh, Giám khảo đã phát hiện trong bản Demo bị dính lỗi phần quản lý của giảng viên. Dẫu vậy, dự án đã nhận điểm cộng rất lớn vì theo nhận xét của các giám khảo: Đây là dự án duy nhất đã có Pull Request lên kho mã nguồn gốc chứng tỏ nhóm đã bắt kịp và đúng với phong cách phát triển phần mềm nguồn mở chuẩn mực.
Thông tin Nhóm 1: MHST13-14
Nghiên cứu triển khai một hệ thống MOOC cho Việt Nam dựa trên Course Builder
http://wiki.vfossa.vn/mhst:ideas:mhst2013:moocvn
ĐH Duy Tân ĐN
Trưởng nhóm: Hà Ngọc Chung
Mentor: Trương Anh Hoàng (ĐHCN-ĐHQGHN)
An introduction to software engineering, based on the first chapter of "A (Partial) Introduction to Software Engineering
Practices and Methods" By Laurie Williams
Python Code Camp (Professionals) is a whole day workshop that aims to enable professionals to learn Python Basics and Django.
Visit: http://devcon.ph/events/python-code-camp-professionals-2016
Automating Cloud Operations: Everything You Wanted to Know about cURL and RESTRevelation Technologies
All cloud service providers support seamless cloud automation and management through a REST API architecture allowing for single tasks or complex multi-step orchestrations to be created. REST has become the de facto standard for these cloud interfaces because of its ease of us, communication over HTTP, and wide support of nearly all programming languages and operating systems.
Where do you start? How do you decipher the API documentation? Where do you authenticate? And how do you create cloud resources programmatically?
This presentation walks through the fundamentals of REST, how its invoked through cURL, as well as a live demonstration of the automated provisioning of Oracle Cloud services through cURL/REST.
Introduction to the SharePoint Client Object Model and REST APIRob Windsor
As Microsoft was releasing SharePoint 2013 it was pretty clear that they were steering people away from using the product as a portal to using it as a gateway to external systems and services. Since the Server Object Model cannot be used remotely, developers building these external systems will need to become familiar with the Client Object Model (CSOM) and/or the REST API if they want to communicate with SharePoint. This session will introduce these two APIs, give a brief overview of their history, and then show you how to get started using them through a series of demonstrations.
1. URL Programming
Introduction
How to write a program that fetches
URL content
How to write a program that submits
GET or POST requests to a web server
or a servlet
2. Start simply
No programming involved!
Connect to server (telnet)
Send request (type in an http request)
Get input
Using TCP Sockets
Connect to port 80
Send HTTP request (GET, POST, HEAD)
Read HTTP response
URL Programming In Java
A URL is a name for a web resource (page, applet)
http://www.cs.wmich.edu/index.html
Java URL programming allows Java programs to access
web resources by sending protocol requests and
receiving protocol responses.
Related Classes:
URL class
URLConnection class
HttpURLConnection class
URLEncoder class
3. URL Class
Represents a Uniform Resource Locator
scheme (protocol)
hostname
port
path
query string
Parsing a URL
You can use a URL object as a parser:
URL u = new URL(“http://www.cs.wmich.edu/index.html”);
System.out.println(“Proto:” + u.getProtocol());
System.out.println(“File:” + u.getFile());
4. Retrieving URL contents
There are a number of ways to do this:
Object getContent();
InputStream openStream();
URLConnection openConnection();
Getting Header Information
There are methods that return information
extracted from response headers:
String getContentType();
String getContentLength();
long getLastModified();
5. URLConnection Class
Represents the connection (not the URL
itself).
More control than URL
can write to the connection (send POST data).
can set request headers.
HttpURLConnection is a subclass of
URLConnection that is specific to HTTP
Example: Reading from a URL
// -- open connection
URL url = new URL(“http://www.google.com/index.html”);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.connect();
// -- read in html ----------------
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
String page = new String("");
while (null != ((line = in.readLine()))) {
page += line;
}
in.close();
System.out.println(page);
6. Points to note
An HttpURLConnection represents a
connection to a particular page on a
server, not just to the server.
An HttpURLConnection object is NOT
made by the usual use of new(). Instead it
is created by the use of the Url’s
openConnection() method
More points to note
the connect method (of
HttpURLConnection) not only opens the
connection but also makes the GET
request!
the code for reading in the HTML from the
connection is identical to that for reading in
a file.
7. Faking GET Form Submission
Not all webpages are produced in
response to a simple GET request
Some are the output of a program
which may require parameters
passed using the GET method (via the
URL), e.g.
http://www.cs.wmich.edu/servlet/convert?id=57&amount=10&units=pint
Faking POST Form Submission
The POST request sends parameters
(data) in the HTTP request body
Any data to be sent must be encoded as a
string of key-value pairs:
id=57&amount=10&units=pint
8. URLEncoder Class
Used to encode GET and POST parameters.
Example:
String content = "action=“ + URLEncoder.encode("100”);
content += "&zipcode=“ + URLEncoder.encode(“49008");
content += "&name=“ + URLEncoder.encode(“Bill Somebody");
content += "&passwd=“ + URLEncoder.encode(“cisco");
Making GET Form Submissions
Step 1: Encode GET parameters
String content = "action=“ + URLEncoder.encode("100”);
content += "&zipcode=“ + URLEncoder.encode(“49008");
content += "&name=“ + URLEncoder.encode(“Bill Somebody");
content += "&passwd=“ + URLEncoder.encode(“cisco");
Step 2: Make an HttpURLConnection object in the usual way:
URL url = new URL("http://www.cs.wmich.edu/servlet/converter“ + “?” + contents);
Step 3:
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
Step 4:
conn.connect();
Step 5: You can read the reply as explained before.
9. Making POST Form Submissions
Step 1: Encode POST parameters
String content = "action=“ + URLEncoder.encode("100”);
content += "&zipcode=“ + URLEncoder.encode(“49008");
content += "&name=“ + URLEncoder.encode(“Bill Somebody");
content += "&passwd=“ + URLEncoder.encode(“cisco");
Step 2: Make an HttpURLConnection object in the usual way:
URL url = new URL("http://www.cs.wmich.edu/servlet/converter“);
Step 3:
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
Making POST Form Submissions (Contd.)
Step 4: Tell it that you want to use the POST method
conn.setRequestMethod("POST");
conn.setDoOutput(true);
Step 5: Build a Printer writer to send things out via the connection
and send the data.
PrintWriter out = new PrintWriter(conn.getOutputStream());
out.println(content);
out.close();
Step 6: You can read the reply as explained before.