Java Reflection Notes – getDeclaredAnnotations vs getAnnotations method

This is just going to be a very short notes about difference between the getDeclaredAnnotations and getAnnotations method of Java java.lang.Class class.

I was googling for the answer but didn’t immediately got any article that explains it, so I thought why I not create it myself.

So what is the difference: Continue reading “Java Reflection Notes – getDeclaredAnnotations vs getAnnotations method”

How SQL Index Affects Query Speed Performance

Ok, so maybe I’m done with the Database Management course, but that doesn’t mean that I’m done playing around with the database. This is just some easy to follow guide how to see the difference that an index made in a real database system using MySQL.

To see the significant time difference of a query with and without index, we will need to generate a significant amount of records and you know I’m not talking about a hundred or two hundred records here, I’m talking about at least one hundred thousand (100,000) records to one million (1,000,000) records.

The first question that probably come to your mind is ‘How can I create such huge amount of data?’. The answer is you don’t, let an application do that for you, and its name is Benerator. Anyway, let’s see the steps I did for this query performance test.

Continue reading “How SQL Index Affects Query Speed Performance”

How to Find Candidate Key(s)

As my final exam on Database Management Course closely approaching, I think I’m a bit forced (in a good way) to write some notes on the topics I’ve learned so far. This time it’s the notes on how to find candidate key of a given relation.

Lately after I started post my database notes on conflict and view serializability, and BCNF and 3NF check, I see increased visitors traffic to my blog. Some visitors actually visited my blog to find how to find candidate keys of a relation. I just have the time now to write this post, hopefully it’s not really too late.

Enough for the introduction, get your pencil and paper, let’s find that candidate keys!

Continue reading “How to Find Candidate Key(s)”

Getting Started using Apache OpenJPA

Few weeks ago we were required to learn an Object Relational Mapping (ORM) concept in our Introduction to Database Management System course. The ORM our professor wanted us to use is Apache OpenJPA. Not really sure what was the reason he chose Apache OpenJPA over JBoss Hibernate that is more commonly used in the industry.

Although both Hibernate and OpenJPA are JPA compliant, which means that they follow the JPA standards that were set by Java, tutorials and discussion of OpenJPA is a lot fewer than of Hibernate. This means that whenever we encounter trouble with OpenJPA, the answer is not always there.

What makes it even a bit worse is that even getting started with OpenJPA is not that easy. So just in case any of you have problem with it. This is my notes and tutorial of how to kickstart using OpenJPA with Eclipse.

Continue reading “Getting Started using Apache OpenJPA”

How To Check if a Relation is in BCNF, 3NF, or Both

Another note of my database lecture class regarding Normalization and checking whether a relation is in BCNF, 3NF, or both.

The textbook that I use is “Database Management System” by Ramakrishnan and Gehrke and though it is a very comprehensive textbook, it is not that easy to understand. The discussion about BCNF, and 3NF was so wordy and has few examples.

So this is my way of making notes that will help myself on the final exam later, and I hope it can help you also understanding the BCNF and 3NF relation.

Continue reading “How To Check if a Relation is in BCNF, 3NF, or Both”

How to check for View Serializable and Conflict Serializable

This is a note for myself about how to check whether a schedule is view serializable, conflict serializable, or not.

There is various resources in the internet about how to do this, but the examples are a bit scattered, so in this post I just want to make a neat note on how to do it properly with several examples that can cover many possibilities as well.

Let’s get started! Continue reading “How to check for View Serializable and Conflict Serializable”

Belajar Programming Sendiri Dalam Sepuluh Tahun

Bookshelf at NEU CCIS Lab
Bookshelf at NEU CCIS Lab by djitz!

oleh: Peter Norvig

(disadur dari Teach Yourself Programming in Ten Years)

Mengapa semua orang terburu-buru?

Masuklah ke sebuah toko buku dan anda akan melihat buku mengenai bagaimana “Belajar Java dalam 7 Hari” dan banyak variasi lainnya yang menawarkan untuk mengajarkan Visual Basic, Windows, Internet, dan sebagainya dalam beberapa hari atau jam. Saya melakukan power search di

pubdate: after 1992 and title: days and (title: learn or title: teach yourself)

dan mendapatkan 248 hasil. 78 hasil pertama adalah buku komputer (no. 79 adalah “Belajar Bahasa Bengali dalam 30 hari“). Lalu saya mengganti “hari” dengan “jam” dan mendapatkan hasil yg luar biasa mirip: 253 buku, dengan 77 buku komputer dan diikuti dengan “Belajar Grammar dan Tata Bahasa dalam 24 jam” di nomor 78. Dari 200 hasil pertama, 96% adalah buku-buku komputer.

Kesimpulannya adalah entah orang-orang sekarang ini terburu-buru untuk belajar tentang komputer, atau komputer adalah hal yang sangat mudah dipelajari dari hal-hal lainnya. Tidak ada buku untuk belajar Beethoven, atau Fisika Kuantum, atau bahkan Melatih Anjing dalam beberapa hari. Dr. Felliesen et al. mengakui tren ini dalam buku mereka “Bagaimana Mendesign Program“, dimana mereka mengatakan “Memprogram dengan jelek sangat mudah. Orang-orang Idiot bisa mempelajarinya dalam 21 hari, bahkan walaupun mereka betul-betul bodoh.” Continue reading “Belajar Programming Sendiri Dalam Sepuluh Tahun”