Skip to main content


Showing posts from 2010

Hibernate-Secondary Table Annotation..

When using Hibernate with annotation, SecondaryTable needs to be used carefully while using the Discriminator. We assume that there is a table called Inventory which is the parent table that has common elements including Id, createDate, modifiedDate, SKU#, and productType.
The other tables, which are children of the Inventory table, are TV_Inventory, DVD_inventory etc.. In this example, we consider TV_Inventory which inherits from Inventory (in terms of objects).

@Table(name = "INVENTORY")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "PRODUCT_TYPE", discriminatorType = DiscriminatorType.STRING, length = 20)
@SequenceGenerator(name = "InventorySequence", sequenceName = "INV_SEQ", allocationSize = 1)

public abstract class Inventory {
 // getters and setters with other annotations for the columns and relevant methods.

Consider the child object associated with the table TV_INVENTORY. The outline is shown below:


Binary Digits.

Consider the number 783 which can be obtained by:
7 x102=7008 x101= 803 x100= 378310Total= 78310
In the decimal system, we are counting how many 10s, 100s, 1000s, 10000s etc. there are. Then we are multiplying the number depending on where it is positioned, and finally, we add them up.

If we were to do the same to the 8th base, then the above table will look as follows:

1 x83=5124 x82=2166 x81=487 x80=714678Total= 78310
Now the number 78310 ~= 14678. This means that any number (like 783) can be written to any number base; even its own. So in computers we are interested in binary digits, as the switches in circuits are either ON or OFF. With this in mind, the number above (783) would be written in binary form as follows:

1 x29=5121 x28=2560 x27=00 x26=00 x25=00 x24=01 x23=81 x22=41 x21=21 x20=111000011112Total= 78310

This means that:
11000011112 ~=78310

Here is a sequence that may simplify this process a bit better:

20 = 1 = 12
21 = 2 = 102
22 = 4 = 1002
23 = 8 = 10…

4 Circles releases Word Frequency..

4 Circles released its application 'Word Frequency v1.1'.

This application counts the number of words in your essay and tells you the frequency of each word. This application is simple to use and helpful for bloggers, writers, journalists, students and speech writers. The application has 1 box for the text to be copied and pasted (left hand side) while clicking the button will count the total number of words in the essay.

This application is written in JDK 1.6, and runs on JRE 1.6.x or above. The user needs to copy the text and place it in the text box and click on the button to get the frequency in the grid. Please download the software here:
Word Frequency