Internship, Days 33-35 (6-8 Jun 2012) [END]

Posted on June 10th, 2012 in computer, CPE, in English, in Thai, personal | 1 Comment »


(Photo: A gift from Symphony, and my faculty-paper)

สำหรับตอนนี้เป็นตอนสุดท้ายของซีรี่ส์ฝึกงานแล้วนะครับ ขออภัยที่มาช้าไปเล็กน้อย เริ่มกันเลยดีกว่า

ในช่วงเวลาสามวันที่ผ่านมานี้ผมก็ได้ใช้เวลากับงานชิ้นใหม่คือการวิเคราะห์ข้อมูลจากอีเมล์ โดยอีเมล์จะให้ข้อมูลต่างๆ เกี่ยวกับระบบเครือข่ายมา โดยประกอบไปด้วยบรรทัดต่างๆ ในรูปแบบ <ชื่อฟิลด์ข้อมูล> : <ค่าของฟิลด์> ทำให้สามารถถอดข้อมูลมาวิเคราะห์ได้ง่าย

ผมก็คิดว่าใช้เวลาไม่น่านาน แต่ด้วยความที่ใกล้จบฝึกงาน ผมต้องเตรียมนำเสนอการฝึกงานทั้งหมด และต้องเตรียมเอกสารที่จะต้องส่งด้วย ไม่ว่าจะส่งไปที่ใดก็ตาม เช่น ใบเวลาทำงาน ฯลฯ จากนี้ผมขอแบ่งเป็นส่วนๆ ดีกว่า โดยแต่ละส่วนก็จะเป็นไทยอังกฤษสลับกันจะได้ตามง่ายๆ ครับ

This is the last episode in the internship series. Sorry for being late, let’s begin anyway.

During the three days I spent time with the new task analyzing data from emails. The emails have network data as <field> : <value> lines, which are easy to extract.

I didn’t think it would take time, but as the end of internship nears, I have to prepare the presentation as well as the papers to submit to matter where they are such as time record, etc. For this entry I’ll split into multiple parts, with Thai and English interleaving for easy reading.

งานชิ้นสุดท้าย / Last Task

ดังที่ได้กล่าวไป สำหรับงานชิ้นสุดท้ายเป็นการสร้างระบบคัดข้อมูลออกจากอีเมล์ ซึ่งจะทำงานบนฐานข้อมูลเดียวกับระบบแจ้งเตือนอีเมล์ แต่อยู่คนละบริบทกัน โดยใช้อีเมล์ชุดเดียวกันจริง แต่แยกส่วนการประมวลผลออก ทำให้ไม่ต้องเขียนระบบรับอีเมล์ใหม่

ปัญหาจากงานนับอีเมล์ก็จะตามมาด้วย ก็คือฐานข้อมูลที่ไม่มีคีย์หลัก เป็นต้น ซึ่งผมแก้ปัญหาโดยการสร้าง log มาเก็บไว้ว่าระบบของเราตรวจเมล์ไปแล้วกี่ฉบับบ้าง โดยจะไม่มีการตรวจอีเมล์ซ้ำไม่ว่าในกรณีใดๆ ก็ตาม ตรงนี้ทำให้เกิดข้อจำกัดมากมาย เช่น การไม่มีผลย้อนหลังของการตั้งค่า เป็นต้น แต่ช่วยให้เราตรวจสอบเฉพาะอีเมล์ใหม่เท่านั้น จึงไม่น่าช้าจนเกินไป

การเลือกเมล์ทำได้ตามผู้ส่งเท่านั้น ยังไม่มีการคัดกรองตามหัวข้อ (ซึ่งเป็นข้อจำกัด) และงานก็ยังไม่เสร็จด้วย ซึ่งถ้ามีโอกาสจะพยายามทำให้เสร็จ เพราะเป็นประโยชน์กับทุกฝ่าย

As introduced earlier, the last task consists of email data extraction which works on the same system as mail alerts, but on a different context. The emails will come from the same source, but processing will be separated so we do not need to build another database-inbox.

The no-primary-key problem from email counting task also carries over, which I fixed by building an execution log which keeps track of the last time we checked emails, and will never revisit older emails no matter the reason. While this makes the system relatively faster, it suffers from the non-retroactiveness of email inspection, i.e. if you change the email definition midway, old and new data won’t be consistent. (So it might be better to delete the definition entirely)

Email definition can only be done on a per-sender basis without per-subject separation. The work is not done, but I will try to finish if possible, as it only benefits everyone.

การนำเสนองาน / Presentation

วันที่ 7 เป็นวันที่นิสิตนักศึกษาฝึกงานจะต้องนำเสนอผลงาน ด้วยความที่ผมคุยกับพี่เลี้ยงไว้ว่าอธิบายงานตั้งแต่ต้นจนจบ (ความเป็นมา ความต้องการ โครงสร้าง กระบวนการ แสดงโปรแกรมถ้าเป็นไปได้ สรุปและข้อเสนอแนะ) และงานผมมีถึงสี่งาน (จริงๆ คือห้า ได้แก่ ติดตั้งเซิร์ฟเวอร์ ตัวเล่นวิดีโอ นับอีเมล์ ระบบ IDC และดึงข้อมูลอีเมล์ แต่อันแรกไม่นับ) ผมก็เลยกดไป 43 สไลด์ เวลาอีกเกินครึ่งชั่วโมง ในขณะที่คนอื่นใช้เวลาน้อยกว่ามาก โดยที่ผมแทบจะไม่ได้อธิบายความรู้อะไรเลย (ผมมองว่ามันเป็นแค่งานโปรแกรมมิ่งธรรมดาๆ คิดว่ากระบวนการสร้างโปรแกรมน่าสนใจกว่า) แต่คนอื่นๆ ก็มีพูดเรื่องความรู้ที่ได้ออกมาด้วย ผมก็รู้สึกแปลกๆ กับงานตัวเอง แต่ก็ดีใจที่ได้พูดออกไปว่าทำอะไรบ้าง

7th was the day the intern students present their works. Since I’ve talked to my supervisor that I will be explaining the work “from beginning to end” (reasons, requirements, architecture, implementation, demonstration, conclusion and suggestion) and I have four tasks to do (five actually: server installation, “vplay” video player, email counting, IDC system, and email data extraction but I won’t count the first)  and I ended up with 43 slides taking up more than half-hour while others used much less time; and I did it all without telling any kind of knowledge at all (I see my work as ordinary programming tasks so the process is more interesting than the code) while others presented more content and knowledge than I did. I felt awkward afterwards, but still happy being able to tell others what I do.

งานเลี้ยงส่ง / Farewell Party

งานเลี้ยงจัดที่ร้านเอ็มเค โรบินสันรัชดา เป็นหนึ่งในไม่กี่โอกาสที่ได้คุยกับเพื่อนๆ พี่ๆ คราวละหลายๆ คน ขอขอบคุณพี่ๆ ทุกท่านที่มาเลี้ยง และขออภัยที่พวกผมกินเยอะนะครับ

The party was hosted at MK Restaurants, Robinson Ratchada. This was one of the few moments I get to talk to many friends and seniors at once. Thank you very much, and sorry for over(-the-budget)eating.

เคลียร์เอกสาร / Final Paperwork

การจัดการเอกสารทั้งหมด

  • ลอกข้อมูลเวลาจากตารางเวลาทำงานของบริษัทลงใบเวลาของคณะ ให้พี่เลี้ยงลงนามรับรอง
  • ถ่ายเอกสารทั้งหมดที่ต้องมีการส่งคณะหรือบริษัท ยกเว้นความลับองค์กร (ซึ่งไม่ถึงมือผมอยู่แล้ว สบายใจได้)
  • เขียน TODO ในส่วนที่ยังไม่ได้ทำ และอธิบายโครงสร้างงานของเราไว้สำหรับคนต่อไป
  • ส่งรายงานของบริษัทฉบับสุดท้ายให้ HR
  • คืนบัตรพนักงานและบัตรลิฟท์อาคาร

Just do all the paper.

  • Copy the times from company log to faculty log, have supervisor sign it.
  • Photocopy everything that need to be submitted, except corporate secrets (which I don’t have.)
  • Write TODOs where needed, and document as much as possible
  • Submit last weekly report to HR
  • Return employee and lift cards

ขอขอบคุณ / Thanks to:

พี่ๆ ที่บริษัท CS LOXINFO ทุกคน

  • พี่แพท (เพ็ญโสภา กมลนาวิน) พี่เลี้ยงผู้ควบคุมการฝึกงาน
  • พี่กี (กีรติพงศ์ อุกะโชค) นับว่าเป็นพี่เลี้ยงอีกคน แม้ว่าจะไม่ได้อยู่ตลอดการฝึกงานก็ตาม
  • พี่หนุ่ย (สุรศักดิ์ อุทโยภาศ) หัวหน้าฝ่าย
  • พี่ติ๊ก (กัญญ์ชิสา ดันไหม) ฝ่ายทรัพยากรบุคคล
  • พี่ยอด แต่จะขอบคุณมากกว่านี้ถ้าพี่ซื้อ Diablo III ให้ผมด้วย (อิอิ)
  • และพี่ๆ ทุกคนในบริษัทที่เป็นบรรยากาศและชีวิตในการทำงานของผมด้วย
และสุดท้ายขอขอบคุณเพื่อนๆ ทุกคนที่มาฝึกงานด้วยกันครับ แม้ว่าบางทีจะเจอบ้างไม่เจอบ้างก็ตาม

Thanks to all CS LOXINFO employees!

  • P’Pat (Pensopha Kamolnawin), internship supervisor
  • P’Gee (Keeratipong Ukachoke), technical advisor
  • P’Nui (Surasak Uthayopas), head of technical & operation department
  • P’Tik (Kanchisar Dunmai), HR
  • P’Yod (I don’t know your name), but more thanks if you actually buy me Diablo III instead of bragging how you earn so much from Auction House out loud :)
  • And everyone for providing me with enjoyable work environment and experience!

Finally, thanks to all friends in the same internship program, even though we don’t get to see each other much.

สำหรับผู้ที่ต้องการเนื้อหาหรือข้อมูลจากการฝึกงาน หากสามารถให้ได้จะให้นะครับ ติดต่อมาได้

For those who need content or data from internship, I will provide them if possible so feel free to contact.

Some more pics


At presentation, my two friends preparing


ASCII Art of company name, limited to 80 characters wide


Phase I of MK Pot


Phase II, and we ate them all.

You can view all internship posts here: http://lunaticneko.com/blog/?tag=school-internship

Internship, Day 32 (5 Jun 2012)

Posted on June 6th, 2012 in computer, in English, in Thai, personal, PHP, programming | No Comments »

เวลาเหลือน้อยลงไปทุกทีๆ สำหรับการฝึกงานที่ใกล้จะจบลง งานของผมที่ต้องมานั่งแก้บั๊กก็ยังไม่เสร็จ ตอนเช้าผมก็เลยบอกหัวหน้าฝ่ายไปตรงๆ ว่าไม่น่าจะทัน แม้ว่ามันจะไม่ยากแต่มันเยอะมาก และเป็นการแก้บั๊กจากงานที่ไม่ได้ทำเอกสารไว้ ทำให้ไม่รู้ว่าต้องเริ่มแก้ตรงไหนก่อน ต้องมาคอยไล่ดักเอาเองตลอด ที่สำคัญอย่างที่บอกไปในตอนก่อนๆ คือพี่ที่ทำแอพพลิเคชันตัวนี้มาก่อนใช้หน้าต่างแบบ pop-up เยอะมาก ทำให้ไล่โค้ดยากขึ้นไปอีก

เวลาที่เหลือส่วนใหญ่ก็ทำสไลด์เพื่อเตรียมนำเสนอในวันที่ 7 ต่อไป

Time’s running out and the end of internship draws near. I have to continue debugging the job but it’s not quite done so I met the boss and told him it’s not going to finish in time. It’s not that hard, but the code was not documented so I have no idea where the possible code defects are. Most importantly, I might have said this earlier, that this application uses a lot of JS pop-ups which makes it all harder.

Whatever time I have left, I spend them on working with the slide to present on 7th.

Internship, Day 31 (1 Jun 2012)

Posted on June 5th, 2012 in in English, in Thai, personal, rant | No Comments »

วันนี้งานก็ไม่ค่อยเดินอีกแล้ว ส่วนใหญ่เวลาก็หมดไปกับการไล่บั๊กเช่นเคย จำได้ว่าพี่บอกว่าให้ทำงานนี้ถึงแค่วันนี้เท่านั้น วันอังคารจะมีงานใหม่พร้อมกับให้เตรียมนำเสนองานทั้งหมดอีกที

There’s still not much progress today, hunting bugs all day. I remember the senior limiting my work until today, as I will be switched to another one with final presentation preparation on Tuesday.

I recommend writing database views to reduce stress on your own part when working with complex database systems.

Internship, Day 30 (31 May 2012)

Posted on June 1st, 2012 in in English, in Thai, personal, rant | No Comments »

Image macro consisting of the Github Octocat (stylized, friendly cartoon creature with cat's head and multiple tentacles) and text macro 'because', 'FORK YOU', and 'THAT'S WHY.', playing on the phrase 'Because f**k you that's why' used to indicate deliberate spite, and the word 'fork you', which in turn comes from the phrase 'f**k you' and 'fork', the latter being a term in source version control system.
(Photo: Octocat, one of the many trademarks of Github. Click on it to go to my page there. I might create some repos in the future!)

งานไม่เดิน รูปไม่มี ของดหนึ่งวัน สาเหตุที่เป็นเช่นนี้เพราะการลงทะเบียนครับ

No progress. No picture. No blogging. All blame goes to registration.

Internship, Day 29 (30 May 2012)

Posted on May 31st, 2012 in computer, in English, in Thai, personal, programming, SQL | No Comments »


(Photo: More “proper food” my friend eats.)

ใกล้ครบกำหนดฝึกงานขั้นต่ำแล้ว (ของผมต้องถึง Day 32 เพราะลางานไป 10 ชั่วโมง) วันนี้ผมไปทำงานโดยมีเจตนาเอาฐานข้อมูลที่มีอยู่แล้วมาใช้ล้วนๆ เลย สำหรับงานที่ได้ในตอนนี้คือทำให้ระบบบันทึกการใช้งาน IDC บันทึกการนำอุปกรณ์เข้าและออกได้สมบูรณ์แล้ว แต่ยังไม่สามารถยกเลิกงานบางส่วนระหว่างทำงานได้ในบางกรณี (การยกเลิกงานอาจเกิดขึ้นในกรณีที่ไม่ต้องการทำงานนั้นๆ อีกต่อไป เช่น ตรวจพบทีหลังว่าเซิร์ฟเวอร์ที่นำมาใช้ไม่ได้ หรือไม่ต้องการนำของออกแล้ว เป็นต้น) เนื่องจากยังติดปัญหาว่าโค้ดเก่าพึ่งพา PHP Session มากเกินไป แต่กลับไม่ยอมเก็บตัวแปรที่อ้างถึงผู้ใช้ไว้เลย

So I’m nearing the minimum hours for internship (actually I need 32 days because I took 10 hours of leave). Today I came to work with pure intention to utilize the old database. Today I got the IDC visitor system working right with equipment installation and returns, but still cannot cancel jobs half-way in some cases (It might occur due to server installation error, or customer no longer wishes to remove the piece, for example.) owing to the dependency of the old code on PHP Session system, but lack of any actual reference to database.

Delete from multiple tables

 DELETE table1, table2
FROM table1, table2
WHERE
  table1.pk = table2.pk
  AND (your_condition_here); 

Select neighbors

If you have some tuple (x1,y) where you know only the value of x1, and you wish to select (x1,y), (x2,y), …, (xn,y), this is way to go.

 SELECT X AS REFX, Y AS REFY
FROM your_table
WHERE EXISTS
  (
  SELECT * FROM your_table
  WHERE Y = REFY
    AND X = $x1
  ) 

Internship, Day 28 (29 May 2012)

Posted on May 29th, 2012 in computer, CPE, in English, in Thai, personal, PHP, programming, SQL | No Comments »


(Photo: Guess where we had our lunch today!)

วันนี้กลายเป็นว่างานไม่ค่อยเดินเท่าไหร่ เนื่องจากผมพยายามสร้าง Task List ที่เอาไว้เก็บว่าลูกค้าแต่ละคนเข้ามาทำอะไรบ้าง ความซับซ้อนมันอยู่ที่การสร้างระบบฐานข้อมูลที่รองรับรายการหลายๆ ชนิดได้ ซึ่งตรงนี้ผมก็ทำโดยใช้ generalization และ specialization และหลังจากที่นั่งมั่วกับโค้ดเป็นเวลานาน ในที่สุดผมก็เริ่มเขียน PHP แบบ MVC เป็นขึ้นมาบ้าง แต่ก็ยังไม่ค่อยเข้าใจเท่าไหร่ ที่บอกว่างานไม่เดินเป็นเพราะว่าที่ทำลงไปจริงๆ ไม่ต้องทำก็ได้ เพราะโค้ดที่มีมามันก็มี Task List อยู่แล้ว แค่เก็บไว้อีกที่นึง อ้อ วันนี้พี่พาไปเลี้ยงมือเที่ยงด้วย ขอบพระคุณมากครับ (ถ้าพี่ตามมาอ่านในนี้นะ ^ ^”)

So I didn’t progress much today. I tried to build a Task List system which keeps track of what each customer does at a particular time. The complexity lies within the database code that needs to support multiple types of entries for the Task List, which can be accomplished using generalization and specialization techniques. After messing around for some time, I started to grasp the concepts of PHP and MVC and can now code a bit more properly. The lack of progress was due to the fact that there’s already a Task List system in place. I was reinventing the wheel all along. Finally, special thanks to the senior that treated me lunch!

The Wheel I did reinvent


Note: Tables authorized_on_customer and equipment and column data in temp_equipment shown here are simplified versions of the “real thing” on the live server.

Internship, Day 27 (28 May 2012)

Posted on May 29th, 2012 in computer, in English, in Thai, personal, PHP, programming, SQL | No Comments »


(Photo: What my friend eats for lunch. Not always like this, but always better than mine.)

เข้าสู่สองสัปดาห์สุดท้ายของการฝึกงานแล้ว ผมก็ยังไปทำงานชิ้นเดิมต่อ โดยวันนี้ผมไปขอพี่สร้างตารางใหม่ลงในฐานข้อมูลได้แล้ว โดยสร้างเป็นตารางขึ้นมาเพื่อใช้เก็บข้อมูลชั่วคราวของ Session ส่วนปัญหาเรื่องโค้ดที่ไม่มีการอธิบายนั้นตอนนี้ผมใช้วิธีสร้างไฟล์ติดต่อฐานข้อมูลแยกไว้ต่างหากออกมาจากตัว MVC ก่อน แต่ก็พยายามใช้ของเดิมเท่าที่ทำได้ ไม่สร้างใหม่ (ปัญหานอกจากการไม่มี document คือเขาเอาปลั๊กอิน JS มาใส่ ทำให้ไล่หน้าต่างๆ ไม่ถูก เพราะต้องมาไล่ทั้ง MVC ไล่ทั้ง JS call) ผลที่ได้วันนี้เลยไม่ก้าวหน้าเท่าที่ควร พี่ก็เร่งให้งานเสร็จ เพราะจะได้ไปทำงานอื่นอีกสองอัน

And now I’ve entered the last two weeks. I still work on the same piece today. I got permission to create new tables necessary to store temporary variables from sessions. The undocumented code problem forced me to build a new (hack) procedural code separate from the MVC architecture provided by CodeIgniter; I still attempted to preserve the old code however. Apart from lack of documentation, there are also JS plugins and they really throw me off balance because I spend too much time hunting each piece down, tracing both JS and MVC. In the end, I have not progressed much despite the expedition given by the senior because they wanted me to do two more pieces.

Internship, Day 26 (25 May 2012)

Posted on May 28th, 2012 in computer, in English, in Thai, personal, PHP, programming, SQL | No Comments »


(Photo: Handling two computers at once…)

สรุปว่าส่วนที่ต้องทำจริงๆ คือ การเก็บพวก session การใช้งานต่างๆ ลงไปพักไว้ในฐานข้อมูลก่อน โอเคครับ ไม่ยาก แต่นาน 555+ ที่ต้องเก็บลงฐานข้อมูลเป็นเพราะว่ามันนานเกินกว่าจะเก็บไว้ด้วย PHP session ครับ

So it’s just storing sessions into the database. It’s not that hard but will take some time to code. The reason for this is because the said session is a real-world session which is longer than a PHP session.

SQL: Insert with respect to reference table

Since there’s not much in the blog today, let’s write another knowledge scrap. A reference table is an enumerated table with IDs against “facts” in a one-to-one manner such as:

 
userclass(id INT, name VARCHAR(20));
+------+----------+
| id   | name     |
+------+----------+
|    1 | normal   |
|    2 | silver   |
|    3 | gold     |
|    4 | platinum |
+------+----------+

usertype(id INT, name VARCHAR(20));
+------+------------+
| id   | name       |
+------+------------+
|    1 | individual |
|    2 | sme        |
|    3 | corporate  |
+------+------------+
 

Say, if we want to insert a “silver sme” user into a table, rather than, with PHP variables, using

 
// Get the reference ID from two tables
$q1 = "SELECT id FROM userclass WHERE name='$class'";
$q2 = "SELECT id FROM usertype WHERE name='$type'";

$r1 = mysql_query($q1);
$r2 = mysql_query($q2);

$s1 = mysql_fetch_assoc($r1);
$s2 = mysql_fetch_assoc($r2);

$classid = $s1 ['id'] ;
$typeid = $s2 ['id'] ;

// Now insert into new table
$q3 = "INSERT INTO user (uname, uclass, utype) VALUES('$username', $classid, $typeid)";
$r3 = mysql_query($q3) or die(mysql_error());
 

we have a “PHP-clean but more SQL-complex” way to do it:

 
$q = "INSERT INTO user (uname, uclass, utype)
       (SELECT '$username', userclass.id, usertype.id
        FROM userclass, usertype
        WHERE userclass.name = '$class'
          AND usertype.name = '$type'
       )";
$r = mysql_query($q) or die(mysql_error());
 

It does not hurt to study SQL. You can in fact extend this to as many reference tables as necessary. This is a generalized version of the SQL code:

 
INSERT INTO target_table (
  fixed_col_1, fixed_col_2, ..., fixed_col_m,
  ref_col_1, ref_col_2, ..., ref_col_n)
  (SELECT fixed_input_1, fixed_input_2, ..., fixed_input_m,
          ref_id_1, ref_id_2, ..., ref_id_n
   FROM ref_table_1, ref_table_2, ..., ref_table_n
   WHERE
     ref_table_1.ref_val_1 = ref_input_1 AND
     ref_table_2.ref_val_2 = ref_input_2 AND
     ... AND
     ref_table_n.ref_val_n = ref_input_n
  );
 

Where:

  • fixed_col_i are target columns you want your fixed inputs to go into
  • ref_col_j are target columns you want your inputs to be referenced into IDs and go into
  • fixed_input_i is the data itself. Usually a string or integer or something else.
  • ref_id_j is the id column from each table j. For brevity I’ll force this column to be int.
  • ref_table_j is the table itself. Each table is defined by ref_table_j (ref_id_j INT, ref_val_j SOME_DATA_TYPE)
  • ref_val_j is the value (or “name”) column from each table j.
  • ref_input_j is the user input, usually supplied from PHP or something else.

It will take some time to understand all this due to my bad English, but I think the code can be studied more easily due to the fact that the code does not belong to any human language — they are just symbols derived from English.

Internship, Day 25 (24 May 2012)

Posted on May 25th, 2012 in computer, in English, in Thai, personal, PHP, programming, SQL | No Comments »


(Photo: Finally got this bun!)

วันนี้ผมก็ทำงานต่อจากเมื่อวานเฉยๆ ครับ ไม่ค่อยมีอะไรมาก แต่สิ่งที่เป็นปัญหาอย่างหนักในการทำงานคือฐานข้อมูลที่ไม่มี Foreign Key เลย แม้ว่าเราจะหาความสัมพันธ์ได้จาก query ต่างๆ ที่มี แต่เป็นเรื่องยากพอสมควรเมื่อเทียบกับการทำฐานข้อมูลให้ชัดเจนตั้งแต่แรก และไม่ทราบว่าตรงไหนเป็นบั๊กเพราะไม่ทราบตั้งแต่แรกว่าโปรแกรมควรจะทำงานอย่างไร ทำให้ผมได้แต่จัดการกับ error message ที่ขึ้นมาชัดๆ เท่านั้น (เปิดจาก log ก็ไม่ได้เพราะเซิร์ฟเวอร์ไม่มีการเก็บ error_log ไว้เลย)

I continued on yesterday’s work and not much else. The big problem exists here again because there are no foreign keys at all in the tables I work with. Even though it’s possible to infer from the other queries, it’s still harder than reading a documented or properly FK’d database. Additionally, I didn’t know which part is bugged because I didn’t know how the program is supposed to work, so I could only fix the real, visible errors. (No logs because the server doesn’t have error_log configured.)

Bonus

By the way, this:

 SELECT x,y
FROM A,B
WHERE A.x = B.y; 

is as fast as:

 SELECT x,y
FROM A
  INNER JOIN B ON A.x = B.y; 

Reference: http://stackoverflow.com/questions/121631/inner-join-vs-where

Internship, Day 24 (23 May 2012)

Posted on May 24th, 2012 in cloud, computer, in English, in Thai, personal, PHP, programming | No Comments »


(Photo: I can has coffee?)

เหมือนอะไรๆ จะกลับเข้าสู่ภาวะปกติอีกครั้งเมื่อผมปิดงานโปรแกรมวิดีโอได้ซักที แต่สุดท้ายก็ไม่เป็นเช่นนั้น เพราะวันนี้ในขณะที่ผมกำลังอ่านเรื่อง Cloud ต่อพี่ก็เอางานใหม่มาให้ทันที งานนั้นคือระบบบันทึกการเข้าออกของลูกค้าที่เข้ามาใน data center

แน่นอน องค์กรมหาชนขนาดนี้เขามีใช้อยู่แต่แรกแล้วละ เพียงแค่ว่าเขาอยากให้ทำละเอียดลงไปอีกเท่านั้นเอง เพราะเดิมข้อมูลลูกค้าจะถูกแยกเป็นรายบริษัท คือเป็นความสัมพันธ์แบบ one-to-many จากบริษัทไปหาบุคคล (คือ บริษัทหนึ่งมีหลายคนที่เข้าออก data center ได้) แบบใหม่ต้องการแทรกรายละเอียดงานในระดับ project ลงไปด้วย ทำให้เป็น one-to-many-to-many จากบริษัทไปหาโปรเจคไปหาบุคคลแทน

โชคดีที่โปรแกรมเก่ามีอยู่แล้ว และมีการแก้ไขไปบ้างแล้วด้วย แต่ปัญหาคือมันยังสะดุดๆ เดี้ยงๆ อยู่ พี่ที่ทำก็ไม่ว่างทำต่อ และอีกปัญหาของผมคือโปรแกรมนี้ใช้ CodeIgniter เขียน ซึ่งเป็น MVC ที่ผมไม่คุ้นเคยอย่างแรง จะได้เรียนใหม่อีกรอบก็งานนี้แหละ!!!

Everything seemed to calm down when I close my video task, but it finally was not the case because while I was reading about Cloud the senior came and tasked me with a new job: visitor logging for data center.

Surely, this kind of public corporation already has one, but they want me to go a bit into deeper detail. Customer data relationship used to be one-to-many of company-to-person (one company may have many persons that can access the data center) but the new one will have “project” stuffed in the middle, giving a one-to-many-to-many of company-project-person.

Fortunately there already exists an application that does this and it is already being worked on. The problem is it bugs a lot and the seniors who worked on it no longer had time to continue this project. I have my own problem though: I have no experience with CodeIgniter MVC which this project uses.

Useful reads for vCloud:
http://www.yellow-bricks.com/2010/08/31/vmware-vcloud-director-vcd/
http://www.yellow-bricks.com/2010/09/07/vcd-networking-part-1-intro/
http://frankdenneman.nl/2010/09/provider-vdc-cluster-or-resource-pool/