Friday, October 23, 2015

Database Design Chapter 1 Introduction (Praktek Perancangan Basisdata) + Video

Database Design Chapter 1 Introduction (Praktek Perancangan Basisdata) + Video  

Just check out this video :




ShadowOfBdg© - All rights reserved. 

The Very Simple Delphi Chat Client & Server Program + Video Tutorial

The Very Simple Delphi Chat Client & Server Program + Video Tutorial


This is the very simple example of chat program using TCP.

Form Design of TCP Chat Client:



Form Design of TCP Chat Server:




You can see the source code and output here (TCP Chat Client) :


Source code & output of TCP Chat Server :



The interaction between TCP Chat Client & TCP Chat Server:



ShadowOfBdg© - All rights reserved. 

Thursday, October 22, 2015

How to Use Class using PHP Programming Language + Video Tutorial

How to Use Class using PHP Programming Language

This is the simplest way to convert from class diagram to PHP program.

Class Diagram:

Student
StudentNo: String
Name: String
Address: String
setStudentNo()
getStudentNo()
setName()
getName()
setAddress()
getAddress()


PHP program:

<?php
//create class Student with 3 attributes and the operations to manage them
class Student{
var $StudentNo;
var $Name;
var $Address;

//the operation to set the StudentNo attribute
function setStudentNo($newStudentNo){
$this->StudentNo = $newStudentNo;
}

//the operation to get the value of StudentNo
function getStudentNo(){
return $this->StudentNo;
}

//the operation to set Name
function setName($newName){
$this->Name = $newName;
}

//the operation to get student name
function getName(){
return $this->Name;
}

//the operation to set address
function setAddress($newAddress){
$this->Address = $newAddress;
}

//the operation to get the address
function getAddress(){
return $this->Address;
}
}

//implemented the student class
$James = new Student(); //create the Student object 
//set the attributes values of object James
$James->setStudentNo("007");
$James->setName("James Bono");
$James->setAddress("Sumedang");

//display data to the screen
echo "Student No : "; echo $James->getStudentNo();
echo "<br>";
echo "Name : "; echo $James->getName();
echo "<br>";
echo "Address : "; echo $James->getAddress();
?>

Output:



ShadowOfBdg© - All rights reserved. 

How to Use Procedure using Embarcadero/Borland Delphi Programming Language

How to Use Procedure using Embarcadero/Borland Delphi Programming Language 

Note:
Kalkulator sederhana dengan prosedur = simple calculator using procedure(s)
Nilai X = Value of X
Nilai Y = Value of Y
Hasil = Result


Form Design:


Properties:

Components
Properties
Value
Form1
Caption
Program 4 Prosedur

Width
284

Height
219
Label1
Caption
Kalkulator sederhana dengan prosedur
Label2
Caption
Nilai X
Label3
Caption
Nilai Y
Label4
Caption
Hasil
Edit1
Text
Kosongkan/clear
Edit2
Text
Kosongkan/clear
Edit3
Text
Kosongkan/clear
Button1
Caption
+
Button2
Caption
-
Button3
Caption
*
Button4
Caption
/

Delphi program:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Label4: TLabel;
    Edit3: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure tambah(x,y: integer);
    procedure kurang(x,y: integer);
    procedure kali(x,y: integer);
    procedure bagi(x,y: integer);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.tambah(x,y: integer);
begin
  Edit3.Text := IntToStr(x + y);
end;

procedure TForm1.kurang(x,y: integer);
begin
  Edit3.Text := IntToStr(x - y);
end;

procedure TForm1.kali(x,y: integer);
begin
  Edit3.Text := IntToStr(x * y);
end;

procedure TForm1.bagi(x,y: integer);
begin
  Edit3.Text := IntToStr(x div y);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  tambah(StrToInt(edit1.text), StrToInt(edit2.text));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  kurang(StrToInt(edit1.text), StrToInt(edit2.text));
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  kali(StrToInt(edit1.text), StrToInt(edit2.text));
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  bagi(StrToInt(edit1.text), StrToInt(edit2.text));
end;

end.

Output:




ShadowOfBdg© - All rights reserved.