วันอาทิตย์ที่ 14 ธันวาคม พ.ศ. 2557

SQL Commands

SQL Select


Table: Customer


 Examples



 SQL Distinct

Table: Customer

Example


SQL Where

Table: Customer



Information from website: http://www.w3schools.com

วันเสาร์ที่ 13 ธันวาคม พ.ศ. 2557

PHP Commands

   This topic, we'll show you some examples of using PHP commands, which are if, else, elseif, if/then, if/then/else, if/ifelse/else, switch, etc.

PHP Commands Example

If

<?php
          $a = 5;
          $b = -5;
          $c = 3;
          if($a < $b)   {
                 echo"\$a is less than \$b";
          }
          if($b < $c)   {
                 echo"\$b is less than \$c";
          }
?>

Else

<?php
          $a = 5;
          $b = -5;
          if($a < $b)   {
                 echo"\$a is less than \$b";
          }
          else   {
                 echo"\$a is more thank or same as \$b";
          }
?>

Elseif

<?php
          $b = -5;
          $c = 3;
          if($b > $c)   {
                echo"$b is more than $c";
          }
          elseif($b < $c)   {
                echo"$b is less than $c";
          }
          else   {
                echo"$b is same as $c";
          }
?>

If...Then

<?php
          $a = 1;
          if($a)   {
                 echo "True!";
          }
?>

If...Then...Else

<?php
          $a = 5;
          $b = "10";
          if($a > $b)   {
                  echo "$a is more than $b";
          } else {
                  echo "$a is less than $b";
          }
?>

If...Elseif...Else

<?php
          if($a == $b)   {
               //if $a same value as $b, do the first command
               //do second command if true
          }   
          elseif($a > $b)   {
               //if $a is more than $b, do this command
          }
          elseif($a < $b))   {
               //if $a is less than $b, do this command
          }
          else   {
               //if all commands false, do this command
          }
?>

Switch

<?php
          $a = "100";
          switch($a)   {
               case(10):
                      echo "variable keep 10";
                      break;
               case(100):
                      echo "variable keep 100<br>";
               case(1000):
                      echo "variable keep 1000";
                      break;
               default:
                      echo "<p>are you sure that it was number or not";
          }
?>

For Loop

<?php
          for($i = 0; $i < 10; $i++)   {
                      echo $i<br>;
          }
?>

Foreach Loop

<?php
          $array = array("name" => "Jet","Occupation" => "Bounty Hunter");
          foreach($array as $val)   {
                       echo "<p>$val";
          }
?>

While

<?php
          $bg = "DDDDDD";
          while($data = mysql_fetch_array($result))   {
                       if($bg = "DDDDDD")   {
                                  $bg = "EEEEEE";
                       }
                       else   {
                                 $bg = "DDDDDD";
                       }
          echo '<tr bgcolor="$bg">',
          echo $data[name];
          echo'</tr>';
?>

Do...While

<?php
          $i = 0;
          do   {
                        print$i;
          }
          while($i>0);
?>

For

<?php
          for($a = 1; $a < 13; $a++)   {
                   echo"<font color=green>";
                   echo"2 x $a ="2*$a,"<br>";
                   echo"</font>";
          }
?>


Information from website:
https://sites.google.com

วันอาทิตย์ที่ 30 พฤศจิกายน พ.ศ. 2557

Computer O-net Examination Example(Unfinished)

O-net Examination - Year 2008 (Unfinished)

*Red choices is correct answer*

1. Which is not the application on "Smartphone"?
a. Ubumtu
b. iphone os
c. Android
d. Symbian

2. Which file contain data as a character type?
a. mp3
b. jpeg
c. html
d. movie

3. What does Open Source copyright allow user to do?
(1) Able to use without paying fee for copyright.
(2) Try using it first and pay later if found that it is interesting.
(3) User able to edit a program by himself.
a. (1) and (3)
b. (2) and (3)
c. Only (2)
d. Only (1)

4. One random web board requires...
(1) Users able to do their activities after they've logged in.
(2) Users may post a new comments or reply the old ones.
(3) System will automatically remember all users ID.
In case of designing this database, which is correct?
a. Making user table, comment table, and reply table.
b. No need of making user table despite of able to record user in comment and reply tables.
c. Making user and comment tables, whereas reply table already placed in comment table.
d. No need of making comment table as it's already recorded in user table.

5. What is the central processing unit of Computer?
a. Moniter
b. CPU
c. Speaker
d. Program

6. Which is the right behavior when researching information for assignment?
a. Copy it all from website.
b. Use information from web board for assignment.
c. Take images from website.
d. Give credit to the owner.

7. To hold a profession as Website Developer, which Information they must expert and able to do?
(1) Computer Hardware
(2) Operating System
(3) Web Server
(4) html
(5) Database System
(6) Java
a. (1) and (3)
b. (2) and (5)
c. (3) and (4)
d. (3) and (6)

8. The library want to develop book renting system that able to record data on electronic card without writing, which technology should the library use?
a. Smart Card
b. Fingerprint
c. Bar code
d. Wi-fi

9. Which are all wireless technology?
a. Wi-fi, IP
b. Wi-fi, Bluetooth
c. 3G, ADSL
d. 3G, Ethernet

10. Choose the best answer.
a. Recording data in CD is magnetic technology.
b. IP numbers are used with Network Interce Card.
c. Secondary storage is Volntile storage system.
d. ACII and EBCIDIC code that use 8-bit Character code.

11. Which is the smallest unit of Computer?
a. Bit
b. Byte
c. Field
d. Record

12. After the data has been processing, then what do we got?
a. Document
b. Record
c. Information
d. Database

13. Which is the Computer signal?
a. Analog
b. Digital
c. Electronic
d. Electricity

14. What is the file of WinZip?
a. .doc
b. .zip
c. .txt
d. .exe

15. Detail of data that show the property of Entity is?
a. Attribute
b. Relationship
c. Database
d. File

16. Which relationship is not correct?
a. 1:1
b. 1:M
c. M:1
d. M:n

17. To identify the relationship between?
a. One to One
b. One to Many
c. Many to Many
d. Many to One

18. In SQL, after FORM is?
a. Field name
b. Table name
c. Query name
d. All correct

19. In SQL, after SELECT is?
a. All possible
b. Table name
c. Field and Query name
d. None

20. What is the duty of DBMS?
a. Keeping data.
b. Connecting with data manager.
c. Controlling the use of data.
d. All correct.

This exercises is form:
https://krupaga.wordpress.com
http://natchapon21.blogspot.com/

วันศุกร์ที่ 21 พฤศจิกายน พ.ศ. 2557

PHP Functions

Standard Functions

is_string()

is_array()

is_bool()

is_float()

is_double()

is_real()

is_int()

is_integer()

is_long()

is_null()

is_numeric()

is_object()

is_scalar()

Typical Number&Math Functions

min()

max()

ceil()

floor()

round()

abs()

log()

log10()

decbin()

decoct()

dechex()

base_convert()

deg2rad()

rad2deg()

pi()

sin()

cos()

tan()

fmod()

bc Math Functions

bcadd()

bcsub()

bcmul()

bcdiv()

bcmod()

bccomp()

bcpow()

bcsqrt()

bcpowmod()

bcscale()

Random Number Functions

rand()

srand()

getrandmax()

mt_rand()

mt_srand()

mt_getrandmax()

Array

array_change_key_case()

array_pad()

array_splice()

array_merge()

each()

current()

pos()

key()

next()

prev()

end()

array_reverse()

unset()

array_pop()

array_push()

array_shift()

array_values()

array_keys()

array_chunk()

array_unshift()

array_unique()

array_count_values()

range()

sizeof()

count()

array_combine()

array_fill()

array_fill_key()

array_flip()

array_intersect()

array_intersect_assoc()

array_intersect_key()

array_walk()

array_walk_recursive()

String Functions

Addcslashes()

Addslashes()

bin2hex()

chop()

chr()

chunk_split()

convert_uuencode()

count_chars()

crc32()

crypt()

explode()

echo()

fprintf()

get_html_translation_table()

html_entity_decode()

htmlentities()

htmlspecialchars_decode()

htmlspecialchars()

implode()

join()

metaphone()

itrim()

rtrim()

trim()

ord()

parse_str()

print()

printf()

Quometa()

sha1()

sha1_file()

lavenshtein()

md5()

md5_file()

similar_text()

soundex()

sprintf()

sscanf()

str_replace()

str_ireplace()

str_pad()

str_repeat()

str_rot13()

str_shuffle()

str_split()

str_word_count()

strcasecmp()

strchr()

stristr()

strcoll()

strcspn()

strip_tags()

stripcslashes()

stripslashes()

strlen()

strnatcasecmp()

strnatcmp()

strncasecmp()

strncmp()


Information from: http://computer.todaygoods.com/php/index.html

วันจันทร์ที่ 3 พฤศจิกายน พ.ศ. 2557

Database System(Will upload more later)

(This post is under construction, will upload more soon)

Database System


   Database is information management system that let users able to use information of any work together, without information being complicate, and help user avoid the dissent of those information, also, information in system must be reliable, the same standard, by identify the information security.

   Nowadays, information is known as standard data, can be use to benefit in many ways, whether for business, management and other works.
   Organizations that have large amount of data find it's hard to manage them all, including when it's come to use, so Computer become the equipment for data management since then.
   However, each program must created control and management method itself, so database become necessary, especially for the work systems that need Computer. Therefore, design and development of database system should be about control and management of information using.

What is Database System

   Database System is an information structure that has detail of data, which relating to use along with various system.
   Users can storage data in many ways, therefore, they are able to add, edit, delete and view those data, which mostly are application of Computer system that use for data management.

Definition

- Bit 
   Is the smallest unit.
- Byte
   An unit that added many bits together and then became Character.
- Field
   An unit that consist of more than one characters, then got a meaning of something identity, e.g. name, address, etc.
- Record
   Unit from many field data assemble together, for example, 1 record of student, which content:
1. Student ID; 1 record
2. Student name; 1 record
3. Address; 1 record
- File
   Unit that assemble from many records(with the related data).

Other definition

- Entity
   Is the name of something, for example, people, place, etc.
- Relationships
   Is about relationship of entity, such as, student entity and subject entity.

Relationships between entity


   There are 3 types of relationship between entity.
1. One-to-one relationships (1:1)
2. One-to-many relationships (1:m)
3. Many-to-many relationships (m:n)

Importance of database processing

1. Reduce data redundancy.
2. Avoid data inconsistency.
3. Able to use data together.
4. Keep data reliable
5. Able to set data the same standard
6. Data security
7. Freedom of using data

Type of Databases

1. Relational database
2. Network database
3. Hierarchical database

Popular database program

- Access
- FoxPro
- dBase
- SQL

วันจันทร์ที่ 18 สิงหาคม พ.ศ. 2557

Communication System and Network

Data Communication


What is Data Communication?

   Data Communication is the process of exchanging information from the sender or source pass the transmission medium to the destination.

Components of Data Communication System

1. Message
   Information that can be message, number, sound, and even video.
2. Sender/ Source
   Is an equipment that use to send information, such as, Computer or phone.
3. Receiver/ Destination
   Is an equipment that use to receive information, such as, Computer or phone.
4. Transmission Medium
   Such as cable or radiate wave.
5. Protocol
   Group of laws and rules that identify to be an engagement of sender and receiver.

Telecommunication

   Telecommunication is that similar to remote sensing system, which objective is to exchange information, relate to the use of electronic transmitters, for example, telephone, television, radio, and Computer.
   Nowadays, telecommunication is very important for the development of country, we discovered that developed countries all have very useful and modern telecommunications, which cause many business...say...Economic system is somehow effected from telecommunication.

Network

What is network?

   Network are system that link together in the local distance with remote system, especially networks that link with the remote distance, are really necessary to dependent telecommunication.

Example of telecommunications

- Telegraphy
- Facsimile
- Telephone
- Television
- Radio
- Microwave
- Satellite

Computer Network

What is Computer Network?

   Computer network is network connection of Computer and equipment, which using cable or radiate wave as a transmission medium.

Advantages of Network

1. Is the right way of using resource.
2. Reduce cost.
3. More convenience when communication.
4. More security.

Categories of Networks

- LAN (Local Area Network)
   LAN is private network. Is designed to allow user to share source on network.
- MAN (Metropolitan Area Network)
   MAN is province network.
- WAN (Wide Area Network)
   WAN is country network, able to communicate across the countries.

Internet

   Internet is public network.

Computer Networks - Basic Configurations

1. Microcomputer-to-LAN Configurations
2. Microcomputer-to-Internet Configurations
3. LAN-to-Internet Configurations
   This equipment is called "Router", is an important equipment that have to connect between two networks, even though switch or bridge also able to connect.
4. Satellite and Microwave
   Is count as one of the popular technologies. If the distance of two networks is too far and hard to make a connection, or can't even make a connection because of geometric problem, so this way can make an effective connection.
5. Wireless Telephone
   For example, Laptop or Notebook that use to connect with wireless phone pass the cable or Bluetooth.

วันจันทร์ที่ 30 มิถุนายน พ.ศ. 2557

CPU

What is CPU?


   CPU(Pronounce: C-P-U; Central Processing Unit), also known as "Brain of Computer" and sometimes be called "Microprocessor", it processes instructions that are gather from decoding the code in files and programs.

Part of CPU

   There're 3 part of CPU, which are ALU, Control unit, and Register.

ALU

   Is a digital circuit that calculates an arithmetic operations and logic operations between two numbers. The ALU is a fundamental building block of the central processing unit of the computer. 

Control Unit

   Control CPU operation, including ALU operations, the movement of data within the CPU, and the exchange of data.

Registers

   These components are special memory locations that can be accessed very fast. Three registers that are shown:
- The Instruction Register (IR)
- The program Counter (PC)
- The Accumulator

CPU Functions

   CPU has 4 main functions, which are fetch, decode, execute and writeback.

Fetch

   Is the first step of all functions, when the user makes a command to open the program, the CPU receive the request and process it. The CPU then retrieves the desired program by accessing memory for the program's location. Each program has a program counter number, this is a roadmap that the CPU uses to locate the program and get further instructions from the program.

Decode

   When CPU fetches the program, it doesn't see all of graphical aspects like how user see them, but see the code instead. The code must be deciphered into a language that CPU able to read and understand. There are literally hundreds of different programming languages that programmers use to write software programs. First the CPU must decide what language the program is written in and then decode it so that it understands the instructions that are held inside the code.
   The decode process is another list of steps. The CPU breaks down the code so that it is manageable. The part that the CPU deals with are the only ones that directly communicate with it. The opcode(indicates the numerical order of code) is used to figure out the order in which the code must be executed.
   There are times when a CPU can't interpret the code on its own, so it uses a translator called a microprogram. Once the microprogram has interpreted the code, it sends the instructions back to the CPU in a language that it understands.

Execute

   After the CPU finding the numerical order of the instructions in the code, it's now ready to execute them. The program is loaded and made ready for the user. All the components necessary for the program to run efficiently are loaded using the opcode and microprogram if necessary.

Writeback

   Is the final step of all functions. During the each previous functions, the CPU records feedback on the process, this function is necessary if there was a problem during one of the functions. Even if everything loaded successful, the CPU writes the status back into melody. An example of this is when an error causes Windows to not start properly.

Type of CPU

Single core

   Single core CPUs are the oldest type of Computer CPU available and initially, this was the only type of CPU that could be used in Computers. Single core CPUs can only start one operation at a time, so they were not very good at multi-tasking. This meant that there were noticeable deceases in performance whenever more than one application was running. Although only one operation could be started at a time, another one could be activated before the first one was finished.

Advantages
1. Use less power, it takes less power to run a single core CPU. Dual core and Quad core use up a lot of energy, which is not a problem with machines that are plugged into the wall, but it can drain the laptop batteries quickly.
2. Run coolers, using less power mean there's less heat generated by the core.
3. Sufficient for most software, much of today's software isn't build for multi core.

Disadvantages
1. Run slower - In cases where the Computer specs are comparable.
2. Freezing - Many of today's software programs use up a lot of computing power. Often, a user will use many programs, which overloads the CPU.

Dual core

   A dual core is a single CPU that has two cores and thus functions like two CPUs in one. Unlike single core CPUs where the processor has to switch back and forth between different sets of data.
Advantages
1. Perform tasks faster - Dual-core CPU run faster than single-core ones, especially in instances where there are multiple processes at one time.
2. Reduce costs - Even before there were dual-core CPUs, users were able to build dual-processor units that had the computing power of two computers.
Disadvantages
1. Wasted computer power - While dual-core CPUs certainly can blaze through numerous applications, most regular users don't need that much power.
2. Compatibility - Dual-core CPUs will run any software of course, but the software itself has to be programmed for dual-core CPU.

Quad core

   Quad core CPUs are a further refinement of the multi-core CPU design.
Advantages
1. Multitasking - The quad-core system is one of the best systems for multi-tasking.
2. Run intensive applications - Applications that use up a lot of resources, such as graphics programs, video editors, and anti-virus programs can run smoothly at the same time.
3. Less heat and power consumption - Most of the newer quad-core chips are so small and efficient; they can actually use less power and generate less heat than single-core systems.
4. Use for a long term - The problem with Moore's Law is that it practically guaranteed that your Computer would be obsolete in about 24 months. Since few software programs are programmed to run on dual-core, much less quad-core, these processors are actually way ahead of software development.
Disadvantages
1. Lowers battery life - Depending on the type of applications, quad-core system can drain batteries faster.
2. Available software - Software needs to be programmed to take full advantage of quad-core CPUs, so not all programs can utilize the four processors.
3. Hardware compatibility - Multi-core processors are compatible with certain motherboards, so it's not as simple as swapping out the old CPU with a brand new one. Purchase of a new motherboard may also necessitate the purchase of other components that are compatible with the motherboard.

Some type of Intel CPU

Intel Pentium Dual Core Processors

Intel Pentium Dual core CPU Logo
   The Intel Pentium processors with Intel dual-core technology deliver great desktop performance, low power enhancements, and multitasking for everyday computing.

Intel i3 Processors (Ivy Bridge)

Intel Dual Core i3 CPU Logo
   Intel core i3 dual core processors provide 4-way multitasking capability, runs at fixed speed ideal for typical tasks and media playback but not games.

Intel i5 Processors

Intel Dual Core i5 CPU Logo
   Intel i5 usually quad core but some dual processors deliver the next level of productivity. Mostly the same as i3 but with Intel Turbo Boost Technology, delivers extra speed when you need it, like the i3 integrated graphic is included but is only ideal for normal use, not for gaming.

Intel i7 Processors

Intel Dual Core i7 CPU Logo
   Intel i7 Processors dual or quad core for the most demanding applications with cache and faster clock speeds, quad-core processors feature 8-way threading, four cores will run faster, and more L3 cache, but will consume more power. High-end use, video and gaming with dedicated video card.