Saturday, May 7, 2011

Variable C++

The variable is a temporary storage area in computer memory that is named as an identifier. Only be temporary because the variables are allocated into the computer's memory when the program starts only.
Variables that will be used in the program must be declared first. Declaration here means the ordering of memory and determine what kind of data can be stored in it.

The variable name (identifier) are free, but must consider the following matters:

-There should be no spaces
-Can not contain arithmetic operators
-It should not be prefixed by a number
-It should not be a reserved word in a programming language.
-Reflecting the data to be stored.

Format variable declaration:

tipe_variabel nama_variabel;
Type of variable -Global Variables
    Variables that are recognized by all environments in the program.

-Local Variables
    Variables are only identified by a function only, that is, not recognized by the outside environment in the program.

Thursday, May 5, 2011

Array in C++

Definition Arrays
Array is a type of structured data in the form of a number of similar data (same data type), whose numbers remain and be given a specific name.
Array elements arranged in rows and can be accessed at random in the memory.
Array has an address that besebelahan / adjoining dependent width data types.
Array can be an array of 1 dimension, 2 dimensions, even n-dimensional.
The elements array of the same data and can contain the same or different.

Accessing array elements
Array elements can be accessed by the program using a particular index by random or sequential
Charging and collection value at a particular index can be done by setting the value or returns the value of the index in question.
In C, there is no error handling to the limit value of the index, whether the index would be in the index array that is defined or not. It is the responsibility of the programmer. So if the programmer to access the index is wrong, then the resulting value will be different or damaged due to accessing memory address that is not appropriate.


Initialize the array:

Initialize array same as the initial value
array at the time defined.

int value [6] = {8,7,5,6,4,3};
can be simplified to become:
int value = {8,7,5,6,4,3};
 

Description: The example above means that you reserve a space in computer memory as much as 6 place with an index of 0-5, where the index into-0-value 8, to-1 worth 7, etc., and all elements of type integer data.
Note: To provide niai 0 against all elements of the array at the time defined, you can assign the initial value 0 on the first element. For example:
Int temp [100] = {0};
Will provide the results of zero value of the subscript value of 0 to 99.


Excellence array:
-Array is suitable for random access. Any element in the array can be referenced directly without going through the other elements.
-If you are in a location element, it is very easy to drill down to the neighboring elements, both elements of the predecessor or successor element
-If the array elements are the values ​​of independent and all must be maintained, then the use of highly efficient storage

Weaknesses array:

-Array must be of type-homogenous. We can not have arrays in which one element is a character, another element numbers, and other elements are other types
-Not efficient in memory usage
-Arresting a lot of computing time
-On an application, the static representation is not possible

PHP Basic Structure

PHP Definition  
According to official documents of PHP, PHP stands for PHP Hypertext Preprocessor.
It is a form of language scripts that are placed in the server and processed on the server.  
The results are sent to the client, the user using the browser.  
PHP is a server-side scripting language that integrates with HTML
to create dynamic web pages. The purpose of the server-side scripting
is the syntax and the commands that we give will be entirely run on the
server but is included in regular HTMLdocuments. PHP is free to use.
You do not have to pay anything for using this software, aka free.
You can download it via the site http://www.php.net. PHP is available 
in binary code form as well as complete source code.

PHP Style 
 PHP gives us flexibility when writing a program, 
with records still refer to the conditions set. Please note that by the time 
PHP parse the file, the tag will be read to meet the special tags which tell
for menerjemahkanya as PHP code. If the tag is found, then parser to 
execute the program code until the end on the closing tag. This also
applies to the PHP code is embedded in HTML documents, which 
the parser will find the tags to be found. The rest are outside the tags will
be deemed not is the PHP code, so the parser is also no need to process it. 
 There are four ways to write a tag that identifies the PHP program.

Introduction to Web Server and Server Side Scripting

Web Servers
Web Server is a software that functions in the server receives a request (request) in the form of web pages via HTML or HTTPS from the client, known as a web browser and sent back (response) results in the form of web pages are generally in the form of an HTML document. Some of the widely used Web Server on the Internet, among others:

1. Apache Web Server (http://www.apache.org)

2. Internet Information Services, IIS (http://www.microsoft.com/iis) 
 3. Xitami Web Server (http://www.xitami.com) 
 4. Sun Java System Web Server (Http://www.sun.com/software/products/web_srvr/home_web_srvr.xml) 
 
Server Side Scripting

Server Side Scripting is a scripting or web programming technology in which the script (program) is compiled or translated on the server. With server side scripting, enabling it to generate dynamic web pages. Some examples of Server Side Scripting (Programming):

1. ASP (Active Server Pages) and ASP.NET  

2. ColdFusion (http://www.macromedia.com/software/coldfusion) 
 3. Java Server Pages (http://java.sun.com/products/jsp/) 
 4. Perl (http://www.perl.org)  
5. Phyton (http://www.python.org) 
 6. PHP (http://www.php.net)
 

PHP Privileges 
1. Fast  
2. Free 
 3. Easy to learn  
4. Multi-platform  
5. Support technical-support 
 6. Many of the PHP community  
7. Safe

Installing Apache, PHP and MySQL with XAMPP

The process of installing Apache, PHP and MySQL is often an obstacle, especially for beginners who are just learning web programming with PHP. This is because the software must be installed and configured one by one. For those not yet understand correctly, would often have difficulty, especially those of us who learn independently. But do not be discouraged, currently widely available applications software packages that unite these three (Apache, PHP and MySQL) into a single installer. The installation can be done easily and quickly, just next, next, and finish. Some application packages include:

1. XAMPP (Windows version) and lampp (Linux version) which can be downloaded at http://apachefriends.org. 

2. WAMP Server.
3. AppServ.  
4. PHPTriad.

Wednesday, May 4, 2011

Selection c++

Control statement is used to take a decision or choose the programs to be undertaken in accordance with the conditions or terms provided. OR Branching is a selection of statements to be executed when the selection was based on certain conditions.
The statement above-statement needs a condition or conditions as the basis for decision making. One of the commonly used condition is a state of true or false (true or false). C language provides several statements control, such as:

If statement If-else statement, and
Switch statement
IF Structure of the conditions.


This structure is the simplest structure because it only involves one  expression to be examined. If the condition is false, will do nothing in the instruction IF (straight to the next instruction). The structure is as follows:

/ / If only one statement made
if (condition) statement
/ / If more than one statement
if (condition) {
    
statemen1;
    
statemen2;
    
... ..


The structure of the two conditions  

Branching structure of this type a little more complex when compared with the structures that have only one condition. The structure is as follows:

if (condition)
   
{Statemen_jika_kondisi_terpenuhi;} else
    
{Statemen_jika_kondisi_tidak_terpenuhi;}
 

The structure of the three conditions  
Branching of this type is an extension of the branching structure with one and two conditions. The structure is as follows:

if (kondisi_1)
   
{Statemen_jika_kondisi_1_terpenuhi;} else if (kondisi_2)
    
{Statemen_jika_kondisi_2_terpenuhi;} else if (kondisi_3)
    
{Statemen_jika_kondisi_3_terpenuhi;} else
    
{Statemen_jika_semua_kondisi_diatas_tdk_terpenuhi;}

HTML (hypertext markup language)

HTML DEFINITION
 HTML (hypertext markup language) is one of the formats used in making documents and applications that run on web pages. Therefore, to be able to do programming applications over the web. You must first to master HTML. Although there are now many packages applications that can be used to create web pages in WYSIWYG (what you see is what you get) such as FrontPage, DreamWeaver, Netsccape Composer and there are many more, but still have to master HTML tags, especially for make the application on the internet. 

HTML BASICS

HTTP (hypertext transfer protocol) is a protocol used for transfer data between a web server to a web browser. This protocol transfer web documents written or formatted HTML (hypertext markup language). It said because the HTML markup language used to format the file plain text documents to be displayed on the web browser as you wish. This can be done by adding elements or often referred to as tagtag. HTML elements are usually in the form of paired tags and each tag marked with the symbols <and>. Pairs of a tag marked with a `/`. For example, pairs of <contoh> tag is </ example>. In this case <contoh> referred to as the element and usually in a contained element attributes to regulate that element. So for example <contoh> element when written with attributes are as follows: 

 
<contoh atribut1="nilai_atribut1"atribut2="nilai_atribut2" …>. 


 In writing the HTML tags are not case sensitive meaning that the use of capital or small letters does not matter.

Comparasion Javascript & Java

The Java programming language Java Script is a programming language that is not equipped with writing Java code static and strong type checking. Java Script has a lot of expression syntax and construction of basic control flow Java programming. Conversely, if there is a declaration in Java compilation system time, whereas only a Java Script based timing system on a small number of numerical data, boolean and string values. Java Script has a model simple object-oriented programs are still being developed capabilities. Java Script also has the functions, without the use of a special declaration. Functions to the "properties" of an object. Complements Java Java Script is a view which is very useful for mention the author (author). These statements can retrieve and Java Script set the "properties" you want to look for a statement or allow association of an HTML page with an "applet" or "plug-ins".
 
Java is a programming language designed for fast execution and writing security. Safety seen from the possibility of writing the command "int" on an object reference or to take a special memory space with reduce the number of Java byte code. Java programs have exclusive classes and methods. Java also require equipment to perform the class declaration, method of writing, and ensure the security of the writing. It makes it seem complex Java program and less user friendly so that tends to always be a hierarchy of needs collection of objects. Instead Java Script, has a high capacity although written only in some dynamic command line just as found in the program Hyper Talk or dBase. Script programming language is also equipped with the tools that facilitate users from various walks of life. The existence of a simple syntax, functions special place, and the required minimum requirements in making a object.

Advanced CSS

Watermark Concepts  
CSS also comes with properties that allow you to define how how the background image (background) you in the show. First, property "Background-image" allows you to specify a background image for each HTML element. If you require this background as a watermark, which can not discroll when you to scroll down a page, you must add property "background-attachment" - The values ​​accepted are "fixed" and "scroll" You can also set a Yes / No its an image / images that pass through one page with the property "background-repeat". This property may be taken one of four parts: a "repeat" (horizontal layout and vertically), "repeat-x" (horizontal position only), "repeat-y" (where it is vertical only), and "no repeat" (no arrangement) The examples below we take to indicate the keyword "repeat-y", please try:

<html> 

 <head> 
<style type="text/css" media="all"> . Question {font-size: 20pt; background-image: url (". / letak_folder / bunga.gif"); background-repeat: repeat-y} </ Style>
</ Head>
<body>  
<p class="question"> Q. Hmm ... turns out you now have to understand about the concept of a watermark? A. Yes, There Really is sir! </ P>
</ Body> 
 </ Html> 

CSS formatting model assumes that each element is surrounded by three areas different. Starting from the inside out, this area is the padding, border, and margin. Each of these entities can be arranged through special CSS properties, allowing the developers to briefly set the display and positioning of each HTML element. Value margins (the margins) can be set large and located through property "margin-top", "Margin-bottom", "margin-right", and "margin-left".
 

<html> 
 <head>
</ head> 
 <body>  
<Div style = "position: absolute; top: 10; left: 50; font-family: Verdana; font-size: 35pt; color: green; "> Q. Does everyone who reads this module already understand? </ Div> 
 <Div style = "position: absolute; top: 140; left: 300; font-family: Verdana; font-size: 20pt; color: blue; "> A. Not Necessarily! </ Div>
<Div style = "position: absolute; top: 180; left: 50; letter-spacing: 5px; font-family: Verdana; font-size: 33pt; color: red; "> The ability of each individual is not necessarily the same. </ Div> </ Body>  
</ Html> 

ORGANIZING FILE CSS  
One of several technological prowess css is - and is the reason many people Like its use - is to allow us to define a global style sheet that can apply css rules to the overall HTML documents on your pages. The advantage is clear, if we want to change the look of the site, we live editing one file only and the results will be reflected on the overall HTML document linked to it.
Example:  

Create a folder named css - create a file named global.css. Move the CSS tag of the file. html to global.css. To give effect rules all Style-Sheet or to a specific HTML document,
add the tag between <HEAD> ... </ HEAD>,
becomes:
 

<head> 
 <Link rek = "stylesheet" href = "http://www.webkamu.com/style/global.css" type = "text / css" media = "all" />
</ Head>
 
and all rules of Style-sheet in "global.css" will be applied automatically into HTML documents that want to be informed Style-Sheet. Or can also import Style-Sheet by using keywords (keyword) "@ import",

<style type="text/css" media="all"> @ Import url (http://www.webkamu.com/global.css); </ Style>

CSS (Cascading Style Sheet)

1. Introduction to CSS
Cascading Style Sheets is a technology used to beautify website page views (the site). With the overall color and CSS Method display in a web site can be converted / reformatted quickly. CSS also been in standartkan by the World Wide Web Consortium (W3C) for use on the web browser. 

Writing CSS :<style Type="text/css"> ... CSS ... </ STYLE>


Example: <h1 style="color:red;"> Red, Meriah Euy ...</ h1>




2. The terms in the Style Sheet  
Style rules Cascading style sheets is a collection of rules that define style from the document. As an example we can create the style rules determine that all <H2> display with the color orange.
 

Style sheets Style sheets can be embedded into HTML document. Or called embedded style sheet. Style sheets can also be made as an external file and the link to an HTML document. Style roles can be wearing on the of a certain web page. For example you can determine certain paragraphs in the show with bold and italic style while others remain as usual. Selector property1 {selector: value, property2: value,. . .} h1 {color: green; background-color: orange;}

Style sheets consist of two parts:

a. Selector  
The first part before the "{}" is called selector  
b. Declaration Consisting of the property and its value. 


3. Use the style element

 Let's start by setting the font color and background. You can do this by using the style element to set the character code tags of your document.  
a. Inheritance: 
 <html> 
 <head>  
<style type="text/css" media="all"> b {color: green;} </ Style>
</ Head>  
<body>  
<b> Q: Why, if we consider <font size="+1"> a job </ font> it easy then the real work will become easier? <br /> A: Because it is a suggestion of ourselves. </ B>  
</ Body>
</ Html>

b. Classes:  

This time we define two classes of "ask" and "responsibility" with CSS rules apply. From here we can see kalu two classes should not same and can be modified in accordance with the wishes and interests of our needs.  
<html> 
 <head> 
 <style type="text/css" media="all"> . Asked {color: red;} . Replied {color: blue;} </ Style>
</ Head> 
 <body>  
<p class="tanya"> Q: Why if we deem it an easy job then the real work will become easier? </ P> <p class="jawab"> A: Because it is a suggestion CLASS="tanya"> <FONT </ FONT> of ourselves </ P>  
</ Body> 
 </ Html>

c. Contextual selector

  Contextual selector is similar to conditional statements - Style-Sheet declaration that there will be an effect if the conditions / circumstances encountered. For example, suppose you want to make all text bold and italic performed with arial and blue letters.  
Contextual selector, it will be like this: 
 <head> 
 <style type="text/css" media="all"> b i {color: blue; font-family: Arial;} / * This selector all for bold + italic text * / </ Style>  
</ Head> 

CSS offers a variety of ways to change the color. Is easiest by using one of the pre-defined colors - aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. You can also use hexadecimal color combinations by adding attribute # (sign Kreiss). i {color: # 0000FF;) Or the combination of RGB in the absolute value of percent, like this: i {color: rgb (0, 0, 255);) i {color: rgb (0%, 0%, 100%);)  

We can change the color combination in accordance with the style that we like.  
<html> 
 <head>  
<style type="text/css" media="all"> . Blue {color: cyan; background-color: # FF8000;} . Green {color: lime; background-color: black;}  
</ Style> 
 </ Head>   

 <body>  
<p class="blue"> Actually all the work is easy! </ P> <p class="green"> Agreed, but not as easy to say it .... </ P>  
</ Body>  
</ Html> 

We can also add attributes format for the web we become more alive. For example, changing the link color, font color add bold, italics, underline, gives color to the textbox, textarea, scrollbar, and others.  

<html>
<head>  
<style type="text/css" media="all"> body {color: black; background: white;} i, u {color: red;} b {color: green;} </ Style>  
</ Head> 
 <body> Q: Why, if we consider <i> a job </ i> it is easier then the job real will become easier <b> </ b>? <br /> A: Because it is a suggestion <u> </ u> to <b> ourselves </ b> 
 </ Body> 
 </ Html>

Another example.
<html>

<head>
<style type="text/css" media="all"> . Question {text-decoration: underline} / * underscore * / . Answer {text-decoration: overline} / * line of text * / . Repeat {text-decoration: line-through} / * line through the text * / . No-Imagination {text-decoration: blink; font-weight: bolder} / * Text blink * / </ Style> 
 </ Head> <body> <p class="question"> Q. Why why, never never, always always? </ P> <p class="answer"> A. Because Because always always sometime Sometimes? </ P> <p class="repeat"> Q. Do you know, who the funniest in Indonesia? </ P> <p class="repeat"> A. I Do not Know, Casino and Indro. </ P> <p class="no-imagination">
Instead john terry? </ P>

</ Body>
</ Html>