วันพุธที่ 31 ตุลาคม พ.ศ. 2555

What make me here?

Life has no boundaries
...
Thank for พระพุทธเจ้า to give me the way to do
Thank to my family for living
Thank for my teacher to teach
Thank for friend to completed me
Thank for other to support me
...

Favorit
Music: Classic, Soundtrack,
Band: X-Japan, Within Temptation,
Movie: ET, Star war, Beautiful mind,
Cartoon: Ghibli
Country: Thailand, Japan, Germany,
Hobby: Traveling, Book, Movie,

Far Future
50-year old
A little house on High mountain
2 dogs run around me
A few farm
Fresh air

Near Future
Contribute my knowledge to community

Next
MQ i don't want to "lost" anything
Twisted Matrix "amazing project"

Migrate
PHP to Python
SQL to ORM
html to template
Web page to Web Application
Horizontal to Vertically
Everyone is user for system
"in Band, very skilled and less skilled musician need to adopt together"

Platform
2012
We need other platform
Codeigniter.... no
Cake PHP ... no
Zend ... no
Symfony ... no
Java? ... no
Python ... yes
django ... yes
"Simple is more complexities behind"

Software Project Management
2007
Flag ship, CRM
Project management on Trac
Revision control on SVN
{{Applications}}
CRM, Case management, Knowledge management
Sales Management, Marketing Management
Email Mass Marketing
Business Inteligent
{{Application}}
We'd get our platform?
Hosting service
Customization service
Software as service
Cloud service
Python
django, my hero
"Service on Software"

Size Does Matter
2006
Fast growing database, web application was delivered to biggest TV response company
AIX RS/600 was amazing in Thailand
PostgreSQL on AIX, Possible here!
... Now our system serve more than 150GB of data...
... more than 500 users concurrent ...
"Big Huge Giant"

Software Engineering
2003
Requirement analysis
Design
Documentation
Develop
Project management
Implement
Maintain
Version control was implement
CVS SVN
Software Test
Software Quality
"Imagine is more important"

Coding Era
2001
Open source came back
PHP + PostgreSQL+ Apache
First software/service served for businesses
All software written for web, web page!
"team work"

Telephony Network
2001
Move to PABX system
Where voice and data merge here!
Business applications, CRM, messaging system, monitoring software were introduced
Many software are integrated together to complete requirement
"meeting, meeting, business!"

Work!
2000
1-year computer networks, internet servers
ATM, Router, Switch had been setup to serve user
Some on MCU to make meeting over network
We served 600 users with single mail server! with Linux Debian
Open source begin!
Python first introduced
"i'm hungry to know more"

Big Moves
1999
Rosenheim, Germany was next moves
Signal Processing in Big Firm, Siemens
Linux first come in to my life
Environment change
Vision changes
Attitude changes
Life changes
Explore Resenheim
"2nd miracle, Amazing! Incridible"

University
1999
Electrical Engineering Department
Computer/Communication was my major
Digital Image processing using DSP was my project
i fork here
"First miracle, it happend all the time."

Technical School
1996
Knight Rider brought me here
"Time and Time to wait and go for get it"

Next School
1993
Math-Sci was my major here
Music, was my hobby
Trumpet, French-horn were my next instruments in school band
"in a Band, very skilled and low skilled musician need to adopt together"

School
1990
My school was near Wat
I had to walk to school from home every day
I played music on last 3 year in first school
My first instrument was melodeon
"music is one of meditation"

Childhood
I was the second child of three children
We lived close to Wat
I have to learn Buddhism without knowing it
"know nothing means know everything"

Begin
1977
I was born on 10 April
Male
Bangkok, Thailand was my birth place
"a Child can make things"

วันอาทิตย์ที่ 21 ตุลาคม พ.ศ. 2555

PHP Spreadsheet_Excel_Writer with text format

ในการสร้าง Excel ด้วย PHP นั้น ผมก็ใช้  Spreadsheet_Excel_Writer  เพื่อช่วยสร้าง Excel  
ปกติแล้ว เราก็กำหนด Format ของ ตัวเลข วันที่ ค่าเงิน จาก function setNumFormat() แต่พอต้องการแสดงหมายเลขโทรศัพท์ โดยเฉพาะที่ขึ้นต้นด้วย "0" ก็จะมีปัญหาที่เวลาแสดงใน excel แล้ว เลข "0" จะหายไปทำให้แสดงค่าผิดพลาด 

ค้นหาไปก็หลาย ๆ ที่แล้วก็บอกว่าให้ช้ setNumFormat('@') ตามนี้ (http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-format.setnumformat.php) แต่พอนำไปใช้งานก็ยังเป็นปัญหาอยู่

สุดท้ายก็ต้องไปแก้ที่ต้นทางเลยคือที่ Worksheet.php ตามนี้ (http://pear.php.net/bugs/bug.php?id=3514) หรือไม่ก็ไปใช้ writeString() แทน write() ที่ทำการตรวจสอบค่าทีหลัง 

แต่ผมใช้การกำหนด setNumFormat('@') เป็นอย่างนี้แล้วก็ไปเพิ่ม

function write($row, $col, $token, $format = null)
    {
        // leading zero or string format
        if ($format->_num_format=='@') // || preg_match("/^0/", $token))
               return $this->writeString($row,$col,$token,$format);


 สุดท้ายก็ขอขอบคุณ opensource ไว้เพราะว่าทำให้เราแก้ไขได้เอง และศึกษาเข้าไปในส่วนต่าง ๆ ได้อีก