วันศุกร์ที่ 16 สิงหาคม พ.ศ. 2562

วิธีแก้ปัญหาติดตั้ง Angular บน Ubuntu ไม่ได้โดยไม่ใช้ sudo

สร้าง directoy สำหรับ Global module
$ mkdir ~/.npm-global
 จากนั้น config npm
$ npm config set prefix '~/.npm-global'
เพิ่ม .npm-global ไปยัง System Path
$ vim .bashrc
เพิ่มข้อความนี่ไปที่บรรทัดสุดท้าย
export PATH=~/npm-global/bin:$PATH
 ติดตั้ง Angular อีกครั้ง คำสั่ง
npm install -g @Angular/cli

วันศุกร์ที่ 3 สิงหาคม พ.ศ. 2561

วิธีการแก้ Unknown Validation Message ใน Eclipse

วันนี้ได้รับงานให้แก้ไขโปรเจคเก่า เลยนำ source code import เข้ามาให้ eclipse 

หลังจากนั้นลองสั่ง clean project พบว่าเจอ validation error

แต่พอลองเข้าไปอ่านว่า error นั้นเกิดจากส่วนไหน... ถึงขั้นงง เพราะ IDE บอกว่า
Unknown Validation Message 


วิธีแก้ไข
  1. เปิด Project properties

วันศุกร์ที่ 23 กุมภาพันธ์ พ.ศ. 2561

วิธีการหา Profile path ของ Google Chrome

Google Chrome มี feature ให้เราสามารถสร้าง Profile ในการใช้งานได้
ซึ่งก็หมายถึง เราสามารถใช้ Google Chrome ด้วยหลาย accounts ในเครื่องเดียวกันได้นั่นเอง

สำหรับการเพิ่ม Profile สามารถอ่านได้จาก https://support.google.com/chrome

หลังจากที่มีการใช้งานหลาย Profiles ในเครื่องเดียวกันแล้ว ก็ต้องมีที่เก็บข้อมูลของแต่ล่ะ Profile แต่ล่ะ Profile แยกกัน

ในบทความนี้จะแสดงวิธีการหา location path ของ Google Chrome profiles\

โดยค่าเริ่มต้นแล้วตำแหน่งที่เก็บ profile ของ Google Chrome จะขึ้นอยู่กับ Platform ที่ใช้ เช่น

วันจันทร์ที่ 12 กุมภาพันธ์ พ.ศ. 2561

How to disable kernel updates in Ubuntu via command line


This article gives the steps how to upgrade all the apt-get packages without updating the kernel on Ubuntu via command line.

Disable Kernel Update
sudo apt-mark hold linux-image-generic linux-headers-generic 

Updates Apt-Get Local DB
sudo apt-get update
Install Upgrades
sudo apt-get upgrade -y

How to re-enable Kernel Updates

วันอังคารที่ 14 มีนาคม พ.ศ. 2560

Salesforce วิธีเช็คว่า String เท่ากับ ช่องว่าง, null บน Apex Class

[Apex class]

การตรวจสอบค่าใน Apex class controller

กำหนดให้รับค่า id มาเก็บไว้ในตัวแปรประเภท String(id)
String id;
id = System.currentPageReference().getParameters().get('id');  
ถ้าต้องการตรวจสอบค่าของ id ว่ามีค่าหรือไม่ เพื่อจัดการตัวแปร ใน Controller
if(id==''){
System.debug('Mode: create');
}elsle{
System.debug('Mode: edit');
}
จาก code ด้านบน เมื่อ id มีค่าเป็น "null" 
โปรแกรมจะไม่เข้าการทำงานในส่วนของ if แต่จะทำงานในส่วนของ else แทน

ดังนั้น วิธีการเช็ค empty('') value == '' ไม่สามารถใช้กับค่า null ได้นั่นเอง

ถ้าต้องการตรวจสอบค่า ทั้ง ช่องว่าง empty('') และ ค่า null เราสามารถใช้ function มาตราฐานที่ให้มาได้เลยครับ