วันอาทิตย์ที่ 6 มกราคม พ.ศ. 2562
Calorie Diary Privacy Policy
The Calorie Diary App needs this state to retrieve previously saved data.
วันศุกร์ที่ 18 พฤศจิกายน พ.ศ. 2559
ทดสอบ printf และ scanf
#include <iostream>
#include <string.h>
char * s1(char* b);
int main()
{
setbuf(stdout, NULL);
char *s, *b;
s = (char *) malloc(15);
b = (char *) malloc(15);
strcpy(s, "test");
strcpy(b, "xxx");
s = s1(b);
printf("input:");
scanf("%15s",s);
printf("%s ...",s);
free(s);
free(b);
}
char * s1(char* b){
return b;
}
#include <string.h>
char * s1(char* b);
int main()
{
setbuf(stdout, NULL);
char *s, *b;
s = (char *) malloc(15);
b = (char *) malloc(15);
strcpy(s, "test");
strcpy(b, "xxx");
s = s1(b);
printf("input:");
scanf("%15s",s);
printf("%s ...",s);
free(s);
free(b);
}
char * s1(char* b){
return b;
}
วันเสาร์ที่ 20 สิงหาคม พ.ศ. 2559
การตั้งชื่อโดเมนเนม
การตั้งชื่อโดเมนเนมมักจะเจอปัญหาในการตั้งชื่อแล้วเจอแต่ชื่อซ้ำ
แต่ก็มีคนทำเครื่องมือช่วยคิดชื่อ domainname ไว้ให้ ช่วยให้ประหยัดเวลาในการคิดชื่อเว็บได้มากเลยครับ
http://www.leandomainsearch.com/
http://www.bustaname.com/word_maker
https://www.shopify.com/tools/business-name-generator
http://www.namemesh.com/domain-name-search/
แต่ก็มีคนทำเครื่องมือช่วยคิดชื่อ domainname ไว้ให้ ช่วยให้ประหยัดเวลาในการคิดชื่อเว็บได้มากเลยครับ
http://www.leandomainsearch.com/
http://www.bustaname.com/word_maker
https://www.shopify.com/tools/business-name-generator
http://www.namemesh.com/domain-name-search/
วันอาทิตย์ที่ 14 สิงหาคม พ.ศ. 2559
Strength
ทดสอบหา Strength ของตัวเองมาจากเว็บไซต์หนึ่ง
ตรงหัวข้อ Optimism น่าจะจริงเพราะงานอดิเรกของผมก็คือ rewrite code ตัวเองที่เคยเขียนไว้ให้ดีขึ้นๆหรือบางทีแค่ให้โค้ดเป็นระเบียบขึ้นเฉยๆ แต่ตรง Innovation นี่สิหมายถึงอะไร bookmark ไว้เอาไว้ทำความเข้าใจวันหลัง -__-'
Your Top 5 Strengths Are:
Innovation (100%):
* Actively seek out positions where your ideas will be valued and encouraged.
* Be a designer, sales strategies, marketing guru, or customer service rep for new products and ideas.
* Search out and request ideas from others to stimulate your thinking.
* Constantly think of ideas that can improve businesses and the lives of others.
* You enjoy the power of words; punchy ideas stimulate your thinking - focus and play with this fact.
* For decisions, you need to know that everything fits together. Be aware and plan for decisions.
* If a decision seems to stand out as particularly bothersome, then check if it is an exception before worrying about it.
Optimism (94%):
* Look for positions where you can be as close to customers as possible.
* Actively help plan events - like new product launches and user groups.
* Do use your humor and good attitude to excite people.
* Being positive does not mean you'll be in good mood - be aware and let others know, as needed.
* Cynics quickly sap your energy and you dislike cheering negative people - minimize these instances.
* You enjoy celebrating and should actively find ways to recognize achievements.
Faith (94%):
* Make efforts to discover your true passion and tie it to your work, no matter what you do.
* Align, but don't compromise, your values to that of your organization.
* You respect others for learning about your family and community - give them the opportunity.
* You give more value to greater levels of service than more money - let others know this.
* People may not share your beliefs, but you feel they need to understand & respect - let them.
Self Motivation (88%):
* You don't need your hand-held; help others understand you need space to make meaningful decisions.
* Seek to take on a role where persistence is essential to success.
* Continually take on roles that demand an aura of certainty and stability.
* You have a strong self-concept that you are an agent of action - nurture it.
* You are most effective when you feel you are in control of your world - be aware and help others understand this.
* You need clear feedback to develop your instincts - review your failures and successes for lessons learned.
Strategic Thinking (88%):
* Be on the leading edge of your organization, groups, and strategic plans.
* Be involved in organizational planning and risk management efforts.
* Always give yourself plenty of time to think through a situation.
* Read books, take a training course, or attend a seminar in strategic planning and futurism.
* Seek chances to share your ideas in writing and presentations.
* Seek solutions that worked in other places, learn from them, and try to apply them to your life and work.
Your Remaining Results Are:
Risk Taking (88%):
Communication (81%):
Purpose (81%):
Curiosity (81%):
Problem Solving (75%):
Ambition (75%):
Balance (69%):
Visionary (63%):
Resourcefulness (63%):
Leadership (63%):
Focus (56%):
Salesmanship (56%):
Teamwork (56%):
Adaptability (44%):
Integrity (25%):
Your Bottom 1 Weakness Is:
Determination (19%):
* Constantly be on the lookout for new goals and improvements.
* You're good at initiating and organizing a project, start your own and help others.
* Get feedback from people as others' expectations will energize you.
* Actively participate in helping a bogged down team into action.
* When down, think of new improvements to do tomorrow - stay on track.
* Be careful of those who really want to project and analyze - they are a non-fit for your work style!
Thank Website
http://richardstep.com/richardstep-strengths-weaknesses-aptitude-test/free-aptitude-test-find-your-strengths-weaknesses-online-version/
ตรงหัวข้อ Optimism น่าจะจริงเพราะงานอดิเรกของผมก็คือ rewrite code ตัวเองที่เคยเขียนไว้ให้ดีขึ้นๆหรือบางทีแค่ให้โค้ดเป็นระเบียบขึ้นเฉยๆ แต่ตรง Innovation นี่สิหมายถึงอะไร bookmark ไว้เอาไว้ทำความเข้าใจวันหลัง -__-'
Your Top 5 Strengths Are:
Innovation (100%):
* Actively seek out positions where your ideas will be valued and encouraged.
* Be a designer, sales strategies, marketing guru, or customer service rep for new products and ideas.
* Search out and request ideas from others to stimulate your thinking.
* Constantly think of ideas that can improve businesses and the lives of others.
* You enjoy the power of words; punchy ideas stimulate your thinking - focus and play with this fact.
* For decisions, you need to know that everything fits together. Be aware and plan for decisions.
* If a decision seems to stand out as particularly bothersome, then check if it is an exception before worrying about it.
Optimism (94%):
* Look for positions where you can be as close to customers as possible.
* Actively help plan events - like new product launches and user groups.
* Do use your humor and good attitude to excite people.
* Being positive does not mean you'll be in good mood - be aware and let others know, as needed.
* Cynics quickly sap your energy and you dislike cheering negative people - minimize these instances.
* You enjoy celebrating and should actively find ways to recognize achievements.
Faith (94%):
* Make efforts to discover your true passion and tie it to your work, no matter what you do.
* Align, but don't compromise, your values to that of your organization.
* You respect others for learning about your family and community - give them the opportunity.
* You give more value to greater levels of service than more money - let others know this.
* People may not share your beliefs, but you feel they need to understand & respect - let them.
Self Motivation (88%):
* You don't need your hand-held; help others understand you need space to make meaningful decisions.
* Seek to take on a role where persistence is essential to success.
* Continually take on roles that demand an aura of certainty and stability.
* You have a strong self-concept that you are an agent of action - nurture it.
* You are most effective when you feel you are in control of your world - be aware and help others understand this.
* You need clear feedback to develop your instincts - review your failures and successes for lessons learned.
Strategic Thinking (88%):
* Be on the leading edge of your organization, groups, and strategic plans.
* Be involved in organizational planning and risk management efforts.
* Always give yourself plenty of time to think through a situation.
* Read books, take a training course, or attend a seminar in strategic planning and futurism.
* Seek chances to share your ideas in writing and presentations.
* Seek solutions that worked in other places, learn from them, and try to apply them to your life and work.
Your Remaining Results Are:
Risk Taking (88%):
Communication (81%):
Purpose (81%):
Curiosity (81%):
Problem Solving (75%):
Ambition (75%):
Balance (69%):
Visionary (63%):
Resourcefulness (63%):
Leadership (63%):
Focus (56%):
Salesmanship (56%):
Teamwork (56%):
Adaptability (44%):
Integrity (25%):
Your Bottom 1 Weakness Is:
Determination (19%):
* Constantly be on the lookout for new goals and improvements.
* You're good at initiating and organizing a project, start your own and help others.
* Get feedback from people as others' expectations will energize you.
* Actively participate in helping a bogged down team into action.
* When down, think of new improvements to do tomorrow - stay on track.
* Be careful of those who really want to project and analyze - they are a non-fit for your work style!
Thank Website
http://richardstep.com/richardstep-strengths-weaknesses-aptitude-test/free-aptitude-test-find-your-strengths-weaknesses-online-version/
วันอาทิตย์ที่ 17 มกราคม พ.ศ. 2559
หลักการ submit โปรแกรมใน codecanyon
หลักการ submit โปรแกรมใน codecanyon
- ชื่ออธิบายตรงกับโปรแกรม
- ตั้งชื่อแบบ Camelcase ยกเว้น is,of,an และคำสั้นๆ (1-3 ตัวอักษร)
- และยกเว้นคำย่อเช่น CMS
- ใช้คำ industry standard เช่น jQuery และ WordPress
- ไม่ใช้คำอธิบายไม่มีความชัดเจน เช่น best, beautiful file
- คำที่ไม่เกี่ยวข้องเช่น username และคำที่ไม่เกี่ยวกับไฟล์
- ไม่ใช้คำว่าคล้ายๆ กับอะไร ให้คำอธิบายว่าจริงๆ มันคืออะไร
- คำอธิบายไม่เกิน 100 ตัวอักษร
- คำอธิบายชัดเจน เพราะคนซื้อทุกคนไม่ได้เชี่ยวชาญ
- อธิบายข้อมูลเชิงเทคนิคทั้งหมด เพื่อให้เข้าใจว่าคืออะไร และทำอะไรได้บ้าง
- ลองคิดตัวเองว่าเป็นคนซื้อจะ search ยังไง ข้อมูลอะไรที่ต้องการทราบ
- แสดงภาพตัวอย่างของ item ของคุณที่กำลังทำงาน
- แบ่งช่องไฟและย่อหน้าให้อ่านง่าย
- ห้ามใช้ชื่อสินค้าของคนอื่นใน item tags
- ชื่อแรกควรเป็นคำนามหรือกิจกรรม
- ถ้าชื่อเกี่ยวข้องกับฟิลด์ หรือกลุ่มอุตสาหกรรม หรือ เฉพาะทางให้ระบุให้ชัดเจน
- ระบุ function การทำงานเช่น tileable image
- mood หรือ style เช่น รูปแบบของ theme แต่ไม่ใช้คำที่กว้างเกินไป
- ไม่ใช้คำที่กำกวม
- เช็คคำสะกด
- อาจจะใช้คำสองคำขึ้นไปได้
- ไม่ใช้ Camelcase ยกเว้นคำย่อ
ลิงค์ที่จะใช้ได้ใน description
- ลิงค์เกี่ยวกับคุณสมบัติและที่มาที่จำเป้น
- เอกสารวิธีใช้ online, support forum แต่ต้องไม่เชื่อมโยงไปถึงลิงค์คู่แข่ง
- เนื้อหา third party plugin เพื่ออธิบายเชิงเทคนิค, api ฯลฯ
- ตัวอย่างเพิ่มเติม demo
- social media account
- ไม่อนุญาติให้ลิงค์ไปยังลิงค์คู่แข่ง
Image Preview
- ขนาด 590x300 jpg ที่ไม่มี logo ของเว็บที่มีชื่อเสียง
Thumbnail
- ขนาด 80x80 jpg,gif,png
ไฟล์หลัก (Main File)
- ชัดเจนและจัดลำดับได้ดี
- รูปตัวอย่างเพิ่มเติม jpg และใหญ่ไม่เกิน 900x900
โดยตั้งชื่อในแบบ 01_preview1.jpg, 02_preview2.jpg
โดยแยกรูปไว้ใน folder เฉพาะสำหรับรูปภาพเพิ่มเติม
Tag
- จำกัดอยู่ที่ 15 tags
Comment
- 1 comment or more per function
- descriptive comment than short comment
โครงสร้างไฟล์
- แบ่ง folder ส่วนที่เกี่ยวข้องใน folder เดียวกัน
- การแก้ไขได้ง่าย
- validate แล้ว
- style ที่ดีและ best practice
- ห้ามใส่ script, document, image ไว้ใน root folder ที่เดียวกัน
- html5 จะต้องไม่มี javascript
- App จะต้องเน้นการช่วยเหลือ work flow สำหรับ web developer
- Plugin จะต้องมีตัวอย่างและฟังชั่นใน server ของคุณ
- เช็คว่า asset สามารถนำมาขายร่วมได้
help file
- pdf, doc, txt หรือ html
- ควรจะทำให้มองเห็นภาพ
- ควรจะมีภาพ แต่ไม่ควรใช้แทน text ขั้นตอนการใช้งาน
- อาจจะใช้ Screenr.com ที่จะใช้บันทึกวิธีการใช้
- ชื่ออธิบายตรงกับโปรแกรม
- ตั้งชื่อแบบ Camelcase ยกเว้น is,of,an และคำสั้นๆ (1-3 ตัวอักษร)
- และยกเว้นคำย่อเช่น CMS
- ใช้คำ industry standard เช่น jQuery และ WordPress
- ไม่ใช้คำอธิบายไม่มีความชัดเจน เช่น best, beautiful file
- คำที่ไม่เกี่ยวข้องเช่น username และคำที่ไม่เกี่ยวกับไฟล์
- ไม่ใช้คำว่าคล้ายๆ กับอะไร ให้คำอธิบายว่าจริงๆ มันคืออะไร
- คำอธิบายไม่เกิน 100 ตัวอักษร
- คำอธิบายชัดเจน เพราะคนซื้อทุกคนไม่ได้เชี่ยวชาญ
- อธิบายข้อมูลเชิงเทคนิคทั้งหมด เพื่อให้เข้าใจว่าคืออะไร และทำอะไรได้บ้าง
- ลองคิดตัวเองว่าเป็นคนซื้อจะ search ยังไง ข้อมูลอะไรที่ต้องการทราบ
- แสดงภาพตัวอย่างของ item ของคุณที่กำลังทำงาน
- แบ่งช่องไฟและย่อหน้าให้อ่านง่าย
- ห้ามใช้ชื่อสินค้าของคนอื่นใน item tags
- ชื่อแรกควรเป็นคำนามหรือกิจกรรม
- ถ้าชื่อเกี่ยวข้องกับฟิลด์ หรือกลุ่มอุตสาหกรรม หรือ เฉพาะทางให้ระบุให้ชัดเจน
- ระบุ function การทำงานเช่น tileable image
- mood หรือ style เช่น รูปแบบของ theme แต่ไม่ใช้คำที่กว้างเกินไป
- ไม่ใช้คำที่กำกวม
- เช็คคำสะกด
- อาจจะใช้คำสองคำขึ้นไปได้
- ไม่ใช้ Camelcase ยกเว้นคำย่อ
ลิงค์ที่จะใช้ได้ใน description
- ลิงค์เกี่ยวกับคุณสมบัติและที่มาที่จำเป้น
- เอกสารวิธีใช้ online, support forum แต่ต้องไม่เชื่อมโยงไปถึงลิงค์คู่แข่ง
- เนื้อหา third party plugin เพื่ออธิบายเชิงเทคนิค, api ฯลฯ
- ตัวอย่างเพิ่มเติม demo
- social media account
- ไม่อนุญาติให้ลิงค์ไปยังลิงค์คู่แข่ง
Image Preview
- ขนาด 590x300 jpg ที่ไม่มี logo ของเว็บที่มีชื่อเสียง
Thumbnail
- ขนาด 80x80 jpg,gif,png
ไฟล์หลัก (Main File)
- ชัดเจนและจัดลำดับได้ดี
- รูปตัวอย่างเพิ่มเติม jpg และใหญ่ไม่เกิน 900x900
โดยตั้งชื่อในแบบ 01_preview1.jpg, 02_preview2.jpg
โดยแยกรูปไว้ใน folder เฉพาะสำหรับรูปภาพเพิ่มเติม
Tag
- จำกัดอยู่ที่ 15 tags
Comment
- 1 comment or more per function
- descriptive comment than short comment
โครงสร้างไฟล์
- แบ่ง folder ส่วนที่เกี่ยวข้องใน folder เดียวกัน
- การแก้ไขได้ง่าย
- validate แล้ว
- style ที่ดีและ best practice
- ห้ามใส่ script, document, image ไว้ใน root folder ที่เดียวกัน
- html5 จะต้องไม่มี javascript
- App จะต้องเน้นการช่วยเหลือ work flow สำหรับ web developer
- Plugin จะต้องมีตัวอย่างและฟังชั่นใน server ของคุณ
- เช็คว่า asset สามารถนำมาขายร่วมได้
help file
- pdf, doc, txt หรือ html
- ควรจะทำให้มองเห็นภาพ
- ควรจะมีภาพ แต่ไม่ควรใช้แทน text ขั้นตอนการใช้งาน
- อาจจะใช้ Screenr.com ที่จะใช้บันทึกวิธีการใช้
วันอาทิตย์ที่ 6 ธันวาคม พ.ศ. 2558
Create diff file with php xdiff
โค้ดแสดงบรรทัดที่มีการเปลี่ยนแปลงในไฟล์เริ่มต้นและไฟล์อัพเดตล่าสุด
จะมีประโยชน์ในการ compare ให้โปรแกรมเมอร์หรือผู้ที่ต้องการตรวจสอบแก้ไขไฟล์
ให้สามารถหาตำแหน่งแก้ไขเพิ่มเติมหรือแก้ปัญหาที่เกิดขึ้นได้อย่างสะดวกรวดเร็ว
ใช้คำสั่ง xdiff_file_diff ซึ่งต้อง download dll มาลงเป็น extension ก่อนครับที่ลิงค์
http://pecl.php.net/package/xdiff
จะมีประโยชน์ในการ compare ให้โปรแกรมเมอร์หรือผู้ที่ต้องการตรวจสอบแก้ไขไฟล์
ให้สามารถหาตำแหน่งแก้ไขเพิ่มเติมหรือแก้ปัญหาที่เกิดขึ้นได้อย่างสะดวกรวดเร็ว
ใช้คำสั่ง xdiff_file_diff ซึ่งต้อง download dll มาลงเป็น extension ก่อนครับที่ลิงค์
http://pecl.php.net/package/xdiff
<?php
function rec($path,$target,$diff){
$h = opendir($path);
$time = time();
$day = 60*60*24;
$dayAmount = $day*5;
while($file = readdir($h)){
if ($file != '.' && $file != '..' && $file != '.git' && $file != 'nbproject'){
if (is_dir($path.'/'.$file)){
rec($path.'/'.$file,$target.'/'.$file,$diff.'/'.$file);
}else{
$mtime = filemtime($target.'/'.$file);
if ($time - $mtime < $dayAmount){
$p1 = str_replace("\\",'/',$path).'/'.$file;
$p2 = str_replace("\\",'/',$target).'/'.$file;
$p3 = str_replace("\\",'/',$diff).'/'.$file;
$tdir = dirname($p3);
@mkdir($tdir,0777,true);
xdiff_file_diff($p1, $p2, $p3, 2);
echo "<pre>\r\n=====================================================\r\n\r\n";
echo '<strong>',str_replace('C:/wamp/www/diff','',$p3)."</strong><br>";
$a = file($p3);
foreach($a as $line){
if (substr($line,0,1)=='-'){
echo '<span style="color:red">',htmlspecialchars(substr($line,1)),'</span>';
}
elseif (substr($line,0,1)=='+'){
echo '<span style="color:limegreen">',htmlspecialchars(substr($line,1)),'</span>';
}
elseif (substr($line,0,2)=='@@'){
preg_match('/^@@ \-\d+\,\d+ \+(\d+)\,\d+/',$line,$matches);
echo '<span style="color:#6495ED;">บรรทัดที่ '.$matches[1],'</span>';
}
else{
echo htmlspecialchars($line);
}
}
echo '</pre>';
}
}
}
}
}
header('Content-type:text/html;charset=utf-8');
rec('C:\wamp\www\init-code','C:\wamp\www\update-code','C:\wamp\www\diff');
วันศุกร์ที่ 25 กันยายน พ.ศ. 2558
cordova build error
หลังจาก update cordova เวอชั่นใหม่หรือ plugin version ใหม่
พอจะ build โปรแกรมมักจะเกิดปัญหาแปลกๆ อยู่เสมอ
บางทีก็แจ้ง error ที่ไม่เข้าใจ ตัวอย่างเช่น
cordova build failed with exit code 8
cordova build failed with exit code 1
cordova build failed with exit code 2
ซึ่งส่วนใหญ่มักจะเกิดจาก plugin หรือโค้ด java มีปัญหาบางอย่างนั่นเองครับ
เพื่อให้แสดง error ที่ละเอียดมากขึ้นให้ลองทำตามนี้ดูครับ
cordova platform remove android
cordova platform add android
cordova build android
พอจะ build โปรแกรมมักจะเกิดปัญหาแปลกๆ อยู่เสมอ
บางทีก็แจ้ง error ที่ไม่เข้าใจ ตัวอย่างเช่น
cordova build failed with exit code 8
cordova build failed with exit code 1
cordova build failed with exit code 2
ซึ่งส่วนใหญ่มักจะเกิดจาก plugin หรือโค้ด java มีปัญหาบางอย่างนั่นเองครับ
เพื่อให้แสดง error ที่ละเอียดมากขึ้นให้ลองทำตามนี้ดูครับ
cordova platform remove android
cordova platform add android
cordova build android
วันจันทร์ที่ 20 กรกฎาคม พ.ศ. 2558
Code สำหรับสร้างโค้ดคำสั่ง check ข้อมูลแบบ jquery
var s=document.createElement('script');
s.setAttribute('src','http://code.jquery.com/jquery.js');
document.getElementsByTagName('body')[0].appendChild(s);
window.setTimeout(function(){
$(function(){
var t = " $(function(){\r\n";
var formId = $('form[id]').attr('id');
t += " $('#"+formId+"').submit(function(){\r\n";
$('form[id]').find(':text[id],select[id]').each(function(){
var inputId = $(this).attr('id');
t += " if ($('#"+inputId+"').val()==''){\r\n";
t += " alert('Invalid "+inputId+"');\r\n";
t += " return false;\r\n";
t += " }\r\n";
});
t += "return true;\r\n";
t += "});\r\n";
t += "});\r\n";
console.log('\r\n'+t+'\r\n ');
});
},3000);
สำหรับ Chrome กดปุ่ม F12 แล้วใส่ไปใน tab console ได้เลยครับ
แต่มีเงื่อนไขคือต้องเป็น form ที่มี id และ input ที่จะตรวจสอบจะต้องมี id
เช่น
<form id="form1"> <input type="text" id="text1"> <input type="text" id="text2"> <input type="text" id="text3"> <input type="submit" value="send"> </form>จะได้ผลลัพธ์เป็น
$(function(){
$('#form1').submit(function(){
if ($('#text1').val()==''){
alert('Invalid text1');
return false;
}
if ($('#text2').val()==''){
alert('Invalid text2');
return false;
}
if ($('#text3').val()==''){
alert('Invalid text3');
return false;
}
return true;
});
});
ไว้สำหรับเป็นโค้ดสำหรับตรวจสอบทาง javascript ต่อไปครับ
วันอาทิตย์ที่ 5 กรกฎาคม พ.ศ. 2558
PHP Code Builder From Mysql Create Table Code
โปรแกรมแปลง create table ให้เป็น insert และ update query ครับ
ถ้าเขียนโปรแกรมฐานข้อมูลบ่อยๆ และจำชื่อฟิลด์ไม่ค่อยได้
ในการเขียนโปรแกรม insert / update
จะต้องสลับเปิดไปมาระหว่าง phpmyadmin และ php editor ซึ่งเสียเวลาและใช้เวลาพิมพ์มากพอสมควร
รวมถึงอาจจะพิมพ์ผิดต้องแก้หลายครั้ง ถ้าใช้โปรแกรมตัวนี้ช่วยจะไม่ต้องเสียเวลาพิมพ์นานและมีความถูกต้องและรวดเร็วด้วยครับ
แต่เงื่อนไขของโปรแกรมนี้จะต้องเริ่มต้นด้วย ชื่อตาราง และฟิลด์ถัดมาควรจะเป็น primary key ครับ
ไม่งั้นโปรแกรมจะแปลงข้อมูลได้ไม่ถูกต้อง
ถ้าเขียนโปรแกรมฐานข้อมูลบ่อยๆ และจำชื่อฟิลด์ไม่ค่อยได้
ในการเขียนโปรแกรม insert / update
จะต้องสลับเปิดไปมาระหว่าง phpmyadmin และ php editor ซึ่งเสียเวลาและใช้เวลาพิมพ์มากพอสมควร
รวมถึงอาจจะพิมพ์ผิดต้องแก้หลายครั้ง ถ้าใช้โปรแกรมตัวนี้ช่วยจะไม่ต้องเสียเวลาพิมพ์นานและมีความถูกต้องและรวดเร็วด้วยครับ
แต่เงื่อนไขของโปรแกรมนี้จะต้องเริ่มต้นด้วย ชื่อตาราง และฟิลด์ถัดมาควรจะเป็น primary key ครับ
ไม่งั้นโปรแกรมจะแปลงข้อมูลได้ไม่ถูกต้อง
CREATE TABLE `ชื่อตาราง` ( `id` INT(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT, /* primary key */ `m_id` INT(6) UNSIGNED ZEROFILL NULL DEFAULT NULL, `name` VARCHAR(120) NOT NULL, `phone` VARCHAR(60) NOT NULL, `status` INT(1) NOT NULL, `date` DATE NOT NULL );ลิงค์โปรแกรม PHP Code Builder From Mysql Create Table Code
วันอาทิตย์ที่ 7 ธันวาคม พ.ศ. 2557
เว็บสอนฟังและพูดภาษาอังกฤษ
มีเว็บสอนภาษาอังกฤษอยู่มากมายครับ ถ้าตอนเด็กๆ ได้ฝึกกับเว็บพวกนี้ป่านนี้น่าจะคล่องแล้ว
สำหรับผมการอ่านนี่ส่วนใหญ่จะได้ 80% อยู่แล้วแต่ฟังกับพูดยังไม่ถึง 50%
ตอนนี้ถ้ามีเวลาว่างผมก็จะลองไปฝึกตามเว็บนี้ครับ :)
http://talkenglish.com/talkenglish-android.aspx
http://learnamericanenglishonline.com/Blue%20Level/B1%20Be.html
http://usalearns.org
สำหรับผมการอ่านนี่ส่วนใหญ่จะได้ 80% อยู่แล้วแต่ฟังกับพูดยังไม่ถึง 50%
ตอนนี้ถ้ามีเวลาว่างผมก็จะลองไปฝึกตามเว็บนี้ครับ :)
http://talkenglish.com/talkenglish-android.aspx
http://learnamericanenglishonline.com/Blue%20Level/B1%20Be.html
http://usalearns.org
วันอาทิตย์ที่ 23 พฤศจิกายน พ.ศ. 2557
เคล็ดลับในการทำ app ให้ประสบความสำเร็จบน google play
สำหรบ app ทั่วๆ ไป
- ใช้ developer console เพื่อคุยโต้ตอบกับ comment เพื่อทำความเข้าใจกับ user
- โปรโมต app ของคุณใน google search, youtube และใน app อื่นๆ
- โปรโมต app อื่นๆ ของคุณใน admob house ads
- ทำ app ที่เกี่ยวข้องกับชื่อ app แต่มีความพิเศษหรือความสามารถเหนือ app อื่น
- ให้ผู้ชำนาญด้านการทำ icon ทำ icon ให้ หรือใช้ android asset studio tools ในการสร้าง icon
- แสดง screenshot ที่ทำให้เห็นประโยชน์ใน app
- คำอธิบาย app สั้นแต่ได้ใจความ และช่วยให้ user ได้รู้ว่าเป็น app ที่ตรงกับความต้องการ
- สร้าง video อัพโหลดขึ้น youtube เพื่อนำเสนอ app
- ใช้ปุ่ม badge มาตรฐาน เพื่อให้รับทราบว่าสามารถ download app ได้ที่ไหน
- ทำ app ที่ตัวเองรู้สึกชอบและอยากใช้งาน ถ้าแม้แต่ตัวเองยังไม่ชอบก็ยากที่คนอื่นจะชอบด้วย
- ไม่เน้นขายเป็นหลักในขั้นตอนการใช้งานต่างๆ ซึ่งอาจจะทำให้ app ไม่น่าใช้
- ทำตัวให้น่าเชื่อถือ ยอมรับหัวข้อปัญหาต่างๆ ใน comment และจัดการปัญหา เพื่อให้มีคนติดตามตลอดเวลา
- อย่าใช้แต่คำบอกเล่า ใช้รูปและวีดีโอที่ทำให้เกิดประโยชน์กับคนจริงๆ มาแล้ว!!! หรือช่วยให้ผู้ชมสนุกสนาน
- อย่ากลัวที่จะเรียกให้ user share หรือ +1 เมื่อถึงเวลาที่เหมาะสม
- ใช้ google sign-in กับเว็บไซต์ของคุณ
- สร้าง app ที่เหมาะสมกับ tablet, และเหมาะสมสำหรับการศึกษา
- ใช้ google adword ในเวลาที่เหมาะสม เช่นในช่วงลดราคา app
- ให้สิทธิพิเศษกับ user ที่ share คุณ
- ใช้ระบบ notification แจ้ง function ที่มีประโยชน์ เพื่อให้ app function เป็นที่รุ้จัก
- ทำ deep link เพื่อให้ผู้ใช้สามารถเปิดดูข้อมูล app ได้ทาง search result
สำหรับแอพเกมส์
- สร้าง leaderboards เพื่อเปรียบเทียบความสามารถกับผู้เล่นอื่นๆ
- บันทึก data ไว้ที่ cloud (เพื่อให้ผู้เล่นคนเดียวกันสามารถใช้งานได้หลายเครื่อง)
- ระบบการสะสมเหรียญ สะสมไอเทมช่วยให้เกมส์น่าเล่นอย่างต่อเนื่อง
- สามารถเล่นเกมส์และอีเว้นท์ของเกมส์โดยไม่ต้องอัพเดตเกมส์
- ระบบ multi player ช่วยให้เกมส์น่าสนใจมากขึ้น
- ส่ง/รับ ของขวัญ ให้กับผู้เล่น
- ใช้ google plus sign in ช่วยให้เผยแพร่และตรวจสอบสถิติการใช้งาน
- วิจัยก่อนว่าผู้ใช้ app ประเภทที่กำลังทำชอบการชำระเงินแบบไหน
- โปรแกรมไม่ทางการจะเหมาะสมกับ ads และ in-app purchases
- ถ้ากำลังทำ app ที่มี ads ให้ลองทำ in-app purchases ที่ remove ads
- ถ้าโปรแกรมคุณสามารถขยายได้เช่นเพิ่ม level ให้เสนอ level พิเศษสำหรับการรุ่นที่ชำระเงินด้วย
- app ที่มีมูลค่าของเนื้อหา เปลี่ยนไป เรื่อยๆ ให้ใช้ subscription (กำหนดระยะเวลา)
- ใช้ developer console เพื่อคุยโต้ตอบกับ comment เพื่อทำความเข้าใจกับ user
- โปรโมต app ของคุณใน google search, youtube และใน app อื่นๆ
- โปรโมต app อื่นๆ ของคุณใน admob house ads
- ทำ app ที่เกี่ยวข้องกับชื่อ app แต่มีความพิเศษหรือความสามารถเหนือ app อื่น
- ให้ผู้ชำนาญด้านการทำ icon ทำ icon ให้ หรือใช้ android asset studio tools ในการสร้าง icon
- แสดง screenshot ที่ทำให้เห็นประโยชน์ใน app
- คำอธิบาย app สั้นแต่ได้ใจความ และช่วยให้ user ได้รู้ว่าเป็น app ที่ตรงกับความต้องการ
- สร้าง video อัพโหลดขึ้น youtube เพื่อนำเสนอ app
- ใช้ปุ่ม badge มาตรฐาน เพื่อให้รับทราบว่าสามารถ download app ได้ที่ไหน
- ทำ app ที่ตัวเองรู้สึกชอบและอยากใช้งาน ถ้าแม้แต่ตัวเองยังไม่ชอบก็ยากที่คนอื่นจะชอบด้วย
- ไม่เน้นขายเป็นหลักในขั้นตอนการใช้งานต่างๆ ซึ่งอาจจะทำให้ app ไม่น่าใช้
- ทำตัวให้น่าเชื่อถือ ยอมรับหัวข้อปัญหาต่างๆ ใน comment และจัดการปัญหา เพื่อให้มีคนติดตามตลอดเวลา
- อย่าใช้แต่คำบอกเล่า ใช้รูปและวีดีโอที่ทำให้เกิดประโยชน์กับคนจริงๆ มาแล้ว!!! หรือช่วยให้ผู้ชมสนุกสนาน
- อย่ากลัวที่จะเรียกให้ user share หรือ +1 เมื่อถึงเวลาที่เหมาะสม
- ใช้ google sign-in กับเว็บไซต์ของคุณ
- สร้าง app ที่เหมาะสมกับ tablet, และเหมาะสมสำหรับการศึกษา
- ใช้ google adword ในเวลาที่เหมาะสม เช่นในช่วงลดราคา app
- ให้สิทธิพิเศษกับ user ที่ share คุณ
- ใช้ระบบ notification แจ้ง function ที่มีประโยชน์ เพื่อให้ app function เป็นที่รุ้จัก
- ทำ deep link เพื่อให้ผู้ใช้สามารถเปิดดูข้อมูล app ได้ทาง search result
สำหรับแอพเกมส์
- สร้าง leaderboards เพื่อเปรียบเทียบความสามารถกับผู้เล่นอื่นๆ
- บันทึก data ไว้ที่ cloud (เพื่อให้ผู้เล่นคนเดียวกันสามารถใช้งานได้หลายเครื่อง)
- ระบบการสะสมเหรียญ สะสมไอเทมช่วยให้เกมส์น่าเล่นอย่างต่อเนื่อง
- สามารถเล่นเกมส์และอีเว้นท์ของเกมส์โดยไม่ต้องอัพเดตเกมส์
- ระบบ multi player ช่วยให้เกมส์น่าสนใจมากขึ้น
- ส่ง/รับ ของขวัญ ให้กับผู้เล่น
- ใช้ google plus sign in ช่วยให้เผยแพร่และตรวจสอบสถิติการใช้งาน
- วิจัยก่อนว่าผู้ใช้ app ประเภทที่กำลังทำชอบการชำระเงินแบบไหน
- โปรแกรมไม่ทางการจะเหมาะสมกับ ads และ in-app purchases
- ถ้ากำลังทำ app ที่มี ads ให้ลองทำ in-app purchases ที่ remove ads
- ถ้าโปรแกรมคุณสามารถขยายได้เช่นเพิ่ม level ให้เสนอ level พิเศษสำหรับการรุ่นที่ชำระเงินด้วย
- app ที่มีมูลค่าของเนื้อหา เปลี่ยนไป เรื่อยๆ ให้ใช้ subscription (กำหนดระยะเวลา)
วันพุธที่ 19 พฤศจิกายน พ.ศ. 2557
youtube partner คืออะไร
youtube partner ถ้าแปลตรงๆ ก็คือหุ้นส่วนของ youtube ซึ่งเราทุกคนสามารถที่จะเป็นหุ้นส่วนของ youtube ได้ โดยการเผยแพร่คลิปวีดีโอที่มีคนดูจำนวนมาก ซึ่งวีดีโอนั้นจะต้องไม่ละเมิดลิขสิทธ์
เช่นวีดีโอที่นำเพลงลิขสิทธิ์มาเผยแพร่โดยไม่ได้รับอนุญาติฯลฯ youtube จะไม่พิจารณาให้เป็น youtube partner
ในการเป็น youtube patner เรามีหน้าที่จัดทำและเผยแพร่คลิปวีดีโอ และ youtube จะแบ่งเปอร์เซนต์จากการโฆษณาให้ ตามที่เราเห็นโฆษณาขึ้นใน video ใน youtube ต่างๆ นั่นเองครับ
เช่นวีดีโอที่นำเพลงลิขสิทธิ์มาเผยแพร่โดยไม่ได้รับอนุญาติฯลฯ youtube จะไม่พิจารณาให้เป็น youtube partner
ในการเป็น youtube patner เรามีหน้าที่จัดทำและเผยแพร่คลิปวีดีโอ และ youtube จะแบ่งเปอร์เซนต์จากการโฆษณาให้ ตามที่เราเห็นโฆษณาขึ้นใน video ใน youtube ต่างๆ นั่นเองครับ
วันศุกร์ที่ 7 พฤศจิกายน พ.ศ. 2557
Output Buffer Render
โค้ดช่วยแสถงสถานะ เหมาะสำหรับช่วยแสดงสถานะการทำงานของโปรแกรมที่ใช้เวลาทำงานนานๆ ครับ
$rows=file('./etlex');
set_time_limit(0);
$sx = 0;
foreach($rows as $number=>$r){
if ($number % 100000==0){
echo "";
$sx++;
echo "Line ".$number."";
echo str_pad('',4096)."\n";
ob_flush();
flush();
sleep(1);
}
}
วันเสาร์ที่ 28 มิถุนายน พ.ศ. 2557
php debug function
ในบางครั้ง debug ผ่านการ echo จะไม่สะดวก
โค้ดด้านล่างนี้สำหรับ debug ตัวแปรใส่ไว้ใน file และสามารถใส่ใน loop ก็ได้ครับ
if (empty($test)){
file_put_contents(dirname(__FILE__).'/test1.txt','');
$test=true;
function test($var){
ob_start();
var_dump($var);
$s=ob_get_clean();
file_put_contents(dirname(__FILE__).'/test1.txt',$s,FILE_APPEND);
}
}
test($testvar);
วันเสาร์ที่ 8 มีนาคม พ.ศ. 2557
แปลงวันที่ไทยให้เป็นวันที่ของ php
แปลงวันที่ภาษาไทยให้เป็นวันที่ php ครับ
แต่ function นี้มีข้อจำกัดคือไม่สามารถใช้กับ host windows ได้ครับเพราะเรียกใช้ strptime ซึ่งไม่มีใน host windows
function strtotime_thai($str){
$str = preg_replace_callback('/\d{4}/',function($match){
return $match[0]-543;
},$str);
setlocale(LC_TIME, 'thai');
$format = '%d %B %Y %H:%M:%S';//d M Y H:i:s
$str = iconv('UTF-8','TIS-620',$str);//comment this line if $str is tis620
$result = strptime($str,$format);
if (empty($result)){
return false;
}
extract($result);
return mktime($tm_hour,$tm_min,$tm_sec,$tm_mon+1,$tm_mday,$tm_year+1900);
}
$phptime = strtotime_thai('19 ธันวาคม 2557 23:30:59');
echo date('d/m/Y H/i/s',$phptime);
วันศุกร์ที่ 14 กุมภาพันธ์ พ.ศ. 2557
facebook programming
สมัยนี้คนเล่น facebook กันมาก facebook สะดวกในการเก็บรูปเก็บวีดีโอ
ทำให้เราไม่ต้องเสียพื้นที่เก็บข้อมูลมากๆ ในเว็บไซต์ เราสามารถจะดึงข้อมูลใน facebook ของเรามาแสดงในเว็บอีกทีหนึ่งก็ได้ไม่ต้องอัพโหลดซ้ำครับ
มีหลายเทคนิคด้วยกันครับ เทคนิคแรกเป็นการดึงข้อมูลเองโดยตรงผ่าน graph ของ facebook
http://kevinp93.com/facebook-images-on-website-v2/
วิธีที่สองก็คือการดึงข้อมูลผ่าน FQL ซึ่งเป็นเป็น api ของ facebook
http://www.codeofaninja.com/2011/06/display-facebook-photos-to-your-website.html
http://www.codeofaninja.com/p/facebook-developers.html
http://www.codeofaninja.com/2013/02/facebook-appId-and-appSecret.html
ทำให้เราไม่ต้องเสียพื้นที่เก็บข้อมูลมากๆ ในเว็บไซต์ เราสามารถจะดึงข้อมูลใน facebook ของเรามาแสดงในเว็บอีกทีหนึ่งก็ได้ไม่ต้องอัพโหลดซ้ำครับ
มีหลายเทคนิคด้วยกันครับ เทคนิคแรกเป็นการดึงข้อมูลเองโดยตรงผ่าน graph ของ facebook
http://kevinp93.com/facebook-images-on-website-v2/
วิธีที่สองก็คือการดึงข้อมูลผ่าน FQL ซึ่งเป็นเป็น api ของ facebook
http://www.codeofaninja.com/2011/06/display-facebook-photos-to-your-website.html
http://www.codeofaninja.com/p/facebook-developers.html
http://www.codeofaninja.com/2013/02/facebook-appId-and-appSecret.html
วันเสาร์ที่ 11 มกราคม พ.ศ. 2557
ควบคุมแคลอรี่เพื่อการลดน้ำหนักด้วยแอพแคลอรี่ไดอารี่ Calorie Diary App
การควบคุมปริมาณแคลอรี่ให้อยู่ในปริมาณที่เหมาะสมจะช่วยลดน้ำหนักและควบคุมน้ำหนักไม่ให้เพิ่มขึ้นได้ แอพแคลอรี่ไดอารี่ตัวนี้จะช่วยบันทึกประมาณแคลอรี่ที่คุณรับประทานในแต่ละวันเก็บไว้เป็นสถิติเพื่อช่วยในการตัดสินใจว่าเพิ่มหรือลดแคลอรี่ที่จะรับประทานเข้าไปในแต่ละวันให้มีปริมาณที่เหมาะสมครับ
Controlling the amount of calories in the right amount to help lose weight and keep weight. The Calorie Diary will help you note calories amount you consume each day, keep the statistics to help decide whether to raise or lower the calories to eat each day.
- การจดบันทึกและควบคุมปริมาณแคลอรี่ที่ร่างกายจะได้รับในแต่ละวันจะช่วยในการควบคุมและลดน้ำหนัก
- แสดงรายการข้อมูลในรูปแบบปฎิทินทำให้แก้ไขเพิ่มเติมข้อมูลได้ง่ายดาย
- สามารถค้นหาข้อมูลชื่ออาหารและค่ากิโลแคลอรี่ของอาหารประเภทต่างๆ นับพันรายการ
- สามารถเพิ่มรายชื่อผู้ใช้ได้หลายคนเพื่อจดสถิติให้กับเพื่อนๆ หรือคนในครอบครัว
- นอกจากนี้คุณยังสามารถเพิ่มชื่ออาหารและค่ากิโลแคลอรี่ของอาหารได้เองด้วย
- มีรายงานสถิติค่าเฉลี่ยแคลอรี่ที่คุณรับเข้าไปในแต่ละวันและค่าเฉลี่ยน้ำหนักที่ลดลงในแต่ละวัน
Feature
- Note Statistics calories you are eating each day.
- To record and control the amount of calories each day will help to control and loss weight.
- Display information in the calendar form make it easy to add/update data.
- Find out the name and the kilo calories of food types , thousands of items .
- Can add multiple users to take statistics with friends. Or someone in the family.
- You also can add your name and the kilo calories of the food itself.
- Have reported record , the average calories you intake each day and the average weight loss each day.
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.4
- สามารถใช้ปุ่มย้อนกลับของ android ในการย้อนไปยังหน้าก่อนหน้า
- เพิ่มปุ่มให้คะแนนแอพนี้ และปุ่มแจ้งปัญหา
- ลบปุ่มส่งต่อให้เพื่อน (เนื่องจากไม่มีงบประมาณในการซื้อ social plugin)
- ลบปุ่มยกเลิก สำหรับการปิดเมนูป๊อปอัพจะเปลี่ยนมาใช้การกดที่หน้าจอแทน
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.3
- ย้ายรายชื่อผู้ใช้ไปหน้าแรก
- เพิ่มป็อปอัพเมนูเพื่อให้บันทึกข้อมูลได้สะดวกขึ้น
- เพิ่มปุ่มส่งต่อให้เพื่อน
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.2
- แก้ไขข้อผิดพลาดที่เกิดขึ้นในหน้าปฎิทินที่เกิดขึ้นเมื่อไม่ได้กำหนดค่าแคลอรี่ในบันทึกประจำวัน
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.1
- แก้ปัญหาขนาดช่องป้อนข้อมูลเล็กเกินไปในหน้าบันทึกน้ำหนักและแคลอรี่
- เพิ่มการแสดงวันที่ปัจจุบันเป็นสีชมพูในปฎิทิน
- จัดรูปแบบหน้าแรกให้ปุ่มสำคัญอยู่ตรงกลางเพียงปุ่มเดียวเพื่อให้กดปุ่มสะดวกขึ้น
Change Log
What changed in version 1.4
- Can return to the previous page using android hardware back button.
- Add Rate This App Button and Feedback Button.
- Remove Share This App Button (Due to budget issues).
- Remove Cancel Button, Changed to close pop-up menu by pressing the screen.
What changed in version 1.3
- Move the user list to the first page.
- Added popup menu to save the data easier.
- Add Share to friends button.
What changed in version 1.2
- Fix error in the calendar page when not providing value to calorie on the day.
What changed in version 1.1
- Fixed the input size too small in weight and calories input page.
- Added display the current date in pink color in the calendar.
- Formatting the home menu buttons, display a single button will press easier.
คุณสามารถติดตั้งแอพแคลอรี่ไดอารี่ได้ทาง Google Play
You can install The Calorie Diary via
ถ้ามีปัญหาการใช้งานติดต่อมาได้ที่ dragon_html[แอด]hotmail.com ครับ
2. ทานผักผลไม้ให้มากขึ้น
3. ทานนมและถั่วให้มากขึ้น
4. ทานอาหารในปริมาณน้อยๆ ทีละหลายครั้งดีกว่าทีละมากๆ ครั้งเดียว (ทานเท่าที่ร่างกายต้องการแทนทานเท่าที่ต้องการ)
5. ชั่งน้ำหนักด้วยกิโลที่มีความละเอียดอ่านได้ง่ายตัวอย่างเช่นเครื่องชั่งดิจิตอล
6. ตรวจสอบแคลอรี่ของอาหารที่รับประทานเข้าไปในแต่ละวันไม่ให้มากเกินไปครับ
2. Eat more fruits and vegetables.
3. Eat more sugar free milk and nuts.
4. Eating foods in small amounts but multiple times better than eating food in big amounts at once
(Eat as much as the body needs, Not to eat as much as body wish).
5. Weighed with a scale that can check your weight accurately, for example, the digital scales.
6. Check the calorie of food consumed each day, not too much.
Controlling the amount of calories in the right amount to help lose weight and keep weight. The Calorie Diary will help you note calories amount you consume each day, keep the statistics to help decide whether to raise or lower the calories to eat each day.
คุณสมบัติของแคลอรี่ไดอารี่ (Calorie Diary)
- ไดอารี่สำหรับจดบันทึกสถิติแคลอรี่ที่คุณได้รับจากการรับประทานอาหารในแต่ละวัน- การจดบันทึกและควบคุมปริมาณแคลอรี่ที่ร่างกายจะได้รับในแต่ละวันจะช่วยในการควบคุมและลดน้ำหนัก
- แสดงรายการข้อมูลในรูปแบบปฎิทินทำให้แก้ไขเพิ่มเติมข้อมูลได้ง่ายดาย
- สามารถค้นหาข้อมูลชื่ออาหารและค่ากิโลแคลอรี่ของอาหารประเภทต่างๆ นับพันรายการ
- สามารถเพิ่มรายชื่อผู้ใช้ได้หลายคนเพื่อจดสถิติให้กับเพื่อนๆ หรือคนในครอบครัว
- นอกจากนี้คุณยังสามารถเพิ่มชื่ออาหารและค่ากิโลแคลอรี่ของอาหารได้เองด้วย
- มีรายงานสถิติค่าเฉลี่ยแคลอรี่ที่คุณรับเข้าไปในแต่ละวันและค่าเฉลี่ยน้ำหนักที่ลดลงในแต่ละวัน
Feature
- Note Statistics calories you are eating each day.
- To record and control the amount of calories each day will help to control and loss weight.
- Display information in the calendar form make it easy to add/update data.
- Find out the name and the kilo calories of food types , thousands of items .
- Can add multiple users to take statistics with friends. Or someone in the family.
- You also can add your name and the kilo calories of the food itself.
- Have reported record , the average calories you intake each day and the average weight loss each day.
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.4
- สามารถใช้ปุ่มย้อนกลับของ android ในการย้อนไปยังหน้าก่อนหน้า
- เพิ่มปุ่มให้คะแนนแอพนี้ และปุ่มแจ้งปัญหา
- ลบปุ่มส่งต่อให้เพื่อน (เนื่องจากไม่มีงบประมาณในการซื้อ social plugin)
- ลบปุ่มยกเลิก สำหรับการปิดเมนูป๊อปอัพจะเปลี่ยนมาใช้การกดที่หน้าจอแทน
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.3
- ย้ายรายชื่อผู้ใช้ไปหน้าแรก
- เพิ่มป็อปอัพเมนูเพื่อให้บันทึกข้อมูลได้สะดวกขึ้น
- เพิ่มปุ่มส่งต่อให้เพื่อน
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.2
- แก้ไขข้อผิดพลาดที่เกิดขึ้นในหน้าปฎิทินที่เกิดขึ้นเมื่อไม่ได้กำหนดค่าแคลอรี่ในบันทึกประจำวัน
สิ่งที่เปลี่ยนแปลงในเวอร์ชั่น 1.1
- แก้ปัญหาขนาดช่องป้อนข้อมูลเล็กเกินไปในหน้าบันทึกน้ำหนักและแคลอรี่
- เพิ่มการแสดงวันที่ปัจจุบันเป็นสีชมพูในปฎิทิน
- จัดรูปแบบหน้าแรกให้ปุ่มสำคัญอยู่ตรงกลางเพียงปุ่มเดียวเพื่อให้กดปุ่มสะดวกขึ้น
Change Log
What changed in version 1.4
- Can return to the previous page using android hardware back button.
- Add Rate This App Button and Feedback Button.
- Remove Share This App Button (Due to budget issues).
- Remove Cancel Button, Changed to close pop-up menu by pressing the screen.
What changed in version 1.3
- Move the user list to the first page.
- Added popup menu to save the data easier.
- Add Share to friends button.
What changed in version 1.2
- Fix error in the calendar page when not providing value to calorie on the day.
What changed in version 1.1
- Fixed the input size too small in weight and calories input page.
- Added display the current date in pink color in the calendar.
- Formatting the home menu buttons, display a single button will press easier.
คุณสามารถติดตั้งแอพแคลอรี่ไดอารี่ได้ทาง Google Play
You can install The Calorie Diary via
ถ้ามีปัญหาการใช้งานติดต่อมาได้ที่ dragon_html[แอด]hotmail.com ครับ
เทคนิคในการลดน้ำหนัก
1. ทานน้ำเปล่าหรือน้ำชาอ่อนๆ ให้มากขึ้น2. ทานผักผลไม้ให้มากขึ้น
3. ทานนมและถั่วให้มากขึ้น
4. ทานอาหารในปริมาณน้อยๆ ทีละหลายครั้งดีกว่าทีละมากๆ ครั้งเดียว (ทานเท่าที่ร่างกายต้องการแทนทานเท่าที่ต้องการ)
5. ชั่งน้ำหนักด้วยกิโลที่มีความละเอียดอ่านได้ง่ายตัวอย่างเช่นเครื่องชั่งดิจิตอล
6. ตรวจสอบแคลอรี่ของอาหารที่รับประทานเข้าไปในแต่ละวันไม่ให้มากเกินไปครับ
Techniques to lose weight
1. Drink more water or light tea.2. Eat more fruits and vegetables.
3. Eat more sugar free milk and nuts.
4. Eating foods in small amounts but multiple times better than eating food in big amounts at once
(Eat as much as the body needs, Not to eat as much as body wish).
5. Weighed with a scale that can check your weight accurately, for example, the digital scales.
6. Check the calorie of food consumed each day, not too much.
วันศุกร์ที่ 27 ธันวาคม พ.ศ. 2556
start end format display number
abstract class StartEnd{
protected $m = array();
public function push($data){
if (count($this->m)==0){
$this->m[1] = $this->m[0] = $data;
}else{
$this->m[1] = $data;
}
}
public function __toString(){
if (count($this->m)==0){
return '';
}elseif ($this->m[0] == $this->m[1]){
return (string)$this->m[0];
}else{
return $this->m[0].'-'.$this->m[1];
}
}
public static function getFormat(array $a){
$groups = array();
$prev = -1;
static::sort($a);
foreach($a as $i){
if ($prev !== static::getPrev($i)){
$se = new static();
$groups[] = $se;
}
$se->push($prev = $i);
}
return implode(',',$groups);
}
abstract public static function sort(&$a);
abstract public static function getPrev($i);
}
class StartEndNumber extends StartEnd{
public static function sort(&$a){
sort($a,SORT_NUMERIC);
}
public static function getPrev($i){
return $i-1;
}
}
class StartEndDay extends StartEnd{
protected static $enum = array('MON','TUE','WED','THU','FRI','SAT','SUN');
public static function daySort($val1,$val2){
return array_search($val1,static::$enum)-array_search($val2,static::$enum);
}
public static function sort(&$a){
usort($a,'StartEndDay::daySort');
}
public static function getPrev($i){
$position = array_search($i,self::$enum);
if ($position === false){
return false;
}else{
return self::$enum[$position-1];
}
}
}
$a = array(1,4,3,2,5,9,10,12);
echo StartEndNumber::getFormat($a),' '; //1-5,9-10,12
$a = array('TUE','MON','WED','FRI','SAT');
echo StartEndDay::getFormat($a); //MON-WED,FRI-SAT
วันอาทิตย์ที่ 15 ธันวาคม พ.ศ. 2556
calculate age from javascript
function get_age(ymd) {
var x = ymd.split('-');
var y = x[0];
var m = x[1];
var d = x[2];
var today = new Date();
var test = m = (today.getMonth()+1 - m);
if (test < 0) {
y++;
} else if (m == 0 && today.getDate() - d < 0) {
y++;
}
var test2 = today.getFullYear() - y;
if (test2 < 0)
test2 = 0;
return test2;
}
alert(get_age('1980-01-01'));
var x = ymd.split('-');
var y = x[0];
var m = x[1];
var d = x[2];
var today = new Date();
var test = m = (today.getMonth()+1 - m);
if (test < 0) {
y++;
} else if (m == 0 && today.getDate() - d < 0) {
y++;
}
var test2 = today.getFullYear() - y;
if (test2 < 0)
test2 = 0;
return test2;
}
alert(get_age('1980-01-01'));
วันเสาร์ที่ 7 ธันวาคม พ.ศ. 2556
mod_rewrite test tool
http://htaccess.madewithlove.be/
เครื่องมือทดสอบ mod_rewrite โดยไม่ต้องไปแก้ .htaccess บ่อยๆ ทดสอบออนไลน์ได้เลยครับ
เครื่องมือทดสอบ mod_rewrite โดยไม่ต้องไปแก้ .htaccess บ่อยๆ ทดสอบออนไลน์ได้เลยครับ
สมัครสมาชิก:
บทความ (Atom)



