bijection

Postgres: Unique reference from A to B

I want a bijection between the pair (tag1, tag2) and tag_id. CREATE TABLE tags ( question_id INTEGER NOT NULL, tag_id SERIAL NOT NULL, tag1 VARCHAR(20), tag2 VARCHAR(20), PRIMARY KEY(question_id, tag_id), (tag1, tag2) UNIQUE references tags(tag_id) #How? ); I want no ...

JBoss Seam - Can't @In annotations be used at the same time with accessor methods for different properties?

Hi, I generated a new form using sean-gen (seam new-form) and added another field to it using an @In annotation: @Stateful @Name("dummy") public class DummyBean implements Dummy { @Logger private Log log; @In StatusMessages statusMessages; @In private String bar; private String foo; public void doStuff() { ...

Is there "good" PRNG generating values without hidden state?

I need some good pseudo random number generator that can be computed like a pure function from its previous output without any state hiding. Under "good" I mean: I must be able to parametrize generator in such way that running it for 2^n iterations with any parameters (or with some large subset of them) should cover all or almost all v...

Symmetric Bijective Algorithm for Integers

I need an algorithm that can do a one-to-one mapping (ie. no collision) of a 32-bit signed integer onto another 32-bit signed integer. My real concern is enough entropy so that the output of the function appears to be random. Basically I am looking for a cipher similar to XOR Cipher but that can generate more arbitrary-looking outputs. ...

JBoss Seam: inject in @Create method possible?

Hi all, I cannot seem to be able to inject a Seam component inside the @Create method. I cannot find in the documentation any hint that this is not possible, which would verify whether I am making a mistake or not. Is it possible to inject inside the @Create? Cheers! ...

Seam Session scoped component vanishes in next request.

I have the Seam session-scoped component, CustomIdentity which overrides the standard Seam Identity (also session-scoped). The extended CustomIdentity has a property @Out(required=false, scope=ScopeType.SESSION)private User user In the overriden login() I define a User object, populated with information from the Principal of the Http...