ป้ายกำกับ

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

What Is HTML5?

Authors:Brett McLaughlin
Formats:PDF
Ids:Google, Amazon.com,9781449314491
Tags:HTML5, Programming Languages, Web Development, Web Page Design
Publishers:O'Reilly Media
Rating:★★★
Author Sort:McLaughlin, Brett
Title Sort:What Is HTML5?
Date:18 ก.ย. 2013
uuid:58270d47-d05f-4680-822e-075e815ec57e
id:6090
Published:ก.ค. 2011
Modified:18 ก.ย. 2013
Size:3.42MB
Languages:English
Type:book

HTML5: Everyone’s using it, nobody knows what it is. I realize that sounds more like a line out of an existential movie — maybe Waiting for Godot or a screenplay by Sartre — than a statement about HTML5. But it’s really the truth: most of the people using HTML5 are treating it as HTML4+, or even worse, HTML4 (and some stuff they don’t use). The result? A real delay in the paradigm shift that HTML5 is almost certain to bring. It’s certainly not time to look away, because by the time you look back, you may have missed something really important: a subtle but important transition centered around HTML5.

Introducing HTML5 Game Development

Authors:Jesse Freeman
Formats:PDF
Ids:Douban Books, 9781449315177
Tags:Game, HTML5, Programming, Web, Web Development, Web Page Design, Web Programming
Publishers:O'Reilly Media
Author Sort:Freeman, Jesse
Title Sort:Introducing HTML5 Game Development
Date:18 ก.ย. 2013
uuid:ba9f1a90-52b7-4d05-a1f1-3f0950370eb7
id:6089
Published:ก.พ. 2012
Modified:18 ก.ย. 2013
Size:6.55MB
Type:book

Flash is one of the best platforms for developing games on. Whether you want to deploy it to web, desktop or mobile Flash offers one of the largest user bases around. In this book we will cover some basic concepts of game development, managing your game's graphic pipeline, techniques for creating highly optimized game logic and cover some of the most commonly used game frameworks available. While this books offers an overview to Flash game development, the knowledge contained in here is key to any aspiring game developer.

HTML5 Media

Authors:Shelley Powers
Formats:PDF
Ids:Google, Douban Books,9781449304454
Tags:HTML5, Programming Languages, Web Application, Web Page Design, Web Programming
Publishers:O'Reilly Media
Rating:★★★★
Author Sort:Powers, Shelley
Title Sort:HTML5 Media
Date:18 ก.ย. 2013
uuid:8f5bc72f-94c4-4127-9386-3fd5938e82ea
id:6088
Published:ส.ค. 2011
Modified:18 ก.ย. 2013
Size:11.13MB
Languages:English
Type:book

If you're a web developer or designer familiar with CSS and JavaScript, this tightly focused introduction shows you how to add HTML5 media elements to your web pages, and how to provide custom controls for letting web visitors interact with the content. You'll also learn how to provide subtitles and captions, using file formats that work in browsers now. This book includes code samples and downloadable examples to help you take full advantage of audio and video in your web pages. Ensure your audio or video works in all browsers that support HTML5 media elements Learn about widely supported media file codecs and containers Customize the appearance of media elements with CSS Build your own applications to work with and control media elements Apply video subtitles and closed captioning with SRT and WebVTT Use SVG filters with HTML5, and play videos in your Canvas applications Explore upcoming features, including support for multiple tracks and synchronized playback

HTML5 Geolocation

Authors:Anthony T. Holdener, Iii & Anthony Iii
Formats:PDF
Ids:Google, Douban Books,9781449304720
Tags:HTML5, Programming Languages, Web Application, Web Programming
Publishers:O'Reilly Media
Author Sort:Holdener,, Anthony T. Iii & Anthony Iii
Title Sort:HTML5 Geolocation
Date:18 ก.ย. 2013
uuid:cad99c46-b956-48b4-94ab-5292453f1e8f
id:6087
Published:พ.ค. 2011
Modified:18 ก.ย. 2013
Size:1.72MB
Languages:English
Type:book

Truly revolutionary: now you can write geolocation applications directly in the browser, rather than develop native apps for particular devices. This concise book demonstrates the W3C Geolocation API in action, with code and examples to help you build HTML5 apps using the "write once, deploy everywhere" model. Along the way, you get a crash course in geolocation, browser support, and ways to integrate the API with common geo tools like Google Maps. Learn how geo information is gathered from different sources, depending on the device Discover how coordinate systems work, including geodetic systems and datums Use the API to collect location information from a user’s browser with JavaScript code Place geo information on a map using the Google Maps or ArcGIS JavaScript APIs Save geo data with databases, the Keyhole Markup Language, or the shapefile format Be familiar with several practical uses for geo data, such as geomarketing, geosocial, geotagging, and geo-applications

Creating HTML5 Animations With Flash and Wallaby

Authors:Ian L. McLean
Formats:PDF
Ids:Google, Douban Books,9781449307134
Tags:Animation, HTML5, Programming Languages, Web, Web Application, Web Programming
Publishers:O'Reilly Media
Author Sort:McLean, Ian L.
Title Sort:Creating HTML5 Animations With Flash and Wallaby
Date:18 ก.ย. 2013
uuid:ac1e079d-686a-4c4e-9347-1c64396ff477
id:6085
Published:ก.ย. 2011
Modified:18 ก.ย. 2013
Size:5.96MB
Languages:English
Type:book

Creating standards-compliant animations for the Web just got a lot easier. With this concise guide, you’ll learn how to convert Flash animations into HTML5, using Wallaby—the experimental tool from Adobe. Wallaby makes Flash content available for devices that don't support Flash runtimes, including the iPhone and iPad. Developing HTML5 animations is time-consuming with all the coding required. This book shows you how to create compelling content for HTML5 environments with relative ease, whether you know Flash or not. After a quick introduction to simple animation building with Flash, you'll learn how Wallaby helps you convert those animations into HTML5 code. Learn how to create a simple Flash animation, using Flash Professional CS5 Become familiar with the Flash Library, Stage drawing canvas, and animation Timeline Take the right approach to building a complex Flash animation for HTML5 Get performance tips to optimize animations for desktops and mobile devices Use simple JavaScript and CSS code to place the Wallaby animation in a web page Add interactivity to your HTML5 animation with jQuery

HTML5 for Publishers

Authors:Sanders Kleinfeld
Formats:PDF
Ids:Google, Amazon.com,9781449314613
Tags:HTML5, Programming, Web Application, Web Publishing
Publishers:O'Reilly Media
Rating:★★★
Author Sort:Kleinfeld, Sanders
Title Sort:HTML5 for Publishers
Date:18 ก.ย. 2013
uuid:3ad63e90-c125-4aca-acbb-e7cf33da43dd
id:6086
Published:ต.ค. 2011
Modified:18 ก.ย. 2013
Size:2.04MB
Languages:English
Type:book

HTML5 is revolutionizing the Web, and now it's coming to your ebook reader! With the release of the EPUB 3 specification, HTML5 support is officially a part of the EPUB standard, and publishers are able to take full advantage of HTML5's rich feature set to add rich media and interactivity to their ebook content.
HTML5 for Publishers gives an overview of some of the most exciting features HTML5 provides to ebook content creators--audio/video, geolocation, and the Canvas--and shows how to put them in action. Learn how to:
  • Intersperse audio/video with textual content
  • Create a graphing calculator to display algebraic equations on the Canvas
  • Use geolocation to customize a work of fiction with details from the reader's locale
  • Employ MathML to create an interactive equation solver
  • Make a coloring book using SVG and JavaScript

Building Hypermedia APIs With HTML5 and Node

Authors:Mike Amundsen
Formats:PDF
Ids:Google, Douban Books,9781449324568
Tags:HTML5, JavaScript, Programming Languages, Web Application
Publishers:O'Reilly Media
Author Sort:Amundsen, Mike
Title Sort:Building Hypermedia APIs With HTML5 and Node
Date:18 ก.ย. 2013
uuid:e3e0deb4-fdd0-40f3-9f56-8c5146f6ccc9
id:6084
Published:พ.ย. 2011
Modified:18 ก.ย. 2013
Size:6.89MB
Languages:English
Type:book

With this concise book, you’ll learn the art of building hypermedia APIs that don’t simply run on the Web, but that actually exist in the Web. You’ll start with the general principles and technologies behind this architectural approach, and then dive hands-on into three fully-functional API examples. Too many APIs rely on concepts rooted in desktop and local area network patterns that don’t scale well—costly solutions that are difficult to maintain over time. This book shows system architects and web developers how to design and implement human- and machine-readable web services that remain stable and flexible as they scale. Learn the H-Factors for representing application metadata across all media types and formats Understand the four basic design elements for authoring hypermedia types Convert a simple read-only XML-based media type into a successful API design Examine the challenges and advantages of designing a hypermedia type with JSON Use HTML5’s rich set of hypermedia controls in the API design process Learn the details of documenting, publishing, and registering media type designs and link-relation types

Introducing HTML5

Authors:Bruce Lawson & Remy Sharp
Formats:PDF
Ids:Google, Amazon.com, Douban Books, 9780321784421
Tags:HTML5, Web Application, Web Page Design
Publishers:New Riders
Rating:★★★★
Author Sort:Lawson, Bruce & Sharp, Remy
Title Sort:Introducing HTML5
Date:18 ก.ย. 2013
uuid:f43290f8-0a1e-4011-aa34-fb01c1e7d7e4
id:6083
Published:ก.ย. 2011
Modified:18 ก.ย. 2013
Size:19.66MB
Languages:English
Type:book

HTML5 continues to evolve, browsers are implementating at break-neck speed and HTML5 web sites spring up like flowers after rain. More than ever, you need to get acquainted with the powerful new possibilities in web and application design. That’s why we’ve crafted a second edition of this book to help you stay on top of current developments.
This book shows you how to start adapting the language now to realize its benefits on today’s browsers. It concentrates on the practical—the problems HTML5 can solve for you right away. By following the book’s hands-on HTML5 code examples you’ll learn about:
  • new semantics and structures to help your site become richer and more accessible
  • applying the most important JavaScript APIs that are already implemented
  • using and controlling native multimedia
  • how to build more intelligent web forms
  • implementing new storage options and web databases, including both WebSQL and IndexedDB
  • how geolocation works with HTML5 in both web and mobile applications
And this new edition adds:
  • even more detail on canvas, geolocation and offline storage options
  • a peek around the corner for audio and video’s new element, subtitling formats, in-browser web conference
  • browser history controls to make applications more usable and bookmarkable
  • ways to use HTML5 now in older browsers

วันอังคารที่ 17 กันยายน พ.ศ. 2556

HTML5 Step by Step

Authors:Faithe Wempen, M. A.
Formats:PDF
Ids:Google, Douban Books,9780735645264
Tags:HTML5, Web, Web Development, Web Page Design
Publishers:Microsoft Press
Author Sort:A., Faithe Wempen, M.
Title Sort:HTML5 Step by Step
Date:17 ก.ย. 2013
uuid:d44d885e-91f9-4a30-8177-a0234d7c6886
id:6082
Published:ก.พ. 2011
Modified:17 ก.ย. 2013
Size:9.28MB
Languages:English
Type:book

Teach yourself how to create Web pages with HTML5 -- one step at a time. With this practical hands-on tutorial, you'll learn how to use HTML5 markup to add video, offline capabilities, 2-D graphics, and more to your Web pages -- without relying on plug-ins or other technologies. Structure your Web page with tables, frames, or a division-based layout Create bulleted and numbered lists for easy-to-read text Include hyperlinks and menu bars for clear navigation Add graphics, sounds, and videos to your pages Use the Canvas 2-D drawing surface to render visual images on the fly Apply colors, font sizes, and other formatting with tags or Cascading Style Sheets Build user-input forms with option buttons, check boxes, and drop-down menus Your online learning resources include: Practice files Fully searchable online edition of the book -- with unlimited access on the Web

Rendering HTML5 Illustration

Authors:Matthew David
Formats:PDF
Ids:Douban Books, 9780240813837
Tags:HTML5, Web Page Design, Web Programming
Publishers:Focal Press
Author Sort:David, Matthew
Title Sort:Rendering HTML5 Illustration
Date:17 ก.ย. 2013
uuid:39c5119f-6db8-4ed2-91a1-44647d035822
id:6081
Published:เม.ย. 2010
Modified:17 ก.ย. 2013
Size:0.91MB
Languages:English
Type:book

Scalable Vector Graphics (SVG) and CANVAS are two new tools introduced in HTML5 that you can use to add illustration and interactive animation to your Web pages. Understand why there are two different formats, how you can use them, and where they can be used today. HTML 5, is the first major update to the core language of the Web in over a decade. The focus of this book is on innovations that most directly effect Web site design and multimedia integration. The companion Web site features working demonstrations and tutorial media for hands-on practice.

Building Websites With HTML5 to Work With Mobile Phones

Authors:David, Dr Matthew
Formats:PDF
Ids:Google, Amazon.com, Douban Books, 9780240819068
Tags:Data Processing, HTML5, Mobile Application, Mobile Phone, Web Application, Web Development, Web Page Design, Web Programming
Publishers:Focal Press
Rating:★★★★★
Author Sort:Matthew, David, Dr
Title Sort:Building Websites With Html5 to Work With Mobile Phones
Date:17 ก.ย. 2013
uuid:890d5a4b-4221-44ee-9d09-2d8d02a614f3
id:6080
Published:ก.ค. 2011
Modified:17 ก.ย. 2013
Size:1.91MB
Languages:English
Type:book

The goal of this ebook is to introduce you to mobile Web development. In many ways it is very similar to desktop Web site development - HTML5 is HTML5 no matter what device you install it on.What is different is how you use and interface with the device. Smartphones and tablets like the iPad, iPhone, and android devices are just very different than laptops and desktops. Find out how to work within mobile versions of popular web browsers while maximizing your design with HTML5 and CSS3 basics. Discover how to place items, work with fonts, and control color detail as well as other critical yet simple design elements.Work on graphical control with Bitmap, SVG and Canvas elements

วันอาทิตย์ที่ 15 กันยายน พ.ศ. 2556

Browser Test Web Site

วันนี้ผมได้ทดลองใช้ความสามารถเรื่อง Storage ของ HTML5 ดู ซึ่งโปรแกรมที่เขียน จะต้องทำงานได้บน iPad และ Android ผมจึงต้องทดสอบว่า browser บนเครื่องเหล่านั้น มีความสามารถรองรับ Storage หรือไม่ ซึ่งโดยส่วนใหญ่แล้วปัจจุบันนี้ browser ใหม่ๆทั้งหลายจะใช้ HTML5 ได้อยู่แล้ว แต่รายละเอียดปลีกย่อยบางอย่างอาจจะยังไม่สมบูรณ์

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

Web site ที่สรุปและเปรียบเทียบความสามารถของ browser มาดังนี้

  1. Can I use
  2. The HTML5 Test
  3. Browser Compatibility
  4. HTML Support History
  5. Web browser HTML support

วันพุธที่ 21 สิงหาคม พ.ศ. 2556

ปัญหาการสมัคร Google AdSense ใหม่ (Google AdSense Re-apply Problem)

ความเป็นมา

เมื่อสองวันก่อน ผมได้สมัคร Google AdSense อีกครั้ง หลังจากที่เคยทดลองสมัครเมื่อนานมาแล้ว ซึ่งตอนนั้น ผมเพิ่งเริ่มต้นสร้าง Blog จึงถูกปฏิเสธ เพราะ "เนื้อหาไม่เพียงพอ" และผมก็ยอมรับนะครับว่าตอนนั้น ยังไม่ได้มีเนื้อหาอะไรเลยจริงๆ เพราะเพิ่งจะหัดใช้งาน Blogger

หลังจากนั้น ผ่านไป 2 ปี ผมได้เขียนบทความไปทั้งหมด 20 บทความ ผมก็นึกขึ้นได้ว่า เคยสมัคร Google AdSense ไปนี่นา เลยลองสมัครใหม่ แต่ผลลัพธ์ที่ทาง ทีมงาน Google AdSense ตอบกลับมาก็ยังเหมือนเดิมคือ "เนื้อหาไม่เพียงพอ"

ครั้งนี้ ผมรู้สึกว่า ไม่ถูกต้อง เพราะปัญหามันเกิดจากความผิดพลาดของกระบวนการสมัครของ Google AdSense เอง ซึ่งผมพยายามหาทางอธิบายให้กับทีมงาน Google AdSense แต่ไม่มีช่องทางใดเลยที่จะทำได้ เป็นไปได้หรือ? ครับ มันเป็นอย่างนั้นจริงๆ และมีหลายคนได้โพสถามเกี่ยวกับปัญหานี้มากมาย แต่ก็ได้คำตอบแบบเดียวกันคือ ต้องไปสร้าง Google Account ใหม่ แล้วใช้ Account นั้น สมัครใหม่ครับ

ปัญหาคือ

ปัญหามีอยู่ว่า Blog ของผมนั้น ผมสร้างไว้ 2 แห่ง โดยแห่งแรกก็คือ vrsoftdev.blogspot.com ซึ่งผมใช้ URL อันนี้สมัครไปครั้งแรก และไม่ได้รับการยอมรับ เพราะตอนนั้นยังไม่มีเนื้อหาใดๆ ต่อมาผมสร้าง Blog ไว้อีกแห่งคือที่ lsomchai.blogspot.com โดยผมได้เขียนบทความไว้ที่นี่มาตลอด 2 ปี และมีเพื่อนๆรู้จัก Blog นี้ และที่ vrsoftdev.blogspot.com นั้น ผมก็ได้ทิ้งร้างไว้ ไม่ได้เขียนบทความอะไรไว้เลย

ครั้งนี้ที่ผมสมัคร Google AdSense ใหม่ ผมต้องการใช้ lsomchai.blogspot.com เป็นหลัก แต่เมื่อเข้าไปหน้าที่สมัคร ปรากฎว่า โปรแกรมตรวจสอบพบว่า ผมได้เคยสมัครไว้แล้ว ซึ่งนโยบายของทาง Google AdSense นั้น จะสร้าง Account ขึ้นมาเพียง Account เดียว สำหรับผู้ใช้งานแต่ละคน ดังนั้น เมื่อพบว่าผมเคยสมัครไว้แล้ว โปรแกรมก็ทำการดึงข้อมูลใบสมัครเก่ามาให้ผม โดยมี URL ของเว็บที่จะวางโฆษณาอยู่ที่ vrsoftdev.blogspot.com และ URL นี้ กลับไม่สามารถเปลี่ยนได้

ดังนั้น เมื่อผมกดส่งใบสมัครใหม่ ก็เท่ากับว่า เป็นใบสมัครที่ vrsoftdev.blogspot.com ซึ่งไม่มีเนื้อหาใดๆอยู่ เพราะผมทิ้งร้างไปนานแล้ว ผลลัพธ์ก็คือ ทางทีมงาน Google AdSense ก็คงจะเข้าไปดูแล้วไม่พบอะไร จึงตอบไม่ยอมรับการสมัครของผม เพราะเนื้อหาไม่เพียงพอ

ไม่สามารถสะท้อนปัญหาได้

ความยุ่งยากที่ทำให้ผมต้องมานั่งเขียนบทความเล่าเรื่องนี้ ก็เพราะว่า ผมไม่มีช่องทางใดเลยที่จะสะท้อนปัญหานี้ได้ จึงคิดอาศัยบทความนี้เป็นสื่อกลาง วางไว้ให้ทีมงาน Google AdSense เข้ามาอ่าน ถ้าทีมงานเข้ามาตรวจสอบเนื้อหาของ Blog นี้ ก็น่าจะได้อ่านบทความนี้ โดยปัญหาของช่องทางที่ควรจะสื่อสารได้ กลับทำไม่ได้มีดังนี้
  • Email ที่ตอบกลับมาจากทีมงาน Google AdSense นั้น ผมไม่สามารถใช้สำหรับโต้ตอบกับทีมงานเพื่อบอกสาเหตุได้ เพราะเป็น Email แบบ noreply ที่คงจะถูกส่งมาโดยระบบอัตโนมัติ ตอบกลับไปก็คงไม่มีใครได้อ่าน
  • เมื่อผมหาทางเข้าไปติดต่อผ่านทางเว็บ Support ที่มีลิ้งค์มาให้ตาม Email ที่ส่งมานั้น (ปุ่ม ติดต่อเรา) ปรากฎว่า ระบบจะตรวจสอบ Google AdSense Account ก่อน ซึ่ง Account ของผมจะมีสถานะเป็น "ไม่ผ่านการพิจารณา" ซึ่งก็จะไม่มีสิทธิ์ร้องขอความช่วยเหลืออีกเช่นกัน
  • ผมได้เข้าไปใน Forum และค้นหา ถาม-ตอบ เกี่ยวกับเรื่องนี้ และพบว่ามีหลายคนประสบปัญหานี้เช่นกัน และหลายคนก็แนะนำให้ไปสร้าง Gmail ใหม่ แล้วใช้ Gmail นั้นสมัครใหม่ ซึ่งผมคิดว่าไม่ถูกต้อง เพราะเราจะมี Gmail เพิ่มขึ้น และดูแลลำบากมากขึ้น
  • มีอยู่ Forum หนึ่งที่มีคนเขาแนะนำให้สมัครใหม่ด้วยลิ้งค์พิเศษ Forum ชื่อว่า How to change the old website url to a new blogger url? ลิ้งค์ที่แนะนำคือ https://support.google.com/adsense/bin/request.py?hl=en&contact_type=approvalstatus&rd=1 ซึ่งเป็นหน้าตางแบบฟอร์มที่สามารถป้อน URL ได้ เมื่อกรอกข้อมูลโดยใส่ URL อันใหม่เข้าไปแล้ว ไม่นาน ก็มี Email ตอบกลับมาว่า ได้ตรวจสอบการสมัครของผม และพบว่ามันเสร็จสิ้นเรียบร้อยแล้ว (Email ก็ยังคงเป็น noreply เหมือนเดิม)
  • ผมพบว่า ใน Forum ส่วนใหญ่ คำตอบไม่ได้มาจากทีมงานของ Google แต่เป็นคำตอบของคนทั่วไป และผมไม่สามารถหาคำตอบที่เป็นทางการ ที่เชื่อถือได้ในเรื่องนี้
หวังว่าทีมงาน Google AdSense จะได้อ่านบทความนี้ เข้าใจในปัญหาที่หลายๆคนพบ และนำไปสู่การปรับปรุงแก้ไขปัญหาที่เกิดขึ้นนะครับ

วันจันทร์ที่ 19 สิงหาคม พ.ศ. 2556

Safari Web Content

เมื่อวานนี้ ตอนเย็นๆ ผมกำลังหาข้อมูลเกี่ยวกับการเขียนโปรแกรมให้ใช้งานบน iPad ความจริงก็หามานานแล้วล่ะครับ ใครๆก็อยากเขียนโปรแกรมให้ใช้งานบน iPad ได้ เพราะอุปกรณ์ Mobile มันพกพาสะดวก ทำให้ใช้งานได้ทุกที่ทุกเวลา หลายๆคนก็เลยติดอินเตอร์เน็ตกันงอมแงมไปเลย

ครั้งนี้ก็นับเป็นครั้งที่เท่าไหร่แล้วไม่รู้ ที่ผมพยายามหาทางเขียนโปรแกรมให้ใช้บน iPad ได้ แต่ที่ยังไม่ลงตัวก็เพราะว่า ถ้าจะทำอย่างนั้นได้แบบตรงไปตรงมา ก็ต้องซื้อเครื่อง Mac มาใช้ และต้องเสียค่าสมัครเป็น iOS Developer อีก แล้วก็ต้องไปผ่านกระบวนการตรวจสอบโปรแกรมของเราจาก Apple ถึงจะสามารถขึ้นไปอยู่บน App Store ได้ ประมาณว่า ถ้าคิดจะทำโปรแกรมเล่นๆ ก็ถือว่าต้องลงทุนมากเป็นพิเศษ นี่ถ้าไม่ใช่รักกันจริง ก็คงจะไม่มีใครยอมลงทุนมากขนาดนั้น ซึ่งผมเองก็อยู่ในกลุ่มนี้เสียด้วยสิ

ครั้งนี้ ผมก็ได้พบความน่าสนใจของการพัฒนาโปรแกรมให้เป็น Web App และนำมาใช้งานบน iPad เนื่องจาก ผมพบว่า Safari สามารถสร้าง icon ของ Web Site ที่เราต้องการบน Home Screen ได้ด้วยการกดปุ่มส่งออก แล้วเลือก Add to Home Screen ซึ่งจะได้ปุ่ม icon เช่นเดียวกับ Application ต่างๆเลย ดังภาพข้างล่างนี้ ผมได้ทดลองเอาโลโก้ของมหาวิทยาลัยสงขลานครินทร์มาใส่ (เนื่องจากมีไฟล์เก่าอยู่ ตอนที่ผมเคยแปลงไฟล์ภาพ เป็น SVG)
ซึ่งเวลาจะลบ icon ทิ้งก็ทำได้ตามปกติ

จากการหาข้อมูลการพัฒนา Web App บน iPad ผมก็พบว่า Apple ให้เราสมัครเป็น Safari Extension Developer ได้ฟรี ผมก็เลยเข้าไปสมัครมาเรียบร้อย จากนั้นก็ได้อ่าน Resource แนะนำการเขียนโปรแกรมมากมาย โดยเฉพาะ Safari Web Content Guide ทำให้ผมรู้วิธีกำหนดภาพ icon ของ Web Site คือ การใส่ไฟล์รูปภาพชื่อ apple-touch-icon.png ไว้ที่ root ของ Web Site หรือกำหนด tag link ไปยังไฟล์ภาพของเรา เช่น

<link rel="apple-touch-icon" href="/custom_icon.png"/>

หลายคนอาจจะมีคำถามว่า วิธีนี้ก็จะทำให้โปรแกรมของเราต้องออนไลน์อยู่ตลอดเวลานะสิ คำตอบคือ ไม่ครับ เราสามารถกำหนดให้ Browser (Safari) ทำการ cache ไฟล์ต่างๆที่จำเป็นไว้ได้ โดยใช้ความสามารถของ HTML5 เรื่อง Application Cache ร่วมกับ Storage จากนั้น การทำงานทุกอย่างก็สามารถทำด้วย JavaScript ได้ ยกเว้นว่า เราต้องการส่งข้อมูลกลับไปยัง Server เท่านั้น ซึ่งสามารถกำหนดเงื่อนไขตรวจสอบการออนไลน์ของผู้ใช้ได้

หวังว่าแนวทางนี้ จะช่วยให้หลายๆคนพัฒนา App ดีๆบน iPad ได้เลยทันทีนะครับ

หมายเหตุ: การใช้ HTML5 Application Cache นั้น มีข้อจำกัดกับ Browser บางตัวที่จำกัดเนื้อที่ของไฟล์ให้ไม่เกินที่กำหนด Safari กำหนดได้ไม่เกิน 100MB

วันศุกร์ที่ 12 เมษายน พ.ศ. 2556

Using Bugzilla Account with Subversion Problem

ผมได้พยายามติดตั้ง Bugzilla และ Subversion ให้ใช้งานร่วมกัน โดยอยากจะใช้ account ร่วมกัน ซึ่ง Bugzilla นั้น มีการจัดการ account ในฐานข้อมูล MySQL อยู่แล้ว ส่วน Subversion นั้นจัดการ account ผ่าน user ของระบบปฏิบัติการ แต่หากติดตั้งให้ทำงานผ่าน Apache Web Server เราก็สามารถควบคุมการ Authentication จาก account ในฐานข้อมูล MySQL ได้ด้วย module auth_mysql ได้

แต่ปัญหามีอยู่ว่า รหัสผ่านที่ Bugzilla เก็บไว้ในคอลลั่มน์ cryptpassword ของตาราง profiles ในฐานข้อมูลนั้น มีการเติมข้อความ "{ชื่อ digest algorithm}" ต่อท้ายไว้ ทำให้ auth_mysql ไม่สามารถเปรียบเทียบค่า digest ของรหัสผ่านได้ แม้จะใส่รหัสได้ถูกต้องตรงกันแล้วก็ตาม

ปัญหานี้ ได้มีการแนะนำให้เข้าไปแก้ไขไฟล์ Bugzilla/Constants.pm โดยกำหนดให้ตัวแปร PASSWORD_DIGEST_ALGORITHM ไม่ต้องใส่ค่าใดๆ

PASSWORD_DIGEST_ALGORITHM = ''

เมื่อเราเปลี่ยนรหัสผ่านใน Bugzilla รหัสใหม่ก็จะถูกเข้ารหัสด้วยฟังก์ชัน crypt() ของระบบปฏิบัติการ และไม่ใส่ข้อความชื่อ digest algorithm ต่อท้าย ซึ่งจะทำให้ได้ค่าตรงกับที่ auth_mysql ต้องการ

จากการศึกษา เพื่อพยายามแก้ปัญหานี้ ทำให้ผมรู้ว่า MySQL ไม่มีฟังก์ชันที่จะแปลงข้อความเป็น Base64 โดยเพิ่งจะมีใน version 5.6 ซึ่งเป็นรุ่นล่าสุดในปัจจุบัน แต่ Ubuntu 12.04 LTS ที่ผมใช้อยู่ มี MySQL 5.5 และได้รู้ว่า ฟังก์ชันเข้ารหัสของ MySQL นั้น มีหลายฟังก์ชัน แต่ทั้งหมดจะให้คำตอบมาเป็น hex ไม่ใช่ base64

วันเสาร์ที่ 22 ธันวาคม พ.ศ. 2555

Bugzilla sslbase Setting failed.

สำหรับใครที่ใช้ Bugzilla บน Ubuntu จะพบปัญหาว่า ถ้าอัพเกรดมาเป็น Ubuntu 12.04 LTS แล้ว จะไม่มีแพ็คเกจของ bugzilla มาให้ เนื่องจากปัญหาช่องโหว่ด้านความปลอดภัย และไม่มีอาสาสมัครเข้ามาดูแลโปรแกรมนี้เป็นเวลานาน (ถ้าจำไม่ผิด คือเกิน 6 เดือน) จึงทำให้ Debian ถอด bugzilla ออก ซึ่งก็ส่งผลกระทบมายัง Ubuntu ด้วย แต่จากการติดตามข้อมูล เข้าใจว่ามีอาสาสมัครเข้ามาดูแลและแก้ไขช่องโหว่นั้นไปนานแล้ว แต่ยังไม่ได้มีการนำ bugzilla กลับเข้ามา

อย่างไรก็ตาม ผู้ใช้ยังสามารถดาวโหลดโปรแกรมโดยตรงจากเว็บไซต์ของ bugzilla (http://www.bugzilla.org) ได้ และวิธีการติดตั้งก็ไม่ได้ยุ่งยากอะไรมากนัก ซึ่งผมคงไม่กล่าวถึงในบทความนี้ สิ่งที่อยากจะเล่าสู่กันฟังก็คือ ปัญหาตอนเริ่มต้นที่เราจะต้องเข้าไปเซ็ตค่าเริ่มต้น sslbase แล้วเกิด error โดยค่าเริ่มต้นอื่นๆคือ urlbase ssl_redirect และ cookiepath ไม่มีปัญหา

แต่เพื่อความปลอดภัย เราควรจะเซ็ตค่าให้ใช้ SSL เป็นหลัก นั่นคือ การกำหนดให้ ssl_redirect เป็น on ซึ่งถ้าผู้ใช้เรียกมาที่ urlbase (http://....) bugzilla ก็จะ redirect ไปที่ sslbase (https://...) แทน แต่ปรากฏว่าเมื่อป้อนค่าเสร็จ กดปุ่ม Save ก็เกิดข้อความ error ว่า "The new value for sslbase is invalid: Failed to connect to ...:443; unable to enable SSL." ดังภาพ



ผมได้ค้นดูจาก Google แล้ว ก็พบว่ามีคนแนะนำให้ใส่ URL ที่ต้องการ (secure url ที่ใช้ HTTPS) ไว้ที่ urlbase เลย โดยทิ้ง sslbase ให้ว่างไว้ ซึ่งก็ใช้งานได้ แต่จะไม่มีการ redirect เสมือนว่าเราเปิดใช้เฉพาะ https อย่างเดียว

ปัญหาที่เกิดขึ้นนี้ เนื่องจาก bugzilla จะตรวจสอบว่า sslbase ที่เรากรอกไว้สามารถเข้าถึงได้จริง ซึ่งเป็นการเรียกตัวเอง และปกติแล้ว เราอ้างถึงด้วย localhost ถ้าอ้างด้วยชื่อโดเมน ในบางระบบจะทำไม่ได้เนื่องจากเป็นระบบเครือข่ายภายใน ซึ่งอาจจะใช้ IP ไม่ตรงกับที่มองมาจากภายนอก

วิธีการแก้ปัญหาของผมคือ แก้ไขไฟล์ /etc/hosts โดยใส่ชื่อโดเมนที่ต้องการไว้คู่กับ localhost เช่น

127.0.0.1 localhost somchai.coe.psu.ac.th

เมื่อกรอกข้อมูลเสร็จ จะสามารถ Save ได้ไม่เกิด error อีก จากนั้น เราอาจจะแก้ไขไฟล์ /etc/hosts ให้กลับไปเหมือนเดิมก็ได้ ถ้าคงไว้ อาจจะมีปัญหาการ routing ในบางกรณี ขึ้นอยู่กับระบบเครือข่าย

สมชัย หลิมศิโรรัตน์

วันศุกร์ที่ 6 กรกฎาคม พ.ศ. 2555

Fuzzy Logic

Fuzzy Logic เป็นเรื่องของตรรกะคลุมเครือ (Uncertainty) ซึ่งจะต่างจากตรรกะปกติ (อุดมคติ) ตามที่เราได้เรียนกันมาตั้งแต่สมัยมัธยมนั้น เป็นตรรกะที่มีเพียงสองค่า (bivalent logic) คือ จริง (true) กับ เท็จ (false) เท่านั้น แต่ fuzzy จะมีตรรกะมากกว่าสองค่า หรือที่เรียกว่า multivalent logic ซึ่งโดยทั่วไปแล้วจะใช้ค่า 0 = เท็จ, 1=จริง และ ค่าระหว่าง 0-1 จะเป็นดีกรีของค่าจริง

Fuzzy Logic จะมีความเหมาะสมและตรงกับตรรกะของมนุษย์มากกว่า เพราะมนุษย์จะพูดถึงเรื่องต่างๆในแบบที่ไม่ชัดเจน หรือ ไม่แม่นยำมากนัก เช่น เวลาที่เราพูดถึงความสูงของคน ถ้าจะวัดความสูงกันจริงๆ นาย ก. สูง 170 ซม. นาย ข. สูง 150 ซม. และ นาย ค. สูง 200ซม. เป็นต้น แต่เวลาเราพูดอาจจะบอกว่า นาย ก. สูง นาย ข. ไม่สูง และ นาย ค. สูงมาก ซึ่งไม่ใช่มีแค่สูงกับไม่สูง แต่ยังมีค่าอื่นๆด้วย

Membership Functions

เมื่อเราต้องการระบุถึงสิ่งใดสิ่งหนึ่งที่มีความคลุมเครือ เราสามารถใช้ fuzzy ระบุถึงความเป็นสิ่งนั้นได้ด้วยฟังก์ชันค่าความเป็นสมาชิก หรือที่เรียกว่า membership function โดยที่ฟังก์ชันนี้จะให้ค่าอยู่ในช่วง 0-1 เป็นการระบุค่าดีกรีของความเป็นสิ่งนั้นว่ามากน้อยเพียงไร

โดยปกติแล้ว เพื่อให้ง่ายต่อการคำนวณ เรามักจะใช้สมการเส้นตรงระบุค่าความเป็นสมาชิก เช่น





Operators
เมื่อต้องการประมวลผลค่าความเป็นสมาชิกของหลายๆสิ่ง มีวิธีการคำนวณดังนี้
M(not A) = 1 - M(A)
M(A) and M(B) = MIN(M(A), M(B))
M(A) or M(B) = MAX(M(A), M(B))
ส่วนเงื่อนไข IF A THEN B นั้น ปกติแล้ว เรามีเงื่อนไขเทียบเท่าคือ not A or B
ซึ่งสามารถคำนวณด้วย not และ or ได้

แต่เพื่อความสมเหตุสมผลมากกว่านี้ Godel ได้เสนอเงื่อนไข IF A THEN B ใหม่เป็นเทียบเท่ากับ (A <= B) or B

Rules
เมื่อเรานำเอาเงื่อนไข IF A THEN B มาใช้งาน โดยใช้เป็นกฏของการพิจารณาเรื่องที่เราสนใจเป็นข้อๆ ทำให้เราสามารถสร้างเงื่อนไขที่ซับซ้อนขึ้นได้ แต่จากกฏแต่ละข้อ เราสามารถคำนวณหาค่าความเป็นสมาชิกของเงื่อนไข IF A THEN B ได้ไม่ยาก แต่เมื่อนำค่าที่ได้จากกฏหลายๆข้อมารวมกัน เราจะต้องมีวิธีการรวมกันที่เหมาะสม เช่น ถ้ากฏแต่ละข้อ เป็นเงื่อนไขของแต่ละกรณีที่ไม่เกี่ยวข้องกัน เรามักจะเอาผลลัพธ์ของกฏแต่ละข้อมารวม(บวก)กัน แต่ถ้าเป็นกฏที่ขัดแย้งกัน เราก็จะรวมกันแบบ and เป็นต้น

Defuzzification
นอกจากนี้ เนื่องจาก B ยังเป็น fuzzy อยู่ เราก็จะต้องแปลงคำตอบที่ได้กลับไปเป็นค่าจริง โดยใช้วิธีการหา center of gravity ของคำตอบ B

สมชัย หลิมศิโรรัตน์