22 Apr
Posted by Ultra MCU as Computer, Programming
พอดีว่าง ๆ เลยหาโหลด IPhone SDK มาลองเล่น ๆ ดู เขียนไปมึน ๆ ไปก็มัน ๆ ดี
สมมุติว่า เรามี TextField(Windows เรียก TextBox) อันนึง TagId = 1
แล้วเราต้องการ Convert ไปใส่ในตัวแปล Int หรือ Float
UITextField *txtNumber = (UITextField *)[window viewWithTag:1];
float fNumber;
fNumber = [[txtNumber text] floatValue];
float nNumber;
nNumber = [[txtNumber text] intValue];
และถ้าเราอยาก Convert จาก Int/Float เป็น String ลงใน text field
txtShowF.text = [NSString stringWithFormat:@"%f", fNumber];
txtShowN.text = [NSString [...]
select concat(‘Imnuke’,’ ’,’Im-AI’) = Imnuke Im-AI
select concat(‘Imnuke’,’ ’,’Im-AI’,NULL) = NULL
วันนี้เจอปัญหาโปรแกรมดึงข้อมูลวิธีการใช้ยาแล้วไม่ยอมแสดง
หลังจากตรวจสอบพบว่า มีการนำค่ามา Concat กัน ซึ่งเวลา Query ข้อมูลออกมาดู
โปรแกรมไม่แสดงบอกว่าเป็น NULL หรือ ” ก็ไล่ไปไล่มาว่าทำไมข้อมูลไม่ยอมออก
และแล้วก็พบว่า select concat String กับ NULL = NULL
มีอยู่ 1 ฟิลที่มีค่าเป็น NULL โอ้วววววววว
แล้วก็ไม่บอกตั้งแต่แรกว่าเป็น null เพราะแสดงออกมาเป็นค่าว่างเหมือนกัน
วิธีตรวจสอบ การใช้ CPU และ RAm ใน Solaris
#prstat -a -s rss
Ex. —————————————————————————————
bash-3.00# prstat -a -s rss
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
422 root 26M 9032K sleep 59 0 0:01:12 0.1% Xorg/1
9 root 8636K 7604K sleep 59 0 0:00:15 0.0% svc.configd/16
7 root 9292K 6832K sleep 59 0 0:00:16 0.0% svc.startd/12
457 root 6380K 4588K sleep [...]