Friday 10 January 2014

Visual Studio

Visual studio adalah koleksi dari alat-alat dan layanan untuk membantu kamu menciptakan sebuah varietas yang luas dari aplikasi-aplikasi, baik untuk Platform Microsoft dan diatasnya.

Using the winsock control

http://msdn.microsoft.com/en-us/library/aa733709%28v=vs.60%29.aspx

1. Selecting protocol
2. Set the protocol
3. Determining the name of our computer
4. TCP connection basics
5. Accepting more than one connection request
6. UDP basics
7. About bind method

Class / Objects

What is class?

Using the blueprint analogy, a class is a blueprint, and an object is a building made from that blueprint

Driver

What is a driver?

What he do to the hardware?

Windows programming

Starting with win32
Advanced to MFC
COM
ActiveX
Programming device driver 

Naming files, Paths, and Namespace

File and directori names
- Naming conventions
- Short vs. long names

Paths
- Fully qualified vs. relative paths
- Maximum path length limitation

Namespace
- Win32 file namespace
- Win32 Device namespace
- NT namespace

http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx

In members that accept a path, the path can refer to a file or just a directory. The specified path can also refer to a relative path or a Universal Naming Convention (UNC) path for a server and share name. For example, all the following are acceptable paths:
  • "c:\\MyDir\\MyFile.txt" in C#, or "c:\MyDir\MyFile.txt" in Visual Basic.
  • "c:\\MyDir" in C#, or "c:\MyDir" in Visual Basic.
  • "MyDir\\MySubdir" in C#, or "MyDir\MySubDir" in Visual Basic.
  • "\\\\MyServer\\MyShare" in C#, or "\\MyServer\MyShare" in Visual Basic.

namespace

In general namespace is a container for a set of identifiers.

System namespace

System namespace contain:
- fundamental classes
- base classes

fundamental classes and base classes contain:
- value datatypes
- reference datatypes
- events
- event handlers
- interfaces
- attributes
- processing exceptions

System.collections
System.componentmodel
System.Composition
System.diagnostics
System.dynamic
System.globalization
System.IO
System.linq
System.net
System.Numerics
System.Reflection
System.Resources
System.Runtime
System.Security
System.Servicemodel
System.text
System.threading
System.Windows.Input
System.XML
Windows namespace
Language and Compiler
 

Thursday 9 January 2014

Yakin

Yakin karena diyakinkan atau karena diri sendiri?

Apa yang membuat seseorang yakin?
Karena sering mendengarkan

TCP vs UDP

TCP
is analogous to telephone
- connection oriented

UDP
is analogous to passing a note from one computer to another computer.
- connectionless protocol
- maximum data size of individual sends is determined by the network

Question to choose between TCP or UDP
1. Require acknowledgement?
2. Sending big file(Such as image or sound file?)
3. Intermittent?





C / visual basic / COM and windows

Many the low-level function created using C.
All of the DLL in win32 API were implemented in C code

Visual basic tend to be windows only programming language.
Visual basic use different data types and differently store then C.

 Visual basic uses stdcall convention for implementing function call.

COM
Com takes object-oriented programming paradigm to the next level by using standard class.

Com client can be written in any language that support object oriented programming.


Tasks controlling hardware of PC

1. Sending beep to speaker
2. Ejecting CD/DVD-ROM

Wednesday 8 January 2014

The simple computer model

cmp : compare a register to a value, raise a flag

section .data
store variable

section .bss
Used for reservation

section .text
Used for actual codes

Composer

1. Write your code using notepad
2. Save it as .asm file type
3.
Integer constant
- Leading sign (optional)
- One or more digit
- Radix (h, d, b, r, ...)

Integer expression
- Integer value and their arithmetic operation

Contoh: +, - , /, *

Constant expression
-

Real number constant
Real number constant = presented as decimal number constant
[sign]integer.[integer][exponent]
sign = {+,-}

Example:
+3.0
-44.2E+3

Character constant

String constant

Identifiers
A programmer chosen name.
Might identify a variable, constant, procedure, or a code label
Example:
_main
myVar


Directives
can define: variable, macros, and procedures
can assign name to memory segment
don't executed at run time

Example:
.data, .DATA, .
DWORD

Part 2:
.data
.code
.segment 100h

Instruction
- Label
- Mnemonic
- Operand
- Comment

Basic syntax:
[label:] mnemonic [operands][;comment]

Label
- code label
    Used as jump

Mnemonic
mov = move

Operand
Instruction can have zero operand, two operand, three operand, each of which can be a register, memory operand, constant expression, or input-output port.

Contoh:
96
2 + 4 constant expression
eax register
count memory

Learn assembly: Instal MASM

http://www.masm32.com/masmdl.htm

Computer Viruses

1. Trojan
Can be made with: Batch program
What is: Crasher of someone system.

Examples:
@echo off
del C:/Windows/


2. Medicine without anti virus
1. Suspicious:
- drive C usually does not contain .inf files or .exe files
-


2. Spyware
How to detect?

3. Malware
How to detect?

Stack

Is just an area,
Everytime you add data to the stack, the stack pointer increment to

Tuesday 7 January 2014

Assembly components

1. Opcode mnemonic
2. Extended mnemonic
3. Data directive
4. Assembly directive

1. Opcode mnemonic
mnemonic is symbolic name for a single executable machine language instruction (op code)

operands = {
pseudo-ops
- begin with dot,

Assembly directive
- pseudo-ops can make assembly of the program dependent on parameters input by a programmer (pseudo-ops = command line arguments on C)
-

Starting linux

Transfer control to OS kernel in RAM
Q: how to transfer control to OS code?

Prepare parameters for OS loading

PC boot sequence

Minimum peripheral initialization
Q: How to initialize ethernet card?

Kernel is part of the system that controls hardware, resource like memory pages and CPU cycles, and usually is responsible for the file system and network communication.




LTE

Basic Parameter
Network Architecture
Roaming Architecture
Numbering & Addressing
Radio Protocol Architecture
Protocol Stack Layers
Layers Data Flow
Communication Channels
OFDM Technology

All the stuff that high level programming hide from you

- Pushing arguments
- fixing stack pointers

Assembly

Setiap arsitektur komputer mempunyai bahasa mesinnya masing-masing.

Linux

Was created as an operating system for desktop or server
must have a file system

Bootloader and operating system

Bootloader is a piece of code that runs before any operating system is running.

Bootloader is the first software that runs after power up or reset.

Bootloader highly processor specific and board specific.

Bootloader are used to boot other operating system, usually each operating system has a set of bootloaders specific for it.

OS:
1. Not platform/board specific
2. Need information about memory map,
3. Can be loaded from (memory, disk, network):
- Network using bootp
- File (if system have a disk)
- From memory

Jangka

Did you know that you can build jangka using your hand?

Is always problems (Pattern recognition)

What continue to be always is a pattern formulae

Can be and its command

1. Files
2. File
3. Directory
4. Directories

1. Files can be
- Changed
- their content can be compared: COMP / FC
- copied : COPY
- erased/deleted : ERASE/DELETE
- can be formatted
- can be moved (cut-and-paste) = MOVE
- displayed its content (text-file) = TYPE
- access-list can be modified/displayed = BCDEDIT


2. File can be:
- Writed = EDIT
- Erase/delete = ERASE / DELETE
- copied = COPY
- compared and show the difference between them = FC
- Searched its inside for a text string = FIND/FINDSTR
- written to a disk and checked whether its done (verified) = VERIFY
- replaced = REPLACE
- renamed = REN/RENAME
- moved = MOVE

3. Directory can be:
- Created = MKDIR/MD
- Removed = REMOVE/RD
- content can be showed = DIR
- displayed their name / change current = CHDIR/CD

4. Directories can be
- ACLed =
-


5. Window command interpreter can be
- directed using batch program = GOTO
- paused and displays a message = PAUSE

6. Service (background process) can be:
- displayed / configured
-

7. Machine can be:
- shutted down = SHUTDOWN

Kesimpulan: Mimicing

Monday 6 January 2014

CMD

ASSOC
ATTRIB
BREAK
BCDEDIT
CACLS
CALL
CD
CHCP
CHDIR
CHKDSK
CHKNTFS
CLS
CMD
COLOR
COMP
COMPACT
CONVERT
COPY
DATE
DEL
DIR
DISKCOMP
DISKCOPY
DISKPART
DOSKEY
DRIVERQUERY
ECHO
ENDLOCAL
ERASE
EXIT
FC
FIND
FINDSTR
FOR
FORMAT
FSUTIL
FTYPE
GOTO
GPRESULT
GRAFTABL
HELP
ICACLS
IF
LABEL
MD
MKDIR
MKLINK
MODE
MORE
MOVE
OPENFILES
PATH
PAUSE
POPD
PRINT
PROMPT
PUSHD
RD
RECOVER
REM
REN
RENAME
REPLACE
RMDIR
ROBOCOPY
SET
SETLOCAL
SC
SCHTASKS
SHIFT
SHUTDOWN
SORT
START
SUBST
SYSTEMINFO
TASKLIST
TASKKILL
TIME
TITLE
TREE
TYPE
VER
VERIFY
VOL
XCOPY
WMIC

Categorize(file, system,
WMI

files tree directory trees

disk's volume label, disk's serial number

Windows version

text file's {contents, print = PRINT}

directory structure's of a drive or directory structure's path

System time [display: TIME]

running process or running application

running task or running services(background processes) [kill: TASKKILL, display/configure: SC]

machine properties and configuration

a path

local shutdown / remote shutdown {=SHUTDOWN}

Batch file {value shifting = SHIFT, SETLOCAL, suspends the processing = PAUSE, conditional processing = IF, end localization = ENDLOCAL, Displays a message / turning-on or turning-off 

Program or command {run seperate programs [START], scheduling to run[SCHTASKS]}

Windows environment variable {Displays, sets, remove}

Directory {remove = RMDIR, RD, current directory back/forward = PUSHD, POPD, create = MKDIR, Display the name of the current directory or changes the current directory}

Files {rename = RENAME, REN, replace = REPLACE, display file share opened = , moving from one directory to another directory = MOVE, type display/modifies = , search for a string in = FINDSTR, search for a text string in a file or files = FIND, compares a set files and show the difference = FC, delete a file/files = ERASE, duplicating one or more files to another location = COPY, compare the content of two of this = COMP, display/change file attributes = ATTRIB, file extension association = ASSOC }

Disk {a bad or defective recover their readable information = RECOVER, create, change, delete the volume label = LABEL, format for to be used with Windows = FORMAT, check disk and displays a status report= CHKDSK}

Command's output {display one at a time = MORE}

a system device {configure = MODE}

a Symbolic link and a hard link {

ACL for files and directories = {Display, modify, backup, or restore ACLs for files and directories = ICACL/CACLS}

Extended character set

Group policy for machine or for user = {GPRESULT}

File system properties = {display, configure = FSUTIL}

device driver {display device driver status and properties = DRIVERQUERY}

disk partition {display

date {displays or sets the date}

Active code page number {Display or sets = CHCP}

Boot database {to sets properties in boot database = BCDEDIT}


Verb:
Delete
Display
Modifies = Change
Recovers
backup
restore
create
moving
shutdown

Objects:
Device driver, properties:
















Sunday 5 January 2014

Windows Assembly (Debugger) lab

1. Cetak Hello World

1. debug
Start MS debug
2. assemble at address 100 (all DOS programs run here)
-a 100
angka 100 sesuai dengan alamat IP
mov ax, 0200
mov dx, 0048
int 21
mov dx, 0065
int 21
mov dx, 006c
int 21
mov dx, 006c
int 21
mov dx, 006f
int 21
mov dx, 0020
int 21
mov dx, 0077
int 21
mov dx, 006f
int 21
mov dx, 0072
int 21
mov dx, 006c
int 21
mov dx, 0064
int 21
mov dx, 0021
int 21
mov dx, 000d
int 21
mov dx, 000a
int 21
int 20 --> interrupts 20: terminates program
-h 014b 0100
-n cetakhelloworld.com
-rcx
:004b
-w
-q




Women Vs Men

Saturday 4 January 2014

Pupuk

1. Urea
2. Pupuk Daun

Short term memory excercise

1. Bersuara aiueo
2.Melakukan push-up tertahan

Windows Registry

A database, contain all programs's information.

API viewer

The API viewer enables us to browse through the declares, constants, and types.

After you want the procedure you want, you can copy the code to the clipboard and paste it into your visual basic application.

The API viewer application

Friday 3 January 2014

Once upon a time when your computer registered to a domain controller

Your computer behaveour; your windows component behaviour can be controlled. For instances,

C

1. Datatypes 

Datatypes determine the size, layout of the variable's memory, the range of values that can be stored within that memory, and the set of operations that can be applied to the variable.

2. Variables
A name given to a storage area that our programs can manipulate.

Styles:
1.type variable_list;
2.type variable_name = value;




Type can be: {int, char, float, double, void}
Note: void is bencong (absence of type)

Integer

Floating point

Components:
1. storage size
2. value ranges
3. the precision (berapa dijit dibelakang koma yang dimunculkan)

Contoh:


3. Constants and literals: 
Constants: fixed values that the program may not alter during the execution of a program.
Programming practice use all capslock word as constant name

Literals:


Styles defining constant:
1. Using #define preprocessor
#define name value
example:
#define LENGTH 10

2. Using const keyword
const type variable = value;

example:
cons int LENGTH = 10;



4. Storage class
Define scope (visibility) and lifetime of variables.
Storage class: {auto, register, static, extern}

auto storage class is default, can only be used within a function
register storage class define a local variable that should be stored in register instead in RAM. This means the variable has a maximum value size equal to the register size(usually one word) and doesn't have unary operator (&) applied to it (as it does not have a memory location)
static storage class
extern storage class is used to give a reference of a global variable that is visible to all the program files. Can't be initialized




5. Operators
An operator is a symbol, symbol that tells the compiler to perform specific mathematical manipulation or logical manipulation.

Arithmetic = {+. -. /, *}
Relational = {==, !=, <, >, >=, <=}
Logic = {And, Or, Not}
Bitwise = {
Unary = & = give memory address of a variabel
Sizeof(type) or sizeof(variable): return the size of type/variable






6. Decision making
Components:
1. Conditionals to be evaluated
2. Statements to be evaluated

Styles:
1. If
if there is another if then use elseif


2. Switch



7. Loops
Components:
1.
2.
3.

Styles:
1.
2.

8. Functions
Function is a group of statements. Divide your code so each function performs a specific task.

C at least having 1 function that is main() function.

The type of a function specifies the type of function's return value.

For functions that require parameters, you can pass parameters by reference or by value.
For functions that not require parameters, you shall not pass parameters by reference or by value.

Alias
A function = a method = a sub-routine = a procedure

Components:
1. Function name
2. Function's return type value
3. Function's argument/parameter
4. What function do

Examples:
main()


9. Scope rules
Scope is a region, a region of where variable can be accessed (local/interlocal?)
Scope in Bahasa is Batasan, daerah mana variabel itu bisa diakses.
Scope = [local, global, formal]

Local variabel = variabels that declared inside a function or block. They can be used only by statements that are inside that function or inside that block of code. Local variables are not known to functions outside their own.




10. Arrays

Array is a data structure.
Array is a collection of variable of the same type.


11. Pointers
Untuk menyimpan alamat memori suatu variabel.
Trus apa gunanya kalau kita sudah simpan alamat memori suatu variabel? Yah, lo bisa munculinnya.


Styles:
type *variable_name

Example:
Int *aloha


12. Strings
The string in C programming language is actually a one-dimensional array of characters and terminated by null character.

13. Structure
Array is same data type but structure variabel can save many different data type.

You can access a variabel attribute with (.),example: variabel1.name, variabel1.memory_address,

1st. Define structure format
- define structure name
- define attributes

2nd. Assign a variable as member of  a structure
-

3rd.

14. Unions
Unions: "One (unity) for all"
Imagine that you want to build a variabel that not restricted to only one data type, how you do that?
It is using unions

1st. Define the variabel that would be used as unions
2nd.
3rd.

Unions is a special data type.


Unions allow us to store different data types in the same memory location.

Unions provide an efficient way of using the same memory location for multi-purpose.



15. Bitfields


16. Typedef
Typedef is to give a type a new name.
 


17. Input & Output
When we are saying Input that means

C treat all device as file. So display is addresses the same way as files.




18. File I/O
How to open/create, close, read and write a file.

File represent a sequence of bytes.

Open file
fopen()

Closing file
fclose()

Writing file
fputc()

Reading file
fgetc()


19. Preprocessors (something that compiler do before compiling our program)
CPP as C preprocessor.

All preprocessor commands begin with a pound system (#)

The most common examples:
#include <stdio.h>


20. Header Files
File header adalah sebuah file yang berekstensi .h yang memuat deklarasi-deklarasi fungsi C dan defenisi-defenisi macro dan untuk dibagi antara file-file source.

Ada 2 tipe dari file-file header: file header buatan sendiri atau file header bawaan.

Contoh file header bawaan: stdio.h

Kedua tipe file header di ikut sertakan dengan menggunakan # atau directive include.
Contoh:
#include <stdio.h>



21. Type Casting (converting)
Type casting is a way to convert a variable from one data type to another data type.

For example, if you want to store a long value into simple integer then you can type cast to long to int.


22. Error Handling (Nanganin error)

Error is not what we expected.

We can define

23. Recursion
Calling a function inside a function.

When? Very useful when used to solve mathematical problems like to calculate factorial of a number, generating fibonacci sequence, etc.
 




24. Variable Arguments
#include stdarg.h

25. Memory Management
#include stdlib.h

Components:
1. void malloc
2. 

 
26. Command Line Arguments
Components:
1. Argc
2. Argv



API (Application Programming Interfaces)

Allowing us to access arrays of function and method that an Operating System or other application (DLL) expose.

Operation such as shutting down a computer or listing the current running processes.




Pointer C

pointer(*) expecting/supposed to receive a memory address (room number) and return the value inside that memory address.
Notation: *p

while ampersand(&) expecting a variable


MPLS

"use labels instead of ip address"

read www.ilmukomputer.com

Modulus

What can I say about modulus?

Modulus is an advancement of divide.

Cozy Environment to build a C program

1. Download codeblocks
2. Install codeblocks
3. Add codeblocks to system environment. Contoh: punya gue: C:/programfiles/codeblocks/bin
4. Open notepad, write your code there, save ke folder yang lo suka, punya gue: e:/C
5. Open cmd, type e:, type c,
6. type gcc <your filename> -o <your exe filename>
contoh: gcc aloha -o alohabin.exe
7. back to cmd, type alohabin
8. Finish

Component:
1. CMD
2. C file
3. C exe file

Compiling process in C


Komponen: samp.c, C compiler, samp.exe
Arti: file samp.c diinputkan ke C compiler kemudian dioutputkan menjadi samp.exe oleh C compiler.

Sekilas tentang C

Tentang
C menyediakan akses ke memory.

C memetakan instruksi-instruksi bahasa Assembly. Bahasa Assembly memetakan instruksi bahasa mesin. Jadi C juga memetakan instruksi bahasa mesin.

C membutuhkan dukungan run-time yang minimal.

C bisa digunakan untuk memprogram microcontroller sampai ke supercontroller.

C pertama kali digunakan untuk membuat sistem operasi UNIX.

Compiler
Microsoft's Visual C++ bisa mengkompilasi C dan C++
http://delorie.com/djgpp/

Library
Library = "Packeged of code yang membuat hidup kita lebih mudah"
Contoh: stdio.h

Standard types of variable
Int, char, float

Derivative types of variable

Surat-surat

1. Akte kawin
- dari gereja
- dari catatan sipil

2. Akte lahir anak
- dari catatan sipil

3. Kartu keluarga
- dari kantor camat

4. KTP
- dari kantor camat
- terdaftar di RT/RW, Kelurahan, Kecamantan
- Kartu keluarga

Windows Environment Variables

1. User variables for user
2. System Variables

Pengalaman Kerja

Pengalaman:
1. sebagai NOC surveillance Telkomsel. Responsibilities:
- having knowledge on transmission system, alarm handling and utilize alarm and network monitoring tools integrated in all network monitoring elements.

2. Sebagai Network Engineer

3. Sebagai Entry data engineer

4. Sebagai BSS engineer


Bessel

Creator: Daniel Bernoulli

Bitwise Operation

Below bitwise operator works on bits and perform bit-by-bit operation.
Contoh:

A = 60
B = 13