Broke Up, Hi-jacking, and Deception

16/07/2009

Once in my peaceful days, a friend rang me up. She said that a friend of her got a problem with email. This friend got her email hi-jacked by her ex-boyfriend. So she couldn’t login to her email. That’s just for the start. The bigger problem is this ex also hi-jacked her Facebook account and start doing nasty things with her account. Pretty scary huh? Continue reading

Wanna Host Your Own Blog?

11/07/2009

Almost one year ago, I take a risky experiment. I tried to self-hosted my own Wordpress blog and bought myself a domain name. As you can see right now, I used second level domain provided by my own country, that is web.id. With this domain, I played around with setting own blog into one of free hosting provider. Ever since that time, some of my friends asking me about this hosting and domain. How to get the domain, how to buy a hosting, and all of other questions. And this article was dedicated to them and to you who wanna host your own blog.

This article is about some considerations we need to take before deciding what kind of hosting and domain do you need.

This article is NOT about detailed instructions in configuring and setting blog on our own hosting and domain. I wrote about these at another site in Bahasa Indonesia. You can read about that there (send me a comment if you want me to translate it into English).

So, you wanna host your own blog? Continue reading

Mr. Four Eyes

08/07/2009

It was in the early year of my undergrads study when I realized that I can’t do long distance reading. At those days, we got a course on a big hall with more than a hundred students in it, looking at small white boards at the front of the class. At closer range than this, my brain could still run text recognizer to determine what sentence is written. But at this big hall, I barely see nothing but a black curve in the white.

So then, I got ophthalmologist checked my eyes. The result: my right eye is -0.5 and my left is -0.25. Not too bad. It still small numbers compared to the others. Because of this, I rarely used my spectacles.  And it has been continued until just now.

Right now, almost five years after that. Actually I just feeling my eyes were still okay. I could still spend most of my time in front of computer with no problem. And there’re no classes yet. One that just bothered me is just that sometimes I must close my distance with monitor screens to read. So I decided to check my eyes again.

The result was quite surprising. My right is -0.5 and my left is -1.25. The person who tested my eyes said that the result wasn’t bad after all these five years. Yeah, not bad for a person who spend almost 15hrs a day in front of his computer. But because of this increase, I have decided to use my spectacles. Just using it make me feel 200% smarter than before, he3..

:cool:

Dang!

05/07/2009

I don’t know why, but I’m feeling lack in ideas lately. For your information, last month I only posted one article, and nothing more. I dunno what happened, but I hope I can overcome my laziness in writing then write a better post in the future.

Last, I hope this is not the last post of this month.

Why Generate Database Keys?

09/06/2009

Howdy.

Not so long ago, I created a GUI for data storage using Java and of course JDBC. I followed a tutorial about how to insert database records to the database table. The tutorial said that before we’re inserting new record to the database, we should generate unique key as record identity. The generation process handled by Java code. The tutorial use System.currentTimeMilis() function to create the key. So, the code will be look like this:

//set new id
Number time = System.currentTimeMillis();
Integer id = (time.intValue()/10000);

The generated key then being inserted to the database.

As you may realized, database systems usually have their own key generation technique. For example AUTO_INCREMENT attribute in MySQL. I followed the tutorial and sure it works. But, I tried database-generation key, and it works too. So, why we should bother generate our own keys?

The O’Reilly Java Author gave an explanation about that. They said:

However, using the supported key generation tools of your database of choice presents several problems:

  • Every database engine handles key generation differently. Thus, it is difficult to build a truly portable JDBC application that uses proprietary key generation schemes.
  • Until JDBC 3.0, a Java application had no clear way of finding out which keys were generated on an insert.
  • Automated key generation wreaks havoc with EJBs.

I got the point that the application should be portable. Who knows that someday we’ll migrating from one database systems to another? So the database generation key will be hard to control. 

Another detailed answer came from Scott Selikoff. He wrote a complete article about database key generation and gave an example:

Now, let’s say a user is in the process of creating a new record in your system. For each user record, you also have a set of postal addresses. For example, Bob may be purchasing items on NewEgg and have a home address and a work address. Furthermore, Bob enters his two addresses at the time he creates his account, so the application server receives the information to create all 3 records at once. In such a situation, you would normally have 3 records: 1 user record for Bob and 2 address records. You could add the address info in the user table, although then you have to restrict the number of addresses Bob can have and/or have a user table with a lot of extra columns.

Inserting Bob into the user table is straight forward enough, but there is a problem when you go to insert users into the address table, namely that you need Bob’s newly generated User Id in order to insert any records into the address table. After all, you can’t insert addresses without being connected to a specific user, lest chaos ensue in your data management system.

The problems will arise in complex database relationship. As we don’t know the generated key, we couldn’t set the foreign key of corresponding tables. I didn’t realize this because the GUI I made was using a simple database design. Maybe with no table relation at all.

So, I got my question answered. Do you have another answer for my question? Feel free to share.

Page 5 of 15« First...3456710...Last »