<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4170761397864520900</id><updated>2024-12-19T16:44:02.019+11:00</updated><category term="diary"/><category term="ClassA"/><category term="kickboxing"/><category term="six pack"/><category term="exercise"/><category term="muay thai"/><category term="ลดความอ้วน"/><category term="มวยไทย"/><category term="มวย"/><category term="buddhism"/><category term="cardio boxing"/><category term="lame"/><category term="personal development"/><category term="photography"/><category term="writing"/><category term="fitness first"/><category term="ionic"/><category term="muay boran"/><category term="muay chaiya"/><category term="no excuses"/><category term="review"/><category term="so you think you can dance"/><category term="พัฒนาบุคคล"/><category term="$http"/><category term="$promise"/><category term="$resource"/><category term="anger management"/><category term="angularjs"/><category term="australian idol"/><category term="bot"/><category term="cardio"/><category term="chaiya"/><category term="chatbot"/><category term="customer review"/><category term="cx5"/><category term="dhamma"/><category term="dietary"/><category term="directive"/><category term="facebook"/><category term="firewall"/><category term="forester"/><category term="glasses"/><category term="http"/><category term="https"/><category term="judge"/><category term="karma"/><category term="locationhistory"/><category term="mazda"/><category term="messenger"/><category term="motivation"/><category term="my house"/><category term="nat"/><category term="ngrok"/><category term="nobiai ยิงธนู มรรค เป้าหมายในชีวิต"/><category term="nodejs"/><category term="opera"/><category term="ownsday"/><category term="ptt"/><category term="python"/><category term="routing"/><category term="sixpack"/><category term="subaru"/><category term="time to say goodbye"/><category term="tunnel"/><category term="vdo"/><category term="webdevelopment"/><category term="webhook"/><category term="webservice"/><category term="zero excuses"/><category term="การเงิน"/><category term="กำลังใจ"/><category term="ขำๆ"/><category term="จมูกคด"/><category term="ธรรมะ"/><category term="ผ่าตัดโพรงจมูก"/><category term="พัฒนาตนเอง"/><category term="พัฒนาสมอง"/><category term="แกนจมูกคด"/><category term="โพรงจมูกคด"/><title type='text'>The Chayapol</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>PRL</name><uri>http://www.blogger.com/profile/05790694615940977991</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.s-t.au.ac.th/~prl/images/prlintro5.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>107</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-3661279905829094016</id><published>2019-05-19T19:16:00.003+10:00</published><updated>2019-05-19T19:17:26.119+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="buddhism"/><category scheme="http://www.blogger.com/atom/ns#" term="dhamma"/><category scheme="http://www.blogger.com/atom/ns#" term="karma"/><title type='text'>ทำดีไม่ได้ดี</title><content type='html'>&lt;i&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&quot;ทำดีไม่ได้ดี เหนื่อยแล้วโว้ย คนไม่ดีทำไมมั่งมีศรีสุขกันจัง ท้อกับการทำดีแล้ว&quot;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
ใจเย็นก่อน&lt;br /&gt;
&lt;br /&gt;
บาป บุญ มันเหมือนวัวดำ วัวขาว&lt;br /&gt;
การทำบุญทำบาปเป็นการสะสมวัวขาววัวดำ เข้าในคอกของเรา นอกจากสีแล้ว วัวก็มีวัย วัวเด็ก วัวหนุ่ม วัวแก่ ถ้ากรรมจะส่งผล ประตูกรรม(คอก) เปิดออก วัวตัวไหนจะออกมาก่อน?&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;u&gt;&lt;b&gt;วัวที่ใกล้ประตูจะออกมาก่อน&lt;/b&gt;&lt;/u&gt; ไม่แน่ด้วยว่าจะเป็นวัววัยไหน และ สีอะไร&lt;br /&gt;
ถ้าเรามีวัวขาว แต่วัวดำอยู่หน้าคอก วัวดำออกมาก่อน เราจะรู้สึกว่ามีแต่เคราะห์ แต่เมื่อกรรมร้ายมันหมด ก็ถึงเวลาเสวยบุญกันแล้ว&lt;br /&gt;
&lt;br /&gt;
คนที่ยังทำไม่ดี แต่ดูมีความสุขอยู่ วัวขาวเขาคงออกมาก่อน แต่ถ้าบุญหมด ก็เหลือแต่กรรมแล้ว&lt;br /&gt;
&lt;br /&gt;
งั้นเราอย่าไปสรุปว่าทำดีไม่ได้ดี &lt;u&gt;&lt;b&gt;ทำดีได้ทำ&lt;/b&gt;&lt;/u&gt; เจอปัญหาแก้ปัญหา อย่าตีโพยตีพาย บุญจะส่งผลไม่เช้าก็เร็วแหล่ะ</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/3661279905829094016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/3661279905829094016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3661279905829094016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3661279905829094016'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2019/05/blog-post.html' title='ทำดีไม่ได้ดี'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-8366425590450385677</id><published>2018-01-23T16:31:00.002+11:00</published><updated>2018-01-23T16:35:01.704+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="มวยไทย"/><title type='text'>REVIEW โดนชก จนเกือบน็อค</title><content type='html'>ซ้อมมวยมา 10 ปี อยากลองขึ้นเวทีมวยชกจริง ๆ มาตลอด อายุก็มากขึ้นเรื่อย ๆ เกรงจะหมดโอกาส&lt;br /&gt;
วันหนึ่งฝันเป็นจริงโดยการชักชวนของครูที่ค่ายที่ซ้อมอยู่ ผมสมัครเข้ารายการมวยสมัครเล่น Fairtex Smoker #7 ณ โรงแรม Fairtex พัทยา แม้จะใส่อุปกรณ์เต็ม แต่ก็ยังเจ็บอยู่ดี&lt;br /&gt;
&lt;br /&gt;
มวย 3 ยก ยกละ 2 นาที ไม่เล่าน้ำ เอาเนื้อ ๆ ที่ผมอยากแชร์คือ โดนเตะ โดนต่อย&lt;br /&gt;
&lt;h3&gt;
ยก 1&lt;/h3&gt;
เตะแรก ทักทายจากคู่ชก ป้าบแรกที่ขาซ้าย นี่ขนาดใส่สนับแข้ง ยังเจ็บขนาดนี้ ใจเต้นเร็วขึ้นมาทันที&lt;br /&gt;
หมัดที่โดนจริงจังหมัดแรก แย็บซ้าย เข้าแก้มขวา แม้จะใส่ head guard&lt;br /&gt;
หน้าด้านขวารู้สึกชา ได้ยินเสียงเหมือนของกรอบ ๆ ดังในหัว ตาขวามองไม่เห็น เซไปหน่อยนึง กรรมการเข้ามาขวางแล้วนับ 8&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
ยก 2&lt;/h3&gt;
จังหวะคลุกวงใน โดนฮุคขวาเข้าหัวด้านซ้าย&lt;br /&gt;
เสียงกรอบดังในหัวอีกครั้ง หูวิ้ง ภาพตัดมืดไปเลย แล้วก็ล้มลงไปกระแทกพื้นเวที แต่ก็ยันตัวขึ้นมาโดยสัญชาติญาน กรรมการเข้ามาดูอาการ กำลังจะโบกมือยุติการชก&lt;br /&gt;
ในหัวเวลานั้น เวลาเดินเช้ามาก ผมมองไปรอบ ๆ คนส่งเสียงเชียร์ ผมคิดว่า&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
จะจบแค่นี้แล้วหรือ? จบแค่นี้จริง ๆ หรือ?&lt;/blockquote&gt;
แล้วก็ปากก็พูดออกไป ในขณะที่อ้าปากหายใจเพราะฟันยางมันคับปากว่า&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ช่วยใส่ฟันยางให้หน่อย&lt;/blockquote&gt;
ไม่ได้คิดไตร่ตรองเยอะมากที่พูดออกไป กรรมการก็งง ๆ ผมคิดเพียงจะยื้อเวลาอีกนิด อย่ายุติการชก ผมไม่อยากแพ้แบบนี้ ผมยังพูดย้ำ&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ใส่ฟันยางให้หน่อย&lt;/blockquote&gt;
&lt;br /&gt;
กรรมการที่ทำท่ากำลังจะโบกมือยุติการชก ก็จับใส่ให้ แล้วผมยืนขึ้น โดยที่รู้ว่า ต้องโดนเข้ามาซ้ำแน่&lt;br /&gt;
จากนั้นใส่หมด ไม่กลัวเจ็บแล้ว&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
ยก 3 ก็ทุลักทุเล เจ็บ เหนื่อย&lt;/h3&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ผมดีใจที่ไม่ยอมแพ้ตรงนั้น ผมอาจจะเจ็บใจมากกว่านี้ถ้าถูกยุติการชก&lt;/blockquote&gt;
&lt;br /&gt;
การแพ้ครั้งนี้ แพ้คะแนนแบบที่ผมยอมแพ้จริง ๆ ความรู้สึกโดนชกจำไปไม่มีวันลืม การโดนเตะขา ทำให้ผมเดินไม่เป็นไป 3 วัน คืนนั้นนอนโอดครวญทั้งคืน เป็น 3 ยก ที่ยาวนาน เสียดาย อยากชกให้สะใจกว่านี้ แต่ผมเองที่ใจไม่โหดพอที่จะชกคนอื่น</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/8366425590450385677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/8366425590450385677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8366425590450385677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8366425590450385677'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2018/01/review.html' title='REVIEW โดนชก จนเกือบน็อค'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-2660453734102326457</id><published>2017-09-01T15:10:00.001+10:00</published><updated>2017-09-01T15:10:50.741+10:00</updated><title type='text'>กระแสต่อต้านการเรียนแบบท่องจำ</title><content type='html'>สังคมไทยเวลาเห็นอะไรล้าหลัง ก็ต้องมีเรื่องการศึกษาเข้าไปเป็นปัจจัยทุกครั้ง&lt;br /&gt;
แต่การวิพากย์ขนาดว่า กระทั่งท่องสูตรคูณก็บอกว่าล้าหลัง และ ทุกอย่างคำนวณและ prove ได้หมด ผมไม่เถียงเลยครับ ทุกอย่าง prove ได้หมด&lt;br /&gt;
&lt;br /&gt;
อย่าง Calculus ง่ายๆ เช่น่ d x^2 /dx = 2x นี่ ท่านจะ prove กันใหม่ทุกครั้งไหม? ถ้ามีการทำเป็น formula มาให้ว่า d (x^n) /dx = nx^(n-1) ให้**จำ**ไปใช้ถือว่าล้าหลังไหม เครื่องคิดเลขต้องรุ่นขนาดไหนถึงจะทำ differentiation ได้&lt;br /&gt;
&lt;br /&gt;
เขียนโปรแกรมจำคำสั่งไม่ได้เลย แต่แน่นอนครับมี API reference ให้เปิดอ่าน ไม่ต้องท่องเลย เปิดอ่านไป แต่คนที่จำได้ ก็ทำเสร็จไปไกลแล้ว&lt;br /&gt;
&lt;br /&gt;
เรียนหมอไม่ท่องจำ anatomy แล้วเปิดอ่านทุกครั้ง ทำไง? ช่วงเวลาเรียนเขาบังคับให้คุณต้องจำสิ่งนี้ให้ได้ก่อนออกไปทำงาน หรือจะต้องให้ทำงานก่อนประสบการณ์เยอะๆแล้วจะจำได้เอง?&lt;br /&gt;
&lt;br /&gt;
อย่าสุดโต่งมากนักเลย พึ่งพาเครื่องไม้เครื่องมือตลอดก็เกินงามนะครับ</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/2660453734102326457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/2660453734102326457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/2660453734102326457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/2660453734102326457'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2017/09/blog-post.html' title='กระแสต่อต้านการเรียนแบบท่องจำ'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-9068763403629505488</id><published>2017-05-03T01:55:00.003+10:00</published><updated>2017-05-03T01:59:18.118+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="anger management"/><category scheme="http://www.blogger.com/atom/ns#" term="buddhism"/><category scheme="http://www.blogger.com/atom/ns#" term="personal development"/><title type='text'>Taking control of your anger</title><content type='html'>&lt;b&gt;How should you deal with you anger?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
No, you don&#39;t have to hold it, but yet you don&#39;t have to tighten your fist, breath heavily, grit, stare, or imagine million ways to kill someone.&lt;br /&gt;
&lt;br /&gt;
Try this. There&#39;s a little kid in you whose name is the same as yours. As soon as something happens to the kid, he/she will rush to you and tell you that &quot;I am so angry! I wanna bite him!&quot;&lt;br /&gt;
&lt;br /&gt;
Now YOU! You are observing things; you see what&#39;s going on; you are compassionate enough to comfort and console the kid. I believe if you are reading this blog, you are not the type to tell him/her to fight or harm someone, but you will rather tell him/her to calm down, because you know well that&lt;br /&gt;
1. the anger is just a feeling that the kid submits to.&lt;br /&gt;
2. there is a reason why the kid is angry, but you know the consequence if the kid goes too far.&lt;br /&gt;
&lt;br /&gt;
Now tell your kid what to do; there you are telling yourself what to do.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Why does this method work?&lt;/b&gt;&lt;br /&gt;
The sooner the kid tells you about anything, the sooner you can pick up your feeling and you get back to mindfulness state quicker. You don&#39;t allow your instinct to take control; which of course it is best to control things consciously. Hence you will not strengthen this part of your brain to hard wire the temper reflex. It is a reward system, the more you do, the better you feel.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/9068763403629505488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/9068763403629505488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/9068763403629505488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/9068763403629505488'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2017/05/taking-control-of-your-anger.html' title='Taking control of your anger'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-3451394799683106758</id><published>2017-04-04T22:30:00.002+10:00</published><updated>2017-04-04T22:39:13.180+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ptt"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="webservice"/><title type='text'>Python เรียก Web Service ราคาน้ำมัน ของ ปตท</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEips_6kCLCvaehX5vkO07CQ3pKBJKaF9D-cnQ6TeNrnIEDMdZ0RIpnUKg5k4C-OYJd7c-Zf6VypWw7KpCpeR1lFI6RRF0Wj8SpVCbjVcxH98PSMW-pMp6Gun8JPTo-2LLw6gIbpngrN4o_3/s1600/ptt.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;252&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEips_6kCLCvaehX5vkO07CQ3pKBJKaF9D-cnQ6TeNrnIEDMdZ0RIpnUKg5k4C-OYJd7c-Zf6VypWw7KpCpeR1lFI6RRF0Wj8SpVCbjVcxH98PSMW-pMp6Gun8JPTo-2LLw6gIbpngrN4o_3/s400/ptt.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
ได้เห็นคุณ&amp;nbsp;&lt;a href=&quot;http://webunique.in.th/blog/author/supachet2526/&quot; rel=&quot;author&quot; style=&quot;border: 0px; box-sizing: border-box; color: #6e6e6e; font-family: inherit; font-size: 15px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 1px; text-decoration-line: none; text-transform: capitalize; vertical-align: baseline;&quot; title=&quot;Posts by supachet2526&quot;&gt;Supachet2526&lt;/a&gt;&amp;nbsp;เขียนการใช้ PHP เรียก Web Service ราคาน้ำมันของ ปตท เลยอยากลองใน Python บ้าง แต่เนื่องจาก Python มี Package มหาชนให้เลือกใช้เยอะไปหมด ตัวมาตรฐานที่ให้มาก็ซับซ้อนเกินงาม โดยสรุป ผมทำได้สั้นสุด เท่านี้ครับ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #e5e5cc; border: 1px solid rgb(240, 240, 224); margin-top: -5px; padding: 5px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;from zeep import Client
from lxml import etree

client = Client(&#39;http://www.pttplc.com/webservice/pttinfo.asmx?WSDL&#39;)
result = client.service.CurrentOilPrice(&quot;en&quot;)

root = etree.fromstring(result)

for r in root.xpath(&#39;DataAccess&#39;):
    product = r.xpath(&#39;PRODUCT/text()&#39;)[0]
    price = r.xpath(&#39;PRICE/text()&#39;) or [0]
    print(product,float(price[0]),&#39; BAHT&#39;)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Output&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihrTOmFT-lqZ_AtCiC9nILjXdGWvAUWmt7hEFFz2M44rUkbr2Zlr6AWr36MI2Us0xdJ4iKvAftSvGGCE-naYi5U0TAdfXuzKs6ONbv_l3pDERh9Ynk6guj7Ugc6u3CmaKNW7iQKjM0WMQp/s1600/ptt-result.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihrTOmFT-lqZ_AtCiC9nILjXdGWvAUWmt7hEFFz2M44rUkbr2Zlr6AWr36MI2Us0xdJ4iKvAftSvGGCE-naYi5U0TAdfXuzKs6ONbv_l3pDERh9Ynk6guj7Ugc6u3CmaKNW7iQKjM0WMQp/s320/ptt-result.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ผมสรุปว่า&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;background-color: whitesmoke; font-family: inherit; font-size: 14px;&quot;&gt;SimpleXMLElement&amp;nbsp;&lt;/span&gt;ของ PHP ทำให้ Parse XML ที่คืนมาในรูปแบบ String ได้ง่ายมาก (แต่ก็นะ WebService นี้ตอบมาเป็น plain string ซะงั้น คืนมาเป็น Object จะเข้าทางมากกว่านี้)&lt;/li&gt;
&lt;li&gt;วุ่นวายอ่าน review หา SOAP Client ที่เหมาะสม แล้วไหนต้องระวังว่าจะ obsolete ไปแล้วด้วย สุดท้ายเลือก zeep ครับ และ code นี้ต้องลง zeep เพิ่ม แล้วจะได้ lxml มาด้วย ลง zeep ด้วย pip แสนง่ายดายด้วย&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;pip install zeep&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/3451394799683106758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/3451394799683106758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3451394799683106758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3451394799683106758'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2017/04/python-web-service.html' title='Python เรียก Web Service ราคาน้ำมัน ของ ปตท'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEips_6kCLCvaehX5vkO07CQ3pKBJKaF9D-cnQ6TeNrnIEDMdZ0RIpnUKg5k4C-OYJd7c-Zf6VypWw7KpCpeR1lFI6RRF0Wj8SpVCbjVcxH98PSMW-pMp6Gun8JPTo-2LLw6gIbpngrN4o_3/s72-c/ptt.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-952115737989059149</id><published>2017-03-20T18:36:00.001+11:00</published><updated>2018-03-11T14:25:29.042+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="customer review"/><category scheme="http://www.blogger.com/atom/ns#" term="cx5"/><category scheme="http://www.blogger.com/atom/ns#" term="forester"/><category scheme="http://www.blogger.com/atom/ns#" term="mazda"/><category scheme="http://www.blogger.com/atom/ns#" term="subaru"/><title type='text'>REVIEW Mazda CX5 2.0S 2016 VS Subaru Forester 2.0ip 2016</title><content type='html'>เมื่อปีที่แล้ว มีเพื่อนๆพี่น้องถามประสบการณ์ที่เปลี่ยนจ&lt;wbr style=&quot;font-family: helvetica, arial, sans-serif;&quot;&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot; style=&quot;display: inline-block;&quot;&gt;&lt;/span&gt;าก Mazda CX5 2.0 มา Subaru Forester 2.0 เอาว่าเขียนตรงนี้ละกันแล้วนะ&amp;nbsp;ประสบการณ์ตรง สรุปคร่าวๆเป็นข้อๆ ประกอบการตัดสินใจสำหรับท่านที่มองหา SUV ไว้ใช้&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBSlS3ISkePJxVFdb9wF_gkuCUENlcFVBB7uuOU-zkWdKu06afVcjbhFppGw4WxzoIJksZG6hkSW7bWHbjaR1OdsIZ0qFU0qqX_IUb3hK4R9ZDYz2V81bh68LqcsvdS0ATUb1VF8pfcJIF/s1600/Forester+VS+CX5.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;267&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBSlS3ISkePJxVFdb9wF_gkuCUENlcFVBB7uuOU-zkWdKu06afVcjbhFppGw4WxzoIJksZG6hkSW7bWHbjaR1OdsIZ0qFU0qqX_IUb3hK4R9ZDYz2V81bh68LqcsvdS0ATUb1VF8pfcJIF/s640/Forester+VS+CX5.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
1. ราคา&lt;/h3&gt;
Forester ราคาขึ้นๆลงๆ ตอนผมซื้อร าคาพอกับ CX5 ตอนนี้แพงกว่าแล้ว ใครบอกใช้รถแล้วราคาตก นี่ไงขึ้นเห็น&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;ๆ หะหะ&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;2. เครื่องยนต์ และ เกียร์&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;จุดเด่นของ Subaru คือเครื่อง Boxter ที่ลูกสูบอยู่แนวแนว ศูนย์ถ่วงก็ต่ำสาดโค้งเป็นเรื่องสนุก เพราะไม่รู้สึกเหมือนโดนโยนออกจากรถ ยิ่งจะอยากเร่งให้เร็วขึ้นตอนอยู่ในโค้งด้วยซ้ำ (ต้องลองเองนะครับ) นอกจากนี้&lt;/span&gt;เครื่องยนต์ก็อยู่ต่ำด้วย เปิดฝากระโปรง Forester จะเห็นว่า ด้านบน ๆ จะมีพื้นที่มาก (อ๊ะ ฝากระโปรงเป็นอลูมิเนียมซะด้วย เบาดี)&lt;br /&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;Forester เป็น CVT ที่ใช้โซ่ ทนทาน และมีเสียงโวงๆๆๆๆ ตอนปลอ่ยไหลขณะลดความเร็ว (เป็นปกติที่จะมีเสียง) ในขณะที่ CX5 เป็น 6-speed AT แน่นอนว่าความรู้สึกตอนเร่งไม่เหมือนกัน เสียงรอบขึ้น เปลี่ยนเกียร์แล้วไต่รอบขึ้นใหม่ ไม่มีอาการนี้ใน CVT ซึ่งการเร่งออกตัวจะถูกแช่ไว้ที่ 3,000 รอบ ซึ่งเป็นรอบที่ Optimal ที่สุดของเครื่องยนต์&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;CVT ของ Subaruนี้ทำตัวประหลาดๆ ที่แรกๆ ก็งงกับนิสัยมัน คือกดมิดก็ไม่พุ่งออกตัวเหมือน AT แต่หลังจากศึกษาวิธีขับก็พบว่า มันไม่ชอบให้กดหมด กดแค่ 70% พอรอบมาแล้ว กดต่อได้อีกจนลากไปถึง 6,000-7,000 รอบตอนออกตัวก็ได้ แต่อย่าฟังคนอื่นด่า CVT จนกลายเป็นแหยง CVT ไปด้วย มันมีข้อดีของมัน ต้องลองเอง เอา VDO ของ Nissan ไปดูประกอบ ไม่มีจังหวะเย่อเปลี่ยนเกียร์เร่งขึ้นๆไป และการควบคุมอยู่ที่น้ำหนักเท้า&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/2OMqmpjOHWM/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/2OMqmpjOHWM?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;3. อัตราบริโภคน้ำมัน&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;Forester ไม่ประหยัดน้ำมันเท่า CX5 ขับชิวๆ เคยได้ 7.4L/100km (13.5km/L) แต่ Forester ได้ดีสุดก็ 8.1L/100km (12.3km/L) ก็มันขับสี่ ให้ทำไง ตอนนี้ขับมา 20,000 โล อัตราบริโภครวมอยู่ที่ 9.4L/100km (10.64km/L)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;**Update** ตอนนี้ 44,000 โล เฉลี่ยที่ 9.1L/100km หลังจากเข้าใจมันมากขึ้น ทำได้ดีสุดที่ 6.9L/100km&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;4. การขับขี่&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;4.1 Forester ขับเคลื่อน 4 ล้อ &lt;b&gt;&lt;u&gt;ตลอดเวลา&lt;/u&gt;&lt;/b&gt; (คือตลอดเวลา ไม่ใช่เปิดปิดได้ ไม่ใช่คอมพิวเตอร์เลือกว่าเมื่อไหร่จะขับ 4 ล้อ) ดียังไง เช่น อยากเลี้ยวไปไหนมันก็ไป เข้าโค้งตัวไม่เหวี่ยงเพราะเครื่องสูบนอนศ&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot; style=&quot;display: inline-block; font-family: inherit;&quot;&gt;&lt;/span&gt;ูนย์ถ่วงต่ำ ไม่กลัวติดหล่ม ถนนขึ้นเขาขรุขระเส้นเดียวกัน CX5 ขึ้นไม่ได้ ต้องหมุนหามุมหลายตลบ แต่ Forester ก็ปีนมันขึ้นไปง่ายๆ&lt;br /&gt;4.2 Forester มี 4-low (X-Mode) ลงเขาไม่ต้องเลี้ยงเบรค ค่อยๆลงมาเอง&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;4.3 เคยมีเหตุที่ทำให้ต้องซัดตีนผีบนบูรพาวิถี&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot; style=&quot;display: inline-block; font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;จากเอแบคบางนา ไปหนองมน ตอนนั้น CX5 ก็ตอบสนองได้ดีมาก แต่ให้เทียบความมั่นใจในการขับขี่ว่าจะเอา&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot; style=&quot;display: inline-block; font-family: inherit;&quot;&gt;&lt;/span&gt;อยู่ในโค้ง บอกตรงๆ ไม่อวย ไม่เอียง Forester มั่นใจกว่าครับ&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;5. ศูนย์บริการ&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;5.1 ออก CX5 ศูนย์พระราม 7 บริการเป็นเลิส แต่พอหลังๆ ผมอยู่ชลบุรีเป็นหลัก ศูนย์บริการห่วย ไร้ฝีมือ วิเคราะมั่ว เกลียด นี่เป็นตัวเร่งหลักที่ทำให้ตัดสินใจ &lt;b&gt;**ถ้าอยู่ชลบุรี อย่า่ใช้ Mazda**&lt;/b&gt;&lt;br /&gt;5.2 ออก Forester ที่ศรินครินท์ ถึงวันนี้ ยังไม่มีอะไรให้บ่น (หรือใจมันรัก)&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;6. Defect&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;6.1 CX5 เคยดับกลางถนน ช่างศูนย์มั่ว โทษแบต เปลี่ยนแบตตอน 6 เดือนแรก โดยผมต้องจ่ายเอง แต่ไม่หาย สาเหตุสุดท้ายคือ ปั๊มติ๊กเสีย (เสีย??) เคลมฟรี และเคยมี โช๊คหลังขวาตาย&lt;br /&gt;6.2 Forester มี mic bluetooth พูดไปปลายทางไม่ได้ยิน กล้องมองหลังน้ำเข้า เคลมไป อย่างละเดือน&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;7. อุปกรณ์เสริม&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;7.1 กล้องมองหลัง Forester ไม่ make sense เท่า CX5 เส้นนำไม่เลี้ยวตาม เอาไว้ดูสภาพแวดล้อมด้านหลังเท่านั้น เอาไว้กะระยะมุมเลี้ยวลำบาก&lt;br /&gt;7.2 Forester ไม่มี sensor หน้าหลัง CX5 มีครบ ฉลาด ทำงานเมื่อความเร็วต่ำ Forester ต้องติดเพิ่ม&lt;br /&gt;7.3 Forester ประตูหลังไฟฟ้า ตั้ง mode ทิ้งกุญแจไว้ในรถแล้วใส่ code เปิดประตูได้ (ซึ่งทำยากมาก) ใช้เวลาไปเที่ยวทะเลแล้วไม่มีคนเฝ้าของ แต่อยากเล่นน้ำ&lt;br /&gt;7.4 CX5 ตอนนั้น Entertainment System อ่านภาษาไทยไม่ได้ ไม่มี GPS ตอนนี้คงได้แล้ว&lt;br /&gt;7.5 พื้นที่ด้านหลัง Forester กว้างกว่า เพราะหลังไม่ปาดเอียง (เลยทำให้ดูไม่โฉบเฉี่ยวเท่า CX5) และแผ่นกั้นห้องโดยสาร CX5 ฉลาดกว่ามาก คือดึงขึ้นได้พร้อมกับตอนเปิดฝาหลัง&lt;br /&gt;7.6 เสา A ของ CX5 มีปัญหา ตัว model change จะแก้ปัญหานี้ คือ มันบังมอเตอร์ไซค์ได้มิด มุมนั้นต้องระวัง จาก Clip นี้ ผมกวางกล้องให้เห็นว่ามุมมองที่เสา A Forester เจาะช่องไว้เป็นกระจก ตัวนี้ต่างอย่างเห็นได้ชัด รู้สึกกว้างขึ้นมาก&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;7.7 Forester มี memory seat มีประโยชน์มากสำหรับผมที่ผลัดกันขับกับภรร&lt;/span&gt;&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot; style=&quot;display: inline-block; font-family: inherit;&quot;&gt;&lt;/span&gt;ยา&lt;br /&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/xyKKupk64JQ/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/xyKKupk64JQ?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;8. ค่าเลี้ยงดู&lt;/span&gt;&lt;/h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;8.1 ตาม spec เติม Gasohol 95 ทั้งคู่&lt;br /&gt;8.2 Subaru dealer มักเป็นผู้ขายรถยี่ห้ออื่น หรือไม่ก็ เกรย์ บางทีจะมีของแถมแปลกๆได้เช่น เคลือบแก้ว ดอก 0% ฯลฯ แล้วแต่ทักษะการต่อรอง และมักจะไม่ค่อยยอมต่อรองทางโทรฯ เซลล์บอก กลัวเจอ สนง ใหญ่ แกล้งโทรมา จะกลายเป็นศูนย์ตัดกันเองด้วยโปรแรงๆ ราคาปลีก X แต่ขายจริง มีส่วนลดเป็นแสน O_o คุยหลายๆ ที่ครับ&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;9. หน้าตา -- นานาจิตตัง&lt;/span&gt;&lt;/h3&gt;
&lt;h3&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;10. ลองขับก่อนซื้อนะครับ&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;เซล Subaru ของสองศูนย์ที่ไปลองมา พาขึ้นเขา วิ่งถนนขรุขระ ยิ่งฝนตก ยิ่งขวนให้ออกไปขับ ส่วน CX5 ไม่ได้ลอง ภรรยาสั่งให้ซื้อเลย&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;การรีวิวจึงจบลงด้วยประการฉะนี้ เอวัง&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/952115737989059149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/952115737989059149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/952115737989059149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/952115737989059149'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2017/03/customer-review-mazda-cx5-20s-2016-vs.html' title='REVIEW Mazda CX5 2.0S 2016 VS Subaru Forester 2.0ip 2016'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBSlS3ISkePJxVFdb9wF_gkuCUENlcFVBB7uuOU-zkWdKu06afVcjbhFppGw4WxzoIJksZG6hkSW7bWHbjaR1OdsIZ0qFU0qqX_IUb3hK4R9ZDYz2V81bh68LqcsvdS0ATUb1VF8pfcJIF/s72-c/Forester+VS+CX5.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-8776904390933732399</id><published>2017-01-31T14:45:00.001+11:00</published><updated>2017-03-20T18:49:05.543+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="glasses"/><category scheme="http://www.blogger.com/atom/ns#" term="ownsday"/><category scheme="http://www.blogger.com/atom/ns#" term="review"/><title type='text'>REVIEW ร้านแว่น OWNDAYS</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbf5pUl4p9RENF414a6UuiclQXXUjtTr3IzMzPBU5cG-CNfpzX8-jleqGyOGekuxoVxktC6aQdUVRYzY3Js3daNf-RkpDhoKYxqgE0iQkzeq87_LBKRx2EtWUZz83M7AV6R1FqNSSG3niC/s1600/S__5185549.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbf5pUl4p9RENF414a6UuiclQXXUjtTr3IzMzPBU5cG-CNfpzX8-jleqGyOGekuxoVxktC6aQdUVRYzY3Js3daNf-RkpDhoKYxqgE0iQkzeq87_LBKRx2EtWUZz83M7AV6R1FqNSSG3niC/s320/S__5185549.jpg&quot; width=&quot;239&quot; /&gt;&lt;/a&gt;ผมใส่แว่นมาตั้งแต่เด็ก เป็นเวลามากกว่า 30 ปี สายตาไม่ได้สั้นมาก แต่เอียงเยอะหน่อย ทุกครั้งที่ไปตัดแว่น พนักงานร้านจะบอกให้รอหนึ่งสัปดาห์เพื่อส่งสเปกไปให้โรงงานทำเลนส์แล้วส่งมา ก็เป็นอย่างนั้นมาตลอด แต่วันนี้เกิดเหตุ&lt;b&gt;&lt;u&gt;แว่นบึ้มคาหน้า&lt;/u&gt;&lt;/b&gt; คือเฟรมขาด แล้วเด้งเลนส์กระเด็นออกไปเลย ก็เข้าใจได้ เพราะปีหลังๆนี้ผมงก ไม่ซื้อกรอบใหม่ เพราะรู้สึกว่ามันแพง แค่เหล็กพลาสติก ทำไมแพงนักว้า เลยทนใช้มาเรื่อยๆ สามปีก็มาถึงจะบึ้มคาหน้า&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
พอทำใจได้ว่าจะต้องใช้ชีวิตไม่มีแว่นไปสักพัก ก็ไป Mega Bangna เพื่อตัดแว่น เดินสำรวจอยู่พักนึง เจอหลายร้าน และหลายยี่ห้อที่คุ้นหู แต่ครั้งนี้อยากลองอะไรใหม่ๆ เลยลองเข้าร้านที่หน้าร้านเปิดกว้าง ชื่อ OWNDAYS ดู สิ่งแรกที่รู้สึกได้คือ ไม่แพง แว่นอันใหม่ที่ได้มาทรงเดิม ราคารวมเลนส์เคลือบกัน UV แล้ว 2,490 บาท ผมถือว่าราคาถูกแล้ว ถ้าจะเอาเคลือบอะไรพิเศษอีก ก็เพิ่มไปเลย 3,000 บาท&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
แต่จากประสบการณ์การลองสารเคลือบต่าง ผมพบกว่า แค่กัน UV ก็พอแล้ว&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Multi-coat เปลี่ยนสีเข้มเมือเจอ UV - แต่ตอนขับรถ ถ้ารถติดฟิลม์ที่กัน UV อยู่แล้ว เลนส์แว่นจะไม่เปลี่ยนสี เพราะไม่โดน UV (ป้าด!)&lt;/li&gt;
&lt;li&gt;เคลือบอะไรไม่รู้ กันแสงสีฟ้าจากหน้าจอคอมพิวเตอร์ - ปัญหาคือ สารเคลือบมันหมดสภาพง่าย คือ คนใส่แว่นผมเชื่อว่า ร้อยละล้าน ไม่เช็ดแว่นด้วยผ้าเช็ดแว่นทุกครั้ง แล้วสารพวกนี้ก็จางลง ทำให้บริเวณที่เคลือบไม่เท่ากัน กลายเป็นมองผ่านเลนส์แสงเข้าไม่เท่ากัน ปวดเฮด&lt;/li&gt;
&lt;li&gt;เคลือบอะไรไม่รู้ กันน้ำ - โดนน้ำแล้วสะบัดๆออกได้เลย ว้าวววว แต่ มันก็ลอกง่ายอีกแหล่ะ&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
สำหรับผม พอกันทีกับการเพิ่มเงินเพื่อเคลือบพวกนี้ เอากัน UV จากแสงอาทิตย์กันเป็นต้อก็เพียงพอ&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-kdwnoIlOJxQxsxC-Cf5sAE2yOU4Yprg6IvZRErOwjhtIvVM8F1SNldaU1qAbyme83DV8O_3eGvzfcNAD8yn4WsczVZ8FwUI4TA3KqsUO_Ov5wJa-cqr1qbMufFBD2dKZ4T-khogTcx77/s1600/S__5193738.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;476&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-kdwnoIlOJxQxsxC-Cf5sAE2yOU4Yprg6IvZRErOwjhtIvVM8F1SNldaU1qAbyme83DV8O_3eGvzfcNAD8yn4WsczVZ8FwUI4TA3KqsUO_Ov5wJa-cqr1qbMufFBD2dKZ4T-khogTcx77/s640/S__5193738.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;ร้านนี้เป็นร้านแว่นที่มีคนรุม ลูกค้าเยอะตลอด ดูจากรูป จะงงๆว่า เขาซื้อเสื้อผ้ากันเหรอ มาทำไมกันเยอะแยะ จุดเด่นคือ &lt;b&gt;&lt;u&gt;ตัดเสร็จภายใน 20 นาที!!&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
แม้ค่าสายตาผมจะต้องทำให้ร้านแว่นหลายร้านสั่งจากโรงงาน แต่ที่นี่ บอกว่าเขา Stock ของเยอะมาก ดังนั้นค่าสายตาผมก็มี อีก 20 นาทีมารับ ... เลิศ!&lt;/div&gt;
&lt;div&gt;
และ ต่างชาติก็มา เพราะการที่ตัดแล้วได้วันนี้เลย บางทีเกิดเหตุแบบผมแว่นบึ้มคาหน้า จะต้องทำงาน ต้องเที่ยว ต้องเดินทางต่อ จะต้องให้รอไปถึงไหน 20 นาที คือคำตอบ&lt;/div&gt;
&lt;div&gt;
สรุปคือ ประทับใจนะครับ&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/8776904390933732399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/8776904390933732399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8776904390933732399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8776904390933732399'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2017/01/review-owndays.html' title='REVIEW ร้านแว่น OWNDAYS'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbf5pUl4p9RENF414a6UuiclQXXUjtTr3IzMzPBU5cG-CNfpzX8-jleqGyOGekuxoVxktC6aQdUVRYzY3Js3daNf-RkpDhoKYxqgE0iQkzeq87_LBKRx2EtWUZz83M7AV6R1FqNSSG3niC/s72-c/S__5185549.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-6389489180893024434</id><published>2017-01-16T18:48:00.000+11:00</published><updated>2017-01-16T18:48:00.932+11:00</updated><title type='text'>Setup Python on Windows for Mathematics with NumPy and MatPlotLib</title><content type='html'>&lt;h2&gt;
System Check&lt;/h2&gt;
Know your Windows. Is it 32-bit or 64-bit version?&lt;br /&gt;
You can check using System Properties (Press&amp;nbsp;&lt;span style=&quot;background-color: #eff0f1; color: #242729; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; white-space: inherit;&quot;&gt;⊞&amp;nbsp;+ Break&lt;/span&gt;)&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI99Npbc3Sc33W_m_j-omWRRwewrp7LvmUQ14NMMpZiZUXxEXx0Nig3MhpNvLndY5WUxjCuhhDrk8Fyj3Mwt_BIv0evS7wsN_R8Pf1RdTdB_CqL9bXzfYWAzWAm1cV0ETF4KQsGpx3DNNI/s1600/Screenshot+2017-01-16+14.20.10.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI99Npbc3Sc33W_m_j-omWRRwewrp7LvmUQ14NMMpZiZUXxEXx0Nig3MhpNvLndY5WUxjCuhhDrk8Fyj3Mwt_BIv0evS7wsN_R8Pf1RdTdB_CqL9bXzfYWAzWAm1cV0ETF4KQsGpx3DNNI/s400/Screenshot+2017-01-16+14.20.10.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
At &lt;b&gt;System Type&lt;/b&gt;, my machine is using 64-bit Windows.&lt;br /&gt;
&lt;h2&gt;
Download&lt;/h2&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Python 3.5+ from &lt;a href=&quot;https://www.python.org/downloads/&quot;&gt;Python Website&lt;/a&gt;. Pick the one for your OS (32 or 64 bits).&lt;/li&gt;
&lt;li&gt;For NumPy and MatPlotLib, we will skip compiling and building process by using the pre-compile packages from &amp;nbsp;&lt;a href=&quot;http://www.lfd.uci.edu/~gohlke/pythonlibs/&quot;&gt;UC Irvine&lt;/a&gt;. Save them in a folder, say &quot;C:\cal1&quot;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;NumPy,&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;32-bit&amp;nbsp;&lt;a href=&quot;https://www.blogger.com/null&quot; style=&quot;color: navy; text-decoration: underline; white-space: nowrap;&quot; title=&quot;[] []&quot;&gt;numpy‑1.12.0+mkl‑cp36‑cp36m‑win32.whl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;64-bit&amp;nbsp;&lt;a href=&quot;https://www.blogger.com/null&quot; style=&quot;color: navy; text-decoration: underline; white-space: nowrap;&quot; title=&quot;[] []&quot;&gt;numpy‑1.12.0+mkl‑cp36‑cp36m‑win_amd64.whl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;MatPlotLib,&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;32-bit&amp;nbsp;&lt;a href=&quot;https://www.blogger.com/null&quot; style=&quot;border-color: rgb(136, 136, 0); color: #e00000; text-decoration: underline; white-space: nowrap;&quot; title=&quot;[] []&quot;&gt;matplotlib‑1.5.3‑cp36‑cp36m‑win32.whl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ol&gt;
&lt;ol&gt;&lt;ul&gt;
&lt;li&gt;64-bit&amp;nbsp;&lt;a href=&quot;https://www.blogger.com/null&quot; style=&quot;color: navy; text-decoration: underline; white-space: nowrap;&quot; title=&quot;[] []&quot;&gt;matplotlib‑1.5.3‑cp36‑cp36m‑win_amd64.whl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;h2&gt;
Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Double click Python installation file&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Click on Add &lt;b&gt;Python 3.x to PATH&lt;/b&gt;&lt;b&gt;&lt;img alt=&quot;Related image&quot; height=&quot;237&quot; src=&quot;http://loadbalancerblog.com/sites/default/files/images/image003.jpg&quot; width=&quot;400&quot; /&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;And click &lt;b&gt;Install Now&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Open a command-line interface (CLI),&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Press&amp;nbsp;&lt;span style=&quot;background-color: #eff0f1; color: #242729; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px;&quot;&gt;⊞&lt;/span&gt;&amp;nbsp;(Windows key) and type &lt;b&gt;cmd&lt;/b&gt;,&lt;b&gt; &lt;/b&gt;press &lt;b&gt;Enter&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Change your current directory to C:\cal1 (where you saved NumPy and MatPlotLib)&lt;br /&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code style=&quot;background-color: transparent; border-radius: 3px; border: 0px; color: inherit; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; padding: 0px;&quot;&gt;cd c:\cal1&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Run Python Package manager (PIP) to install these packages&lt;br /&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code style=&quot;background-color: transparent; border-radius: 3px; border: 0px; color: inherit; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; padding: 0px;&quot;&gt;pip install numpy‑1.12.0+mkl‑cp36‑cp36m‑win_amd64.whl&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;and&lt;br /&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code style=&quot;background-color: transparent; border-radius: 3px; border: 0px; color: inherit; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; padding: 0px;&quot;&gt;pip install matplotlib‑1.5.3‑cp36‑cp36m‑win_amd64.whl&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;h2&gt;
That&#39;s it!&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
Installation failure could happen due to many reasons. The most common one is typing mistake. Check your spelling for all these commands. Or if you have any questions, drop it in the comment section below.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/6389489180893024434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/6389489180893024434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/6389489180893024434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/6389489180893024434'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2017/01/setup-python-on-windows-for-mathematics.html' title='Setup Python on Windows for Mathematics with NumPy and MatPlotLib'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI99Npbc3Sc33W_m_j-omWRRwewrp7LvmUQ14NMMpZiZUXxEXx0Nig3MhpNvLndY5WUxjCuhhDrk8Fyj3Mwt_BIv0evS7wsN_R8Pf1RdTdB_CqL9bXzfYWAzWAm1cV0ETF4KQsGpx3DNNI/s72-c/Screenshot+2017-01-16+14.20.10.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-4538017844014796315</id><published>2016-12-05T16:57:00.001+11:00</published><updated>2016-12-05T16:57:22.665+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bot"/><category scheme="http://www.blogger.com/atom/ns#" term="chatbot"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="messenger"/><category scheme="http://www.blogger.com/atom/ns#" term="nodejs"/><title type='text'>ทำ Facebook Chatbot - Part 1</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH8nKHmpRZHV-EugFE0QmtKKPOs91o3ZhchEHOrOyFcj5nkkhJ_m2VMlN6cLUntYeZ0hFoYtgcdCZxX1nf0SddtMYSfxp3-AucHfkqtodJQdpfWvYtmqxW60l-5rW2mc6M_mAouAi8eE2t/s1600/bot.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH8nKHmpRZHV-EugFE0QmtKKPOs91o3ZhchEHOrOyFcj5nkkhJ_m2VMlN6cLUntYeZ0hFoYtgcdCZxX1nf0SddtMYSfxp3-AucHfkqtodJQdpfWvYtmqxW60l-5rW2mc6M_mAouAi8eE2t/s400/bot.jpg&quot; width=&quot;223&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
Chatbot กำลังเป็นที่นิยมในยุคที่ผู้คน Chat ระหว่างเดินมากกว่าการคุยโทรศัพท์กัน เพราะการใช้งานที่สะดวก เราใช้ Chat กับทุกสิ่งอย่าง ถ้าเลือกได้ ก็ไม่อยากสลับออกไปใช้ App อื่น และ Social Network Platform ต่าง ๆ ก็ออกเครื่องมือสำำหรับการทำเรื่องนี้ออกมา LINE ที่คนไทยนิยมก็มี LINE Bot API และ Facebook Messenger Platform ซึ่งใน Blog นี้จะขอนำเสนอ Facebook Messenger Platform เบื้องต้น&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Facebook Messenger Platform&lt;/h2&gt;
เป็น platform ที่ทำให้การสื่อสารกับลูกเพจได้หลากหลาย Bot สามารถสื่อสารได้ทั้งข้อความ Integrate platform ที่รวมถึง media ต่างๆ รูป เสียง URL ฯลฯ ซึ่งเราอาจนำมาใช้สำหรับการขายของผ่าน Bot ตั้งแต่ต้นยันจบการขาย การสั่งจองสินค้าบริการกันเลย แล้วแต่จะสร้างสรรค์ แต่แน่นอนว่าต้องมีงานส่วนอื่น ๆ มาประกอบด้วย เช่น การให้ Bot อ่าน/เขียน ฐานข้อมูล วิเคราะห์ recommendation ฯลน ก็อีก แล้วแต่สร้างสรรค์เลยครับ platform มีแล้ว&lt;br /&gt;
&lt;h2&gt;
Getting Started&lt;/h2&gt;
&lt;div&gt;
เนื่องจาก &lt;a href=&quot;https://developers.facebook.com/docs/messenger-platform&quot;&gt;Tutorial &lt;/a&gt;&lt;span id=&quot;goog_1370889054&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1370889055&quot;&gt;&lt;/span&gt;&lt;a href=&quot;https://www.blogger.com/&quot;&gt;&lt;/a&gt;ของ Facebook ทำมาได้ดีอยู่แล้ว ท่านอาจอ่านจาก&amp;nbsp;&lt;a href=&quot;https://developers.facebook.com/docs/messenger-platform&quot;&gt;Tutorial&amp;nbsp;&lt;/a&gt;โดยตรงแล้วทำตามเลยก็ได้ แต่เพราะตอนที่ผมทำเอง เจอจุดที่เราท่านอาจพลาดกันง่าย ๆ จึงขอนำประสบการณ์มาเขียนเป็นวิทยาทาน&lt;br /&gt;
ภาพรวมของระบบคือ เรามีหน้าที่เขียน Bot ซึ่งก็คือ Web App บน Web Server ที่ Listen ที่ Port หนึ่ง ๆ ในโค้ดตัวอย่างที่ Facebook ให้ใช้ Node แล้ว Listen ที่ Port 5000 โดยเมื่อมีข้อความส่งมาทาง Messenger ทาง Facebook จะเรียก Web App ของเราที่ Webhook URL ที่ลงทะเบียนไว้กับ Facebook&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPAuzLs8cEiVapICsddnCcy70TLZsNekfpRH_uwwjn9zInyGN0qjYJiQMi5S4Pi9283XHbjHCnrlsXfAULtHhQnG1LM23BGdiAsd6PtyF0qXL2AlQvmV5FtvGWxZN9cj5XciQa_zFedTY6/s1600/bot-arch.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPAuzLs8cEiVapICsddnCcy70TLZsNekfpRH_uwwjn9zInyGN0qjYJiQMi5S4Pi9283XHbjHCnrlsXfAULtHhQnG1LM23BGdiAsd6PtyF0qXL2AlQvmV5FtvGWxZN9cj5XciQa_zFedTY6/s640/bot-arch.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;
สิ่งที่ต้องมี&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://node.js/&quot;&gt;node.js&lt;/a&gt; - สำหรับรัน Chatbot code ในที่นี่ ใช้ JavaScript (แต่ท่านจะใช้เครื่องมืออะไรก็ได้ ขอให้สื่อสารกันตาม API ที่ Facebook กำหนด)&lt;/li&gt;
&lt;li&gt;Webhook - เมื่อมีข้อความจาก messenger ส่งมาให้ Bot ทาง Facebook จะเรียก URL ที่เราลงทะเบียนไว้ พร้อมส่งข้อมูลต่างๆมาให้ ตัว URL นี้คือ Web Hook ถ้าท่านมี Web Host สักตัวก็สะดวกแต่จะลำบากตอน Code เพราะต้องคอย On-line ตลอด หรือ ท่านสามารถทำให้เครื่องที่ท่านทำงานมี Web Server ที่สามารถเปิดให้โลกภายนอกเข้ามาได้ แต่ผมมีปัญหานี้คือ ไม่มีเครื่อง On-line (เช่นบน Cloud) และ อยาก Code ที่เครื่องที่ทำงาน เพราะเครื่องมือครบ ก็ Tunnel เอาได้เลย วิธีการผมเขียนเอาไว้ที่ &lt;a href=&quot;http://mchayapol.blogspot.com/2016/10/cloud-tunneling-dev.html&quot;&gt;Blog&lt;/a&gt; นี้&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/fbsamples/messenger-platform-samples&quot;&gt;Code ตัวอย่าง จาก Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Facebook Page สำหรับให้ Bot นี้ไว้สื่อสาร เพราะ ณ วันนี้ยังผูก Bot กับ Profile ส่วนตัวไม่ได้&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
ขั้นตอนการทำ&lt;/h2&gt;
&lt;h3&gt;
1. เตรียม Node.js Code&lt;/h3&gt;
&lt;div&gt;
เมื่อได้ Code ตัวอย่างมาแล้ว ให้เก็บไว้ที่ directory อะไรก็ได้ เช่น C:\codes\facebook-bot&lt;br /&gt;
&lt;h4&gt;
1.1 App Secret&lt;/h4&gt;
&lt;div&gt;
ไปที่หน้า &lt;a href=&quot;https://developers.facebook.com/apps&quot;&gt;Facebook App&lt;/a&gt;&amp;nbsp;แล้วเลือกที่ Settings / Basic แล้วมองหา App Secret เลือก Show (เพราะเดิมจะเป็น ******) เราต้องใช้ App Secret นี้ในการ config bot เรา สมมติ xxxxxxx&lt;/div&gt;
&lt;h4&gt;
1.2 Page Access Token&lt;/h4&gt;
&lt;div&gt;
ที่หน้า&amp;nbsp;&lt;a href=&quot;https://developers.facebook.com/apps&quot;&gt;Facebook App&lt;/a&gt;&amp;nbsp;แล้วเลือกที่ Messenger ที่ส่วน Token Generation ให้เลือก Page ที่เราต้องการผูก Bot ไว้ เราจะได้ Page Access Token มา สมมติ yyyyyyy&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWHEKHycRQ8NAEu8fBtuabEnszmaFgJMNnpmmXH00TRLoVJajQ6QCsDW9_Zdkf3SMu0Xr0JlDX_UgouPRX_2r0_2saHwKoX6JFuyYbYFpKTLuR30Df7rgFWYN5BOkLERMDNUAEt247LTOt/s1600/fbb13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWHEKHycRQ8NAEu8fBtuabEnszmaFgJMNnpmmXH00TRLoVJajQ6QCsDW9_Zdkf3SMu0Xr0JlDX_UgouPRX_2r0_2saHwKoX6JFuyYbYFpKTLuR30Df7rgFWYN5BOkLERMDNUAEt247LTOt/s640/fbb13.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;
1.3 &amp;nbsp;Validation Token&lt;/h4&gt;
&lt;div&gt;
ข้อความอะไรอะไรก็ได้ครับ ตัวอย่างตาม Facebook ใช้ my_voice_is_my_password_verify_me เอาตามนี้ละกัน&lt;/div&gt;
&lt;h4&gt;
1.4 Server URL&lt;/h4&gt;
&lt;div&gt;
สั่งคำสั่งที่ Command Line เรียก Ngrok ให้ tunnel port 5000&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: black;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;ngrok http -bind-tls=true site.dev:5000&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
แล้วเราจะได้ Forwarding address มา เช่น&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;orphans: 2; text-align: start; text-indent: 0px; widows: 2;&quot;&gt;
&lt;div style=&quot;background-color: black;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; color: white; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: small; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; color: white; font-family: courier new, courier, monospace; font-size: small; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: white; font-family: courier new, courier, monospace;&quot;&gt;https://e77d10c7.ngrok.io -&amp;gt; site.dev:5000&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h4&gt;
1.5 เตรียม Config&lt;/h4&gt;
&lt;/div&gt;
ใน directory config จะมี default.json ให้ปรับข้อมูลตามที่เราได้มา&lt;br /&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;div style=&quot;color: black; font-size: medium; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &quot;appSecret&quot;: &quot;xxxxxxx&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-size: medium; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &quot;pageAccessToken&quot;: &quot;yyyyyyy&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-size: medium; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &quot;validationToken&quot;: &quot;my_voice_is_my_password_verify_me&quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-size: medium; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &quot;serverURL&quot;: &quot;https://e77d10c7.ngrok.io&quot;&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;h4&gt;
1.6 แล้วใช้ Command Prompt เพื่อรัน app.js&lt;/h4&gt;
&lt;div style=&quot;background-color: black;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: white; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;c:\codes\facebook-bot\node app.js&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
จะเห็นข้อความว่า&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: black;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: white; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;Node app is running on port 5000&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
2. สร้าง Facebook App และ Facebook Page&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;สร้าง&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://developers.facebook.com/apps&quot; style=&quot;background-color: white; color: #365899; cursor: pointer; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, &amp;quot;lucida grande&amp;quot;, sans-serif; font-size: 14px; text-decoration: none;&quot;&gt;Facebook App&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;และ&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.facebook.com/pages/create&quot; style=&quot;background-color: white; color: #365899; cursor: pointer; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, &amp;quot;lucida grande&amp;quot;, sans-serif; font-size: 14px; text-decoration: none;&quot;&gt;Page&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;หรือใช้ของเดิมที่เคยทำไว้แล้ว ไปที่หน้า Dashboard และเลือก Product Settings แล้วเลือก &quot;Add Product&quot; และ &quot;Messenger&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3E9nuXv-xi5Dhq4b8kwmNgJqJDVlvuk3FidNBk8Z04cPrAiDnw2Z9ufe_4MoR6EOv2N8MLI2JHpvzRyY5cLhy1ITIfRFeE51qtRApvCNE54q4DKfJGrAlvBkW74HBWTS3NGyuHWgDMnYD/s1600/fbb10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3E9nuXv-xi5Dhq4b8kwmNgJqJDVlvuk3FidNBk8Z04cPrAiDnw2Z9ufe_4MoR6EOv2N8MLI2JHpvzRyY5cLhy1ITIfRFeE51qtRApvCNE54q4DKfJGrAlvBkW74HBWTS3NGyuHWgDMnYD/s640/fbb10.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3E9nuXv-xi5Dhq4b8kwmNgJqJDVlvuk3FidNBk8Z04cPrAiDnw2Z9ufe_4MoR6EOv2N8MLI2JHpvzRyY5cLhy1ITIfRFeE51qtRApvCNE54q4DKfJGrAlvBkW74HBWTS3NGyuHWgDMnYD/s1600/fbb10.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/ol&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;background-color: white; color: #20375f; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 16px;&quot;&gt;3.ตั้งค่า Webhook&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, &amp;quot;lucida grande&amp;quot;, sans-serif; font-size: 14px; margin-bottom: 24px;&quot;&gt;
ในส่วน Webhooks เลือก &quot;Setup Webhooks&quot;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZYjy5IVOEmAulujuN_yCyjufk9nC9PF5ahCGAty6wkOp0CmvXrqv5XH0_iYTPQgImlhvbtl2rQqWPzLZisiQMueOViV9m7EoQeKN4Kc_OPfp-TNmi-tE3O1NUDp6hTfkbwBJ_QgmBcqQr/s1600/fbb11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;406&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZYjy5IVOEmAulujuN_yCyjufk9nC9PF5ahCGAty6wkOp0CmvXrqv5XH0_iYTPQgImlhvbtl2rQqWPzLZisiQMueOViV9m7EoQeKN4Kc_OPfp-TNmi-tE3O1NUDp6hTfkbwBJ_QgmBcqQr/s640/fbb11.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, &amp;quot;lucida grande&amp;quot;, sans-serif; font-size: 14px; margin-bottom: 24px;&quot;&gt;
ใส่ URL สำหรับ webhook ในกรณีที่ใช้ Ngrok แบบผม URL จะเป็น &lt;span style=&quot;color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif;&quot;&gt;https://e77d10c7.ngrok.io ซึ่งทุกครั้งที่รัน ngrok URL จะเปลี่ยนไปเรื่อย ๆ (ถ้าจ่ายค่าบริการ จะ lock URL ไว้ได้)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; margin-bottom: 24px;&quot;&gt;
&lt;span style=&quot;color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;จากนั้น ก็ใส่ Verify Token (คล้าย password แบบฉาบฉวย ใส่อะไรก็ได้ครับ) และ เลือก&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;color: #42b72a; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px;&quot;&gt;messages&lt;/code&gt;&lt;span style=&quot;color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;และ&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;color: #42b72a; font-family: Menlo, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px;&quot;&gt;messaging_postbacks&lt;/code&gt;&lt;span style=&quot;color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;ในส่วน&lt;/span&gt;&lt;span style=&quot;color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;Subscription Fields.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; margin-bottom: 24px;&quot;&gt;
&lt;span style=&quot;color: #4b4f56; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;lucida grande&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;แล้วกด Verify and Save (ขั้นตอนนี้จะผ่านได้ก็ต่อเมื่อมี webhook และรัน node แล้ว)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8Qk90lxGiNQBdQFxV16O6VvAnVpSi3McJutZTHjsTNRxR6Wol-YUzefFhhqWLXJdvafkzLyauy6PwqXvyfhxkzK43JzZuiPZ39BYrfQ-mD_X6iLiO_cB75O8z3wBPtrp71I6u2NgSQH85/s1600/fbb12.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;380&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8Qk90lxGiNQBdQFxV16O6VvAnVpSi3McJutZTHjsTNRxR6Wol-YUzefFhhqWLXJdvafkzLyauy6PwqXvyfhxkzK43JzZuiPZ39BYrfQ-mD_X6iLiO_cB75O8z3wBPtrp71I6u2NgSQH85/s640/fbb12.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, &amp;quot;lucida grande&amp;quot;, sans-serif; margin-bottom: 24px;&quot;&gt;
&lt;div style=&quot;font-size: 14px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;ถึงขั้นนี้ ต้อง Verify and Save ผ่านนะครับ!!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #4b4f56; font-size: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;color: #4b4f56; font-size: 14px;&quot;&gt;
4. ทดลองใช้งาน&lt;/h3&gt;
&lt;div style=&quot;color: #4b4f56; font-size: 14px;&quot;&gt;
ลองเปิด Chat แต่ Bot จะใช้งานได้กับ Admin page เท่านั้น คนทั่วไปยังใช้ไม่ได้จนกว่าจะส่งงานให้ Facebook ตรวจสอบก่อน ข้อความที่พิมพ์เข้าไป ถ้าไม่ตรงกับ keyword ที่ Code ตัวอย่างจับได้ Bot จะ Echo กลับมา เช่น Hello สวัสดี แต่ถ้าตรงกับ Keyword ได้แก่ image, gif, audio, video, file, button, generic, receipt, quick reply, read receipt, typing on, typing off, account linking จะมีการตอบเฉพาะตาม Code ที่แสดงให้เห็นว่า Bot ทำอะไรได้บ้าง&lt;/div&gt;
&lt;div style=&quot;color: #4b4f56; font-size: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #4b4f56; font-size: 14px;&quot;&gt;
ใน Part 2 จะมาดูใน Code นี้กัน&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #4b4f56; font-size: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/4538017844014796315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/4538017844014796315' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/4538017844014796315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/4538017844014796315'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2016/12/facebook-chatbot-part-1.html' title='ทำ Facebook Chatbot - Part 1'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH8nKHmpRZHV-EugFE0QmtKKPOs91o3ZhchEHOrOyFcj5nkkhJ_m2VMlN6cLUntYeZ0hFoYtgcdCZxX1nf0SddtMYSfxp3-AucHfkqtodJQdpfWvYtmqxW60l-5rW2mc6M_mAouAi8eE2t/s72-c/bot.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-3268501898433773827</id><published>2016-10-28T12:05:00.002+11:00</published><updated>2017-05-28T16:10:01.236+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="http"/><category scheme="http://www.blogger.com/atom/ns#" term="https"/><category scheme="http://www.blogger.com/atom/ns#" term="nat"/><category scheme="http://www.blogger.com/atom/ns#" term="ngrok"/><category scheme="http://www.blogger.com/atom/ns#" term="tunnel"/><category scheme="http://www.blogger.com/atom/ns#" term="webdevelopment"/><category scheme="http://www.blogger.com/atom/ns#" term="webhook"/><title type='text'>Cloud Tunneling เปิดเครื่อง Dev สู่โลกภายนอก</title><content type='html'>สมมติเราอยากรัน Web Server ที่เครื่องของเรา เช่น เพื่อทดสอบ API ที่ต้องใช้ Webhook เช่น Facebook Messaging Platform แต่ติดเงื่อนไขต่าง ๆ เช่น&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;ไม่มีเครื่องบน Cloud ที่มี Public IP&lt;/li&gt;
&lt;li&gt;เครื่องที่ใช้ทำงานอยู่หลัง Firewall หรือ NAT&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
ทางออกคือ tunnel ออกไป แต่ใครจะเป็นฝั่งปลายทางที่จะรับ HTTP/HTTPS request แล้วส่งต่อมาให้เราหล่ะ? &lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;https://ngrok.com/&quot;&gt;ngrok &lt;/a&gt;&lt;/span&gt;&lt;/b&gt;เป็นทางเลือกที่ดีครับ โดยเจ้า ngrok จะทำการ เชื่อมระหว่าง ngrok server กับเครื่องที่เราทำงานโดยตรง เช่นถ้าเราต้องการ run NodeJS app port 5000 ด้วย HTTPS เท่านั้น ก็สั่ง&lt;/div&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code style=&quot;background-color: transparent; border-radius: 3px; border: 0px; color: inherit; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; padding: 0px;&quot;&gt;ngrok http -bind-tls=true localhost:5000&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
แล้วเราจะได้ Tunnel URL มาเช่น https://b1234as.ngrok.io เราก็สามารถเอาเจ้า URL ไปลงทะเบียนกับ webhook ได้ เมื่อมี HTTP/HTTPS request ที่ยิงมาจาก webhook เราก็จะได้รับเหมือน web request ทั่วไป&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://ngrok.com/static/img/webhooks.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://ngrok.com/static/img/webhooks.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Downsides&lt;/h3&gt;
&lt;div&gt;
วิธีนี้ก็มีข้อเสียเหมือนกัน คือ&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;ข้อมูลของคุณวิ่งผ่าน ngrok ทั้งหมด ต้องไม่ลืมว่านี่ไม่ใช่แค่ redirect แต่เป็น tunnel เลยแต่การนี้คือเพื่อ dev พอจะขึ้น production ก็ต้องเปิด public IP ในที่สุด&lt;/li&gt;
&lt;li&gt;URL เปลี่ยนทุกครั้งที่ run ngrok ทำให้ต้องไล่ update ทะเบียน webhook แน่นอนว่า คุณจ่าย $5 ต่อเดือนเพื่อจอง domain ได้&lt;/li&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/3268501898433773827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/3268501898433773827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3268501898433773827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3268501898433773827'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2016/10/cloud-tunneling-dev.html' title='Cloud Tunneling เปิดเครื่อง Dev สู่โลกภายนอก'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-8998209422824754571</id><published>2016-10-27T13:36:00.000+11:00</published><updated>2016-10-27T13:45:11.366+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cardio boxing"/><category scheme="http://www.blogger.com/atom/ns#" term="kickboxing"/><category scheme="http://www.blogger.com/atom/ns#" term="muay thai"/><category scheme="http://www.blogger.com/atom/ns#" term="sixpack"/><title type='text'>ทำไมถึงซ้อมมวย?</title><content type='html'>เมื่อถึงจุดหนึ่งที่ท่านเสพติดการออกกำลังกาย คือ ถ้าอยู่เฉย ๆ ไม่ได้รู้สึกออกแรงพาลจะหงุดหงิดเอา ท่านจะลองกิจกรรมต่าง ๆ และสนุกไปกับมัน แต่ก็มีจุดเบื่อได้&lt;br /&gt;
&lt;br /&gt;
เหตุที่ Fitness Centre มี Class ต่าง ๆ เพราะเพื่อให้สมาชิกไม่เบื่อ ก่อนหน้านี้ผมเข้า Body Pump ของ Fitness First ประจำ แต่หลัง ๆ มานี้ เบื่อเสียงั้น กลับไปเล่น Weight เอง แล้ว Cardio แบบอื่น ๆ&lt;br /&gt;
&lt;br /&gt;
ที่ว่ามานี้ ผมมาจบตรงที่ ทุกวันนี้ มวย ก็ยังเป็นกิจกรรมที่ผมโปรดอยู่ดี ดังนั้นผมขอ *อวย* มวยให้เต็มที่เลยละกัน&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/CrfPDuF0SC8/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/CrfPDuF0SC8?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
ข้อดีของการซ้อมมวย&lt;/h2&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;กระดูกแข็งแรง&lt;/u&gt;&lt;/b&gt; สร้างมวลกระดูก เพราะมีการกระทบ ชก เตะ แน่นอนว่าต้องมีเกิดกระดูกแตกบาง ๆ จากการปะทะ (Microfracture) ทำให้ร่างกายสร้างกระดูกมาทดแทนให้กระดูกแข็งแรงขึ้นเรื่อย ๆ&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;สร้างกำลังใจ&lt;/u&gt;&lt;/b&gt; การชกต่อเนื่องให้ครบยก ไม่ว่าจะ 2 หรือ 3 นาที นั้น ยากจริง ไม่ลองไม่รู้ว่าทำไม 2-3 นาทีนั้นมันช่างยาวนาน หายใจไม่ทัน เหนื่อยอยากล้มลงไปนอน แต่ถ้าผ่านไปได้ จะรู้สึกเหมือนได้รับรางวัล (Rewarding) เป็นการสร้างนิสัยให้ไม่เกรงกับการออกกำลังกายหนัก ๆ&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;หัวใจแข็งแรง&lt;/u&gt;&lt;/b&gt; ในระหว่างยกนั้น หัวใจทำงานเต็มทีสูบฉีดเลือดทั่วร่างกาย และ ให้พัก Heart Rate ที่พุ่งสูง แล้วพักสั้น เป็น Interval Training แนวหนึ่ง&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;ฝึกการผสานการทำงานของทุกส่วนในร่างกาย&lt;/u&gt;&lt;/b&gt; มวยเหมือนว่าใครก็ยืนขึ้นแล้วทำท่าชก ๆ ได้ แต่คนที่ชกเป็น กับ คนเพิ่งฝึก ท่าทางต่างกันลิบลับ เช่นการต่อย ไม่ได้ออกหมัดจากหัวไหล่ แต่บิดส่งมาตั้งแต่ปลายเท้า ผ่านเข่า ผ่านสะโพก ลำตัว หัวไหล่ แล้วส่งออกที่แขน Co-ordination นี้ถ้าทำได้จนเป็นธรรมชาติ ก็มีผลต่อกิจกรรม หรือ กีฬาอื่น ๆ ด้วย&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;ฝึกสติ&lt;/u&gt;&lt;/b&gt; ตอบสนองต่อคำสั่ง สั่งเตะ สั่งต่อย สั่งหลบ พลาดโดนตบ แม้ฟังแล้วออกซาดิสไปหน่อย แต่การซ้อมมวยที่ไม่ได้แข่งขันจริง ใช้อุปกรณ์ป้องกัน นุ่ม ๆ ทั้งนั้น การกระทบบ้าง ก็ทำให้รู้สึกสดชื่นดี&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;สร้างความมั่นใจ&lt;/u&gt;&lt;/b&gt; คือไม่ได้มั่นใจว่าจะไปต่อยกับใคร แต่มั่นใจว่า ถ้าต้องสู้กัน หนีดีกว่า ต่อยกันจริง ๆ มันเจ็บ แต่ถ้าต้องสู้ ก็บ่ย่าน&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;เสียงคำรามสุด Cool&lt;/u&gt;&lt;/b&gt; ขอยกตัวอย่างโดยเฉพาะคุณผู้หญิง การคำราม (Grunting) แบบเท่ ๆ ทำให้คุณดูเท่มาก ยกตัวอย่าง&amp;nbsp;Michelle Waterson ลูกครึ่งไทยอเมริกันที่เป็นดาวใน UFC ไปแล้ว&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;/ol&gt;
&lt;ol&gt;&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/8PVdQZnH14I/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/8PVdQZnH14I?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
ข้อเสียของการซ้อมมวย&lt;/h2&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;พลาดท่า&lt;/u&gt;&lt;/b&gt; เจ็บนะครับ เช่นการ Hook หรือ Uppercut แล้วข้อมือไม่ตรง ก็เอาเส้นเอ็นรับแรงกระแทกเอ็นฉีก พักกันเป็นเดือนเลยทีเดียว หรือการเตะที่บิดลำตัวดี แต่ขาไม่บิดตาม เอ็นเข่าก็เจ็บด้วย&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;ไม่ค่อยได้ Biceps&lt;/u&gt;&lt;/b&gt; อิอิ อันนี้ไม่ค่อยจำเป็นในมวย แต่ถ้าอยากกล้ามสวยทั่ว ๆ ก็ต้องยก Weight เพิ่มนะครับ&lt;/li&gt;
&lt;li&gt;อ่าาาา.. นึกไม่ออก ข้อเสียน้อยจริง&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
ทิ้งท้าย&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioDdJB_SXzExv2tH0-CQKDXpOrYatHPWPuIpjVfWOg4Iz-n_Dn-wSE-mxMJpEMq8Q6e2MJEMf04quUPMfbSmnYBkxxhyphenhyphen4KfKQATMP3PO_kbc68zn0xJAii1MLv-zbWLyCkGHdCGG8o_1pT/s1600/14463131_1796403723905059_3987667390856125493_n.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;199&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioDdJB_SXzExv2tH0-CQKDXpOrYatHPWPuIpjVfWOg4Iz-n_Dn-wSE-mxMJpEMq8Q6e2MJEMf04quUPMfbSmnYBkxxhyphenhyphen4KfKQATMP3PO_kbc68zn0xJAii1MLv-zbWLyCkGHdCGG8o_1pT/s200/14463131_1796403723905059_3987667390856125493_n.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
ขอฝากชมรม &lt;a href=&quot;https://www.facebook.com/authaiboxingclub/?fref=ts&quot;&gt;AU Muay Thai&lt;/a&gt; ที่นักศึกษาผู้รักมวยไทยร่วมกันก่อตั้ง ผมก็เป็นอาจารย์แก่ ๆ ไปช่วย ๆ กันตั้งชมรม ฝึกพื้นฐานให้นักมวยหน้าใหม่กับเขา ว่างแวะมาทักทายกันครับ&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/8998209422824754571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/8998209422824754571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8998209422824754571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8998209422824754571'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2016/10/blog-post_27.html' title='ทำไมถึงซ้อมมวย?'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/CrfPDuF0SC8/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-1113579230757674651</id><published>2016-10-24T12:20:00.001+11:00</published><updated>2016-10-24T12:20:26.323+11:00</updated><title type='text'>รวมศัพท์คอมพิวเตอร์ที่คนไทยมักออกเสียงผิด</title><content type='html'>&lt;br /&gt;
&lt;div&gt;
เมื่อสื่อสารกับนานาชาติ เขาจะได้เข้าใจ ผมจะรวบรวมคำที่นักคอมพิวเตอร์มักพูดผิดในวงการไว้ในหน้านี้เรื่อย ๆ ครับ&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Factory&lt;br /&gt;อ่านว่า แฟค-ทรี&lt;br /&gt;ไม่ใช่ แฟค-ทอ-รี&lt;/li&gt;
&lt;li&gt;Listener - เช่น EventListener&lt;br /&gt;อ่านว่า ลิส-ซึน-เนอ&lt;br /&gt;ไม่ใช่ ลิส-&lt;b&gt;&lt;u&gt;เทน&lt;/u&gt;&lt;/b&gt;-เนอ&lt;/li&gt;
&lt;li&gt;Login&lt;br /&gt;มาจากการ Log เข้า (in)&lt;br /&gt;อ่านว่า ล้อก-อิน&lt;br /&gt;ไม่ใช่ โล-จิ้น&lt;br /&gt;และ Logout ไม่อ่านว่า โล-เจ๊า&lt;/li&gt;
&lt;li&gt;Value&lt;br /&gt;อ่านยากจริง ๆ คำนี้&lt;br /&gt;อ่านว่า ฟาว-ยู่ / แฟ-ลิ-อู่&lt;br /&gt;ไม่ใข่ แว-ลู่ / วา-ลู่ / วา-ยู่ (อันนี้ถ้าไม่ออก V ให้ชัดเจน จะไม่เพราะ)&lt;/li&gt;
&lt;li&gt;Volume&lt;br /&gt;เช่นเดียวกัน คล้าย Value&lt;br /&gt;อ่านว่า ฟอ-ยุ่ม / ฟอ-ลิ-อุ่ม&lt;br /&gt;ไม่ใช่ วอ-ลุ่ม / วอ-ยุ่ม (ก็เช่นเดียวกัน ถ้าจะยุ่มแล้ว ก็ขอ V ให้ฟัด ๆ หน่อยนะครับ)&lt;/li&gt;
&lt;li&gt;Error&lt;br /&gt;อ่านว่า เอ-เรอ&lt;br /&gt;ไม่ใช่ เออ-เร่อ&lt;/li&gt;
&lt;li&gt;Leopard - ชื่อ MacOS รุุ่นหนึ่ง&lt;br /&gt;อ่านว่า เลพ-เพริด&lt;br /&gt;ไม่ใช่ ลี-โอ-พารด&lt;/li&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/1113579230757674651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/1113579230757674651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1113579230757674651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1113579230757674651'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2016/10/blog-post_24.html' title='รวมศัพท์คอมพิวเตอร์ที่คนไทยมักออกเสียงผิด'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-8747333952109486582</id><published>2016-10-20T14:24:00.000+11:00</published><updated>2016-10-20T14:25:58.153+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="personal development"/><category scheme="http://www.blogger.com/atom/ns#" term="ธรรมะ"/><category scheme="http://www.blogger.com/atom/ns#" term="พัฒนาตนเอง"/><title type='text'>เอาชนะความโกรธ</title><content type='html'>ไม่ต้องระงับ ไม่ต้องกำหมัดแน่น ไม่ต้องหายใจแรง ไม่ต้องกัดฟันทน ไม่ต้องถลึงตา&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
แต่ ให้หัดมองว่า มีเด็กชาย/เด็กหญิง ที่ชื่อเดียวกับคุณกำลังโกรธอยู่ เด็กน้อยนั้นหันมาบอกคุณว่า&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&quot;โกรธจัง หนูอยากจะตบมันให้คว่ำสักที&quot;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
คุณเองซึ่งกำลังมองเด็กน้อยนี้อยู๋ ก็มองอย่างเข้าใจ ว่าทำไมเด็กน้อยนี้ถึงได้โกรธนะ เพราะอะไร เพียงวูบที่คุณมองออกว่า ความโกรธเป็นสิ่งที่เด็กคิดขึ้นมาเอง มันไม่ได้มีสาระอะไรมากนักหรอก คุณค่อยอธิบายให้เด็กฟังว่า ไม่ต้องไปโมโหโกรธา&lt;/div&gt;
&lt;div&gt;
คุณเองพลันจะหายโกรธแล้วมองคู่กรณีคุณด้วยเมตตามากขึ้น จบกันไป จากกันไป ไม่ต้องเอาเขามาใส่ในความคิดเราอีกวัน เดือน ปี หลังจากนี้ ไม่จำเป็นต้องคิดถึงความเจ็บแค้นนี้อีก&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ถ้าคุณ Exercise ความโกรธบ่อย ๆ ทุกครั้งที่คุณโมโห คุณแสดงออก โลกหยุดนิ่งเพราะตะลึงงันกับอีบ้าที่วีนลั่นอยู่กลางห้าง นั่นเป็นรางวัลที่คุณได้รับ ไม่ต่างอะไรกับ Reward System ยิ่งคุณได้รางวัล คุณยิ่งทำมัน แต่ในเมื่อเห็นแล้วว่า มันไม่ดี อยากฝึกเพื่อหยุดนิสัยขี้โมโหนี้ ก็ต้องฝึกมองเด็กน้อยให้ทัน ยิ่งฝึกมาก ยิ่งมีสติทัน ก็ไม่ต้องโกรธแล้ว&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/8747333952109486582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/8747333952109486582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8747333952109486582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8747333952109486582'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2016/10/blog-post_20.html' title='เอาชนะความโกรธ'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-1023285371156156813</id><published>2016-10-05T00:55:00.001+11:00</published><updated>2016-10-05T16:39:55.972+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="nobiai ยิงธนู มรรค เป้าหมายในชีวิต"/><title type='text'>เป้าหมายในชีวิต การยิงธนู และ มรรค</title><content type='html'>&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;เราได้ยินได้อ่านการพูดถึงคุณค่าของทัศนคติ มากกว่า IQ หรือคะแนนสอบควบคู่กันมากับการพยายามเร่งเร้าให้นักเรียนสอบได้ดี และ พนักงานทำงานให้บรรลุเป้าหมาย แต่แทนที่จะบอกเขาว่าทำอย่างไร กลับเอาเป้าหมายมากดดัน ไม่ต่างจากการวัดผลด้วย KPI ล้วน ๆ แล้วรู้หรือไม่ว่าระหว่างทางนั้น นักเรียน หรือ พนักงานคนนั้น ได้พยายามทำอะไรแล้วบ้าง?&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXoFqsx7UHmvCLuA49CdJCd5ikg4hYMorCssP8BrHb3M0YPzI5206a0s7NIHOCTYVb-1JYogpaa7emr4SxmiRL15Z8VykIm_1_7Nln6v9yS4VTCaVvQ31NGJmpmmr0gTjCJV5Vtgk_SKig/s1600/lucesnice-ii.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;311&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXoFqsx7UHmvCLuA49CdJCd5ikg4hYMorCssP8BrHb3M0YPzI5206a0s7NIHOCTYVb-1JYogpaa7emr4SxmiRL15Z8VykIm_1_7Nln6v9yS4VTCaVvQ31NGJmpmmr0gTjCJV5Vtgk_SKig/s320/lucesnice-ii.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 12px;&quot;&gt;เอาว่า ผมขอละเรื่องที่ว่าโลกนี้สนใจผลลัพท์มากกว่าแนวทางเอาไว้ก่อน มาดูคำถามที่แสนยิ่งใหญ่ &lt;b&gt;&lt;u&gt;เป้าหมายในชีวิต&lt;/u&gt;&lt;/b&gt; (โอ้โห) แต่ละคนมีเป้าหมายไม่เหมือนกัน จะทางโลกทางธรรมก็ตาม หากท่านตั้งใจจะบรรลุเป้าหมาย ก็ต้องมามองกันว่า ทำอย่างไร ลองมาปรับวิธีการทำงาน การใช้ชีวิตกันดูไหม เสมือนปรับหางเสือเรือให้ตรงคราเดียว แล้วมันจะแล่นไปถึงเป้าหมายเอง โดยที่ท่านมีหน้าที่คอยประคองหางเสือให้มั่นคง&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 12px;&quot;&gt;อีกตัวอย่างคือ &lt;u&gt;&lt;b&gt;การยิงธนูญี่ปุ่น&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;การยิงธนูญี่ปุ่น ไม่ได้สนใจผลลัพธ์ แต่สนใจที่สภาวะที่เป็นอยู่ เมื่อท่าถูกต้อง จิตใจถูกต้อง เป้าหมายจะถูกต้องเอง ผู้ฝึกยิงธนูจึงมองเป้าแค่ครั้งเดียว สภาวะนี้เรียกว่า&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;Nobiai (โนบิอาย)&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #1d2129; font-family: helvetica, arial, sans-serif; font-size: 12px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;หลักนี้ ทางพุทธคือ &lt;b&gt;&lt;u&gt;มรรค&lt;/u&gt;&lt;/b&gt; มีองค์ 8 เมื่อปฏิบัติถูกครบทั้ง 8 องค์ ก็จะได้นิโรธ สู่หนทางที่ถูกต้องเอง&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #1d2129; font-family: helvetica, arial, sans-serif; font-size: 12px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;วันนี้ เราทำงานวัดผลกันมากเกินไปแล้ว วันนี้หลายที่ใช้ KBI ไม่ใช่ KPI แล้ว แต่ถ้าท่านยัง*จำเป็น*ต้องอยู่ในที่ที่บัง&lt;/span&gt;&lt;wbr style=&quot;background-color: white; color: #1d2129; font-family: helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot; style=&quot;background-color: white; color: #1d2129; display: inline-block; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1d2129; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;คับ KPI ก็อย่าเสียขบวน อย่าเสียตัวตน ตั้งใจทำให้ดี ผลต้องออกมาดี .... แต่ในทางกลับกัน ทำชั่ว เอาเปรียบ เห็นแก่ได้ ในที่สุด ผลก็จะเกิดต่อท่านเอง&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/1023285371156156813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/1023285371156156813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1023285371156156813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1023285371156156813'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2016/10/blog-post.html' title='เป้าหมายในชีวิต การยิงธนู และ มรรค'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXoFqsx7UHmvCLuA49CdJCd5ikg4hYMorCssP8BrHb3M0YPzI5206a0s7NIHOCTYVb-1JYogpaa7emr4SxmiRL15Z8VykIm_1_7Nln6v9yS4VTCaVvQ31NGJmpmmr0gTjCJV5Vtgk_SKig/s72-c/lucesnice-ii.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-4483301164287360868</id><published>2015-10-25T17:34:00.003+11:00</published><updated>2015-10-25T17:38:30.775+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="directive"/><category scheme="http://www.blogger.com/atom/ns#" term="ionic"/><category scheme="http://www.blogger.com/atom/ns#" term="locationhistory"/><title type='text'>Ionic Directive สำหรับ Back Button</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://i.stack.imgur.com/lCqmE.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://i.stack.imgur.com/lCqmE.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
บน Ionic Framework มี directive ให้ใช้สำหรับปุ่มย้อนกลับไปหน้าก่อนหน้านี้ อยู่แล้วคือ &amp;lt;ion-nav-bar&amp;gt; แต่เจ้าปุ่มนี้ จะอยู่ได้ใน &amp;lt;ion-nav-bar&amp;gt; เท่านั้น&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 243, 248); border-left-color: rgb(215, 219, 228); border-left-style: solid; border-radius: 2px; border-width: 0px 0px 0px 4px; box-sizing: border-box; color: #333333; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot; style=&quot;background-color: transparent; border-radius: 2px; border: 0px; box-sizing: border-box; color: inherit; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: inherit; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;&amp;lt;ion-nav-bar&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;&amp;lt;ion-nav-back-button&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;&amp;lt;/ion-nav-back-button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;&amp;lt;/ion-nav-bar&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
ถ้าเราต้องการสร้างปุ่มต่างหากเลย ก็สามารถใช้ &amp;lt;button&amp;gt; แล้วเขียน ng-click สำหรับเมื่อมีการกดปุ่ม แล้วให้ทำการย้อนกลับไปหน้าก่อนหน้านี้ ตัวอย่าง&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 243, 248); border-left-color: rgb(215, 219, 228); border-left-style: solid; border-radius: 2px; border-width: 0px 0px 0px 4px; box-sizing: border-box; color: #333333; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot; style=&quot;background-color: transparent; border-radius: 2px; border: 0px; box-sizing: border-box; color: inherit; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: inherit; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;&amp;lt;button ng-click=&quot;goBack()&quot;&amp;gt;Back&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
ใน Controller เป็นดังนี้&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 243, 248); border-left-color: rgb(215, 219, 228); border-left-style: solid; border-radius: 2px; border-width: 0px 0px 0px 4px; box-sizing: border-box; color: #333333; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot; style=&quot;background-color: transparent; border-radius: 2px; border: 0px; box-sizing: border-box; color: inherit; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: inherit; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;$scope.goBack = function() {
   $ionicHistory.goBack();
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
คราวนี้ ลองมาใช้ Directive กัน&lt;br /&gt;
ถ้าใช้ Directive ตัว Code จะดูเป็นระเบียนขึ้นอีกเป็นกอง แล้วยังสามารถเอา Directive ไปใช้กับ HTML หน้าอื่นๆได้อีก ตัวอย่าง&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 243, 248); border-left-color: rgb(215, 219, 228); border-left-style: solid; border-radius: 2px; border-width: 0px 0px 0px 4px; box-sizing: border-box; color: #333333; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot; style=&quot;background-color: transparent; border-radius: 2px; border: 0px; box-sizing: border-box; color: inherit; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: inherit; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; color: navy;&quot;&gt;&amp;lt;button go-back&amp;gt;Back&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
ใน Direct จะเป็นดังนี้ เราจะเขียนขยายจาก module กัน&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 243, 248); border-left-color: rgb(215, 219, 228); border-left-style: solid; border-radius: 2px; border-width: 0px 0px 0px 4px; box-sizing: border-box; margin-bottom: 10.5px; padding: 10px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot; style=&quot;background-color: transparent; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border-radius: 2px; border: 0px; box-sizing: border-box; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Monaco, Menlo, Consolas, Courier New, monospace;&quot;&gt;&lt;span style=&quot;line-height: 1.42857; white-space: pre-wrap;&quot;&gt;angular.module(&#39;app&#39;, [])
&lt;/span&gt;&lt;span style=&quot;font-size: 14px; line-height: 20px; white-space: pre-wrap;&quot;&gt;.directive(&#39;goBack&#39;, function ($ionicHistory) {
    return function (scope, element, attrs) {
        element.bind(&#39;click&#39;, function () {
            scope.$apply(function () {
                $ionicHistory.goBack();
            });
        });
    };
});&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/4483301164287360868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/4483301164287360868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/4483301164287360868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/4483301164287360868'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/10/ionic-directive-back-button.html' title='Ionic Directive สำหรับ Back Button'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-2649202290393504638</id><published>2015-10-14T18:00:00.000+11:00</published><updated>2015-10-14T18:00:29.498+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="$http"/><category scheme="http://www.blogger.com/atom/ns#" term="$promise"/><category scheme="http://www.blogger.com/atom/ns#" term="$resource"/><category scheme="http://www.blogger.com/atom/ns#" term="angularjs"/><title type='text'>CRUD App ง่ายๆ ด้วย Angular $resource - Part 1</title><content type='html'>App หน้าเดียว (SPA: Single-Page App) ที่ทำงานกับ Database ต้องมี CRUD operation (Create Read Update Delete) แต่การจะเขียน SPA ให้ต่อกับ Database โดยตรงนั้น ก็ออกจะเป็นการก้าวก่ายหน้าที่ของบริการ (service) ที่คุมฐานข้อมูลกันเกินไป ดังนั้น เราควรมี layer หนึ่งเพื่อเอาไว้สื่อสารระหว่าง SPA กับ Database&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://image.slidesharecdn.com/coldfusion11andangularjsbasicscfsummit2014-141022122704-conversion-gate01/95/building-coldfusion-and-angularjs-applications-4-638.jpg?cb=1413980906&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://image.slidesharecdn.com/coldfusion11andangularjsbasicscfsummit2014-141022122704-conversion-gate01/95/building-coldfusion-and-angularjs-applications-4-638.jpg?cb=1413980906&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
การสื่อสารกันระหว่าง FrontEnd (SPA ของเรา) กับ Backend (Database) จะเป็นในรูปแบบ REST API สิ่งที่ส่งไปมาคือ JSON ซึ่งง่ายต่อการผนวกเข้ากับ AngularJS&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
$http&lt;/h2&gt;
โดยทั่วไป เราจะใช้ $http service ของ AngularJS เอาไว้เรียก REST API เช่น&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;$http.get(&#39;/someUrl&#39;, config).then(successCallback, errorCallback);&lt;/span&gt;&lt;/pre&gt;
คำสั่งนี้ AngularJS จะสร้าง AJAX GET ไปยัง /someUrl ซึ่ง จะเป็น Asynchronous mode ตลอด (ซึ่งนี่จะนำมาสู่ว่าทำไมถึงได้มี $resource) การเป็น Asynchronous จะทำให้ code ไม่หยุดรอที่บรรทัดนั้น แต่จะทำงานต่อไปเลย ดังนั้น หลังจากบรรทัด $http.get ไม่ได้หมายว่า เราได้ข้อมูลกลับมาแล้ว แต่ Browser อาจจะกำลังติดต่อ server รอข้อมูล อยู่ ด้วยเหตุนี้ จึงต้องมี callback function เพื่อว่า เมื่อ ข้อมูลมาแล้ว จะทำอย่างไรต่อไป เช่น&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;var customers = [];
$http.get(&#39;http://myhose.com/api/customers&#39;).then(
  function(resp) { // on success
    customers = resp;
  },
  function(resp) { // on error
    console.error(&#39;Fail&#39;);
  }
);
console.log(customers.length); // ได้ 0&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;
ที่ console.log(customers.length) บรรทัดสุดท้าย แสดงค่า 0 แทนที่จะเป็นข้อมูลที่ได้มาจาก REST เพราะ ข้อมูลยังมาไม่ถึง $http.get ยังทำงานไม่เสร็จ code ก็ข้ามมาก่อน เพราะความเป็น Asynchronous แต่เมื่อข้อมูลมาแล้ว function // on success จะถูกเรียก แล้วนำเอาข้อมูลนั้นใส่เข้าให้กับ customers&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
สิ่งที่ได้คือ สัญญา $promise&lt;/h2&gt;
การเขียนโปรแกรมแบบ Asynchronous นี้ ทำให้เกิดการเขียน code แบบเรียก Callback function เมื่อ $http ที่ทำงานแบบ หน่วงเวลา (defer) ทำงานเสร็จแล้ว (resolved)&lt;br /&gt;
&lt;br /&gt;
การเขียนแบบนี้ ผิดความหมายนะครับ&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;-webkit-text-stroke-width: 0px; background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.42857; margin: 0px 0px 10.5px; orphans: auto; padding: 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 1; word-break: break-all; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;var customers = $http.get(&#39;http://myhose.com/api/customers&#39;).then(
  function(resp) { // on success
    
  },
  function(resp) { // on error
    
  }
);&lt;/span&gt;&lt;/pre&gt;
หากเราลองจับสิ่งที่ return ออกมาของ $http.get จบพบว่า ไม่ใช่ตัวข้อมูลเลย แต่กลับเป็น Promise object ซึ่งคือ คำมั่นสัญญาว่า เมื่อทำงานเสร็จ (resolve = true) จะเรียก successCallback ให้&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ไว้ผมจะอธิบายเรื่อง promise ในเรื่อง $q service ต่อไป&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
$resource ช่วยให้ชีวิตดีขึ้น&lt;/h2&gt;
$resource เป็น hi-level service ที่ใช้งาน $http แทนเรา โดยเมื่อ $http ทำงานเสร็จแล้ว $resource จะจับข้อมูล ยัดใส่ตัวแปรที่เราเอามารอรับค่าให้ โดยที่ ในขณะที่ข้อมูลยังไม่มา (resolve = false) นั้น ตัวแปรนั้นจะเป็น $promise เช่นเดียวกับ $http แต่เราไม่ต้องมาเขียน successCallback แล้ว&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;var&lt;/span&gt; customers = $resource(&#39;/someUrl&#39;);&lt;/pre&gt;
ง่ายเวอร์ครับ&lt;br /&gt;
&lt;br /&gt;
การใช้งาน $resource มีอะไรอีกมาก ไว้จะมาเล่าให้ฟังในบทความต่อๆไป&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/2649202290393504638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/2649202290393504638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/2649202290393504638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/2649202290393504638'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/10/crud-app-angular-resource-part-1.html' title='CRUD App ง่ายๆ ด้วย Angular $resource - Part 1'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-6841387697261460352</id><published>2015-10-14T14:56:00.004+11:00</published><updated>2015-10-14T15:02:29.125+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ionic"/><category scheme="http://www.blogger.com/atom/ns#" term="routing"/><title type='text'>Ionic Routing</title><content type='html'>&lt;a href=&quot;https://scotch.io/wp-content/uploads/2014/03/angular-routing-ui-router.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;https://scotch.io/wp-content/uploads/2014/03/angular-routing-ui-router.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;Routing เป็นส่วนแรกที่เจอเมื่อสร้าง Ionic App จาก Template ซึ่งจะเขียนไว้ใน app.js ใน ionic เลือกใช้ &lt;a href=&quot;https://github.com/angular-ui/ui-router&quot;&gt;angular-ui-router&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
เราจะกำกับ url ต่างๆที่วิ่งไปมาใน App ว่าให้ไปเอาเนื้อหา html ไฟล์ไหนมาแสดง แล้ว ให้ใช้ Controller ตัวไหนในการควบคุม&lt;br /&gt;
&lt;br /&gt;
โดยแต่ละ url ต่อไปนี้จะเรียกว่า state&lt;br /&gt;
ตัวอย่าง code ใน app.js&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;var&lt;/span&gt; app = angular.module(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;ionicApp&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, [&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;ionic&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;])

app.config(&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$stateProvider&lt;/span&gt;, &lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$urlRouterProvider&lt;/span&gt;) {
  &lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$urlRouterProvider&lt;/span&gt;.otherwise(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;)

  &lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$stateProvider&lt;/span&gt;.state(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, {
    &lt;span class=&quot;key&quot; style=&quot;box-sizing: border-box;&quot;&gt;url&lt;/span&gt;: &lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;,
    &lt;span class=&quot;key&quot; style=&quot;box-sizing: border-box;&quot;&gt;template&lt;/span&gt;: &lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;p&amp;gt;Hello, world!&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;
  })
})&lt;/pre&gt;
&lt;br /&gt;
การทำ routing คือการ config module ในกรณีนี้ ถ้า App เราชื่อ ionicApp ก็ทำการสร้าง หรือ เรียก module จาก cache ด้วย&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;var&lt;/span&gt; app = angular.module(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;ionicApp&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, [&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;ionic&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;])&lt;/pre&gt;
&lt;br /&gt;
จากนั้น ก็ config โดย inject resource เข้าไป สองอย่างคือ $stateProvider และ $urlRouterProvider&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;  &lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$urlRouterProvider&lt;/span&gt;.otherwise(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;
กำหนดว่า ถ้า url path ไม่ตรงกับที่กำหนดไว้เลย ให้ไปที่ หน้า root /&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;  &lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$stateProvider&lt;/span&gt;.state(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, {
    &lt;span class=&quot;key&quot; style=&quot;box-sizing: border-box;&quot;&gt;url&lt;/span&gt;: &lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;,
    &lt;span class=&quot;key&quot; style=&quot;box-sizing: border-box;&quot;&gt;template&lt;/span&gt;: &lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;p&amp;gt;Hello, world!&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;
  })&lt;/pre&gt;
กำหนด state ใหม่ชื่อ home โดยบอกว่า ถ้า url path คือ / ให้ใช้ template เป็น html code ตามที่กำหนดได้เลย แต่เราสามารถกำหนดให้ใช้ไฟล์ home.html เลยก็ได้ ด้วย&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;predefined&quot; style=&quot;box-sizing: border-box;&quot;&gt;$stateProvider&lt;/span&gt;.state(&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, {
  &lt;span class=&quot;key&quot; style=&quot;box-sizing: border-box;&quot;&gt;url&lt;/span&gt;: &lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;,
  &lt;span class=&quot;key&quot; style=&quot;box-sizing: border-box;&quot;&gt;templateUrl&lt;/span&gt;: &lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;home.html&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;
})&lt;/pre&gt;
ส่วนเนื้อหา index.html หน้าแรกของ ionic ก็จะเป็น&lt;br /&gt;
&lt;pre style=&quot;background-color: #ebf0f6; border-radius: 5px; border: none; box-sizing: border-box; color: #3c4f6e; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; line-height: 1.42857; margin-bottom: 10.5px; padding: 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;ion-tabs&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;tabs-positive&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;ion-tab&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;icon&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;ion-home&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;ui-sref&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;ion-nav-view&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/ion-nav-view&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/ion-tab&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;ion-tab&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;icon&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;ion-help&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;ui-sref&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;ion-nav-view&lt;/span&gt; &lt;span class=&quot;attribute-name&quot; style=&quot;box-sizing: border-box;&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;box-sizing: border-box;&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/ion-nav-view&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/ion-tab&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/ion-tabs&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
โดยที่ เมื่อ click ที่ tab home, ionic จะเอา home.html มาแสดงตามที่กำหนดใน router&lt;br /&gt;
&lt;br /&gt;
ณ จุดนี้ อาจจะดูยุ่งยาก ทั้งๆที่การทำ link ธรรมดาก็น่าจะเพียงพอ&lt;br /&gt;
แต่ เมื่อ App ซับซ้อนขึ้น มีการใช้ Controller ซ้ำๆในหน้า html ต่างๆ วิธีนี้ จะทำให้เห็นศูนย์รวมของการตั้งค่าได้่ดีกว่า การกำหนด Controller แยกในแต่ละ html ไฟล์&lt;br /&gt;
&lt;br /&gt;
ไว้ผมจะมาขยายความต่อครับ</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/6841387697261460352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/6841387697261460352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/6841387697261460352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/6841387697261460352'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/10/ionic-routing.html' title='Ionic Routing'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-1530779539666144019</id><published>2015-07-03T00:14:00.000+10:00</published><updated>2015-07-03T00:14:02.006+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>Neural Networks</title><content type='html'>&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
นักวิทยาศาสตร์คอมพิวเตอร์ประยุกต์สิ่งรอบตัวมาเพื่อหาคำตอบ เพราะนักวิทยาศาสตร์คอมพิวเตอร์คือนักตอบคำถาม ถ้าเมื่อธรรมชาติตอบคำถามของตัวมันเองได้ดีที่สุด ดั่งเช่นมนุษย์เราคงอยู่มาได้ถึงปัจจุบัน เพราะธรรมชาติของร่างกายมนุษย์ทำให้เราเรียนรู้และพัฒนาได้ นักวิทยาศาสตร์คอมพิวเตอร์ก็นำสิ่งนี้มาใช้เช่นกัน คราวนี้เรามามองสิ่งที่ทุกคนมีคือ สมอง สมองเรียนรู้อย่างไร&lt;br /&gt;
&lt;br /&gt;
เคยได้ยินกฎ 10,000 ชั่วโมง สู่ความเป็นเลิศไหมครับ ทำไมต้อง 10,000 ชั่วโมง มันเป็นตัวเลขจากการสังเกต เช่นนักเปียโนระดับเทพสักคนจะเก่งขนาดนั้น เขาฝึกวันละ 3 ชั่วโมง ต่อกันเป็นเวลา 10 ปี ก็ 10,000 ชั่วโมงโดยประมาณ เพื่ออะไร? เพื่อให้สมองจดจำวิธีการกระทำนั้นๆจนตอบสนองได้อย่างรวดเร็ว คำว่าจดจำและตอบสนองได้อย่างรวดเร็วคือ การที่เซลล์สมองที่เรียกว่า Neuron ต่อเชื่อมกันจนเป็นเส้นที่ใหญ่ และ สั้นลงเรื่อยๆ เมื่อมีเหตุการณ์มากระตุ้น เส้นทางในสมองเพื่อตอบสนองต่อกิจกรรมนั้นจะเร็วและทันที ดังนั้นฝึกครับ ฝึกเข้าไป&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://mechanicalforex.com/wp-content/uploads/2011/06/NN.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://mechanicalforex.com/wp-content/uploads/2011/06/NN.png&quot; height=&quot;230&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
วิธีการที่สมองเรียนรู้นี้ เราใช้ให้คอมพิวเตอร์เรียนรู้โดยการจำลอง Neural Networks ขึ้นมา แล้วเราให้ตัวอย่างการทำงานและผลลัพธ์ไปเรื่อยๆ โครงข่ายนี้จะสร้างเส้นทางที่เหมาะสมกับตัวอย่างที่ได้เรียนรู้ เช่นเราจะสอนคอมพิวเตอร์ให้เล่นหมากรุก เราเอารูปแบบการเล่นให้คอมพิวเตอร์เห็นและผลลัพธ์ว่า เดินแบบนี้จะโดนกิน จะแพ้ จะชนะ ไปเรื่อยๆ เมื่อถึงจุดหนึ่ง คอมพิวเตอร์จะสามารถตอบสนองกับสถานการณ์ที่แม้จะไม่เคยถูกสอนมาก่อนได้ น่าสนุกนะครับ วิธีการแบบนี้ถูกใช้ให้คอมพิวเตอร์เรียนรู้ไปได้หลายอย่างเลย</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/1530779539666144019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/1530779539666144019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1530779539666144019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1530779539666144019'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/neural-networks.html' title='Neural Networks'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-8127272612133273129</id><published>2015-07-03T00:04:00.001+10:00</published><updated>2015-07-03T00:04:28.978+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>Genetic Algorithm</title><content type='html'>&lt;br /&gt;
&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
วิทยาศาสตร์คอมพิวเตอร์ประยุกต์เรื่องรอบตัวต่างๆมาใช้ในการหาคำตอบตลอดเวลาครับ เพราะนักวิทยาศาตร์คอมพิวเตอร์คือนักหาคำตอบ ไม่ได้ด้วยเล่ห์ ก็เอาด้วยกล ว่างั้น&lt;br /&gt;
&lt;br /&gt;
วิธีหนึ่งที่ธรรมชาติทำอยู่ตลอดคือ Natural Selection การคัดเลือกโดยธรรมชาติ ผู้ที่เหมาะสม ผู้ที่แข็งแกร่งจะอยู่รอด และสืบทอดต่อมาผ่านการวิวัฒนาการ Gene ของมนุษย์ก็เช่นกัน Gene ที่ด้อย ก็จะหายไป Gene ที่สำคัญต่อการดำรงชีวิตก็จะยังอยู่และยังสามารถพัฒนาต่อไปให้แกร่งขึ้น เช่นคนอาฟริกาผิวเข้มเพื่อดำรงชีวิตอยู่ภายใต้แสงแดดได้&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sdteffen.de/diplom/web/img45.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://sdteffen.de/diplom/web/img45.png&quot; height=&quot;205&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;มีปัญหาทางคอมพิวเตอร์ที่โจทย์คือ การตั้งค่าที่ดีที่สุดเพื่อให้ได้ผลลัพธ์ที่ดีที่สุด เช่น ถ้าเราตั้งค่าผิดเครื่องจักร์ในโรงงานอาจต้องทำงานหนักเพื่อให้ได้ผลงานเท่ากับการตั้งค่าอีกแบบที่เครื่องจักร์ทำงานไม่หนัก และใช้พลังงานน้อยกว่า ยิ่งถ้าเราตั้งค่าตัวนี้ได้แม่นเท่าไหร่ ก็ยิ่งดี&lt;br /&gt;
&lt;br /&gt;
เราใช้เรื่อง Natural Selection นี้มาประยุกต์กับ Gene โดยมองการตั้งค่าคือ ค่า่ของแต่ละ Chromosome ใน Gene ตัว Chromosome ที่ก่อให้เกิดผลดี ก็จะถูกเก็บไว้ ก็คือ ค่านั้นๆจะถูกเก็บไว้ และค่าที่ไม่ดีก็จะหายไปในการวิวัฒนาการรอบต่อไป&lt;br /&gt;
&lt;br /&gt;
เช่นถ้ามีเกม RPG สักเกม ที่เรามีหน้าที่ปรับแต่งค่าของตัวละคอน เราใส่ชุดเกราะแบบนี้ ใส่ดาบแบบนี้ ใส่ท่าไม้ตายแบบนี้ ปรับ Skill แบบนี้ แล้วปล่อยให้ไปสู้ เราทำได้เพียงนั่งดูตัวละคอนเราสู้จากค่าที่ปรับไว้ แล้วถ้าผลออกมาดี แปลว่าค่าชุดนี้เหมาะกับการต่อสู้แบบนี้ แต่หากแพ้กลับมา เราก็จะปรับแต่งแล้วกลับไปสู้ใหม่ จนกระทั่งพบค่าที่เหมาะสม นี่แหล่ะครับ Genetic Algorithm เราสามารถประยุกต์ได้อีกมากครับ&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/8127272612133273129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/8127272612133273129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8127272612133273129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/8127272612133273129'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/genetic-algorithm.html' title='Genetic Algorithm'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-6116258816911972689</id><published>2015-07-02T23:52:00.001+10:00</published><updated>2015-07-02T23:52:17.293+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>MVC</title><content type='html'>&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
การเขียนโปรแกรมสำหรับงานใหญ่ๆ โดยเฉพาะที่ต้องทำงานกับฐานข้อมูล แนวทางหนึ่งที่เป็นที่นิยมมากคือ MVC = Model View Control โดยเป็นการแยกส่วนของโปรแกรม เพื่อไม่ให้โค้ดพันกันยุ่งเหยิง&lt;br /&gt;
&lt;br /&gt;
เช่นถ้าเราจะทำ website สำหรับขายของ online ก็ต้องมีฐานข้อมูล และส่วนการแสดงข้อมูล ถ้าเราให้ทุกหน้า web ดึงข้อมูลจากฐานโดยตรงก็ทำได้ แต่หากฐานข้อมูลมีการปรับเปลี่ยน อาจทำให้ทุกหน้าที่ดึงข้อมูลโดยตรงนั้นกระทบ แล้วเราต้องตามไปแก้ทั้งหมด แก้ได้หมดก็ดี ถ้าแก้ไม่หมด ก็เกิด Bug แน่ๆ&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://indiandotnet.files.wordpress.com/2009/04/mvc1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://indiandotnet.files.wordpress.com/2009/04/mvc1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
MVC บอกว่า ส่วนที่เป็นตัวแทนจากฐานข้อมูล เราจะเรียกว่า Model โดยทั่วไปคือ เราจะเขียน Class ในโปรแกรมเพื่อเป็นตัวกลางระหว่างฐานข้อมูลกับโปรแกรมส่วนอื่นๆ หา่กมีการแก้ไข แก้ที่ Model ก็พอ และเครื่องมือสำหรับเขียนโปรแกรมยุคนี้ฉลาดสามารถช่วยเราแก้โค้ดลักษณะนี้ได้รวดเร็ว ด้วยการทำ Refactor&lt;br /&gt;&lt;br /&gt;
เมื่อเรามีข้อมูลแล้ว เราจะนำเสนอทางหน้า web โดยส่วน View ซึ่งก็คือหน้า web นั่นเอง การเขียนส่วนนี้ เราจะได้สนใจเพียงหน้าตาที่น่าใช้งาน ไม่ต้องห่วงเรื่องการดึงข้อมูลในหน้า web อีก&lt;br /&gt;
&lt;br /&gt;
และเมื่อมีการเพิ่มเติม แก้ไข ลบ ข้อมูลหล่ะ จำเป็นต้องผ่านการควบคุม ส่วนนี้คือ Control ซึ่งเราจะเขียนโปรแกรมเพื่อควบคุมวิธีการคิดของระบบ และส่วนนี้จะไม่มี Graphics User Interface ใดๆ สนใจแต่หลักการทำงานเท่านั้น&lt;br /&gt;
&lt;br /&gt;
หลักการ MVC เป็นที่นิยมกันนะครับ ถ้าจะเริ่มทำงานใหญ่ๆ ขอแนะนำให้วางแผนให้ดีก่อน อย่าเพิ่งลุยโค้ดทันที รื้อโค้ดไม่สนุกเลยครับ</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/6116258816911972689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/6116258816911972689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/6116258816911972689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/6116258816911972689'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/mvc.html' title='MVC'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-5594462993134747801</id><published>2015-07-02T23:42:00.002+10:00</published><updated>2015-07-02T23:42:46.180+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>NetLogo</title><content type='html'>&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.wired.com/wp-content/uploads/2014/04/1997_El_Nino_TOPEX.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.wired.com/wp-content/uploads/2014/04/1997_El_Nino_TOPEX.jpg&quot; height=&quot;319&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&quot;คนคำนวณ หรือ จะสู้ฟ้าลิขิต&quot; ฟังดูแล้วเหมือนไม่ค่อยเป็นวิทยาศาสตร์เลยนะครับ แต่นักวิทยาศาตร์เราเก่งขนาดคำนวณวงโคจรของดาวหางฮัลเลย์ที่จะเวียนมาทุก 75 ปีได้ แต่ไม่อาจคำนวณสภาพอากาศในอีก 2-3 ชั่วโมงข้างหน้าอย่างแม่นยำได้ เพราะถ้าทำได้จริง ต้องไม่มีเหตุเครื่องบินตกเพราะสภาพอากาศแปรปรวน นี่แหล่ะครับ บางเหตุยากเกินการคำนวณเพราะปัจจัยมากมายเหลือเกิน ณ วันนี้เรายังไปไม่ถึง แต่เราก็พยายามกันอยู่ครับ&lt;br /&gt;
&lt;br /&gt;
ผมจะพูดถึงการจำลองเหตุการณ์ ก็ในเมื่อคำนวณหาผลชัดเจนไม่ได้ อีกวิธีคือลองทดลองจำลองเหตุการณ์โดยใส่ปัจจัยต่างๆเข้าไป แล้วเร่งเวลาของการจำลองขึ้นเพื่อให้เห็นว่าในอนาคต น่าจะเกิดอะไรขึ้น การจำลองนี้ใช้กันอย่างแพร่หลาย ตัวอย่างการจำลองผลกระทบจาก El Nino หรือเหตุการณ์น้ำแข็งขั้วโลกละลาย&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
และการคำนวณอย่างนี้ ไม่พ้นต้องใช้คอมพิวเตอร์ครับ&lt;br /&gt;
&lt;a href=&quot;http://beyondbitsandatomsblog.stanford.edu/spring2012/files/2012/04/wolf-sheep-predation-500x365.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://beyondbitsandatomsblog.stanford.edu/spring2012/files/2012/04/wolf-sheep-predation-500x365.png&quot; height=&quot;233&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;ผมขอแนะนำเครื่องมือใกล้ตัวที่หามาทดลองเล่นกันเองได้คือ NetLogo เป็นเครื่องมือสร้างเหตุการณ์จำลองด้วยหลักการ Intelligent Agent โดยใช้ภาษา LOGO ภาษาที่ใช้เขียนควบคุมตัวต่อ LEGO นั่นเองครับ ตัวอย่าง เราอยากทราบว่าโลกที่มีแต่แกะ หมาป่า และต้นหญ้า จะยั่งยืนขนาดไหน หากเรากำหนดอัตราการขยายพันธุ์ของแกะ หมาป่า และ ต้นหญ้า แกะกินหญ้า และขยายพันธุ์ หมาป่ากินแกะแล้วขยายพันธุ์ ต้นหญ้าก็โต ถ้าแกะขยายพันธุ์เร็วไป หญ้าไม่พอกิน แกะก็ตายกันหมด พอแกะตาย หมาป่าก็ไม่มีอะไรกินก็ตาย อย่างนี้ไม่ยั่งยืน แล้วอย่างไรยั่งยืน? ก็ต้องทดลองกันไปเรื่อยๆเพราะ คำนวณยากเหลือเกิน โปรแกรมนี้มีตัวอย่างการจำลองหลายแบบที่น่าสนใจ เราอาจประยุกต์เพื่อลองหาคำตอบว่า ทำไมสี่แยกที่ไม่มีไฟจราจร กลับรู้สึกติดขัดเมื่อคุณพี่ตำรวจมาช่วยโบก ก็ได้นะครับ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/5594462993134747801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/5594462993134747801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/5594462993134747801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/5594462993134747801'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/netlogo.html' title='NetLogo'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-4608662676164922616</id><published>2015-07-02T23:25:00.003+10:00</published><updated>2015-07-02T23:25:57.725+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>Internet Of Things (IoT)</title><content type='html'>&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
เคยมองไปที่ของเล่น Gadget ต่างๆแล้วนึกสนุกว่า ถ้าเราเอาอุปกรณ์ชิ้นนั้นจากเครื่องโน้นมาใส่ประกอบเพิ่มมันจะดีขึ้นไหมนะ เราทำให้ตู้เย็นเรามี wifi แล้วมี sensor คอยจับว่ามีของอะไรในตู้เย็น หรือ เอาจุกวัดลมรถส่งสัญญาน Bluetooth แล้วเอา App Smart Phone มาอ่านค่าได้ไหมนะ&lt;br /&gt;
ทำได้ครับ ยุคนี้ ชิ้นส่วนต่างๆแบบนี้มีขายในราคาที่ถูกลง แล้วทำให้นักประดิษฐ์ที่เคยติดขัดเรื่องความยากของการพัฒนาอุปกรณ์หาซื้อและใช้งานได้ง่ายขึ้น&lt;br /&gt;
&lt;br /&gt;
นักประดิษฐ์หรือ Maker เหล่านี้กำลังสนุกกับ Internet Of Things (IoT) กันอยู่ ทุกท่านที่สนใจทำได้นะครับ เราสั่งซื้อได้จาก website ในไทยก็มี เมื่อได้ของมา นำมาประกอบเป็นสิ่งที่ต้องการ แล้วขั้นต่อมา เราจะต้องมองที่การเขียนโปรแกรมเพื่ออ่านค่า และ ควบคุมอุปกรณ์เหล่านั้น ก็ต้องมาสนใจกันหล่ะว่า เราจะใช้ platform ไหน จะใช้ภาษาอะไร ปัจจุบันที่นิมกันก็คือ C++ Arduino และอีกไม่นานจะมีเจ้าอื่นๆทำออกมาด้วยเช่นกัน Intel, Microsoft, Apple ลงมาเล่นกับสิ่งนี้กันแล้วครับ อีกหน่อยก็จะไม่ใช่แค่ C++ จะมี JavaScript และอื่นๆตามออกมา&lt;br /&gt;
&lt;br /&gt;
การต่อยอดความคิดจนนำไปสู่การประดิษฐ์นี้ กำลังเป็นที่นิยมและควรสงเสริมอย่างยิ่ง เพราะอย่างไรแล้ว Technology จะเข้าใกล้ตัวเราขึ้นเรื่อยๆครับ สิ่งใกล้ตัวจะเชื่อมโยงถึงกันหมด ทุกชาติทำพัฒนาแล้วในโลกกำลังมุ่งพัฒนาสู่การเป็น Smart City ไทยเองก็ต้องไม่นั่งมองเฉยๆนะครับ</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/4608662676164922616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/4608662676164922616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/4608662676164922616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/4608662676164922616'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/internet-of-things-iot.html' title='Internet Of Things (IoT)'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-5371887138222116161</id><published>2015-07-02T23:14:00.002+10:00</published><updated>2015-07-02T23:14:38.854+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>Cloud Computing</title><content type='html'>&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
สมัยนี้ อะไรๆ เราก็จะเอาขึ้นเมฆกันเรื่อยนะครับ เอ่ะอะก็ เอาขึ้น Cloud เอาขึ้น Cloud&lt;br /&gt;
ลองมาดูกัน ถ้าเราอยากมีระบบออนไลน์เช่น ฐานข้อมูลเอาไว้ใช้แบ่งกันในบริษัท หรือ ระบบงานที่ต้องใช้ได้ทุกสาขา เราอาจจะคิดถึงการทำ Web Application แล้วคราวนี้ เราก็ต้องคิดหาเครื่องมาทำเป็น Server แล้วก็ต้องมีห้องติดแอร์เอาไว้วางเพื่อเปิดมัน 24/7 แล้วยังต้องมี UPS กันไฟดับ Internet ที่เสถียร มีพนักงานคอยดู ต้องคอย update program เผื่อโดน hack ฯลฯ&lt;br /&gt;
&lt;br /&gt;
สมัยนี้ง่ายกว่านั้นครับ ไปเช่า Server ที่เป็น Cloud ได้เลย อยากได้เครื่องแรงแค่ไหน เปิดตลอดเวลา หรืออยากจะปรับ spec กระทันหันเพราะอยู่ดีๆมีคนใช้งานหนักมาก ไม่ต้องกลัวไฟดับ น้ำท่วม ไม่ต้องมีห้องเก็บเครื่อง แล้วเราก็จ่ายเงินเท่าที่เราใช้เท่านั้น การมีเครื่องเอง เวลาเรา upgrade เครื่อง เครื่องก็จะแรง แต่ราคาก็มักจะแรงตาม แต่เดี๋ยวไม่กี่ปี ก็ต้องปรับอีกแล้ว เป็นอย่างนี้ไปเรื่อยๆ จะเกิดช่องว่างระหว่างกำลังเครื่อง กับกำลังการใช้งานจริง เมื่อปรับไม่ทัน อาจเกิดจังหวะที่ผู้ใช้เจอความช้าของระบบแล้วเริ่ม่พอใจได้ แต่กับ Cloud service เราปรับได้ทันทีและเราจ่ายเท่าที่เราใช้จริงๆ วันไหนระบบไหนไม่ค่อยได้ใช้ ก็ลด spec ลงมาก็ได้&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://networkstatic.net/wp-content/uploads/2012/09/AWS.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://networkstatic.net/wp-content/uploads/2012/09/AWS.jpg&quot; height=&quot;193&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
ลักษณะการทำงานแบบนี้ ไม่ได้จำกัดแค่การเช่า server นะครับ รวมไปถึง software ต่างๆ เช่น Microsoft Office 365, Adobe Creative Cloud เป็นต้น หลักการสำคัญก็คือ Pay as you go และ นี่ก็ทำให้ผู้ใช้ที่ไม่ค่อยใช้ของลิขสิทธิ์เพราะราคาแพง เริ่มหันมาใช้เพราะราคาที่เขาจ่ายไม่จำเป็นต้องจ่ายแพงเกินไป</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/5371887138222116161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/5371887138222116161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/5371887138222116161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/5371887138222116161'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/cloud-computing.html' title='Cloud Computing'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-3212401983427882272</id><published>2015-07-02T22:51:00.002+10:00</published><updated>2015-07-02T22:51:42.451+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>Big Data</title><content type='html'>&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fefdfa; color: purple; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;ช่วงปีที่ผ่านมา มีการพูดถึง Big Data กันมาก ชื่อมันแสนธรรมดานะครับ เพราะ Data มีขนาดใหญ่ขึ้น เราก็รู้กันดี แต่ด้วยความว่าใหญ่นี่ มันใหญ่เกินเราจินตนาการเลยทีเดียว ทุกนาที&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;Facebook share เรื่องราวต่างๆ 2.5 ล้านเรื่อง&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;Twitter twit กัน เกือบ 300,000 ครั้ง&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #fefdfa; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;Instagram ขึ้นรูปกัน 220,000 รูป&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #fefdfa; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;YouTube upload video เนื้อหายาวรวมกันถึง 72 ชั่วโมง&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #fefdfa; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;AppStore download เกือบ 50,000 app&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #fefdfa; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;Email ถูกส่งราว 200 ล้านฉบับ&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #fefdfa; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;Amazon ขายของได้ราว $80,000&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;[&lt;/span&gt;&lt;a href=&quot;http://aci.info/2014/07/12/the-data-explosion-in-2014-minute-by-minute-infographic/&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;อ้างอิง&lt;/a&gt;&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;ทั้งหมดนั่่นเกิดขึ้นใน 1 นาที แล้ว 1 ชั่วโมง 1 วัน 1 เดือน 1 ปี ข้อมูลเกิดขึ้นมากมายมหาศาล Big พอไหมครับ คราวนี้ข้อมูลที่เกิดขึ้นนี้ ถ้าแค่เก็บๆไว้ก็ไม่เกิดประโยชน์ ถ้าเราเอามาวิเคราะห์หาพฤติกรรม ข้อมูลที่น่าสนใจก็จะเพิ่มมูลค่าและพํฒนาโลกนี้ต่อไปได้ แต่ประเด็นคือ มันใหญ้่มาก ถ้าจะมองว่า ก็เอา HDD ลูกใหญ่ๆมาเก็บแล้วค่อยคำนวณสิ ไม่ไหวหรอกครับ ข้อมูลที่ซับซ้อนมากๆ ใช้เวลาในการคำนวณมาก ยิ่งข้อมูลมหาศาลขนาดนั้น บางทีเราถามคำถามไปคำถามเดียว อาจใช้เวลาเป็นชั่วโมงเพื่อตอบ&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #fefdfa; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;&quot;&gt;ดังนั้น นักวิทยาศาสตร์คอมพิวเตอร์จึงเรียกปรากฎการณ์นี้ว่า Big Data และจำต้องเปลี่ยนวิธีการมอง วิธีการคิดกันใหม่เลยทีเดียว ดังจะเห็นผลตอนนี้ว่า Google ค้นหาข้อมูลให้เราจากฐานข้อมูลมหาศาลภายในเวลาเพียงสั้นนิดเดียว ผมขอเปิดเรื่องเอาไว้ตรงนี้ก่อนว่า Big Data มีที่ให้เราค้นคว้าอีกมากมาย แล้วเราค่อยมาคุยกันต่อ&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/3212401983427882272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/3212401983427882272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3212401983427882272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/3212401983427882272'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/07/big-data.html' title='Big Data'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4170761397864520900.post-1182501070436505697</id><published>2015-06-29T23:25:00.001+10:00</published><updated>2015-06-29T23:25:19.669+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ClassA"/><title type='text'>KANBAN</title><content type='html'>&lt;span style=&quot;color: purple;&quot;&gt;[Script จากรายการ Class A โดยอาจารย์ชยพล]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
หลายครั้งที่เราตั้งใจจะทำอะไรสักอย่าง แล้วก็กระตือรือร้นอยู่พักหนึ่ง พอมีเหตุเข้ามาขัด หรือเพียงข้ามวัน ความรู้สึกกับงานนั้นต่อไม่ติด แน่นอนว่า คนทั่วไปต้องมีกิจกรรมมมากกว่าหนึ่งอย่างในชีวิตอยู่แล้ว&lt;br /&gt;
&lt;br /&gt;
ง่ายๆคือการจด แต่วิธีการจดที่ช่วยให้เราสามารถจัดการกับงาน ย้ายได้ แตะต้องได้ เห็นภาพ ลองดูการใช้ กระดาน Kanban หลักสำคัญคือการจดลงบน Sticky Note / Post It เป็นสีๆแล้วแต่ประเภทงาน จากนั้นก็แปะลงบนกระดานที่แบ่งเป็นช่อง เรียงจากซ้ายไปขวา คือ สิ่งที่อยากทำ สิ่งที่จะทำต่อไป สิ่งที่กำลังทำ และ เสร็จ&lt;br /&gt;
&lt;br /&gt;
เมื่อมีเรื่องอยากทำ ก็จดลงในช่องที่จะทำก่อน ยังไม่พร้อมจะทำก็ไม่เป็นไร แต่สิ่งที่อยากทำนั้นก็จะปรากฎอยู่อย่างนั้น เมื่อพร้อมจะทำ ก็เลือกออกมาสักแผ่นว่า อยากทำอะไรก่อน เอามารอไว้ในช่องงานที่จะทำ งานไหนที่กำลังทำอยู่ก็เอาไว้ในช่องกำลังทำ ตรงนี้เราสามารถกำหนดว่า จะทำงานพร้อมกันกี่อย่าง ทั่วไปก็ประมาณสองอย่าง ไม่มากไปกว่านี้ ถ้าช่องงานที่กำลังทำเต็มอยู่ เราก็จะไม่เริ่มงานใหม่ อย่างนี้ประสิทธิภาพงานก็จะดีขึ้นด้วย เมื่อทำงานเสร็จแล้ว ก็ย้ายงานไปช่องเสร็จแล้ว&lt;br /&gt;
&lt;br /&gt;
ลองคิดดูว่า การที่เราเห็นงานเสร็จมากๆเข้า มันเป็นกำลังใจที่จะทำให้เราทำงานสำเร็จไปเรื่อยๆ&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWasE0YUR3degWr60-4kJV-DPCMmZYygxJLenTzshhq7K1m83HqgVzqbJaig8n53nNtFQoys-ugo3byHEQ-RI73Qwn1nE3hxDdo1ijQy4HVHFtWOVonTNdnHB7xxTxFGxjjVF0HARfMW31/s1600/cs.kanban.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWasE0YUR3degWr60-4kJV-DPCMmZYygxJLenTzshhq7K1m83HqgVzqbJaig8n53nNtFQoys-ugo3byHEQ-RI73Qwn1nE3hxDdo1ijQy4HVHFtWOVonTNdnHB7xxTxFGxjjVF0HARfMW31/s320/cs.kanban.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://mchayapol.blogspot.com/feeds/1182501070436505697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4170761397864520900/1182501070436505697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1182501070436505697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4170761397864520900/posts/default/1182501070436505697'/><link rel='alternate' type='text/html' href='http://mchayapol.blogspot.com/2015/06/kanban.html' title='KANBAN'/><author><name>Chayapol</name><uri>http://www.blogger.com/profile/02599373328079187044</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWasE0YUR3degWr60-4kJV-DPCMmZYygxJLenTzshhq7K1m83HqgVzqbJaig8n53nNtFQoys-ugo3byHEQ-RI73Qwn1nE3hxDdo1ijQy4HVHFtWOVonTNdnHB7xxTxFGxjjVF0HARfMW31/s72-c/cs.kanban.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>