93
UNIVERSITAS MUHAMMADIYAH CIREBON 2012 Page | 1 DATA STRUCTURE COMPUTER PERSONELL COMPUTER GRAPHIC HIGH LEVEL LANGUAGE COMPILER & INTREPRETERS

b.inggris Imam

Embed Size (px)

Citation preview

UNIVERSITAS MUHAMMADIYAH CIREBON

2012

Page | 1

DATA STRUCTURE COMPUTER PERSONELL COMPUTER GRAPHIC HIGH LEVEL LANGUAGE COMPILER & INTREPRETERS

Page | 2

Chapter 6 :

DATA STRUCTURES

Data structures are generally based on the ability of a computer to fetch and store data at any place in its memory, specified by an address—a bit string that can be itself stored in memory and manipulated by the program. Thus the record and array data structures are based on computing the addresses of data items with arithmetic operations; while the linked data structures are based on storing addresses of data items within the structure itself. Many data structures use both principles, sometimes combined in non-trivial ways (as in XOR linking)

The implementation of a data structure usually requires writing a set of procedures that create and manipulate instances of that structure. The efficiency of a data structure cannot be analyzed separately from those operations. This observation motivates the theoretical concept of an abstract data type, a data structure that is defined indirectly by the operations that may be performed on it, and the mathematical properties of those operations (including their space and time cost).

1. Null Values

Users new to the world of databases are often confused by a special value particular to our field – the NULL value. This value can be found in a field containing any type of data and has a very special meaning within the context of a relational database. It’s probably best to begin our discussion of NULL with a few words about what NULL is not:

NULL is not the number zero. NULL is not the empty string (“”) value.

Rather, NULL is the value used to represent an unknown piece of data. Let’s take a look at a simple example: a table containing the inventory for a fruit stand. Suppose that our inventory contains 10 apples, 3 oranges. We also stock plums, but our inventory information is incomplete and we don’t know how many (if any) plums are in stock. Using the NULL value, we would have the inventory table shown at the bottom of this page. It would clearly be incorrect to include a quantity of 0 for the plums record, because that would imply that we had no plums in inventory. On the contrary, we might have some plums, we’re just not sure.

Databases treat NULL values in a special way, depending upon the type of operation that it is used in. When a NULL value appears as an operand to an AND operation, the operation’s value is FALSE if the other operand is FALSE (there is no way the expression could be TRUE with one FALSE operand). On the other hand, the result is NULL (unknown) if the other operand is either TRUE or NULL (because we can’t tell what the result would be.)

The OR operand treats NULL values in a similar fashion. If the other operand is TRUE, the result of the OR is TRUE (because the real value of the NULL operand doesn’t matter.) On the other hand, if the other operand is either FALSE or NULL, the result of the OR operation is NULL.

Page | 3

There are two special operands used to test for the presence of the NULL value. ISNULL returns TRUE only when the supplied operand has a NULL value. Conversely, ISNOTNULL returns TRUE when the supplied operand does not have a NULL value. These are quite important functions. Avoid one of the most common database mistakes: testing an operand for a NULL value by comparing it to the empty string or zero is not correct!

A value of NULL indicates that the value is unknown. A value of NULL is different from an empty or zero value. No two null values are equal. Comparisons between two null values, or between a NULL and any other value, return unknown because the value of each NULL is unknown. Null values generally indicate data that is unknown, not applicable, or that the data will be added later. For example, a customer's middle initial may not be known at the time the customer places an order.

Following is information about nulls:

To test for null values in a query, use is null or is not null in the where clause. When query results are viewed in SQL Server Management Studio Code editor, null values

are shown as null in the result set. Null values can be inserted into a column by explicitly stating null in an insert or update

statement, by leaving a column out of an insert statement, or when adding a new column to an existing table by using the alter table statement.

Null values cannot be used for information that is required to distinguish one row in a table from another row in a table, such as primary keys.

In program code, you can check for null values so that certain calculations are performed only on rows with valid, or not NULL, data. For example, a report can print the social security column only if there is data that is not NULL in the column. Removing null values when you are performing calculations can be important, because certain calculations, such as an average, can be inaccurate if NULL columns are included.

If it is likely that null values are stored in your data and you do not want null values appearing in your data, you should create queries and data-modification statements that either remove NULLs or transform them into some other value.

When null values are present in data, logical and comparison operators can potentially return a third result of UNKNOWN instead of just TRUE or FALSE. This need for three-valued logic is a source of many application errors. These tables outline the effect of introducing null comparisons.

The following table shows the results of applying an AND operator to two Boolean operands.

AND TRUE UNKNOWN FALSETRUE TRUE UNKNOWN FALSEUNKNOWN UNKNOWN UNKNOWN FALSEFALSE FALSE FALSE FALSE

Page | 4

The following table shows the results of applying an OR operator to two Boolean operands.

OR TRUE UNKNOWN FALSETRUE TRUE TRUE TRUEUNKNOWN TRUE UNKNOWN UNKNOWNFALSE TRUE UNKNOWN FALSE

The following table shows how the NOT operator negates, or reverses, the result of a Boolean operator.

Boolean expression to which the NOT operator is applied Evaluates toTRUE FALSEUNKNOWN UNKNOWNFALSE TRUE

The ISO standard uses the keywords IS NULL and IS NOT NULL to test for the presence of null values.

Boolean expression to which the IS NULL operator is applied

Evaluates to

Boolean expression to which the IS NOT NULL operator is applied

Evaluates to

TRUE FALSE TRUE TRUENULL TRUE NULL FALSEFALSE FALSE FALSE TRUE

Transact-SQL also offers an extension for null processing. If the option ANSI_NULLS is set to OFF, comparisons between nulls, such as NULL = NULL, evaluate to TRUE. Comparisons between NULL and any data value evaluate to FALSE.

2. The indication of the length of a string

String Functions

Function Description UTF-8 equivalent

Asc Returns the ASCII code of a character in a string. String.Code

Base64$ Encode a string in Base64. Since 3.2 version

-

Chr$ Returns a character from its ASCII code. String.Chr

Comp Compares two strings. String.Comp

InStr Searches a string into another string. String.InStr

LCase$ Converts a string to lowercase. String.LCase

Left$ Returns the first characters of a string. String.Left

Len Returns the length of a string. String.Len

Page | 5

LTrim$ Strips white spaces from the left of a string. -

Mid$ Returns a part of a string. String.Mid

Quote$ Quotes a string. -

Replace$ Replaces in a string a substring by another one. -

Right$ Returns the last characters of a string. String.Right

RInStr Searches a string into another string from its right. String.RInStr

RTrim$ Strips white spaces from the right of a string. -

Scan Splits a string against a regular expression pattern. -

Space$ Returns a string containing only space. -

Split Splits a string into substrings. -

String$ Returns the same string concatenated many times. -

Subst$ Substitutes strings in a pattern. -

Trim$ Strips white spaces from a string. -

UCase$ Converts a string to uppercase. String.UCase

UnBase64$ Decode a Base64 string. Since 3.2 version

-

UnQuote$ Unquotes a string. -

Use in programming languages

In most programming languages, strings are a data type. Individual strings are typically stored in consecutive memory locations. This means that the same string (for example the empty string) could be stored in two different places in memory. (Note that even a string of length zero can require memory to store it, depending on the format being used.) In this way there could be multiple empty strings in memory, in contrast with the formal theory definition, for which there is only one possible empty string. However, a string comparison function would indicate that all of these empty strings are equal to each other.

The empty string is distinct from a null reference (or null pointer) because a null reference does not point to any string at all, not even the empty string. A null reference is likely to cause an error if one tries to perform any operation on it, but an empty string is less likely to do so.

The empty string is a legitimate string, upon which most string operations should work. Some languages treat some or all of the following in similar ways, which can lessen the danger: empty strings, null references, the integer 0, the floating point number 0, the boolean value false, the ascii character NUL, or other such values. The empty string is usually represented similarly to other strings. In implementations with string terminating character (null-terminated strings or plain text lines), the empty string is indicated by the immediate use of this terminating character.

Page | 6

λ representation Programming languages

"" C, C++, Perl, Python, C#, Go, PHP, Visual Basic .NET, Java, Turing, JavaScript, Haskell, Objective-C (as a C string), OCaml, Standard ML, Scala, Tcl

'' Perl, PHP, Python, JavaScript, Delphi, Pascal{'\0'} C, C++, Objective-C (as a C string)std::string() C++@"" Objective-C (as an NSString object)[NSString string] Objective-C (as an NSString object)qw() Perl""""""str()

Python

string.Empty C#String.Empty Visual Basic .NETString.make 0 '-' OCaml{} Tcl

Getting String Lengths

The following example sets the maximum length of key and data by using strlen() to get the lengths

of those strings.

3. #include <string.h>4. ...5. struct element {6. char *key;7. char *data;8. };9. ...10. char *key, *data;11. int len;12.

13. *keylength = *datalength = 0;14. ...15. if ((len = strlen(key)) > *keylength)16. *keylength = len;17. if ((len = strlen(data)) > *datalength)18. *datalength = len;19. ...

3. The number of elements in array.

Array elements are the scalar data that make up an array. Each element inherits the type, type parameters, and INTENT, PARAMETER, and TARGET attributes from its parent array. The POINTER

Page | 7

attribute is not inherited. An array is a group of data type stored into a variable with the same name, by giving the index in a variable to distinguish between the one with the other

You identify an array element by an array element designator, whose form is:

>>---+-array_name--------+--(--subscript_list--)--------------->< '-array_struct_comp-'

array_name is the name of an array

array_struct_comp is a structure component whose rightmost comp_name is an array

subscript is an scalar integer expression+-------------------------------IBM Extension--------------------------------+

A subscript is a real expression in XL Fortran.

+----------------------------End of IBM Extension----------------------------+

Notes

1. The number of subscripts must equal the number of dimensions in the array. 2. If array_struct_comp is present, each part of the structure component except the rightmost

must have rank zero (that is, must not be an array name or an array section). 3. The value of each subscript expression must not be less than the lower bound or greater

than the upper bound for the corresponding dimension.

The subscript value depends on the value of each subscript expression and on the dimensions of the array. It determines which element of the array is identified by the array element designator.

4. Pushing, stacking, popping.

In computer science, a stack is a last in, first out (LIFO) abstract data type and linear data structure. A stack can have any abstract data type as an element, but is characterized by two fundamental operations, called push and pop. The push operation adds a new item to the top of the stack, or initializes the stack if it is empty. If the stack is full and does not contain enough space to accept the given item, the stack is then considered to be in an overflow state. The pop operation removes an item from the top of the stack. A pop either reveals previously concealed items, or results in an empty stack, but if the stack is empty then it goes into underflow state (It means no items are present in stack to be removed). A stack pointer is the register which holds the value of the stack. The stack pointer always points the tops value of the stack.

Page | 8

A stack is a restricted data structure, because only a small number of operations are performed on it. The nature of the pop and push operations also means that stack elements have a natural order. Elements are removed from the stack in the reverse order to the order of their addition: therefore, the lower elements are those that have been on the stack the longest

A stack is a basic computer science data structure and can be defined in an abstract, implementation-free manner, or it can be generally defined as, Stack is a linear list of items in which all additions and deletion are restricted to one end that is Top.

This is a VDM (Vienna Development Method) description of a stack:

Function signatures:

init: -> Stack push: N x Stack -> Stack top: Stack -> (N U ERROR) remove: Stack -> Stack isempty: Stack -> Boolean

(where N indicates an element (natural numbers in this case), and U indicates set union)

Semantics:

top(init()) = ERROR top(push(i,s)) = i remove(init()) = init() remove(push(i, s)) = s isempty(init()) = true isempty(push(i, s)) = false

5. A stack and a queue

An array is a random access data structure, where each element can be accessed directly and in constant time. A typical illustration of random access is a book - each page of the book can be open independently of others. Random access is critical to many algorithms, for example binary search.

A linked list is a sequential access data structure, where each element can be accesed only in particular order. A typical illustration of sequential access is a roll of paper or tape - all prior material must be unrolled in order to get to data you want. In this note we consider a subcase of sequential data structures, so-called limited access data sturctures.

Page | 9

A stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle. In the pushdown stacks only two operations are allowed: push the item into the stack, and pop the item out of the stack. A stack is a limited access data structure - elements can be added and removed from the stack only at the top. push adds an item to the top of the stack, pop removes the item from the top. A helpful analogy is to think of a stack of books; you can remove only the top book, also you can add a new book on the top.

A stack is a recursive data structure. Here is a structural definition of a Stack:

A stack is either empty orit consistes of a top and the rest which is a stack;

The simplest two search techniques are known as Depth-First Search(DFS) and Breadth-First Search (BFS). These two searches are described by looking at how the search tree (representing all the possible paths from the start) will be traversed.

Deapth-First Search with a Stack

In depth-first search we go down a path until we get to a dead end; then we backtrack or back up (by popping a stack) to get an alternative path.

Create a stack Create a new choice point Push the choice point onto the stack while (not found and stack is not empty)

o Pop the stack o Find all possible choices after the last one tried o Push these choices onto the stack

Return

Breadth-First Search with a Queue

In breadth-first search we explore all the nearest possibilities by finding all possible successors and enqueue them to a queue.

Create a queue Create a new choice point Enqueue the choice point onto the queue while (not found and queue is not empty)

Page | 10

o Dequeue the queue o Find all possible choices after the last one tried o Enqueue these choices onto the queue

Return

6. Definition of a tree as a data structure

In computer science, a tree is a widely used data structure that simulates a hierarchical tree structure with a set of linked nodes.

Mathematically, it is an ordered directed tree, more specifically an arborescence: an acyclic connected graph where each node has zero or more children nodes and at most one parent node. Furthermore, the children of each node have a specific order.

A node is a structure which may contain a value, a condition, or represent a separate data structure (which could be a tree of its own). Each node in a tree has zero or more child nodes, which are below it in the tree (by convention, trees are drawn growing downwards). A node that has a child is called the child's parent node (or ancestor node, or superior). A node has at most one parent.

An internal node (also known as an inner node or branch node) is any node of a tree that has child nodes. Similarly, an external node (also known as an outer node, leaf node, or terminal node) is any node that does not have child nodes.

The topmost node in a tree is called the root node. Being the topmost node, the root node will not have a parent. It is the node at which operations on the tree commonly begin (although some algorithms begin with the leaf nodes and work up ending at the root).

All other nodes can be reached from it by following edges or links. (In the formal definition, each such path is also unique). In diagrams, it is typically drawn at the top. In some trees, such as heaps, the root node has special properties. Every node in a tree can be seen as the root node of the subtree rooted at that node. A free tree is a tree that is not rooted.

The height of a node is the length of the longest downward path to a leaf from that node. The height of the root is the height of the tree. The depth of a node is the length of the path to its root (i.e., its root path). This is commonly needed in the manipulation of the various self balancing trees, AVL Trees in particular. Conventionally, the value −1 corresponds to a subtree with no nodes, whereas zero corresponds to a subtree with one node.

A subtree of a tree T is a tree consisting of a node in T and all of its descendants in T. (This is different from the formal definition of subtree used in graph theory.[1]) The subtree corresponding to the root node is the entire tree; the subtree corresponding to any other node is called a proper subtree (in analogy to the term proper subset).

Page | 11

7. Three applications of trees in computing.

Trees are one of the most useful data structures in Computer Science. Some of the common applications of trees are:

1. The library database in a library, a student database in a school or college, an employee database in a company, a patient database in a hospital or any database for that matter would be implemented using trees.

2. The file system in your computer i.e folders and all files, would be stored as a tree.3. When you search for a word in a file or misspell a word and you get a list of possible correct

words, you are using a tree. Because, the file would be indexed as a tree and for the same reason you get answers instantly.

4. When you watch a youtube video or surf anything on the internet, the data which would be present in a computer somewhere in the world would travel to your computer passing through many intermediate computers called routers. The routers heavily use trees for routing.

5. Most probably, Google maps uses trees (apart from using graphs) for all the locations in it. Then it would be very easy to answer questions likea) which is the nearest restaurant to this place?b) list all schools which are present within 5 miles of radius from this placec) and so on

Types of Trees

People come up with different concepts and different types of trees so that they can be made use for a variety of applications. If you are not a technical person, I recommend you to know at least one tree (say binary search trees). If you are a technical person but not a Computer Science person, I recommend you to know at least three trees (say binary search trees, B trees and suffix trees). If you are a Computer Science person, I recommend you to know all known trees.

1. 2-3 heap2. 2-3 trees

Page | 12

3. 2-3-4 trees4. (a-b) trees5. AA trees6. Abstract syntax trees7. Adaptive k-d trees8. Additive trees9. And-or trees10. AVL trees11. etc

Unlike Array and Linked List, which are linear data structures, tree is hierarchical (or non-linear) data structure.

1) One reason to use trees might be because you want to store information that naturally forms a hierarchy. For example, the file system on a computer:

file system———–

/ <-- root / \... home / \ ugrad course / / | \ ... cs101 cs112 cs113

2) If we organize keys in form of a tree (with some ordering e.g., BST), we can search for a given key in moderate time (quicker than Linked List and slower than arrays). Self-balancing search trees like AVL and Red-Black trees guarantee an upper bound of O(Logn) for search.

3) We can insert/delete keys in moderate time (quicker than Arrays and slower than Unordered Linked Lists). Self-balancing search trees like AVL and Red-Black trees guarantee an upper bound of O(Logn) for insertion/deletion.

4) Like Linked Lists and unlike Arrays, Pointer implementation of trees don’t have an upper limit on number of nodes as nodes are linked using pointers.

As per Wikipedia, following are the common uses of tree.1. Manipulate hierarchical data.2. Make information easy to search (see tree traversal).3. Manipulate sorted lists of data.4. As a workflow for compositing digital images for visual effects.5. Router algorithms

------ 00O00 ------

Page | 13

Terjemahan bab 6 :

STRUKTUR DATA

Struktur data umumnya didasarkan pada kemampuan komputer untuk mengambil dan menyimpan data di setiap tempat dalam memori, yang ditentukan oleh string alamat-sedikit yang dapat disimpan dalam memori sendiri dan dimanipulasi oleh program. Dengan demikian catatan dan data array struktur didasarkan pada menghitung alamat item data dengan operasi aritmatika, sedangkan struktur data terkait didasarkan pada menyimpan alamat item data dalam struktur itu sendiri. Banyak struktur data menggunakan kedua prinsip, kadang-kadang dikombinasikan dalam cara non-sepele (seperti dalam XOR menghubungkan).Penerapan struktur data biasanya memerlukan menulis satu set prosedur yang membuat dan memanipulasi contoh struktur itu. Efisiensi struktur data tidak dapat dianalisis secara terpisah dari operasi-operasi. Pengamatan ini memotivasi konsep teoritis dari tipe data abstrak, struktur data yang didefinisikan secara tidak langsung dengan operasi yang dapat dilakukan di atasnya, dan sifat-sifat matematis dari operasi-operasi (termasuk ruang mereka dan biaya waktu).

1. Nilai Null

Pengguna baru ke dunia database sering bingung oleh nilai khusus tertentu untuk bidang kita - nilai NULL. Nilai ini dapat ditemukan dalam sebuah field yang berisi semua jenis data dan memiliki arti yang sangat khusus dalam konteks database relasional. Ini mungkin lebih baik untuk memulai diskusi kita NULL dengan beberapa kata tentang apa yang NULL tidak:

NULL tidak angka nol. NULL tidak string kosong ("") nilai.

Sebaliknya, NULL adalah nilai yang digunakan untuk mewakili sebuah bagian yang tidak diketahui data. Mari kita lihat contoh sederhana: tabel yang berisi persediaan untuk berdiri buah. Misalkan persediaan kami berisi 10 apel, jeruk 3. Kami juga plum saham, tetapi informasi persediaan kita tidak lengkap dan kita tidak tahu berapa banyak (jika ada) plum ada di saham. Menggunakan nilai NULL, kita akan memiliki tabel persediaan ditampilkan di bagian bawah halaman ini. Ini jelas tidak benar untuk menyertakan kuantitas 0 untuk catatan plum, karena itu akan berarti bahwa kami tidak memiliki plum dalam persediaan. Sebaliknya, kita mungkin memiliki beberapa plum, kami hanya tidak yakin. Database nilai NULL mengobati dengan cara yang khusus, tergantung pada jenis operasi yang digunakan masuk Ketika nilai NULL muncul sebagai operan ke operasi AND, nilai operasi adalah FALSE jika operand lainnya adalah FALSE (tidak ada jalan ekspresi bisa menjadi BENAR dengan satu operan FALSE). Di sisi lain, hasilnya adalah NULL (tidak diketahui) jika operan lainnya adalah TRUE atau NULL (karena kita tidak bisa mengatakan apa hasilnya akan.) OR operan memperlakukan nilai NULL dengan cara yang sama. Jika operan lainnya adalah TRUE, hasil dari OR adalah TRUE (karena nilai sebenarnya dari operan NULL tidak masalah.) Di sisi lain, jika operan baik lainnya adalah FALSE atau NULL, hasil dari operasi OR adalah NULL.

Page | 14

Ada dua operan khusus yang digunakan untuk menguji keberadaan dari nilai NULL. IsNull menghasilkan TRUE hanya ketika operan diberikan memiliki nilai NULL. Sebaliknya, ISNOTNULL menghasilkan TRUE ketika operan diberikan tidak memiliki nilai NULL. Ini adalah fungsi cukup penting. Hindari salah satu kesalahan database yang paling umum: menguji sebuah operan untuk nilai NULL dengan membandingkannya dengan string kosong atau nol tidak benar!Nilai NULL menunjukkan bahwa nilai tidak diketahui. Nilai NULL berbeda dengan nilai kosong atau nol. Tidak ada dua nilai null adalah sama. Perbandingan antara dua nilai null, atau antara NULL dan nilai lain, kembali tidak diketahui karena nilai NULL masing tidak diketahui. Nilai null umumnya menunjukkan data yang tidak diketahui, tidak berlaku, atau bahwa data akan ditambahkan kemudian. Misalnya, tengah awal pelanggan mungkin tidak diketahui pada saat pelanggan tempat pesanan.

Berikut ini adalah informasi tentang nulls:

Untuk menguji nilai null dalam query, penggunaan IS NULL atau IS NOT NULL pada klausa WHERE.

Ketika hasil query yang dilihat di editor SQL Server Manajemen Kode Studio, nilai null akan ditampilkan sebagai NULL dalam hasil yang ditetapkan.

Nilai null dapat dimasukkan ke dalam kolom dengan secara eksplisit NULL menyatakan dalam sebuah pernyataan INSERT atau UPDATE, dengan meninggalkan kolom dari pernyataan INSERT, atau ketika menambahkan kolom baru ke tabel yang ada dengan menggunakan pernyataan ALTER TABLE.

Nilai null tidak dapat digunakan untuk informasi yang diperlukan untuk membedakan satu baris dalam tabel dari baris lain dalam tabel, seperti kunci primer.

Dalam kode program, Anda dapat memeriksa nilai null sehingga perhitungan tertentu dilakukan hanya pada baris dengan data yang valid, atau tidak NULL,. Misalnya, laporan dapat mencetak kolom jaminan sosial hanya jika ada data yang tidak NULL dalam kolom. Menghapus nilai null ketika Anda melakukan perhitungan dapat menjadi penting, karena perhitungan tertentu, seperti rata-rata, bisa tidak akurat jika kolom NULL disertakan.

Jika ada kemungkinan bahwa nilai null disimpan dalam data Anda dan Anda tidak ingin nilai null muncul dalam data Anda, Anda harus membuat query dan data-modifikasi pernyataan yang baik menghapus NULLs atau mengubah mereka menjadi beberapa nilai lain.

Ketika nilai-nilai null yang hadir dalam data, operator logika dan perbandingan berpotensi dapat mengembalikan hasil ketiga UNKNOWN bukan hanya TRUE atau FALSE. Hal ini perlu untuk tiga bernilai logika merupakan sumber kesalahan aplikasi banyak. Tabel ini menjelaskan efek memperkenalkan perbandingan null.

Tabel berikut menunjukkan hasil penerapan operator AND untuk dua operand Boolean.

DAN BENAR UNKNOWN SALAH BENAR BENAR UNKNOWN SALAH UNKNOWN UNKNOWN UNKNOWN SALAH

Page | 15

SALAH SALAH SALAH SALAH

Tabel berikut menunjukkan hasil menerapkan operator ATAU dua operand Boolean.

ATAU BENAR UNKNOWN SALAH BENAR BENAR BENAR BENAR UNKNOWN BENAR UNKNOWN UNKNOWN SALAH BENAR UNKNOWN SALAH

Tabel berikut menunjukkan bagaimana operator TIDAK meniadakan, atau membalikkan, hasil dari operator Boolean.

Boolean ekspresi yang operator NOT diterapkan Mengevaluasi untuk BENAR SALAH UNKNOWN UNKNOWN SALAH BENAR

Standar ISO menggunakan kata kunci IS NULL dan IS NOT NULL untuk menguji adanya nilai null.

Boolean ekspresi yang IS NULL Operator diterapkan

Mengevaluasi untuk

Ekspresi boolean dimana TIDAK Operator NULL diterapkan

Mengevaluasi untuk

BENAR SALAH BENAR BENAR NULL BENAR NULL SALAH SALAH SALAH SALAH BENAR

Transact-SQL juga menawarkan perpanjangan untuk diproses null. Jika ANSI_NULLS opsi disetel ke OFF, perbandingan antara nulls, seperti NULL = NULL, mengevaluasi ke TRUE. Perbandingan antara NULL dan setiap nilai data yang mengevaluasi ke FALSE

2. Indikasi panjang string

String Fungsi

Fungsi Deskripsi UTF-8 setara

Asc Mengembalikan ASCII kode karakter dalam sebuah string. String.Code

Base64 $ Encode string dalam Base64. Sejak versi 3.2

-

Chr $ Mengembalikan karakter dari yang ASCII kode. String.Chr

Comp Membandingkan dua string. String.Comp

Page | 16

InStr Mencari string ke string lainnya. String.InStr

LCase $ Mengkonversi string ke huruf kecil. String.LCase

Left $ Mengembalikan karakter pertama dari string. String.Left

Len Mengembalikan panjang string. String.Len

LTRIM $ Strip spasi putih dari kiri string. -

Mid $ Mengembalikan bagian dari string. String.Mid

Kutip $ Harga string. -

Ganti $ Menggantikan dalam string substring dengan yang lain. -

Kanan $ Mengembalikan karakter terakhir dari string. String.Right

RInStr Mencari string ke string lain dari kanan. String.RInStr

RTRIM $ Strip spasi putih dari kanan string. -

Memindai Splits string terhadap pola ekspresi reguler. -

Ruang $ Mengembalikan string yang berisi ruang saja. -

Membagi Membagi string ke dalam substring. -

Merangkai $ Mengembalikan string yang sama concatenated berkali-kali. -

Subst $ Pengganti string dalam pola. -

Potong $ Strip spasi putih dari suatu string. -

UCase $ Mengkonversi string ke huruf besar. String.UCase

UnBase64 $ Decode string Base64. Sejak versi 3.2

-

Tanda kutip $ Unquotes string.

Penggunaan dalam bahasa pemrograman

Dalam kebanyakan bahasa pemrograman, string adalah tipe data . String individu biasanya disimpan dalam berturut-turut lokasi memori . Ini berarti bahwa string yang sama (misalnya string kosong) dapat disimpan di dua tempat berbeda di memori. (Perhatikan bahwa bahkan sebuah string panjang nol dapat memerlukan memori untuk menyimpannya, tergantung pada format yang digunakan.) Dengan cara ini mungkin ada beberapa string kosong dalam memori, berbeda dengan definisi teori formal, yang hanya ada satu mungkin kosong string. Namun, fungsi perbandingan string akan menunjukkan bahwa semua string kosong adalah sama satu sama lain.

String kosong berbeda dari nol referensi (atau pointer null) karena referensi nol tidak menunjuk ke string apapun sama sekali, bahkan string kosong. Sebuah referensi null mungkin menyebabkan kesalahan jika seseorang mencoba untuk melakukan operasi apapun pada itu, tapi string kosong kurang kemungkinan untuk melakukannya.

Page | 17

String kosong adalah string yang sah, di mana operasi string yang paling harus bekerja. Beberapa bahasa mengobati beberapa atau semua hal berikut dengan cara serupa, yang dapat mengurangi bahaya: string kosong, referensi null, 0 integer, jumlah floating point 0, nilai boolean palsu , yang ASCII karakter NUL, atau nilai-nilai tersebut. String yang kosong biasanya diwakili sama dengan string lainnya. Dalam implementasi dengan karakter string mengakhiri ( diakhiri dengan null string atau garis teks biasa), string kosong ditunjukkan dengan penggunaan langsung dari karakter mengakhiri.

λ representasi Pemrograman bahasa

"" C , C + + , Perl , Python , C # , Go , PHP , Visual Basic NET. , Jawa , Turing , JavaScript , Haskell , Objective-C (sebagai string C), OCaml , Standard ML , Scala , Tcl

'' Perl , PHP , Python , JavaScript , Delphi , Pascal {'\0'} C , C + + , Objective-C (sebagai string C) std::string() C + + @"" Objective-C (sebagai obyek NSString) [NSString string]

Objective-C (sebagai obyek NSString)

qw() Perl """""" str()

Ular sanca

string.Empty C # String.Empty Visual Basic NET. String.make 0 '-'

OCaml

{} Tcl

Mendapatkan Panjang String

Contoh berikut menyetel panjang maksimum kunci dan data dengan menggunakan strlen () untuk

mendapatkan panjang string dari mereka.

3. # Include <string.h> 4. ... 5. struct Elemen { 6. char * kunci; 7. char * data; 8. }; 9. ... 10. arang tombol *, * data; 11. int len; 12.

13. * = * Keylength datalength = 0; 14. ... 15. if ((len = strlen (kunci))> * keylength) 16. * Keylength = len; 17. if ((len = strlen (data))> * datalength) 18. * Datalength = len;

Page | 18

19. ...

3. Jumlah elemen dalam array

Elemen array adalah data skalar yang membentuk array. Setiap elemen mewarisi jenis, parameter jenis, dan INTENT, PARAMETER, dan atribut TARGET dari array induknya. Atribut PENUNJUK tidak diwariskan.

Array adalah sekelompok data sejenis yang disimpan ke dalam variabel dengan nama yang sama, dengan memberi indeks pada variabel untuk membedakan antara yang satu dengan yang lain

Anda mengidentifikasi elemen array oleh penanda elemen array, yang bentuknya adalah:

--- >> + - Array_name -------- + - (- subscript_list -) ---------------> <

'- Array_struct_comp -'

array_name adalah nama dari array

array_struct_comp adalah komponen struktur yang paling kanan comp_name adalah array

subskrip adalah ekspresi integer skalar + ------------------------------- IBM Perpanjangan ---------------- ---------------- +

Subskrip adalah ekspresi nyata dalam XL Fortran.

+ ---------------------------- Akhir Perpanjangan IBM ----------------- ----------- +

Catatan

Jumlah subscript harus sama dengan jumlah dimensi dalam array. Jika array_struct_comp hadir, setiap bagian dari komponen struktur kecuali paling kanan

harus memiliki peringkat nol (yaitu, tidak harus menjadi nama array atau bagian array). Nilai dari setiap ekspresi subskrip tidak harus kurang dari batas bawah atau lebih besar dari

batas atas untuk dimensi yang sesuai.

Nilai subscript tergantung pada nilai dari setiap ekspresi subskrip dan pada dimensi array. Ini menentukan elemen array diidentifikasi dengan penanda elemen array.

Page | 19

4. Pushing, stacking, popping.

Dalam ilmu komputer , stack adalah terakhir dalam, pertama (dari LIFO ) tipe data abstrak dan linier struktur data . Tumpukan A dapat memiliki tipe data abstrak sebagai elemen , tetapi ditandai oleh dua operasi dasar, yang disebut push dan pop. Operasi dorongan menambahkan item baru ke puncak stack, atau menginisialisasi stack jika kosong. Jika stack sudah penuh dan tidak mengandung cukup ruang untuk menerima item diberikan, tumpukan ini kemudian dianggap berada dalam sebuah meluap negara. Operasi pop menghapus item dari puncak stack. Sebuah pop baik mengungkapkan transaksi yang sebelumnya telah disembunyikan, atau hasil dalam tumpukan kosong, tetapi jika stack kosong maka itu masuk ke negara underflow (Artinya tidak ada item yang hadir dalam stack yang akan dihapus). Sebuah stack pointer adalah register yang memegang nilai stack. Stack pointer selalu menunjuk nilai puncak dari stack.

Tumpukan adalah sebuah struktur data terbatas, karena hanya sejumlah kecil operasi dilakukan di atasnya. Sifat dari pop dan operasi dorongan juga berarti bahwa elemen tumpukan memiliki tatanan alam. Elemen dikeluarkan dari stack dalam urutan terbalik dengan urutan Selain mereka: oleh karena itu, unsur-unsur yang lebih rendah adalah mereka yang telah di tumpukan paling lama.

Tumpukan adalah dasar ilmu komputer struktur data dan dapat didefinisikan secara abstrak, implementasi bebas, atau dapat secara umum didefinisikan sebagai, Stack adalah daftar linear dari item di mana semua penambahan dan penghapusan dibatasi pada salah satu ujung yang Top.

Ini adalah VDM ( Wina Pengembangan Metode ) penjelasan stack:

Fungsi tanda tangan:

init: -> Stackmendorong: N x Stack -> Stackatas: Stack -> (NU ERROR)menghapus: Stack - Stack>isEmpty: Stack -> Boolean

(Dimana N menunjukkan unsur (bilangan asli dalam kasus ini), dan U menunjukkan serikat diatur) semantik:

atas (init ()) = ERRORatas (push (i, s)) = imenghapus (init ()) = init ()menghapus (push (i, s)) = sisEmpty (init ()) = trueisEmpty (push (i, s)) = palsu

Page | 20

5. Tumpukan dan antrian

Array adalah struktur data akses acak, dimana setiap elemen dapat diakses secara langsung dan dalam waktu yang konstan. Sebuah ilustrasi khas akses acak adalah sebuah buku - masing-masing halaman dari buku ini dapat membuka secara independen dari orang lain. Akses acak sangat penting untuk banyak algoritma, contoh untuk pencarian biner.

Sebuah linked list adalah sebuah struktur data akses berurutan, di mana setiap elemen korosi ini dapat diakses hanya dalam urutan tertentu. Sebuah ilustrasi khas akses sekuensial adalah gulungan kertas atau tape - semua bahan sebelum harus membuka gulungan untuk mendapatkan data yang Anda inginkan.

Melalui catatan ini kita mempertimbangkan subkasus struktur data berurutan, apa yang disebut sturctures akses data yang terbatas.

Tumpukan

Tumpukan adalah sebuah wadah benda yang dimasukkan dan dihapus sesuai dengan prinsip-terakhir di first-out (LIFO). Dalam tumpukan pushdown hanya dua operasi yang diperbolehkan: mendorong item ke stack, dan pop item dari stack. Tumpukan adalah akses struktur data terbatas -. Elemen dapat ditambahkan dan dihapus dari stack hanya di bagian atas dorongan menambahkan item ke bagian atas tumpukan, pop menghapus item dari atas. Sebuah analogi yang berguna adalah untuk memikirkan setumpuk buku, Anda dapat menghapus hanya buku atas, juga Anda dapat menambahkan buku baru di atas.

Tumpukan adalah sebuah struktur data rekursif. Berikut ini adalah definisi struktural dari sebuah Stack: stack adalah baik kosong atau itu consistes dari atas dan sisanya yang merupakan tumpukan;

Dua teknik pencarian yang paling sederhana dikenal sebagai Depth-First Search (DFS) dan Breadth-First Search (BFS). Kedua pencarian dijelaskan dengan melihat bagaimana pohon pencarian (mewakili semua jalur yang mungkin dari awal) akan dilalui.

Deapth-First Search dengan Stack sebuah

Page | 21

Secara mendalam-first kita turun jalan sampai kita ke jalan buntu, maka kita mundur atau kembali (dengan muncul stack) untuk mendapatkan jalur alternatif.

Buat stack Membuat jalur pilihan baru Dorong titik pilihan ke stack sementara (tidak ditemukan dan stack tidak kosong)

o Pop stack o Cari semua kemungkinan pilihan setelah yang terakhir mencoba o Dorong pilihan-pilihan ini ke stack

Kembali

Breadth-First Search Antrian dengan sebuah

Dalam luasnya pertama pencarian kami mengeksplorasi semua kemungkinan terdekat dengan mencari semua penerus mungkin dan enqueue mereka untuk antrian.

Buat antrian Membuat jalur pilihan baru Enqueue titik pilihan ke antrian sementara (tidak ditemukan dan antrian tidak kosong)

o Dequeue antrian o Cari semua kemungkinan pilihan setelah yang terakhir mencoba o Enqueue pilihan-pilihan ini ke antrian

Kembali

6. Definisi Tree sebagai suatu struktur data

Dalam ilmu komputer, sebuah pohon adalah struktur data yang digunakan secara luas yang mensimulasikan struktur pohon hirarki dengan satu set node terhubung.Secara matematis, itu adalah pohon diarahkan memerintahkan, lebih khusus sebuah arborescence: sebuah graf terhubung asiklik mana setiap node memiliki nol atau lebih node anak-anak dan paling banyak satu node induk. Selanjutnya, anak-anak dari setiap node memiliki urutan tertentu.Sebuah node adalah struktur yang dapat berisi nilai, kondisi, atau merupakan suatu struktur data yang terpisah (yang bisa menjadi pohon sendiri). Setiap node di pohon memiliki nol atau node anak lebih, yang berada dibawahnya dalam pohon (dengan konvensi, pohon ditarik ke bawah tumbuh). Sebuah simpul yang memiliki anak disebut parent node anak (atau nenek moyang node, atau superior). Simpul A memiliki paling banyak satu orangtua.Node internal (juga dikenal sebagai simpul dalam atau simpul cabang) adalah setiap node dari pohon yang memiliki node anak. Demikian pula, sebuah simpul eksternal (juga dikenal sebagai node luar, simpul daun, atau node terminal) adalah setiap node yang tidak memiliki node anak.

Node paling atas di pohon disebut simpul akar. Menjadi simpul teratas, simpul akar tidak akan memiliki orangtua. Ini merupakan simpul dimana operasi pada pohon umumnya mulai (walaupun beberapa algoritma dimulai dengan daun dan node bekerja sampai berakhir pada akar). Semua node

Page | 22

lain dapat dicapai dari dengan mengikuti tepi atau link. (Dalam definisi resmi, setiap jalan tersebut juga unik). Dalam diagram, itu biasanya ditarik di bagian atas. Di beberapa pohon, seperti tumpukan, simpul akar memiliki sifat khusus. Setiap simpul di pohon dapat dilihat sebagai node root dari subtree berakar pada simpul tersebut. Pohon bebas adalah pohon yang tidak berakar.Tinggi dari pohon adalah panjang jalan ke bawah terpanjang untuk sebuah daun dari simpul tersebut. Tinggi dari akar adalah tinggi dari pohon. Kedalaman sebuah simpul adalah panjang jalan ke akarnya (yaitu, jalur akarnya). Ini biasanya diperlukan dalam manipulasi pohon menyeimbangkan diri berbagai AVL Pohon pada khususnya. Secara konvensional, nilai -1 sesuai dengan subpohon dengan tidak node, sedangkan nol berkorespondensi dengan sebuah subpohon dengan satu node. Sebuah sub pohon dari pohon T adalah pohon yang terdiri dari sebuah node di T dan semua keturunannya di T. (ini berbeda dari definisi formal dari subtree digunakan dalam teori graf. [1]) yang sesuai subtree ke node root seluruh pohon, yang sesuai subtree ke node lain disebut subtree yang tepat (dalam analogi subset tepat istilah).

7. 3 Aplikasi Tree di dalam computer

Pohon adalah salah satu struktur data yang paling berguna dalam Ilmu Komputer. Beberapa aplikasi umum dari pohon adalah:Database perpustakaan di perpustakaan, database siswa di sekolah atau perguruan tinggi, database karyawan di sebuah perusahaan, database pasien di rumah sakit atau database apapun dalam hal ini akan diimplementasikan dengan menggunakan pohon.Sistem file di folder komputer yaitu Anda dan semua file, akan disimpan sebagai pohon.Bila Anda mencari kata dalam file atau misspell kata dan Anda mendapatkan daftar kata yang benar mungkin, Anda menggunakan pohon. Karena, file tersebut akan diindeks sebagai pohon dan untuk alasan yang sama Anda mendapatkan jawaban langsung.Ketika Anda menonton video youtube atau apapun surfing di internet, data yang akan hadir di komputer di suatu tempat di dunia melakukan perjalanan ke komputer Anda melewati komputer menengah banyak disebut router. Router sangat menggunakan pohon untuk routing.Kemungkinan besar, peta Google menggunakan pohon (selain menggunakan grafik) untuk semua lokasi di dalamnya. Maka akan sangat mudah untuk menjawab pertanyaan-pertanyaan seperti a) yang merupakan restoran terdekat ke tempat ini?

b) daftar semua sekolah yang hadir dalam 5 kilometerdari radius dari tempat inic) dan sebagainya.

Page | 23

Jenis Pohon

Orang-orang datang dengan konsep yang berbeda dan berbagai jenis pohon sehingga mereka dapat dimanfaatkan untuk berbagai aplikasi. Jika Anda bukan orang teknis, saya sarankan Anda untuk tahu setidaknya satu pohon (katakanlah pohon biner pencarian). Jika Anda adalah orang teknis tetapi bukan orang Ilmu Komputer, saya sarankan Anda untuk tahu setidaknya tiga pohon (katakanlah pohon pencarian biner, pohon B dan pohon akhiran). Jika Anda adalah orang Ilmu Komputer, saya sarankan Anda untuk mengetahui semua pohon yang dikenal.

2-3 tumpukan2-3 pohon2-3-4 pohon(a-b) pohonAA pohonAbstrak sintaks pohonAdaptive k-d pohonaditif pohonDan-atau pohonAVL pohonDan lain lain

Tidak seperti Array dan Linked List, yang linier struktur data, pohon hirarkis (atau non-linier) struktur data.

1) Salah satu alasan untuk menggunakan pohon mungkin karena Anda ingin menyimpan informasi yang secara alami membentuk suatu hirarki. Misalnya, sistem file pada komputer:

file sistem----

/ <- Root / \... rumah / \ ugrad saja / / | \ ... cs101 cs112 cs113

2) Jika kita mengatur kunci dalam bentuk pohon (dengan beberapa misalnya pemesanan, BST), kita dapat mencari kunci yang diberikan dalam waktu moderat (lebih cepat dari Linked List dan lebih lambat dari array). Pohon pencarian self-balancing seperti AVL dan Red-Black pohon menjamin atas terikat O (logN) untuk pencarian.

Page | 24

3) Kita dapat menyisipkan / menghapus kunci dalam waktu moderat (lebih cepat dari Array dan lebih lambat dari Unordered Lists Linked). Pohon pencarian self-balancing seperti AVL dan Red-Black pohon menjamin atas terikat O (logN) untuk penyisipan / penghapusan.

4) Seperti Linked Lists dan tidak seperti Array, Pointer implementasi pohon tidak memiliki batas atas jumlah node sebagai node dihubungkan dengan menggunakan pointer.Sesuai Wikipedia, berikut adalah penggunaan umum dari pohon.1. Memanipulasi data hirarkis.2. Membuat informasi mudah untuk mencari (lihat traversal pohon).3. Memanipulasi daftar diurutkan data.4. Sebagai alur kerja untuk compositing gambar digital untuk efek visual.5. router algoritma

------ 00O00 ------

Page | 25

Page | 26

Chapter 7 :

COMPUTER PERSONNEL

The term personal computer was first used in the magazine New Scientist in 1964 in a series of articles entitled "The World in 1984" (World in the Year 1984). In "The Banishment of Paper Work" (Loss of Work Write-Write), Arthur L. Samuel Watson Research Center (Watson Research Center) was IBM wrote, "Though we may be able to receive education at home through the person's own PC, the original nature of human remains will not change."

The first generation of microcomputers began to appear in the 70's. However, it is not highly skilled, and less capable than the computer business (Business Computer) at the time, so it is only used by computer enthusiasts, or just for the game as well as the use of electronic bulletin board system. As the modern computer era of silicon chips in a PC using a microcomputer as a Central Processing Unit. The first microprocessors used in IBM PC is Intel4004 issued on 15 November 1971.

Microcomputers into commerce tool when VisiCalc spreadsheet program was launched for the Apple II machine, and then for the 8-bit Atari, Commodore PET, and the IBM PC is the most popular application programs. In about the year 1980, low price of personal computers into great popularity in the home and business. In 1982, Time magazine named "Personal Computer" title "Man of the Year".

few people are involved in the work of computer construction

That's a good question. After all, it's a lot easier to buy a computer from a reputable computer shop than it is to build one yourself. But the truth is that most of us computer geeks and geeklings build our own computers simply because we enjoy it. We think it's fun. But aside from being fun, there are other advantages to building your own computer. For example:

You can build your computer exactly how you want it, as best fits your computing needs. When you build your own computer, it truly is a "personal" computer.

Building a PC is an educationally rewarding experience that can enrich a person's knowledge of and appreciation for applied math, electronics, and physics.

Sometimes a home-built computer can be less expensive than a comparably equipped store-bought computer, especially if you start with a barebones computer kit.

Building computers is an enjoyable hobby with the potential to lead to a career. In fact, many IT professionals got their start by building their own computers. If you're already interested in computer science, a degree in computer science may be up your alley. (Be sure to do your research first though and make sure that's what you want.)

Page | 27

As was mentioned above, when you design your own computer, you can build it to suit the things you want it to do. The days when all computers had to do was check e-mail and surf the Web are over. A high-end smart phone like the T-Mobile Blackberry Bold can do those things (and much more) very well. But for gaming, CAD/CAM applications, high-end video editing, and other specialized tasks, there's no better way to get the machine you need than to design and build it yourself.

technicians are not concerned with research

Learn about computers. Training can take many forms and can begin anytime in your life. Training does not need to take place completely inside the classroom either. It can be self-driven and continuous. Computer based training at home is certainly useful and a robust curiosity for understanding how computers work is invaluable! Most important is learning WHERE to find the right answers. As is true in any field of endeavor, you do not have to know everything to be smart but the ability to know where to look for the information you need makes you a genius!

Gain experience. To the extent possible, try to get as much hands-on time working with computers as possible. This can be done as part of a course or training program, or it can be done by yourself at home.

Get formal computer training. You can begin preparing to become a computer technician while still in high school. Many high schools offer certification training courses or credit towards a 2-year college degree or an associate's degree. High school graduates can choose to pursue either a 2 or 4 year college program. Many community colleges offer computer technician training programs that focus directly on the actual jobs you will be doing out in the real world. The most important training courses you will need to take are those courses that prepare you for your certification exams! These courses can be taken as part of a degree program or on a stand-alone basis.

Obtain certification. A professional certification is a formal designation which confirms that a person is qualified to perform a job or task. Certifications in the computer technician field are invaluable because they validate your knowledge of computers and let others know that you have the skills needed to do the job right. There are many varieties and levels of computer technician certification. In general, they fall into the following categories:

1) Vendor-neutral certifications: These are certifications which do not focus on a specific vendor or product, but instead span the full spectrum of hardware and software producers. One of the largest developers of vendor-neutral certifications is CompTIA (Computing Technology Industry Association) which offers a very widely-recognized certification known as CompTIA A+. The A+ certification confirms a technician's ability to perform tasks such as installation, configuration, diagnosing, preventive maintenance and basic networking. It also certifies proficiency in such important corollary aspects as security, safety and environmental issues as well as communication and professionalism.

2) Vendor-specific certifications: These certifications are oriented toward specific technologies and are managed by the vendors of these technologies. They are tailored to users of those technologies and to the institutions that employ them. An example of a highly desirable certification in this category is the MCSE (Microsoft Certified System Engineer) Certification, which prepares you to work with Microsoft Windows platforms and Microsoft Server Systems. Other very popular vendors offering certifications of this type include Cisco, Apple, Dell, Novell, and many others.

Page | 28

In order to obtain certification, you will need to pass the exam associated with the specific certification you are pursuing. Courses to prepare you for your certification exams are often found as part of higher-level training programs at colleges or schools which offer computer technician training programs. There also 'boot camps' which provide intensive training specifically targeted towards certification exams. To register to take an exam and locate a testing center near you, visit the website of the certifying organization or vendor.

computer architecs in designing computers

In a nutshell, computer technicians perform installation & maintenance or solve problems that people have with their computers. Just as there are different types of computers and different levels of computer systems and networks, there are also several different types of computer specialist. A partial list of some of the job designations in this growing field includes the following:

desktop support specialist network administrator systems administrator computer forensics specialist help desk technician customer support analyst Internet professional

how is a computer salesman paid.Too many companies are looking for and need sales people. product sales. Here is a quote taken from a website ZDNet about the average salary of people in Indonesia who work in fields related to computer or IT. ZDNet did a survey of 1269 IT workers in different occupations and sectors with diverse abilities.

Income Table in the Field of IT

If seen from the work experience and skills, an IT consultant who has more than 10 years had an average salary of the highest, at $ 150 million per year. Among all the work, a worker who occupy positions in the media industry IT management, marketing, and sales positions with the highest average salary of Rp 144.3 million per year. So working as a sales could also have a big

Page | 29

salary or a salary equivalent to the bias in the work of other IT fields. Computer Sales is not a trivial job as many people think.

electronic engineers in instaling computers

The demand for computer technicians is enormous. To date there are over 65,000 certified technicians worldwide and the industry could use a lot more. computer technician with rack mount systemA wide variety of options are open to computer technicians for the simple reason that computers are found everywhere nowadays, in almost every business, large and small, as well as in almost every home. And wherever computers are found, so are corrupted files, hard drive crashes, and disappearing operating systems. This is when a computer technician can instantly become a super-hero. Many computer technicians are employed in the corporate world and are responsible for the day to day management of an organization's PCs, terminals, monitors, networks and server component hardware. Many others are self-employed.

Some of the duties of a computer technician include: installing, configuring and upgrading PCs, laptops and related equipment; diagnosing and troubleshooting both common and unusual hardware and software problems; performing preventive maintenance on computer equipment; installing required software patches; ensuring the connectivity of PCs, laptops, handhelds and other computing devices to both the local area network (LAN) and wide area network; setting up and maintaining locally connected and networked printers; and connecting needed peripheral equipment.

------ 00O00 ------

Page | 30

Terjemahan bab 7 :

KOMPUTER PRIBADI

Istilah komputer pribadi pertama kali digunakan di majalah New Scientist pada tahun 1964 dalam artikel berseri yang berjudul "The World in 1984" (Dunia pada Tahun 1984). Dalam "The Banishment of Paper Work" (Hilangnya Pekerjaan Tulis-Menulis), Arthur L. Samuel dari Pusat Penelitian Watson (Watson Research Center) nya IBM menulis, "Meskipun mungkin saja kita dapat memperoleh pendidikan di rumah melalui PC orang tersebut sendiri, sifat asli manusia tetap tak akan berubah."

Generasi pertama mikrokomputer mulai bermunculan pada tahun 70-an. Namun begitu, ia tidak berkemampuan tinggi, dan kurang cakap dibandingkan dengan komputer bisnis (Business Computer) pada waktu itu, sehingga hanya digunakan oleh peminat komputer, atau hanya untuk permainan elektronik serta penggunaan bulletin board system. Seperti pada komputer modern di era chip silikon PC menggunakan mikrokomputer sebagai Unit Pemroses Pusat . Mikroprosesor yang pertama dipakai pada PC IBM adalah Intel4004 yang dikeluarkan pada 15 November 1971.

Mikrokomputer menjadi alat perniagaan ketika program spreadsheet VisiCalc diluncurkan untuk mesin Apple II, dan kemudian untuk kelompok 8-bit Atari, Commodore PET, dan PC IBM yang menjadi program aplikasi terpopuler. Pada sekitar tahun 1980an, harga komputer pribadi yang rendah menjadi sebab utama kepopularannya untuk kegunaan di rumah serta bisnis. Pada tahun 1982, majalah Time memberikan "Komputer Pribadi" gelar "Man of the Year".

beberapa orang yang terlibat dalam pekerjaan konstruksi computer.

Itu pertanyaan yang bagus. Setelah semua, itu jauh lebih mudah untuk membeli komputer dari toko komputer terkemuka daripada untuk membangun satu sendiri. Tetapi kebenaran adalah bahwa Geeks komputer kebanyakan dari kita dan geeklings membangun komputer kita sendiri hanya karena kita menikmatinya. Kami pikir itu menyenangkan. Tapi selain dari yang menyenangkan, ada keuntungan lain untuk membangun komputer Anda sendiri. Sebagai contoh:

Anda dapat membangun komputer Anda persis bagaimana Anda inginkan, karena paling sesuai dengan kebutuhan komputasi Anda. Ketika Anda membangun komputer sendiri, itu benar-benar adalah "pribadi" computer.Membangun PC adalah pengalaman mendidik bermanfaat yang dapat memperkaya pengetahuan seseorang dan penghargaan untuk matematika terapan, elektronik, dan fisika.Kadang-kadang komputer rumah yang dibangun bisa lebih murah daripada komputer yang dibeli di toko comparably dilengkapi, terutama jika Anda mulai dengan kit komputer barebone.Membangun komputer adalah hobi menyenangkan dengan potensi untuk menyebabkan karier. Bahkan, banyak profesional TI sampai awal mereka dengan membangun komputer mereka sendiri. Jika Anda sudah tertarik pada ilmu komputer, gelar dalam ilmu komputer mungkin gang Anda.

Page | 31

(Pastikan untuk melakukan penelitian terlebih dahulu meskipun dan pastikan itu yang Anda inginkan.)

Seperti telah disebutkan di atas, ketika Anda merancang komputer sendiri, Anda bisa membangun sesuai dengan hal yang Anda inginkan. Hari-hari ketika semua komputer harus lakukan adalah memeriksa e-mail dan berselancar di Web lebih. Sebuah ponsel high-end pintar seperti T-Mobile Blackberry Bold dapat melakukan hal-hal (dan banyak lagi) sangat baik. Tapi untuk game, CAD / CAM aplikasi, high-end video editing, dan tugas-tugas khusus lainnya, tidak ada cara lebih baik untuk mendapatkan mesin yang Anda butuhkan dari untuk merancang dan membangun sendiri.

teknisi tidak peduli dengan penelitian

Pelajari tentang komputer. Pelatihan dapat mengambil banyak bentuk dan bisa mulai kapan saja dalam hidup Anda. Pelatihan tidak perlu dilakukan sepenuhnya di dalam kelas baik. Hal ini dapat menjadi diri-driven dan berkesinambungan. Pelatihan berbasis komputer di rumah ini tentu berguna dan rasa ingin tahu yang kuat untuk memahami bagaimana komputer bekerja sangat berharga! Yang terpenting adalah belajar WHERE untuk menemukan jawaban yang tepat. Seperti yang terjadi dalam setiap bidang usaha, Anda tidak harus tahu segala sesuatu untuk menjadi pintar tetapi kemampuan untuk tahu di mana mencari informasi yang Anda butuhkan membuat Anda jenius!

Mendapatkan pengalaman. Sedapat mungkin, cobalah untuk mendapatkan sebanyak tangan-tepat waktu bekerja dengan komputer mungkin. Hal ini dapat dilakukan sebagai bagian dari kursus atau program pelatihan, atau dapat dilakukan sendiri di rumah.

Dapatkan pelatihan komputer formal. Anda dapat mulai mempersiapkan diri untuk menjadi seorang teknisi komputer sementara masih di SMA. Sekolah tinggi Banyak menawarkan kursus pelatihan sertifikasi atau kredit untuk gelar sarjana 2-tahun atau gelar sarjana. Lulusan SMA dapat memilih untuk mengejar baik program 2 atau 4 tahun kuliah. Banyak perguruan tinggi menawarkan program pelatihan komputer teknisi yang fokus langsung pada pekerjaan aktual yang Anda akan lakukan di dunia nyata. Kursus-kursus pelatihan yang paling penting yang akan Anda perlu mengambil adalah mereka program studi yang mempersiapkan Anda untuk ujian sertifikasi Anda! Kursus-kursus ini dapat diambil sebagai bagian dari program gelar atau secara berdiri sendiri.

Mendapatkan sertifikasi. Sebuah sertifikasi profesional adalah sebutan resmi yang menegaskan bahwa seseorang memenuhi syarat untuk melakukan pekerjaan atau tugas. Sertifikasi di bidang teknisi komputer tidak ternilai karena mereka memvalidasi pengetahuan Anda tentang komputer dan membiarkan orang lain tahu bahwa Anda memiliki kemampuan yang dibutuhkan untuk melakukan pekerjaan dengan benar. Ada banyak jenis dan tingkat sertifikasi teknisi komputer. Secara umum, mereka jatuh ke dalam kategori berikut:

o Vendor-netral sertifikasi: Ini adalah sertifikasi yang tidak fokus pada vendor tertentu atau produk, melainkan span spektrum penuh dari hardware dan produsen perangkat lunak. Salah satu pengembang terbesar vendor-netral sertifikasi adalah CompTIA (Computing Technology Industry Association) yang menawarkan sertifikasi yang paling banyak diakui dikenal sebagai CompTIA A +. Sertifikasi A + mengkonfirmasi kemampuan teknisi untuk melakukan tugas seperti instalasi, konfigurasi, pemeliharaan mendiagnosis, preventif dan jaringan dasar. Ini juga

Page | 32

mengesahkan kemahiran dalam seperti aspek konsekuensi pentingnya dengan masalah keamanan, keselamatan dan lingkungan serta komunikasi dan profesionalisme.

o Khusus vendor sertifikasi: Sertifikasi ini berorientasi terhadap teknologi spesifik dan dikelola oleh vendor teknologi ini. Mereka disesuaikan dengan pengguna teknologi tersebut dan kepada lembaga-lembaga yang mempekerjakan mereka. Contoh dari sertifikasi sangat diinginkan dalam kategori ini adalah MCSE (Microsoft Certified System Engineer) Sertifikasi, yang mempersiapkan Anda untuk bekerja dengan platform Microsoft Windows dan Sistem Microsoft Server. Vendor sangat populer lain yang menawarkan sertifikasi jenis ini termasuk Cisco, Apple, Dell, Novell, dan banyak lainnya.

Untuk mendapatkan sertifikasi, Anda harus lulus ujian terkait dengan sertifikasi tertentu Anda mengejar. Kursus untuk mempersiapkan Anda untuk ujian sertifikasi Anda sering ditemukan sebagai bagian dari tingkat tinggi program pelatihan di perguruan tinggi atau sekolah yang menawarkan program pelatihan teknisi komputer. Ada juga 'boot kamp' yang memberikan pelatihan intensif khusus ditargetkan untuk ujian sertifikasi. Untuk mendaftar untuk mengambil ujian dan menemukan pusat pengujian di dekat Anda, kunjungi Website organisasi sertifikasi atau vendor.

arsitek komputer dalam merancang computer

Singkatnya, teknisi komputer melakukan instalasi & pemeliharaan atau memecahkan masalah yang orang miliki dengan komputer mereka. Seperti halnya ada berbagai jenis komputer dan berbagai tingkat sistem komputer dan jaringan, ada juga beberapa jenis spesialis komputer. Daftar sebagian dari beberapa sebutan pekerjaan di bidang ini tumbuh meliputi:

spesialis desktop yang mendukung administrator jaringan sistem administrator Komputer forensik spesialis membantu meja teknisi dukungan pelanggan analis internet profesional

bagaimana seorang salesman komputer dibayar.

Sangat banyak perusahaan-perusahaan yang mencari dan membutuhkan tenaga sales. penjualan produknya. Berikut adalah salah kutipan yang diambil dari sebuah website ZDnet tentang gaji rata-rata orang di Indonesia yang bekerja di bidang yang berhubungan dengan computer atau IT. ZDnet melakukan survey terhadap 1.269 pekerja IT di berbagai sektor dengan jenis pekerjaan dan kemampuan bermacam-macam.

Page | 33

Tabel Pendapatan di Bidang IT

Jika dilihat dari pengalaman kerja dan skill, seorang konsultan IT yang berpengalaman lebih dari 10 tahun punya gaji rata-rata paling tinggi, yakni Rp 150 juta per tahun. Di antara semua pekerjaan, seorang pekerja yang menduduki jabatan IT management di industri media, marketing, dan sales menduduki posisi tertinggi dengan gaji rata-rata Rp 144,3 juta per tahun. Jadi bekerja sebagai sales juga bisa memiliki gaji yang besar atau bias setara dengan gaji pekerjaan di bidang IT lainnya. Sales computer bukanlah pekerjaan remeh seperti yang banyak orang pikirkan.

insinyur elektronik di komputer installing

Permintaan untuk teknisi komputer sangat besar. Sampai saat ini ada lebih dari 65.000 teknisi bersertifikat di seluruh dunia dan industri bisa menggunakan lebih banyak. teknisi komputer dengan rak berbagai Systema gunung macam pilihan terbuka untuk teknisi komputer karena alasan sederhana bahwa komputer ditemukan di mana-mana saat ini, di hampir setiap bisnis, besar dan kecil, serta di hampir setiap rumah. Komputer dan dimanapun ditemukan, begitu juga file rusak, hard drive crash, dan sistem operasi menghilang. Ini terjadi ketika seorang teknisi komputer dapat segera menjadi pahlawan super. Banyak teknisi komputer bekerja di dunia usaha dan bertanggung jawab untuk hari ke hari manajemen PC organisasi, terminal, monitor, jaringan dan perangkat keras server komponen. Banyak orang lain bekerja sendiri.Beberapa tugas seorang teknisi komputer meliputi: instalasi, konfigurasi dan upgrade PC, laptop dan peralatan terkait; mendiagnosis dan troubleshooting baik hardware umum dan biasa dan masalah software; melakukan pemeliharaan pencegahan pada peralatan komputer; menginstal patch perangkat lunak yang diperlukan; memastikan konektivitas PC, laptop, handheld dan perangkat komputasi lain untuk kedua jaringan area lokal (LAN) dan wide area network; pengaturan dan mempertahankan lokal terhubung dan jaringan printer, dan menyambung diperlukan peralatan peripheral.

------ 00O00 ------

Page | 34

Page | 35

Chapter 8 :

COMPUTER GRAPHICS

Computer graphics are part of that relates to the manufacture and manipulation of images (visual) digitally. The simplest form of computer graphics is 2D computer graphics are then developed into a 3D computer graphics, image processing (image processing), and pattern recognition (pattern recognition). Computer graphics are also known as data visualization.

Grafika komputer adalah bagian dari yang berkaitan dengan pembuatan dan manipulasi gambar (visual) secara digital. Bentuk sederhana dari grafika komputer adalah grafika komputer 2D yang kemudian berkembang menjadi grafika komputer 3D, pemrosesan citra (image processing), dan pengenalan pola (pattern recognition). Grafika komputer sering dikenal juga dengan istilah visualisasi data.

the hardware needed by freelance

Any computer with the following hardware should suffice, however, for an enjoyable experience, we suggest looking at the Recommended Requirements.

Minimum Requirements: CPU : Intel P4/NetBurst Architecture or its AMD Equivalent (AMD K7) RAM : 1GB GPU : Intel GMA 950 or AMD Equivalent HDD : At least 90MB for Game Core and Sound Files Java Runtime Environment (JRE) 6 or up is required to be able to run the game.

Recommended Requirements:

CPU : Intel Pentium D or AMD Athlon 64 (K8) 2.6 GHz RAM : 2GB GPU : GeForce 6xxx or ATI Radeon 9xxx and Up with OpenGL 2 Support (Excluding Integrated

Chipsets) HDD : 150MB

Three features available to improve the appearance of your data.

Part of computer graphics include:

1) Geometry: learn how to describe the surface area

Page | 36

2) Animation: learn how to describe and manipulate the movement 3) Rendering: learning algorithms to show the effect of light 4) Image (Imaging): learn how to capture and edit images.

2D computer graphics

2D computer graphics is the generation of computer-based digital images-mostly from two-dimensional models, such as 2D geometric models, text, and digital images, and with special techniques for them. This word can stand for the branch of computer science that comprises such techniques, or for its own models.

2D computer graphics are mainly used in the application that was originally developed at the time of traditional printing and drawing technologies, such as typography, cartography, technical drawing, advertising, etc.. In the application, not just a two-dimensional representations of real world objects, but an independent artifact with added semantic value; model of two-dimensional because it is preferred, because they give more direct control of the images of 3D computer graphics, an approach more akin to photography than typography.

Pixel art

Pixel art is a form of digital art, created through the use of raster graphics software, where images are edited on the pixel level. Charts in most old (or relatively limited) computer and video games, game graphics calculator, and many mobile phone games mostly pixel art.

Vector charts

vector graphics raster graphics complement format, which is a representation of an image as a pixel array, since it is usually used for the representation of photographic images. There are many instances when working with vector tools and formats is best practice, and instances when working with raster tools and formats is best practice. There are times when both formats come together. Understanding of the advantages and limitations of each technology and the relationship between those who are most likely to result in efficient use and effective tool.

3D computer graphics

3D computer graphics in contrast to 2D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in a computer for the purpose of performing calculations and rendering 2D images. images could be to display the time or to see real-time. Despite these differences, 3D computer graphics rely on many of the same algorithms as 2D computer vector graphics in the wire frame models and 2D computer raster graphics in the final rendered display. In computer graphics software, the difference between 2D and 3D are sometimes blurred, 2D applications may use 3D techniques to achieve effects such as lighting and primarily 3D may use 2D rendering techniques.

Page | 37

3D computer graphics are often referred to as 3D models. Apart from a given graph, the model is contained within the graphical data file. However, there is a difference. A 3D model is a mathematical representation of any three-dimensional object. A model is not technically a graphic until visual display. Due to 3D printing, 3D models are not confined to virtual space. A model can be displayed visually as a two-dimensional image through a process called 3D rendering, or used in non-graphical computer simulations and calculations.

Computer Graphics

computer animation is the art of creating moving images via the use of computers. It is a subfield of computer graphics and animation. The more it is made by means of 3D computer graphics, though 2D computer graphics are still widely used for style, low bandwidth, and faster real-time rendering needs. Sometimes the target of the animation is the computer itself, but sometimes the target of other media, like film. It is also referred to as CGI (Computer-generated imagery or computer-generated imaging), especially when used in the film.

Virtual entities may contain and are controlled by various attributes, such as the transformation of values (location, orientation, and scale) are stored in the object transformation matrix. Animation is the change attribute from time to time. Several methods exist to achieve the animation, the basic form is based on the creation and editing keyframes, each of which stores the value at any given time, each attribute to be animated. The 2D/3D graphics software will interpolate between keyframes, creating an editable curve to the value mapped from time to time, so the animation. Other methods include techniques for procedural animation and expression-based: the first consolidation of related elements of the animated entity to the set of attributes, useful for creating particle effects and crowd simulation, the latter allows re-evaluated the results of a user-defined logic expressions, plus with mathematics, to automate the animation with a predictable way (easy to control the behavior of the bone beyond what the hierarchy offers in order to set up the system). To create the illusion of movement, the image displayed on a computer screen then quickly replaced with a new image that is similar to the previous image, but shifted slightly. This technique is identical to the illusion of movement in television and motion pictures.

------ 00O00 ------

Page | 38

Terjemahan bab 8 :

KOMPUTER GRAFIS

Komputer grafis adalah bagian dari yang berhubungan dengan pembuatan dan manipulasi gambar (visual) secara digital. Bentuk paling sederhana dari komputer grafik adalah grafik komputer 2D yang kemudian berkembang menjadi komputer grafis 3D, pengolahan citra (image processing), dan pengenalan pola (pengenalan pola). Komputer grafis juga dikenal sebagai visualisasi data.Grafika gedung kantor adalah bahasa Dari Bagian tidak Yang berkaitan Mencari Google Artikel Baru Pembuatan Dan manipulasi Gambar (visual) secara digital. Bentuk Sederhana bahasa Dari Grafika Grafika adalah gedung kantor gedung kantor 2D Yang kemudian berkembang menjadi Grafika gedung kantor 3D, pemrosesan citra (image processing), dan pengenalan Pola (pengenalan pola). Gedung kantor Grafika sering dikenal juga Mencari Google Artikel Istilah Data visualisasi.

spesifikasi / hardware yang di perlukan.

Setiap komputer dengan perangkat keras berikut sudah cukup, namun, untuk pengalaman yang menyenangkan, kami menyarankan melihat Persyaratan yang disarankan.

Persyaratan Minimum:o CPU: Intel P4/NetBurst Arsitektur atau yang Setara AMD (AMD K7)o RAM: 1GBo GPU: Intel GMA 950 atau AMD Setarao HDD: Setidaknya 90MB untuk Core Game dan File Suarao Java Runtime Environment (JRE) 6 atau up diperlukan untuk dapat menjalankan permainan.

Rekomendasi Persyaratan:o CPU: Intel Pentium D atau AMD Athlon 64 (K8) 2,6 GHzo RAM: 2GBo GPU: GeForce 6xxx atau ATI Radeon 9xxx dan Up dengan OpenGL 2 Dukungan (Tidak termasuk chipset Terpadu)o HDD: 150MB

Tiga fitur yang tersedia untuk memperbaiki penampilan data Anda.

Bagian dari grafika komputer meliputi:

1) Geometri: mempelajari cara menggambarkan permukaan bidang2) Animasi: mempelajari cara menggambarkan dan memanipulasi gerakan3) Rendering: mempelajari algoritma untuk menampilkan efek cahaya4) Citra (Imaging): mempelajari cara pengambilan dan penyuntingan gambar.

Image Type

Komputer grafik 2D

Page | 39

komputer grafis 2D adalah generasi komputer berbasis gambar digital-sebagian besar dari model dua dimensi, seperti 2D model geometris, teks, dan gambar digital, dan dengan teknik khusus untuk mereka. Kata ini dapat berdiri untuk cabang ilmu komputer yang terdiri dari teknik tersebut, atau untuk model-model sendiri.komputer grafis 2D terutama digunakan dalam aplikasi yang pada awalnya dikembangkan pada saat pencetakan tradisional dan teknologi menggambar, seperti tipografi, kartografi, gambar teknik, iklan, dll. Dalam aplikasi, gambar dua dimensi bukan hanya representasi dari objek dunia nyata, tetapi artefak independen dengan nilai tambah semantik; model dua dimensi karena itu disukai, karena mereka memberi lebih banyak kontrol langsung dari gambar dari komputer 3D grafis, pendekatan yang lebih mirip dengan fotografi daripada tipografi.

Pixel artPixel art adalah suatu bentuk seni digital, diciptakan melalui penggunaan perangkat lunak raster grafis, di mana foto akan diedit pada tingkat piksel. Grafik di sebagian besar tua (atau relatif terbatas) permainan komputer dan video, grafik game kalkulator, dan banyak game ponsel kebanyakan seni pixel.

Grafik Vektorgrafis vektor format melengkapi grafis raster, yang merupakan representasi dari gambar sebagai array pixel, karena biasanya digunakan untuk representasi dari gambar foto. Ada banyak contoh ketika bekerja dengan alat vektor dan format adalah praktek terbaik, dan contoh ketika bekerja dengan alat raster dan format adalah praktek terbaik. Ada kalanya kedua format datang bersama-sama. Pemahaman tentang keunggulan dan keterbatasan dari setiap teknologi dan hubungan antara mereka yang paling mungkin untuk menghasilkan penggunaan yang efisien dan alat efektif.

Komputer grafik 3Dgrafik komputer 3D kontras dengan 2D grafis komputer adalah grafis yang menggunakan representasi tiga-dimensi dari data geometris yang disimpan dalam komputer untuk tujuan melakukan perhitungan dan render gambar 2D. gambar tersebut dapat untuk menampilkan waktu atau untuk melihat real-time.Meskipun perbedaan-perbedaan ini, grafis 3D komputer bergantung pada banyak algoritma yang sama seperti komputer grafis vektor 2D dalam model frame kawat dan grafik raster 2D komputer dalam tampilan yang diberikan akhir. Dalam perangkat lunak komputer grafis, perbedaan antara 2D dan 3D kadang-kadang kabur, aplikasi dapat menggunakan teknik 2D 3D untuk mencapai efek seperti pencahayaan, dan terutama 3D mungkin menggunakan teknik render 2D.

Komputer grafis 3D sering disebut sebagai model 3D. Selain grafik yang diberikan, model terkandung dalam file data grafis. Namun, ada perbedaan. Sebuah model 3D adalah representasi matematis dari setiap objek tiga-dimensi. Sebuah model tidak teknis grafis sampai visual ditampilkan. Karena cetak 3D, model 3D tidak terbatas pada ruang virtual. Sebuah model dapat ditampilkan secara visual sebagai gambar dua dimensi melalui proses yang disebut 3D rendering, atau digunakan dalam simulasi komputer non-grafis dan perhitungan.

Grafik Komputeranimasi komputer adalah seni membuat gambar bergerak melalui penggunaan komputer. Ini adalah subfield komputer grafis dan animasi. Semakin itu dibuat dengan cara komputer grafis 3D, walaupun grafik komputer 2D masih banyak digunakan untuk gaya, bandwidth rendah, dan lebih cepat kebutuhan real-time rendering. Kadang-kadang sasaran animasi adalah komputer itu sendiri, tapi kadang-kadang target media lain, seperti film. Hal ini juga disebut sebagai CGI (Computer-generated imagery atau pencitraan yang dihasilkan komputer), terutama bila digunakan dalam film.

Page | 40

entitas Virtual mungkin berisi dan dikendalikan oleh berbagai macam atribut, seperti transformasi nilai-nilai (lokasi, orientasi, dan skala) yang tersimpan dalam matriks transformasi obyek. Animasi adalah perubahan atribut dari waktu ke waktu. Beberapa metode untuk mencapai animasi ada, bentuk dasar didasarkan pada penciptaan dan pengeditan keyframes, masing-masing menyimpan nilai pada waktu tertentu, setiap atribut yang akan animasi. The grafis 2D/3D software akan interpolasi antara keyframes, menciptakan kurva dapat diedit dengan nilai dipetakan dari waktu ke waktu, sehingga animasi. Metode lain untuk animasi termasuk teknik prosedural dan ekspresi-based: yang pertama mengkonsolidasi unsur-unsur terkait dari entitas animasi ke set atribut, berguna untuk membuat efek partikel dan simulasi kerumunan, yang kedua memungkinkan hasil dievaluasi kembali dari suatu ekspresi logika yang ditetapkan pengguna, ditambah dengan matematika, untuk mengotomatisasi animasi dengan cara yang dapat diprediksi (mudah untuk mengontrol perilaku tulang di luar apa yang hirarki menawarkan dalam sistem rangka mengatur).Untuk membuat ilusi gerakan, gambar ditampilkan pada layar komputer lalu cepat-cepat diganti dengan gambar baru yang mirip dengan gambar sebelumnya, tetapi bergeser sedikit. Teknik ini identik dengan ilusi gerakan dalam gambar televisi dan gerak.

------ 00O00 ------

Page | 41

Page | 42

Chapter 9 :

HIGH LEVEL LANGUAGE

language program is a language or a procedure that can be used by humans (programmer) to communicate directly with the computer. This type of programming language very much. But in general, the notion of programming language can be divided into two, namely Low Level Language and High Level Language.

A programming language such as C, FORTRAN, or Pascal that enables programmers to write programs more or less independent of a particular type of computer. Language is considered a high level because they are closer to human languages and further from machine languages. In contrast, assembly languages are considered low-level because they are very close to machine language.The main advantage of a lower level language high-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in high level languages should be translated into machine language by a compiler or interpreter.

The first high-level programming language designed in 1950. Now there are dozens of different languages, including Ada, Algol, BASIC, COBOL, C, C + +, FORTRAN, LISP, Pascal, and Prolog.

1. Low level and high level languages.

low-level language is a language program or a procedure that can be used to communicate with the computer. In this case the procedure is still used by the machine-oriented, due to the low level langugae also referred to as machine language.

To use this language, the programmer must write the instructions for each instruction in a clear and thorough. Each program and data are written, must be determined also the address where the data and the program will be stored. Programmers also need to know the location of each indicator or register, and program for the entire function.

The only symbols that are available to communicate the measures taken and to identify the data are 0 and 1. Instructions should be written in the order and the rules which they must ditmapilkan. Therefore, if one instruction is lost due to errors / strapped telitian, all instructions must be re-allocated out to make room to add those instructions, and this means changing the location of the data. To overcome these difficulties, and then developed into a machine language assembly language. Given this development, it is possible to write programs using the instruction code and the label that represents a storage location provided that the computer has the means to translate into machine language. This language is called assembly language and to translate that into a program called the assembler code machine. Generally there are one to one relationship between each of the assembly language instructions to machine code instructions.

Page | 43

Programs written in assembly language programmers called the source program if the program is then converted into machine language, called the object program. With the assembly language, the programmer does not need to allocate address specifically, and he simply gave a name or label as well as induce the required size and format. Assembler then responsible for the allocation and storage. By using symbolic names for data and operating code, the programmer task is made easier than in machine language using a numeric code. Storage allocation by the assembler also allows progremmer make changes, additions and removal instructions tend to be more easily and tend to make smaller mistakes. Because it is still relating to machine language, assembly is very efficient in the use of machine facility.

Assembly language is a low level language, which is closer to machine code of the language used by humans in daily life. Because it is still machine-oriented, requiring programmmer who have good knowledge of the machine. Transfer two machines language programs for different types are often difficult and in some cases impossible. Programmers still have to learn assembly language for different machines.

High level language is a language program or a procedure that can be used to giving orders / instructions to the computer. Existing ordinances that are very similar to the procedures used by humans to communicate. Thus, high level language is easier to learn. All sentences, words or rules that are in high level language, is also a phrase or word, or the rules used in everyday life. Since the range of computer users are international, the rules or sentences or words that are used on the basis of high-level language, then adjusted to the rules and sentences in English. Types of high-level language is quite a lot, such as BASIC, COBOL, FORTRAN and others. Similarly, the procedures contained in assembly language, writing programs in high level language should be translated into machine language before the process is done. Disebuh translator program compiler or interpreter.

Every language in the high-level language has rules and procedures of its own, so does the compiler or interpreter is available. It can also be equated with the language used by humans, in which between one language and other languages are not the same, and all have rules and procedures of their own.

For the BASIC language for example, the structure of the program always consists of three things, namely the line number, keyword and body program. In this case BASIC stands for Beginners All-purpose Symbolic Instruction Code. Basic became very popular because it can be made by the air-structure or not, in addition, has a version of the BASIC interpreter and compiler versions.

2. Problems associated with those programming languages having broad capabilities.

The thing to remember in learning programming is more on the basic concepts and ideas than syntax or programming language being studied. Programming is basically nothing more nothing less than to write the solution of a problem in a computer language. Needed three things to do this: understanding the problem, solutions to problems, and understanding of grammar (syntax) used programming languages.

Page | 44

Many people want to jump directly to the programming language, without going to see and learn to see and resolve problems encountered first. This is a very wrong approach. Before learning a particular programming language in particular, you should first learn the skills to make a flowchart and write algorithms. This is important as a tool to formulate a logical flow and the concept of our program before it was committed in these lines of programming languages.

In addition, make sure to have the basics of math are required. Boolean algebra in high school that the basic minimum. Willing to work in numeric, at least to remember more calculus, linear algebra, and statistics. Forget about it to learn programming if rusty math.

The next focus first on basic programming concepts and techniques: conditions, loops, iteration, selection, function, branching algorithms, recursion, using the library, subprogram, object-oriented programming. Understand how to use these basic concepts to solve problems and how to write it. If the basic concepts are understood, there would be no problem to move to any language as well.

Next, about the programming language to be learned. Programming can be classified as follows [Rechenberg]:

A. Oriented procedures (procedural oriented)2. Oriented functions (functional oriented)3. Oriented logic (logic oriented)4. Object-oriented (object oriented)

Each has its own advantages. Sometimes in building a composite application programming method is required. For example, in C + + and Java (object-oriented programming languages), we can still find the techniques oriented programming procedures in each method / function in the member objects.

A programming language originally only be used in one method. Pascal originally for procedural-oriented, Lisp for functional-oriented, Smaltalk for object-oriented and others. Along with the development of information technology and computers, dozens or even hundreds of new programming language was born. Each has unique advantages and specific. Some are specific to certain types of computers, some are specific to a particular programming paradigm.

Often they are just starting to learn to program and then stuck on the issue of choice of programming language which was first studied. The selection of the first programming language is crucial, because the first programming language affects the way programmers think in the future. Pascal programmers with a first language will be easier to switch to a programming language that has the same paradigm, which is oriented procedures such as C, Modula or Oberon. But programmers will be difficult to move into a paradigm of programming languages such as CLOS and Scheme, the Lisp family of programming languages.

Apart from that, after determining the paradigm, the next problem that arises is to choose the most dominant programming languages in this paradigm. For example, for function-oriented paradigm is most appropriate is taught to beginners, whether or Scheme or CLOS EmacsLisp. The second

Page | 45

problem is related to, the ease of learning, dialects within the family of programming languages, or even of market trends.

In college, usually the first language taught to students is a procedure-oriented programming languages (like Pascal or C). This is because the paradigm is more often used in everyday life. After that, adapted to the circumstances taught other paradigms. But there are also educational institutions that choose the language ML, a language with function-oriented paradigm. The reason is because most previous students have the skills and knowledge in the procedure-oriented programming paradigm, was chosen for reasons of fairness and programming languages that are foreign to most students. Thus most of the students started to learn programming from scratch the same.

Orientation of the educational programming of students are trapped to be dependent on a particular commercial enterprise standards. This can be avoided by focusing on ideas and concepts rather than details of a language or syntax of the language concerned. Try not to rely on commercial software and software releases. Alias, refer to international standards (such as ANSI / ISO) standards rather than specially developed by a particular vendor.

3. My kinds of high level programming languages.

Every language in the high-level language has rules and procedures of its own, so does the compiler or interpreter is available. It can also be equated with the language used by humans, in which between one language and other languages are not the same, and all have rules and procedures of their own.

BASICFor the BASIC language for example, the structure of the program always consists of three things, namely the line number, keyword and body program. In this case BASIC stands for Beginners All-purpose Symbolic Instruction Code. Basic became very popular because it can be made by the air-structure or not, in addition, has a version of the BASIC interpreter and compiler versions. BASIC became popular along with the presence of microcomputer, which in the late 70's. BASIC so popular, so many at PC computer manufacturer that makes the version of BASIC in ROM (Read Only Memory) in addition to the interpreter or compiler version. So that when the computer is turned on, the computer is immediately ready to run BASIC. There is not one language other than BASIC made in various versions. In addition to these advantages, BASIC is also very suitable for beginners or for a senior programmer. BASIC is also suited to solve problems relating to the business or scientific problems. With the line number that dimilinya, BASIC program will process the order from small to large number keline. But with the GOTO instruction, the process can be deflected keurutan other.

COBOL The next language is COBOL, which stands for Common Business Oriented Language. The language is divided into four divisions, namely Identification Division, Environtment Devision,

Page | 46

Data and Procedure Devision Devision. The composition of these languages is very neat and meticulous so as to resemble a manager at the time of writing a report or an author is making a book In 1959, CODASYL (Conference on Data System Language) was established with members consisting of representatives of computer users and manufacturers. Two years later, the first specification produced by COBOL name. Finally, the programming language COBOL became the most widely used in commercial or business applications. More than 40% of computer installations in the world still using COBOL. COBOL can also be regarded as a language system that uses a neat and meticulous documentation as well as English. Given this, the user becomes easy to read and understand, and also be easy for programmers to debug or inspection program. Business issues always require the existence of large amounts of data, and speed to process it. COBOL answered with simple instructions and easy to understand.

PASCAL PASCAL Programming Language is also a language, which names are named after the French scientists are very well known, that Blaise Pascal. The language is structured by the pattern of flow structure from top to bottom. In addition, a large program can be broken into several modules of smaller programs. Thus, this language may encourage a programmer to look at a problem in logic. The concept of modular programming (a program which is divided into several modules form) a very interesting introduction by Turbo Pascal began to version 4.0. This module is known as the unit (Turbo Pascal UNIT / TPU). By using the unit, a part of the program modules can be compiled separately for the main program, so the results compilasi main program is not too large. Thus if the program is run, does not require too much memory. Given the pattern of the structured program (structured programming) is also one of the engineering design, the form of a standard PASCAL program so easy to do the tracking direction or when the program needed improvement. PASCAL using the instruction IF-THEN-ELSE and DO-WHILE to control the structure of its program.

dBASE dBASE Programming is one of the high level languge that has been developed in such a way as specifik for microcomputer, allowing a minimum the use of software, but users can easily and quickly be able to define, build and then to access (retrieve) files they have. Given this, the user can easily manage and create reports from their own files interactively via the keyboard and display monitor or printer. also offers a writing dBase, and storage of the action sequences, and repeat if necessary. In other words, the dBase language and generating intermediate code diinterpetasikan. The user's Windows-based computers, is now using a programming language object-oriented programming languages are offered at many facilities, using the vocabulary of the beautiful, the Visual, so that we know of Delphi's Borland, Visual C + +, Visual Basic, or Oracle, PowerBuilder, Visual dBase, Visual Foxpro, for database applications.

Page | 47

VISUAL BASIC Visual Basic from Microsoft Corporation, is a programming language quickly and easily be used to create applications on Microsoft Windows. The word "Visual" is there, showing the means used to create graphical user interface (GUI). In this way we no longer need the programming instructions in writing the code line, but we can easily drag and drop objects that will be used. The word "Basic" is the language BASIC (Beginners All-purpose Symbolic Instruction Code), which is a programming language in its history has been widely used by programmers to develop applications. Visual Basic was developed from the BASIC programming language and now contains many statements, functions, and keywords, some of which connect to the Windows GUI.The latest version of this program using the 6.0 version number To compile an application, we only need a few minutes. By creating a user interface through the control of "drawing", as well as text boxes and command buttons, in a form. Then we can set properties for form and controls in it. For example, given the caption, color, and size. For the latter, we can write the code to put it into an application. If we already know the sequence of the process of making the above application, it helps to know where the concept of building a Visual Basic application. Because Visual Basic is a Windows programming language, which has long been "friendly" with the wearer and a lot of fans to provide the necessary facilities, this will make it easier version of BASIC programmer. If you are a new Windows programmer, still requires a fundamental understanding of a program.

4. Reserved words.

Reserved words (occasionally called keywords) are one type of grammatical construct in programming languages. These words have special meaning within the language and are predefined in the language’s formal specifications. Typically, reserved words include labels for primitive data types in languages that support a type system, and identify programming constructs such as loops, blocks, conditionals, and branches.

The list of reserved words in a language are defined when a language is developed. Occasionally, depending on the flexibility of the language specification, vendors implementing a compiler may extend the specification by including non-standard features. Also, as a language matures, standards bodies governing a language may choose to extend the language to include additional features such as object-oriented capabilities in a traditionally procedural language. Sometimes the specification for a programming language will have reserved words that are intended for possible use in future versions. In Java, const and goto are reserved words — they have no meaning in Java but they also cannot be used as identifiers. By "reserving" the terms, they can be implemented in future versions of Java, if desired, without "breaking" older Java source code. Reserved words may not be redefined by the programmer, unlike predefined functions, methods, or subroutines, which can often be overridden in some capacity. The name of a predefined function, method, or subroutine is typically categorized as an identifier instead of a reserved word.

Page | 48

5. Two broad types of data items.

There are 3 things that relate to the concept pemrogramanan language: syntax, semantiks and pragmatic. In teaching these three concepts I use the analogy of ordinary language we use everyday.

SyntaxThe syntax of a language related to the structure of language. For example, to form a valid sentence in the language we use the structure: [subject] + [verb] + [noun]. By using this structure, we can form a sentence, for example: I eat rice. In conjunction with the programming language, we must satisfy the syntax (read: the rules of language structure) so that programs can run. For example, in BASIC, for mengassign a variable with a value, we use the operand '=', but if in Pascal, we use ': ='. Examples in BASIC: a = 1, but in the language Pascal, a: = 1

SemanticsThe semantics of a language describes the relationship between syntax and computational models. Simply put, the semantics describes the meaning of the program.Analogy as follows. If we use the syntax [subject] + [verb] + [noun], we can generate sentences.If we mengasilkan sentence I eat rice, then the sentence is in compliance with the rules of syntax. But, if I make the sentence I am eating a rock, the syntax of this sentence is correct. However, semantically, this sentence does not contain significant meaning.In conjunction with the programming language, sometimes there are times when a programmer can not link syntax with computational models. Logic errors can easily occur.

For instance there is a programming language as follows:

if (a = 5) {echo 'The value a = 5';}

If the program is run, what happens? Depends what language is used. If the language used is C, then the output that comes out is always value a = 5, although the value of a variable earlier than 5. Why did that happen? That's because the operator '=' in C means mengassign an existing variable on the left with a value that is on the right. In C language, the syntax of this operation is correct.But, if the question is the programmer wants to evaluate the value of a variable, then it should use the logical operators '=='. Thus, the actual program to be

if (a == 5) {echo 'The value a = 5';}

PragmaticPragmatics related to the ease of implementation and efficiency. In analogy with language, we could just tell it to someone "Do not smoke" when there are regulations that prohibit a person smoking in a room. Such a short sentence is already quite efficient. But, in other occasions we may use the phrase "Please you do not smoke in here because, according to government regulations XXX number of XXX stated that smoking in public places would lead to violations of the rules, other than that of the health ... blah blah blah".

Page | 49

In conjunction with the programming language, a programmer should be able to ensure efficiency in the conduct-an attorney-coding. In C language, the programmer is given the power to allocate memory. As a result, if the programmer fails in mengontorl variables resulting from the assignment of a pointer, it will be a memory leak. This is caused when a programmer mengcreate a pointer variable, and then remove it, the information is still there in memory, it's just not accessible anymore.When I was steeped in programming concepts pragmatically, interestingly, I found the broken window theory. I will explain this theory further in the next article in the Personal category.

------ 00O00 ------

Page | 50

Terjemahan bab 9 :

BAHASA PEMROGRAMAN

Programming language atau bahasa program adalah suatu bahasa ataupun suatu tatacara yang dapat digunakan oleh manusia (programmer) untuk berkomunikasi secara langsung dengan komputer. Jenis programming language sangatlah banyak. Tetapi secara umum, pengertian programming language dapat dibagi menjadi dua, yaitu Low Level Language dan High Level Language.

Sebuah bahasa pemrograman seperti C, FORTRAN, atau Pascal yang memungkinkan programmer untuk menulis program yang kurang lebih independen dari jenis tertentu dari komputer. Bahasa tersebut dianggap tingkat tinggi karena mereka lebih dekat dengan bahasa manusia dan lebih jauh dari bahasa mesin. Sebaliknya, bahasa assembly dianggap tingkat rendah karena mereka sangat dekat dengan bahasa mesin.Keuntungan utama dari bahasa tingkat tinggi lebih rendah tingkat bahasa adalah bahwa mereka lebih mudah untuk membaca, menulis, dan memelihara. Pada akhirnya, program yang ditulis dalam bahasa tingkat tinggi harus diterjemahkan ke dalam bahasa mesin oleh compiler atau interpreter.Tingkat tinggi pertama bahasa pemrograman yang dirancang pada tahun 1950. Sekarang ada puluhan bahasa yang berbeda, termasuk Ada, Algol, BASIC, COBOL, C, C + +, FORTRAN, LISP, Pascal, dan Prolog.

1. perbedaan high dan low level languages.

Low level language adalah suatu bahasa program atau suatu tatacara yang dapat digunakan untuk berkomunikasi dengan komputer. Dalam hal ini tatacara yang digunakan masih ber-orientasi dengan mesin, dikarenakan itu low level langugae juga disebut sebagai bahasa mesin.

Untuk menggunakan bahasa ini, programmer harus menuliskan instruksi untuk setiap instruksi secara jelas dan teliti. Setiap program dan data yang ditulis, harus ditentukan pula address dimana data dan program akan disimpan. Programmer juga harus mengetahui lokasi setiap indikator ataupun register dan program untuk seluruh fungsinya.

Satu-satunya simbol yang tersedia untuk mengkomunikasikan tindakan yang dilakukan dan meng-identifikasikan data adalah 0 dan 1. Instruksi yang ada harus ditulis dalam urutan dan aturan dimana mereka harus ditmapilkan. Oleh karena itu, apabila salah satu instruksi hilang karena terjadi kesalahan/kekuarang telitian, seluruh instruksi harus dire-alokasi-kan untuk membuat ruang guna menambahkan instruksi tersebut, dan ini berarti pengubahan lokasi data.

Untuk mengatasi kesulitan tersebut, bahasa mesin kemudian dikembangkan menjadi assembly language. Dengan adanya pengembangan ini, dimungkinkan untuk menuliskan program dengan

Page | 51

menggunakan kode instruksi dan label yang mewakili lokasi penyimpanan dengan syarat komputer memiliki sarana untuk menterjemahkan kedalam bahasa mesin.

Bahasa ini disebut sebagai assembly language dan program untuk menterjemahkannya kedalam kode mesin disebut sebagai asembler. Pada umumnya terdapat hubungan satu untuk satu antara masing-masing instruksi bahasa assembly dengan instruksi kode mesin.

Program yang ditulis oleh programmer dalam bahasa assembly disebut sebagai source program Jika program ini kemudian diubah kedalam bahasa mesin, disebut sebagai object program. Dengan adanya bahasa assembly ini, programmer tidak perlu meng-alokasikan address secara khusus, dan ia cukup memberikan nama atau label serta menginduksikan ukuran dan format yang diperlukan. Assembler kemudian bertanggung jawab atas pengalokasian dan penyimpanan.

Dengan menggunakan nama-nama simbolik untuk data dan kode-kode pengoperasian, tugas programmer dibuat lebih mudah dari pada menggunakan kode numeric bahasa mesin. Alokasi penyimpanan oleh assembler juga memungkinkan progremmer membuat perubahan-perubahan, penambahan dan penghilangan instruksi cenderung lebih mudah dan cenderung membuat kesalahan yang lebih kecil. Karena masih berhubungan dengan bahasa mesin, assembly sangat efisien dalam penggunaan fasilitas mesin.

Bahasa assembly adalah low level language, yakni lebih dekat dengan kode mesin dari pada bahasa yang digunakan oleh manusia dalam kehidupan sehari-hari. Karena masih berorientasi mesin, membutuhkan programmmer yang memiliki pengetahuan mesin secara baik. Transfer program bahasa mesin kemesin untuk type berbeda sering sulit dan dalam beberapa kasus tidak mungkin. Programmer masih harus mempelajari bahasa assembly untuk mesin yang berbeda.

High level language merupakan suatu bahasa program atau suatu tata cara yang dapat digunakan untuk memberi perintah/instruksi kepada komputer. Tata cara yang ada sangat mirip dengan tata cara yang digunakan oleh manusia dalam berkomunikasi. Dengan demikian, high level language lebih mudah untuk dipelajari. Semua kalimat, kata ataupun aturan yang ada didalam high level language, juga merupakan kalimat ataupun kata ataupun aturan yang digunakan dalam kehidupan sehari-hari.

Karena jangkauan pemakai komputer adalah international, maka aturan ataupun kalimat ataupun kata-kata dasar yang digunakan pada high level language, kemudian disesuaikan dengan aturan-aturan dan kalimat yang ada dalam bahasa Inggris.

Jenis high level language cukup banyak, seperti misalnya BASIC, COBOL, FORTRAN dan lain sebagainya. Sama halnya dengan tatacara yang terdapat dalam bahasa assembly, penulisan program dalam high level language juga harus diterjemahkan kedalam bahasa mesin sebelum proses dilakukan. Program penterjemah disebuh compiler atau interpreter.

Setiap bahasa didalam high level language mempunyai aturan dan tata cara sendiri-sendiri, demikian pula halnya dengan compiler ataupun interpreter yang ada. Hal ini juga bisa disamakan dengan bahasa yang digunakan oleh manusia, dimana antara satu bahasa dan bahasa lainnya tidaklah sama, dan semuanya memiliki aturan dan tatacara sendiri-sendiri.

Untuk bahasa BASIC misalnya, susunan programnya selalu terdiri atas tiga hal, yaitu line number, keyword dan body program. Dalam hal ini BASIC merupakan singkatan dari Beginners All-purpose

Page | 52

Symbolic Instruction Code. Basic menjadi sangat populer karena dapat dibuat dengan cara yang ber-struktur ataupun tidak, disamping itu, BASIC memiliki versi interpreter dan versi compiler.

2. Masalah yang berhubungan dengan bahasa pemrograman

Yang harus diingat dalam belajar programming adalah lebih pada konsep dan ide dasar pemrograman dibandingkan sintaks atau bahasa yang dipelajari. Pemrograman pada dasarnya tidak lebih tidak kurang dari menuliskan solusi suatu masalah dalam bahasa komputer. Diperlukan tiga hal untuk melakukan ini: pemahaman masalah tersebut, solusi masalah tersebut, dan pemahaman tatabahasa (sintaks) bahasa pemrograman yang dipakai.

Banyak orang ingin melompat langsung ke bahasa pemrograman, tanpa mau melihat dan belajar untuk melihat dan menyelesaikan masalah yang dihadapi terlebih dulu. Ini adalah pendekatan yang sangat keliru. Sebelum belajar bahasa pemrograman tertentu secara khusus, sebaiknya pelajari terlebih dahulu ketrampilan membuat flowchart maupun menulis algoritma. Ini penting sebagai alat bantu untuk merumuskan alur logika dan konsep dari program kita sebelum dituangkan dalam baris-baris bahasa pemrograman.

Disamping itu, pastikan untuk memiliki dasar-dasar matematika yang diperlukan. Aljabar Boolean dasar di SMU itu minimum. Untuk yang mau kerja di numerik, minimal ingat-ingat lagi kalkulus, aljabar linear, dan statistik. Lupakan saja belajar pemrograman kalau matematikanya karatan.

Selanjutnya fokuskan dahulu pada konsep dan teknik dasar pemrograman: kondisi, loop, iterasi, seleksi, fungsi, pencabangan, algoritma, rekursi, menggunakan library, subprogram, pemrograman berorientasi objek. Pahami bagaimana menggunakan konsep-konsep dasar tersebut untuk menyelesaikan masalah dan bagaimana menuliskannya. Jika konsep-konsep dasar sudah paham, tidak akan ada masalah pindah ke bahasa manapun juga.

Berikutnya, soal bahasa pemrograman yang akan dipelajari. Pemrograman dapat diklasifikasikan sebagai berikut [Rechenberg]:

1. Berorientasi prosedur (procedural oriented)2. Berorientasi fungsi (functional oriented)3. Berorientasi logik (logic oriented)4. Berorientasi obyek (object oriented)

Masing-masing memiliki kelebihan tersendiri. Kadangkala dalam membangun suatu aplikasi dibutuhkan gabungan metode pemrograman tersebut. Misalnya dalam C++ dan Java (bahasa pemrograman berorientasi obyek), kita masih dapat menemukan tehnik-tehnik pemrograman berorientasi prosedur dalam setiap method/function member dalam obyek-obyeknya.

Suatu bahasa pemrograman pada asalnya hanya dapat digunakan dalam satu metode. Pascal mulanya untuk procedural-oriented, Lisp untuk functional-oriented, Smaltalk untuk object-oriented dan lain-lain. Seiring dengan perkembangan tehnologi informasi dan komputer, puluhan bahkan ratusan bahasa pemrograman baru lahir. Masing-masing memiliki keunikan dan kelebihan spesifik. Ada yang khusus untuk jenis komputer tertentu, ada pula yang khusus untuk paradigma pemrograman tertentu.

Page | 53

Seringkali mereka yang baru mulai belajar memprogram lantas terjebak pada masalah pilihan bahasa pemrograman yang pertama kali dipelajari. Pemilihan bahasa pemrograman pertama merupakan hal yang krusial, sebab bahasa pemrograman pertama akan mempengaruhi cara berfikir programer di masa yang akan datang. Programer dengan bahasa pertamanya Pascal akan lebih mudah berpindah ke bahasa pemrograman yang memiliki paradigma sama, yaitu berorientasi prosedur seperti C, Modula, atau Oberon. Tetapi programer tersebut akan kesulitan untuk berpindah ke bahasa pemrograman dengan paradigma yang lain seperti CLOS dan Scheme, yaitu bahasa pemrograman keluarga Lisp.

Selain daripada itu, setelah menentukan paradigmanya, masalah berikutnya yang muncul adalah memilih bahasa pemrograman yang paling dominan dalam paradigma tersebut. Misalnya, untuk paradigma berorientasi fungsi manakah yang paling tepat diajarkan kepada pemula, apakah CLOS atau Scheme atau EmacsLisp. Masalah kedua ini berkaitan dengan, kemudahan dalam belajar, dialek dalam keluarga bahasa pemrograman tersebut, atau bahkan kecenderungan pasar.

Di perguruan tinggi, biasanya bahasa pemrograman pertama yang diajarkan pada mahasiswa adalah bahasa pemrograman yang berorientasi prosedur (seperti Pascal atau C). Hal ini dikarenakan paradigma tersebut lebih sering dipakai di dalam kehidupan sehari-hari. Setelah itu, disesuaikan dengan situasi dan kondisi diajarkan paradigma lain. Tetapi ada pula lembaga pendidikan yang memilih bahasa ML, bahasa dengan paradigma berorientasi fungsi. Alasannya karena sebagian mahasiswa sebelumnya telah memiliki ketrampilan dan pengetahuan dalam paradigma pemrograman berorientasi prosedur, demi alasan keadilan dipilihlah bahasa dan pemrograman yang asing untuk sebagian besar mahasiswa. Dengan demikian sebagian besar mahasiswa memulai belajar pemrograman dari awal yang sama.

Orientasi pendidikan pemrograman sering menjebak peserta didik untuk menjadi tergantung pada standar perusahaan komersial tertentu. Hal ini bisa dihindari dengan berfokus pada ide dan konsep dari suatu bahasa ketimbang detail atau sintaks bahasa bersangkutan. Usahakan untuk tidak bergantung pada software komersial dan rilis software. Alias, mengaculah ke standar internasional (seperti ANSI/ISO) ketimbang standar yang khusus dikembangkan oleh vendor tertentu.

3. Jenis – jenis bahasa pemrogramman.

Setiap bahasa didalam high level language mempunyai aturan dan tata cara sendiri-sendiri, demikian pula halnya dengan compiler ataupun interpreter yang ada. Hal ini juga bisa disamakan dengan bahasa yang digunakan oleh manusia, dimana antara satu bahasa dan bahasa lainnya tidaklah sama, dan semuanya memiliki aturan dan tatacara sendiri-sendiri.

BASICUntuk bahasa BASIC misalnya, susunan programnya selalu terdiri atas tiga hal, yaitu line number, keyword dan body program. Dalam hal ini BASIC merupakan singkatan dari Beginners All-purpose Symbolic Instruction Code. Basic menjadi sangat populer karena dapat dibuat dengan cara yang ber-struktur ataupun tidak, disamping itu, BASIC memiliki versi interpreter dan versi compiler.

BASIC menjadi populer seiring dengan hadirnya microcomputer, yaitu pada akhir 70-an. Demikian populernya BASIC, sehingga banyak pabrik komputer PC pada saat itu yang membuat BASIC dalam versi ROM (Read Only Memory) disamping versi interpreter ataupun compiler. Sehingga pada saat komputer dinyalakan, komputer tersebut langsung siap menjalankan BASIC. Belum ada satu bahasa selain BASIC yang dibuat dalam pelbagai versi.

Page | 54

Selain keunggulan-keunggulan tersebut, BASIC juga sangat cocok digunakan untuk pemula ataupun bagi programmer senior. BASIC juga cocok untuk menyelesaikan masalah-masalah yang berkaitan dengan bisnis ataupun persoalan scientific. Dengan adanya line number yang dimilinya, BASIC akan memproses program dari urutan yang kecil menuju keline number yang besar. Tetapi dengan adanya instruksi GOTO, proses ini bisa dibelokkan keurutan lainnya.

COBOLBahasa berikutnya adalah COBOL yang merupakan singkatan dari Common Business Oriented Language. Bahasa ini terbagi menjadi empat divisi, yaitu Identification Division, Environtment Devision, Data Devision dan Prosedure Devision. Susunan bahasa ini sangat rapi dan teliti sehingga menyerupai tulisan seorang manajer pada saat membuat laporan ataupun seorang pengarang sedang membuat buku Pada tahun 1959, CODASYL (Conference on Data System Language) didirikan dengan anggota yang terdiri dari wakil-wakil pemakai komputer dan pabrik. Dua tahun kemudian, spesifikasi pertama dihasilkan dengan nama COBOL. Akhirnya COBOL menjadi bahasa pemrograman yang digunakan paling luas dalam aplikasi komersial ataupun bisnis. Lebih dari 40% instalasi komputer didunia masih menggunakan COBOL. COBOL juga bisa dianggap sebagai suatu bahasa yang menggunakan sistem dokumentasi yang rapi dan teliti seperti halnya bahasa Inggris. Dengan adanya hal ini, pemakai menjadi mudah untuk membaca dan mengerti, dan programmer juga menjadi mudah untuk melakukan debug atau pemeriksaan program. Persoalan bisnis selalu memerlukan adanya data dalam jumlah yang besar, serta kecepatan untuk memprosesnya. COBOL menjawab dengan instruksi-instruksi yang sederhana dan mudah dimengerti.

PASCALPASCAL Programming Language juga merupakan suatu bahasa, dimana nama yang ada diambil dari nama seorang ilmuawan Perancis yang sangat terkenal, yaitu Blaise Pascal. Bahasa ini tersusun dengan pola struktur yang mengalir dari atas kebawah. Disamping itu, sebuah program yang besar dapat dipecah-pecah dalam beberapa modul program yang lebih kecil. Dengan demikian, bahasa ini dapat mendorong seorang programmer untuk melihat sebuah persoalan secara logic. Konsep pemrograman secara modular (suatu program yang dibagi dalam beberapa bentuk modul) yang sangat menarik diperkenalkan oleh Turbo Pascal mulai versi 4.0. Modul ini dikenal dengan unit (Turbo Pascal UNIT/TPU). Dengan menggunakan unit, suatu modul bagian dari program dapat dikompilasi secara terpisah terhadap program utama, sehingga hasil compilasi program utama tidak terlalu besar. Dengan demikian apabila program dijalankan, tidak memerlukan memory yang terlalu besar. Dengan adanya pola program yang terstruktur (structured programming) yang juga merupakan salah satu rancangan teknik, maka bentuk program PASCAL menjadi standart sehingga mudah untuk melakukan pelacakan arah program ataupun saat diperlukan perbaikan. PASCAL menggunakan instruksi IF-THEN-ELSE dan DO-WHILE untuk mengontrol struktur dari program yang dimilikinya.

dBASEdBASE Programming merupakan salah satu high level languge yang telah dikembangkan sedemikian rupa secara specifik untuk microcomputer, sehingga memungkinkan adanya penggunaan software secara minimum, tetapi pemakai dapat dengan mudah dan cepat dapat menentukan, membangun dan kemudian meng-access (memanggil kembali) file-file yang mereka miliki. Dengan adanya hal ini, pemakai dapat dengan mudah mengolah dan membuat laporan dari file mereka sendiri secara interaktif melalui keyboard dan layar monitor ataupun printer. dBase juga

Page | 55

menawarkan suatu penulisan dan penyimpanan urutan-urutan tindakan, dan mengulanginya jika diperlukan. Dengan kata lain, dBase adalah bahasa yang diinterpetasikan dan menghasilkan kode intermediate. Para pengguna komputer berbasis Windows, kini menggunakan bahasa pemrograman berbasis objek Bahasa pemrograman yang ditawarkan dengan banyak kemudahan ini, menggunakan kosa kata yang cantik, yakni Visual, sehingga kita mengenal adanya Delphi milik Borland, Visual C++, Visual Basic, atau Oracle, PowerBuilder, Visual dBase, Visual Foxpro, untuk aplikasi database.

VISUAL BASICVisual Basic dari Microsoft Corporation, merupakan bahasa pemrograman yang secara cepat dan mudah dapat digunakan untuk membuat aplikasi pada Microsoft Windows. Kata "Visual" yang ada, menunjukkan cara yang digunakan untuk membuat graphical user interface (GUI). Dengan cara ini kita tidak lagi memerlukan penulisan instruksi pemrograman dalam kode-kode baris, tetapi dengan secara mudah kita dapat melakukan drag dan drop objek-objek yang akan kita gunakan. Kata "Basic" merupakan bagian bahasa BASIC (Beginners All-purpose Symbolic Instruction Code), yaitu sebuah bahasa pemrograman yang dalam sejarahnya sudah banyak digunakan oleh para programmer untuk menyusun aplikasi. Visual Basic dikembangkan dari bahasa pemrograman BASIC dan sekarang banyak berisi statemen, fungsi, dan keyword, yang beberapa diantaranya terhubung ke Windows GUI. Versi terbaru program ini menggunakan nomor versi 6.0 Guna menyusun sebuah aplikasi, kita hanya membutuhkan beberapa menit saja. Dengan membuat user interface melalui kontrol "drawing", seperti halnya text box dan command button, dalam sebuah form. Selanjutnya kita dapat mengatur properti untuk form dan kontrol yang ada di dalamnya. Misalnya memberi nilai caption, color, dan size. Untuk proses terakhir, kita dapat menuliskan kode untuk memasukkannya ke dalam sebuah aplikasi. Jika kita sudah mengetahui urutan proses pembuatan aplikasi diatas, hal ini akan membantu untuk mengetahui konsep di mana Visual Basic membangun sebuah aplikasi. Karena Visual Basic merupakan bahasa pemrograman Windows, yang telah lama "bersahabat" dengan para pemakainya dan banyak menyediakan fasilitas yang dibutuhkan penggemarnya, hal ini akan memudahkan programmer versi BASIC. Jika kita seorang programmer Windows baru, masih memerlukan pemahaman yang mendasar dari sebuah program.

4. Apa itu “ reserver word ”

Kata Reserved (kadang-kadang disebut kata kunci) adalah salah satu jenis konstruksi gramatikal dalam bahasa pemrograman. Kata-kata ini memiliki arti khusus dalam bahasa dan telah ditetapkan dalam spesifikasi resmi bahasa itu. Biasanya, kata-kata tersedia menyertakan label untuk tipe data primitif dalam bahasa yang mendukung sistem jenis, dan mengidentifikasi konstruksi pemrograman seperti loop, blok, conditional, dan cabang.

Daftar kata-kata tersedia dalam bahasa yang dimaksudkan ketika bahasa dikembangkan. Kadang-kadang, tergantung pada fleksibilitas dari spesifikasi bahasa, vendor mengimplementasikan kompilator dapat memperpanjang spesifikasi dengan memasukkan non-standar fitur. Juga, sebagai bahasa yang matang, badan standar yang mengatur suatu bahasa dapat memilih untuk memperpanjang bahasa untuk menyertakan fitur tambahan seperti kemampuan berorientasi objek dalam bahasa tradisional prosedural. Kadang-kadang spesifikasi untuk sebuah bahasa pemrograman akan memiliki kata-kata tersedia yang dimaksudkan untuk digunakan mungkin dalam versi masa depan. Di Java, const dan goto adalah kata-kata dicadangkan - mereka tidak memiliki arti di Java tetapi mereka juga tidak dapat digunakan sebagai pengidentifikasi. Dengan "pemesanan"

Page | 56

persyaratan, mereka dapat diimplementasikan pada versi mendatang dari Java, jika diinginkan, tanpa "melanggar" kode sumber Java lebih tua. Kata Reserved mungkin tidak didefinisikan ulang oleh programmer, tidak seperti fungsi standar, metode, atau subrutin, yang sering dapat diganti dalam beberapa kapasitas. Nama fungsi yang telah ditetapkan, metode, atau subrutin biasanya dikategorikan sebagai pengidentifikasi bukan kata reserved.

5. Dua item data pemrograman

Ada 3 hal yang berhubungan dengan konsep bahasa pemrogramanan: sintaks, semantiks dan pragmatis. Dalam mengajarkan 3 konsep ini saya menggunakan analogi bahasa yang biasa kita pakai sehari-hari.

SintaksSintaks sebuah bahasa berhubungan dengan struktur bahasa. Sebagai contoh, untuk membentuk sebuah kalimat yang valid dalam bahasa kita memakai struktur: [subyek] + [kata kerja] + [kata benda]. Dengan memakai struktur ini, kita bisa membentuk kalimat, sebagai contoh: Saya makan nasi. Dalam hubungannya dengan bahasa pemrograman, kita musti memenuhi sintaks (baca: aturan struktur bahasa) agar program dapat berjalan. Sebagai contoh, dalam bahasa BASIC, untuk mengassign sebuah variabel dengan sebuah nilai, kita memakai operand ‘=’, tetapi kalau dalam Pascal, kita pakai ‘:=’. Contoh dalam BASIC: a=1, tapi dalam bahasa Pascal, a:=1.

SemantikSemantik sebuah bahasa menggambarkan hubungan antara sintaks dan model komputasi. Sederhananya, semantik menjelaskan arti dari program.

Analoginya sebagai berikut. Apabila kita memakai sintaks [subyek] + [kata kerja] + [kata benda], kita bisa menghasilkan kalimat-kalimat. Apabila kita mengasilkan kalimat Saya makan nasi, maka kalimat ini memenuhi aturan sintaks. Tapi, apabila saya membuat kalimat Saya makan batu, secara sintaks kalimat ini sudah benar. Namun, secara semantik, kalimat ini tidak mengandung makna yang berarti.Dalam hubungannya dengan bahasa pemrograman, kadang ada kalanya seorang programmer tidak bisa mengaitkan sintaks dengan model komputasi. Kesalahan logika bisa dengan mudah terjadi.

Sebagi contoh ada bahasa pemrograman sebagai berikut:if(a=5) {echo ‘Nilai a=5 ;′}Apabila program ini dijalankan, apa yang terjadi? Bergantung bahasa apa yang digunakan. Apabila bahasa yang dipakai adalah bahasa C, maka output yang keluar selalu Nilai a=5, walaupun nilai variabel a sebelumnya selain 5. Kenapa itu bisa terjadi? Itu karena operator ‘=’ dalam bahasa C berarti mengassign sebuah variabel yang ada di sebelah kiri dengan nilai yang ada di sebelah kanan. Dalam bahasa C, secara sintaks operasi ini sudah benar.Tapi, apabila yang dimaksud adalah programmer ingin mengevaluasi nilai variabel a, maka seharusnya memakai operator logika ‘==’. Jadi, program yang sebenarnya menjadi

Page | 57

if(a==5){echo ‘Nilai a=5 ;′}

PragmatikPragmatik berhubungan dengan kemudahan implementasi dan efisiensi. Dalam analoginya dengan bahasa, kita bisa saja memberitahukan ke seseorang “Jangan merokok” apabila ada peraturan yang melarang seseorang merokok di dalam sebuah ruangan. Kalimat singkat seperti itu sebenarnya sudah cukup efisien. Tapi, dalam kesempatan lain kita bisa saja memakai kalimat “Mohon Anda jangan merokok di sini karena menurut peraturan pemerintah daerah nomor XXX tahun XXX dinyatakan bahwa merokok di tempat umum akan mengakibatkan pelanggaran peraturan, selain itu dari sisi kesehatan… blah blah blah”.Dalam hubungannya dengan bahasa pemrograman, seorang programmer harus bisa memastikan efisiensi dalam melakukan peng-coding-an. Dalam bahasa C, programmer diberikan kekuasaan untuk mengalokasikan memori. Sebagai akibatnya, apabila programmer lalai dalam mengontorl variabel-variabel yang dihasilkan dari hasil assignment pointer, maka akan terjadi kebocoran memori. Ini diakibatkan apabila seorang programmer mengcreate sebuah variabel pointer, dan kemudian menghapusnya, informasi tersebut masih ada dalam memori, hanya saja sudah tidak bisa diakses lagi.Ketika saya sedang mendalami konsep pemrograman secara pragmatis, menariknya, saya mendapati teori broken window. Teori ini akan saya jelaskan lebih lanjut di tulisan berikutnya dengan kategori Personal.

------ 00O00 ------

Page | 58

Page | 59

CHAPTER 10 :

COMPILER AND INTERPRETERS

Interpreter is capable of executing software program code (which is written by the programmer) and then translated into machine language, so the machine does the instruction requested by the programmer. The commands are created by the programmer is executed line by line, following the logic contained in the code. This process is very different from the compiler, where the compiler, the result is a direct form of a unity of command in the form of machine language, which the translation process carried out before the program is executed.

While the compiler itself is a system program that is used as a tool in pemrogaman.Perangkat software code that performs the translation process (which made programmer) into machine language. The results of this translation is machine language. On some compilers, the output of machine language implemented by the different assembler.

For more on the differences between the Interpreter to Compiler, it helps me explain in more detail about these two things.

Differences between the Compiler to Interpreter:

i) If you want to run the program compilation can be done without the need of source code. If you need the source code interpreter.

ii) If the compiler, then run the code generation engine that can be done in two separate stages, namely parsing (object code generation) and linking (incorporation of the object code with the library). If the interpreter does not have a separate process.

iii) If the compiler needs to combine the object code linker with various libraries to generate a code that can be executed by a machine. If the interpreter does not need a linker to combine the object code with a variety of libraries.

iv) Interpreter suited to create / test module (sub-routine / minor programs). Then the compiler is somewhat troublesome because to change a module / object code is small, then the process must be done linking / merging back all the required objects to the library.

v) On compiler optimizations can be done / improved quality of code that can be run. There are optimized in order to more quickly, there is so much smaller, there are optimized for systems with many processors. If the interpreter can be difficult or even not optimized.

1. the specific task of a compiler

Is to translate the entire program into machine language, then dijalankan.Compiler included into the High-level language translator facility (tingggi level programming language) High-level programming language is a language close to human language.

2. how the compiler check FDR error

When you compile your code you will receive the following error message:

Page | 60

The type or namespace name <type / namespace> not found (missing you use a hint or reference to the Assembly?)where <type / namespace> is the name of the type or namespace you are trying to use.

There are several reasons why you might receive this error:

You may have misspelled the name of the type or namespace you are trying to use. Without the correct name, Compiler able to find a definition for the type or global namespace referenced in your code. This most often occurs because the C # case-sensitive and you do not use correct capitalization when you are called type. For example, see the following code:

Dataset ds;

This will generate a compiler error CS0246. Notification 's' letters in Dataset is not large.

If an error is a reference to a namespace, you may not have the Assembly where the namespace is referenced in your project. For example, you may use the following namespaces:

using Accessibility;

However, if you do not have the Assembly Accessibility.dll referenced in your project then you will receive a compiler error CS0246.

If an error is a reference to a type, then you may not be appropriate to use directive, or you may have not fully qualified type name. See the following code lines:

DataSet ds;

To be able to use the DataSet type you need two things. First, you need a reference to the Assembly that contains the definition for the DataSet type. Secondly, you needusing a directive for the namespace where DataSet is located. For example, because DataSet is located in the System.Data namespace, you will need the following statement at the beginning of your code file:

using System.Data;

The second step is not required. However, if you omit this step, then you will have to fully qualify the DataSet type when you refer to it. Fully qualifying it means that you use the namespace and type every time you refer to in your code. So, if you decide to forgo the second step, you must change the code for the Declaration:

System.Data.DataSet ds;

3. what is used by the compiler to translate the source program statements into machine language

3 main parts of the following commands:

1) analysis of lexical(1) check for valid search words

Page | 61

(2) placing all forms of input into the same form(3) coding for reserved words(4) standardize the format and remove spaces to standardize the format that has been represented to the next stage.

2) the syntactic analysis(1) examine the statement to find out the truth of grammatical form(2) complex forms can be broken down into simpler equivalent.

3) penggenerasian code

i) the translation of each statement into its equivalent formii) the use of such tables in the assembly processiii) determination of the various couplingiv) subroutine from the library pick-up systemv) optimizing

Phase penggenerasian code is divided into three stages:

A. penggenerasian code intermediate (between) the code obtained directly from the parser, which has a simple form2. code optimizationbetween the transformation in order to make the program execution is faster and requires less storage space3. penggenerasian code optimization code has been used to generate object code

4. compilation errors and types

Presentation of the Chandler Carruth we can see in the clang compiler GoingNative very persuasive at all. Chandler explains the weakness of the compiler such as gcc, etc. before. Often the error that's secreted by c + + compiler will create frustrations of novice programmers. Diagnostic issued elusive, perhaps even not at all help us in mengalanalisa problem. The compiler also often miss kesalahan2 happens though its syntax is but a logical one or even no meaning.Clang in this case is based on the problem. Clang give error messages, warnings and excellent diagnostics for errors, bad practice, and suggestion. This is really cool stuff. Unfortunately, support for Windows is not so good and buggy.Also supports the clang c + +11 already approved by the committee on standards since the end of last year. So it is very tempting benar2 enough to try. Support given to the c + +11 clang quite complete. You can see the comparison with other compiler2 be some following sites:

http://stackoverflow.com/questions/7232878/c11-compiler-closest-to-the-standard-and-how-close

https://wiki.apache.org/stdcxx/C% 2B% 2B0xCompilerSupport

http://www.aristeia.com/C++11/C++11FeatureAvailability.htm

I followed the steps in the Getting Started or here to do the clang compiler build with Visual Studio C + +. We will do compilasi compiler. That's really cool is not? c + + compiles C + + compilers. The compilation process will take quite a long time. That's compiler right? not a common software. So I

Page | 62

hope you do to be patient at the time of compilation. Here I will only build against the clang project as a compiler.The compilation will be found to build \ bin \ Debug. You can see that the compilation was produced clang.exe. This is a compiler that we will use for our source code.As usual I will start making hello.cpp program. You must first add the compiler is in the PATH environment variable.

1 #include

2 int main(int argc, char **argv) { printf("hello world\n"); }

Compile from the command prompt

1 clang hello.c -o hello.exe

You can see hello.exe generated. If you execute the Hello World will soon appear on the screen. Not surprising.Now we will prove kecangihan of clang like the one in the presentation. Is this true clang can produce good diagnostic?for code like the following add.cpp

1 int foo() {

2    4 + 4;

3 }

Compile with clang-o add.cpp add.exe. It will display the following message

1 add.cpp:2:6: warning: expression result unused [-Wunused-value]

2 4 + 4;

3 ~ ^ ~

4add.cpp:3:1: warning: control reaches end of non-void function [-Wreturn-type]

5 }

6 ^

Warning messages are clear. Very Cool.

Another example is the array index access.

Page | 63

1 int foo() {

2  int arr[100];

3

4  return arr[100];

5 }

Then we will get a very descriptive error following

1array.cpp:4:9: warning: array index 100 is past the end of the array (which

2  contains 100 elements) [-Warray-bounds]

3  return arr[100];

4  ^ ~~~

5  array.cpp:2:2: note: array 'arr' declared here

6  int arr[100];

7  ^

8  1 warning generated.

You can try other contoh2 Chandler in the presentation. This is very helpful for the beginner to learn C + +. Clang will help correct your code. So you do not shoot your own foot with all the freedom that is in c + +.I tried to run the range for (c + +11) with a clang. But failed. It is true that support for windows buggy. Mudah2n immediately addressed.

------ 00O00 ------

Page | 64

terjemahan bab 10 :

COMPILER DAN INTERPRETERS

Interpreter adalah perangkat lunak yang mampu mengeksekusi code program (yang ditulis oleh programmer) lalu menterjemahkannya ke dalam bahasa mesin, sehingga mesin melakukan instruksi yang diminta oleh programmer tersebut. Perintah-perintah yang dibuat oleh programmer tersebut dieksekusi baris demi baris, sambil mengikuti logika yang terdapat di dalam kode tersebut. Proses ini sangat berbeda dengan compiler, dimana pada compiler, hasilnya sudah langsung berupa satu kesatuan perintah dalam bentuk bahasa mesin, dimana proses penterjemahan dilaksanakan sebelum program tersebut dieksekusi.

sedangkan Compiler sendiri adalah program sistem yang digunakan sebagai alat bantu dalam pemrogaman.Perangkat lunak yang melakukan proses penterjemahan code (yang dibuat programmer) ke dalam bahasa mesin. Hasil dari terjemahan ini adalah bahasa mesin. Pada beberapa compiler, output berupa bahasa mesin dilaksanakan dengan proses assembler yang berbeda.

Untuk lebih jelas mengenai perbedaan antara Interpreter dengan Compiler, ada baiknya saya jelaskan lebih terperinci mengenai dua hal ini.

Perbedaan antara Compiler dengan Interpreter :

1. Jika hendak menjalankan program hasil kompilasi dapat dilakukan tanpa butuh kode sumber. Kalau interpreter butuh kode sumber.

2. Jika dengan kompiler, maka pembuatan kode yang bisa dijalankan mesin dilakukan dalam 2 tahap terpisah, yaitu parsing ( pembuatan kode objek ) dan linking ( penggabungan kode objek dengan library ) . Kalau interpreter tidak ada proses terpisah.

3. JIka compiler membutuhkan linker untuk menggabungkan kode objek dengan berbagai macam library demi menghasilkan suatu kode yang bisa dijalankan oleh mesin. Kalau interpreter tidak butuh linker untuk menggabungkan kode objek dengan berbagai macam library.

4. Interpreter cocok untuk membuat / menguji coba modul ( sub-routine / program-program kecil ). Maka compiler agak repot karena untuk mengubah suatu modul / kode objek kecil, maka harus dilakukan proses linking / penggabungan kembali semua objek dengan library yang diperlukan.

5. Pada kompiler bisa dilakukan optimisasi / peningkatan kualitas kode yang bisa dijalankan. Ada yang dioptimasi supaya lebih cepat, ada yang supaya lebih kecil, ada yang dioptimasi untuk sistem dengan banyak processor. Kalau interpreter susah atau bahkan tidak bisa dioptimasikan.

1. tugas khusus dari kompilator

Adalah proses mentranslasikan seluruh program ke dalam bahasa mesin, baru kemudian dijalankan.Compiler termasuk kedalam fasilitas penterjemah High level language (bahasa

Page | 65

pemrograman tingkat tingggi) High level language adalah bahasa pemrograman yang mendekati bahasa manusia.

2. bagaimana compiler memeriksa kesalahan FDR

Ketika Anda mengkompilasi kode Anda Anda akan menerima pesan galat berikut ini: Jenis atau namespace nama < jenis/namespace > tidak ditemukan (Anda hilang menggunakan petunjuk atau referensi Majelis?)di mana < jenis/namespace > adalah nama jenis atau namespace Anda mencoba untuk menggunakan.

Ada beberapa alasan mengapa Anda mungkin menerima kesalahan ini:

Anda mungkin eja nama jenis atau namespace yang Anda mencoba untuk menggunakan. Tanpa nama yang benar, Kompilator mampu menemukan definisi untuk jenis atau namespace global yang dirujuk dalam kode Anda. Hal ini paling sering terjadi karena C# huruf yang benar dan Anda tidak menggunakan kapitalisasi benar ketika Anda disebut tipe. Sebagai contoh, lihat kode berikut:

Dataset ds;

Ini akan menghasilkan kesalahan kompilator CS0246. Pemberitahuan 's ' huruf dalam Dataset tidak besar.

Jika kesalahan adalah referensi ke namespace, Anda mungkin tidak memiliki Majelis di mana namespace terletak dirujuk dalam proyek Anda. Sebagai contoh, Anda mungkin menggunakan ruang nama berikut:

using Accessibility;

Namun, jika Anda tidak memiliki Majelis Accessibility.dll yang dirujuk dalam proyek Anda maka Anda akan menerima kesalahan kompilator CS0246.

Jika kesalahan adalah referensi ke jenis, maka Anda mungkin tidak tepat menggunakan direktif, atau Anda mungkin memiliki tidak sepenuhnya kualifikasi nama jenis. Lihat baris kode berikut:

DataSet ds;

Untuk dapat menggunakan DataSet jenis Anda memerlukan dua hal. Pertama, Anda perlu referensi kepada Majelis yang berisi definisi untuk jenis DataSet. Kedua, Anda perlu menggunakan direktif untuk namespace di mana DataSet terletak. Sebagai contoh, karena DataSet terletak di System.Data namespace, Anda akan memerlukan pernyataan berikut pada awal file kode Anda:

using System.Data;

Langkah kedua tidak diperlukan. Namun, jika Anda menghilangkan langkah ini, maka Anda akan memiliki untuk sepenuhnya memenuhi syarat jenis DataSet ketika Anda merujuk ke itu. Sepenuhnya kualifikasi itu berarti bahwa Anda menggunakan namespace dan ketik setiap

Page | 66

kali Anda merujuk ke dalam kode Anda. Jadi, jika Anda memutuskan untuk melupakan langkah kedua, Anda harus mengubah kode Deklarasi untuk:

System.Data.DataSet ds;

3. apa yang digunakan oleh compiler untuk menerjemahkan pernyataan sumber program ke bahasa mesin

3 bagian pokok proses kompilasi :

1) analisis leksikal (1) memeriksa untuk mencari words valid (2) menempatkan semua bentuk input ke dalam bentuk yang sama (3) mengkode reserved words (4) menstandarisasi format dan mengeluarkan spaces hingga format yang telah di

standarisasi direpresentasikan ke tahap berikutnya.

2) analisis sintaksis (1) memeriksa statement untuk mengetahui kebenaran bentuk gramatikal (2) bentuk-bentuk kompleks dapat dipecah menjadi ekuivalen yang lebih

sederhana.

3) penggenerasian kode

i) penerjemahan tiap statement ke dalam bentuk ekuivalennya ii) penggunaan tabel seperti dalam proses assembly iii) penetapan berbagai penghubunganiv) penjemputan subroutine dari perpustakaan sistem v) pengoptimasian

Fase penggenerasian kode dibagi menjadi 3 tahap :

1. penggenerasian kode intermediate (antara) kode antara diperoleh langsung dari parser, mempunyai bentuk yang sederhana

2. optimasi kode antara di transformasi agar dapat membuat eksekusi program lebih cepat dan memerlukan ruang penyimpanan lebih sedikit

3. penggenerasian kode kode yang telah di optimasi digunakan untuk menghasilkan kode objek

4. kompilasi kesalahan dan jenisnya

Presentasi dari Chandler Carruth yang bisa kita lihat di GoingNative mengenai Clang compiler sangat persuasif sekali. Chandler menjelaskan kelemahan dari compiler sebelum seperti gcc dsb. Sering kali error yang dikeluar kan oleh compiler c++ akan membuat frustasi dari programmer pemula. Diagnostic yang dikeluarkan sukar dimengerti, bahkan mungkin sama sekali tidak membantu kita

Page | 67

dalam mengalanalisa masalah. Compiler juga sering sekali melewatkan kesalahan2 yang terjadi meskipun secara syntax benar tetapi logical nya salah atau bahkan tidak ada artinya.

Clang dalam hal ini dibuat berdasarkan masalah tersebut. Clang memberikan pesan error, warning dan diagnosa yang sangat baik untuk kesalahan, bad practice, and suggestion. This is really cool stuff. Sayangnya support untuk windows tidak begitu bagus dan buggy.

Clang juga mendukung c++11 yang sudah di approved oleh komite standard sejak akhir tahun lalu. Sehingga ini benar2 cukup menggoda sekali untuk dicoba. Dukungan yang diberikan Clang terhadap c++11 cukup lengkap. Anda dapat melihat perbandingannya dengan compiler2 lain di beberap situs berikut:

http://stackoverflow.com/questions/7232878/c11-compiler-closest-to-the-standard-and-how-close

https://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport

http://www.aristeia.com/C++11/C++11FeatureAvailability.htm

Saya mengikuti langkah yang ada di Getting Started atau di sini untuk melakukan build compiler Clang dengan Visual Studio c++. Kita akan melakukan compilasi compiler. That’s really cool isn’t ? c++ compiles c++ compilers. Proses kompilasi akan memakan waktu yang cukup lama. That’s compiler right ? not a common software. Jadi saya harap anda bersabar pada saat kompilasi dilakukan. Saya disini hanya akan melakukan build terhadap clang project sebagai compiler.

Hasil kompilasi tersebut akan ditemukan build\bin\Debug. Anda dapat melihat bahwa kompilasi tersebut menghasilkan clang.exe. Ini merupakan compiler yang akan kita gunakan untuk source code kita.

Seperti biasa saya akan mulai membuat program hello.cpp. Anda terlebih dahulu harus menambahkan compiler tersebut pada environment variable PATH.

1 #include

2 int main(int argc, char **argv) { printf("hello world\n"); }

Lakukan kompilasi dari command prompt

1 clang hello.c -o hello.exe

Anda dapat melihat hello.exe di generate. Jika anda mengeksekusinya maka akan segera ditampilkan Hello World ke layar. Tidak mengejutkan.

Sekarang kita akan membuktikan kecangihan dari Clang seperti yang ada di presentasi tersebut. Apakah benar Clang ini dapat menghasilkan diagnostic yang bagus ?

buat code add.cpp seperti berikut

Page | 68

1 int foo() {

2    4 + 4;

3 }

Lakukan kompilasi dengan clang add.cpp -o add.exe. Maka akan ditampilkan pesan sebagai berikut

1 add.cpp:2:6: warning: expression result unused [-Wunused-value]

2 4 + 4;

3 ~ ^ ~

4add.cpp:3:1: warning: control reaches end of non-void function [-Wreturn-type]

5 }

6 ^

Pesan warning yang diberikan cukup jelas. Very Cool.

Contoh lain adalah mengenai mengakses index array.

1 int foo() {

2  int arr[100];

3

4  return arr[100];

5 }

Maka kita akan mendapatkan error yang sangat deskriptif berikut ini

1array.cpp:4:9: warning: array index 100 is past the end of the array (which

2  contains 100 elements) [-Warray-bounds]

3  return arr[100];

4  ^ ~~~

5  array.cpp:2:2: note: array 'arr' declared here

6  int arr[100];

Page | 69

7  ^

8  1 warning generated.

Anda dapat mencoba contoh2 lain yang ada di presentasi Chandler tersebut. Ini sangat membantu bagi para beginner c++ untuk belajar. Clang akan membantu mengkoreksi code anda. Sehingga anda tidak menembak kaki anda sendiri dengan segala kebebasan yang ada di c++.

Saya mencoba menjalakan range for (c++11) dengan Clang. Tetapi gagal. Memang benar support untuk windows buggy. Mudah2n segera dibenahi.

------ 00O00 ------

Page | 70