แสดงความเห็นโดย จั่น บน พฤศจิกายน 18, 2009
เมื่อใช้ function readfile(); ใน php แต่ php.ini ตั้งไว้
memory_limit = 24M ; Maximum amount of memory a script may consume (8MB)
เมื่อไฟล์มีขนาดใหญ่มากเกิน 24M ไฟล์จะถูกตัดออก อ่านเข้ามาใน program ได้เพียง 24MB
วิธีการแก้ไข
แก้เป็น
max_execution_time = 1800 ; Maximum execution time of each script, in seconds
max_input_time = 1800; Maximum amount of time each script may spend parsing request data
memory_limit = 500M ; Maximum amount of memory a script may consume (8MB)
จากนั้นก็ restart apache
เขียนแล้วใน Uncategorized | Leave a Comment »
แสดงความเห็นโดย จั่น บน พฤศจิกายน 11, 2009
1). ที่ windows เปิด command prompt พิมพ์คำว่า php แล้วไม่ขึ้นคำว่า command not found แสดงว่า สามารถเรียก php.exe ผ่าน command prompt ได้ (ปกติแล้วลง Appserv ตัวโปรแกรม php.exe จะอยู่ที่ path C:\AppServ\php5)
2).ที่ windows เข้าไปที่ Administrative tools –> ดับเบิ้ลคลิกที่ Task Scheduler
3). คลิกขวาที่ Task Schedule Library แล้วเลือก Create Basic Task
จากนั้นใส่ชื่อ, เลือก Daily หากต้องการเรียก php รายวัน, เลือกเวลา และเลือก Start a program
4) ในช่อง Program/script ให้ Browse ไปที่ bat ไฟล์ที่เราสร้างไว้ตั้งแต่ต้น อย่างเช่นในตัวอย่างนี้สร้างไฟล์ชื่อ sscron.bat โดยเก็บไว้ที่ C:\Users\jun\ โดยเนื้อหาของ sscron.bat จะเป็นดังนี้
start php.exe C:\\AppServ\\www\\FPO\\modules\\Subscription\\sendmailforss.php
หมายถึงตัว Task Scheduler ของ Windows จะไปเรียกไฟล์ sendmailforss.php ด้วย php.exe
5). ขั้นตอนสุดท้าย กด Finish
6.) จะได้งานใหม่ขึ้นมาดังรูป
ให้ double click ที่งานนั้น
แล้วเลือกเป็น Run whether user is logged on or not เพราะ server อาจจะ Log off เมื่อหน้าจอนิ่ง แต่เราก็อยากให้งานที่เราตั้งไว้ทำงาน และเลือก Do not store password. The task will only have access to local computer resources ดังรูป จากนั้นกด OK
ไซต์อ้างอิง
http://www.devx.com/DevX/Article/39900/1763/page/3
เขียนแล้วใน Uncategorized | Leave a Comment »
แสดงความเห็นโดย จั่น บน พฤศจิกายน 1, 2009
วันนี้เรียน software project management สอนให้เรารู้ว่ามีเทคนิคต่างๆในการจัดการปัญหาเมื่อเจอปัญหา เช่นเมื่อคุยกับลูกค้า และการทำ software เป็นเรื่องยากที่จะประเมินเวลา ไม่เหมือนงานก่อสร้างที่ประเมินขนาดของานที่เหลือได้ชัดเจน
อาจารย์บอกว่า คนเราำทำอะไรก็ตามได้งานออกมาหนึ่งชิ้น และจะภูิมิใจตนเอง มีกำลังใจทำต่อไป สังเกตตัวเราเองก็ใช่เลย ถ้าวันไหนทำงานแล้วออกได้ 1 ชิ้นจะรู้สึกดีมีกำลังใจ แต่ถ้าวันไหน ไม่ได้งานเลยจะรู้สึกเบื่อๆ
เขียนแล้วใน Uncategorized | Leave a Comment »
แสดงความเห็นโดย จั่น บน ตุลาคม 31, 2009
เรียน Software Metrics จบ 2 บท ต้องหาหนังสือมาอ่านด่วน ไม่รู้เรื่องเลย
Software Metrics: A Rigorous and Practical Approach, Revised (Paperback)
~ Norman E. Fenton
Norman E. Fenton (Author)
เขียนแล้วใน Uncategorized | Leave a Comment »
แสดงความเห็นโดย จั่น บน ตุลาคม 22, 2009
If you intend to create a back up of your database in Server A and restore it on a Server B, here’s how to go about it. Create a .bak file (Open SSMS > Database > Right Click your database > Tasks > BackUp > Specify the destination).
To do it using script, check my blog over here .
Once the .bak is created, copy this file from Server A to a Server B. We will assume that the file has been copied at the location ”C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\” at Server B. It can any location that you desire.
How to restore the .bak file
Use this query:
RESTORE DATABASE [SouthWind]
FROM DISK = ‘C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\South.BAK’
WITH REPLACE,
MOVE ‘SouthWind_Data’ TO ‘C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\SouthWind_Data.MDF’,
MOVE ‘SouthWind_Log’ TO ‘C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\SouthWind_Log.LDF’
where FromDisk is where the .bak file is kept on Server B and MOVE specifies the location of the data and log file.
http://www.sqlservercurry.com/2008/02/restore-bak-using-sql-server-2005.html
เขียนแล้วใน Uncategorized | 2 Comments »
แสดงความเห็นโดย จั่น บน ตุลาคม 17, 2009
อยู่ดีๆก็เข้าใจการเขียน Program อีกระดับหนึ่ง
ที่อาจารย์สอนกลับมาอีกครั้งหนึ่ง
ตอนนี้ที่ติดเขียน program แล้ว bug เสมอๆ หรือคิดไม่ออก
ไม่ใช่เราไม่ถนัดภาษานั้นๆ
แต่เราไม่ได้คิดอย่างเป็นระบบ วิธีหนึ่งที่ช่วยเราได้คือเขียน flowchart หรือฝึกออกแบบเยอะๆก่อนลงมือเขียนจริงๆ
เขียนแล้วใน Uncategorized | 1 ความคิดเห็น »
แสดงความเห็นโดย จั่น บน ตุลาคม 16, 2009
หากต้องการเก็บ ไฟล์ binary ลง field ที่มีคอลัมน์เป็น BLOB, MEDIUMBLOB หรือ Largeblob ก็ตาม ใน 1 Insert statement ของ SQL มักจะมีขนาดใหญ่ไปตามไฟล์ที่ต้องการจะใส่เข้ามา
สิ่งที่ต้องทำคือ default ของ mysql จะตั้งให้ max_allowed_packet=1M
ดังนั้นจะต้องแก้ให้ใหญ่ขึ้นมาดังนี้
Way to increase your maximum allowed packet size in your MYSQL server
Open your my.ini file in the MYSQL server folder.
Add this entry max_allowed_packet = 32M beneath the [mysqld].
Now restart your MYSQL server
******วิธีการตรวจว่าตอนนี้ MYSQL ของเรามี max_allowed_packet ก่อนและหลังปรับเท่าไหร่ ให้ใช้ mysql client ใน Command prompt
C:\mysql
mysql>mysqladmin -p variables
เขียนแล้วใน Uncategorized | Leave a Comment »
แสดงความเห็นโดย จั่น บน กุมภาพันธ์ 17, 2009
ระบบฐานข้อมูล คือ อะไร คือสิ่งที่เพิ่มเข้าไปในระบบคอมพิวเตอร์เพื่อไปเพิ่มประสิทธิภาพการจัดการข้อมูล ข้อดีข้อเสียของระบบฐานข้อมูล ช่วยเสนอแนะแนวทางการจัดการเมื่อเรานำเอาระบบฐานข้อมูลมาใช้กับองค์กร
ระบบแฟ้ม File Systems คืออะไร
ระบบฐานข้อมูลเชิงสัมพันธ์คืออะไร RDBMS
ความสัมพันธ์ของคำต่อไปน้ จงเขียนอธิบาย
1) Integrity Rules vs Data Inconsistency
ถึงแม้จะมีการใช้ระบบฐานข้อมูลแทนระบบแฟ้มข้อมูลแต่ก็ยังคงมีการซ้ำกันของข้อมูลเกิดขึ้นเพราะเราต้องเชื่อมความสัมพันธ์ระหว่าง table ด้วย Foreign key แต่ในการเกิดการซ้ำ ระบบฐานข้อมูลได้ตั้งกฏหนึ่งขึ้นมาชื่อว่า Integrity Rules เพื่อควบคุมไม่ให้เกิดความขัดแย้งของข้อมูล Data Inconsistency โดย Integrity Rules มีอยู่ 2 ข้อคือ ควบคุมที่ Primary key เรียกกฏนี้ว่า Entity Integrity กับควบคุม Foreign Key เรียกกฏนี้ว่า Referential Integrirty
Entity Integrity บอกว่า Primary Key จะต้องห้ามซ้ำและห้ามว่าง Unique, Not Null
Referential Integrity บอกว่า Foreign Key ซ้ำได้ ว่างได้ และ Foreign key ที่อ้างอิงถึง Primary Key ใน table หลักจะต้องมีตัวตน
2) Database Table vs Entity Set
ในการออกแบบฐานข้อมูลในยุคแรก ใช้แนวคิดการปฏิบัติการทางเซตมาเชื่อมความสัมพันธ์ระหว่างแฟ้มข้อมูล แต่ต่อมาในยุค RDMBS ของ Codd ได้เรียก Entity Set นั้นว่าเป็น table แทน และได้เพิ่มตัวปฏิบัติการเชิงสัมพันธ์เข้าไปอีก 4 ตัวนอกเหนือจากเซต คือ Select, Join, Divide, Project นอกจากนี้ table ของ Codd ก็มีคุณสมบัติ 9 อย่างที่ไม่เหมือนกับ table ในทางคณิตศาตร์อีกด้วย
3) Relational Operations vs Union Compatible
ตัวปฏิบัติการเชิงสัมพันธ์ที่ต้องมีคุณสมบัติ Union Compatible คือ Union, Different, Intersect
คุณสมบัตินี้คือตัวถูกดำเนินการจะต้องมี 2 ตัวและมี attributes เหมือนกัน และมีจำนวนเท่ากัน
4) …
เขียนแล้วใน Ct316 | Leave a Comment »
แสดงความเห็นโดย จั่น บน มกราคม 27, 2009
เขียนแล้วใน Uncategorized | 2 Comments »
แสดงความเห็นโดย จั่น บน ธันวาคม 10, 2008
โจทย์ ให้ตัวตั้งอย่างมากใส่ได้เป็นตัวเลข 3 หลัก และตัวนำมาคูณก็ 3 หลักเช่นกัน เขียน program คูณกันธรรมดาแบบมีเครื่องหมาย
Program Multiply Two Integers
MULTIPLICAND : 5
MULTIPLIER : -5
PRODUCT : -25
RUN AGAIN (y/n):
———–
TITLE (Multipli.asm)
Include Irvine32.inc
Include Macros.inc
.data
.code
main PROC
Start:
call Clrscr
mGotoxy 20,10
mWrite <”Program Multiply Two Integers”,0dh,0ah>
mGotoxy 20,11
mWrite “MULTIPLICAND : “
call ReadInt
mov ebx, eax
mGotoxy 20,12
mWrite “MULTIPLIER : “
call ReadInt
IMUL ebx
mGotoxy 20,13
mWrite “PRODUCT : “
call WriteInt
mGotoxy 20,14
mWrite “RUN AGAIN (y/n): “
call ReadChar
cmp al, ‘y’
je Start
exit
main ENDP
END main
เขียนแล้วใน CT215 , Programming | 4 Comments »