Wednesday, 2 September 2015

php socket



1.
What is a sub procedure?

C.
A named block of code that you can call / execute by calling its name and expect NO return value
Struct sockaddr{
    unsigned short sa_family;
    char sa_data[14];
}

Struct sockaddr_in{
    short sin_family;
    unsigned short sin_port;//Port Number
    struct in_addr sin_addr;//IP address
    char sin_zero[8];
}

Struct in_addr{
    unsigned long s_addr;//4 byte
}
htons() host to network short
htonl() host to network long
inet_aton() ---> ascitobinary
inet_ntoa() ---> network to ascii
Comments: /* Comment */
Whitespace ignore
Data types = declaring types of variables, declaring types of functions. Basic types: integer and floating-point, Enumerated, Void = no value returned

Header mendefinisikan macro

Array = collection

Pointer = untuk memudahkan mengakses elemen-elemen dari sebuah array.

Tuesday, 1 September 2015

https://en.wikipedia.org/wiki/CARDboard_Illustrative_Aid_to_Computation
https://www.cs.drexel.edu/~bls96/museum/cardsim.html
https://en.wikipedia.org/wiki/Little_man_computer

Monday, 31 August 2015

API

For example, if you want to write a program that reads and analyzes data from Twitter, you'd need to use the Twitter API, which would specify the process for authentication, important URLs, classes, methods, and so on.

Building social networking profile

Sceleton
<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body></body>
</html>

Instructions
  1. Put your name between the <title></title> tags.
  2. Put a picture of yourself (or anything you like!) between the <body></body> tags. If you can't think of a good picture, use this ninja: https://s3.amazonaws.com/codecademy-blog/assets/ninja_zpsa5dbe37a.jpg.