January 2010

Hibernate Annotations – Mapping Inheritance

@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
name=”planetype”,
discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue(”Plane”)
public class Plane { … }

@Entity
@DiscriminatorValue(”A320″)
public class A320 extends Plane { … }

is different from

@MappedSuperclass
public class BaseEntity {
@Basic
@Temporal(TemporalType.TIMESTAMP)
public Date getLastUpdate() { … }
public String getLastUpdater() { … }

}

@Entity class Order extends BaseEntity {
@Id public Integer getId() { … }

}

Trying To Code
Whispering from the Cubicle

Comments (0)

Permalink

What Will Be Announced Tomorrow …

Who knows?

But won’t it be interesting if Apple releases a product where you’re forced to watch ads before you can continue to assess content from sites like New York Times. The web-camera at the front recognizes if a person has stopped watching the ad. To avoid having to watch the ads, you can just buy a subscription.

Whatever.

My bank account is going to take a hit soon.

Ignore This

Comments (1)

Permalink

Using FLARToolKit

So, never coded in ActionScript before. What to do?

Downloaded the starter kit from Saqoosha.net.

Went through the samples.

First step was to print out the marker that came with the started kit. Tested the SimpleCube sample. Everything works.

Now, try to generate a marker using my own image.

Found this online generator.

Substituted the name of my marker’s pattern in the code. Marker does not register now.

Why?

A little searching led to this:

new FLARCode( i_width:int , i_height:int , i_markerPercentWidth:uint = 50 , i_markerPercentHeight:uint = 50 );

I need to change the values passed to the constructor in the SimpleCube sample code because I had generated my marker with different settings.

After changing the values, the sample code works again.

Trying To Code

|

Comments (0)

Permalink

A Blank Canvas

What do you give a blog who is about to turn 3?

A Blank Canvas

Just in case the settings need to be changed so that the camera can be accessed:

Notes:

Never did any Flash ActionScript coding before this little project.

It was a good chance to learn a little about:

1. Papervision3D
2. FLARToolkit

Trying To Code

| | |

Comments (2)

Permalink

Which Half Is Chinese? Double-Barrelled Racial Classification …

Double-barrelled racial classification … What will our government think of next? Don’t they realize they are making it harder for us IT guys. Like way way harder.

Two conversations related to mixed heritage and this change:

Conversation 1 with my busty Indian friend.

Busty Indian Friend: I’m not pure Indian. A part of me is actually Chinese.

Me: Which part is Chinese?

Busty Indian Friend: Definitely not the top part.

Conversation 2 with colleagues.

Setting: In the office, discussing the implications of the changes in classification on IT systems and the confusion that might arise when people start filling up forms.

Colleague A: So let me ask you. What do you call a person whose father is Indian-Portuguese and mother is Chinese-Malay.

Me: Beautiful.

On Singapore
Overheard

Comments (0)

Permalink

Facebook Connect & Facebook Share

There is a difference between using the “fb:share-button” (XFBML) tag for a Facebook Connect site and using Facebook Share.

When using the “fb:share-button” tag on a Facebook Connect site, it is important that the site takes into account the Facebook login status of the user. When using Facebook Share, it is not necessary. If the user is not logged in, the user will be prompted to log into Facebook before sharing can occur.

Trying To Code
What I Learned Today

Comments (0)

Permalink

New Media & The Beating Of Their Chest

The Temasek Review was the first internet news site to report on the news, well before any of the newspapers owned by SPH and Mediacorp (read our article here)

The matter would have been kept under wraps if not for the wild speculations and rumors circulating in cyberspace after we published the news which finally forced Straits Times and Channel News Asia to report on it two days later.

The writers for Singaporean online sites that purport to be alternative source of news, opinions and analysis should really try to tone down the beating of the chest every time they think they have trumped the mainstream media owned by SPH and MediaCorp.

They really should stop defining themselves in terms of the other.

They really also should stop thinking of themselves as ‘alternative’. They should just focus on being a credible source of news, opinions and analysis.

Maybe then, they can start being the mainstream.

On Singapore
Tangled Web We Weave

Comments (0)

Permalink

How Guys Show Love To Each Other

Guys show love to each other by making fun of each other.

Harmless ribbing.

Three rules:

1: Don’t go for the jugular. When friends rib each other, they know not to go for a weak spot.

2: Don’t rib the other person to make yourself feel better or feel superior.

3: Spread the ribbing love.

If you are a victim of male ribbing, and,

1. Someone keeps going for the jugular, then know that he is a dick. Feel free to whack back. Everyone has a weakness. Use it. Find the green kryptonite and shove it up his ass.

2. If he is ribbing to make himself feel better – pity him. OR refer to rule 1. He is trying to establish a food-chain. No mercy.

3. If the love is being shared, don’t be sensitive. If the love isn’t being shared then:

a. If the whole group is ribbing you only, time to leave the group.
b. If only that guy is focusing fire on you, time to mobilize the group to whack him, but remember, if you are lower on the food chain this may potentially be fatal to your status in the group. If you’re not confident in your status in the group, then refer to rule 1.

Revenge is a dish best served cold.

Musing about Life

Comments (0)

Permalink

This Is Soulless

This has no meaning.

Being a monkey doing manual work just because that’s the way it has always been. Because the company, despite being around for so long has not bitten the bullet and dedicated resources to building the tools it needs to use so regularly.

Because labor is elastic, the tools are not focused on. Quote aggressively for projects and throw more and cheap labor onto the problem.

It feels like we are becoming like the Indian company I used to work for.

This is soulless.

Of course, we (i.e. the staff) could dedicate our own time outside of office hours to create the tools we need.

But why should we?

Whispering from the Cubicle

Comments (0)

Permalink

The Problem With WordPress

I love WordPress but its popularity and simplicity is a problem (to some people).

Why?

Let’s just say I love WordPress as a blogging tool. It is easy to use, easy to extend with plugins and is the venerable Swiss Army Knife of blogging tools.

The problem starts when people start using it as a CMS. The truth is, WordPress needs to do more contortions than a Cirque du Soleil performer for it to be an effective CMS.

To be fair, WordPress has never pretended to be a CMS. From its site:

WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.

The problem actually has much deeper roots than developers trying to fit WordPress into a hole that it was not made for. The problem begins because when it comes to the web, people conflate the following activities:

1. Content Generation
2. Content Publishing
3. Content Management

Let’s think about this with an example.

Say I work for a site that publishes posts on interesting stuff that happen in Singapore.

Say I want to write a post about birds in Singapore. I will go out and take photos. Do some research. Write up a post. Find some related sites. Link to those sites in my post. Associate relevant photos with the post.

I’m generating my content.

Now, in WordPress, when I am generating this content, as the writer, I am generally responsible for arranging where the photos appear in the post. If there is a colleague who finally decides where the photos are placed relative to the text, the same interface used to write the text is used (i.e. either the Visual or HTML editor).

In fact, the person publishing the post (the final action before the content can be seen by readers) should be responsible for where the photos are. To have a coherent site design, the layout of every post needs to be taken into account. The current post editors (i.e. Visual and HTML) for WordPress allows the designer to control the look of a post, however it needs the designer to know the existing code (i.e. CSS) for the site. Also, WordPress allows the writer to control the look of a post with no consideration for the look of the site.

Content Management occurs when an information architect decides on how to categorize and tag the published post making it easily available to readers and search engines.

With regards to Content Generation, I believe the current Visual and HTML editors used by WordPress (and other similar tools) is stuck in the Microsoft Office era. The tools are not fitting the way we actually work when producing content for the web.

Tangled Web We Weave

| |

Comments (0)

Permalink