Friday 20 December 2013

The 9 hardest things programmers have to do

1. Naming things
2. Explainning what I do and don't do
3. Estimating time to complete task
4. Dealing with other people
5. Working with someone else's code
6. Implementing functionality you disagree with
7. Writing documentation
8. Writing test
9. Designing a solution


Wednesday 18 December 2013

Visual Basic LAB

7. Visual basic Errors
Error tergolong atas:
1. Logic error
2. Syntax error
3.

Panduan melihat error: Jendela Error list 

39. Messagebox
- Message/prompt
- Buttons
- Title
- Icon

dim a = msgbox ("Aloha?",vbYesNo, "Asek?")
if messagebox.show("click something", "title", messagebuttons.abort,

38. Toolbox
Button
- Dock : None, top,
Checkedlistbox:
   - item: hello, onlivegamer,
Checkbox




 37. Visual basic form properties
Changing (name):
- Mengubah nama panggilan form.

Changing backcolor:
- Mengubah warna layar utama jendela (bukan layar title).
- System color : Warna-warna yang biasanya digunakan pada sistem (Windows 7 misalnya)
- Web color: Warna yang biasanya digunakan dalam web. Web biasanya membutuhkan lebih banyak variasi warna. Makanya variasi warna web color lebih banyak dari system color.

Changing background image
- Mengubah gambar latar form
- Jika ukuran gambar yang digunakan lebih kecil dari ukuran layar, gambar akan di-tile

 Changing icon
- Mengubah gambar icon jendela formborder title

Changing formborder style
- None, fixedsingle, fixed3d,  fixeddialog, sizable, fixedtoolwindow, sizabletoolwindow
- None: Tidak pakai/tidak ada formborder
- Fixedsingle:
- Fixed3D
- FixedDialog
- Sizable
- Fixedtoolwindow
- Sizabletoolwindow


Change MaximizeBox
- Change whether form can be maximized or not

Change Minimize Box
- Change whether form can minimized or not

Change opacity
- Change the transparency of the form

Changing text (form's title)
- change form's title

Change transparency key


Kondisi
Kondisi maju atau mundurnya suatu perusahaan tergantung dari pendapatan.
Besar / kecilnya pendapatan tergantung dari banyaknya barang yang terjual.

jika perusahaan maju, maka pendapatan besar.
jika perusahaan mundur, maka pendapatan kecil.

lebih ke sebab-akibat

if perusahaan = "maju" then console.writeline = "
else :
    if perusahaan = "mundur" then console.writeline ("Pendapatan kecil")
end if

Jika kasus diperluas, bahwa maju mundurnya perusahaan bukan hanya dari meningkatnya pendapatan, tapi juga berkurangnya pengeluaran

if pendapatan = "meningkat"
    if pengeluaran = "berkurang"
        then console.writeline ("Perusahaan maju")
else
    console.writeline ("Perusahaan tidak maju")

26. Visual Basic Form



23. Comparing String

 .compare


22. Replacing String
a = console.readline()
console.writeline(kata1.replace("Hello","Halo"))

21. Formatting string
21.1 Uppercasing
.toUpper
21.2 Lowercasing
 .toLower


20. Substring
sub main()
dim kata1 as String
kata1 = "Hello World!"
writeline(kata1.substring

End sub

19. Get length of String
Well, jika sesuatu direfer sebagai sesuatu, maka referensi itu mempunyai properti yang sama dan berbeda.
Contoh jika truk dibilang sama dengan mobil, maka truk pada umumnya mempunyai strir, ban, kaca, karena mobil memiliki itu semua.

Sejak kamu mereferensikan sebuah variabel sebagai string (pada waktu kamu mendeklarasikannya: dim kata1 as string), maka variabel itu juga memiliki apa yang dimiliki string.

Jika kamu mereferensikan variabel a sebagai string maka variabel a memiliki length,

Console.WriteLine(angka1.Length.Equals(10))

9. Math operators
+, -, *, /, ^, mod
Contoh syntax modulus:
4 mod 3

10. Declaring variabel and initialization
Berikut hanya deklarasi variabel:
Dim angka1 as Integer
Dim angka2 as Integer

Format deklarasi variabel jika dipersingkat menjadi:
Dim angka1, angka2 as Integer

Berikut deklarasi variabel sekaligus inisialisasi (pemberian nilai awal):
Dim angka1 as Integer = 10
Dim angka2 as Integer = 5

Disingkat menjadi?
Dim angka1, angka2 = 10, 5

3. Datatype primitives
Karena kita hanya berurusan dengan angka dan huruf saja, maka kita perlu variabel untuk menyimpan angka dan huruf itu. Angka dan huruf tersimpan di dalam. 

Data type untuk angka:
Double

Jika double, maka digit dibelakang koma maksimal = 14 dijit. Jika angka yang kamu masukkan 19 dijit dibelakang koma, maka 14 dijit dibelakang koma yang akan disimpan/ditampilkan dan 5 digit yang lainnya akan digenapkan.

Contoh:

sub main()
angka1 = 1.1234567891234568
Console.WriteLine(angka1)
end sub

Output:
 

Integer
Jika integer didesain untuk menyimpan bilangan bulat (bilangan tanpa koma), maka digit didepan koma maksimal = 10 dijit. Lebih daripada itu dijit yang lain tidak akan tersimpan.

Datatype untuk perhurufan

Char

Variabel bertipe char hanya mampu menyimpan 1 huruf saja. Jika kamu ingin menyimpan kata (lebih dari satu huruf) maka hanya 1 huruf saja yang tersimpan.

Contoh:

sub main()
dim kata1 as char
kata1 = "hello world apa kabarnya? Sehat kan? Sudahkah anda minum yakult hari ini?"
Console.WriteLine(angka1)
end sub

Output:


Well, hanya huruf h saja? Yup, betul. Variable char hanya muat 1 huruf!

String

Variabel bertipe string mampu menyimpan lebih dari satu huruf.

Contoh menggunakan contoh yang sama dengan contoh Char tapi variabel kata1 diubah menjadi variabel string:

sub main()
dim kata1 as String
kata1 = "hello world apa kabarnya? Sehat kan? Sudahkah anda minum yakult hari ini?"
Console.WriteLine(angka1)
end sub

Output:







Well, untuk peta lengkapnya adalah dibawah ini: Tapi kita sebagai programmer aplikasi sederhana cukup menggunakan integer, double, char, string saja. Kita sudah cukup bahagia.

 



Monday 16 December 2013

VIsual Basic Language Features

Link
Materi:
1. Array
2. Collection Initializers
3. Constants and Enumerations
4. Control flow
5. Data types
6. Declared elements
7. Delegates
8. Early and late binding
9. Error types
10. Events
11. Interfaces
12. LINQ
13. Object and classes
14. Operators and expression
15. Procedures
16. Statements
17. Strings
18. Variables
19. XML

Sunday 15 December 2013

Lets learn some new words


Tipe-tipe industri

Tipe-tipe industri:
1. Advertising
2. Audit
3. Banking
4. Chemical Industry and Banking
5. Computer sience and system development
6. Consumer goods
7. Courier
8. Education and trainning consultant
9. Electrical and instrumentation
10. Entertainment and event organizer
11. Food and beverage
12. Foreign exchange and other financial sector
13. Hotel
14. Human resource service
15. Information technology
16. Insurance
17. Journalism
18. Legal
19. Logistics and transportation
20. Manufacturing
21. Marine
22. Mechanical and automotive service
23. Media and publishing
24. Mining
25. Multimedia
26. Oil & Gas and Geothermal production
27. Oil & Gas and Geothermal production and service
28. Oil & Gas and Geothermal services
29. Security
30. Sport
31. Telecommunication

Saturday 14 December 2013

How to refer to Cells and Ranges by using A1 notation (VBA)

You want to change value of many / more than one cells at once? You will use range property to do that.

Range properties is great and flexible meaning: Range can be used to refer 1 cell, and also many cells (a block).

You can refer to a cell, for instance we targeting cell A1's value:
sheet1.range("A1").value
we refer to cell A1's value that contained within.

And, you can also refer to many cells (more than 1 cell), for instance:
sheet.range("A1:A2").value
we refer to cell A1's and cell A2's value contained.

Essentially, you should help / navigate Range property with A1 notation.

What is A1 notation? A1 notation could be: A1, A1:A2, A:A, 1:1, A1:D5
A1 means: cell 1 column A
A1:A2 means: cell 1 column A and cell 2 column A
A:A means all cells in column A
1:1 means all cells in row 1
A1:D5 means a block start from A1 to D5. This kind a awkward, but try that on your VBA.


To recap all: in short explanation use this syntax: sheet.range("A1_Notation") and A1 notation could be: A1, A1:A2, A:A, 1:1, and A1:D5


So now try to combine/write them on your VBA editor:
Sheet1.range("A1").value
Sheet.range("A1:A2").value
Sheet.range("A:A").value
Sheet.range("1:1").value
Sheet.range("A1:D5").value

You are done!

PS: Did you notice that Ms. Excel is indexing his row and column with numeric (1, 2, 3, 4,...) and alphabet (A, B, C, D...). So, in referencing a cell in A1 notation, we must use this convention.

Quiz:
1. How could you refer to a block of cells/matrix (3 x 3) that start from D5?
Clue: Sheet1.Range("Start cell : End cell")

2.  Try this sheet.range("A:A, E6:H9").value = 10
What you see?

Wireless security settings on TP-LINK

We will observe this device:
150M Wireless Lite N Router
Model No. TL-WR740N / TL-WR740ND

WEP
Type: {Automatic, Open System, Shared Key}
WEP Key Format: {Hexadecimal, ASCII}
Key Selected WEP Key(Password) Key Type

Look below picture to clarify:

WPA/WPA2 - Enterprise
Version: {Automatic, WPA, WPA2}
Encryption: {Automatic, TKIP, AES}
Radius Server IP: ___
Radius Port: 1812 (1-65535, 0 stands for default port 1812)
Radius password: ___
Group Key Update Period: ___ (in second, minimum is 30, 0 means no update)

 

WPA/WPA2 - Personal
Version: {Automatic(Recommended), WPA-Personal, WPA2-Personal}
Encryption: {Automatic(Recommended), TKIP, AES}
Password: ___
(You can enter ASCII characters between 8 and 63 Hexadecimal characters between 8 and 64.)
Group Key Update Period: ___ seconds (Keep it default if you are not sure, minimum is 30, 0 means no update)


So whats the different between WPA/WPA2 - Enterprise and WPA/WPA2-Personal?