Each group presents about XML
Homework:
To try and use XML parser
G1 Python
G2 Lua
G3 Java
G4 Ruby
G5 Javascript
G6 C#
G1-G3 create XML data about books (10 for each member)
G4-G6 create XML data about movies (10 for each member)
Each group presents about XML
Homework:
To try and use XML parser
G1 Python
G2 Lua
G3 Java
G4 Ruby
G5 Javascript
G6 C#
G1-G3 create XML data about books (10 for each member)
G4-G6 create XML data about movies (10 for each member)
How do we document code? A good solution is to create self-explanatory code; this somewhat eliminates the need to document the code. We still need some very basic documentation. Code comments are one form of documentation, that is often misused. This talk is about self-explanatory code, the documentation we need and code comment patterns and anti-patterns.
Jennifer Rondeau and Margaret Eker presentation from Write The Docs Prague, 2016:
Treating docs as code, an approach that more and more teams and companies are moving toward, involves more than putting the two together in a source repository. We discuss some of the details that often get lost in as dev and docs learn to work together in new ways. Because if all we do is put doc files next to code files in source control, or use parts of the same workflow for code and docs, we're still isolating docs as a separate sort of responsibility, free from the obligations of systematic review and testing without which code would never be accepted into production.
Thinking of Documentation as Code [YUIConf 2013]evangoer
As a software engineer, one of the best things you can do for your documentation is to take the principles of code construction that you already know and apply them to your writing. We'll demonstrate how thinking about documentation as code will help you avoid many of the classic high level mistakes people make when launching documentation projects. This is a companion piece to last year's talk, which focused on how to optimize English prose at the micro level.
Assignmet 2 selectedtopic Topic in Computer EngineerAey Unthika
Create simple IoT that connect to web service on cloud
วัดอุณหภูมิโดยใช้ dht11 ส่งค่าเวลาและอุณภูมิผ่าน Webservice ซึ่งจะมีฟังก์ชันส่งช่วงเวลาปัจจุบัน หรือช่วงหนึ่งถึงอีกช่วงหนึ่ง แล้วคืนค่าเป็นอุณหภูมิกับเวลาในช่วงเวลานั้นๆ
Assignmet1 selectedtopic Topic in Computer EngineerAey Unthika
Start by finding web services using SOAP and WSDL on the Internet/Cloud
Try to use the web services with each group programming language
Then create web services for your group XML data
try to deploy your web services on the cloud
How do we document code? A good solution is to create self-explanatory code; this somewhat eliminates the need to document the code. We still need some very basic documentation. Code comments are one form of documentation, that is often misused. This talk is about self-explanatory code, the documentation we need and code comment patterns and anti-patterns.
Jennifer Rondeau and Margaret Eker presentation from Write The Docs Prague, 2016:
Treating docs as code, an approach that more and more teams and companies are moving toward, involves more than putting the two together in a source repository. We discuss some of the details that often get lost in as dev and docs learn to work together in new ways. Because if all we do is put doc files next to code files in source control, or use parts of the same workflow for code and docs, we're still isolating docs as a separate sort of responsibility, free from the obligations of systematic review and testing without which code would never be accepted into production.
Thinking of Documentation as Code [YUIConf 2013]evangoer
As a software engineer, one of the best things you can do for your documentation is to take the principles of code construction that you already know and apply them to your writing. We'll demonstrate how thinking about documentation as code will help you avoid many of the classic high level mistakes people make when launching documentation projects. This is a companion piece to last year's talk, which focused on how to optimize English prose at the micro level.
Assignmet 2 selectedtopic Topic in Computer EngineerAey Unthika
Create simple IoT that connect to web service on cloud
วัดอุณหภูมิโดยใช้ dht11 ส่งค่าเวลาและอุณภูมิผ่าน Webservice ซึ่งจะมีฟังก์ชันส่งช่วงเวลาปัจจุบัน หรือช่วงหนึ่งถึงอีกช่วงหนึ่ง แล้วคืนค่าเป็นอุณหภูมิกับเวลาในช่วงเวลานั้นๆ
Assignmet1 selectedtopic Topic in Computer EngineerAey Unthika
Start by finding web services using SOAP and WSDL on the Internet/Cloud
Try to use the web services with each group programming language
Then create web services for your group XML data
try to deploy your web services on the cloud
Assignment 1 of Database (MySQL & Sqlite3) Aey Unthika
● Map your ER diagram to relations
● Create relations in sqlite
● Insert data ( >4GB? )
● Query ( > 30 sec?)
● Use the same data for your selected DBMS
21. Xpath
ตัวอย่างการใช้งานและผลลัพธ์
Path Expression Result
bookstore เลือกทุก node ที่ชื่อ "bookstore"
/bookstore เลือก root element bookstore
bookstore/book เลือก book elements ทั้งหมดที่เป็น children ของ bookstore
//book เลือก book elements ทั้งหมดโดยไม่สนว่า elements มาจากไหน
bookstore//boo
k
เลือก book elements ทั้งหมดที่เป็น descendant ของ element
bookstore
//@lang เลือก attributes ทั้งหมดที่ชื่อ lang
22. Xpath
Predicates
Predicates ใช้หา node ที่มีคุณสมบัติจาเพาะ หรือมีคุณสมบัติต่างๆกันโดย Predicates จะต้อง
เรียกใช้ภายใน [ ] เท่านั้น
Path Expression Result
/bookstore/book[1] เลือก element book ตัวแรกที่เป็น child ของ element bookstore
/bookstore/book[last()] เลือก element book ตัวสุดท้ายที่เป็น child ของ element bookstore
/bookstore/book[last()-1] เลือก element book ตัวก่อนสุดท้ายที่เป็น child ของ element
bookstore
/bookstore/book[position()<3] เลือก element book สองตัวแรกที่เป็น child ของ element bookstore
//title[@lang] เลือก element title ทุกตัวที่มี attribute ชื่อ lang
//title[@lang='en'] เลือก element title ทุกตัวที่มี attribute ชื่อ lang และ lang = en
/bookstore/book[price>35.00] เลือก element book ทุกตัวที่เป็น child ของ element bookstore และมี
ค่าของ element price มากกว่า 35
/bookstore/book[price>35.00]/title เลือก element title ทุกตัวที่เป็น child ของ element book ที่มีค่าของ
element price มากกว่า 35 และเป็น child ของ element bookstore
23. Xpath
XPath Operators
Operator Description Example
| Computes two node-sets //book | //cd
+ Addition 6 + 4
- Subtraction 6 - 4
* Multiplication 6 * 4
div Division 8 div 4
= Equal price=9.80
!= Not equal price!=9.80
< Less than price<9.80
<= Less than or equal to price<=9.80
> Greater than price>9.80
>= Greater than or equal to price>=9.80
or or price=9.80 or price=9.70
and and price>9.00 and price<9.90
mod Modulus (division remainder) 5 mod 2
24. Xqueries
• XQuery คือภาษาที่ใช้ในการ Query ข้อมูลจากเอกสาร XML คล้ายกับ SQL
• Xquery ใช้ Xpath ในการเข้าถึงส่วนต่าง ๆ ของ xml แล้วทาการแปลงข้อมูลออกเป็นรูปแบบ
หรือโครงสร้างอื่น
• ใช้ฟังชั่น doc() ในการเรียก ไฟล์ xml มาเช่น
• doc("MovieAll_SPN.xml")
• แล้วใช้ path ในการเข้าถึง element ต่างๆ
• doc("MovieAll_SPN.xml")/film/movie
25. Xqueries
FLWOR
• For - selects a sequence of nodes
• Let - binds a sequence to a variable
• Where - filters the nodes
• Order by - sorts the nodes
• Return - what to return (gets evaluated once for every node)
27. Xqueries
ในการเปรียบเทียบนั้นจะใช้เครื่องหมาย
=, !=, <, <=, >, >= หรือ eq, ne, lt, le, gt, ge โดยจะแตกต่างกันที่ eq, ne, lt, le, gt, ge
จะใช้งานได้เมื่อมีแค่ค่าเดียวที่เป็นจริง
ทดลองโค้ดเรียกชื่อหนังที่มี Tom Hanks แสดง
for $x in film/movie
where $x//name_actor="Tom Hanks"
return $x/name