Trying To Code

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

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

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

Creating A Job Board For Programmers and Designers

For the last few months, I’ve been working on creating a job board for programmers and designers.

The design for the site was heavily influenced by 37signals’ job board. Right before launching, something about our site’s look still didn’t feel right. For want of a better phrase, I felt the site ‘wasn’t us’, where ‘us’ referred to Gwen and me.

One of the changes was to add the photo of the Lego figures taken by Ansik with a quote by Steve Jobs to the site’s design.

Do you want to spend the rest of your life selling sugared water or do you want a chance to change the world?

The quote resonated with us, especially me, because there are just so many great companies trying, or rather doing, great things that it doesn’t make sense to be stuck in a job you’re not satisfied with or a mundane job where you’re just a cog in the wheel.

So, if you know that you can make a difference, do check out the available jobs over at Triple Point’s Job Board.

2 other considerations were made when designing the front page of the site. The first was not to group the job listings by category. The other was not to include the ’standard’ categories found in other Singapore job sites. This was done to prevent a ‘ghost-town’ effect where there are too many categories with little or not job listings for them.

The job board is still a work in progress. If you have any comments on how to make it better or what is lacking in the current job boards, do share it.

The influence and the result:


Tangled Web We Weave
Trying To Code

| |

Comments (0)

Permalink

Eclipse Builders

Old article, but still useful to understand what’s going on above:

Incremental project builders provide a mechanism for processing resources in a project and producing some build output. The builder framework makes it easier to incrementally maintain that built state as the input resources change

Trying To Code

|

Comments (2)

Permalink

Selenium + HTTPS + Firefox

These two links were invaluable:

Selenium and HTTPS:

Create a new Firefox profile (firefox.exe -profileManager). In this case the name of the new profile is selenium-https-profile.

java -jar selenium-server.jar -firefoxProfileTemplate

Dealing with self-signed SSL certificates when running Selenium server with Firefox:

Delete everything in the directory except for the cert_override.txt and cert8.db files.

Trying To Code
What I Learned Today

|

Comments (0)

Permalink

Xvfb + Selenium

Xvfb:

In the X Window System, Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. From the point of view of the client, it acts exactly like any other server, serving requests and sending events and errors as appropriate. However, no output is shown. This virtual server does not require the computer it is running on to even have a screen or any input device.

Running Selenium on a Solaris server so that can run Cucumber tests via Hudson daily after each successful build. The problem was Selenium + Firefox had no display to output to.

The solution was to use xvfb and output to it.

Trying To Code
What I Learned Today

| |

Comments (0)

Permalink

Problems With MySQL and Rails 2.3

From here:

As I understood the client MySQL library doesn’t work well with Rails 2.3. We can resolve this by using the older MySQL client library (libmySQL.dll). You can get it here http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll.

Just put it in \bin\ and restart MySQL service.

http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

Trying To Code

|

Comments (0)

Permalink

Problems With Logging-1.2.2

Was having problems with logging-1.2.2,

In utils.rb, this section of code was having issues.

rescue LoadError, NoMethodError
retry if $use_rubygems and require('rubygems')
if $whiny_require
name ||= string
$stderr.puts "Required library #{string.inspect} could not be loaded."
$stderr.puts "Try:\tgem install #{name}"
end
raise
end

Solution:

1. Set the global variables $use_rubygems & $whiny_require in environment.rb to false and true respectively.
2. Comment out the retry line.

Trying To Code

Comments (0)

Permalink