<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vachirachat &quot;Net&quot; Sawadditwat on Medium]]></title>
        <description><![CDATA[Stories by Vachirachat &quot;Net&quot; Sawadditwat on Medium]]></description>
        <link>https://medium.com/@vachirachat.saw?source=rss-175b4e9acbb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*P8NReHsYPcmih4ZDQEH_eg.jpeg</url>
            <title>Stories by Vachirachat &amp;quot;Net&amp;quot; Sawadditwat on Medium</title>
            <link>https://medium.com/@vachirachat.saw?source=rss-175b4e9acbb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:02:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vachirachat.saw/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I just finish “The comfort book” — Matt Haig.]]></title>
            <link>https://medium.com/@vachirachat.saw/i-just-finish-the-comfort-book-matt-haig-80d8523eb39f?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/80d8523eb39f</guid>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 02:55:05 GMT</pubDate>
            <atom:updated>2025-01-08T02:55:05.595Z</atom:updated>
            <content:encoded><![CDATA[<p>I just finish “The comfort book” — Matt Haig. I highlight sentence that I love from the book. And I want to share and keep all good things in my blog. I think this is a good book which you should read. I love his writing style since “Reason to stay alive” and “Notes on a Nervous Planet”.</p><p>For me, I like “Notes on Nervous Planet” the most since I think this book related with everyone. So if you want to start reading Matt Haig book. I recommend to start from this one.</p><p>Here is all sentence which I love in “The comfort book”. I think this blog will be useful when anyone face hard time in life. Just take a deep breath and read all of this.</p><p>“It is a strange paradox, that many of the clearest, most comforting life lessons are learned while we are at our lowest.”</p><p>When times are hard, we need a deep kind of comfort. Something elemental. A solid support. A rock to hold on to.</p><p>Nothing is stronger than a small hope that doesn’t give up.</p><p>“If we keep going in a straight line we’ll get out of here,”</p><p>Walking one foot in front of the other, in the same direction, will always get you further than running around in circles. It’s about the determination to keep walking forward.</p><p>It’s okay to like what you like. It’s okay to be who you are.</p><p>sometimes we are unable to escape them, but with a change of perspective we can live among the trees.</p><p>It also empowers us, because we aren’t at the mercy of the world we can never control, we are at the mercy of a mind we can, potentially, with effort and determination, begin to alter and expand. Our mind might make prisons, but it also gives us keys.</p><p>It also empowers us, because we aren’t at the mercy of the world we can never control, we are at the mercy of a mind we can, potentially, with effort and determination, begin to alter and expand. Our mind might make prisons, but it also gives us keys.</p><p>Self-forgiveness makes the world better. You don’t become a good person by believing you are a bad one.</p><p>future is uncertain, and that life contains light as well as dark.</p><p>In order to get over a problem it helps to look at it. You can’t climb a mountain that you pretend isn’t there.</p><p>And that sometimes all you need to do in order to rise up again is to keep moving forward.</p><p>We are always bigger than the pain we feel. Always.</p><p>There was a gap between what I looked like and what I felt like. And the only way to bridge that gap was by talking and writing about what was going on inside me.</p><p>Don’t fear missing parties you would probably want to leave.</p><p>Hope, in its simplest form, is the acceptance of possibility.</p><p>Be curious. Go outside. Get to bed on time. Hydrate. Breathe from the diaphragm. Eat happy. Get a routine baggy enough to live in. Be kind. Accept that not everyone will like you. Appreciate those who do. Don’t be defined. Allow fuck-ups. Want what you already have. Learn to say no to things that get in the way of life. And to say yes to the things that help you live.</p><p>Life is “understood backward; but it must be lived forward” (Søren Kierkegaard)</p><p>‘When we have really resolved to achieve something,’ my father once said, ‘we succeed. We only have to want it, Juliane.’</p><p>When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us. Helen Keller, We Bereaved</p><p>Experience one beautiful thing a day. However small.</p><p>We grow through hard times.</p><p>The most painful moments in life expand us. And when the pain leaves, space remains. Space we can fill with life itself.</p><p>Life is short. Be kind.</p><p>Empty your mind, be formless. Shapeless, like water. Now, you put water into a cup, it becomes the cup. You put water into a bottle, it becomes the bottle. You put it in a teapot, it becomes the teapot. Now, water can flow or it can crash. Be water, my friend. Bruce Lee</p><p>Delete the italics I am not popular enough. I am not good enough. I am not strong enough. I am not lovable enough. I am not attractive enough. I am not cool enough. I am not hot enough. I am not clever enough. I am not funny enough. I am not educated enough. I am not Oxford enough. I am not literary enough. I am not rich enough. I am not posh enough. I am not young enough. I am not tough enough. I am not well-traveled enough. I am not talented enough. I am not cultured enough. I am not smooth-skinned enough. I am not thin enough. I am not muscular enough. I am not famous enough. I am not interesting enough. I am not worth enough.</p><p>(I am enough.)</p><p>Tips for how to make a bad day better Get up. Get washed. Get dressed. Stand up. Move your body. Put your phone in another room. Go for a walk. Stretch. Place your legs against the wall. Get some sunlight, if there is some available. Head, if you can, to somewhere green. A garden, a park, a field, a meadow, a forest. Breathe deeply and slowly and consciously for a little while. Phone someone you love. If there is a nagging thing you are expected to do, but really don’t want to do, cancel it now. Do it now. If you can, cook a good meal and concentrate on the process. Cooking is the best kind of active meditation. Avoid artificial blue light, especially after dark. Allow bad thoughts, because that way they pass through quicker. Watch some TV you really like. But before you watch it, work out how long you want to watch for, and stick to it. If it is a clear night, watch the stars, just as Marcus Aurelius did in times of turmoil nearly two thousand years ago. Go to bed before midnight. Don’t try too hard to get to sleep. Just allow your mind to absorb the day, and let all those fears and frustrations float through.</p><p>Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up.</p><p>Let everything happen to you: beauty and terror. Just keep going. No feeling is final.</p><p>You don’t have to be positive. You don’t have to feel guilty about fear or sadness or anger. You don’t stop the rain by telling it to stop. Sometimes you just have to let it pour, let it soak you to your skin. It never rains forever. And know that, however wet you get, you are not the rain. You are not the bad feelings in your head. You are the person experiencing the storm. The storm may knock you off your feet. But you will stand again. Hold on.</p><p>We can move against the current of life, and forever meet resistance, or we can let our thoughts flow, and become the free uncertain river.</p><p>The hardest dream of all to achieve is the dream of not being tormented by our unlived dreams.</p><p>You are worth yourself, and that is always enough.</p><p>Wanting to be someone you aren’t. Wishing you could undo a past that can’t be undone. Taking out your hurt on people who didn’t cause your hurt. Trying to distract yourself from pain by doing something that creates more pain. Being unable to forgive yourself. Waiting for people to understand you when they don’t even understand themselves. Imagining happiness is the place you reach when you get everything done. Trying to control things in a universe characterized by unpredictability. Avoiding painful memories by resisting a contented present. The belief that you have to be happy.</p><p>Happy moments are precious. We need to hold on to them. Save them. Write them down. Place them in a bag. Have that metaphorical bag with you, for when it seems happy moments could never exist. Sometimes just to be reminded of happiness makes it more possible.</p><p>The present is known. The future is unknown. The present is solid. The future is abstract. Ruining the present by worrying about the future is like burning your most treasured possession simply because you might one day lose other possessions that you don’t own yet.</p><p>“You must never wait in pain,”</p><p>“You must see to it straightaway. It doesn’t go away by pretending it isn’t there.”</p><p>Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a — small hope that doesn’t give up.</p><p>Curiosity and passion are the enemies of anxiety. Even when I fall deeply into anxiety, if I get curious enough about something outside of me</p><p>You are not other people. You are you.</p><p>“No one can make you feel inferior without your consent,” said Eleanor Roosevelt.</p><p>“It’s not what happens to you, but how you react that matters.”</p><p>“Man is disturbed not by things, but by the views he takes of them.”</p><p>Just keep in mind: the more we value things outside our control, the less control we have.”</p><p>“I cannot escape death,” he said, “but at least I can escape the fear of it.”</p><p>Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up. Nothing is stronger than a small hope that doesn’t give up.</p><p>You may feel like you are in a nightmare. Your mind might be beating you up. You may think you aren’t going to make it. But remember a time you felt bad before.</p><p>The cure for loneliness is understanding who we are.</p><p>“Life moves pretty fast. If you don’t stop and look around once in a while, you could miss it.”</p><p>You can cry. You can feel. You can show what you are.</p><p>Forgiving other people is great practice for forgiving yourself when the time comes.</p><p>have a more enduring and resilient kind of hope. A hope that doesn’t wish for bad things not to happen — because they sometimes do — but rather one that enables us to see that bad things are never the whole story.</p><p>In short, we never know. The only certainty is uncertainty. And so, if we are to reach any kind of constant comfort, we need to find comfort in uncertainty. And it is there. Because while things are uncertain, they are never closed. We can exist in hope, in the infinite, in the unanswered and open question of life itself.</p><p>Each of us has the power to enter a new world. All we have to do is change our mind.</p><p>love the pleasurable distractions of modern life. I like that our world is one with podcasts and movies and video calls. But when I am in that state of deep fragility, where I am stripped of my shell, I find the shortest path back seems to be the timeless one.</p><p>always wanted to be somewhere else, closer to the center of the excitement.</p><p>My desperate desire to avoid pain and discomfort led to me feeling the worst pain and discomfort of my life.</p><p>This might be a funny thing to say in a book with “comfort” in the title, but pain is a part of life. A part of all life.</p><p>Of accepting that life connects joy to pain and pain to joy within the same breath. I didn’t need to go out and grab life. I was life.</p><p>The most powerful moment in life is when you decide not to be scared anymore.</p><p>It is impossible to grow in a world without struggle.</p><p>Suffering has been stronger than all other teaching, and has taught me to understand what your heart used to be. I have been bent and broken, but — I hope — into a better shape. Charles Dickens, Great Expectations</p><p>I wasn’t just feeling depressed. I was feeling depressed about feeling depressed.</p><p>To escape depression I had to get to a point where I accepted it.</p><p>And when you really analyze fear you realize, first, that it is only a natural part of us. And second, that it is the sister of hope. Because both are born from the uncertain fabric of life.</p><p>Remember There will be other days. And other feelings.</p><p>am a happy-sad-calm-fearful person. I let myself feel it all, and that way I am always open to new feelings.</p><p>No single feeling becomes the only feeling, if you let it all happen.</p><p>when we see the way everything connects, we can feel more empowered at our lowest points.</p><p>“Hate is not the opposite of love,” he said, “apathy is.”</p><p>“Joy is the experience of possibility,”</p><p>he wrote, “the consciousness of one’s freedom as one confronts one’s destiny. In this sense despair . . . can lead to joy. After despair, the one thing left is possibility.”</p><p>We need self-acceptance. Self-compassion. Our present bodies and minds and lives are not things we have to escape. We need to remember the messy miracle of being here.</p><p>Mettā is about accepting yourself as you are. There is no intent to change you, but rather an acceptance of yourself and all things as change.</p><p>In troublesome moments, the beauty of life can come into sharper focus.</p><p>Fear to calm, hope to hopelessness, despair to comfort.</p><p>We always have more inside us than we realize. More strength, more warmth, more compassion, more resilience. The world can surprise us, sure, but we can surprise ourselves too.</p><p>Nothing truly ends. It changes.</p><p>Change is eternal. In being change, you too are eternal. You are here. In this moving moment. And in being here, you are also forever.</p><p>Doing becomes being. Pain becomes strength. Noon becomes night.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80d8523eb39f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Software Development ในปี 2024]]></title>
            <link>https://medium.com/@vachirachat.saw/software-development-%E0%B9%83%E0%B8%99%E0%B8%9B%E0%B8%B5-2024-6cccdad73c17?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cccdad73c17</guid>
            <category><![CDATA[thailand]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 20:45:16 GMT</pubDate>
            <atom:updated>2024-10-18T20:45:16.294Z</atom:updated>
            <content:encoded><![CDATA[<p>Powered by ChatGPT-4o และแรงมนุษย์นิดหน่อย (Some human effort) อยากอ่าน version อังกฤษกดอ่านดูใน blog ของผมได้เลยครับ</p><p>หลังจากทำงานมา 3 ปีทั้งใน Software engineer และ non-software engineer rolผมอยากอัปเดตความรู้และแชร์แนวคิดเกี่ยวกับเทรนด์การพัฒนาซอฟต์แวร์ในปี 2024</p><p><strong>คำเตือน:</strong> ข้อมูลนี้มาจากประสบการณ์ส่วนตัวของผม</p><h3>Way of working</h3><p>Agile ยังคงเป็นวิธีการทำงานที่ได้รับความนิยมที่สุดที่ผมเจอ มันช่วยให้เราปรับตัวกับการเปลี่ยนแปลงที่รวดเร็วในพฤติกรรมของผู้ใช้และความต้องการทางธุรกิจ ผมยังไม่เคยเจอบริษัทที่ยังใช้โมเดล Waterfall แม้ว่าผมจะเดาว่าอาจจะยังมีใช้ในหน่วยงานของรัฐบาล</p><h3>เจาะลึกเกี่ยวกับ “Agile”</h3><p>มีบทความมากมายที่ตอบคำถามเช่น <em>“Agile คืออะไร?”</em> หรือ <em>“เราจะนำ Agile มาใช้ได้อย่างไร?”</em> แต่ผมจะโฟกัสที่ความคิดของผมว่าทำไม Agile ถึงเหมาะแก้การทำงานในสาย Softare development</p><p>Agile เหมาะสมกับการพัฒนาซอฟต์แวร์เพราะมันช่วยให้ทีมตอบสนองต่อการเปลี่ยนแปลงที่เกิดขึ้นอย่างต่อเนื่องตลอดวงจรชีวิตซอฟต์แวร์ได้อย่างรวดเร็ว มันเป็นกระบวนการที่ยืดหยุ่นและช่วยให้ทีมส่งมอบคุณค่าได้ตลอดเวลา</p><h3>การทำงานระยะไกลและแบบไฮบริด</h3><p>ผมเริ่มต้นอาชีพในช่วงที่โลกกำลังเผชิญกับการระบาดของ COVID ดังนั้นผมจึงเริ่มทำงานในรูปแบบไฮบริดหรือ WFH (Work From Home) แบบเต็มรูปแบบ ผมเชื่อว่าการเปลี่ยนแปลงนี้ได้เปลี่ยนอุตสาหกรรมไปตลอดกาล ตอนนี้ผู้คนเลือกงานตามสไตล์การทำงานที่พวกเขาชอบ สำหรับผมเอง ผมจะเลือกทำงานในรูปแบบไฮบริดหรือ WFH เท่านั้น — ผมไม่ต้องการทำงานในสำนักงาน 5 วันต่อสัปดาห์อีกต่อไป</p><h3>เจาะลึกเกี่ยวกับ “การทำงานแบบไฮบริด”</h3><p>การทำงานแบบไฮบริดเหมาะสมกับผมอย่างมากเพราะมันให้อิสระในการทำงาน วันที่เราต้องไปที่สำนักงานควรได้รับการตกลงร่วมกันกับสมาชิกทีมทุกคนเพื่อส่งเสริมการสร้างความสัมพันธ์ภายในทีม นอกจากนี้ยังช่วยลดเวลาที่ใช้บนถนนได้ ซึ่งเป็นสิ่งสำคัญในเมืองใหญ่อย่างกรุงเทพฯ</p><p>การประชุมที่ต้องมีการพูดคุยกันมากสามารถย้ายไปอยู่ในวันที่เราไปที่สำนักงานได้ ส่วนวันที่ทำงานจากที่บ้านจะเหมาะกับการทำงานที่ต้องการสมาธิ ข้อเสียเดียวของการทำงานแบบไฮบริดคือบางครั้งการทำงานจากบ้านอาจมีเสียงรบกวนจากสิ่งแวดล้อมรอบตัว</p><h3>เจาะลึกเกี่ยวกับ “การทำงานจากบ้าน (WFH)”</h3><p>WFH เหมาะสำหรับคนที่ต้องการสมาธิสูง หรือในกรณีที่สมาชิกทีมและลูกค้าอยู่ในประเทศที่ต่างกัน ข้อเสียหลักคือคุณจะมีโอกาสออกกำลังกายน้อยลง และการสร้างความสัมพันธ์ในทีมก็จะยากขึ้น</p><h3>แนวทางปฏิบัติที่ดีสำหรับการทำงานจากที่บ้าน</h3><ul><li>เปิดกล้องระหว่างการประชุมให้มากที่สุดเท่าที่จะทำได้ เพราะการเห็นหน้ากันจะช่วยสร้างความสัมพันธ์ที่แข็งแกร่งกว่าการเห็นเพียงชื่อผู้ใช้งานหรืออวาตาร์</li><li>จัดกิจกรรมสนุก ๆ ออนไลน์กับทีม เช่น เกมเล็ก ๆ ที่ใช้เวลาแค่ 30 นาที อย่าง <a href="https://garticphone.com/">Gartic Phone</a>, <a href="https://amongus-online.net/">Among Us</a>, หรือ <a href="https://www.geoguessr.com/">GeoGuessr</a> หากทีมของคุณไม่ชอบเล่นเกม ก็สามารถจัดเซสชันแชทเบา ๆ นอกเหนือจากเรื่องงานได้</li></ul><h3>Hot topic ของ Software Engineer 2024</h3><h4>“AI จะทำให้งานนักพัฒนาหายไปหรือไม่?”</h4><p>ผมไม่คิดว่า AI จะทำให้งานนักพัฒนาหายไป แต่มันจะทำให้เราทำงานได้ง่ายขึ้นในบางด้าน แต่สุดท้ายแล้ว เรายังต้องการคนในการพัฒนาซอฟต์แวร์อยู่ดี</p><h4>“จะมีงานในด้าน AI มากขึ้นในอนาคตหรือไม่?”</h4><p>ใช่ ผมคิดว่าอย่างนั้น เมื่อโลกผลิตข้อมูลมากขึ้นเรื่อย ๆ เราจะต้องการผู้เชี่ยวชาญที่สามารถจัดการและสร้างคุณค่าจากข้อมูลเหล่านี้มากขึ้น</p><h4>“เงินเดือนในอุตสาหกรรมนี้จะเพิ่มขึ้นอีกหรือไม่?”</h4><p>ขึ้นอยู่กับอุตสาหกรรมย่อยที่คุณเลือก ตัวอย่างเช่น การทำงานในสตาร์ทอัพเกมและบริษัท FAANG อาจมีช่วงเงินเดือนที่แตกต่างกันมาก สิ่งสำคัญคือการหาสมดุลระหว่างงานที่คุณชอบและเงินเดือนที่คุณพึงพอใจ ไม่มีคำตอบที่ถูกหรือผิด — มันขึ้นอยู่กับสิ่งที่ดีที่สุดสำหรับคุณ</p><h4>“Cloud Computing ยังคงเป็นกระดูกสันหลังของอุตสาหกรรมหรือไม่?”</h4><p>ใช่ แน่นอน Cloud Computing ยังคงเป็นโครงสร้างพื้นฐานที่สำคัญในการพัฒนาซอฟต์แวร์และจะยังคงเป็นรากฐานของอุตสาหกรรมต่อไปในอนาคตอันใกล้</p><p>ขอบคุณที่อ่าน! หากคุณมีข้อเสนอแนะใด ๆ โปรดแสดงความคิดเห็นไว้ได้เลย หากคุณต้องการให้ผมครอบคลุมหัวข้อใดเป็นพิเศษ แจ้งผมได้เลย แล้วผมจะพยายามตอบในเวลาที่สะดวก 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cccdad73c17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Way of working Software Development 2024]]></title>
            <link>https://medium.com/@vachirachat.saw/way-of-working-software-development-2024-3fe1b85c76af?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fe1b85c76af</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[work-from-home]]></category>
            <category><![CDATA[agi̇le]]></category>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 20:36:42 GMT</pubDate>
            <atom:updated>2024-10-18T20:36:42.635Z</atom:updated>
            <content:encoded><![CDATA[<p>After working for 3 years in both engineering and non-engineering roles, I wanted to update my knowledge and share some insights into software development trends in 2024. Please note, this is based on my personal experience.</p><p><strong><em>Disclaimer first, This is came from my personal experience.</em></strong></p><h3>Way-of-working</h3><ul><li>Agile remains the hottest methodology I’ve encountered. It continues to help us adapt to rapid changes in user behavior and business requirements. I haven’t come across any companies still using the Waterfall model, though I assume some government sectors may still be using it.A bit deep down on “Agile”</li><li>There’s plenty of content online answering questions like “What is Agile?” or “How can we implement it?”. I’ll focus more on my thoughts on why Agile works so well.</li><li>Agile fits software development perfectly because it allows teams to respond quickly to the constant changes that occur throughout the software lifecycle. It’s a dynamic process that helps teams stay flexible and ensures we’re always delivering value.</li></ul><h3>Remote and Hybrid work</h3><ul><li>When I graduated, the world was in the middle of the COVID pandemic, so I started my career in a hybrid or full WFH (Work From Home) setup. I believe this shift has changed the industry forever. Now, people are choosing jobs based on their preferred work style. Personally, I would only consider hybrid or WFH roles — I no longer want a 5-day office schedule.</li></ul><p>A bit deep down on “Hybrid work”</p><ul><li>IHybrid work fits me perfectly because it allows flexibility. The days we go to the office should be agreed upon by all team members to promote team bonding and collaboration. It also helps cut down on commute time, which is especially important in big cities like Bangkok.</li><li>Meetings that require a lot of interaction can be scheduled on office days, while remote days are better suited for focused work. The only downside to hybrid work is that WFH can sometimes bring distractions, such as noise from your home environment.</li></ul><p>A bit deep down on “WFH”</p><ul><li>WFH is ideal for those who need to focus intensively or when team members and clients are in different countries. However, the main cons are reduced physical activity and the challenge of maintaining team bonding.</li></ul><p>Good practice that you should do when you have to work from home.</p><ol><li>Keep your camera on during meetings as much as possible. Seeing faces creates stronger connections compared to just interacting with usernames or avatars.</li><li>Organize fun online sessions with your team. These can be small 30-minute games like <a href="https://garticphone.com/">Gartic Phone</a>, <a href="https://amongus-online.net/">Among Us</a>, or <a href="https://www.geoguessr.com/">GeoGuessr</a>. If your team isn’t into games, casual chit-chat sessions are also a great way to stay connected outside of work topics.</li></ol><h3>Hot topic now (when you read this article, maybe it’s already obsolete)</h3><ul><li>“AI will make developer job disappeared” — I don’t think so. AI will make certain tasks easier, but we will still need people to innovate, manage, and lead in software development.</li><li>“They will want more AI job in the futures.”- Yes, I think so. As we generate more and more data, there will be a growing need for specialists who can handle and extract value from this data.</li><li>“Salary will raise again in this industry” — That depends on the sub-industry you’re working in. For example, a game startup and a FAANG company will likely offer different salary ranges. It’s all about finding the right balance between the type of work you enjoy and the salary you’re satisfied with. There’s no right or wrong answer — it’s about what works best for you.</li><li>“Cloud computing still be backbone of industy” — Yes</li></ul><p>Thanks for reading. If you have any suggestion you can type in the commet. If you want any topice, please let me know if I have a time :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fe1b85c76af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tools for measuring web accessibility: Empowering developers to create inclusive digital…]]></title>
            <link>https://medium.com/@vachirachat.saw/tools-for-measuring-web-accessibility-empowering-developers-to-create-inclusive-digital-2ac5396d41f2?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ac5396d41f2</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing-tools]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Sat, 28 Sep 2024 05:48:46 GMT</pubDate>
            <atom:updated>2024-09-28T05:48:46.314Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tools for measuring web accessibility: Empowering developers to create inclusive digital experiences</h3><p>Since I have to drive improvement accessibility in my team I’ve researched and discovered some interesting testing tools. I’d like to introduce these tools to help you assess your website’s accessibility. I hope the tools I’ve found will be useful for anyone interested in accessibility development.</p><h3>🤔 Why we have to care about accessibility in our website ?</h3><p>“Adding more accessibility to websites ensures that all users, including those with disabilities, can interact with and benefit from digital content. It broadens the user base, improving inclusivity and user experience while also meeting legal and ethical standards. Accessible websites also enhance SEO, increasing visibility and usability for a wider audience.” — ChatGPT4</p><h3>⚙️ List of accessibility testing tools</h3><ul><li>Lighthouse: Scores accessibility and more. It offers suggestions for improving objects or components that aren’t up to par. Also provides tips to enhance performance. Great for a quick overview of the page.</li><li>VoiceOver on macOS: A tool used daily by people with disabilities. Try it to understand how your website performs for these users.</li><li>JAWS on Windows: Similar to VoiceOver, but for Windows OS.</li><li>Microsoft Narrator: Comparable to JAWS, but available as free software.</li><li>WAVE: Free software that provides detailed information on accessibility improvements needed for your website. It highlights both strengths and areas for enhancement.</li><li>W3C Validator: Helps identify errors that should be fixed to improve accessibility.</li></ul><p>Thanks for reading. If you have any tools suggestion, please let me know.🙂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ac5396d41f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[25 lesson when I’m 25]]></title>
            <link>https://medium.com/@vachirachat.saw/25-lesson-when-im-25-a3e5eb17f228?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3e5eb17f228</guid>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 07:19:27 GMT</pubDate>
            <atom:updated>2024-06-09T07:19:27.637Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>When There’s a will, There’s a way.</li><li>Take care of you metal health.</li><li>Don’t have to care much about person that you don’t like.</li><li>But you have to manage relationship with them.</li><li>Know which people can boost your energy and improve your life.</li><li>People around you is very important. It will define the person who you are.</li><li>Save money.</li><li>Don’t buy anything because social or other people.</li><li>Be careful of voice that you talk to yourself.</li><li>Learn to meditate.</li><li>Joy of missing out.</li><li>Don’t do work just only for money.</li><li>Don’t forgot to workout.</li><li>Out of comfort zone or be stress is OK.</li><li>Everything have price.</li><li>Be the best version of yourself.</li><li>Storm will come and it will pass.</li><li>Don’t stop learning.</li><li>Don’t stop reflection,</li><li>Don’t stop doing your journal.</li><li>You can’t change all people around you.</li><li>Don’t expected on other people</li><li>Start to writing.</li><li>If you want to be a leader, you have to have fate and courage.</li><li>Don’t give up.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3e5eb17f228" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pair programming คืออะไร? เริ่มทำยังไง ?]]></title>
            <link>https://medium.com/@vachirachat.saw/pair-programming-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-%E0%B9%80%E0%B8%A3%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%97%E0%B8%B3%E0%B8%A2%E0%B8%B1%E0%B8%87%E0%B9%84%E0%B8%87-ffc3c2857db5?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffc3c2857db5</guid>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[working-process]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Tue, 22 Nov 2022 00:00:05 GMT</pubDate>
            <atom:updated>2022-11-22T00:17:33.830Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pair programming คืออะไร? เริ่มทำยังไง ?</h3><p>สวัสดีครับ วันนี้เราจะมาเล่าเรื่องวิธีการทำงานในสาย Developer อีกแบบหนึ่ง ที่อาจจะช่วยเราหลายๆ คนแก้ปัญหากับสิ่งที่เจออยู่ได้ สิ่งที่เราจะมาเล่าวันนี้คือ Pair Programming สำหรับใครที่ยังไม่เคยได้ยินคำนี้มาก่อนใน Blog นี้เราก็มีการอธิบายว่า Pair Programming คืออะไร รวมไปถึงข้อดีของการทำ Pair อีกทั้งยังมีเรื่องของการทำ Pair Programming ยังไงให้มีประสิทธิภาพอีกด้วย</p><h3><strong>Pair programming คืออะไร ?</strong></h3><p>มีหลายคนที่ตอนนี้ทำงานอยู่ในวงการ Development Software ได้ยินเรื่องเกี่ยวกับ Pair Programming แต่การถูกนำมาใช้งานในตอนนี้ยังมีเป็นเพียงกลุ่มเล็กๆ อยู่ หนึ่งในเหตุผลหลักที่ยังถูกนำมาใช้น้อย เพราะประโยชน์ที่ทีมจะได้รับนั้นส่วนมากจะอยู่ใน Medium Term หรือ Long Term มากกว่า Short Term และนอกจากนี้การที่เราทำ Pair Programming อาจจะทำให้ Developer หรือ Programmer เองนั้นไม่ได้รู้สึก สบายใจที่จะทำมัน แต่ทำไมเราถึงควรทำ Pair Programming รวมทั้งสิ่งนี้ ช่วยให้กระบวนการพัฒนา Software ของเรานั้นดีขึ้นได้อย่างไรบ้าง</p><h3><strong>Pair Programming ช่วยอะไรบ้าง ?</strong></h3><ul><li><strong>เกิดการ Share ความรู้ระหว่างคู่ Pair</strong> — การที่ Developer สองคนทำงานร่วมกัน ช่วยทำให้การถ่ายทอด Technology, Business Domain และป้องกันการเข้าใจผิดทาง Knowledge กันภายในทีมดีขึ้น นอกจากนี้เมื่อเรามีสองความคิดในการเขียน Code เดียวกันแล้วยังช่วยให้เราได้มีโอกาสในการปรึกษาและเข้าใจปัญหาได้มากขึ้น อีกทั้งยังช่วยให้เราสามารถหา Solution ที่ดีขึ้นสำหรับการเขียน Code</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*eor7wVrG76gnb1PdtNzkbA.jpeg" /><figcaption><a href="http://justicefergie.com/wp-content/uploads/2015/02/SPongeBob.jpg">http://justicefergie.com/wp-content/uploads/2015/02/SPongeBob.jpg</a></figcaption></figure><ul><li><strong>Reflection</strong> — เนื่องจากการ Pair Programming เราจำเป็นที่จะต้องพูดคุยหรือ Discuss กับในแนวทางที่เราจะเขียน Code รวมไปถึง Solutiion อีกด้วย ทำให้ Developer จำเป็นต้องอธิบายในสิ่งที่ตัวเองคิดออกมา ซึ่งก็จะเป็นการช่วยให้เรา Reflect ถึงความคิดในหัวออกมา ทำให้เราได้คิดอีกรอบว่า Solution หรือทางที่เราจะทำนั้นเป็น Solution ที่ดีจริงๆ ไหม</li><li><strong>มีการ Focus มากกว่าสำหรับการเขียน Code</strong> — เมื่อเราทำ Pair Programming ทำให้เราต้องสื่อสารออกมาทั้งสองฝ่ายหรือ 2-way Communitcation ซึ่งทำให้เราต้อง Focus กับการเขียน Code ตลอดเวลาว่าเรากำลังทำอะไรและเราต้องการไปทางไหน แตกต่างกับการทำงานคนเดียว ที่เมื่อเราโดนรบกวนจาก Meeting หรือ งานเร่งด่วนต่างๆ เมื่อกลับมาใน Code ที่เราเคยเขียนเราอาจจะลืมในสิ่งที่เราเคยเขียนไปแล้วก็ได้ โดย Pairing Partner จะคอยช่วยให้เรา Keep On Track ได้ง่ายขึ้น, Focus อยู่กับเป้าหมายว่าเป้าหมายของงานที่ทำอยู่คืออะไร และป้องกันการการหลงทางจากการที่เราทำงานคนเดียว</li><li><strong>Code ถูกรีวิวขณะที่เขียน Code (Code Review On-the-go)</strong> — ตอนที่เรา Pair เรามีถึง 4 ตาสำหรับการช่วยดู Code ทั้งในมุมเล็กและมุมกว้าง รวมไปถึงช่วยให้เราสามารถเจอ Error จากการเขียน Code ได้ก่อนที่เราจะเขียน Code เสร็จ รวมถึงในการ Refactor Code จะเกิด Discuss ระหว่างกัน และทำให้การตั้งชื่อต่างๆ นั้นเป็นไปได้ง่ายขึ้นอีกด้วย</li><li><strong>การมองภาพของการเขียน Code ทั้ง High-level และ Low-level</strong> — จากการ Pair Programming แบบ Driver และ Navigator (ด้านล่างจะมีการอธิบายว่าการ Pair Programming มีกี่ Style) ทำให้การทำงานนั้นจะถูกมองทั้งจาก High-level และ Low-level ของ Code ซึ่งประโยชน์คือจะทำให้ Code ที่เราเขียนนั้นมีคุณภาพมากขึ้น เพราะมีการมองจากทั้ง High-level และ Low-level</li><li><strong>เป็นเจ้าของร่วมกันของ Code จากทั้งทีม</strong> — เนื่องจากการ Pairing นั้นทำให้เรามั่นใจได้ว่า Code ที่เราเขียนนั้นถูกอ่านจากคนสองคนตลอดเวลา เมื่อเราต้องการเปลี่ยน Code ในบางส่วนก็จะทำให้ Team กล้าที่จะเปลี่ยน Code ในส่วนอื่นๆ มากกว่าการที่เราเขียน Code โดยไม่มีการ Pair</li><li><strong>ทำให้ WIP ของทีมต่ำ</strong> — WIP คือ Work In Progress ซึ่งการ Limit WIP เป็นหนึ่งในการพัฒนา team flow ให้ดีขึ้น การที่เรา limit WIP นั้นจะช่วยให้เรา Focus กับงานที่สำคัญที่เราควรทำได้ และภาพรวม Productivity ของทีมโดยร่วมก็จะดีขึ้น เนื่องจากการทำ Multi-tasking นั้นไม่มีประสิทธิภาพเพียงแค่การทำงานเพียงคนเดียว แต่ยังกระทบถึงทั้งภาพรวมของทีมอีกด้วย</li><li><strong>Onboarding ได้เร็วขึ้นสำหรับสมาชิกใหม่</strong> — เนื่องจากการ Pair นั้นจะทำให้เกิดการ Pairing ระหว่างทีม ทำให้สมาชิกใหม่นั้นสามารถเข้าใจโปรเจคได้เร็วขึ้น รวมไปถึง Business Domain และการจัดการต่างๆ ของทีม</li></ul><h3><strong>เริ่มทำ Pair Programming ยังไง ?</strong></h3><p>ก่อนการเริ่มทำ Pair Programming เราควรที่จะรู้จัก Style ต่างๆ ของการ Pair ก่อน เนื่องจากการ Pair Programming นั้นก็มีหลายแบบ รวมถึงมีวิธีการต่างๆ ที่มีให้เราเลือกใช้ได้ตามถนัด</p><h3><strong>Styles การ Pair Programming</strong></h3><p><strong>1.Driver and Navigator 🚘 — </strong>style แรก ที่เป็นที่นิยมและง่ายที่สุดสำหรับการ Pair โดยที่เราจะแบ่งคนที่ Pair เป็นทั้งหมด 2 หน้าที่</p><ul><li>Driver เหมือนเป็นคนที่คอยขับรถ ซึ่งในบริบทนี้คือการที่เป็นคนที่คอยเขียน Code เพื่อให้ Navigator คอยช่วยดู โดยคนที่เป็น Driver จะ Focus เพียงแค่สิ่งที่ทำอยู่ ไม่จำเป็นต้องนึกถึง big issue หรือภาพรวมขนาดใหญ่ และ Driver ควรที่จะพูดถึงที่สิ่งที่คิด รวมถึงสิ่งที่อยากจะทำด้วย</li><li>Navigator เป็น position สำหรับการคอยสังเกต ในขณะที่ Driver กำลังพิมพ์สิ่งต่างๆ รวมไปถึงการรีวิว Code ที่กำลังเกิดขึ้นรวมถึงการ share ทิศทางของ Code ที่ควรจะเป็นรวมถึงแชร์ความคิดในการเขียน Code นั้นๆ ทั้งทาง Technical การออกแบบระบบและ Requirement จากฝั่ง Business Team ด้วย Navigator ส่วนมาจะต้อง Focus ที่ Big Picture</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgPKlYgKFsPdh9vDViWF7g.jpeg" /><figcaption><a href="https://skoda-motorsport.s3.amazonaws.com/com/2016/08/20160827-Rally-Barum-Kopecky-3.jpg">https://skoda-motorsport.s3.amazonaws.com/com/2016/08/20160827-Rally-Barum-Kopecky-3.jpg</a></figcaption></figure><p>ทั้ง 2 หน้าที่จะมีมุมมองต่อ Code ที่ต่างกันออกไป Driver นั้นจะคิดในมุม Technical รวมถึง Detail ต่างๆ ของ Code ที่เขียน ส่วน Navigator นั้นจะเป็นคนที่มองภาพใหญ่ของระบบมากกว่า</p><p><strong>2. Ping Pong 🏓 </strong>— โดย Technical นี้นั้นส่วนมากจะถูกใช้ร่วมกับ TDD และจะทำงานได้อย่างดีเมื่อเรามี Task งานที่ชัดเจน โดยเราจะแบ่งการทำงานเป็น 2 Part คือ Ping กับ Pong</p><ul><li>Ping คือการที่ Developer A จะเริ่มเขียน Test โดย Test ที่เขียนนั้นจะล้อไปกับ Business Requirement และเมื่อ Run Test ก็จะ Fail เนื่องจากยังไม่มีการเขียน Code เพื่อแก้หรือ Implement Function ในส่วนนั้นขึ้นมา</li><li>Pong คือการที่ Developer B นั้นจะเริ่ม Implement Function นั้นเพื่อให้ Test ผ่าน</li><li>โดยในรอบถัดไป Developer B อาจจะเปลี่ยนหน้าที่ตัวเองเป็น Ping แทนก็ได้</li><li>ละในแต่ละรอบของคนที่เป็น Pong ก็สามารถ ทำการ Refactor Code ก่อนท่ีจะไปเริ่มเขียน test ถัดไปให้ Fail ได้อีกด้วย ซึ่งวิธีนี้เป็นการทำตาม “Red-Green-Refactor” ซึ่ง Red หมายถึงการที่เราเขียน Test ให้ Fail และ Green หมายถึงการที่เราเขียนให้ผ่าน Minimum Requirement และจากนั้นเราค่อย Refactor และค่อยเริ่มกระบวนการนี้ใหม่อีกรอบ</li></ul><p><strong>3. Strong-Style Pairing </strong>💪 — เทคนิคนี้เป็นเทคนิคที่ดีสำหรับการทำ Knowledge Transfer ที่ค่อนข้างได้ผลดี โดยมีกฏอยู่ว่า “การที่เราจะเปลี่ยนไอเดียของเราให้เป็น Code นั้น จำเป็นที่จะต้องผ่านมือใครสักคนที่ไม่ใช่เรา” ใน Style นี้นั้น Navigator จำเป็นจะต้องเป็นคนที่มีประสบการณ์อย่างมากในการเขียน ในขณะที่ผู้ที่เป็น Driver นั้นจะเป็นผู้ที่พึ่งเริ่มต้นเขียนหรือไม่ชิน (ไม่ชินทั้งในเรื่องของภาษาที่ใช้เขียน, เครื่องมือ IDE ต่างๆ, รวมไปถึง Codebase และสิ่งต่างๆ) ส่วนมากผู้ที่มีประสบการณ์จะเป็น Navigator และคอยนำทาง Driver ในการเขียน Code ส่วนต่างๆ</p><p><strong>4.</strong> <strong>Pair Development 🧑‍🤝‍🧑</strong> — “Pair Development” จริงๆ แล้วไม่ใช่การ Pair สำหรับทาง Technical ขนาดนั้นแต่เป็น Mindset ที่เรามีต่อการ Pair โดยที่เราสามารถเริ่มได้จาก</p><ul><li>เข้าใจปัญหา — เราควรจะ Pair เพื่อเข้าใจปัญหาก่อนที่จะกระโดดลงไปเขียน Code เลย เพราะอาจจะทำให้การเขียน Code ของเรานั้นไปผิดทางหรือไม่ถูกต้องได้</li><li>การคิด Solution — Pair เพื่อคุยหรือ Discuss ถึง Solution ที่เราต้องการที่จะแก้ไข</li><li>วางแผนการ Step ถัดๆไปสำหรับการทำ Pair — เราจำเป็นต้องทำอะไรบ้างเพื่อที่จะทำ Solution นั้นให้สำเร็จ, มีอะไรไหมที่เราจำเป็นจะต้องคิดเสมอระหว่างการ Coding หรือเราจะ Test สิ่งๆนี้นยังไงดี โดยอาจจะใช้การเขียนลง Document หรือ Sticky Notes เพื่อบันทึกถึงสิ่งที่เรากำลังจะทำก็ได้</li></ul><h3><strong>เรื่องอื่นๆ นอกจาก Style ในการ Pair ของเรา</strong></h3><ul><li><strong>การบริหารเวลาระหว่างการ Pair Programming (Time Management)</strong> — นอกจาก Style การ Pair ต่างแล้ว ยังมีเครื่องมีต่างๆ ที่ช่วยทำให้เราทำ Pair Programming ได้ง่ายขึ้น เช่น การใช้ Pomodoro Technique 🍅 ที่ช่วยให้เราจับเวลาในการทำงานและก็มีการพักตลอดทุกๆ 25 นาที ข้อดีของการทำ Time Management นั้นคือทำให้เราไม่เหนื่อยเกินไปในการทำงานและยัง Focus กับสิ่งที่ทำอยู่ตลอด</li><li><strong>การเปลี่ยนตำแหน่งระหว่างผู้ Pair (Pair Rotations)</strong> — เราควรจะเปลี่ยนคู่ Pair ไปเรื่อยๆ เมื่อถึงจุดนึงจะการเปลี่ยนตำแหน่งของการ Pair ช่วยให้เราได้ไอเดียที่เปลี่ยนไปจากการคู่ที่เรา Pair ด้วย นอกจากนี้ยังทำให้คนที่เห็น Code ของ Task นี้มีเพิ่มขึ้นด้วย โดยการเปลี่ยนคู่ Pair นั้นเราจะต้องมีหนึ่งคนที่เป็น Anchor ⚓️ หรือเป็นที่จะอยู่ต่อในงาน Task นั้นเพื่อถ่ายทอดความรู้ไปให้อีกคน</li><li><strong>วางแผนการ Pair สำหรับวันนั้น (Plan the Day)</strong> — เราควรจะตั้งข้อกำหนดของการ Pair ไว้โดยอาจจะคุยกับคู่ Pair ของเราว่าจะ Pair วันละกี่ชม เวลากี่โมง โดยอาจจะใช้ Calendar ในการตั้งว่าเราจะ Pair กันเวลาไหน เพื่อให้เราสามารถวางแผนได้ว่าเวลาที่เหลือของวันเราจะไปทำงานอะไรบ้าง</li><li><strong>การ Set Up สภาพแวดล้อมในการ Pair</strong> — การเซ็ต Physical Space หรือการสร้างสภาพแวดล้อมของการทำงานที่ทำให้เราสามารถ Pair ได้ง่ายที่สุด เช่น การเซ็ค Mouse, Keyboard, หูฟัง หรือ IDE ให้เหมาะสมที่สุดสำหรับการทำงาน</li><li><strong>การทำ Remote Pairing</strong> — ถ้าหากเราต้องทำการ Remote ซึ่งเกิดขึ้นมากในยุคนี้ เราควรที่จะเช็คอุปกรณ์ต่างๆ ให้พร้อมรวมไปถึงถ้าหากเป็นไปได้ก็ควรจะเปิดกล้องหรือวีดิโอคอลระหว่าง Pair ด้วย เพราะจะช่วยให้เราเห็นสีหน้าของผู้ที่ Pair ด้วยได้</li><li><strong>Have a Donut Together 🍩</strong> — ฉลองกับความสำเร็จหลังงานเสร็จกับคู่ Pair เพื่อทำให้เรารู้สึกมีแรงที่จะทำงานใน Task ต่างๆ ต่อไป อีกทั้งยังช่วยให้ความสัมพันธ์ระหว่างเรากับคู่ Pair ก็ดีขึ้นอีกด้วย</li></ul><h3><strong>สิ่งที่ควรหลีกเลี่ยงระหว่างการ Pair</strong></h3><ul><li>อย่าใจลอย หรือทำอย่างอื่นระหว่าง Pair ที่ไม่เกี่ยวข้อกับการทำงาน Task นั้น เพราะจะทำให้การ Pair ไม่มีประสิทธิภาพ</li><li>อย่า Micro-management ที่จะคอยจับผิด คอยสั่งทุกการกระทำของคนที่เรา Pair ด้วย เพราะการทำแบบนี้อาจจะทำให้คู่ที่เรา Pair ด้วยนั้นรู้สึกอึดอัด และอาจจะกระทบถึงความสัมพันธ์ได้ ดังนั้นเราควรระวังเรื่องการเป็น Micro-management โดยไม่รู้ตัว</li><li>ใจร้อน บางทีการที่คนที่เป็น Driver ยังไม่ได้ทำตามที่ Navigator ต้องการอาจะเป็นเพราะระหว่างนั้น Driver อาจจะกำลังอยู่ในกระบวนการคิดว่าจะทำอะไรเป็นสิ่งถัดไป และบางที่การที่เราใจร้อนยเกิดไปอาจจะไปขัดกระบวนการคิดของคนที่เป็น Driver ได้</li><li>อย่า Control Keyboard คนเดียว ลองสลับกันเป็นคนเขียน Code อาจจะทำให้การ Pairing ของคุณดีขึ้นก็ได้ 🙂</li><li>อย่า Pair 8 ชั่วโมงต่อวัน เพราะอาจจะเหนื่อยเกินไป และอย่าลืมว่าคุณมีงานอย่าอื่นนอกจากการเขียน Code อีก เช่น การ Check email 📧 , 1:1 Meeting, Researching/Learning 📚</li></ul><p><strong><em>อย่าลืมว่าทั้งหมดที่แนะนำมาอาจจะไม่ใข่สิ่งที่ถูกต้องที่สุดในการ Pair</em></strong> — เนื่องจากคนเราแต่ละคนมีเรื่องต่างๆ ที่ต่างกันออกไป ทั้ง Styles ที่ชอบ, Personalities, ประสบการณ์ รวมไปถึงสถานการณ์ต่างๆ ที่เจอ งานต่างๆ ระหว่างวัน และอีกหลายๆปัจจัย ดังนั้นถ้าหากเราลองทำสิ่งไหนแล้วไม่ใช่ลองเริ่มเปิดใจกับคู่ที่เรา Pair ดูว่าเราจะปรับปรุงการ Pair ให้ดีขึ้นได้อย่างไร</p><h3>อุปสรรคในการ Pair Programming (Challenges)</h3><ul><li><strong>ความเหนื่อยล้าจาก Pairing</strong> — เมื่อคุณทำงานคนเดียวคุณสามารถที่จะหยุดทำงานเมื่อไรก็ได้ แต่เมื่อเราทำการ Pair นั้นเราจำเป็นที่จะต้อง Focus มากๆ รวมถึงจะต้องคุยกับคนอื่นๆ อีกด้วยทำให้อาจจะทำให้เหนื่อยล้ากว่าการทำงานแบบปกติได้ ดังนั้นอย่าลืมวางแผนเวลาพักเมื่อทำการ Pair ไว้ด้วย</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*6_XS1zyAJXx5fh9orL9AKA.jpeg" /><figcaption><a href="https://i0.wp.com/winkgo.com/wp-content/uploads/2018/10/37-Best-Exhausted-Memes-22.jpg?w=800&amp;ssl=1">https://i0.wp.com/winkgo.com/wp-content/uploads/2018/10/37-Best-Exhausted-Memes-22.jpg?w=800&amp;ssl=1</a></figcaption></figure><ul><li><strong>การ Collaboration นั้นอาจจะเกิดขึ้นได้ยาก</strong> — เนื่องจากการทำงานกับอีกคนในระยะเวลาที่นานจำเป็นต้องใช้ Empathy และ Interpersonal Skill ที่ค่อนข้างสูง เพราะแต่ละคนก็มี Soft-skill ที่แตกต่างกัน ดังนั้นเราจึงควรที่จะพูดคุยกับเพื่อนที่ Pair ด้วยกันก่อนเริ่ม Pair เพื่อสร้างสัมพันธ์ที่ดีก่อน Pair เช่น การพูดคุยทักทาย หรือการถามว่าต้องการ Pair ในรูปแบบไหน และเมื่อ Pair เสร็จอาจจะมีการให้ Feedback กันเพื่อให้เกิดพัฒนาในการ Pair ครั้งถัดๆไป</li><li><strong>อาจจะโดนรบกวนการ Pair ได้โดย Meeting</strong> — ในการทำงานอาจจะมีประชุมที่ชอบแทรกมาบ่อยๆ ซึ่งอาจจะทำให้รบกวนเวลาการ Pair ได้ ทางที่ดีเราควรจะล็อคเวลาในปฏิทินของเราเลยว่าจะ Pair ช่วงไหนบ้าง</li><li><strong>ระดับหรือความแตกต่างของการสกิล</strong> — รับฟังความคิดเห็นของคนที่เรา Pair ด้วย และกล้าที่จะพูดในสิ่งที่เราคิดหรือสิ่งที่เราต้องการออกมา จะช่วยให้เราสามารถลดความต่างของ Skill ที่เป็นปัญหาได้</li><li><strong>Power Dynamic</strong> — เป็นหนึ่งในข้อสำคัญของที่อาจจะเป็นปัญหาใหญ่สุดของการ Pair เลยก็ว่าได้ เพราะสิ่งนี้เกิดจากระดับชั้นของคนที่ Pair ด้วยกันไม่เสมอกัน เช่น Junior — Senior, Non-men — Men, Career Changers — Folks with a CS Degree, People of Color — White Folks โดยการแก้อาจจะทำโดยการเตือนหรือบอกคนที่มีอำนาจมากกว่าให้เค้ารู้ถึงความรู้สึกที่เกิดขึ้น รวมทั้งการฝึก anti-bias ก็ช่วยในเรื่องนี้ได้เช่นกัน</li><li><strong>Pair โดยที่ไม่รู้อะไรเลย</strong> — ในบางครั้ง Task ที่ทำนั้นก็ใหญ่เกินไป จนคนที่ pair ทั้งคู่ไม่มีไอเดียเลยว่าจะทำมันอย่างไร หรือบางที่เราจะต้องทำงานกับ Technology ที่ใหม่มากๆ ที่ไม่เคยใช้มาก่อนก็อาจจะเป็นปัญหาได้ ดังนั้นเราอาจจะทำการ Spike(อารมณ์คล้ายๆ Research) ก่อนที่จะ Pair เพื่อให้รู้หลักการทำงานจริงๆที่จะเกิดขึ้น และอย่าลืมที่จะแชร์ความรู้ที่ได้มาให้กับทีมด้วย</li><li><strong>ไม่มีเวลาสำหรับตัวเอง</strong> — บางทีการ Pair ในเวลามากๆ ก็อาจจะทำให้เรารู้สึกไม่มีเวลากับตัวเองเท่าไร เช่น บางครั้งเราอยากจะลองอ่าน Code ลองอ่าน Document เอง สิ่งที่เราทำได้นั้นคืออย่า Pair ทั้งวัน เต็มที่ในแต่ละวันอาจจะแค่ 6 ชั่วโมงพอ เพื่อให้เราได้มีเวลาไปเรียนรู้เรื่องใหม่ๆ หรือการทำความเข้าใจเกี่ยวกับปัญหาของ Task นั้นๆ</li></ul><h3>เมื่อไรที่เราไม่ควร Pair ?</h3><p>ของทุกอย่างมีสองด้านเสมอการ Pairing ก็เช่นกัน เราควรเลือกใช้การ Pair ให้ถูกต้อง แล้วเมื่อไรที่เราควร Pair และ ไม่ควร Pair</p><ul><li><strong>งานบางอย่างที่น่าเบื่อเกินไป</strong> — Code บางอย่างหรือบาง Ticket เราอาจจะรู้คำตอบของมัน หรือรู้อยู่แล้วว่าต้องทำยังไงก็ไม่จำเป็นจะต้อง Pair ก็ได้ แต่ควรจะระวังเรื่อง Code Smell ที่เกิดขึ้นด้วย เพราะถ้าไม่มีคู่ Pair แล้วโอกาสที่จะเกิด Code Smell ก็มีได้ง่ายขึ้น</li><li><strong>“เราสามารถทำสิ่งนี้เองได้ไหม”</strong> — เนื่องจากคนเราทุกคนไม่เหมือนกัน บางที Junior บางคนอาจจะรู้สึกไม่สบายใจที่จะต้องเขียน Code และมีคนคอยดูอยู่ตลอดเวลา Junior บางคนอาจจะชอบการเรียนรู้ที่เริ่มเรียนด้วยตัวเองมากกว่าดังนั้นเราอาจจะให้เค้าทำงานด้วยตัวเองก่อน ถ้าเค้ามีปัญหาอะไรค่อยช่วยเช็คหรือให้คำแนะนำก็ได้</li></ul><p>อย่างที่เราบอกใน intro ว่าการทำ Pair Programming นั้นจะมีประโยชน์ใน Medium-Long Term เป็นส่วนใหญ่ และเราเชื่อว่าสุดท้ายแล้ว Software ส่วนมากก็ต้องการการ Maintain ในระยะยาว อย่างมีคุณภาพ ดังนั้น Pair Programming อาจจะเป็นหนทางที่ทุกคนกำลังตามหาอยู่ก็ได้ สุดท้ายนี้เนื่องจากการ Pairing นั้นเป็นเรื่องที่ขึ้นอยู่กับทั้งเราและผู้ Pair เป็นอย่างมาก สิ่งที่เราบอกในบทความนี้อาจจะเป็นได้เพียงแค่ Guideline สำหรับการ Pair เท่านั้น อย่าลืมปรับการ Pair ให้เหมาะสมกับตัวเรา และคู่ของเราด้วย ขอให้สนุกกับการ Pair ครับ🙂</p><p>ปล. ถ้ามีเนื้อหาส่วนไหนที่ผิดพลาดไปหรือต้องการเพิ่มเติมเรื่องใดสามารถบอกด้านล่างได้เลยนะครับ 🙏</p><p><strong>ref:</strong> <a href="https://martinfowler.com/articles/on-pair-programming.html">https://martinfowler.com/articles/on-pair-programming.html</a></p><p><strong>Special Thanks</strong></p><ul><li><a href="https://www.linkedin.com/in/waragon-manothumsatit-46ab6b19b/">Waragon Manothumsatit</a></li><li><a href="https://www.linkedin.com/in/waritphon-sriphrom-9abb87218/">Waritphon Sriphrom</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffc3c2857db5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สวัสดีครับ วันนี้เราจะมาแนะนำรูปแบบในการเขียน Code อีกแบบนึงที่เรียนกว่า TDD (Test Driven…]]></title>
            <link>https://medium.com/@vachirachat.saw/%E0%B8%AA%E0%B8%A7%E0%B8%B1%E0%B8%AA%E0%B8%94%E0%B8%B5%E0%B8%84%E0%B8%A3%E0%B8%B1%E0%B8%9A-%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%99%E0%B8%B5%E0%B9%89%E0%B9%80%E0%B8%A3%E0%B8%B2%E0%B8%88%E0%B8%B0%E0%B8%A1%E0%B8%B2%E0%B9%81%E0%B8%99%E0%B8%B0%E0%B8%99%E0%B8%B3%E0%B8%A3%E0%B8%B9%E0%B8%9B%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B9%83%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99-code-%E0%B8%AD%E0%B8%B5%E0%B8%81%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%99%E0%B8%B6%E0%B8%87%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B8%81%E0%B8%A7%E0%B9%88%E0%B8%B2-tdd-test-driven-1052e226dbc8?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1052e226dbc8</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Sat, 19 Nov 2022 12:41:37 GMT</pubDate>
            <atom:updated>2022-11-21T23:16:25.699Z</atom:updated>
            <content:encoded><![CDATA[<h3>TDD คืออะไร และมีประโยชน์อะไร ?</h3><h4>ทำ TDD อย่างไรให้ Software เรามีคุณภาพมากยิ่งขึ้น</h4><p>สวัสดีครับ วันนี้เราจะมาแนะนำรูปแบบในการเขียน Code อีกแบบนึงที่เรียกว่า TDD (Test Driven Development) ซึ่งจะช่วยให้ Code ของเรานั้นมีคุณภาพ และ Clean มากยิ่งขึ้น โดยในบทความนี้เราจะพูดถึงว่ามันคืออะไร ประโยชน์คืออะไร ถ้าอยากจะเริ่มทำต้องทำอย่างไรบ้าง และเมื่อไรที่เราไม่จำเป็นที่จะต้องใช้มัน</p><h4>TDD คืออะไร ? Workflow ของ TDD เป็นอย่างไรบ้าง ?</h4><p>Workflow ของ TDD — มีอยู่ 3 step หลักๆ RED(Fail), GREEN(Pass), REFACTOR</p><ul><li>RED (Fail) — เป็น Step ที่เราเริ่มเขียน Test Case ขึ้นมาเพื่อให้มัน Fail</li><li>GREEN (Pass) — เป็น Step ที่เราเขียน Code <em>เพียงแค่เพื่อพอผ่าน Test </em>สำหรับ Function หรือ Task งานนั้นๆ</li><li>REFACTOR — หลังจากที่เรามี Test ที่เรามั่นใจว่ามันครอบคลุมทุกอย่างแล้ว เราก็มั่นใจในการ Refactor Code ของเรามากขึ้น</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQPQYhAuR1SH6joJvNhHSg.png" /><figcaption>REF: <a href="https://www.thoughtworks.com/content/dam/thoughtworks/images/photography/inline-image/insights/blog/testing/blg_inline_test_driven_development_best_thing_has_happened_software_design.png">https://www.thoughtworks.com/content/dam/thoughtworks/images/photography/inline-image/insights/blog/testing/blg_inline_test_driven_development_best_thing_has_happened_software_design.png</a></figcaption></figure><p>TDD เป็น Shift-left Testing คือการที่เราเอางานของ QA มาทำตั้งแต่ใน Development Phase เพื่อ Confirm ว่า Code ของเรานั้นจะมีคุณภาพตั้งแต่ตอนที่เราพัฒนา</p><p>โดยการเขียน Test ก่อนเขียน Code นั้น จะช่วยให้เรามั่นใจได้ว่า Software ที่เราเขียนนั้นจะเป็นตาม Business Requirement ได้จริงๆ และช่วยให้เรา Focus อยู่กับการเขียน Code ที่เกิดขึ้นได้ การเขียน Test ก่อนจะช่วยให้เราเข้าใจปัญหานั้นได้จริงๆ อีกทั้งการเขียน Test จะช่วยกำจัดความกลัว เมื่อเราจำเป็นที่จะต้อง Refactor Code หรือเปลี่ยน Code (เพราะถ้าเราเขียน Test ดีพอ เมื่อเรา Refactor Test ที่เราเขียนก็ยังจะต้องผ่านเหมือนเดิม)</p><p>โดยกฏของ TDD จาก Uncle Bob มีอยู่ด้วยกัน 3 ข้อ</p><ol><li>เขียน Test ขึ้นมาให้ Fail ก่อน เราจะไม่สามารถเขียน Production Code ได้ ยกเว้นการเขียน Production Code นั้นจะทำให้ Unit Test นั้นผ่าน</li><li>เราเขียน Test แค่ที่จะต้องใช้ใน Ticket นั้นๆ ไม่ต้องเขียนเผื่อ ยกตัวอย่างเช่น ถ้าการ์ดใน Jira ของเรานั้นต้องการเขียนเพียงแค่ Function แปลงเงินจากบาทเป็นดอลล่า การเขียน Test ของเรานั้นก็จะมี Scope อยู่แค่การเปลี่ยนเงินจากบาทเป็นดอลล่าเท่านั้น ไม่จำเป็นต้องคิดหรือเขียนเผื่อสำหรับการแปลงค่าเงินอื่นๆ</li><li>หลังจากได้ Test มาแล้ว เราแค่เขียน Code ขึ้นมาเพื่อพอให้ผ่าน Test เท่านั้น เพียงแค่ Code ปัจจุบันที่เราทำอยู่</li></ol><p>หลายคนที่อ่านมาถึงตรงนี้อาจจะสงสัยว่าแล้วมันต่างจาก Unit Test ที่เราเขียนปกติอย่างไร ซึ่งจริงๆ แล้วต่างกันในตอนที่เราจะต้องเขียน Test</p><p>การเขียน Unit Test ปกติ: เขียน Code -&gt; เขียน Unit Test -&gt; อาจจะ Refactor หรือไม่ก็ได้ -&gt; วนกลับไปเขียน Code ใหม่</p><p>การเขียนแบบ TDD: เขียน Unit Test -&gt; เขียน Code -&gt; Refactor Code ที่เขียนใน Step แรก -&gt; วนกลับไปเขียน Unit Test ใหม่</p><p>พอถึงจุดนี้แล้วผมเชื่อว่าทุกคนน่าจะพอเห็นภาพสำหรับการทำ TDD แล้ว ต่อไปเราไปดูกันดีกว่าว่าทำไมการทำ TDD จึงมีประโยชน์มากกว่าการพัฒนาปกติทั่วไป</p><h4>ประโยชน์ของ TDD</h4><ol><li>Business Requirement ชัด — เมื่อเราจะต้องเขียน Test ก่อนมัน Force ให้เราไม่ข้ามไปถึงตัว Code เลย เราจะ Focus ที่ Business Requirement ลูกค้าก่อน (ทำความเข้าใจกับสิ่งที่ลูกค้าอยากจะได้ก่อน)</li><li>Interface Guideline — เป็น Guideline ให้ Developer ได้รู้ว่าโปรแกรมนั้นควรมี Interface ยังไง</li><li>Confident Refactor — มีความมั่นใจมากขึ้นเมื่อต้อง Refactor Code ทำให้ Improve Code ใหม่ได้เรื่อยๆ</li><li>Document — ตัว Test Case เองก็จะเป็น Document สำหรับโปรเจค เพราะถ้าเราอ่าน Code ส่วนไหนไม่เข้าใจ เราก็ยังสามารถอ่านในส่วนของ Test ได้ ว่า Function นั้นๆ ต้องทำอะไร หรือมี Business Requirement อะไร</li></ol><h4>เริ่มทำ TDD อย่างไร ?</h4><ol><li>เริ่มจากการที่เราไม่มี Code อยู่เลย</li><li>เราเริ่มเขียน Simple Test สำหรับงาน Task นั้นๆ เขียนแค่พอตอบโจทย์ของทาง Business Requirement พอ เมื่อรัน Test ก็จะ Fail (RED Step) เพราะเรายังไม่มีการ Implement Code ในส่วนนั้น ขั้นถัดไปเราจะเริ่ม Implement เขียน Code ให้ผ่าน</li><li>เขียน Code เพื่อให้ Test Case จากข้อ 1 นั้นผ่าน ซึ่งเมื่อผ่านเราก็จะไปอยู่ใน GREEN Step พร้อมที่จะ Refactor Code ต่อไป</li><li>Refactor Code เมื่อเราสามารถทำให้ Test ของเราผ่านได้แล้วนั้น เราก็จะเริ่มทำการ Refactor ได้ โดยที่ Test จะมาค่อยช่วยให้เรามั่นใจได้ว่า Code ที่เรา Refactor นั้นยังคงทำงานได้เหมือนเดิม และยังตอบ Business Requirement แบบเดิมได้</li><li>วน Loop กลับไปข้อ 1 ใหม่</li></ol><h4>เมื่อไรที่เราไม่จำเป็นต้องใช้ TDD (อยากใช้ก็ได้นะ แต่ไม่ใช้ก็ได้)</h4><ul><li>เมื่อเราต้องขึ้น Project อะไรไวๆ เช่น Demo ของบางโปรเจคหรือ MVP ต่างๆ เนื่องจาก TDD นั้นค่อนข้างใช้เวลามากในการพัฒนาเพื่อแลกกับการที่ Code นั้นมีคุณภาพ TDD จึงไม่เหมาะกับอะไรที่ต้องการขึ้นไวๆ หรือโปรเจคที่สร้างขึ้นมาในระยะเวลาอันสั้น</li><li>โปรเจคที่ Simple มากๆ Business Requirement ไม่ได้ซับซ้อน เราอาจจะไม่จำเป็นต้องใช้ TDD ในการเขียน Code ก็ได้</li></ul><p>สำหรับใครที่อยากดูการ Live Coding TDD หรืออยากรู้เกี่ยวกับ TDD เพื่มขึ้นก็สามารถเข้าไปดูใน Live ที่ทาง Thoughtworks <strong>ได้ Live เดี่ยวกับเรื่องนี้ได้</strong><a href="https://www.facebook.com/thoughtworksthailand/videos/559719698463322"><strong><em>ที่นี่</em>เ</strong></a><strong>ลยครับ</strong></p><p>สำหรับใครที่อ่านแล้วอยากเสริมเพิ่มเติมอะไรที่เกี่ยวข้องกับ TDD ก็สามารถพิมพ์ Comment ทิ้งไว้ด้านล่างนี้ได้เลยครับ🙂</p><h3>Special Thanks:</h3><ul><li><a href="https://www.linkedin.com/in/waragon-manothumsatit-46ab6b19b/">Waragon Manothumsatit</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1052e226dbc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database Sharding คืออะไร ?]]></title>
            <link>https://medium.com/@vachirachat.saw/database-sharding-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-a02e1b9967ae?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a02e1b9967ae</guid>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Wed, 08 Jun 2022 16:30:00 GMT</pubDate>
            <atom:updated>2022-07-24T15:38:36.229Z</atom:updated>
            <content:encoded><![CDATA[<h3>อยากสเกลให้ Database รับโหลดได้เยอะๆ (Database Sharding คืออะไร)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aq_K9xeBLdf9ZdXrDC4XVw.jpeg" /><figcaption>picture from <br>Jan Antonin Kolar <a href="https://unsplash.com/photos/lRoX0shwjUQ">https://unsplash.com/photos/lRoX0shwjUQ</a></figcaption></figure><h3>ทำไมต้องทำ Database Sharding</h3><ul><li>เมื่อเราต้องการ scale ระบบให้ใหญ่ขึ้น โดยปกติแล้วเราสามารถ scale pod บน Kubenetes หรือ scale server แต่สุดท้ายแล้วเราก็อาจจะคอขวดที่ Database ได้ จึงมีอีกหนึ่งเทคนิคที่เกิดขึ้นมาเพื่อช่วยให้เราสามารถ scale ระบบได้โดยที่คอขวดที่ Database คือ “Database Sharding”</li></ul><h3>การทำ Database Sharding คือ</h3><ul><li>พยายามแบ่งข้อมูลเป็น partition หรือเป็นส่วนๆ เพื่อเก็บลง Database ที่แตกต่างกัน ทำให้เราสามารถรองรับ load ที่จะเข้าไปใน database ได้มากขึ้น นอกจากนี้ยังช่วยในการทำงานเวลา read ข้อมูลด้วยเช่นกัน</li></ul><h3>ข้อดีของการทำ sharding</h3><ul><li>ช่วยให้เราสามารถ horizontal scaling ได้ดีขึ้น แทนที่จะเป็นการเพิ่ม Ram หรือ CPU ทำให้สามารถรับ traffic และ process ได้เร็วขึ้น</li></ul><h3>แต่นอกจากข้อดีแล้วข้อเสียของการ sharding ก็มีเช่นกัน</h3><ul><li>ในการทำ sharding บางทีอาจจะทำให้เกิดการสูญเสียหรือข้อมูล ข้อมูลได้ในบางครั้งถ้าเรา setup ไม่ดี</li><li>ถ้าหาก algorithm ในการ sharding ไม่ดีพอ อาจจะทำให้ Database บางลูกรับ load มากกว่า Database ลูกอื่นได้</li><li>ถ้าหากเราใช้ Database sharding แล้ว อยากกลับไปใช้ Database แบบไม่ sharding ค่อนข้างเป็นไปได้ยาก เพราะเราต้องรวม Database ขึ้นมาใหม่</li><li>อย่างสุดท้ายคือการทำ sharding จะมีบาง database engine ไม่รองรับ</li></ul><h3>วิธีการออกแบบการ sharding หรือ Sharding Architecture</h3><ul><li>Key Based Sharding — ตามชื่อเลยคือการ sharding ด้วย Primary Key เอา Primary Key เป็นตัวแบ่ง</li><li>Range Based Sharding — เป็นการ sharding ตามช่วง เช่น เราอาจจะแบ่งจากช่วงของตัวเลขเป็นหลัก</li><li>Directory Based Sharding — เป็นการแบ่งโดยการกำหนด Zone ของแต่ละข้อมูลขึ้นมาเพื่อใช้เป็นการ lookup ข้อมูล</li></ul><p>นอกจากการ​ Sharding แล้วเรายังมีอีกหลายๆ ท่าในการช่วย optimize ระบบของเราให้รับ load ได้เยอะขึ้นได้ เช่น การ caching, การสร้าง replica สำหรับการอ่าน หรือกการ scale server</p><p>สำหรับใครที่อยากอ่านเพิ่มเติมเกี่ยวกับ Database Sharding อย่างละเอียดสามารถเข้ามาอ่านได้<a href="https://www.digitalocean.com/community/tutorials/understanding-database-sharding">ที่นี่</a>เลยครับ🙂 มีตัวอย่างประกอบและมีข้อดีข้อเสียของแต่ละการ Sharding แต่ละประเภทให้ดูด้วย สำหรับใครที่เห็นข้อมูลผิดหรือสงสัยอะไร หรืออยากรู้อะไรเพิ่มเติมสามารถพิมพ์ comment ไว้ได้เลยนะค้าบ🫡</p><p>ref: <a href="https://www.digitalocean.com/community/tutorials/understanding-database-sharding">https://www.digitalocean.com/community/tutorials/understanding-database-sharding</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a02e1b9967ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สร้างเว็บสมัครสอบด้วย React]]></title>
            <link>https://medium.com/@vachirachat.saw/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A%E0%B8%AA%E0%B8%A1%E0%B8%B1%E0%B8%84%E0%B8%A3%E0%B8%AA%E0%B8%AD%E0%B8%9A%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-react-5b7bf6c09809?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b7bf6c09809</guid>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Mon, 16 Dec 2019 05:48:42 GMT</pubDate>
            <atom:updated>2019-12-16T05:48:42.293Z</atom:updated>
            <content:encoded><![CDATA[<p>สวัสดีครับ วันนี้จะมาสอนการทำหน้าเว็บด้วย react และ node โดยเว็บที่เราจะทำนั้นจะเป็นเว็บสำหรับการสมัครสอบออนไลน์ ซึ่งเราของจะดึงข้อมูลการสอบมาจากการสอบ DebugExam นะครับ แต่อันนี้ผู้เขียนไม่ได้ที่ส่วนเกี่ยวข้องกับการสอบนี้แต่อย่างไร ถ้าใครอยากทำเว็บสมัครสอบของตัวเองที่เป็น frontend ก็แค่เปลี่ยนข้อมูลหรือปรับข้อมูลต่างๆตามที่ต้องการได้เลยงั้นมาเริ่มกันเลยครับ</p><p>ก่อนอื่นเลยขอปูพื้นฐานสำหรับเรื่องความรู้ทั่วไปของ React ที่ต้องใช้เรียนรู้ในการทำโปรเจคนี้นะ เรื่องแรกเลยคือเรื่องของ component ใน React และอีกเรื่องคือเรื่องของ State</p><p><strong>Component ใน react</strong></p><p>แต่เดิมการเขียนเว็บจะเขียนเป็นหน้าๆ โดยที่ยัดโค้ดทั้งหมดลงไปในหน้านั้น ทำให้มีความยุ่งยากในการจัดการ code อีกทั้งยังแก้ไขได้ลำบากอีกด้วย เพราะ code ในหน้านั้นมันเยอะแยะ และงงไปหมด react จึงสร้าง component มาเพื่อแตกส่วนต่างๆในหน้าเว็บให้ออกเป็นส่วนๆ แล้วค่อยมารวมในหน้าเดียว ทำให้การแก้ไขโค้ดหรือการออกแบบจัดการโค้ดเป็นระเบียบมากขึ้น ยกตัวอย่างเช่น ถ้าหน้าเว็บเราต้องการให้มีการให้ข้อมูลการสมัครสอบและวิธีการสมัครสอบ เราก็อาจจะแยกอันนี้เขียนเป็น 2 component แล้วค่อยเอามารวมในหน้าเดียวกัน และค่อยปิดท้ายหน้าเว็บด้วย footer โดยแต่ละ component ก็จะมีความสามารถที่สามารถโยนข้อมูลเข้าไปเพื่อให้แสดงผลตามข้อมูลที่ถูกโยนเข้าไปได้ด้วย ซึ่งสิ่งที่โยนเข้าไปใน Component เราจะเรียกสิ่งนั้นว่า Props เหมือนเป็นตัวเก็บข้อมูลที่เราต้องการเรียนเข้าไป</p><p><strong>State ใน react</strong></p><p>state จะเป็นเหมือนตัวจัดเก็บข้อมูลในหน้านั้นๆเพื่อเอาไปใช้ต่อ โดยจะเอาไปใช้พื่อส่งข้อมูลให้ server หรือใช้เพื่อให้ไปแสดงผลในหน้าถัดไป หรือแสดงใน component ที่ใช้อยู่ก็ได้ โดย State ที่เก็บใน class component และ function component ก็จะมีการเรียกใช้งานที่ต่างกันออกไป ถ้าเราต้องการเรียกหรือเปลี่ยนข้อมูล state ใน class เราจะใช้คำสั่งว่า this.setState({[ชื่อ state]:[ค่า stateที่ต้องการเปลี่ยนให้เป็น]}) แต่ถ้าเป็น function component จะไม่มี this.setState ให้เลือกใช้เพราะไม่มีการประกาศ state ตั้งแต่แรกใน function อยู่แล้วดังนั้นเราจึงต้องใช้ hook มาช่วยแก้ปัญหาตรงนี้โดยเราจะประกาศให้ state ของเราเป็นตัวแปรตัวนึงใน function นั้นก่อนโดยการใช้คำสั่งที่ว่า const [count,setCount] = useState(0) ก็จะเป็นการเซ็ตตัวแปร count ให้เป็น 0 ใน state เริ่มต้นและ เมื่อไรที่เราต้องการเปลี่ยนค่าของตัวแปร count ก็เพียงสั่งว่า setCount(count+1) ค่า count ก็จะถูกเปลี่ยนทุกครั้งที่เรากด</p><p><strong>Life Cycle ใน react</strong></p><p>อันนี้เป็นเรื่องที่อาจจะต้องใช้บ้างในการเขียน react สมัยเก่าแต่ใส่มาเผื่อเอาไว้555555 ส่วนมากอันนี้จะใช้กับการเขียนใน class component เป็นการเขียนเพื่อจัดการข้อมูลต่างๆ ที่เริ่มอัพเดท โดยส่วนนี้จะพูดถึงนิดเดียวเพราะไม่ได้ใช่ในโปรเจคนี้ <br>- componentDidMount เป็นเหมือนการเซตจัดการข้อมูลเริ่มต้นก่อนทำหรือจัดการข้อมูลใน class นั้น<br>- componentDidUpdate จะถูกเรียกหลังจากข้อมูลใน component แล้วมีการอัพเดท แต่ อันนี้จะไม่ถูก render ตอนแรก componentDidMount</p><p>งั้นเรามาเริ่มการส้รางหน้าเว็บ react กันเลยดีกว่า ให้เปิด terminal หรือ cmd ขึ้นมาเพื่อพิมพ์คำสั่งที่เราจะใช้ในการสร้าง โดย cd ไปใน directory ที่ต้องการสร้างแอพหรือที่เก็บงานของเรา จากนั้นพิมพ์คำสั่งว่า</p><pre>npx create-react-app</pre><p>หลังจากปล่อยให้มันทำงานจนเสร็จแล้วค่อย cd เข้าไปใน folder ที่เราสร้างแล้วพิมพ์ว่า code . เพื่อเป็นการเปิด code editor ที่เราเซ็ตเป็นค่า default ขึ้นมาเพื่อแก้ไขไฟล์</p><p>มาหลังจากนี้เราจะมาดูการสร้าง structure คร่าวๆต่างๆก่อน</p><p>ใน folder node_modules จะเป็นสถานที่ไว้เก็บข้อมูลของ node ต่างๆไว้ในนี้</p><p>src คือส่วนที่เก็บข้อมูลของหน้าเว็บเพจเราที่ต้องการจะปรับแต่ง เช่น การเก็บ component การเก็บหน้าเพจ การเก็บรูปภาพที่แสดงในเพจ และเก็บไฟล์ css ต่างๆ ที่เราต้องใช้ไว้ใน folder นี้ส่วนมากเราจะแก้ไขหรือปรับแต่งใน folder นี้เป็นส่วนมาก</p><p>packlock.json package-lock.json เป็นส่วนที่ใช้ในการเก็บข้อมูลจัดการคำสั่งต่างๆใน react</p><p>นอกจากนี้ในโปรเจคนี้เราจำเป็นต้องใช้หลายๆอย่างจาก npm ด้วยฉะนั้นอย่างลืมลง nodejs ใว้ในเครื่องนะครับ โดยคำสั่งปกติที่ใช้สำหรับการลง library ต่างๆผ่าน npm คือ</p><pre>npm install ตามด้วยชื่อที่เราต้องการจะลง</pre><p>และ UI framework ที่เราจะใช้กันในโปรเจคนี้คือ bootstrap ข้อดีของการใช้ UI framework คือมันช่วยให้เราไม่จำเป็นต้องพัฒนา css ให้ทั้งหมดตั้วแต่ต้น และสามารถแสดงผลได้สวยงามกว่าการไม่ใช้อีกด้วย</p><p>โดยหน้าหลักๆของเว็บสมัครสอบเราจะมีหน้าแรก อารมณ์ประมาณ landing page และหน้าที่ใช้ login และ register ในการสมัครสอบ หน้าที่มี component เยอะที่สุดจะเป็หน้า register และหน้าหลัก โดยที่ทุกหน้าจะมีการส่วนของ navbar อยู่ในทุกหน้าเป็นเหมือนแถบนำทางเพื่อให้ไปในแต่ละหน้า งั้นเราจะเริ่ม code จาก navbar -&gt; landing page -&gt; register -&gt; login</p><p><strong>Navbar</strong></p><pre>import React from &#39;react&#39;;</pre><pre>import &#39;../style/style.css&#39;;</pre><pre>import Link from &#39;react-router-dom&#39;;</pre><pre>import Logo from &#39;../pic/Logo.png&#39;;</pre><pre>export default function Navbar() {</pre><pre>&lt;a id=&#39;logoNav&#39; class=&quot;navbar-brand&quot; href=&quot;/&quot;&gt;&lt;img src={Logo} style={{width:&#39;40px&#39;}}/&gt;&lt;/a&gt;</pre><pre>&lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#navbarNav&quot; aria-controls=&quot;navbarNav&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot;&gt;</pre><pre>&lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;</pre><pre>&lt;/button&gt;</pre><pre>&lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarNav&quot;&gt;</pre><pre>&lt;ul class=&quot;navbar-nav&quot;&gt;</pre><pre>&lt;/ul&gt;</pre><pre>&lt;a id=&#39;loginButton&#39; class=&#39;btn btn-outline-green&#39; href=&quot;/login&quot; &gt;Login&lt;/a&gt;</pre><pre>&lt;/nav&gt;</pre><pre>)</pre><pre>}</pre><p>โดย navbar เราเขียนออกมาเป็น function component เมื่อเราเขียนออกมาเสร็จปุ๊บจะได้หน้าตาของ navbar แบบนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2NX2P5UCNPjdWH-M-b0JA.png" /></figure><p>โดยที่เราสามารถเปลี่ยน logo ได้ตามที่ต้องการเลย และสามารถเปลี่ยนสีได้ตามที่ต้องการใน file css เหมือนกัน ต่อไปเราจะมาทำในส่วนหน้าตาหลักของ landing page</p><p>Landing page</p><p>ในส่วนนี้เราจะแบ่ง component ออกเป็น 4ส่วนหลักๆ โดยข้อมูลหลักๆเรามาจากเว็บเพจของ debugExam แต่ทางผู้เขียนไม่ได้มีส่วนได้ส่วนเสียกับงานจัดสอบครั้งนี้นะครับย้ำอีกรอบ555555<br>1 คือการบอกว่าการสอบนี้เป็นอะไร ทำไมต้องสอบ debug<br>2 จะมีกราฟที่คอยการวิเคราะห์ผลการสอบ<br>3 ค่าใช้จ่ายและกำหนดการวันต่างๆ<br>4 footer สำหรับการหาข้อมูลเพิ่มเติม<br>โดยที่เราจะมาเริ่ม code ในแต่ละส่วนกันเลยเริ่มจากส่วนที่ 1</p><pre>import React from &#39;react&#39;;</pre><pre>import Register from &#39;./Register&#39;;</pre><pre>import Logo from &#39;../pic/Logo.png&#39;;</pre><pre>import Fade from &#39;react-reveal/Fade&#39;;</pre><pre>export default function FirstCompPage() {</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;div id=&#39;firstContainer&#39; style={{ backgroundColor: &quot;#00b78b&quot; }}&gt;</pre><pre>&lt;div class=&#39;row&#39;&gt;</pre><pre>&lt;div class=&#39;col-lg-4 col-sm-12&#39;&gt;</pre><pre>&lt;Fade cascade&gt;</pre><pre>&lt;img id=&#39;firstMainLogo&#39; src={Logo} style={{ width: &#39;300px&#39;, borderRadius: &#39;10px&#39; }} /&gt;</pre><pre>&lt;/Fade&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&#39;col-lg-6 col-sm-12&#39; style={{ color: &#39;white&#39; }}&gt;</pre><pre>&lt;Fade cascade duration={4000}&gt;</pre><pre>&lt;div id=&quot;firstMainContent&quot;&gt;</pre><pre>&lt;h1 class=&quot;display-4&quot;&gt;การสอบ Debug คืออะไร?&lt;/h1&gt;</pre><pre>&lt;p class=&quot;lead&quot;&gt;การสอบวัดผลวิชาคณิตศาสตร์ ที่ประเมินความสามารถทางคณิตศาสตร์ของน้องๆ และเปรียบเสมือน Pre-test สำหรับข้อสอบ 7 วิชาสามัญ และ PAT1 ในสภาพสนามจริงอย่างแท้จริง</pre><pre>ข้อดียิ่งไปกว่านั้นก็คือ ผลสอบของเราชี้จุดอ่อน ไม่ว่าจะเป็นความสะเพร่า แม่นยำ หรือพื้นฐานในแต่ละบทออกมาให้น้องๆ ได้เห็นกันจะจะ พร้อมนำไปปรับปรุงทุกและพัฒนาได้ทันท่วงที ไม่ต้องไปพลาดในวันสอบจริงอีกด้วย!&lt;/p&gt;</pre><pre>&lt;a id=&#39;register1&#39; class=&#39;btn btn-outline-green&#39; href=&#39;/register&#39;&gt;Register&lt;/a&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/Fade&gt;</pre><pre>&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</pre><pre>&lt;div id=&#39;whyDebug&#39; style={{textAlign:&#39;center&#39;}}&gt;</pre><pre>&lt;div class=&#39;display-3 kanitFont&#39;&gt;&lt;Fade duration={3000}&gt;ทำไมต้องสอบ Debug&lt;/Fade&gt;&lt;/div&gt;</pre><pre>&lt;div class=&#39;display-4 kanitFont&#39; style={{ color: &#39;#c8171e&#39; }}&gt;&lt;Fade duration={4000}&gt;คะแนนสอบเลขดี สอบอะไรก็ติด!&lt;/Fade&gt;&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div id=&#39;rowInFour&#39; class=&#39;row&#39;&gt;</pre><pre>&lt;div class=&#39;col-lg-4&#39;&gt;</pre><pre>&lt;div  style={{marginBottom:&#39;50px&#39;,marginTop:&#39;50px&#39;}}&gt;</pre><pre>&lt;div class=&#39;h2 kanitFont&#39;&gt;เสมือนจริงที่สุด&lt;/div&gt;</pre><pre>&lt;ul class=&#39;10ul&#39;  &gt;</pre><pre>&lt;li&gt;&lt;div class=&#39;h6&#39;&gt;ทีมงานคุณภาพที่ออกแนวข้อสอบมาใกล้เคียงกับแนวของ สทศ มากที่สุด ทั้งจำนวนข้อ การติดตะแนน และสัดส่วนบทที่ออกสอบ&lt;/div&gt;&lt;/li&gt;</pre><pre>&lt;/ul&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&#39;10ul&#39;&gt;</pre><pre>&lt;div class=&#39;h2 kanitFont&#39;&gt;จำลองบรรยากาศ&lt;/div&gt;</pre><pre>&lt;ul&gt;</pre><pre>&lt;li&gt;&lt;div class=&#39;h6&#39;&gt;จำลองบรรยากาศการสอบเหมือนจริงมากที่สุด ภายใต้ความกดดันและเวลาจำกัดในการทำข้อสอบ&lt;/div&gt;&lt;/li&gt;</pre><pre>&lt;/ul&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&#39;col-lg-3&#39;&gt;</pre><pre>&lt;img src={Logo} style={{width:&#39;100%&#39;}}/&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&#39;col-lg-4&#39;&gt;</pre><pre>&lt;div  style={{marginTop:&#39;50px&#39;,marginBottom:&#39;50px&#39;}}&gt;</pre><pre>&lt;div class=&#39;h2 kanitFont&#39;&gt;มีเฉลยข้อสอบละเอียด&lt;/div&gt;</pre><pre>&lt;ul&gt;</pre><pre>&lt;li&gt;&lt;div class=&#39;h6&#39;&gt;เมื่อสอบเสร็จแล้วสามารถนำข้อสอบกลับบ้านได้ เอาไว้รอเช็คกับเฉลยอย่างละเอียด พร้อมทบทวนหรือทำซ้ำได้ทุกเมื่อ ทุกเวลาที่ต้องการ&lt;/div&gt;&lt;/li&gt;</pre><pre>&lt;/ul&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div&gt;</pre><pre>&lt;div class=&#39;h2 kanitFont&#39;&gt;รอประกาศผลภายใน 15 วัน&lt;/div&gt;</pre><pre>&lt;ul&gt;</pre><pre>&lt;li&gt;&lt;div class=&#39;h6&#39;&gt;ประกาศผลคะแนนแยกตามบทและแยกตามทักษะทางคณิตศาสตร์ในแต่ละด้าน พร้อมวิเคราะห์ผลอย่างละเอียด&lt;/div&gt;&lt;/li&gt;</pre><pre>&lt;li&gt;&lt;div class=&#39;h6&#39;&gt;มีข้อสอบช้อยห์เอาไว้หลอก หากน้องๆผิดพลาด จะมีการบอกจุดผิดเหล่านั้นให้ในหน้าประกาศผลสอบ&lt;/div&gt;&lt;/li&gt;</pre><pre>&lt;/ul&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>)</pre><pre>}</pre><p>โดยส่วนนี้หลักจาก สั่งรันและให้ขึ้นหน้าเว็บแล้วก็จะได้หน้าตาประมาณนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hN64ehnEIMSimXNEw8mk6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bhvo51y7IcwX_MY4wH118A.png" /></figure><p>โดยมันจะเป็นแบบนี้ได้ต้องมีการ Import ได้ style.css ด้วยซึ่งเดะเราจะใส่ไว้ให้ในด้านล่าง ต่อไปเป็นส่วนที่ 2 คือส่วนที่จะมีการบอกการวิเคราะห์ผลต่างๆ ซึ่งเราจะมีกราฟในนั้นด้วย</p><pre>import React,{Component} from &#39;react&#39;;</pre><pre>import Chart from &quot;react-apexcharts&quot;;</pre><pre>class ChartEx extends Component {</pre><pre>constructor(props) {</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>options: {</pre><pre>chart: {</pre><pre>id: &quot;basic-bar&quot;,</pre><pre>tools:{</pre><pre>download: false,</pre><pre>}</pre><pre>},</pre><pre>xaxis: {</pre><pre>categories: [&#39;โจทย์ยาก&#39;, &#39;โจทย์ง่าย&#39;, &#39;โจทย์ปานกลาง&#39;, &#39;ลำดับ&#39;, &#39;อนุกรม&#39;]</pre><pre>}</pre><pre>},</pre><pre>series: [</pre><pre>{</pre><pre>name: &quot;series-1&quot;,</pre><pre>data: [30, 40, 45, 50, 49]</pre><pre>}</pre><pre>]</pre><pre>};</pre><pre>}</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;div className=&quot;app&quot;&gt;</pre><pre>&lt;div className=&quot;row&quot;&gt;</pre><pre>&lt;div id=&#39;radarChart&#39; className=&quot;mixed-chart col-lg-6 col-sm-12&quot;&gt;</pre><pre>&lt;Chart id=&#39;chartObj&#39;</pre><pre>options={this.state.options}</pre><pre>series={this.state.series}</pre><pre>type=&quot;radar&quot;</pre><pre>width=&#39;500&#39;</pre><pre>/&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div id=&#39;annuExamDetail&#39; class=&#39;col-lg-5 col-sm-12&#39;&gt;</pre><pre>&lt;h1&gt;การวิเคราะห์ผลอย่างละเอียด&lt;/h1&gt;</pre><pre>&lt;lead&gt;ทมีการวิเคราะห์ผลอย่างละเอียดทุกๆข้อเพื่อให้น้องๆ สามารถนำผลที่วิเคราะห์ได้นำไปใช้งานต่อได้ ทำให้น้องๆรู้จุดบอดและสามารถปรับแก้ไขได้ก่อนลงสนามจริง&lt;/lead&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>);}}</pre><pre>export default ChartEx;</pre><p>โดยส่วนของกราฟเราไม่ได้ code กราฟเองทั้งหมดเรามีการดึง library บางส่วนของกราฟมาใช้ด้วยซึ่งดูได้จากที่ import กราฟเลย</p><p>ส่วนต่อไปคือส่วนที่จะบอกเรื่องรายละเอียดการสอบว่าสมัครสอบวันไหน กี่โมงสอบวันไหนบ้าง</p><pre>import React from &#39;react&#39;;</pre><pre>import Fade from &#39;react-reveal/Fade&#39;;</pre><pre>import CountUp from &#39;react-countup&#39;;</pre><pre>export default function SecondCompPage() {</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;div id=&#39;secondCom&#39; class=&quot;jumbotron jumbotron-fluid&quot;&gt;</pre><pre>&lt;div class=&#39;row&#39; id=&#39;priceExam&#39; &gt;</pre><pre>&lt;Fade&gt;&lt;h0 class=&#39;display-4&#39; &gt;ราคาค่าใช้จ่ายในการสมัครสอบ&lt;/h0&gt;&lt;/Fade&gt;</pre><pre>&lt;Fade&gt;&lt;h0 id=&#39;price&#39; class=&#39;display-4&#39; &gt;&lt;CountUp end={300} duration={5} /&gt; บาท&lt;/h0&gt;&lt;/Fade&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div id=&#39;dateReg&#39; class=&#39;row&#39;&gt;</pre><pre>&lt;Fade left cascade duration={2000} delay={1000}&gt;</pre><pre>&lt;table id=&#39;regTable&#39; class=&quot;table table-bordered col-lg-3&quot; &gt;</pre><pre>&lt;tbody&gt;</pre><pre>&lt;tr&gt;</pre><pre>&lt;th scope=&quot;row&quot;&gt;สมัครสอบ&lt;/th&gt;</pre><pre>&lt;td&gt;15-30 ตุลาคม 2562&lt;/td&gt;</pre><pre>&lt;/tr&gt;</pre><pre>&lt;tr&gt;</pre><pre>&lt;th scope=&quot;row&quot;&gt;ประกาศที่นั่ง&lt;/th&gt;</pre><pre>&lt;td&gt;15 พฤศจิกายน 2562&lt;/td&gt;</pre><pre>&lt;/tr&gt;</pre><pre>&lt;tr&gt;</pre><pre>&lt;th scope=&quot;row&quot;&gt;สอบจริง&lt;/th&gt;</pre><pre>&lt;td&gt;30 พฤศจิกายน 2562&lt;/td&gt;</pre><pre>&lt;/tr&gt;</pre><pre>&lt;tr&gt;</pre><pre>&lt;th scope=&quot;row&quot;&gt;ประกาศผล&lt;/th&gt;</pre><pre>&lt;td&gt;1 ธันวาคม 2562&lt;/td&gt;</pre><pre>&lt;/tr&gt;</pre><pre>&lt;/tbody&gt;</pre><pre>&lt;/table&gt;</pre><pre>&lt;/Fade&gt;</pre><pre>&lt;Fade right cascade duration={3000} delay={1000}&gt;</pre><pre>&lt;div id=&#39;regDetail&#39; class=&#39;col-lg-6&#39; style={{color: &#39;#00b78b&#39; }}&gt;</pre><pre>&lt;div class=&#39;h1&#39;&gt;เหลือเวลาอีก 3 วันในการสมัครสอบ&lt;/div&gt;</pre><pre>&lt;div class=&#39;h1&#39;&gt;สมัครสอบคลิ๊กเลย&lt;/div&gt;</pre><pre>&lt;a class=&#39;btn btn-outline-green&#39; href=&#39;/register&#39;&gt;Register&lt;/a&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/Fade&gt;</pre><pre>&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</pre><pre>)}</pre><p>ซึ่งหน้าตาที่ได้ก็จะออกมาเป็นประมาณนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ow67pW3t2_vGXsH4unLAkQ.png" /></figure><p>จากนั้นก็จะมาถึงส่วนสุดท้ายคือส่วนของ footer เป็นส่วนที่จะคอยให้ information ในการติดต่อต่างๆ ไปยังช่องทางอื่นๆ เช่น facebook line youtube โดยที่เรามีการ import รูป logo จาก folder ที่เก็บรูปเอาไว้ด้วย จากนั้นก็เอามาใส่ link เพื่อให้ลิ้งค์ไปในช่องทางที่เราเซ็ตเอาไว้ได้</p><pre>import React from &#39;react&#39;;</pre><pre>import &#39;../style/style.css&#39;;</pre><pre>import lineIcon from &#39;../pic/socialIcon/iconmonstr-line-3-240.png&#39;;</pre><pre>import facebookIcon from &#39;../pic/socialIcon/iconmonstr-facebook-3-240.png&#39;;</pre><pre>import youtubeIcon from &#39;../pic/socialIcon/iconmonstr-youtube-8-240.png&#39;;</pre><pre>export default function Footer(){</pre><pre>return (</pre><pre>&lt;div style={{color:&#39;white&#39;,backgroundColor:&#39;black&#39;,paddingTop:&#39;20px&#39;}}&gt;</pre><pre>&lt;div&gt;</pre><pre>&lt;div class=&#39;display-4&#39; style={{textAlign:&#39;center&#39;}}&gt;DEBUGEXAM 2019&lt;/div&gt;</pre><pre>&lt;h2 id=&#39;FollowUs&#39; style={{textAlign:&#39;center&#39;}}&gt;Follow us:&lt;/h2&gt;</pre><pre>&lt;div class=&#39;row&#39; id=&#39;footerContent&#39; style={{alignItems:&#39;center&#39;}}&gt;</pre><pre>&lt;div&gt;&lt;a href=&#39;https://www.facebook.com/debugexam/&#39;&gt;&lt;img src={facebookIcon} style={{ width: &#39;48px&#39;, borderRaefdius: &#39;10px&#39;,marginLeft:&#39;10px&#39;}} /&gt;&lt;/a&gt;&lt;/div&gt;</pre><pre>&lt;div&gt;&lt;img src={lineIcon} style={{ width: &#39;48px&#39;, borderRadius: &#39;10px&#39;,marginLeft:&#39;10px&#39; }} /&gt;&lt;/div&gt;</pre><pre>&lt;div&gt;&lt;a href=&#39;https://www.youtube.com/channel/UC3m3skmSIqwSmrZjTTRYNIQ&#39;&gt;&lt;img src={youtubeIcon} style={{ width: &#39;48px&#39;, borderRadius: &#39;10px&#39;,marginLeft:&#39;10px&#39;}} /&gt;&lt;/a&gt;&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div style={{textAlign:&#39;center&#39;}}&gt;COPYRIGHT2019@vachirachat&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>)}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6kVsBE6HpO8eB3tHfJXhg.png" /></figure><p>ต่อไปที่เราจะทำคือหน้า register</p><p><strong>Register</strong></p><p>หน้านี้เราไม่อยากให้ผู้ที่สมัครสอบรู้สึกว่าต้องกรอกข้อมูลเยอะมากๆ เราเลยจะแบ่งหน้า register เป็นหลายๆหน้าย่อยๆ เป็น stepๆ เพื่อลดความรู้สึกว่าการสมัครสอบจะต้องกรอกเยอะ โดยเราจะแบ่งทั้งหมดเป็น 4 step และจะมีหน้า register ใหญ่ 1 หน้าที่คอยรวบรวมข้อมูลจากการกรอกแต่ละหน้าย่อยๆ มาไว้ในหน้าเดียว โดย code ที่ผมได้เขียนไว้จะเป็นการส่งข้อมูลผ่าน props ซึ่งมีอีกวิธีที่ใช้ได้คือการส่งข้อมูลผ่าน store แต่ไม่ได้ใช้ในคราวนี้ งั้นเรามาเริ่มที่หน้า register ใหญ่กันก่อนเลย</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>import Register1 from &#39;../components/registerStep/Register1&#39;;</pre><pre>import Register2 from &#39;../components/registerStep/Register2&#39;;</pre><pre>import Register3 from &#39;../components/registerStep/Register3&#39;;</pre><pre>import Register4 from &#39;../components/registerStep/Register4&#39;;</pre><pre>import &#39;../style/style.css&#39;;</pre><pre>import {Progress} from &#39;reactstrap&#39;;</pre><pre>import {withRouter} from &#39;react-router-dom&#39;;</pre><pre>import {registerUser} from &#39;../actions/authActions&#39;;</pre><pre>import { connect } from &quot;react-redux&quot;;</pre><pre>import PropTypes from &#39;prop-types&#39;;</pre><pre>import axios from &#39;axios&#39;;</pre><pre>import { fromBits } from &#39;long&#39;;</pre><pre>class Register extends Component {</pre><pre>constructor(props){</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>step: 1,</pre><pre>IDCard: &#39;&#39;,</pre><pre>conIDCard: &#39;&#39;,</pre><pre>phoneNumber: &#39;&#39;,</pre><pre>name: &#39;&#39;,</pre><pre>surname: &#39;&#39;,</pre><pre>email: &#39;&#39;,</pre><pre>school: &#39;&#39;,</pre><pre>grade: &#39;&#39;,</pre><pre>}</pre><pre>}</pre><pre>componentDidMount() {</pre><pre>// If logged in and user navigates to Register page, should redirect them to dashboard</pre><pre>if (this.props.auth.isAuthenticated) {</pre><pre>this.props.history.push(&quot;/dashboard&quot;);</pre><pre>}</pre><pre>}</pre><pre>nextStep = () =&gt; {</pre><pre>const { step } = this.state;</pre><pre>this.setState({</pre><pre>step: step + 1</pre><pre>});</pre><pre>};</pre><pre>prevStep = () =&gt; {</pre><pre>const { step } = this.state;</pre><pre>this.setState({</pre><pre>step: step - 1</pre><pre>});</pre><pre>};</pre><pre>//for get data from textField</pre><pre>handleChange = input =&gt; e =&gt; {</pre><pre>e.preventDefault();</pre><pre>const {name,value} = e.target;</pre><pre>let errors = this.state.errors;</pre><pre>this.setState({ [input]: e.target.value });</pre><pre>};</pre><pre>handleSubmit = () =&gt; {</pre><pre>console.log(&#39;handleSubmit&#39;)</pre><pre>const { IDCard, conIDCard, phoneNumber, name, surname, email, school, grade, payment } = this.state;</pre><pre>const values = { IDCard,conIDCard, phoneNumber, name, surname, email, school, grade, payment };</pre><pre>}</pre><pre>render() {</pre><pre>const { step } = this.state;</pre><pre>const { IDCard, phoneNumber,conIDCard, name, surname, email, school, grade, payment,errors } = this.state;</pre><pre>const values = { IDCard,conIDCard , phoneNumber, name, surname, email, school, grade, payment ,errors};</pre><pre>switch (step) {</pre><pre>case 1:</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;Progress id=&#39;progressRegister&#39;animated color=&#39;greenDebug&#39; value=&quot;25&quot;&gt;1/4&lt;/Progress&gt;</pre><pre>&lt;Register1 nextStep={this.nextStep} handleChange={this.handleChange}</pre><pre>values={values} errors={this.errors}/&gt;</pre><pre>&lt;/div&gt;</pre><pre>);</pre><pre>case 2:</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;Progress id=&#39;progressRegister&#39;animated color=&#39;greenDebug&#39; value=&quot;50&quot;&gt;2/4&lt;/Progress&gt;</pre><pre>&lt;Register2 nextStep={this.nextStep} prevStep={this.prevStep} handleChange={this.handleChange}</pre><pre>values={values} /&gt;</pre><pre>&lt;/div&gt;</pre><pre>);</pre><pre>case 3:</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;Progress id=&#39;progressRegister&#39; animated color=&#39;greenDebug&#39; value=&quot;75&quot;&gt;3/4&lt;/Progress&gt;</pre><pre>&lt;Register3 data={this.state} nextStep={this.nextStep} prevStep={this.prevStep} handleChange={this.handleChange} handleSubmit={this.handleSubmit}</pre><pre>values={values} /&gt;</pre><pre>&lt;/div&gt;</pre><pre>)</pre><pre>case 4:</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;Progress id=&#39;progressRegister&#39; animated color=&#39;greenDebug&#39; value=&quot;100&quot;&gt;4/4&lt;/Progress&gt;</pre><pre>&lt;Register4 nextStep={this.nextStep} prevStep={this.prevStep} handleChange={this.handleChange}</pre><pre>values={values} /&gt;</pre><pre>&lt;/div&gt;</pre><pre>)</pre><pre>}}}</pre><p>โดยเราจะส่งข้อมูลต่างๆ และโยน function ที่เรียกว่า nextStep และ prevStep ไปเป็น props เพื่อให้ component ที่มารับสามารถใช้งานได้ และมากการส่งข้อมูลกลับเข้ามาที่ values หลัก นอกจากนี้เรายังมีการใส่ progress bar ไว้เพื่อบอก user ด้วยว่าอยู่ที่ step ไหนและเหลืออีกกี่ step ที่ต้องทำ และมี function handleChange สำหรับการเปลี่ยนแปลงของข้อมูล</p><p>register 1</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>import SimpleReactValidator from &#39;simple-react-validator&#39;;</pre><pre>export class Register1 extends Component {</pre><pre>constructor(props){</pre><pre>super(props);</pre><pre>}</pre><pre>continue = e =&gt;{</pre><pre>if ((this.props.values.IDCard.length != 13 || this.props.values.IDCard != this.props.values.conIDCard || this.props.values.phoneNumber.length != 10)){</pre><pre>alert (&#39;กรุณากรอกข้อมูลให้ถูกต้อง&#39;);</pre><pre>}else{</pre><pre>e.preventDefault();</pre><pre>this.props.nextStep();</pre><pre>}</pre><pre>};</pre><pre>render() {</pre><pre>const handleChange = this.props.handleChange;</pre><pre>const values = this.props.values;</pre><pre>const errors = this.props.values.errors;</pre><pre>console.log(this.props);</pre><pre>console.log(errors);</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;form class=&#39;col-lg-5 col-sm-12&#39;&gt;</pre><pre>&lt;h1&gt;ขั้นตอนสมัคร STEP 1&lt;/h1&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;IDCard&quot;&gt;รหัสบัตรประชาชน 13 หลัก&lt;/label&gt;</pre><pre>&lt;input type=&#39;number&#39; class=&quot;form-control&quot; id=&quot;IDCard&quot; placeholder=&quot;x-xxxx-xxxxx-xx-x&quot; onChange={handleChange(&#39;IDCard&#39;)}  /&gt;</pre><pre>&lt;small style={{color:&#39;red&#39;}}&gt;{this.props.values.IDCard.length != 13 &amp;&amp; this.props.values.IDCard.length != 0 &amp;&amp; &#39;กรุณาใส่รหัสบัตรประชาชนให้ถูกต้อง&#39; }&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;conIDCard&quot;&gt;ยืนยันรหัสบัตรประชาชน 13 หลัก&lt;/label&gt;</pre><pre>&lt;input type=&#39;number&#39; class=&quot;form-control&quot; id=&quot;comIDCard&quot; placeholder=&quot;x-xxxx-xxxxx-xx-x&quot; onChange={handleChange(&#39;conIDCard&#39;)}   /&gt;</pre><pre>&lt;small style={{color:&#39;red&#39;}}&gt;{this.props.values.IDCard != this.props.values.conIDCard &amp;&amp; this.props.values.conIDCard.length != 0 &amp;&amp; &#39;บัตรประชาชนไม่ตรงกับด้านบน&#39;}&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;phoneNumber&quot;&gt;เบอร์โทรศัพท์มือถือ&lt;/label&gt;</pre><pre>&lt;input type=&#39;number&#39; class=&quot;form-control&quot; id=&quot;phoneNumber&quot; placeholder=&#39;xxx-xxx-xxxx&#39; onChange={handleChange(&#39;phoneNumber&#39;)} required=&#39;true&#39; /&gt;</pre><pre>&lt;small style={{color:&#39;red&#39;}}&gt;{this.props.values.phoneNumber.length != 10 &amp;&amp; this.props.values.phoneNumber.length != 0 &amp;&amp; &#39;กรุราใส่หมายเลขโทรศัพท์ให้ถูกต้อง&#39;}&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;button class=&#39;btn btn-outline-green&#39;  onClick={this.continue}&gt;ต่อไป&lt;/button&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/div&gt;</pre><pre>)}}</pre><pre>export default Register1;</pre><p>ในส่วนของด้านการกรอกข้อมูลเราจะมีการใส่ code ประมาณนี้ไว้เพื่อcheck ว่าข้อมูลที่ user กรอกนั้นถูกต้องมั้ย{this.props.values.phoneNumber.length != 10 &amp;&amp; this.props.values.phoneNumber.length != 0 &amp;&amp; &#39;กรุณาใส่หมายเลขโทรศัพท์ให้ถูกต้อง&#39;} ถ้าไม่ถูกต้องก็จะมีข้อความสีแดงเตือนขึ้นมาว่าสิ่งที่กรอกมานั้นไม่ถูกต้อง user จะได้ทำการแก้ไขให้ถูกต้องได้ และ type ของ input ต่างๆ ก็ใส่ตามที่เราเห็นสมควรว่าจะต้องใส่ เช่น บางอันควรเป็น dropdown บางอันต้องเป็นตัวเลข บางอันต้องเป็น string</p><p>register 2</p><pre>import React,{Component} from &#39;react&#39;;</pre><pre>import &#39;../../style/style.css&#39;;</pre><pre>import {Alert} from &#39;reactstrap&#39;;</pre><pre>function validateEmail(email) {</pre><pre>var re = /^(([^&lt;&gt;()\[\]\\.,;:\s@&quot;]+(\.[^&lt;&gt;()\[\]\\.,;:\s@&quot;]+)*)|(&quot;.+&quot;))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;</pre><pre>return re.test(String(email).toLowerCase());</pre><pre>}</pre><pre>export class Register2 extends Component{</pre><pre>continue = e =&gt;{</pre><pre>e.preventDefault();</pre><pre>if (validateEmail(this.props.values.email)){</pre><pre>this.props.nextStep();</pre><pre>}else{</pre><pre>alert(&#39;กรุณากรอก Email ให้ถูกต้อง&#39;);</pre><pre>}</pre><pre>}</pre><pre>back = e =&gt;{</pre><pre>e.preventDefault();</pre><pre>this.props.prevStep();</pre><pre>};</pre><pre>render(){</pre><pre>console.log(this.props.values);</pre><pre>const {values,handleChange} = this.props;</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;form&gt;</pre><pre>&lt;h1&gt;ขั้นตอนสมัคร STEP 2&lt;/h1&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;name&quot;&gt;ชื่อ-นามสกุล&lt;/label&gt;</pre><pre>&lt;input class=&quot;form-control&quot; id=&quot;name&quot; aria-describedby=&quot;nameHelp&quot; onChange={handleChange(&#39;name&#39;)}/&gt;</pre><pre>&lt;small id=&quot;nameHelp&quot; class=&quot;form-text text-muted&quot;&gt;ใส่คำนำหน้าด้วย เช่น นายหรือนางสาว&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;Email&quot;&gt;Email&lt;/label&gt;</pre><pre>&lt;input class=&quot;form-control&quot; type=&quot;email&quot; id=&quot;Email&quot; onChange={handleChange(&#39;email&#39;)}/&gt;</pre><pre>&lt;small style={{color:&#39;red&#39;}}&gt;{!validateEmail(this.props.values.email) &amp;&amp; &quot;กรุณาใส่ email ให้ถูกต้อง&quot;}&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;School&quot;&gt;โรงเรียน&lt;/label&gt;</pre><pre>{/*bug*/}</pre><pre>&lt;select class=&#39;custom-select&#39; id=&#39;input1&#39; onChange={handleChange(&#39;school&#39;)} data-live-search=&quot;true&quot;&gt;</pre><pre>&lt;option selected&gt;เลือกชั้นปีที่กำลังศึกษา&lt;/option&gt;</pre><pre>&lt;option value=&quot;1&quot;&gt;สวนกุหลาบ&lt;/option&gt;</pre><pre>&lt;option value=&quot;2&quot;&gt;เตรียมอุดม&lt;/option&gt;</pre><pre>&lt;option value=&quot;3&quot;&gt;สามเสน&lt;/option&gt;</pre><pre>&lt;option value=&#39;4&#39;&gt;ปทุมวัน&lt;/option&gt;</pre><pre>&lt;/select&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;Grade&quot;&gt;ชั้นปี&lt;/label&gt;</pre><pre>&lt;select class=&quot;custom-select&quot; id=&quot;inputGroupSelect01&quot; onChange={handleChange(&#39;grade&#39;)}&gt;</pre><pre>&lt;option selected&gt;เลือกชั้นปีที่กำลังศึกษา&lt;/option&gt;</pre><pre>&lt;option value=&quot;1&quot;&gt;มัธยมศึกษา 4&lt;/option&gt;</pre><pre>&lt;option value=&quot;2&quot;&gt;มัธยมศึกษา 5&lt;/option&gt;</pre><pre>&lt;option value=&quot;3&quot;&gt;มัธยมศึกษา 6&lt;/option&gt;</pre><pre>&lt;option value=&#39;4&#39;&gt;เกินชั้นมัธยม&lt;/option&gt;</pre><pre>&lt;/select&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;button type=&quot;submit&quot; id=&#39;nextButton&#39; class=&quot;btn btn-outline-green&quot; onClick={this.back}&gt;ย้อนกลับ&lt;/button&gt;</pre><pre>&lt;button type=&quot;submit&quot; class=&quot;btn btn-outline-green&quot; onClick={this.continue}&gt;ต่อไป&lt;/button&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/div&gt;</pre><pre>)}}</pre><pre>export default Register2;</pre><p>register 3</p><p>สำหรับ register 3 ส่วนนี้จะเป็นส่วนที่เกี่ยวข้องกับการจ่ายเงินหรือการกรอกรหัสจากบัตรที่ผู้สมัครสอบซื้อ ซึ่งส่วนนี้จะยังไม่เสร็จจนกว่าจะมีการต่อเข้ากับระบบจ่ายเงินของ Backend แต่ถ้าเรากดปุ่มต่อไปในหน้านี้จะเด้งไปหน้าที่ลงทะเบียนสำเร็จเพราะเป็นหน้าที่เราได้เซ็ตเอาไว้แล้ว</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>import axios from &#39;axios&#39;;</pre><pre>export class Register3 extends Component {</pre><pre>constructor(props){</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>data : this.data,</pre><pre>};</pre><pre>}</pre><pre>}</pre><pre>continue = e =&gt; {</pre><pre>e.preventDefault();</pre><pre>this.props.handleSubmit();</pre><pre>this.props.nextStep();</pre><pre>};</pre><pre>back = e =&gt; {</pre><pre>e.preventDefault();</pre><pre>this.props.prevStep();</pre><pre>};</pre><pre>handleSubmit = e =&gt;{</pre><pre>e.preventDefault();</pre><pre>this.props.handleSubmit();</pre><pre>this.props.nextStep();</pre><pre>};</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;div id=&#39;register3Form&#39; class=&#39;col-lg-5 col-sm-12&#39;&gt;</pre><pre>&lt;h1&gt;ขั้นตอนสมัคร STEP 3&lt;/h1&gt;</pre><pre>&lt;div class=&quot;accordion&quot; id=&#39;accordionExample&#39;&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;div class=&quot;card-header&quot; id=&quot;headingOne&quot;&gt;</pre><pre>&lt;h2 class=&quot;mb-0&quot;&gt;</pre><pre>&lt;button class=&quot;btn btn-link&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#collapseOne&quot; aria-expanded=&quot;true&quot; aria-controls=&quot;collapseOne&quot;&gt;</pre><pre>ใส่โค้ดจากบัตร</pre><pre>&lt;/button&gt;</pre><pre>&lt;/h2&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div id=&quot;collapseOne&quot; class=&quot;collapse show&quot; aria-labelledby=&quot;headingOne&quot; data-parent=&quot;#accordionExample&quot;&gt;</pre><pre>&lt;div class=&quot;card-body&quot;&gt;</pre><pre>&lt;form class=&quot;form-1&quot;&gt;</pre><pre>&lt;div class=&quot;form-group&quot; style={{ marginLeft: &#39;10%&#39; }}&gt;</pre><pre>&lt;label for=&quot;exampleInputEmail1&quot;&gt;กรอกรหัสโค้ดจากบัตรที่ซื้อมา&lt;/label&gt;</pre><pre>&lt;input class=&quot;form-control col-lg-8&quot; id=&quot;codeRegister&quot; style={{ marginBottom: &#39;5px&#39; }} aria-describedby=&quot;emailHelp&quot; placeholder=&quot;กรอกรหัส&quot; /&gt;</pre><pre>&lt;button class=&#39;btn btn-outline-green col-lg-8&#39;&gt;ลงทะเบียน&lt;/button&gt;</pre><pre>&lt;small id=&quot;emailHelp&quot; class=&quot;form-text text-muted&quot;&gt;รหัส 14 หลักที่อยู่หลังบัตร&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;div class=&quot;card-header&quot; id=&quot;headingTwo&quot;&gt;</pre><pre>&lt;h2 class=&quot;mb-0&quot;&gt;</pre><pre>&lt;button class=&quot;btn btn-link collapsed&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#collapseTwo&quot; aria-expanded=&quot;false&quot; aria-controls=&quot;collapseTwo&quot;&gt;</pre><pre>จ่ายด้วยบัตรเครดิต</pre><pre>&lt;/button&gt;</pre><pre>&lt;/h2&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div id=&quot;collapseTwo&quot; class=&quot;collapse&quot; aria-labelledby=&quot;headingTwo&quot; data-parent=&quot;#accordionExample&quot;&gt;</pre><pre>&lt;div class=&quot;card-body&quot;&gt;</pre><pre>omise</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</pre><pre>&lt;div style={{marginTop:&#39;1%&#39;}}&gt;</pre><pre>&lt;button type=&quot;submit&quot; id=&#39;nextButton&#39; class=&quot;btn btn-outline-green&quot; onClick={this.back}&gt;ย้อนกลับ&lt;/button&gt;</pre><pre>&lt;button type=&quot;submit&quot; class=&quot;btn btn-outline-green&quot;</pre><pre>onClick ={(e)=&gt; {</pre><pre>axios.post(&#39;http://localhost:5000/api/users/register&#39;,</pre><pre>this.data2</pre><pre>).then((res) =&gt; {</pre><pre>console.log(res.status);</pre><pre>}).catch((error) =&gt;{</pre><pre>const {response} = error;</pre><pre>console.log(JSON.stringify(error));</pre><pre>alert(JSON.stringify(error[&#39;message&#39;]));</pre><pre>})</pre><pre>this.handleSubmit.bind(this);</pre><pre>}}&gt;ต่อไป&lt;/button&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>)}}</pre><pre>export default Register3;</pre><p>register 4</p><p>หน้านี้จะไม่ค่อยมีอะไรมาก จะเป็นการบอกว่าการลงทะเบียนเสร็จสิ้นแล้วกลับไปหน้าหลักได้</p><pre>import React,{Component} from &#39;react&#39;;</pre><pre>export class Register4 extends Component{</pre><pre>continue = e =&gt;{</pre><pre>e.preventDefault();</pre><pre>this.props.nextStep();</pre><pre>};</pre><pre>back = e =&gt;{</pre><pre>e.preventDefault();</pre><pre>this.props.prevStep();</pre><pre>};</pre><pre>render(){</pre><pre>return (</pre><pre>&lt;div id=&#39;register3Form&#39; class=&#39;col-lg-5 col-sm-12&#39;&gt;</pre><pre>&lt;h1&gt;ขั้นตอนสมัคร STEP 4&lt;/h1&gt;</pre><pre>&lt;h1&gt;การลงทะเบียนสำเร็จเสร็จสิ้น&lt;/h1&gt;</pre><pre>&lt;a class=&quot;btn btn-outline-green&quot; href=&#39;/&#39;&gt;เสร็จสิ้น&lt;/a&gt;</pre><pre>&lt;/div&gt;</pre><pre>)}}</pre><pre>export default Register4;</pre><p>ในส่วนต่อไปที่เราจะทำกันคือส่วนของ login</p><p><strong>Login</strong></p><p>อันนี้ไม่ยาก เพราะมีเพียงแค่ 2่ ช่องให้กรอกเท่านั้นแต่จะต้องมีการส่งข้อมูลไปให้ backend ด้วยซึ่งผมยังไม่เสร็จนะครับ พอส่งข้อมูลไปเสร็จและได้กลับมาก็ควรจะเด้งไปหน้า dashboard ของ user แต่ละคนที่มีข้อมูลแตกต่างกันออกไป</p><pre>import React,{useState} from &#39;react&#39;;</pre><pre>import {Component} from &#39;react&#39;;</pre><pre>import axios from &#39;axios&#39;;</pre><pre>import {loginUser} from &#39;../actions/authActions&#39;;</pre><pre>import {connect} from &#39;react-redux&#39;;</pre><pre>import PropsTypes from &#39;prop-types&#39;;</pre><pre>class LoginForm extends Component {</pre><pre>constructor(props){</pre><pre>super(props);</pre><pre>this.state ={</pre><pre>IDNum:&quot;&quot;,</pre><pre>phone:&quot;&quot;</pre><pre>}</pre><pre>}</pre><pre>render(){</pre><pre>return (</pre><pre>&lt;div&gt;</pre><pre>&lt;form id=&#39;loginForm&#39;&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;exampleInputEmail1&quot;&gt;รหัสบัตรประชาชน&lt;/label&gt;</pre><pre>&lt;input class=&quot;form-control&quot; id=&quot;inputIDNum&quot; aria-describedby=&quot;emailHelp&quot; placeholder=&quot;รหัส 13 หลัก&quot; onChange={(e) =&gt; {this.setState({[this.state.IDNum]:e.target.value})}</pre><pre>}/&gt;</pre><pre>&lt;small id=&quot;emailHelp&quot; class=&quot;form-text text-muted&quot;&gt;กรอกรหัสบัตรประชาชน 13 หลักเพื่อใช้ login&lt;/small&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;form-group&quot;&gt;</pre><pre>&lt;label for=&quot;exampleInputPassword1&quot;&gt;เบอร์โทรศัพท์มือถือ&lt;/label&gt;</pre><pre>&lt;input type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;exampleInputPassword1&quot; placeholder=&quot;Password&quot; onChange={(e) =&gt; {</pre><pre>this.setState({[this.state.phone]:e.target.value})</pre><pre>console.log(this.state.phone);</pre><pre>}} /&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;button type=&quot;submit&quot; class=&quot;btn btn-greenFill&quot; onClick={</pre><pre>(e) =&gt; {</pre><pre>const data = {</pre><pre>&#39;IDNum&#39; : this.state.IDNum,</pre><pre>&#39;phone&#39; : this.state.phone</pre><pre>}</pre><pre>axios.post(&#39;/api/users/login&#39;,data)</pre><pre>.then(res =&gt; {</pre><pre>console.log(res);</pre><pre>}).catch(err =&gt; {</pre><pre>console.log(err);</pre><pre>});</pre><pre>}</pre><pre>}&gt;Login&lt;/button&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/div&gt;</pre><pre>);}}</pre><pre>const mapStateToProps = state =&gt; ({</pre><pre>auth: state.auth,</pre><pre>errors: state.errors</pre><pre>});</pre><pre>export default connect(</pre><pre>mapStateToProps,</pre><pre>{ loginUser }</pre><pre>)(LoginForm);</pre><p>จริงๆหลังจากหน้านี้ควรเป็น dashboard สำหรับการแสดงผลข้อมูลของ user แต่ละคนแต่ส่วนตรงนั้นยังทำไม่เสร็จถ้าทำเสร็จแล้วจะมาเขียน guide ที่สมบูรณ์กว่านี้ให้นะครับ</p><p>style.css</p><pre>body,html{</pre><pre>font-family: &#39;Prompt&#39;, sans-serif;</pre><pre>width:100%;</pre><pre>height:100%;</pre><pre>margin: 0px;</pre><pre>padding:0px;</pre><pre>overflow-x:hidden;</pre><pre>}</pre><pre>.kanitFont{</pre><pre>font-family: &#39;Kanit&#39;, sans-serif;</pre><pre>}</pre><pre>.btn-outline-green{</pre><pre>color:#00b78b;</pre><pre>background-color:#ffffff;</pre><pre>border-color:#00b78b;</pre><pre>}</pre><pre>.btn-outline-green:hover,.btn-outline-green:focus,.btn-outline-green:active{</pre><pre>color:#ffffff;</pre><pre>background-color: #00b78b;</pre><pre>border-color: #ffffff;</pre><pre>}</pre><pre>.btn-greenFill{</pre><pre>color:#ffffff;</pre><pre>background-color: #00b78b;</pre><pre>border-color: #ffffff;</pre><pre>}</pre><pre>.btn-greenFill:hover,.btn-greenFill:focus{</pre><pre>color:#ffffff;</pre><pre>background-color: #00b78b;</pre><pre>border-color: #ffffff;</pre><pre>}</pre><pre>#nextButton{</pre><pre>margin-left:73%;</pre><pre>margin-right:5px;</pre><pre>}</pre><pre>#progressRegister{</pre><pre>width:50%;</pre><pre>margin-left: 25%;</pre><pre>margin-top: 2%;</pre><pre>}</pre><pre>.bg-greenDebug{</pre><pre>background-color: #00b78b;</pre><pre>}</pre><pre>form{</pre><pre>width:40%;</pre><pre>margin-top: 5%;</pre><pre>margin-left: 30%;</pre><pre>}</pre><pre>.form-1{</pre><pre>width:100%;</pre><pre>margin-left:10%;</pre><pre>}</pre><pre>#logoNav{</pre><pre>margin-left: 15%;</pre><pre>}</pre><pre>#register3Form{</pre><pre>margin-left: 30%;</pre><pre>margin-top: 5%;</pre><pre>}</pre><pre>#loginButton{</pre><pre>margin-left: 75%;</pre><pre>}</pre><pre>.loginForm{</pre><pre>width:100%;</pre><pre>}</pre><pre>.form-control:focus{</pre><pre>border-color: #00b78b;</pre><pre>lighting-color: #00b78b;</pre><pre>box-shadow: 0 1px 1px rgba(0, 183, 139, 0.2) inset, 0 0 8px rgba(0, 183, 139, 0.6);;</pre><pre>}</pre><pre>#footerContent{</pre><pre>margin-left:44%;</pre><pre>margin-top: 15px;</pre><pre>margin-bottom: 30px;</pre><pre>}</pre><pre>#firstMainLogo{</pre><pre>margin-left:30%;</pre><pre>}</pre><pre>#FollowUs{</pre><pre>margin-top:10px;</pre><pre>}</pre><pre>#priceExam{</pre><pre>font-size: 64px;</pre><pre>margin-left: 15%;</pre><pre>}</pre><pre>#dateReg{</pre><pre>margin-left: 15%;</pre><pre>}</pre><pre>#whyDebug{</pre><pre>padding-top: 30px;</pre><pre>padding-bottom: 30px;</pre><pre>}</pre><pre>#rowInFour{</pre><pre>padding-bottom: 30px;</pre><pre>margin-left: 10%;</pre><pre>}</pre><pre>#regTable{</pre><pre>font-size: 24px;</pre><pre>margin-top: 2%;</pre><pre>}</pre><pre>#secondCom{</pre><pre>margin-bottom: 0px;</pre><pre>}</pre><pre>#radarChart{</pre><pre>font-size: 64px;</pre><pre>}</pre><pre>#chartObj{</pre><pre>margin-left: 30%;</pre><pre>}</pre><pre>#firstContainer{</pre><pre>padding-top: 100px;</pre><pre>padding-bottom: 100px;</pre><pre>}</pre><pre>#annuExamDetail{</pre><pre>margin-top: 5%;</pre><pre>}</pre><pre>#price{</pre><pre>margin-left: 10px;</pre><pre>}</pre><pre>#dateReg{</pre><pre>margin-top: 30px;</pre><pre>}</pre><pre>#regDetail{</pre><pre>margin-left:20px;</pre><pre>margin-top: 20px;</pre><pre>}</pre><pre>#regTable{</pre><pre>margin-left: 13%;</pre><pre>}</pre><pre>@media only screen and (max-width: 600px){</pre><pre>form{</pre><pre>margin-left:0%;</pre><pre>}</pre><pre>#nextButton{</pre><pre>margin-left:55%;</pre><pre>}</pre><pre>#register3Form{</pre><pre>margin-left: 0%;</pre><pre>}</pre><pre>.form-1{</pre><pre>margin-left: -15px;</pre><pre>}</pre><pre>#logoNav,#loginButton{</pre><pre>margin-left: 0px;</pre><pre>}</pre><pre>#firstMainLogo{</pre><pre>margin-left: 10%;</pre><pre>}</pre><pre>#firstContainer{</pre><pre>padding-top: 20px;</pre><pre>padding-bottom: 20px;</pre><pre>}</pre><pre>#firstMainContent{</pre><pre>padding-left: 10%;</pre><pre>padding-right: 10%;</pre><pre>}</pre><pre>#register1{</pre><pre>margin-left: 37%;</pre><pre>}</pre><pre>#rowInFour{</pre><pre>margin-left: 0px;</pre><pre>}</pre><pre>.ul{</pre><pre>margin-left: -10px;</pre><pre>}</pre><pre>#priceExam{</pre><pre>margin-left: 20px;</pre><pre>width: 90%;</pre><pre>text-align: center;</pre><pre>}</pre><pre>#price{</pre><pre>margin-left: 10%;</pre><pre>}</pre><pre>#regTable{</pre><pre>margin-left:-30px;</pre><pre>}</pre><pre>#regDetail{</pre><pre>margin-left:-20%;</pre><pre>text-align: center;</pre><pre>}</pre><pre>#chartObj{</pre><pre>margin-left: -20%;</pre><pre>}</pre><pre>#annuExamDetail{</pre><pre>text-align: center</pre><pre>}</pre><pre>#footerContent{</pre><pre>margin-left: 25%;</pre><pre>}</pre><pre>}</pre><p><strong>สรุป</strong></p><p>guide ที่เขียนขึ้นมานี้เป็นเพียง guide คร่าวๆว่าจะต้องใช้อะไรหรือต้องทำอะไรบ้างในแต่ละหน้า แต่รายละเดียดในการเขียนยังมีรายละเอียดอีกมากครับ สำหรับคนไหนที่อยากลองเห็นหน้าเว็บว่ามันจะออกมาเป็นยังไงดูได้ที่ลิ้งนี้เลย <a href="https://debugtest-e03da.firebaseapp.com/">https://debugtest-e03da.firebaseapp.com/</a> อันนี้จะเป็นลิ้งที่ให้ลองกดดูว่ามันจะออกมาประมาณนี้ แต่หน้าเว็บนี้ยังไม่สามารถใช้ได้จริงเพราะยังส่งข้อมูลไม่ได้ เป็นเพียงแค่ static web</p><p>และสิ่งที่เราค้นพบว่าจะต้องอ่านเพิ่มและเรียนรู้เพิ่มจากโปรเจคนี้คือ<br>1 การเขียนโค้ดให้เป็นระเบียบสำคัญมาก โปรเจคนี้ยังรู้สึกว่าตัวเองเขียนโค้ดไม่ค่อยเป็นระเบียบ<br>2 เรื่องการ design ต่างๆควรทำก่อนการทำงานแบบละเอียดเพื่อให้ตอนทำงานไม่ต้องมานั่งแก้ใหม่เรื่อยๆ โปรเจคนี้เราแทบไม่ได้ design เลยมาถึงก็ทำเลย เลยอาจทำให้บางส่วนมีปัญหา<br>3 การทำงานให้ทันตาม deadline ควรจัดการงานให้ทัน deadline<br>4 มีเรื่องมากมายที่ให้เรียนรู้อีกมาก เพื่อที่จะเป็น Full stack dev</p><p>สำหรับวันนี้ก็ขอบคุณมากครับที่อ่านมาถึงตรงนี้ ขอบคุณค้าบ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b7bf6c09809" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[หนังสือ SMARTER FASTER BETTER]]></title>
            <link>https://medium.com/@vachirachat.saw/%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-smarter-faster-better-7788cd2a3513?source=rss-175b4e9acbb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7788cd2a3513</guid>
            <category><![CDATA[reading]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Vachirachat "Net" Sawadditwat]]></dc:creator>
            <pubDate>Thu, 27 Jun 2019 20:44:53 GMT</pubDate>
            <atom:updated>2019-06-27T20:44:53.913Z</atom:updated>
            <content:encoded><![CDATA[<p>สวัสดีครับ วันนี้จะมาเล่าหนังสือที่พึ่งอ่านจบให้ฟัง เพราะหลังจากอ่านเล่มนี้จบแล้วได้ประโยชน์เลยอยากจะมาแชร์ให้คนที่อ่านได้อ่านกัน สำหรับหนังสือตอนเดินผ่านในร้านหนังสือสะดุดตามากเพราะรู้สึกว่าชอบหน้าปก55555 หน้าปกดูมินิมอล และก็ไปสะดุดตรงคำโปรยของหนังสือคือ ความลับของ Productivity ที่นักวิทยาศาสตร์อยากบอกคุณ เลยทำให้สนใจเล่มนี้แล้วหยิบมาซื้อมาอ่าน หนังสือเล่มนี้จะเกี่ยวกับการสร้าง productive ในการทำงานต่างๆ หนังสือเล่มนี้จะแบ่งออกมาเป็น 8 บท โดยที่แตละบทผุ้เขียนจะเอาเรื่องราวต่างๆมาร้อยเรียง ตามหลักวิทยาศาสตร์และมีตัวอย่างเรื่องเล่าประกอบ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*qaswXyyL9CR2nsG6PQ3AUQ.jpeg" /></figure><h3>แรงจูงใจ</h3><p>เรื่องแรงจูงใจอันนี้จะเล่าเกี่ยวกับการที่ผู้คนจะมีแรงจูงใจในการทำสิ่งต่างๆในชีวิตได้ยังไง เล่าไปถึงนาวิกโยธิน ผู้คนที่ไปเที่ยวแล้วกลับมาหมดแรงจูงใจ พยาบาลที่เห็นความเจ็บป่วยของเด็กน้อยที่ไม่มีใครสังเกต ที่นี้เราจะสามารถสร้างแรงจูงใจได้อย่างไรให้กับคนหรือตัวเองก็ตาม ถ้าหากเราต้องการสร้างแรงจูงใจให้กับคนอื่นหรือแม้แต่ตัวเองก็ตามเราต้องให้ผู้คนที่เราต้องการสร้างแรงจูงใจสามารถเลือกหรือตัดสนใจในสิ่งที่เค้าต้องการได้ เช่น ถ้าเรามีทีมแล้วอยากให้ทีมมีแรงจูงใจในการทำงานต่างๆ เราก็ควรจะให้อำนาจหรือการตัดสินใจลงให้ลงไปในทีมของเรา ถ้าช่วงแรกไม่สามารถปล่อยให้ทีมเราสามารถทำงานเราอาจจะตั้งคำถามเพื่อโน้มน้าวก่อนในช่วงแรก แต่การตัดสินใจก็ควรจะเป็นของคนที่ทำงานว่าอยากทำงานอย่างไร มนุษย์ส่วนมากจะรู้สึกมีแรงจูงใจเมื่อเค้าสามารถเลือกหรือควบคุมสิ่งที่เค้าทำได้ในงานหรือในสิ่งที่เค้าทำ ให้เค้ามีสิทธิที่ได้เลือกและตัดสินใจ คนที่ทำงานจะรู้สึกว่าเค้ามีอำนาจมนการควบคุม อีกทั้งเราควรสามารถตอบได้ว่าสิ่งที่เราทำนั้นทำไปเพื่ออะไร มันเอื้ออะไรกับเป้าหมายใหญ่ที่เราต้องการที่จะทำ มันจะทำให้เราเลือกตัดสินใจได้มากขึ้นว่าเราควรทำอะไรหรือเลือกทางเดินไหนในชีวิต</p><h3>ทีม</h3><p>google เคยพยายามหาว่า ทีมที่ดีนั้นควรสร้างมาจากอะไร มีใครหรือมีอะไรที่เป็นองค์ประกอบบ้าง เพราะคนส่วนมากอาจเคยคิดว่าการที่เราคนเก่งๆมารวมกัน จะสามารถสร้างทีมที่ดีและสร้างผลงานได้มากกว่าการเอาคนธรรมดามารวมกัน แต่มันเป็นเรื่องที่ผิดการสร้างความเป็นทีมที่ดีของเรานั้นจำเป็นต้องให้ทุกคนได้พูดแบบ free speech คือทุกคนสามารถแสดงและสร้างความคิดเห็นของตัวเองได้และมีทุกคนรับฟังทีมที่ดีไม่จำเป็นจะต้องมีแต่คนที่ทำงานเก่งๆ เท่านั้น แต่ต้องเป็นทีมที่ทำงานได้กันอย่างลงตัว ซึ่งเป็นความสามารถของผู้นำทีมนั้นเอง</p><h3>การตั้งเป้าหมาย</h3><p>อย่างที่เรารู้ว่าเราควรตั้งเป้าหมายเพื่อให้เรามีแรงจูงใจในการทำงานในชีวิต แล้วเราควรสร้างหรือตั้งเป้าหมายอย่างไรเพื่อให้เราสามารถทำงานได้ดีที่สุด ตามหลักการทางวิทยาศาสตร์เราควรจะตั้งเป้าหมายของเราแบบสุดมื้อเอื้อมคือเป้าหมายที่ไม่ง่ายเกินไปที่จะทำได้และก็ไม่ยากเกินไปจนทำไม่ได้ การตั้งเป้าหมายแบบนี้จะช่วยให้เราสามารถทำงานได้มากได้ดีขึ้นกว่าเดิม และส่งเสริมให้เราสามารถพัฒนาความสามารถของตัวเองได้ด้วย แต่ปัญหาคือพอเป้าหมายเริ่มยากแล้วเราจะสามารถจัดการงานนั้นได้อยากไรคำตอบคือการใช้วิธี SMART แบ่งเป้าหมายจากใหญ่ออกเป็นย่อยๆ และต้องชัดเจน ตั้งด้วยว่าความคืบหน้าของเป้าหมายเราใกล้ถึงเป้าหมายเราขนาดไหน มีการตั้งกรอบเวลาชัดเจน การตั้งเป้าหมายแบบ SMART และสุดเอื้อมจะช่วยให้เราใช้ความสามารถทุกอย่างของเราอย่างสุดความสามารถ</p><h3>การ focus</h3><p>การที่เราจะสามารถ focus งานแต่ละงานได้นั้นเราต้องจดจ่อสร้างแบบจำลองทางความความคิด ว่าอนาคตที่กำลังจะเกิดขึ้นเป็นยังไง สิ่งที่เราคาดหวังจะเกิดขึ้นในอนาคตเป็นอย่างไร ลองคิดว่าเป้าหมายของเราคืออะไร อุปสรรคที่เกิดขึ้นมีอะไรเราจะได้หาทางรับมือได้ทัน เล่าสิ่งที่เราจะทำให้ตัวเองฟังว่าสิ่งที่เราจะทำหรือเกิดขึ้นคืออะไร มันจะเป็นเหมือนการรีวิวสิ่งที่เราจะทำในชีวิตได้ดีมากยิ่งขึ้น พอเรารีวิวสิ่งที่เราจะทำแล้วมันจะช่วยให้เราเห็นงานของเราละเอียดได้มากยิ่งขึ้น</p><h3>วิธีการตัดสินใจให้ดีขึ้น</h3><p>ทุกการตัดสินใจในชีวิตของเรามันจะเชื่อมไปถึงสิ่งที่เราจะเกิดขึ้นในขึ้นในอนาคต เช่น ถ้าเราตัดสินใจทำอย่างนึงมันจะส่งเสริมให้เอื้อต่อเป้าหมายใหญ่ในชีวิตของเรา ถ้าเราไม่ตัดสินใจอย่างนั้นก็จะไม่เอื้อต่อเป้าหมายของเรา นั่นเท่ากับว่าการที่เป้าหมายใหญ่ของเรานั้นจะสำเร็จได้เกิดจากการตัดสินใจย่อยๆ ของเราในชีวิต ถ้าเราสามารถตัดสินใจในครั้งย่อยๆได้ถูกมันก็จะเอื้อต่อเป้าหมายเรา การวิธีการช่วยให้ตัดสินใจได้ถูกคือเราควรจะคิดถึงความเป็นไปได้หลายๆ และมองถึงความเป็นไปได้ในการที่การกระทำแต่ละอย่างจะเอื้อต่อเป้าหมายในชีวิตของเรา</p><p>อันนี้เป็นเพียงแค่คร่าวๆ ของหนังสือเล่มนี้นะครับ หนังสือเล่มนี้ส่วนตัวรู้สึกว่าอ่านง่ายสนุก เพราะเรื่องราวต่างๆ มันจะแตกต่างกัน แต่ถ้าค่อนข้างจะหนาเอาเรื่องอยู่เหมือนกัน5555555 ถ้าเต็ม 10 ให้ 6 ไว้คราวหน้าถ้าเจอหนังสือใหม่ๆ จะเอามาเล่ารีวิวให้ฟังนะครับ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7788cd2a3513" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>