การรับค่า Indentity จากข้อมูลล่าสุดที่เพิ่มขึ้น หลังจากที่ใช้คำสั่ง INSERT เราสามารถส่งค่าที่เป็นเลขล่าสุดออกมาจาก store procedure ได้หลายวิธีดังนี้
- SELECT @@IDENTITY หรือ
- SELECT IDENT_CURRENT(‘ชื่อตาราง’) หรือ
- SELECT SCOPE_IDENTITY()
การรับค่า Indentity จากข้อมูลล่าสุดที่เพิ่มขึ้น หลังจากที่ใช้คำสั่ง INSERT เราสามารถส่งค่าที่เป็นเลขล่าสุดออกมาจาก store procedure ได้หลายวิธีดังนี้
from Frantic
Serial ports provide an easy way to communicate between many types of hardware and your computer. They are relatively simple to use and are very common among peripherals and especially DIY projects. Many platforms such as Arduino have built in serial communication so they are really easy to set up and use. Many times you may want your project to communicate with your computer in order to have a cool interactive output, a neat sensor that passes data to your computer, or anything else you could possibly dream up. In this tutorial, I will walk you through how to interface to a serial port on the computer side of things, using Microsoft’s . net framework. The code examples in this tutorial are in C#, but can be easily transferred to Visual Basic, or Visual C++. This tutorial assumes that you have a very basic understanding of object oriented programing, and whatever language you choose to program in.
Since we are mainly going to be using the System.IO.Ports.SerialPort class, HERE is a link to the full documentation by MSDN if you want to check out the rest of the class.
ครั้งนี้ผมขอนำ How to ขั้นตอนการติตตั้ง LAMP ด้วย Tasksel บน Ubuntu Server แบบ Step by step แบบฉบับรวบลัด Quick Guide
Tasksel คืออะไร
Tasksel มีการจัดอินเตอร์เฟสที่เรียบง่ายสำหรับผู้ใช้ที่ต้องการกำหนดค่าระบบของพวกเขาเพื่อทำงานที่เฉพาะเจาะจง เพื่อลดกระบวนการในการติดตั้งองค์ประกอบต่างๆได้อย่างมีประสิทธิภาพ
บทความนี้เราจะมาติดตั้ง Web Server แบบง่ายๆ ด้วยคำที่คุ้นหู คือ LAMP (หลอดไฟๆๆๆๆๆ) เริ่มกันเลย
L ตัวแรกคือ Linux , A คือ Apache หรือ httpd, M คือ MySQL หรือ MariaDB สุดท้าย P คือ PHP ครับ
0. ทำการ Update Package list จาก Repository ก่อนแล้วกันครับ
[root@server ~]#yum update -y
1. ทำการติดตั้ง HTTP Server ด้วย httpd package และคำสั่งให้เปิด Service ดังนี้
[root@server ~]#yum install -y httpd[root@server ~]#systemctl start httpd[root@server ~]#systemctl enable httpd
ตรวจสอบ httpd services
[root@server ~]#systemctl status httpd● httpd.service — The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)Active: active (running) since Thu 2017–03–09 01:51:52 ICT; 1min 56s agoDocs: man:httpd(8)man:apachectl(8)Main PID: 2158 (httpd)Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”CGroup: /system.slice/httpd.service├─2158 /usr/sbin/httpd -DFOREGROUND├─2159 /usr/sbin/httpd -DFOREGROUND├─2160 /usr/sbin/httpd -DFOREGROUND├─2161 /usr/sbin/httpd -DFOREGROUND<br>├─2162 /usr/sbin/httpd -DFOREGROUND└─2163 /usr/sbin/httpd -DFOREGROUNDMar 09 01:51:52 server01.thaiops.com systemd[1]: Starting The Apache HTTP Serv….Mar 09 01:51:52 server01.thaiops.com systemd[1]: Started The Apache HTTP Server.Hint: Some lines were ellipsized, use -l to show in full.[root@thaiops01 ~]#[root@thaiops01 ~]# ss -tlnState Recv-Q Send-Q Local Address:Port Peer Address:PortLISTEN 0 128 *:22 *:*LISTEN 0 128 :::80 :::*[root@thaiops01 ~]#
ทดสอบการใช้งานโดยเปิด Web Browser แล้วพิมพ์ช่อง URL เป็น http://IP-Address-Server
ถึงแม้ว่าคอมพิวเตอร์จะพัฒนาไปไกล จนถึงระดับ 64 บิตแล้วก็ตาม สิ่งหนึ่งที่ยังเป็นที่นิยม ยังมีใช้อยู่ทั่วไปก็คือ พอร์ตอนุกรม โดยเฉพาะในโลก Embedded system แล้ว หากคุณต้องการที่จะรับส่งข้อมูลระหว่างอุปกรณ์ภายนอก และโปรแกรมภายในคอมพิวเตอร์แล้ว พอร์ตอนุกรม หรือ Serial Port ก็ยังเป็นที่นิยมอยู่ ด้วยความที่มันติดต่อกันในรูปแบบที่ไม่ซับซ้อน สามารถเข้าใจได้ง่าย ช่วยให้งานจบได้เร็ว จึงทำให้ทุกวันนี้ เรายังพบเห็นโปรแกรมที่รับส่งข้อมูลทางพอร์ตอนุกรมอยู่ ถึงแม้่ว่าคอมพิวเตอร์บางเครื่องจะไม่มีพอร์ตอนุกรมแล้วก็ตาม เราก็ยังสามารถที่จะใช้ตัวแปลง USB to Serial ทำงานได้เหมือนๆ กัน
ใช้งาน MySQL ผ่าน xampp บน Windows มาตลอด ก่อนหน้านี้ ก็ใ่ช้ phpmyadmin สำหรับสำรองฐานข้อมูล แต่ข้อมูลเริ่มใหญ่มากขึ้นจนรู้สึกว่าการสั่ง export / import เริ่มช้ามากขึ้นเรื่อยๆ
ตอนนี้ย้ายไปใช้งาน Linux เต็มตัว เลยต้องย้ายฐานข้อมูลไปด้วย แต่ว่าขนาดไฟล์ใหญ่มาก นึกขึ้นได้ว่าสมัยตอนหัดเรียนรู้เขียนเว็บโปรแกรมมิ่งแรกๆ เคยผ่านตาว่าการสำรองข้อมูลใน MySQL มันสามารถทำงานผ่าน command line ได้ เลยไปค้นๆ วิธี แล้วจดบันทึกไว้กันลืม เพราะตอนแรกงงๆ ทำแล้ว error ตลอด กว่าจะเข้าใจว่าต้องทำยังไง