Senin, 15 September 2014

on Leave a Comment

A Dance in Fire Chapter 1

 A Dance in Fire
Chapter 1
by Waughin Jarth
Chapter 1 of a clerk's adventures in Valenwood

Scene: The Imperial City, Cyrodiil
Date: 7 Frost Fall, 3E 397
It seemed as if the palace had always housed the Atrius Building Commission, the company of clerks and estate agents who authored and notarized nearly every construction of any note in the Empire. It had stood for two hundred and fifty years, since the reign of the Emperor Magnus, a plain-fronted and austere hall on a minor but respectable plaza in the Imperial City. Energetic and ambitious middle-class lads and ladies worked there, as well as complacent middle-aged ones like Decumus Scotti. No one could imagine a world without the Commission, least of all Scotti. To be accurate, he could not imagine a world without himself in the Commission.

      “Lord Atrius is perfectly aware of your contributions,” said the managing clerk, closing the shutter that demarcated Scotti's office behind him. “But you know that things have been difficult.”
      “Yes,” said Scotti, stiffly.
      “Lord Vanech's men have been giving us a lot of competition lately, and we must be more efficient if we are to survive. Unfortunately, that means releasing some of our historically best but presently underachieving senior clerks.”
      “I understand. Can't be helped.”
      “I'm glad that you understand,” smiled the managing clerk, smiling thinly and withdrawing. “Please have your room cleared immediately.”

       Scotti began the task of organizing all his work to pass on to his successor. It would probably be young Imbrallius who would take most of it on, which was as it should be, he considered philosophically. The lad knew how to find business. Scotti wondered idly what the fellow would do with the contracts for the new statue of St Alessia for which the Temple of the One had applied. Probably invent a clerical error, blame it on his old predecessor Decumus Scotti, and require an additional cost to rectify.

      “I have correspondence for Decumus Scotti of the Atrius Building Commission.”
Scotti looked up. A fat-faced courier had entered his office and was thrusting forth a sealed scroll. He handed the boy a gold piece, and opened it up. By the poor penmanship, atrocious spelling and grammar, and overall unprofessional tone, it was manifestly evident who the writer was. Liodes Jurus, a fellow clerk some years before, who had left the Commission after being accused of unethical business practices.
     
      “Dear Sckotti,
I emagine you alway wondered what happened to me, and the last plase you would have expected to find me is out in the woods. But thats exactly where I am. Ha ha. If your'e smart and want to make lot of extra gold for Lord Atrius (and yourself, ha ha), youll come down to Vallinwood too. If you have'nt or have been following the politics hear lately, you may or may not know that ther's bin a war between the Boshmer and there neighbors Elswere over the past two years. Things have only just calm down, and ther's a lot that needs to be rebuilt.
Now Ive got more business than I can handel, but I need somone with some clout, someone representing a respected agencie to get the quill in the ink. That somone is you, my fiend. Come & meat me at the M'ther Paskos Tavern in Falinnesti, Vallinwood. Ill be here 2 weeks and you wont be sorrie.
-- Jurus
P.S.: Bring a wagenload of timber if you can.”
     “What do you have there, Scotti?” asked a voice.
       Scotti started. It was Imbrallius, his damnably handsome face peeking through the shutters, smiling in that way that melted the hearts of the stingiest of patrons and the roughest of stonemasons. Scotti shoved the letter in his jacket pocket.
     “Personal correspondence,” he sniffed. “I'll be cleared up here in a just a moment.”
     “I don't want to hurry you,” said Imbrallius, grabbing a few sheets of blank contracts from Scotti's desk.                                                                                                                                                             “I've just gone through a stack, and the junior scribes [sic] hands are all cramping up, so I thought you wouldn't miss a few.”

      The lad vanished. Scotti retrieved the letter and read it again. He thought about his life, something he rarely did. It seemed a sea of gray with a black insurmountable wall looming. There was only one narrow passage he could see in that wall. Quickly, before he had a moment to reconsider it, he grabbed a dozen of the blank contracts with the shimmering gold leaf ATRIUS BUILDING COMMISSION BY APPOINTMENT OF HIS IMPERIAL MAJESTY and hid them in the satchel with his personal effects.
       The next day he began his adventure with a giddy lack of hesitation. He arranged for a seat in a caravan bound for Valenwood, the single escorted conveyance to the southeast leaving the Imperial City that week. He had scarcely hours to pack, but he remembered to purchase a wagonload of timber.
       “It will be extra gold to pay for a horse to pull that,” frowned the convoy head.
       “So I anticipated,” smiled Scotti with his best Imbrallius grin.

         Ten wagons in all set off that afternoon through the familiar Cyrodilic countryside. Past fields of wildflowers, gently rolling woodlands, friendly hamlets. The clop of the horses' hooves against the sound stone road reminded Scotti that the Atrius Building Commission constructed it. Five of the eighteen necessary contracts for its completion were drafted by his own hand.
        “Very smart of you to bring that wood along,” said a gray-whiskered Breton man next to him on his wagon. “You must be in Commerce.”
        “Of a sort,” said Scotti, in a way he hoped was mysterious, before introducing himself: “Decumus Scotti.”
       “Gryf Mallon,” said the man. “I'm a poet, actually a translator of old Bosmer literature. I was researching some newly discovered tracts of the Mnoriad Pley Bar two years ago when the war broke out and I had to leave. You are no doubt familiar with the Mnoriad, if you're aware of the Green Pact.”
         Scotti thought the man might be speaking perfect gibberish, but he nodded his head.
       “Naturally, I don't pretend that the Mnoriad is as renowned as the Meh Ayleidion, or as ancient as the Dansir Gol, but I think it has a remarkable significance to understanding the nature of the merelithic Bosmer mind. The origin of the Wood Elf aversion to cutting their own wood or eating any plant material at all, yet paradoxically their willingness to import plantstuff from other cultures, I feel can be linked to a passage in the Mnoriad,” Mallon shuffled through some of his papers, searching for the appropriate text.

          To Scotti's vast relief, the carriage soon stopped to camp for the night. They were high on a bluff over a gray stream, and before them was the great valley of Valenwood. Only the cry of seabirds declared the presence of the ocean to the bay to the west: here the timber was so tall and wide, twisting around itself like an impossible knot begun eons ago, to be impenetrable. A few more modest trees, only fifty feet to the lowest branches, stood on the cliff at the edge of camp. The sight was so alien to Scotti and he found himself so anxious about the proposition of entering the wilderness that he could not imagine sleeping.

          Fortunately, Mallon had supposed he had found another academic with a passion for the riddles of ancient cultures. Long into the night, he recited Bosmer verse in the original and in his own translation, sobbing and bellowing and whispering wherever appropriate. Gradually, Scotti began to feel drowsy, but a sudden crack of wood snapping made him sit straight up.
         “What was that?”
           Mallon smiled: “I like it too. 'Convocation in the malignity of the moonless speculum, a dance of fire --'”
         “There are some enormous birds up in the trees moving around,” whispered Scotti, pointing in the direction of the dark shapes above.
          “I wouldn't worry about that,” said Mallon, irritated with his audience. “Now listen to how the poet characterizes Herma-Mora's invocation in the eighteenth stanza of the fourth book.”

           The dark shapes in the trees were some of them perched like birds, others slithered like snakes, and still others stood up straight like men. As Mallon recited his verse, Scotti watched the figures softly leap from branch to branch, half-gliding across impossible distances for anything without wings. They gathered in groups and then reorganized until they had spread to every tree around the camp. Suddenly they plummeted from the heights.
          “Mara!” cried Scotti. “They're falling like rain!”
          “Probably seed pods,” Mallon shrugged, not turning around. “Some of the trees have remarkable --”

           The camp erupted into chaos. Fires burst out in the wagons, the horses wailed from mortal blows, casks of wine, fresh water, and liquor gushed their contents to the ground. A nimble shadow dashed past Scotti and Mallon, gathering sacks of grain and gold with impossible agility and grace. Scotti had only one glance at it, lit up by a sudden nearby burst of flame. It was a sleek creature with pointed ears, wide yellow eyes, mottled pied fur and a tail like a whip.
         “Werewolf,” he whimpered, shrinking back.
         “Cathay-raht,” groaned Mallon. “Much worse. Khajiti cousins or some such thing, come to plunder.”
         “Are you sure?”

          As quickly as they struck, the creatures retreated, diving off the bluff before the battlemage and knight, the caravan's escorts, had fully opened their eyes. Mallon and Scotti ran to the precipice and saw a hundred feet below the tiny figures dash out of the water, shake themselves, and disappear into the wood.

         “Werewolves aren't acrobats like that,” said Mallon. “They were definitely Cathay-raht. Bastard thieves. Thank Stendarr they didn't realize the value of my notebooks. It wasn't a complete loss.”

Selasa, 01 Juli 2014

on Leave a Comment

Apa Itu OOP (Object Oriented Program) atau PBO (Pemrograman Berbasis Objek)

Halo guys, di thread pertama ane. Ane akan ngejelasin apa itu OOP atau PBO.

Mungkin ente udah pada tau betul daripada ane yang masih newbie, langsung aja cekibrot :

A. Pengertian OOP (Object Oriented Programming) 
       OOP (Object Oriented Programming) adalah suatu metode pemrograman yang berorientasi kepada objek. Tujuan dari OOP diciptakan adalah untuk mempermudah pengembangan program dengan cara mengikuti model yang telah ada di kehidupan sehari-hari. Jadi setiap bagian dari suatu permasalahan adalah objek, nah objek itu sendiri merupakan gabungan dari beberapa objek yang lebih kecil lagi. Saya ambil contoh Pesawat, Pesawat adalah sebuah objek. Pesawat itu sendiri terbentuk dari beberapa objek yang lebih kecil lagi seperti mesin, roda, baling-baling, kursi, dll. Pesawat sebagai objek yang terbentuk dari objek-objek yang lebih kecil saling berhubungan, berinteraksi, berkomunikasi dan saling mengirim pesan kepada objek-objek yang lainnya. Begitu juga dengan program, sebuah objek yang besar dibentuk dari beberapa objek yang lebih kecil, objek-objek itu saling berkomunikasi, dan saling berkirim pesan kepada objek yang lain.

B. Konsep OOP (Object Oriented Programming) 
1. Kelas Abstrak (Class Abstraksi)
2. Enkapsulasi (encapsulation)
3. Pewarisan (Inheritance)
4. Polimorfisme (polymorphism)

1. Kelas Abstrak (Class Abstraksi)
    • Kelas merupakan deskripsi abstrak informasi dan tingkah laku dari sekumpulan data.
    • Kelas dapat diilustrasikan sebagai suatu cetak biru(blueprint) atau prototipe yang digunakan untuk menciptakan objek.
    • Kelas merupakan tipe data bagi objek yang mengenkapsulasi data dan operasi pada data dalam suatu unit tunggal.
    • Kelas mendefinisikan suatu struktur yang terdiri atas data kelas (data field), prosedur atau fungsi (method), dan sifat kelas (property).
2. Enkapsulasi (encapsulation)
    • Istilah enkapsulasi sebenarnya adalah kombinasi data dan fungsionalitas dalam sebuah unit tunggal sebagai bentuk untuk menyembunyikan detail informasi.
    • Proses enkapsulasi memudahkan kita untuk menggunakan sebuah objek dari suatu kelas karena kita tidak perlu mengetahui segala hal secara rinci.
    • Enkapsulasi menekankan pada antarmuka suatu kelas, atau dengan kata lain bagaimana menggunakan objek kelas tertentu.
    • Contoh: kelas mobil menyediakan antarmuka fungsi untuk menjalankan mobil tersebut, tanpa kita perlu tahu komposisi bahan bakar, udara dan kalor yang diperlukan untuk proses tersebut.
3. Pewarisan (Inheritance)
    • Kita dapat mendefinisikan suatu kelas baru dengan mewarisi sifat dari kelas lain yang sudah ada.
    • Penurunan sifat ini bisa dilakukan secara bertingkattingkat, sehingga semakin ke bawah kelas tersebut menjadi semakin spesifik.
    • Sub kelas memungkinkan kita untuk melakukan spesifikasi detail dan perilaku khusus dari kelas supernya.
    • Dengan konsep pewarisan, seorang programmer dapat menggunakan kode yang telah ditulisnya pada kelas super berulang kali pada kelas-kelas turunannya tanpa harus menulis ulang semua kodekode itu.
4. Polimorfisme (polymorphism)
    • Polimorfisme merupakan kemampuan objekobjek yang berbeda kelas namun terkait dalam pewarisan untuk merespon secara berbeda terhadap suatu pesan yang sama.
    • Polimorfisme juga dapat dikatakan kemampuan sebuah objek untuk memutuskan method mana yang akan diterapkan padanya, tergantung letak objek tersebut pada jenjang pewarisan.
    • Method overriding.
    • Method name overloading.
C. Karakteristik OOP (Object Oriented Programming) 
  • Semua adalah objek.
  • Komputasi dilakukan dengan komunikasi antar objek. Setiap objek berkomunikasi dengan objek yang lain melalui pengiriman dan penerimaan pesan.
  • Sebuah pesan merupakan permintaan atas sekumpulan aksi dengan semua argumen yang diperlukan untuk menyelesaikan suatu tugas tertentu.
  • Setiap objek memiliki memori sendiri, yang dapat terdiri dari objek-objek lainnya.
  • Setiap objek adalah wakil atau representasi dari suatu kelas. Sebuah kelas dapat mewakili sekelompok objek yang sama.
  • Kelas merupakan kumpulan tingkah laku yang berkaitan dengan suatu objek. Jadi, semua objek yang merupakan wakil dari kelas yang sama dapat melakukan aksi yang sama pula.
  • Kelas-kelas diorganisasikan ke dalam struktur pohon yang berakar tunggal, yang dinamakan dengan jenjang pewarisan (inheritance hierarchy).
  • Setiap objek pada umumnya memiliki tiga sifat, yaitu keadaan, operasi dan identitas objek.
  • Operasi merupakan tindakan yang dapat dilakukan oleh sebuah objek.
  • Keadaan objek merupakan koleksi dari seluruh informasi yang dimiliki oleh objek pada suatu saat.
  • Informasi yang terkandung pada objek tersebut pada akhirnya memberikan identitas khusus yang membedakan suatu objek dengan objek lainnya. 
Referensi :
2. Jeni-dasarpemrogramanjava.pdf
3. Codenhead-javabasic.pdf

Oke gan disini ane akan ngebahas tentang Inheritance atau Pewarisan, ini bukan pewarisan tahta kerajaan broh ya walaupun nyerempet-nyerempet dikit.
Dibahas tadi kalau Inheritance itu adalah dimana class anak dapat mewarisi sifat dari class parent, ibaratnya udah kaya pelajaran Biologi jaman SMA broh. Jadi DNA si orang tua nular ke Anaknya ataupun pepatah berkata "Buah Jatuh Tidak Jauh Dari Pohonnya"

A. PENGERTIAN PEWARISAN (INHERITANCE)
Konsep inheritance ini mengadopsi dunia riil dimana suatu entitas/obyek dapat mempunyai entitas/obyek turunan. Dengan konsep inheritance, sebuah class dapat mempunyai class turunan.

Suatu class yang mempunyai class turunan dinamakan parent class atau base class. Sedangkan class turunan itu sendiri seringkali disebut subclass atau child class. Suatu subclass dapat mewarisi apa-apa yang dipunyai oleh parent class.

Karena suatu subclass dapat mewarisi apa apa yang dipunyai oleh parent class-nya, maka member dari suatu subclass adalah terdiri dari apa-apa yang ia punyai dan juga apa-apa yang ia warisi dari class parent-nya.

Kesimpulannya, boleh dikatakan bahwa suatu subclass adalah tidak lain hanya memperluas (extend) parent class-nya.

Dari hirarki diatas dapat dilihat bahwa, semakin kebawah, class akan semakin bersifat spesifik. Class mamalia memiliki seluruh sifat yang dimiliki oleh binatang, demikian halnya juga macan , kucing, Paus dan Monyet memiliki seluruh sifat yang diturunkan dari class mamalia.

Dengan konsep ini, karakteristik yang dimiliki oleh class binatang cukup didefinisikan didefinisikan dalam class binatang saja.

Class mamalia tidak perlu mendefinisikan ulang apa yang telah dimiliki oleh class binatang, karena sebagai class turunannya, ia akan mendapatkan karakteristik dari class binatang secara otomatis. Demikian juga dengan class macan, kucing, Paus dan monyet, hanya perlu mendefinisikan karakteristik yang spesifik dimiliki oleh class-nya masing-masing.

Dengan memanfaatkan konsep pewarisan ini dalam pemrograman, maka hanya perlu mendefinisikan karakteristik yang lebih umum akan didapatkan dari class darimana ia diturunkan.


B. DEKLARASI PEWARISAN (INHERITANCE)

Deklarasi yang digunakan adalah dengan menambahkan kata kunci extends setelah deklarasi nama class, kemudian diikuti dengan nama parent class-nya. Kata kunci extends tersebut memberitahu kompiler Java bahwa kita ingin melakukan perluasan class.

public class B extends A { … }

Pada saat dikompilasi, Kompiler Java akan membacanya sebagai subclass dari class Object.

public class A extends Object { … }

C. KAPAN KITA MENERAPKAN INHERITANCE?
Kita baru perlu menerapkan inheritance pada saat kita jumpai ada suatu class
yang dapat diperluas dari class lain.

Misal terdapat class Pegawai public class Pegawai { public String nama; public double gaji; } Misal terdapat class Manager public class Manajer { public String nama; public double gaji; public String departemen; }

Dari 2 buah class diatas, kita lihat class Manajer mempunyai data member yang identik sama dengan class Pegawai, hanya saja ada tambahan data member departemen.

Sebenarnya yang terjadi disana adalah class Manajer merupakan perluasan dari class Pegawai dengan tambahan data member departemen.

Disini perlu memakai konsep inheritance, sehingga class Manajer dapat kita tuliskan seperti berikut :

public class Manajer extends Pegawai { public String departemen; }

D. KEUNTUNGAN INHERITANCE


1. Subclass menyediakan state/behaviour yang spesifik yang membedakannya dengan superclass, hal ini akan memungkinkan programmer Java untuk menggunakan ulang source code dari superclass yang telah ada.

2. Programmer Java dapat mendefinisikan superclass khusus yang bersifat generik, yang disebut abstract class, untuk mendefinisikan class dengan behaviour dan state secara umum.

E. ISTILAH INHERITANCE

Extends
Keyword ini harus kita tambahkan pada definisi class yang menjadi subclass.

Superclass Superclass digunakan untuk menunjukkan hirarki class yang berarti class dasar dari subclass/class anak.

Subclass Subclass adalah class anak atau turunan secara hirarki dari superclass.

Super Keyword ini digunakan untuk memanggil konstruktor dari superclass atau menjadi variabel yang mengacu pada superclass.

Methode Overriding Pendefinisian ulang method yang sama pada subclass

Dalam inheritance, method overriding berbeda dengan method overloading. Kalau method overriding adalah mendefinisikan kembali method yang sama, baik nama method maupun signature atau parameter yang diperlukan dalam subclass, kalau method overloading adalah mendefinisikan method yang memiliki nama yang sama, tetapi dengan signature yang berbeda dalam definisi class yang sama.

Ane akan ngasih contoh coding dikit beserta SS (Screen Shot) nya :

1. Class MenuPilih
public class MenuPilih{
    public static void main(String args[]){
        String dataString;

        System.out.println("Silahkan Masukan Nomor Pilihan : " );
        System.out.println("1. Kelas Manusia." );
        System.out.println("2. Kelas Bapak." );
        System.out.println("3. Kelas Ibu." );
        System.out.println("4. Kelas Anak Laki-laki." );
        System.out.println("5. Kelas Anak Perempuan." );
        System.out.println("Ketik Nomor Pilihan :" );
        dataString = InputKeyboard.inputString();
        int pilih = Integer.valueOf(dataString).intValue();

        switch(pilih){
        case 1:
            Manusia objManusia=new Manusia();
            System.out.println("Kelas Warisan Sifat Manusia adalah:");
            objManusia.show();
        break;

        case 2:
            Bapak objBapak=new Bapak();
            System.out.println("Kelas Warisan Sifat Bapak adalah:");
            objBapak.show();
        break;

        case 3:
            Ibu objIbu=new Ibu();
            System.out.println("Kelas Warisan Sifat Ibu adalah:");
            objIbu.show();
        break;

        case 4:
            AnakLaki objAnakLaki=new AnakLaki();
            System.out.println("Kelas Warisan Sifat Anak Laki-laki dari Bapak adalah:");
            objAnakLaki.show();
        break;

        case 5:
            AnakPerempuan objAnakPerempuan=new AnakPerempuan();
            System.out.println("Kelas Warisan Sifat Anak Perempuan dari Ibu adalah:");
            objAnakPerempuan.show();
        break;

        default:
        System.out.println("Silahkan Pilih angka 1,2,3,4 atau 5");}
    }
}

Class PilihMenu : adalah class untuk memanggil semua class yang sudah terinclude.

2. Class Manusia

public class Manusia{
    public String namaSifat,sifat1,sifat2,sifat3;
    public String sifat4,sifat5,sifat6,sifat7;

    public Manusia(){
        sifat1="Marah";
        sifat2="Senyum";
        sifat3="Malas";
        sifat4="Minta Duit";
        sifat5="Kasih Duit";
        sifat6="Masak";
        sifat7="Makan";
    }

    public void show(){
        System.out.println("    1. "+sifat1);
        System.out.println("    2. "+sifat2);
        System.out.println("    3. "+sifat3);
        System.out.println("    4. "+sifat4);
        System.out.println("    5. "+sifat5);
        System.out.println("    6. "+sifat6);
        System.out.println("    7. "+sifat7);
    }
}
Class Manusia adalah class parent, karena sifat dari Class Manusia dapat diturunkan ke Class Child nantinya.

3. Class Bapak
public class Bapak extends Manusia{
    public String sifat8,sifat10;
    private String sifat9,sifat11;

    public Bapak(){
        sifat8="Tidur";
        sifat9="Bekerja";
        sifat10="Nonton";
        sifat11="Rokok";
    }

    public void show(){
        System.out.println("    1. "+sifat1);
        System.out.println("    2. "+sifat2);
        System.out.println("    3. "+sifat3);
        System.out.println("    4. "+sifat4);
        System.out.println("    5. "+sifat5);
        System.out.println("    6. "+sifat6);
        System.out.println("    7. "+sifat7);
        System.out.println("    8. "+sifat8);
        System.out.println("    9. "+sifat9);
        System.out.println("    10."+sifat10);
        System.out.println("    11."+sifat11);
    }
}
4. Class Anak Laki
public class AnakLaki extends Bapak{
    public String sifat12,sifat13,sifat14;

    public AnakLaki(){
        sifat12="Main";
        sifat13="Sekolah";
        sifat14="Olahraga";
    }

    public void show(){
        System.out.println("    1. "+sifat1);
        System.out.println("    2. "+sifat2);
        System.out.println("    3. "+sifat3);
        System.out.println("    4. "+sifat4);
        System.out.println("    5. "+sifat5);
        System.out.println("    6. "+sifat6);
        System.out.println("    7. "+sifat7);
        System.out.println("    8. "+sifat8);
        /*System.out.println("     9. "+sifat9);*/
        System.out.println("    10."+sifat10);
        /*System.out.println("     11. "+sifat11);*/
        System.out.println("    12."+sifat12);
        System.out.println("    13."+sifat13);
        System.out.println("    14."+sifat14);
    }
}


Screen Shot :


Oke broh, segini dulu thread dari ane. Kalo ada Kekurangan mohon maap yak :D
Diberdayakan oleh Blogger.