วันพุธที่ 2 มีนาคม พ.ศ. 2554

How to convert VA to Watts and KVA

How to convert VA to Watts and KVA to Kilowatts
http://www.dieselserviceandsupply.com/power_calculator.aspx
เอา 1.25xKw = KVa

Basics

Since watts is volts times amps, what is VA? VA (or volt-amps) is also volts times amps, the concept however has been extended to AC power. For DC current

VA = Watts (DC current).

In AC if the volts and amps are in phase (for example a resistive load) then the equation is also

VA=Watts (resistive load)

where V is the RMS voltage and A the RMS amperage.

In AC the volts and amps are not always in phase (meaning that the peak of the voltage curve is does not happen at the peak of the current curve). So in AC, if the volts and amps are not precisely in phase you have to calculate the watts by multiplying the volts times the amps at each moment in time and take the average over time. The ratio between the VA (i.e. rms volts time rms amps) and Watts is called the power factor PF.

VA·PF = Watts (any load, including inductive loads)


In other words, volt-amps x power factor = watts. Similarly, KVA*PF = KW,
Or kilovolt-amps times power factor equals kilowatts.
When you want to know how much the electricity is costing you, you use watts. When you are specifying equipment loads, fuses, and wiring sizes you use the VA, or the rms voltage and rms amperage. This is because VA considers the peak of both current and voltage, without taking into account if they happen at the same time or not


Finding the Power Factor
How do you find the power factor? This isn’t easy. For computer power supplies and other supplies that are power factor corrected the power factor is usually over 90%. For high power motors under heavy load the power factor can be as low as 35%.

Industry standard rule-of-thumb is that you plan for a power factor of 60%, which somebody came up with as a kind of average power factor.

Converting VA to Amps

How to convert VA to amps? Use the following formula:



Where A stands for the RMS amps, VA stands for volt-amps, V stands for RMS volts and PF stands for the power factor.

Converting VA to Volts

How to convert VA to volts? Use the following formula:



Where V stands for RMS volts, A stands for the RMS amps, VA stands for volt-amps, and PF stands for the power factor.

What is KVA?

KVA is just kilovolt-amps, or volts times amps divided by 1000:

KVA·PF = KW (any load, including inductive loads)

Where KVA stands for kilovolt-amps, KW stands for kilowatts, and PF stands for the power factor.


Keep the factor of 1000 straight when dealing with mixed units:
KVA·PF = W/1000 (any load, including inductive loads)

VA·PF = 1000·KW (Kilowatts to VA)


The Following equations can be used to convert beween amps, volts, and VA. To convert between kilovolt-amps, kilowatts, and kiloamps, keep track of the factor of 1000.

Convert VA to Amps (at a fixed voltage)
Convert KVA to KW (kilovolt-amps to kilowatts)
Convert KVA to Amps (at a fixed voltage)
Converting Watts to KVA (watts to kilovolt-amps)
Convert Amps to VA (at a fixed voltage)
Convert VA to Volts (at a fixed current)
Convert Volts to VA (at a fixed current)
Convert Volts to Amps (at a fixed VA)
Convert Amps to Volts (at a fixed VA)

Converting VA to Amps (voltage fixed)

The conversion of VA to Amps is governed by the equation Amps = VA·PF/Volts)

For example 12 VA·0.6/(12 volts) = 0.6 amp

Converting KVA to KW (Kilovolt-amps to Kilowatts)

The conversion of KVA to KW is governed by the equation KVA = KW/PF)

For example, if the power factor is 0.6
120 KVA·0.6 = 72 Kilowatts

Converting Watts to KVA (watts to kilovolt-amps)

The conversion of W to KVA is governed by the equation KVA=W/(1000*PF)


For example 1500W/(1000*0.83) = 1.8 kVA (assuming a power factor of 0.83)
F
Converting Amps to VA (voltage fixed)

The conversion of Amps to VA is governed by the equation VA = Amps · Volts/PF

For example 1 amp * 110 volts/0.6 = 183 VA


Converting Amps to KVA (voltage fixed)

The conversion of Amps to KVA is governed by the equation KVA = Amps · Volts/(1000·PF)

For example 100 amp * 110 volts/(1000*0.6) = 18.3 KVA

Converting VA to Volts (current fixed)

The conversion of VA to Volts is governed by the equation Volts = VA·PF/Amps

For example 100 VA · 0.6/10 amps = 6 volts

Converting Volts to VA (current fixed)

The conversion of Volts to VA is governed by the equation VA = Amps · Volts/PF

For example 1.5 amps * 12 volts/0.6 = 30 VA

Converting Volts to Amps at fixed VA

The conversion of Volts to Amps is governed by the equation Amps = VA·PF/Volts

For example 120 VA* 0.6 /110 volts = 0.65 amps

Converting Amps to Volts at fixed VA

The conversion of Amps to Volts is governed by the equation Volts = VA·PF/Amps

For Example, 48 VA · 0.6 / 12 Amps = 2.4 Volts

Explanation

Amps are how many electrons flow past a certain point per second. Volts is a measure of how much force that each electron is under. Think of water in a hose. A gallon a minute (think amps) just dribbles out if it is under low pressure (think voltage). But if you restrict the end of the hose, letting the pressure build up, the water can have more power (like watts), even though it is still only one gallon a minute. In fact the power can grow enormous as the pressure builds, to the point that a water knife can cut a sheet of glass. In the same manner as the voltage is increased a small amount of current can turn into a lot of watts.

วันจันทร์ที่ 10 มกราคม พ.ศ. 2554

แปลงไฟล์ในแผ่น AVCHD (m2ts) เป็นไฟล์ MKV

AVCHD (Advanced Video Codec High Definition) เป็นไฟล์วิดีโอความละเอียดสูง ซึ่งเรามักเห็นกันในแผ่น DVD หรือสื่อบันทึกข้อมูลอื่นๆ พวกกล้องวิดีโอ คุณภาพนั้นก็ด้อยกว่าภาพ Blu-ray ไม่เท่าไหร่ครับ แต่จุดเด่นที่ชัดเจนกว่าคือขนาดไฟล์ที่มีขนาดเล็ก เพราะใช้การเข้ารหัสไฟล์แบบ MPEG-4 AVC (H.264) ทำให้สามารถบรรจุหนังความละเอียดสูงลงแผ่น DVD5 เพียงแผ่นเดียวเท่านั้น
อย่างไรก็ตามแม้มีข้อดีแต่ก็มีข้อด้อยอยู่เหมือนกัน กล่าวคือหากนำแผ่นดังกล่าวมาเล่นในคอมพิวเตอร์ หรือเครื่องเล่นที่ไม่ได้มีตัวถอดรหัสโดยเฉพาะก็จะเล่นไม่ได้ การเล่นในคอมพิวเตอร์นั้น เราสามารถซิกแซกได้ด้วยการเข้าไปเปิดไฟล์โดยตรงที่โฟลเดอร์ [ไดรฟ์]:\BDMV\STREAM โดยไฟล์ที่อยู่ในโฟลเดอร์นั้นจะเป็นไฟล์นามสกุล m2ts เราเพียงลากไฟล์ดังกล่าวมาวางบนหน้าต่างโปรแกรม KMPlayer ก็เล่นได้แล้ว และเพื่อความสะดวกยิ่งขึ้น ควรแปลงไฟล์ดังกล่าวเป็นไฟล์แบบ MKV ด้วยวิธีการดังนี้ครับ

หมายเหตุ
วิธีการทำนี้อาจจะกล่าวได้ว่าไม่ได้เป็นการแปลงเนื้อในภาพวิดีโอ เพียงแต่เปลี่ยนการเปลี่ยนเสื้อผ้า ซึ่งจะใช้เวลาในการทำรวดเร็วมากประมาณ 2 –3 นาทีก็เสร็จแล้ว (ทดสอบจากฮาร์ดดิสก์แบบ Raid 0 หนังหนึ่งเรื่องใช้เวลา 106 วินาที)

ใช้โปรแกรมในการทำ 2 โปรแกรมคือ
tsMuxeR [url= http://www.videohelp.com/tools/tsMuxeR ]download[/url]

mkvmerge GUI http://www.videohelp.com/tools/MKVtoolnix

1. เปิดโปรแกรม tsMuxeR ขึ้นมาดังรูปด้านล่างนี้ คลิกปุ่ม Add

2. คลิกเลือกนำไฟล์ m2ts ที่อยู่ในโฟลเดอร์ [ไดรฟ์]:\BDMV\STREAM เข้ามาในโปรแกรม



3. เมื่อนำไฟล์เข้ามาในโปรแกรมเสร็จแล้ว คลิกเลือก Demux เพื่อทำการแยกไฟล์ภาพ และไฟล์เสียงออกมาจากไฟล์ m2ts

4. คลิกปุ่ม Browse เลือกตำแหน่งสำหรับบันทึกไฟล์

5. คลิกปุ่ม Start Demuxing โปรแกรมจะเริ่มการแยกไฟล์ภาพและเสียงออกให้ทันที


ไฟล์ภาพที่แยกได้ตามตัวอย่างนี้ นามสกุล .264 ส่วนไฟล์เสียงนามสกุล .dts (เป็นเสียงแบบ DTS)



6. เปิดโปรแกรม mkvmerge GUI ขึ้นมา คลิกปุ่ม Add เพื่อนำไฟล์ภาพและเสียงที่แยกเสร็จแล้ว เข้ามาในโปรแกรม

7. คลิกเลือกบรรทัดของไฟล์ภาพ และคลิกที่แท็บ Format specific options เพื่อกำหนดค่า FPS (เฟรมเรท) ของภาพ หากคุณไม่กำหนดตัวโปรแกรมจะใช้ค่ามาตรฐานคือ 25 FPS ตามตัวอย่างนี้ภาพวิดีโอของผมมี FPS: 23.976
ถ้าคุณอยากจะรู้ว่าเฟรมเรทของภาพคุณเท่าไหร่ กดปุ่ม alt + j ระหว่างที่เล่นไฟล์ผ่านโปรแกรม KMPlayer นะครับ จะมีรายละเอียดแสดงขึ้นมาให้เห็น

8. คลิกปุ่ม Browse เลือกตำแหน่งสำหรับบันทึกไฟล์ จากนั้นก็คลิกปุ่ม Start musing โปรแกรมจะรวมไฟล์ภาพและเสียง ให้กลายเป็นไฟล์ mkv ทันที

MKV 2 Blue-ray

หลังจากเขียนบทความ แปลงไฟล์ในแผ่น AVCHD (m2ts) เป็นไฟล์ MKV คราวนี้เรามาแปลงไฟล์ MKV กลับไปบ้าง ถ้าหากคุณมีไฟล์แบบ MKV อยากจะแปลงกลับไปเป็น AVCHD (m2ts) เพื่อบันทึกลงแผ่น DVD5 หรือ Blu-ray (คุณต้องมีแผ่น Blu-ray และเครื่องไรท์ด้วยนะครับ) เพื่อนำไปเล่นในเครื่องเล่น ก็ทำด้วยด้วยวิธีการในบทความนี้ครับ

วิธีการทำต้องอาศัยโปรแกรม
tsMuxeR http://www.videohelp.com/tools/tsMuxeR

โดยมีขั้นตอนการทำดังนี้

1. คลิกปุ่ม Add เพื่อนำไฟล์ mkv เข้ามาในโปรแกรม

2. คลิกเลือกรูปแบบไฟล์ที่จะทำ Blu-ray disk หรือ AVCHD disk ก็เลือกตามต้องการได้เลยครับ

3. คลิกปุ่ม Browse เพื่อกำหนดตำแหน่งสำหรับบันทึกไฟล์

4. คลิกปุ่ม Start muxing โปรแกรมจะเริ่มสร้างไฟล์ให้ทันที




###จบแล้วครับ##

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

thumbnail icon size windows xp

This simple tutorial will walk you through the steps to configure you thumbnails to be bigger than the default size. Alternatively, you could make them smaller as well, if you would like to fit more on a page but still have the thumbnail view. This will only change it for one user as well, so if other people use your machine, it will not affect them. Keep in mind that if the thumbnails are getting made bigger than they should they may distort after a certain size. Let’s get started.



This is the default size of the thumbnail images in windows XP.



We will be modifying the registry to make this change. To open the registry editor, click on Start and select Run (Please note that my start menu says TeamTutorials instead of “start” – Learn how to change that by following http://teamtutorials.com/windows-tutorials/changing-your-start-button-text)



Type in “regedit” (without the quotes) and press enter to launch the Registry Editor.



This is the default view of the registry. Click the expand button (the plus signs) next to the proper keys to navigate to the following key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer

Once you are there, click on Explorer instead of click the expand sign in the left pane and the right pane will fill up with keys.



You editor should now look like the above picture. Look for a key called ThumbnailSize. If one does not exist (like the picture above) we will need to create it. If it does exist you can skip this step.



Right-click on any whitespace located in the right pane, hover over new, and select DWORD Value. This will create a key in the right pane. Name it ThumbnailSize. Make sure you have no spaces in the name.



Once you double-click on the value a box will pop up that looks like the picture above. You can now enter the value you wish to use. You can select either decimal or hexadecimal, doesn’t really matter, except the number limits are different. If you are using decimal, the number can be 32 (smallest) to 256 (largest) which converts to 20 (smallest) and 100 (largest) if you are using hexadecimal. You can now close out of your windows you have open and check your work.



Smallest:
Hex – 20
Decimal – 32



Windows Default:
Hex – 64
Decimal – 100



Largest:
Hex – 100
Decimal – 256

This concludes this tutorial. I hope you were able to follow it with little trouble. Please comment with problems and suggestions for new tutorials. Thank you for reading.

วันพฤหัสบดีที่ 21 ตุลาคม พ.ศ. 2553

Alternate Row Color in Crystal Report

Most of the time while developing reports people wonder how to have alternating row colors in the report like below.

Customer Name Address City State Zip
Suparba panda 123 olive rd St Louis MO 54678
John Doe 456 Tree drive Raleigh NC 14676
Jane Doe 768 Hudson rd Atlanta GA 76555


There is a cool trick to it.

Go to the format section of the Details. Click the Color Tab. Then click the button next to the Background Color CheckBox..



In the formula editor of background color, type the following:

if RecordNumber mod 2 = 0 then crSilver else crNoColor



Save and close the editor.

And now when you run the report you will see alternate colors of silver and white in the details section.

Conclusion

วันอังคารที่ 19 ตุลาคม พ.ศ. 2553

SQL Server::Cursor::ทำความรู้จักกับ Cursorsubject

SQL Server::Cursor::ทำความรู้จักกับ Cursorsubject:ทำความรู้จักกับ Cursorcontent:Cursor ใช้เพื่อเข้าถึงกลุ่มผลลัพธ์ ( ResultSet ) และสามารถทำสิ่งต่างๆต่อไปนี้ได้
1) สามารถเข้าถึงตำแหน่ง Record ของกลุ่มผลลัพธ์ได้
2) สามารถดึงข้อมูลจาก Column ของ Record ที่ชี้อยู่ได้
3) สามารถเปลี่ยนแปลงแก้ไขข้อมูลใน Record ที่ชี้อยู่ได้SQL Server::Cursor::ขั้นตอนการสร้าง Cursorsubject:ขั้นตอนการสร้าง Cursorcontent:ขั้นตอนการสร้าง Cursor ดังนี้
1) ประกาศ Cursor
2) เปิด Cursor
3) เข้าถึง Record ข้อมูลด้วย Cursor
4) ปิด Cursor
5) คืนทรัพยากรที่ถูกใช้โดย Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DECLARE CURSORsubject:DECLARE CURSORsyntax:DECLARE cursor_name [ INSENSITIVE ] [ SCROLL ] CURSOR
FOR
[ FOR { READ ONLY | UPDATE [ OR column1 [, columnN ] ] } ]content:ใช้ในการประกาศ Cursor
> โดย INSENSITIVE เป็นการกำหนดให้สร้างเป็นตารางชั่วคราวแยกต่างหากไว้ในฐานข้อมูลระบบ tempdb
ดังนั้นการแก้ไขข้อมูลจากตารางหลัก จะไม่มีผลกับข้อมูลที่เกิดจาก Cursor นี้ และการแก้ไขข้อมูลที่ Cursor
นี้ ไม่สามารถทำได้
> โดย SCROLL เป็นการกำหนดให้สามารถใช้คำสั่ง FIRST, LAST, PRIOR, NEXT, RELATIVE และ ABSOLUTE
เพื่อเข้าถึงแต่ละ Record ของ Cursor ได้ ( ถ้าไม่กำหนดคำสั่งนี้จะใช้ได้เพียง NEXT เท่านั้น )
> โดย สามารถใช้คำสั่ง COMPUTE, COMPUTE BY, FOR BROWSE และ INTO ไม่ได้
> โดย READ ONLY เป็นการกำหนดว่า Cursor นี้สามารถอ่านได้อย่างเดียว
> โดย UPDATE เป็นการกำหนดว่า Cursor นี้สามารถ UPDATE ข้อมูลได้ และ UPDATE คอลัมน์ใดได้บ้าง
ถ้าไม่ระบุ จะหมายถึงสามารถ UPDATE ได้ทุก COLUMNexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DECLARE CURSOR [ แบบที่ 2 ]subject:DECLARE CURSOR [ แบบที่ 2 ]syntax:DECLARE cursor_name CURSOR
[ LOCAL | GLOBAL ]
[ FORWARD_ONLY | SCROLL ]
[ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]
[ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ]
[ TYPE_WARNING ]
FOR
[ FOR UPDATE [ OR column1 [, columnN ] ] ]content:ใช้ในการประกาศ Cursor โดยปกติ Cursor จะเป็นแบบ GLOBAL
( สามารถเปลี่ยนได้โดย sp_dboption db_name, "default to local cursor", "TRUE" )
> โดย FORWARD_ONLY จะทำให้ใช้ได้แค่คำสั่ง FETCH NEXT เท่านั้น
> โดย SCROLL จะทำให้สามารถใช้คำสั่ง FIRST, LAST, PRIOR, NEXT, RELATIVE และ ABSOLUTE ได้

> โดย STATIC คือเป็นการกำหนดให้สร้างเป็นตารางชั่วคราวแยกต่างหากไว้ในฐานข้อมูลระบบ tempdb
ดังนั้นการแก้ไขข้อมูลจากตารางหลัก จะไม่มีผลกับข้อมูลที่เกิดจาก Cursor นี้ และการแก้ไขข้อมูลที่ Cursor
นี้ ไม่สามารถทำได้
> โดย KEYSET คือหมายความว่า Cursor นี้จะอาศัย Unique Indexes ในการเข้าถึงข้อมูลจริงที่เก็บไว้ในตารางหลัก
ดังนั้นหากมีการเปลี่ยนแปลงข้อมูลในตารางหลักจะทำให้ข้อมูลจาก Cursor ได้รับผลกระทบตามไปด้วย
( ถ้าหาก Table ไม่มี Unique Indexes แล้วก็จะถูกเปลี่ยนไปเป็น STATIC โดยอัตโนมัติ )
> โดย DYNAMIC เป็นการกำหนดว่าหากมีการเปลี่ยนแปลงข้อมูลที่ตารางหลักแล้ว จะมีผลต่อ Cursor ด้วย
จะทำให้ไม่สามารถใช้คำสั่ง FETCH ABSOLUTE ได้ ( วิธีการทำงานของ Cursor นี้นั้น ทุกๆครั้งที่มีการ FETCH
ข้อมูล Cursor จะถูกสร้างใหม่ ทำให้ข้อมูลมีการ UPDATE อยู่เสมอ แต่จะทำให้ใช้ Resource สูงมากตามลำดับ )
> โดย FAST_FORWARD คือจะเข้าถึง Record แรกโดยอัตโนมัติหลังจากเปิด Cursor และจะปิด Cursor
ดยอัตโนมัติทันทีเมื่อเข้าถึง Record สุดท้าย ( ไม่สามารถใช้ได้พร้อมกับคำสั่ง SCROLL, SCROLL_LOCKS,
OPTIMISTIC, FOR UPDATE ได้ )

(
เงื่อนไขของการใช้ FAST_FORWARD ดังนี้
1) เมื่อมีการ Query ระหว่าง 2 ตามรางแล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น STATIC
2) เมื่อมีการ Query โดย Distributed Query แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น KEYSET
3) เมื่อมีการใช้คีย์เวิร์ด FOR UPDATE แล้ว FAST_FORWARD จะถูกเปลี่ยนแป็น DYNAMIC
4) ถ้า Query มีการอ้างถึง column ที่มีข้อมูลประเภท text, ntext หรือ image แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น DYNAMIC
5) ถ้า Query มีการอ้างถึง column ที่มีข้อมูลประเภท text, ntext หรือ image และมีคีย์เวิร์ด TOP ด้วย แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น DYNAMIC
)

> โดย READ_ONLY เป็นการกำหนดให้ Cursor อ่านได้อย่างเดียว
> โดย SCROLL_LOCKS เป็นการ Lock ข้อมูลในตารางจริง เมื่อมีการอ่านมายัง Cursor ทำให้ไม่สามารถแก้ไขข้อมูลในตารางจริงได้
> โดย OPTIMISTIC เป็นการอ่านและบันทึกลงได้ และไม่มีการ Lock ใดๆ

> โดย TYPE_WARNING กำหนดให้มีการแจ้งเตือน หากมีการเปลี่ยนแปลงประเภทของ Cursor ( ที่เปลี่ยนแปลงโดยอัตโนมัติตามเงื่อนไขต่างๆ )
> โดย FOR UPDATE เป็นการกำหนดว่า Cursor นี้สามารถ UPDATE ข้อมูลได้ และ UPDATE คอลัมน์ใดได้บ้าง
ถ้าไม่ระบุ จะหมายถึงสามารถ UPDATE ได้ทุก COLUMNexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::OPEN cursorsubject:OPEN cursorsyntax:OPEN { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการเปิด Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::FETCH cursorsubject:FETCH cursorsyntax:FETCH
[ [ NEXT | PRIOR | FIRST | LAST | ABSOLUTE n | RELATIVE n ] FROM ]
{ { [ GLOBAL ] cursor_name } | cursor_variable_name }
[ INTO @varname1 [, @varnameN ] ]content:ใช้ในการเข้าถึงข้อมูลของ Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::CLOSE cursorsubject:CLOSE cursorsyntax:CLOSE { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการปิด Cursor
example:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DEALLOCATE cursorsubject:DEALLOCATE cursorsyntax:DEALLOCATE { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการคืนทรัพยากร ในกรณีที่ไม่ได้ใช้ Cursor นั้นแ้ล้วexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::@@CURSOR_ROWSsubject:@@CURSOR_ROWSsyntax:@@CURSOR_ROWS content:ถ้าคืนค่า -n เพื่อบอกว่าพบจำนวน n record และจะมากขึ้นเรื่อยๆ เพราะยังโหลดไม่เสร็จ
ถ้าคืนค่า n เพื่อบอกว่าพบจำนวน n record ( เพราะโหลดเสร็จแล้ว )
ถ้าคืนค่า -1 เพื่อบอกว่าเป็นการเปิดแบบ DYNAMIC
ถ้าคืนค่า 0 เพื่อบอกว่ามีจำนวน 0 recordexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
END

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::@@FETCH_STATUSsubject:@@FETCH_STATUSsyntax:@@FETCH_STATUScontent:ถ้าคืนค่า 0 คือเข้าถึง Record สำเร็จ
ถ้าคืนค่า -1 คือเข้าถึง Record ไม่สามารถกระทำได้ หรือได้ชี้เกิดกลุ่มของผลลัพธ์ไปแล้ว ( EOF )
ถ้าคืนค่า -2 คือการเข้าถึง Record มีความผิดพลาดเกิดขึ้นexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int

DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex

WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex

FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
END

CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::ตัวอย่างการ UPDATE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่subject:ตัวอย่างการ UPDATE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่example:UPDATE table_name
SET column_name = value
WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name }

UPDATE person
SET sex = 2
WHERE CURRENT OF cur_personSQL Server::Cursor::ตัวอย่างการ DELETE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่subject:ตัวอย่างการ DELETE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่example:DELETE table_name
WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name }

DELETE person
WHERE CURRENT OF cur_person

วันศุกร์ที่ 8 ตุลาคม พ.ศ. 2553

Desktop background/wallpaper unlocked

Desktop background/wallpaper locked using regedit how do i unlock it?
well i have a friend who got to know a trick from his bro who the head of IT in a firm n he locked my laptop`s wallpaper

how do i unlock it ???????????


i have tried


"HKLM\SOFTWARE\Microsoft\Windows\
CurrentVersion\policies\ActiveDesktop"

&

"HKCU\Software\Microsoft\Windows\
CurrentVersion\Policies\ActiveDesktop"

In those entries look for: "NoChangingWallpaper".
If you see that make sure that the dword value is set to 0 (zero).

HKLM does not have ActiveDesktop folder in the policy folde


GO TO START
RUN
Type gpedit.msc

CLICK OK
go to user configuration (left window)
Administrative templates
Desktop
Active Desktop (single click)

on rght hand side
DOUBLE CLICK Active Desktop wallpaper

under settings
click disabled or not configured (whichever works one by one)
press ok

Restart computer,

Add: go to start , run.
Type desk.cpl