Thursday 19 March 2015

Transistor labs: Electronic Gates

Forget about that silly litle thing. We do this begin with simple thing: "connect this and that".
We will try to build this:
1. Not gate
2. AND gates
3. OR gates
4. NAND gate
5. NOR gate

Di lab ini juga kamu akan mengetahui apa hubungan antara transistor dengan chip-chip IC dan ngapain kamu beli/nyari chip IC di toko Glodok elektronika sewaktu ingin membuat rangkaian elektronika.

Sebagai pemanasan kamu bisa menonton video berikut:


Oke?

Start:
1. A Not Gate
transistor not gate

Rangkaian not gate ini gampang dibuat. Cuma membutuhkan sebuah transistor. Letakkan out sebelum transistor atau dengan kata lain pada kaki collector dan amati out jika A diberi tegangan dan tidak diberi tegangan.

Letakkan a pada basis. Hubungkan kaki emitter pada ground.


2. An AND gate

2-input transistor and gate


Rangkaian AND gate ini gampang dibuat.



3. An OR gates
2-input transistor or gate

Yang paling rumit memang yang bagian tengah diagram. Tapi, kalau berhati-hati kita berhasil membuat rangkaian tersebut diatas breadboard kita.

1 lingkaran = 1 transistor. Jadi rangkaian terdiri dari 2 lingkaran, jadi jumlah transistor yang dibutuhkan = 2 transistor.

4. An XOR gate

exclusive-or gate equivalent

Can you define how many transistor we need to build just an XOR gate based on above?
Answer:
2 for the OR gate, 2 for the AND gate, 2 for the last NAND gate. So the total is 2+2+2 = 6 transistors.

Because its need many transistors or too complex to build, then our ancestor has think about this and introduce us to use an IC (integrated circuit); too fasten human to build such gate.

They produce IC since 1970s. Also, because they know that computers will need lots of this gates to build.


4. NAND gates
2-input transistor nand gate


Apa perbedaan dalam rangkaian AND gate dan NAND gate?
>> Simple, output dikeataskan (NAND) atau dikebawahkan (AND) atau dengan kata lain, output sebelum transistor (AND) atau sesudah transistor (NAND).

5. NOR gate
2-input transistor nor gate

Apa perbedaan dalam rangkaian OR gate dan NOR gate?
>> Simple, output dikeataskan atau dikebawahkan.


Kesimpulan :
1. Gate-gate yang tersedia and, not, or, xor, nand, nor, x-nor.
2. Untuk mengimplementasi gerbang logika juga dapat menggunakan/membeli chip IC.
3. Untuk membuat gerbang logika juga bisa dengan menggunakan switch/saklar.

Next:
1. Bagaimana membuat computer yang bisa menambah / mengaritmatika angka / number?
2. Bagaimana kalau kita membuat permainan berdasarkan transistor?

QUIZ

1. Coba hitung ada berapa gate di dalam IC kita dibawah ini; IC ini bernama/bermerek dagang: "7408 Quad 2-input AND-Gate":

7408 Quad 2-input AND Gate

:

7408 logic and gate

Yup, jawabannya 4 buah gate berjenis AND. Yup lagi, jika kamu membeli IC ini di toko elektronik apek-apek cina kamu bisa membuat 4 buah gerbang and dengan hanya 1 buah IC ini. Dibandingkan jika menggunakan


2. Coba hitung ada berapa gate OR di dalam chip IC ini; IC ini bernama/bermerek dagang: "7432 Quad 2-Input Logic OR  gate"

7432 logic or gate

Yup sama, chip ini terdapat empat gate OR.


3. Coba hutung ada berapa gate NOR di dalam IC ini; IC ini bernama/bermerek dagang: "

7402 logic nor gate
Yup, sama chip ini terdapat empat gate NOR.


Wednesday 18 March 2015

Electronics: Measurement

1. How to calculate the voltage accross
Principe: To calculate the voltage, the multimeter must be in paralel to what it want to measure.

2. How to calculate the current through an
Principle: To calculate the current, the multimeter must be in serial to what it want to measure.


In assembly, everything is just direct access
instructions and the port table, with the words found there anything can be constructed, all in the datasheet of the processor
How the timer is started (is writing "Timer.Start(8)" somehow easier to understand than "LDI R16,0x02" and OUT TCCRO, R16")
how the timer restarted at zero ("CLR R16" and "OUT TCCR0, R16")

Four basic programs are necessary for assembly programming. These tools are:
1. The editor: Windows notepad. Tips change to Courier.
All you have to do is open a notepad, type, and save 
2. The assembler program, program that reads the text file and produces some kind of output files is calles assembler. NASM
3. The chip programming interface
4. The simulator:

The structure of an assembler program.
1. Comments.
A comments start with a semi-colon.
Put comments around all parts of the program, be it complete subroutine or a table.
2. header informations
3. code at program start, and
4. general structure of programs


The purpose of this tutorial is: How to read two user input and add it and print it to the display.

The main program always start with initialization of the stack pointer, setting registers to default values, and the init of the hardware components used.

PORTS
Ports have a fixed address

Tuesday 17 March 2015

Kernels are just a code.

Learn variety of interupt and registers.

Directive, instruction, labels

Function (this just an excerpt)
1. Register set
1.1 Register set to a constant
1.2 Register set to 0
1.3 Register set to 255

2. Copy
2.1 Copy register to register
2.2 Copy SRAM to register, directly
2.3 SRAM register
2.4 SRAM to register and INC
2.5 DEC, SRAM to register
2.6 SRAM, displaced to register
2.7 Port to Register
2.8 Stack to register
2.9 etc...

3. Add
3.1 Add 8 bit + 1
3.2 Add 8 bit, for example: add r1, r2
3.3 8 bit + carry
3.4 etc...

4. Substract
4.1 8 bit -1, for example: DEC r1
4.2 8 bit, for example: SUB r1, r2
4.3 8 bit, constant, SUBI rh, c255
4.4 etc

5 Shift
5.1 Shift logic left
5.2 Shift logic right

6. Binary
6.1 Binary And, for example: AND r1, r2
6.2 Binary Or, for example OR r1, r2
6.3 Binary Exclusive-OR, for example: EOR r1, r2
6.4 Ones-complement, for example: COM r1
6.5 Twos-complement: NEG r1

7. Bits change
7.1 Register, set
7.2 Register, clear

8. Status bit set
8.1 Zero flag
8.2 Carry flag
8.3 Negative flag

9. Status bit clear
9.1 Zero f

10. Compare
10.1 Compare register to register, for example: CP r1, r2
10.2 Register, Register + carry, for example: CPC r1, r2

11. Immediate jump
11.1 Relative
11.2

12. Conditional jump
12. Jump if status bit set
12.2 Jump if status bit clear, for example: BRBC b7, c127
12.3 Jump if equal, for example: BREQ c127

13. Conditioned jump
13.1 Register bit = 0, for example: SBRC r1, b7

14. Others
14.1 NOP = no operation
14.2 Sleep = Sleep
14.3 Watchdog reset = WDR




Pseudocode to solve total resistance count function

For instance:
R1, (R2 // R3)

1. Solve the paralel first with formula:
1/Rt = (R2 x R3) / (R3 + R3)
2. Find Rt = 1/...
3. And then add to R1
4. End
 
1. First law: inertia
Sebuah bola kasti yang dilemparkan secara garis lurus di atmosfir bumi / di luar angkasa ke arah matahari, akan terus bergerak dengan kecepatan konstan jika tidak ada force yang mengungguli / force yang melebih force yang melempar bola kasti tersebut.

A moving object will continue moving in a straight line at a constant speed, and a stationery object will remain at rest, unless acted upon by an unbalanced force.

2. Second law: the "F=m x a"
The acceleration produced by a force on an object is proportional to the magnitude of the force, and inversely proportional to the mass of the object.

3. Third law: For every action there is an equal and opposite reaction.
 


Properti fisika

Mass/Thing/Benda
- Center of mass
- Dimension of the mass
- Berat jenis of the mass
- Volume of the mass
- Kelenturan of the mass
- Berat of the mass


Water(air)
- freezing point

Science

Pada mulanya manusia hanya mengenal penggaris dan jam pasir.

Kemudian manusia curios, dia menjatuhkan sebuah benda dari ketinggian:
jika h = 10m, maka t = 10 detik
h = 10 ->  t = 10 detik
h = 5 m -> t = bukan 10/2

manusia kira bahwa waktu akan menjadi setengah dari waktu ketika ketinggian 10 meter ternyata tidak, manusia terkejut. Mereka berfikir kecepatan akan konstan ternyata tidak. Ternyata ada suatu variabel yang mereka belum pahami saat itu.

Monday 16 March 2015

OS Dev

1. Download BOSCH bosch.sourceforge.net
2. Download virtual floppy drive pada vfd.sourceforge.net
3. Download NASM pada www.nasm.us

1. Install BOSCH.
2. Copy ZIP files ke folder OS Dev kamu.
3. Install NASM .
4. Copy nasm.exe dan nasmpath.exe ke folder OS Dev kamu.

5. Tulis kedalam notepad boschsrc simpan ke folder programfiles BOSCH kamu. Kalau punya saya ada di: 
C:\Program Files (x86)\Bochs-2.6.5



Operating system is a bundle of software which let the user interact with hardware.

Sunday 15 March 2015

Pseudocode of server scripting

Actor:
1. Google chrome web browser
2. An humble txt file
3. My own building IDE


Pseudocode
1. User klik a button in our http://something.html
2. Browser write "hello" to a file
3. IDE read that file (looply, every 1ms)
4. IDE read that file
5. IDE write "hello too.."
6. Web browser print that file to its browser

Explain the pseudocode
1. User klik a button
Build a webpage with 1 input button and 1 input text.

Jumlah, jumlah, jumlah

Jumlah alfabet 26
Jumlah warna dasar 12
Jumlah not musik standard adalah 12
Jumlah bulan adalah 12
Jumlah bit 1 karakter adalah 8 bit.

Yang mana Width yang mana Height

PENGERTIAN

Height (H) adalah tinggi; yang keatas dan kebawah / vertikal.
Weight (VV) adalah lebar; yang ke kiridan ke kanan / horizontal.

NOTASI

Notasi width dan height biasanya ditulis: width x height.
Contoh:
800x600 --> 800 pixel ke kanan, 600 pixel keatas, dengan total jumlah pixel 480000 pixel.

Jadi, melebar dulu baru memanjang. Kebalikan dari Biologi tubuh manusia; memanjang dulu baru melebar; pertumbuhan primer dulu baru pertumbuhan sekunder.

RASIO (RATIO)

Rasio atau perbandingan antara width dan height atau width / height adalah:
Normal screen aspect ratio = 4/3
Wide screen aspect ratio = 16 x 9 dan 16 x 10



Assembly
1. Access all the functions/registers of ATMega328
2. Working with the program counter and the stack
3. No predefined data types
4. working directly with address or pointers

Directive:
1. Define global variables
2. Create data
3. Specify address
4. Determine what header files tobe included
Contoh:
.set untuk mendefenisikan variabel.
.equ untuk constants.

Symbols: names for values or addresses

Syntax specific addressing modes

Numerical values:
1.Decimal
2. Biner
3. Hex

Comments

Assembly code forms
Everyline of code should be one of the following
1. [label:] directive [operands] [comment]
2. [label:] instruction [operands] [Comment]
3. comment
4. Empty line

OPERANDS
1. can be a labels
2. variables defined by the .set directive
3. constants defined by the .equ directive
4. integer constants:
- Decimal: 10, 255
- Hex : 0x0a, or $0a
- Binary : 0b00001010
5. Program counter (PC)

Saturday 14 March 2015

MML (Music Macro Language)

1. Tone
Tone antara lain : C, D, E, F, G, A, B
Contoh:
C untuk do
D untuk re
E untuk mi
F untuk fa
G untuk sol
A untuk la
B untuk si

2. Semitone (Kres atau mol)
C+ untuk C kres
D+ untuk D kres
E+ untuk E kres


3.  Durasi atau length
Macam-macam durasi yang digunakan dalam MML antara lain: 1/1, 1/2, 1/4, 1/16, 1/32. 1/64
Contoh:
C4 berarti nada C 1/4 ketuk
C2 berarti nada C 1/2 atau "setengah" ketuk
C1 berarti nada C 1/1 atau "1 ketuk"

4. Oktaf
Oktaf standard oktaf ke-4.

Simple Assembly

mov ax, 1234 ; store the decimal number 1234 in ax
mov cx, 0x234 ; store the hex number 0x234 in cx
mov dx, 't' ; store the ASCII code for letter 't' in dx
mov bx, ax ; copy the value of ax into bx, so now bx == 1234


Komponen microsoft excel

Apa saja komponen microsoft excel?
1. Worksheet
2. Sheet
3. Cell

Bagaimana mereferensikan suatu worksheet dari worksheet lain?

Mysql Tutorial3: Use

1. Kamu bisa gunakan MySQL sebagai database bagi aplikasi yang berbasis web contoh: kamu bisa menggunakan MySQL sebagai database backend bagi PHP.

2. Kamu bisa gunakan MySQL sebagai backend dari Microsoft Office. Contoh: kamu bisa mengkoneksikan MySQL dengan microsoft office excel serta access. Tapi kamu harus menginstal software connector dulu ke dalam PC.


Kenapa memilih phpMyAdmin dalam mengelola database MySQL?



MySQL Intermezzo

Verb in MySQL
1. View (melihat) data, keyword select
2. Insert (memasukkan / menyisipkan) data, keyword insert
3. Updating (memperbaharui / memodifikasi) data, keyword update
4. Delete (menghapus) data, keyword: delete
5. Search (mencari) data, keyword: select
6. Advance searching, keyword: select
7. Count (menghitung jumlah) data, keyword select count(*)

Total keyword that used in verb of MySQL: select, insert, update, delete, select count(*) = 5 keywords.

Pada database
1. Create (membuat) database, keyword: create
2. Menggunakan database, keyword: use

Pada tabel
1. Create (membuat) tabel, keyword: create
2.
3. Describe (menjelaskan) apa saja parameter-parameter dari suatu tabel, keyword:

Think sebuah database, kemudian:
What -  nilai apa yang kita mau cari.
How - bagaimana kita dapat mendapatkannya.
Why  - Untuk apa kita mencarinya / kenapa kita mencarinya?

Friday 13 March 2015

Mysql Tutorial2: Configuration

mysql> create database transaksipulsadb;
mysql> use transaksipulsadb;
mysql> create table table_akumulasitransaksi(id int(11) unsigned auto_increment primary key not null,nmr varchar(12) not null, pulsa int(255) not null, Status varchar(5) not null);
mysql> describe table_akumulasitransaksi;
mysql> insert into table_akumulasitransaksi(nmr, pulsa, status) value('081378269338',5,Lunas);



Mysql Tutorial2: Installation


Mysql Tutorial1: Installation

Instalasi noninstaller atau dengan kata lain instalasi MySQL menggunakan zip files.

1. Download MySQL zip files from ....
2. Extract zip file ke salah satu folder windows kamu.
Contoh punya gue: D:/mysql
3. Open sebuah jendela commandprompt secara Administrator ketik: set
4. Dengan jendela commandprompt yang sama ketik: mysqld --instal
5. Dengan jendela commandprompt yang sama ketik: mysqld --console
Untuk creating sebuah local server.
6. Open sebuah jendela commandpromt secara Administrator, ketik: mysql.exe -u root -p
Untuk menjalankan/start mysql dengan akses root.



Thursday 12 March 2015

Projek membangun sebuah OS

Bagaimana kalau kita membangun sebuah OS?

Simulatornya di VMWare Player.

Start time: 14/03/2015 14:53

1st: reading the table of content of the tutorial
2nd: Printing the tutorial

Wednesday 11 March 2015


Menggunakan Cam Studio

1. Download versi terbaru Cam Studio

2. Download converter AVI ke MPEG; converter dari AVI ke tipe file lain.
Manuscript:
1. Siti came in from the left kearah (toward) tengah (center)
2. Tino came in from the left to the center after Siti arrive at center
3. After Tino arive next to Siti, Siti talks to Tino
Siti: "You know Tino there is no water in desert"
Tino: "Yes, I know it"
Siti: "So lets walk again"
Tini: "Lets go"
4. Siti walks to the end of along with Tino.


1. Pilih backdrop (background) that available in Scratch library.
Contoh: Desert

2. Pilih back sound / music (jika kamu membutuhkan)
Contoh: Tidak ada

3. Pilih Sprite kamu.
Contoh: Cat

4. Tentukan titik lokasi pertama sprite kamu
Contoh: x:0 y:0

5. Mulai programming.


Tuesday 10 March 2015

Tujuan utama dari tabel periodik adalah untuk memprediksi sifat kimia dari suatu unsur.

Apa saja sifat kimia?
1. Mudah terbakar apa tidak?
2. Mudah busuk apa tidak?
3. Berkarat apa tidak?
4. Mudah meledak apa tidak?
5. Beracun apa tidak?


Javascript - Function

1. Mempermudah / meringkas penulisan program
2. Bisa menciptakan fungsi reusable. Fungsi reusable adalah fungsi menggunakan fungsi lain.

Komponen
- Nama
- Argumen/parameter
- return
Fungsi harus mempunyai return.


Contoh:
function countapples(bobapples, johnapples)
{
return bobapples+johnapples
}

Contoh reusable:
function avg(a, b)
{
return (countapples(a,b) / 2)
}

Javascript - Collection

Collection adalah koleksi dari properti-properti.

Misalnya seorang pengusaha kos-kosan yang mempunyai beberapa bangunan kos.
Kos1 = {alamat: "Jl. Adisucipto No. 38", jlhkmr: 8}
Kos2 = {alamat: "Jl. H. Subrantas No. 47", jlhkmr: 3}

Misal seorang poligami yang mempunyai istri lebih dari satu
istri1 = {nama: "siti", umur:32, anak:2}
istri2 = {nama: "rini", umur:32, anak:1}

Misal kamu punya banyak properti (tanah atau rumah):
Properti1 = {jenis:"rumah", lokasi:"Jl. Muaratakus nomor 38", Harga_beli=47000000, status: "IMB"}
Properti2 = {jenis:"tanah", lokasi: "Jl. Mataram No. 48", Harga_beli = 177000000, status: "IMB"}
Properti3 = {jenis: "tanah", lokasi: "Jl. Teropong No. 31", Harga_beli = 148000000, status: "IMB"}

Monday 9 March 2015

FTP

Penjelasan singkat tentang FTP

FTP is a transfer protocol designed to aid in the moving of files from one location to another over a network.

FTPs are widely used to access the contents of webservers, and many enthusiast groups will create FTP servers as a way to share files between members.

While you can connect to an FTP server using your browser, you will find a lot more functionality if you use a dedicated FTP client.

Tools:

1. 1 Buah FTP client.
Misal: FileZilla, SmartFTP (https://www.smartftp.com/download)

Data/Informasi yang dibutuhkan untuk melakukan koneksi FTP:

1. Alamat IP server FTP atau nama domain server FTP yang anda tuju.
2. Username dan password yang legal.
3. Alamat Port: port 21.

Sunday 8 March 2015

Halo, video singkat ini akan membahas  Digitalread serial.

Komponen yang digunakan:
1. 3 buah kabel jumper (Red, black and white) sebagai jumper ke breadboard
2. 1 buah resistor 1 Kohm sebagai resitor pull-down
3. dan, 1 buah switch tactile sebagai
4. Arduino sketch software tempat untuk memasukkan program

Yang pertama kita lakukan adalah:
1. Membuka software sketch arduino
2. Klik file, examples, basic, digital read seria
3. Kemudian upload program ke board arduinonya
4. Kemudian klik serial monitor untuk membaca


Yang perlu kita perhatikan:
1.





Saturday 7 March 2015

Algorithm to make Raspberry PI

1. Berapa pin gpio yang kamu butuhkan untuk menyalakan rangkaian?
2. Berapa pin gpio dari poin 1 diatas yang kamu jadikan mode input?
3. Berapa pin gpio dari poin 1 diatas yang akan kamu jadikan mode output?



1. Mengimport library atau mengimpor modul
2.


#!/usr/bin/python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.cleanup()
GPIO.setwarnings(False)
GPIO.setup(17,GPIO.out)
GPIO.setup(27,GPIO.out)
print "Lights On"
GPIO.output(17, GPIO.HIGH)
GPIO.output(27, GPIO.HIGH)



Friday 6 March 2015

algorithm to design a logo

1. Determine the text.
Contoh: kedai kopi yuli.

2. Choose the color of your text

3. Draw your text

3. Determine your main word
For instances:
grocery, bakery, goods delivery, cleaning service, etc.

4. Choose a symbol to present the main word

5. Draw your logo behind your text

4. Determine your word (adjective word):
For instances:
1. Forever; loop; continuous
2. Pure
3. Saint;
4. Happines
5. Courage
6. Strength
7. Fellow
8. Instant / flash
9. All over the world


5. Choose a symbol to perform your adjective word
For instances
1. An omega symbol is for forever or loop or continuous symbol.
2. A crystal for
#!usr/bin/python --> to show where the python interpreter resides.



Rasp PI very basic and usefull commands


1. You want to view a file?


1. You want to back up a file?
backup file is basically copy-ing a file.

Tuesday 3 March 2015

Raspberry GPIO

Untuk menghubungkan projek Raspberry Pi kamu dengan dunia luar, kamu perlu belajar:
1. Pengenalan Python
2. GPIO
3. Cara mengimport
4. Komponen elektronika yang akan kamu pasang, contoh: LED, 7 segment display, Sensors: Windspeed sensor, heat sensor (built-in), etc.


Pin GPIO:
3
5
7
8
10
11
12
13
15
16
17
18
19
21
22
23
24
26

Pin Ground
6
9
14
20
25

Pin 5 Volt
2
4

Pin 3.3 Volt
1
17

Pin GPIO bisa berfungsi sebagai
1. Input

Tidak bisa sekedar menghubungkan pin 3 ---> switch ---> ground. Karena akan float.


2. Output

Pin 3 --> LED ---> Resistor ---> Ground / pin 6



GPIO layout



Steps:
In python script
1. Import GPIO module
2. Set the board mode to that of your preference
3. Set up the pins you want to use, and
4. Turn them on
Contoh:
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)  # set board mode to Broadcom

GPIO.setup(17, GPIO.OUT)  # set up pin 17
GPIO.setup(18, GPIO.OUT)  # set up pin 18

GPIO.output(17, 1)  # turn on pin 17
GPIO.output(18, 1)  # turn on pin 18
1. Ballon Pi-Tay Popper
How to use Python code to control the Pi's GPIO pins to heat up a resistor to pop a ballon.

2. Minecraft-whac-a-block-game alias Making a game with minecraft


3. Drawing snowflakes


4. 

Monday 2 March 2015

What is pass by value and pass by reference? it is a method to pass a value to a function that is by value or by reference.

Pass by value :
1. copied
2. menghabiskan memori.


Pass by refernce:
1. not copied
2. tidak menghabiskan memori
3. It just referenced by memory address.

Langkah membentuk/menciptakan fungsi:
1. Tentukan nama fungsi.
2. Tentukan parameter/argumen apa saja yang akan diambil fungsi; di dalam tanda kurung.
3. Tentukan proses apa saja yang akan dilakukan fungsi.
4. Tentukan apa yang dikembalikan atau di-return fungsi ini.

Contoh:
#include <stdio.h>
#include <conio.h>

void display(int, int);

int main()
{
int x, y;
x = 10;
y = 20;
printf("x is %d and y is %d\n",x,y);

display(x,y);

getch();
return 0;
}

void display(int a, int b)
{
printf("a is %d and b is %d\n",a,b);
}


Langkah membentuk/menciptakan fungsi:
1. Tentukan nama fungsi.
2. Tentukan parameter/argumen apa saja yang akan diambil fungsi; di dalam tanda kurung.
3. Tentukan proses apa saja yang akan dilakukan fungsi.
4. Tentukan apa yang dikembalikan atau di-return fungsi ini.

1. Tentukan nama fungsi:
display

2. Tentukan parameter/argumen apa saja yang akan diambil fungsi; di dalam tanda kurung.
int a dan int b.

3. Tentukan proses apa saja yang akan dilakukan fungsi:
printf("x is %d and y is %d\n",x,y);

4. Tentukan apa yang dikembalikan atau di-return fungsi ini:
Tidak ada return.

Studi tentang Pointer di bahasa pemrograman C

Pointer hanya untuk memunculkan alamat memori dari suatu variabel. 

1. Asteriks dari suatu alamat memori memunculkan nilai yang terkandung di dalam alamat memori yang diassign itu.
1. Asteriks dari suatu variabel adalah nilai yang terkandung di dalamnya.
2. Ampersand dari suatu variabel adalah nilai alamat memori pengandung nilai dari variabel itu.
3.

Langkah-langkah:
1. Deklarasikan x
int x;
2. Beri nilai ke dalam x
x = 10;
3. Deklarasikan pointer j
int *j;
4. Berikan nilai ke dalam p (hanya berikan nilai variabel)
j = &x;
5. Tampilkan nilai j
6. tampilan *j
7. tampilkan alamat memori variabel j


#include 
int main() 

 int x = 10; 
 int *j; 
 j = &x; 

 printf("The value of x is %d\n",x); 
 printf("The address of x is i.e &x is %p\n",&x); 
 printf("The value of x is i.e *(&x) %d\n\n",*(&x)); 

 printf("The memory address stored in the pointer j is %p\n",j); 
 printf("The value pointed by the pointer j is %d\n",*j); 
 printf("The address of pointer j is %p",&j); 
 getch(); 
 return 0; 
}

D:\God Bless Me Learn C\pointer>pointer2.exe
The value of x is 10
The address of x is i.e &x is 0028FF0C
The value of x is i.e *(&x) 10

The memory address stored in the pointer j is 0028FF0C
The value pointed by the pointer j is 10
The address of pointer j is 0028FF08



Pointer to pointer
Pointer to pointer is a variable that gonna contain the address of another variabel.



nknk

Sunday 1 March 2015

Studi tentang tahun

Kaisar Romawi memerintahkan seorang Astronomer untuk
http://www.kidnesia.com/Kidnesia2014/Dari-Nesi/Sekitar-Kita/Pengetahuan-Umum/Tahun-Kabisat

Saturday 28 February 2015

Studi tentang Batch Scripting di Sistem Operasi Windows

Digunakan untuk menjalankan perintah command prompt (cmd) windows dengan sangat mudah dan lancar.

0. Mendeklarasikan variabel
@echo off
set name=peter

1. Memanggil suatu variabel
echo %name%

2. Mengambil user input
Mengambil user input dan meletakkannya pada suatu variabel, dengan SET /P dan SET /A.

Contoh:

1. Mempermudah ping sebuah alamat  IP yang mau di PING:
@echo off
set /p alamatIP=Masukkan alamat IP yang hendak di ping:
ping %alamatIP%

INGAT:
No space diantara tanda sama dengan ('=').

Contoh SET /A:


3. String Processing
Mengolah string.


4. Kondisi / Kondisional execution.
Mengeksekusi sebuah blok kode atau sebuah pernyataan dengan suatu atau beberapa syarat.

"IF I can FLY, I go to you, IF not, I am not go to you"

Coba paste game dibawah ini ke notepad, save dengan nama gametebaknama.bat.
Jika nama yang kamu masukkan/inputkan benar, maka kamu tepat. Jika salah, maka kamu tidak tepat.

@echo off

echo Permainan menebak nama
echo ======================
set /p name=Sila masukkan nama:
if %name%==peter echo Match
if not %name%==peter echo do not match


Atau contoh yang asik satu lagi nih dibawah sini:


@echo off
echo MENU HARI INI
echo =============
echo 1. Nasi goreng tempe perkedel
echo 2. Nasi goreng ayam
echo 3. Nasi goreng sambel
set /p pilihan=Silahkan masukkan pilihanmu :
if %pilihan%==1 echo harga yang kamu bayar Rp. 2000
if %pilihan%==2 echo harga yang kamu bayar Rp. 3000
if %pilihan%==3 echo harga yang kamu bayar Rp. 1000

5. Loop 
Loop : Perform a command several times.

Loop ada dua: loop forever (selamanya) atau loop tertentu.
Loop selamanya itu begini:


@echo off
:up
echo =============
echo MENU HARI INI
echo =============
echo 1. Nasi goreng tempe perkedel
echo 2. Nasi goreng ayam
echo 3. Nasi goreng sambel
set /p pilihan=Silahkan masukkan pilihanmu :
if %pilihan%==1 echo harga yang kamu bayar 2000
if %pilihan%==2 echo harga yang kamu bayar 3000
if %pilihan%==3 echo harga yang kamu bayar 1000
goto up:

6. Function
Function: How to package a block of code.


Friday 27 February 2015

Perhitungan-perhitungan Elektronika

1. Perhitungan biaya total pemakaian listrik

Langkah:
1. Cari besar Watt obyek listrik
2. Tentukan berapa lama obyek itu hidup selama sebulan
3. Dibagi seribu
4. Dikalikan Angka Rp dari ketentuan tarif dasar listrik PLN.


Contoh:
Sebuah rumah memasang 5 lampu 20 watt dan menyala 12 jam sehari. Dua lampu 60 watt dan menyala 5 jam sehari. Sebuah kulkas 125 watt dan menyala 24 jam sehari. Sebuah Pesawat TV 200 watt dan menyala 6 jam sehari. Sebuah setrika listrik 250 watt dan dipakai 2 jam sehari.

Jika tarif listrik adalah Rp. 750/kwh, perkirakan biaya listrik rumah tersebut dalam satu hari dan satu bulan.

Jawaban (1 jam =  1h; w adalah singkatan dari watt):
5 lampu 20 watt = 5 x 20 watt = 100 watt x 12 jam = 1200 wh * 750 / kwh =
2 lampu 60 watt = 2 x 60 watt = 120; 120 watt x 5 jam = 600 wattjam; 600wattjam * 750 / kwh =
1 kulkas 125 watt = 1 x 125 watt = 125 watt; 125 watt x
1 pesawat TV 200 watt = 1 x 200 watt = 200 watt x 6 jam = 1200 wattjam; 1200 wattjam *


2. Sebuah laptop VAIO tertulis menggunakan 10.5V dan 3.8A. Tentukan berapa daya (Watt) laptop?
P = V. I^2
P = 10.5 * 3.8^2
P = 151.62 Watt atau setara 152 Watt

Berapakah biaya dipakai untuk menyalakan laptop ini selama 10 jam?
Total Watt selama 10 jam = 152 Watt * 10 jam = 1520 WattHour
Biaya yang dikeluarkan = 1520 WattHour * Rp. 750 / Kwh = 1.52

3. Sebuah setrika merek Melati menyala dengan


4. Sebuah Wireless Access point tertulis di label menggunakan

Pengenalan ARDUINO

1. PENGENALAN PIN-PIN
1. POWER PIN
2. DIGITAL PIN
3. ANALOG PIN
4. GROUND PIN



Digital pin bisa digunakan untuk mengeluarkan sinyal menggunakan procedure bahasa pemrograman digitalwrite()dan bisa digunakan untuk membaca sinyal menggunakan procedure digitalread().

Digitalwrite terdiri atas HIGH dan LOW. Sinyal HIGH itu sama dengan 5volt, sinyal LOW 0v.

Digitalread() atau baca bisa digunakan untuk membaca atau menyelidiki apakah sinyal sedang HIGH atau LOW.

Tetapi terlebih dahulu mode pin harus disetting ke mode digital dulu.

Pin digital antara lain pin 0 - 13 atau pin berwarna hijau di gambar diatas.


Pin analog

Pin analog bisa digunakan juga untuk read dan write, menggunakan nama procedure yang sedikit berbeda dekat pin digital yaitu analogread() dan analogwrite().

Tapi sebelum bisa menggunakan pin analog untuk membaca atau menulis, pin analog harus disetting atau dideklarasi modenya sebagai mode baca atau tulis.



Thursday 26 February 2015

TCP socket programming basic

- Server:
1. Create a socket with the socket()
2. Bind the socket to an address using the bind( )
3. Listen for connections with the listen()
4. Accept a connection with the accept
5. Send and receive data, use the read() and write() system calls

-Client:
1. Create a socket with the socket()
2. Connect the socket to the address of the server using the connect() system call.
3. Send and receive data, use the read() and write() system calls.

 

System Administration

Since a computer consist of harddisk, memory, processor, and network card then the task of system administration are:
1. Check the current space (hard disk)
2. Check harddisk label
3. Check average memory usage (memory)
4. Check average processor usage (processor)
5. And so on

Environment Variables

1. They usually referenced by putting special symbols in front of or around the variable name.
For instance, to display the user home directory, the user has to type:
Echo %HOMEDRIVE%

The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window. 
 
2. Drag and drop files to command-line editor.



Survey

Hal-hal survey tanah:
1. Harga jual (Rp.)
2. Luas tanah (meter persegi)
3. Ketersediaan akses (ada / tidak adanya jalan)
4. Jarak lokasi tanah dari pusat perbelanjaan.

Hal-hal survey barang belian
1. Merek yang tersedia untuk jenis barang yang akan dibeli.
2. Jumlah toko yang akan dibandingkan harganya.
3.

Survey operator telepon seluler:
1. Biaya menelepon antar operator per menit.
2. Biaya telepon dengan operator yang sama.
3. Masa pemakaian kartu / masa berlaku kartu
4. Bonus / discount yang ditawarkan

Tumbuh-tumbuhan

Jika aku sebut tumbuhan-tumbuhan adalah living machine / mesin yang hidup, bolehkan?