Selasa, 07 September 2010

Functions for manipulate String in PHP

Understanding how to manipulate strings in PHP will help you tremendously. It will allow
you to validate user input and extract data from text files in an efficient manner. PHP gives
you an enormous number of functions to manipulate strings—take a look at Table 4.3.
Most of the functions are fairly self explanatory, such as strlen(). But others need a little
bit more attention. printf() and sprintf() are good examples of these; let’s take a closer
look at these two functions.



Minggu, 05 September 2010

The If Statement in C language

Relational operators are used mainly to construct the relational expressions used in if and while statements, covered in detail on Day 6, "Basic Program Control." For now, I'll explain the basics of the if statement to show how relational operators are used to make program control statements.
You might be wondering what a program control statement is. Statements in a C program normally execute from top to bottom, in the same order as they appear in your source code file. A program control statement modifies the order of statement execution. Program control statements can cause other program statements to execute multiple times or to not execute at all, depending on the circumstances. The if statement is one of C's program control statements. Others, such as do and while, are covered on Day 6.

Operators in C language

An operator is a symbol that instructs C to perform some operation, or action, on one or more operands. An operand is something that an operator acts on. In C, all operands are expressions. C operators fall into several categories:
  • The assignment operator
  • Mathematical operators
  • Relational operators
  • Logical operators

Symbolic Constants

A symbolic constant is a constant that is represented by a name (symbol) in your program. Like a literal constant, a symbolic constant can't change. Whenever you need the constant's value in your program, you use its name as you would use a variable name. The actual value of the symbolic constant needs to be entered only once, when it is first defined.
Symbolic constants have two significant advantages over literal constants, as the following example shows. Suppose that you're writing a program that performs a variety of geometrical calculations.

Initializing Numeric Variables

When you declare a variable, you instruct the compiler to set aside storage space for the variable. However, the value stored in that space--the value of the variable--isn't defined. It might be zero, or it might be some random "garbage" value. Before using a variable, you should always initialize it to a known value. You can do this independently of the variable declaration by using an assignment statement, as in this example:

int count;   /* Set aside storage space for count */
count = 0;   /* Store 0 in count */

Variable Declarations in C language

Before you can use a variable in a C program, it must be declared. A variable declaration tells the compiler the name and type of a variable and optionally initializes the variable to a specific value. If your program attempts to use a variable that hasn't been declared, the compiler generates an error message. A variable declaration has the following form:

Numeric Variable Types

C provides several different types of numeric variables. You need different types of variables because different numeric values have varying memory storage requirements and differ in the ease with which certain mathematical operations can be performed on them. Small integers (for example, 1, 199, and -8) require less memory to store, and your computer can perform mathematical operations (addition, multiplication, and so on) with such numbers very quickly. In contrast, large integers and floating-point values (123,000,000 or 0.000000871256, for example) require more storage space and more time for mathematical operations. By using the appropriate variable types, you ensure that your program runs as efficiently as possible.
C's numeric variables fall into the following two main categories:

Make New Project C with Dev C++


How to make new project C with Dev C++ ? You dont know how to use Dev C++ ? or you have not Dev C++ ?
if you have not Dev C++ you can download that sofwtare Download Dev C++
After you download that software and install it
follow this step to make new project with Dev C++
First of all ,
  • Open Dev C++
  • Klik File 
  • New
  • Select Project
So, will be appear this dialog

  • Select console application
  • Select C project
  • And write you project name in field nam (space is not allowed)



  • And klik ok
  • So, now you must select directory, where you want to save your project. In this example i select directory in drive D:



  • Make new folder
  • Open folder and klik ok
  • So, you window will be appear like this


  • Now you can write your script
  • If you want to debug or run program click these icon



  • It is easy,isn't ?
  • You can make console aplication and GUI application and other with Dev C++

Disadvantages Of C Language

 C does have a few disadvantages. It is a terse language. Since C is a free-form language and does ot impose strict style rules, C programs cand be difficult to understand, especially if the programmer has not made the effrort to make the program readable.

What Advantages Of C Language ?

The C programming language has a number of advantages over other procedural language such as FORTAN, Pascal, and Basic. These include flexibility, efficiency,speed and portability. C is very powerful and flexibel language. This is evident from the fact that C is being used extensively for developing a wide variety of aplication. Some of advantages of the C programming language are listed in the paragraphs that follow

First C program (Hello.c)

You’re probably eager to try your first program in C. To help you become familiar with your compiler, here’s a quick program for you to work through. You might not understand everything at this point, but you should get a feel for the process of writing, compiling, and running a real C program.

A Brief History of the C Language

You might be wondering about the origin of the C language and where it got its name. C was created by Dennis Ritchie at the Bell Telephone Laboratories in 1972. The language wasn’t created for the fun of it, but for a specific purpose: to design the UNIX operating system (which is used on many computers). From the beginning, C was intended to be useful–to allow busy programmers to get things done.

Software For C Compiler

For compiling the source code of c/c++ you must have compiler, there are many compiler such as DEV C++, QT3, Visual C++, Tiny C Compiler, Miracle C Compiler, Borland C++.
  1. DOWNLOAD DEV C++
  2. DOWNLOAD QT3
  3. DOWNLOAD VISUAL C++
  4. DOWNLOAD TINY C COMPILER
  5. DOWNLOAD MIRACLE C COMPILER
  6. DOWNLOAD BORLAND C++

Keywords Of C Language

The words int and float are C keywords. C keywords are the words that form the language. All C keywords are in lowercase. The C language keywords are
auto     -  double  - inline   - static
 break    -  else    - int      - struct
 case     -  enum    - long     - switch
 char     -  extern  - register - typedef
 complex  -  float   - restrict - union
 const    -  for     - return   - unsigned
 continue -  goto    - short    - void
 default  -  if      - signed   - volatile
 do       -  sizeof  - while    - imaginary
Keywords cannot be used for any other purpose in a C program, that is, they may not be used as variable names or function names

Sabtu, 16 Januari 2010

membuat alert menggunakan j2me



heheh
abis posting tentang java script untuk memvalidasi, saya ingin menshar tentang bagaimana membuat alert untuk j2me tepatnya kali ini midlet wkwkwk
nah gak pakai basa =basi saya langsung tuliskan saja source codenya

Sabtu, 09 Januari 2010

Menu Search Box dengan Jquery

buat search box ?
kayaknya kalo biasa2 aja jelek deh tapi gak gitu juga sih
nah aku punya script sederhana ni buat bikin search box agak bagus dikit
pertama2
download jquery plugins di sini
nah setlah itu buat file html
dah tuliskan kode berikut :

Tampilkan deret bilangan prima menggunakan java

deret Bilangan prima Ehmmm
hmmm
kali ini saya akan menjelaskan bagaimana cara menghitung bil prima menggunakan java
nah pertama. Kita harus mengerti bagaimana bilangan prima itu
biilangan prima adalah bilangan yang hanya dapat dibagi bilangan itu sendri dan bilangan 1
tetapi 2,3,5,7 merupakan bilangan prima
oleh karena itu
logikanya n % 2 != 0 && n % 3 != 0 dst.. sampai 9 trus  || n == 2 || n == 3 || n == 5 || n ==7
naah pertama2

membuat segitiga siku-siku menggunakan java

nah bagi kawand2
yang mendapat tugas untuk membuat segitiga siku2 menggunakan metode pengulangan perhatikan dan pahamin sintx berikut ini ya :


membuat segitiga menggunakan java

hi kawand2 kali ini saya membuat program pengulangan menggunakan java dengan function while
dan menghasilkan output sepertibelahketupat
nah untuk source codenya lihat dibawah ini


membuat kalender dengan java script

hmm mau buat kalender
aku punya nih sytac sederhana membuat kalender
hehehe
lihat di bawah ini ya :

Program database sederhana menggunakan C

hi, hmm beberapa kali saya menulis artikel tentang java nah kali ini saya akan menulis tentang c
mungkin masih sederhana sekali di banding senior2 heheheh
nih source codenya

Jumat, 08 Januari 2010

FrameCursorApplet

Applet kali ini saya akan mebuat suatu frame applte dan juga button serta function2 butto tersebut
source code :

Membuat menu counter dengan php

hmm menu counter
yha bisanya diapaki untuk mengetahui seberapa banyak orang yang telah mengunjungi web anda
kali ini saya akn membuat counter sederhana

Buat file word menggunakan java

hi, kali ini saya akan membuat program agar dapat membuat suatu laporan sederhana menggunakan java
pertama2

Kamis, 07 Januari 2010

Applet Dasar

Humm mau poring apllet nih
tp sory kalo cuma dasar banget
bisa aku masih cupu sih heheheheheh

Logika Tahun Kabisat

Tahun Kabisat (Bahasa Inggris: Leap Year) adalah sebuah Tahun Syamsiah di mana pada tahun tersebut jumlah hari tidak terdiri dari 365 hari tetapi 366 hari.
Satu tahun syamsiah tidak secara persis terdiri dari 365 hari, tetapi 365 hari, 5 jam, 48 menit dan 45,1814 detik. Jika hal ini tidak dihiraukan, maka setiap empat tahun akan kekurangan hampir satu hari.
Maka untuk mengkompensasi hal ini setiap empat tahun sekali (tahun yang bisa dibagi empat), diberi satu hari ekstra: 29 Februari. Tetapi karena 5 jam, 48 menit dan 45,1814 detik kurang dari 6 jam, maka tahun-tahun yang bisa dibagi 100 (seperti tahun 1900), bukan tahun kabisat, kecuali bisa dibagi dengan 400 (seperti tahun 2000).
Terdapat algoritma mudah untuk menentukan apakah suatu tahun termasuk tahun kabisat atau bukan:
  1. Pertama, jika angka tahun itu habis dibagi 400, maka tahun itu sudah pasti tahun kabisat.
  2. Kedua, jika angka tahun itu tidak habis dibagi 400 tetapi habis dibagi 100, maka tahun itu sudah pasti bukan merupakan tahun kabisat.
  3. Ketiga, jika angka tahun itu tidak habis dibagi 400, tidak habis dibagi 100 akan tetapi habis dibagi 4, maka tahun itu merupakan tahun kabisat.
  4. Jika angka tahun tidak habis dibagi 400, tidak habis dibagi 100, dan tidak habis dibagi 4, maka tahun tersebut bukan merupakan tahun kabisat.
Nah dibawah ini akan saya buat Source code tahun Kabisat menggunakan java


Membuat Program Pascals Triangle berbasis GUI menggunakan JAVA

segitiga pascal mungkin bagi teman - teman banyak yang mendapatkan tugas membuat segitiga pascal. Bisanya tugas seperti ini diberikan untuk mengetahuin seberapa jauh pemahaman anda tentang pengulangan heheheh
Huhu pertama - tama saya akan membuat diagram alur pascal's triangle
nah seperti dibawah ini




Nah setelah itu Saya mencoba membuat program gui java ehhehehe yang mengoutput segitiga pascal ^_^
petama anda buat sebuah frame lalu design sampai seperti dibawah ini

Menampilkan deret Fibonacci dengan JAva

deretan bilangan yang mempunyai struktur bilangan a, b, a+b, a+b+b, (a+b) + (a+b+b), dst.
contoh: 1,1,2,3,5,dst. Nah oleh karena itu saya mecoba mebuat programnya menggunakan java ehhehehe

nah untuk source codenya anda dapat melihatnya dibawah ini

public class fibonanci {
    public static void main (String args[]){
        int aku = 1;
        int bukan = 1;
        int cicak = 6;

        System.out.print(aku + " ");
        while (bukan < cicak){// saat nilai bukan = 1 < cicak = 6
     System.out.print(aku + " ");//print out nilai aku
     aku = aku+bukan;
     bukan = aku-bukan;
        }
    }

}