LevelUp! Studio » tosawat https://blog.levelup.in.th Experience the new world. Fri, 26 May 2017 10:06:07 +0000 th hourly 1 http://wordpress.org/?v=3.8.1 สร้าง pre-paid card ของ SCB easy https://blog.levelup.in.th/2017/05/26/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-pre-paid-card-%e0%b8%82%e0%b8%ad%e0%b8%87-scb-easy/ https://blog.levelup.in.th/2017/05/26/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-pre-paid-card-%e0%b8%82%e0%b8%ad%e0%b8%87-scb-easy/#comments Fri, 26 May 2017 10:06:07 +0000 http://blog.levelup.in.th/?p=6137 1

2

3

]]>
https://blog.levelup.in.th/2017/05/26/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-pre-paid-card-%e0%b8%82%e0%b8%ad%e0%b8%87-scb-easy/feed/ 0
วิธีทำ https อย่างง่าย https://blog.levelup.in.th/2017/02/28/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%97%e0%b8%b3-https-%e0%b8%ad%e0%b8%a2%e0%b9%88%e0%b8%b2%e0%b8%87%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2/ https://blog.levelup.in.th/2017/02/28/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%97%e0%b8%b3-https-%e0%b8%ad%e0%b8%a2%e0%b9%88%e0%b8%b2%e0%b8%87%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2/#comments Tue, 28 Feb 2017 16:44:41 +0000 http://blog.levelup.in.th/?p=6129 ก่อนหน้านี้ผมได้ลองทำ https ครั้งหนึ่ง ตอนนี้ทำไม่ค่อยเป็น มีปัญหาเยอะมากเลยครับ จนมาเจอเจ้า certbot ครับ คิดว่าน่าจะช่วยให้การทำ https ง่ายขึ้นเยอะ

ก่อนอื่นเข้าไป ที่นี่ ก่อนเลยครับ

แล้วจะมีช่องให้เราเลือก software กับ os ที่เราใช้
1

พอเลือกเสร็จก็จะมีวิธีการทำ https มาให้เราทำตาม step ไปเลยครับ
2

ทีเด็ดสุดๆก็คือ สามารถ auto renew ได้ครับ
3

]]>
https://blog.levelup.in.th/2017/02/28/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%97%e0%b8%b3-https-%e0%b8%ad%e0%b8%a2%e0%b9%88%e0%b8%b2%e0%b8%87%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2/feed/ 0
[UNITY][C#] Projectile https://blog.levelup.in.th/2017/01/31/unityc-projectile/ https://blog.levelup.in.th/2017/01/31/unityc-projectile/#comments Tue, 31 Jan 2017 15:11:00 +0000 http://blog.levelup.in.th/?p=6117 วันนี้จะมานำเสนอ method สำหรับทำให้ obj เคลื่อนที่แบบ projectile นะครับ โดยใช้สูตรทางฟิสิกส์แบบเป๊ะๆกันเลยครับ


IEnumerator projectile(Transform trans, Vector3 from, Vector3 to, float height, float time)
{
trans.localPosition = from;
yield return null;
float Vx = (to.x - from.x) / time;
float Vy = 2 * height / (0.33f * time);
float A1 = -2f * height / Mathf.Pow(0.33f * time, 2);
float t = 0;
while (t <= 0.33f * time)
{
float deltaTime = Time.deltaTime;
float deltaSx = Vx * deltaTime;
Vy += A1 * deltaTime;
float deltaSy = Vy * deltaTime;
trans.localPosition = new Vector3(trans.localPosition.x + deltaSx, trans.localPosition.y + deltaSy);
t += deltaTime;
yield return null;
}
Vy = 0;
float A2 = -2f * (to.y - from.y - height) / Mathf.Pow(0.67f * time, 2);
while (t <= time)
{
float deltaTime = Time.deltaTime;
float deltaSx = Vx * deltaTime;
Vy -= A2 * deltaTime;
float deltaSy = Vy * deltaTime;
trans.localPosition = new Vector3(trans.localPosition.x + deltaSx, trans.localPosition.y + deltaSy);
t += deltaTime;
yield return null;
}
}

]]>
https://blog.levelup.in.th/2017/01/31/unityc-projectile/feed/ 0
[Unity][Editor] แก้ไขค่าของตัวแปรในหลาย Object https://blog.levelup.in.th/2016/12/31/unityeditor-%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82%e0%b8%84%e0%b9%88%e0%b8%b2%e0%b8%82%e0%b8%ad%e0%b8%87%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b9%81%e0%b8%9b%e0%b8%a3%e0%b9%83%e0%b8%99%e0%b8%ab/ https://blog.levelup.in.th/2016/12/31/unityeditor-%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82%e0%b8%84%e0%b9%88%e0%b8%b2%e0%b8%82%e0%b8%ad%e0%b8%87%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b9%81%e0%b8%9b%e0%b8%a3%e0%b9%83%e0%b8%99%e0%b8%ab/#comments Sat, 31 Dec 2016 04:53:09 +0000 http://blog.levelup.in.th/?p=6054 เคยไหม เวลาที่อยากแก้ไขค่าของตัวแปรไหนซักตัว แต่ Unity ดันไม่ยอมให้แก้ใน Multi-object mode ดังรูป
1

วันนี้เรามีวีธีแก้ไขมานำเสนอ โดยการใช้ Editor นี่คือตัวอย่าง code

[MenuItem ("LevelUp/Spine/Set Scale to 1", false, 151)]
static void SetScaleTo1 ()
{
Object[] aObj = Selection.objects;
foreach (Object obj in aObj) {
((SkeletonDataAsset)obj).scale = 1;
}
}

เวลาใช้ก็ให้เราเลือก object ทั้งหมดที่อยากแก้ไขค่าแล้วกดใช้งาน code ใน Editor จบบบ
2

]]>
https://blog.levelup.in.th/2016/12/31/unityeditor-%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82%e0%b8%84%e0%b9%88%e0%b8%b2%e0%b8%82%e0%b8%ad%e0%b8%87%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b9%81%e0%b8%9b%e0%b8%a3%e0%b9%83%e0%b8%99%e0%b8%ab/feed/ 0
[database][tips] แก้ไขโครงสร้าง หรือ backup ตารางขนาดยักษ์ยังไงให้ ตารางไม่ถูกล๊อค https://blog.levelup.in.th/2016/11/30/databasetips-%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82%e0%b9%82%e0%b8%84%e0%b8%a3%e0%b8%87%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-%e0%b8%ab%e0%b8%a3%e0%b8%b7%e0%b8%ad-backup-%e0%b8%95/ https://blog.levelup.in.th/2016/11/30/databasetips-%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82%e0%b9%82%e0%b8%84%e0%b8%a3%e0%b8%87%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-%e0%b8%ab%e0%b8%a3%e0%b8%b7%e0%b8%ad-backup-%e0%b8%95/#comments Wed, 30 Nov 2016 15:10:30 +0000 http://blog.levelup.in.th/?p=6010 ถ้าเราใช้ mysql ธรรมดาๆคงไม่สามารถทำได้ ดังนั่นเราเลยต้องใช้ตัวช่วยกันหน่อยนั่นก็คือPercona นั่นเองครับ

วิธีใช้ก็ง่ายแสนง่าย ถ้า ปกติเราใช้คำสั่ง

ALTER TABLE table_name ADD column_name datatype

ก็ใช้ Percona แบบนี้

pt-online-schema-change --dry-run --alter "ADD column_name datatype" D=DATABASE,t=TABLE

จุดสังเกตุคือ เอา command ออกมานอก ” และ เอาชื่อ database กับ ชื่อตาราง มาใส่เป็น parameter ข้างหลัง โดยที่คำสั่ง dry-run นั้น คือคำสั่งที่ให้ทดลอง run ดูก่อนว่า syntax เราผิดรึเปล่า ถ้าไม่มีปัญหาอะไร ถ้าคำสั่งที่เราจะสั่งมีปัญหาอะไรมันจะพ่นมาบอก โดยที่ยังไม่เกิดผลลัพท์อะไรทั้งนั้น ทีนี้พอเรา run ด้วยคำสั่ง dry-run โดยที่ไม่มี error อะไรแล้ว ก็ให้แก้ dry-run ให้เป็น execute แบบนี้

pt-online-schema-change --execute --alter "ADD column_name datatype" D=DATABASE,t=TABLE

Credit

]]>
https://blog.levelup.in.th/2016/11/30/databasetips-%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82%e0%b9%82%e0%b8%84%e0%b8%a3%e0%b8%87%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-%e0%b8%ab%e0%b8%a3%e0%b8%b7%e0%b8%ad-backup-%e0%b8%95/feed/ 0