ป้ายกำกับ

แสดงบทความที่มีป้ายกำกับ Web แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Web แสดงบทความทั้งหมด

วันพุธที่ 30 เมษายน พ.ศ. 2557

Ubuntu 14.04 LTS: ปัญหา Subversion Server ทำงานไม่เสถียร

วันก่อนผมได้เล่าให้เพื่อนๆฟังไปแล้ว เกี่ยวกับปัญหาการใช้งาน Subversion บน Eclipse ซึ่งเมื่อผมทำการ Checkout โปรเจ็คออกมา บางโปรเจ็คก็ไม่มีปัญหาอะไร แต่บางโปรเจ็คก็เกิดอาการดาวโหลดบางไฟล์ไม่ได้ โดยฟ้อง
RA layer request failed
GET ... Internal Server Error

เกี่ยวอะไรกับ MySQL?

ทีแรกนึกว่ามีบางไฟล์เสียหาย แต่เมื่อผมทดลองซ้ำๆหลายๆรอบ ดูเหมือนว่าอาการจะไม่แน่นอน ไม่ซ้ำไฟล์เดิม และบางครั้ง Error ก็เปลี่ยนไปเป็น server close connection ผมจึงคิดว่าปัญหามันน่าจะเกิดที่ Apache Web Server มากกว่า โดยเมื่อเข้าไปดู Log ไฟล์ ก็แทบจะไม่มีอะไรบอกเกี่ยวกับ svn เลย แต่กลับมีข้อความเกี่ยวกับ MySQL เช่น query ไม่ได้ database connection lost อะไรทำนองนั้น ทีแรกผมก็ไม่ได้เอะใจ เพราะคิดว่าไม่เกี่ยวข้องกับ Subversion สักหน่อย แต่ทำไมมันดูเหมือนจะเกี่ยวกัน เพราะฟ้อง warning ตรงตอน GET ไฟล์ แต่เอาเถอะโปรแกรมรุ่นใหม่อาจจะมีการเปลี่ยนไปใช้ฐานข้อมูล MySQL ร่วมด้วยก็ได้ ผมก็เลยพุ่งเป้าไปที่ MySQL

ทีแรกก็ลองปรับค่า max_allowed_packet จาก 16M เป็น 64M ค่า max_connection จาก 100 เป็น 200 ค่า query_cache_limit จาก 1M เป็น 16M ด้วยเหตุผลที่ว่า อาการคล้ายๆกับ MySQL ทำงานไม่ได้ อาจจะเพราะตอน Checkout ไฟล์จำนวนมากๆ เกิด connection จำนวนมาก (ถ้าเป็น 1 ไฟล์ต่อ 1 connection) ก็จะเกิดปัญหาประมาณนี้ ซึ่งก็ช่วยให้สามารถ Checkout ไฟล์ได้มากขึ้น แต่สุดท้ายก็ตายทุกครั้ง

ผมเข้าไปดูค่าใน /var/log/mysql/error.log แล้ว ก็ไม่พบความผิดปกติอะไรเลย ดูเหมือน MySQL จะทำงานได้เป็นปกติดีทุกประการ ผมก็คิดไม่ออกว่ามันเกิดอะไรขึ้น และคิดว่า มันต้องมีปัญหาที่คำสั่ง SQL เพราะ error ใน Apache Web Server ระบุว่า query ไม่ได้ บางครั้งมีคำว่า "SELECSELECT ..." เหมือนคำสั่งมันกลายเป็นขยะไป ทำให้ระบบรวนไปหมด ผมจึงต้องลงลึกเข้าไปในระดับทุกๆคำสั่งที่ส่งให้กับ MySQL เลยว่ามีปัญหาอะไร ผมจึงไปตั้งค่า general_log_file และ general_log (ปกติจะปิดไว้) เพื่อดูค่าการทำงานในแต่ละคำสั่งของ MySQL ซึ่งจะบันทึกไว้ที่ /var/log/mysql/mysql.log (ปกติจะไม่มีไฟล์นี้อยู่)

สุดท้ายผมก็เห็นคำสั่ง
SELECT xxx FROM profiles WHERE login_name=? AND disabledtext = ''
ก็ได้ถึงบางอ้อว่า จริงๆแล้ว คำสั่งนี้เป็นคำสั่งที่เกิดจาก Apache Module ที่มีชื่อว่า mod_auth_mysql เป็นโมดูลที่เกี่ยวกับ การ Authentication เข้าใช้งาน และ Authorization สำหรับยืนยันสิทธิ์ในการเข้าถึงไฟล์ต่างๆของ Subversion  ซึ่งผมเลือกใช้โมดูลนี้เพื่อตั้งค่าให้มีการใช้ account จากฐานข้อมูล MySQL ของ Bugzilla ดังนั้น ทุกๆครั้งที่มีการดาวโหลดไฟล์ จะมีการตรวจสอบสิทธิ์ทุกครั้ง และทำให้เกิดการ query ด้วยคำสั่งข้างบนซ้ำๆจำนวนมาก อาจจะทำให้เกิดอาการไม่เสถียร

Multi-Processing Module (MPM) Prefork vs. Worker

เมื่อรู้ว่าปัญหาเกิดจากโมดูล mod_auth_mysql ทำงานไม่เสถียรแล้ว ผมจึงคิดว่าน่าจะต้องปรับค่าที่เกี่ยวกับการจัดการประมวลผลโมดูล หรือที่เรียกว่า MPM ซึ่งเมื่อตรวจสอบ Apache Web Server ก็พบว่า มีการตั้งค่าแตกต่างไปจากรุ่นก่อน (Ubuntu 12.04) คือ การแยก MPM ออกเป็นโมดูล และเลือกตั้งค่าไว้เป็น mpm_event ในขณะที่ค่าเก่าที่ผมเคยตั้งไว้เป็น mpm_prefork ผมเองก็จำไม่ได้แล้วว่าทำไมถึงใช้ prefork แต่ไหนๆก็ไหนๆแล้ว ผมก็เลยทดลองปรับค่าดู ซึ่งค่าเดิมที่ตั้งไว้คือ default ตามข้างล่างนี้
<IfModule mpm_event_module>
    StartServers                    2
    MinSpareThreads          25
    MaxSpareThreads         75
    ThreadLimit                   64
    ThreadsPerChild            25
    MaxClients                   150
    MaxRequestsPerChild      0
</IfModule>
เมื่อทดลองปรับค่า เช่น MaxClient ลดให้น้อยลง MaxRequestsPerChild กำหนดให้เป็นค่า 1000 แทนที่จะเป็น 0 ซึ่งหมายถึงไม่จำกัด ค่า MaxSpareThreads ลดลง ค่า ThreadLimit ลดลง ThreadsPerChild ลดลง ผลปรากฏว่า เมื่อ Checkout การทำงานค่อนข้างดีขึ้น แต่สุดท้ายแล้วก็นิ่งไปนาน แล้วเกิด connection timeout ขี้น เมื่อดูใน Log ไฟล์ ไม่มีข้อมูลใดๆ เพราะ Apache Web Server ตายไปเรียบร้อยแล้ว ผมก็พยายามทดลองปรับค่าต่างๆแล้ว สุดท้ายสรุปว่าโมดูล mod_auth_mysql ไม่ใช่ thread safe โมดูล (ในขณะที่ข้อมูลจากบางเว็บไซต์ระบุว่าเป็น thread safe) ไม่สามารถใช้งานกับ mpm_worker หรือ mpm_event ได้

prefork เป็นการประมวลผลแบบไม่ใช้ thread โดย root process จะมีการแตก child process ออกมา และแต่ละ child process จะดูแล connection หลาย connection ต่อ process

worker เป็นการประมวลผลแบบใช้ thread โดย root process จะมีการแตก child process ออกมา และแต่ละ child process จะแตก thread ออกมาเพื่อดูแลแต่ละ connection

prefork เหมาะกับการทำงานที่รองรับโมดูลที่ไม่ได้ออกแบบมาให้เป็น thread safe และสำหรับประสิทธิภาพแล้ว ทั้ง prefork และ worker ทำงานได้พอๆกัน แต่ prefork จะใช้ทรัพยากรณ์ หน่วยความจำมากกว่า worker ส่วน event นั้นเป็น worker อีกรูปแบบหนึ่งที่จะจัดการ thread ได้ดีขึ้น

สรุปว่า mod_auth_mysql ไม่เป็น thread safe ต้องใช้กับ prefork เท่านั้น ซึ่งเมื่อผมทดลองปรับไปใช้ prefork ปัญหาทุกอย่างก็หมดไป นิ่งเสถียรดีมาก แต่ด้วยความคิดที่ว่า event มันดูดีกว่า prefork นะ ใช้ทรัพยากรณ์น้อยกว่า ผมจึงคิดว่า เราน่าจะหาทางใช้ event นะ

Apache DBD Module

ผมค้นไปค้นมาก็พบว่า Apache มีโมดูลที่ทำงานกับฐานข้อมูล SQL อยู่แล้ว ชื่อว่า mod_dbd ดังรายละเอียดในหน้า Apache DBD API ที่น่าสนใจคือ
  1. ไม่ยึดติดกับฐานข้อมูลใดๆ โดยจะต้องติดตั้ง driver สำหรับแต่ละฐานข้อมูลเพิ่ม เช่นฐานข้อมูลที่มี driver แล้วคือ MSSQL, SyBase, MySQL, Oracle, PostgreSQL, SQLite, และ ODBC
  2. ใช้กับ MPM ได้หลายแบบทั้งแบบ threaded หรือ non-threaded
  3. จัดการ connection pooling แบบไดนามิกส์เพื่อรองรับโปรแกรมใหญ่ๆได้
และนอกจากนี้ยังมีโมดูล mod_authn_dbd สำหรับการทำ Authentication และโมดูล mod_authz_dbd สำหรับการทำ Authorization ด้วย ทำให้ตอบโจทย์ที่ผมคิดไว้พอดี ผมจึงตัดสินใจทดสอบการใช้งานดู โดยติดตั้งโมดูลต่างๆ และแก้ไข config ไฟล์ ตามตัวอย่างใน document ของ mod_authn_dbd ดังนี้
# mod_dbd configuration
# UPDATED to include authentication cacheing
DBDriver pgsql
DBDParams "dbname=apacheauth user=apache password=xxxxxx"
DBDMin  4
DBDKeep 8
DBDMax  20
DBDExptime 300
<Directory /usr/www/myhost/private>
  # mod_authn_core and mod_auth_basic configuration
  # for mod_authn_dbd
  AuthType Basic
  AuthName "My Server"
  # To cache credentials, put socache ahead of dbd here
  AuthBasicProvider socache dbd
  # Also required for caching: tell the cache to cache dbd lookups!
  AuthnCacheProvideFor dbd
  AuthnCacheContext my-server
  # mod_authz_core configuration
  Require valid-user
  # mod_authn_dbd SQL query to authenticate a user
  AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s"
</Directory>
ในตัวอย่างนี้ จะมีการใช้ AuthBasicProvider โดยเน้นว่าให้ใช้ socache เพื่อทำ cache ให้กับ credential ด้วย ผมก็ได้ทำตามคือ ติดตั้ง socache เพิ่ม และที่สำคัญคือ AuthDBUserPWQuery ที่ต้องสั่ง query รหัสผ่านสำหรับผู้ใช้มาเพื่อตรวจสอบ โดยใส่ %s ไว้ตรงที่เป็นชื่อผู้ใช้ที่จะกรอกผ่าน browser มา ผลการรันปรากฏว่าเกิด Segmentation fault error ครับ Apache สตาร์ทไม่ขึ้น ผมจึงค่อยๆถอดบางคำสั่งที่ไม่จำเป็นออก และสุดท้ายพบว่าปัญหาอยู่ที่ AuthnCacheProvideFor และ AuthnCacheContext ครับ เมื่อตัดสองคำสั่งนี้ออก Apache ก็ทำงานได้ตามปกติ

Password Format

จากคำอธิบายของคำสั่ง AuthDBUserPWQuery ระบุว่า ผลของการ query จะนำเอาเฉพาะข้อความที่อยู่ใน row แรก column แรกเท่านั้นมาพิจารณาเป็นรหัสผ่านในรูปแบบรหัสที่เข้ารหัสแล้ว ซึ่งวิธีพิจารณามีสองแบบคือ แบบ Basic หรือ แบบ Digest ตามที่ได้ระบุ provider ไว้ (ผมขอไม่พูดถึงแบบ Digest นะครับ) เช่นในกรณีนี้ ผมใช้ AuthBasicProvider มีรายละเอียดรูปแบบของข้อมูลรหัสที่จะนำมาเปรียบเทียบตามที่ระบุไว้ชัดเจนในเอกสารคู่มือของ Apache เรื่อง Password Format โดยแบบ Basic มีอยู่ 5 รูปแบบคือ
  1. bcrypt: ข้อความ "$2y$" + ข้อความที่เข้ารหัสด้วยอัลกอริทึม crypt_blowfish
  2. MD5: ข้อความ "$apr1$" + ข้อความที่เข้ารหัสด้วยอัลกอริทึม MD5 ในแบบของ Apache เอง (ไม่เหมือนกับ MD5 อื่นๆ ผมเสียเวลาเข้าใจผิดทดสอบอยู่นานเหมือนกัน)
  3. SHA1: ข้อความ "{SHA}" + ข้อความที่เข้ารหัสด้วย Base64 ของอัลกอริทึม SHA-1 (ไม่ปลอดภัย)
  4. CRYPT: ข้อความที่เข้ารหัสด้วยฟังก์ชัน crypt บนระบบ Unix เท่านั้น (ไม่ปลอดภัย)
  5. PLAIN: ข้อความที่ไม่เข้ารหัส เฉพาะบนระบบ Windows และ Netware (ไม่ปลอดภัย)
อ๊ะๆ สังเกตเห็นอะไรไหมครับ รหัสผ่านที่เข้ารหัสแล้ว จะมีการใส่สัญลักษณ์พิเศษไว้เพื่อให้รู้ว่าเข้ารหัสด้วยวิธีไหน แต่ไม่ต้องกังวลนะครับ อัลกอริทึมที่เข้ารหัสพวกนี้ เป็นอัลกอริทึมที่ออกแบบมาให้ย้อนกลับได้ยาก ทางเดียวที่ง่ายกว่าคือ ต้องหารหัสมาเข้ารหัสด้วยวิธีเดียวกันแล้วได้ค่าที่ตรงกันจึงจะบอกได้ว่าเป็นรหัสที่ถูกต้อง ใครสนใจเรื่องรูปแบบของรหัสสามารถอ่านเพิ่มเติมจากลิ้งค์ที่ให้ไว้ได้นะครับ ในนั้นมีการแนะนำการใช้คำสั่ง htpasswd และคำสั่ง openssl เพื่อทดสอบดูว่า รหัสที่เข้าด้วยอัลกอริทึมแบบต่างๆแล้วได้รูปแบบเป็นอย่างไร

กลับมาเข้าเรื่องปัญหาของผมต่อนะครับ จากฐานข้อมูลผู้ใช้ใน MySQL ของ Bugzilla รหัสผ่านที่เข้ารหัสไว้แล้วนั้น มีรูปแบบไม่เหมือนกับที่ Apache ระบุไว้ ดังนั้น คำสั่งที่จะ query รหัสผ่านมานั้น จะต้องมีการจัดรูปแบบใหม่ให้ถูกต้อง โดยรูปแบบของ Bugzilla จะอยู่ในแบบ
รหัสที่เข้ารหัสแล้ว + "{" + ชื่อ Digest อัลกอริทึม + "}"
เช่น (ขอสมมติรหัสนะครับ)
123456789ABCDEFGHIjklmnopqrstuvwxyZ{MD5}
ถ้าหากผม query มาตรงๆ ก็จะทำให้ mod_authn_dbd ตรวจสอบรหัสผ่านไม่ถูก เพราะถ้าเป็น MD5 จะต้องมีรหัสเป็นประมาณ
$apr1$123456789ABCDEFGHIjklmnopqrstuvwxyZ
ซึ่งก็ไม่ใช่เรื่องยากสักเท่าไรนักที่จะใช้คำสั่ง substring ของ SQL ตัดและต่อคำเข้าไป แต่ปัญหาใหญ่ของผมตอนนี้คือ รหัส MD5 แบบทั่วไปที่ใช้อยู่ใน Bugzilla ซึ่งเขียนด้วยภาษา perl โดยใช้ Digest::MD5 นั้นไม่เหมือนกับ Apache MD5 หรือที่เรียกว่า APR1 ทำให้ผมต้องไปควานหาว่า perl มีอัลกอริทึมเข้ารหัสแบบไหนให้ใช้บ้าง ซึ่งถ้าเป็นไปตาม man page ของ Digest ก็คือมีดังนี้ (เรียงตามลำดับความเร็ว)
Algorithm   Size  Implementation               MB/s
MD4         128   Digest::MD4 v1.3            165.0
MD5         128   Digest::MD5 v2.33            98.8
SHA-256     256   Digest::SHA2 v1.1.0          66.7
SHA-1       160   Digest::SHA v4.3.1           58.9
SHA-1       160   Digest::SHA1 v2.10           48.8
SHA-256     256   Digest::SHA v4.3.1           41.3
Haval-256   256   Digest::Haval256 v1.0.4      39.8
SHA-384     384   Digest::SHA2 v1.1.0          19.6
SHA-512     512   Digest::SHA2 v1.1.0          19.3
SHA-384     384   Digest::SHA v4.3.1           19.2
SHA-512     512   Digest::SHA v4.3.1           19.2
Whirlpool   512   Digest::Whirlpool v1.0.2     13.0
MD2         128   Digest::MD2 v2.03             9.5
Adler-32     32   Digest::Adler32 v0.03         1.3
CRC-16       16   Digest::CRC v0.05             1.1
CRC-32       32   Digest::CRC v0.05             1.1
MD5         128   Digest::Perl::MD5 v1.5        1.0
CRC-CCITT    16   Digest::CRC v0.05             0.8
ผมควานหา package อื่นๆที่เกี่ยวข้องหมดแล้วพบคำสั่งเข้ารหัส Apache MD5 อยู่ใน libcrypt-passwdmd5-perl แต่นั่นเป็น Crypt::PasswdMD5 ไม่ใช่ Digest ซึี่งหากจะใช้คำสั่งนี้ ผมจะต้องเข้าไปแก้ Bugzilla ซึ่งเป็นวิธีที่ไม่น่าทำสักเท่าไรนัก (แต่จริงๆแล้วก็อยากจะลองดูเหมือนกันนะ ☺) จึงต้องตัดสินใจลดระดับความปลอดภัยลงมาเป็น SHA-1

สรุป

ความจริงแล้วปัญหายังไม่ได้จบแค่นี้นะครับ แต่เนื่องจากผมไม่แน่ใจว่า การเปิดเผยอะไรมากไปกว่านี้ จะทำให้ Server ของผมโดนของหรือเปล่า ผมยิ่งไม่ค่อยมีเวลาคอยตรวจดูซะด้วยสิ จึงขอจบเรื่องนี้ไว้แค่นี้ หากใครอยากทราบประสบการณ์เชิงลึก ก็มาคุยกันได้นะครับ ยินดีเล่าให้ฟัง(ถ้าสัญญาว่าจะไม่มาแฮ็คเครื่องผม ☺) เอ้า สรุปว่า ปัญหาต่างๆก็แก้ไปได้ด้วยดี มีความปลอดภัยพอสมควร และเสถียรแล้วสำหรับ Subversion server

วันอังคารที่ 8 ตุลาคม พ.ศ. 2556

Professional jQuery

Title:Professional JQuery
Authors:Cesar Otero & Rob Larsen
Formats:PDF
Ids:GoogleDouban Books,9781118026687
Tags:JavaScript, jQuery, Programming Language, Web
Publishers:John Wiley & Sons
Author Sort:Otero, Cesar & Larsen, Rob
Title Sort:Professional JQuery
Date:08 ต.ค. 2013
uuid:0d8f471b-3b3a-428d-bec3-fe77f0382add
id:5953
Published:พ.ค. 2012
Modified:08 ต.ค. 2013
Size:22.69MB
Languages:English
Type:book

Over the past several years JavaScript has undergone a remarkable transformation. It is now one of the most important programming languages in the world. With the ongoing importance of Ajax-based development and the rise of full-featured JavaScript libraries, most of the stigma around JavaScript has vanished. The most beginner-friendly library, jQuery, is responsible for most of this turnaround. jQuery is used at some of the largest organizations in the world, including Amazon, IBM, Twitter, NBC, Best Buy, and Dell. In 2011 there were three major releases in jQuery and the community surrounding it continues to grow. jQuery is prominently featured at the front end of Java/Spring, PHP, .NET, Ruby on Rails, and Python/Django stacks all over the Web. If you have experience with HTML, CSS, and JavaScript, this book is for you. It will expand your jQuery knowledge by focusing on the core library with the benefit of strong core JavaScript expertise in many of the lessons.This book is aimed at three groups of readers: Experienced server-side web application developers looking to move into the client-side using the world's most popular front-end libraryExperienced JavaScript programmers looking to ramp up quickly on jQueryNovice to intermediate jQuery developers looking to expand their jQuery knowledge into more advanced topicsThis book is not aimed at beginners. For those looking to start with the basics of HTML, CSS, and JavaScript/jQuery development, " Beginning JavaScript and CSS Development with jQuery (Wrox Programmer to Programmer)" by Richard York will most likely help you more.This book covers a lot of information about jQuery including a developer-level introduction as well as providing an in-depth look into some of the more advanced features. The book is divided into two parts, jQuery Fundamentals and Applied jQuery. jQuery Fundamentals introduces the core concepts while Applied jQuery focuses on more advanced subjects. The first part of the book offers an in-depth introduction to jQuery fundamentals, which includes selecting elements, manipulating the DOM, and binding and reacting to browser books. After providing a solid foundation, the book will then outline more advanced topics such as plugin development, unit testing with JavaScript, and other advanced features of the library. The book also focuses on features available as of jQuery 1.7.1. but also tries to incorporate feature support in older versions of the library wherever it is relevant.The first few chapters will help you set up a development environment and they also review important JavaScript concepts. Chapters 3-7 examine the jQuery core concepts. The second half of the book focuses on applying jQuery in the real world as well as detailing jQuery UI, plugin development, and templates among other lessons.Part 1, jQuery Fundamentals, contains chapters 1-7. Chapter 1 sets up an environment for developing and debugging jQuery and JavaScript code. It also defines the code standards that will be used throughout the book. Chapter 2 goes through the basics of JavaScript programming language to strengthen the foundation that the rest of the book is built upon. Chapter 3 introduces the basic functions that make up the library and illuminates usages of the core jQuery functions. It also introduces many of the functions that you will need to perform varieties of tasks. Chapter 4 goes in-depth into one of the core features of jQuery, which is the ability to select and manipulate HTML elements. Chapter 5 introduces another feature of jQuery: the cross-browser ability to bind and manage browser events. Chapter 6 explores one of the biggest revolutions in web development in recent years--Ajax. Chapter 7 focuses on some of the shortcuts jQuery offers for animating components in your web applications. These include moving, fading, toggling, and resizing elements.Part 2, Applied jQuery, contains chapters 8-14. Chapter 8 introduces jQuery UI, which is an associated user interface library for jQuery and contains things such as widgets, effects, animations, and interactions. Chapter 9 explores additional jQuery UI features including moving, sorting, resizing, and selection elements with a mouse. Chapter 10 teaches a variety of techniques, best practices, and patterns that you can apply to your code to immediately make it more efficient, maintainable, and clear. Chapter 11 focuses on the jQuery Template plugin. Templates are a standard way of marrying data and markup snippets. Chapter 12 focuses on authoring jQuery plugins. It is important to know how to extend the power of jQuery with custom methods as it is a fundamental skill for a top jQuery developer. Chapter 13 introduces the jQuery Deferred Object, which was introduced in version 1.5. It is a chainable utility object that provides control over the way callback functions are handled. Chapter 14 introduces the general concept of unit testing and goes into detail with the specific unit testing framework created by and used by the jQuery project itself, QUnit.In order to use this book effectively, you will need one of the following web browsers to run the samples provided within the book: Firefox 3.6, Current -1 VersionInternet Explorer 6+Safari 5.0xOpera current - 1 VersionChrome Current - 1 VersionCesar Otero is a freelance web developer. His technical interests include Python, Django, JavaScript, and jQuery. He sometimes contributes articles to IBM's developer works. He holds a degree in electrical engineering.Rob Larsen has many years' experience as a front-end engineer and team leader. He has built websites and applications for some of the world's biggest brands. He is currently a Senior Specialist, Platform at Sapient Global markets. Rob is an active writer and speaker on web technology with a special focus on emerging standards like HTML5, CSS3, and JavaScript.

jQuery Ui 1.8

Title:jQuery Ui 1.8
Authors:Wellman, Dan
Formats:PDF
Ids:GoogleDouban Books,9781849516525
Tags:JavaScript, jQuery, Programming Language, UI, Web Programming
Publishers:Packt Publishing, Limited
Author Sort:Dan, Wellman,
Title Sort:jQuery Ui 1.8
Date:08 ต.ค. 2013
uuid:4ba7f0a4-6a55-4ba5-82aa-80865000c5d1
id:5952
Published:ส.ค. 2011
Modified:08 ต.ค. 2013
Size:7.11MB
Languages:English
Type:book

jQuery UI, the official suite of plugins for the jQuery JavaScript library, gives you a solid platform on which to build rich and engaging interfaces with maximum compatibility, stability, and a minimum of time and effort.jQuery UI has a series of ready-made user interface widgets and a comprehensive set of core interaction helpers to reduce the amount of code that you need to write to take a project from conception to completion.jQuery UI 1.8: The User Interface Library for jQuery has been specially revised for version 1.8 of jQuery UI. It is written to maximize your experience with the library by breaking down each component and walking you through examples that progressively build upon your knowledge, taking you from beginner to advanced usage in a series of easy-to-follow steps.Throughout the book, you'll learn how each component can be initialized in a basic default implementation and then customize and configure each component to tailor it to your application. You'll look at the configuration options and the methods exposed by each component's API to see how these can be used to bring out the best of the library. Each chapter will also show you the custom events fired by the component covered and how these events can be intercepted and acted upon.What you will learn from this book :How the CSS framework consistently themes the widgets and how these styles can be used in your own codeCreate a custom jQuery UI widget using the widget libraryThe underlying mark-up required by different components, and how each widget or interaction helper is initializedConfigure the different components, and the different options that each component usesWork with each widget programmatically using its methods and event hooksPractical examples of how each component can be usedAdd flair to your interface with animation effectsApproachAn example-based approach leads you step-by-step through the implementation and customization of each library component and its associated resources. Reference tables of each configuration option, method, and event for each component are provided, alongside detailed explanations of how each widget is used.Who this book is written forThis book is for front-end designers and developers who need to quickly learn how to use jQuery UI. To get the most out of this book you should have a good working knowledge of HTML, CSS, and JavaScript, and should ideally be comfortable using jQuery.

jQuery Pocket Reference

Title:jQuery Pocket Reference
Authors:David Flanagan
Formats:PDF
Ids:GoogleDouban Books,9781449397227
Tags:HTML, JavaScript, jQuery, Programming Languages, Reference, Web, Web Programming
Publishers:O'Reilly
Author Sort:Flanagan, David
Title Sort:jQuery Pocket Reference
Date:08 ต.ค. 2013
uuid:e6a094f5-2e20-412d-a9cb-0d176e71c239
id:5949
Published:ธ.ค. 2010
Modified:08 ต.ค. 2013
Size:0.71MB
Languages:English
Type:book

"As someone who uses jQuery on a regular basis, it was surprising to discover how much of the library I’m not using. This book is indispensable for anyone who is serious about using jQuery for non-trivial applications." -- Raffaele Cecco, longtime developer of video games, including Cybernoid, Exolon, and Stormlord
jQuery is the "write less, do more" JavaScript library. Its powerful features and ease of use have made it the most popular client-side JavaScript framework for the Web. This book is jQuery's trusty companion: the definitive "read less, learn more" guide to the library.
jQuery Pocket Reference explains everything you need to know about jQuery, completely and comprehensively. You'll learn how to:
* Select and manipulate document elements
* Alter document structure
* Handle and trigger events
* Create visual effects and animations
* Script HTTP with Ajax utilities
* Use jQuery's selectors and selection methods, utilities, plugins and more
The 25-page quick reference summarizes the library, listing all jQuery methods and functions, with signatures and descriptions.

jQuery in Action

Title:jQuery in Action
Authors:Bear Bibeault & Yehuda Katz
Formats:PDF
Ids:GoogleDouban Books,9781933988351
Tags:HTML, JavaScript, jQuery, Programming Languages, Web
Publishers:Manning Publications
Rating:★★★★
Author Sort:Bibeault, Bear & Katz, Yehuda
Title Sort:jQuery in Action
Date:08 ต.ค. 2013
uuid:aa51abf2-05cd-40d9-bafa-b0efa2693463
id:5948
Published:ก.พ. 2008
Modified:08 ต.ค. 2013
Size:23.17MB
Languages:English
Type:book

A good web development framework anticipates what you need to do and makes those tasks easier and more efficient; jQuery practically reads your mind. Developers of every stripe-hobbyists and professionals alike-fall in love with jQuery the minute they've reduced 20 lines of clunky JavaScript into three lines of elegant, readable code. This new, concise JavaScript library radically simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. "jQuery in Action," like jQuery itself, is a concise tool designed to make you a more efficient and effective web developer. In a short 300 pages, this book introduces you to the jQuery programming model and guides you through the major features and techniques you'll need to be productive immediately. The book anchors each new concept in the tasks you'll tackle in day-to-day web development and offers unique lab pages where you immediately put your jQuery knowledge to work. There are dozens of JavaScript libraries available now, with major companies like Google, Yahoo and AOL open-sourcing their in-house tools. This book shows you how jQuery stacks up against other libraries and helps you navigate interaction with other tools and frameworks. "jQuery in Action" offers a rich investigation of the up-and-coming jQuery library for client-side JavaScript. This book covers all major features and capabilities in a manner focused on getting the reader up and running with jQuery from the very first sections. Web Developers reading this book will gain a deep understanding of how to use jQuery to simplify their pages and lives, as well as learn the philosophy behind writingjQuery-enhanced pages.

WebKit คืออะไร

WebKit คำนี้ หลายคนที่เคยเขียนเว็ป น่าจะเคยผ่านตากันมาบ้างแล้ว เพราะมันเป็นส่วนหนึ่งที่สำคัญมากๆของเว็ปบราวเซอร์หลายๆตัว เช่น Safari และ Chrome รวมทั้งยังมีการนำไปใช้ในโปรแกรมอื่นๆอีกมากมาย สงสัยไหมล่ะครับว่ามันคืออะไร

WebKit คือ

WebKit (webkit.org) เป็นโครงการ open source ที่สร้าง render engine สำหรับ web browser หรืออาจจะเรียกได้ว่ามันคือ render engine ของผลิตภัณฑ์หลายๆตัวใน Mac OS X System Framework  เช่น Safari Dashboard Mail และอื่นๆอีกมากมาย ซึ่งต้องขอย้ำว่า WebKit ไม่ใช่ browser แต่เป็น render engine สำหรับ browser โดยมีการนำ WebKit ไปสร้าง browser มากมาย ดังรายชื่อที่มีคนรวบรวมไว้ที่ Wiki ไม่ต่ำกว่า 30 ตัว

ความสามารถของ WebKit

  1. CSS (CSS1/CSS2.1/CSS3)
  2. DOM (HTML DOM, XML DOM)
  3. HTML/XHTML
  4. HTML Editing
  5. HTML Forms
  6. JavaScript (ECMAScript)
  7. MathML
  8. Plug-ins
  9. Printing
  10. SVG (SVG 1.1)
  11. Accessibility
  12. XML
  13. XSLT

Port

หลักๆแล้ว WebKit สร้างขึ้นสำหรับระบบปฏิบัติการ Mac OS X ซึ่งแกนหลักเป็น Linux ดังนั้นเวลาจะ build โปรแกรมให้ใช้งานบน Windows ได้ จะต้องมีโปรแกรมจำลองสภาพแวดล้อมให้เป็น Linux และที่เขาแนะนำไว้ก็คือโปรแกรม cygwin ส่วนระบบอื่นๆก็ยังมีอีก เช่น Qt GTK+ EFL และอื่นๆอีกมากมายเป็นต้น ซึ่งล้วนเป็น Linux เพียงแต่เปลี่ยน UI เท่านั้น โดยก่อนหน้านี้ WebKit เขียนด้วย Objective-C และกำลังเปลี่ยนผ่านมาสู่ WebCore ซึ่งเป็น C++ ทำให้สามารถ port ไปยังระบบอื่นๆได้ง่ายขึ้น

สรุป

ใครสนใจสร้างโปรแกรมที่ต้องการความสามารถบางส่วนเป็น browser ก็ลองศึกษาเพิ่มเติมดูตามลิ้งค์ที่ให้ไว้ได้เลยนะครับ

วันพุธที่ 25 กันยายน พ.ศ. 2556

HTML5

Title:HTML5
Authors:McDaniel, Adam
Formats:PDF
Ids:GoogleDouban Books,9780470952221
Tags:Design, HTML5, Programming Languages, Web, Web Development, Web Page Design
Publishers:John Wiley & Sons
Author Sort:Adam, McDaniel,
Title Sort:HTML5
Date:25 ก.ย. 2013
uuid:07938b73-9a18-4be2-b214-1b02af8d8382
id:6099
Published:พ.ย. 2011
Modified:25 ก.ย. 2013
Size:19.24MB
Languages:English
Type:book

Use the latest version of HTML to create dynamic Web pages HTML5 is the latest iteration of the standard markup language for creating Web pages. It boasts extensive updates from its predecessor and allows you to incorporate rich media content into a site without any dependence on extra software such as Flash. Packed with hundreds of screen shots, this visual guide introduces you to the many new features and abilities of HTML5 and shows you the many exciting new possibilities that exist for designing dynamic Web pages. Offers visual learners a solid reference on HTML5, the latest version of the standard markup language for designing Web pages Demonstrates how to use HTML5 to create Web pages that feature the latest in rich media content Provides easy-to-understand examples that cover a variety of topics to get you up and running with HTML5 Features a companion Web site that contains all the code needed to learn HTML5 HTML5: Your visual blueprint for designing effective Web pages opens your eyes to the world of possibilities that exist with the new version of the popular markup language. Adam R. McDaniel is a Web developer, technical architect, and security analyst, who has contributed to the Linux Kernel.

HTML5 24-Hour Trainer

Title:HTML5 24-Hour Trainer
Authors:Joseph W. Lowery & Mark Fletcher
Formats:PDF
Ids:GoogleDouban Books,9780470647820
Tags:HTML5, Programming Languages, Web Page Design, Web Programming, Web Publishing
Publishers:John Wiley & Sons
Author Sort:Lowery, Joseph W. & Fletcher, Mark
Title Sort:HTML5 24-Hour Trainer
Date:25 ก.ย. 2013
uuid:42e58584-5562-491a-b504-aa77784d72cf
id:6098
Published:ธ.ค. 2010
Modified:25 ก.ย. 2013
Size:15.02MB
Languages:English
Type:book

Comprehensive written and interactive instruction for learning HTML5 HTML is the core technology for building websites. Today, with HTML5 opening the Internet to new levels of rich content and dynamic interactivity, developers are looking for information to learn and utilize HTML5. HTML5 24-Hour Trainer provides that information, giving new and aspiring web developers the knowledge they need to achieve early success when building websites. Covers the most basic aspects of a web page, including a brief introduction to Cascading Style Sheets (CSS) Provides lessons that are backed up byprofessionally created training videos and interactive content to fully illustrate the dynamic nature of HTML5 and the Internet, while also providing a full learning experience Combines easy-to-follow lessons with expertly crafted training videos to provide you with both written and interactive instruction for learning HTML5 Written by bestselling author Joseph Lowery and with DVD content created by well-known multimedia and eLearning producer Mark Fletcher, HTML5 24-Hour Trainer brings the new features of HTML5 and the Internet to life unlike any other resource.

Smashing HTML5

Title:Smashing HTML5
Authors:Bill Sanders
Formats:PDF
Ids:GoogleDouban Books,9780470977279
Tags:HTML5, Programming Languages, Web, Web Application, Web Page Design, Web Programming
Publishers:Wiley
Author Sort:Sanders, Bill
Title Sort:Smashing HTML5
Date:25 ก.ย. 2013
uuid:d9ca8649-f26f-4318-87da-66cbb7606b47
id:6097
Published:ธ.ค. 2010
Modified:25 ก.ย. 2013
Size:6.17MB
Languages:English
Type:book

Welcome to HTML5 - the future of the Web HTML5 is packed with great new features, including new content-specific elements, audio and video playback, canvas for drawing, and many others. But where to begin? With Smashing HTML5, you have everything you need to get up and running quickly. Bill Sanders is a professional Web developer, information and interface designer, and instructor. His expertise and knowledge shared throughout Smashing HTML5 will help fast-track you toward building next-generation Web sites. Smashing HTML5 provides comprehensive coverage - from how to get started with HTML5 to optimizing media on the Web. You will learn how to use text, graphics, audio, video, and navigation in HTML5 Web pages running in compatible browsers. You will also learn how to: Work with HTML5 tags Design page structure Make site navigation easy for your audience Integrate media including video into HTML5 pages Harness the power of the HTML5 canvas Use HTML 5 forms Create interactivity, store information, and much more Smashing HTML5 is an essential read for Web designers and developers looking to transition to HTML5. With this book, you'll be able to create Web pages that not only look great, but also take advantage of the new features HTML5 has to offer.

HTML5 for Dummies Quick Reference

Title:HTML5 for Dummies Quick Reference
Authors:Harris, Andy
Formats:PDF
Ids:GoogleDouban Books,9781118012529
Tags:HTML5, Programming Languages, Reference, Web, Web Page Design, Web Programming
Publishers:Wiley
Author Sort:Andy, Harris,
Title Sort:HTML5 for Dummies Quick Reference
Date:25 ก.ย. 2013
uuid:d3eec714-e6f1-4f54-ab20-52ebf2c46aeb
id:6096
Published:พ.ค. 2011
Modified:25 ก.ย. 2013
Size:2.34MB
Languages:English
Type:book

Essential information about using HTML5: everything you need at your fingertips HTML is the predominant programming language used to create Web pages.?HTML5 has enhanced rich media, geolocation, database and mobile capabilities, and is now able to script APIs, making it a must-have for Web developers.?This convenient reference, comb-bound to lie flat, makes it easy to find the information you need in a hurry so you can get those terrific Web pages designed and online right now. HTML is used extensively in creating Web pages, especially for mobile browsers; HTML5 offers exciting enhancements that Web developers are eager to master Features a handy format that provides essential information in a quick and simple manner, with easy-to-follow instructions, smaller size, and convenient, lay-flat binding Covers using HTML5, CSS3, and JavaScript The basic information you need to develop eye-popping Web sites with HTML5 are easy to find in HTML5 For Dummies Quick Reference.

HTML5 & CSS3 in the Real World

Title:HTML5 & CSS3 in the Real World
Authors:Estelle Weyl & Louis Lazaris &Alexis Goldstein
Formats:PDF
Ids:GoogleDouban Books,9780980846904
Tags:CSS3, Design, HTML5, Programming Languages, Web, Web Development, Web Page Design
Publishers:SitePoint
Author Sort:Weyl, Estelle & Lazaris, Louis & Goldstein, Alexis
Title Sort:HTML5 & CSS3 in the Real World
Date:25 ก.ย. 2013
uuid:d388ecbd-8c63-4083-9dc9-6753ba0690ce
id:6095
Published:มิ.ย. 2011
Modified:25 ก.ย. 2013
Size:4.26MB
Languages:English
Type:book

HTML5 and CSS3 for the Real World is ideal for any web designer or developer who wants to start using the latest generation of web technologies in their everyday work. This book will teach you how to: * understand the new semantic markup available in HTML5 * use CSS3 to make sites beautiful without sacrificing clean markup or resorting to complex workarounds * employ native HTML5 video and audio in your pages * use web fonts to enrich a site's typography * make web applications accessible using WAI-ARIA * make the most of the new HTML form elements. This easy-to-follow guide is illustrated with lots of examples, and leads readers through the process of creating great websites from start to finish using HTML5 and CSS3. It also features: * details on all the new HTML5 and CSS3 elements and features * information on the current level of browser support * advice for creating great experiences for all users thanks to progressive enhancement.