sequence

Pseudorandom Sequence Generator not just a number generator.

I need an algorithm that pretty much will turn a unix timestamp into a suitably random number, so that if I "play back" the timestamps I get the same random numbers. And here's what I mean by suitably: Most humans will not detect a loop or pattern in the random numbers. It need not be cryptographically secure. All numbers must be capa...

Is it possible to have complexType and elements inside but without the sequence part

I hava a xml doc (and complex element) that is similar to this example: <xs:element name="employee"> <xs:complexType> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> But in my xml it shouldn't matter if I add firstna...

Hibernate does not generate identifier when using Oracle sequence

I have the following mapping @Entity @SequenceGenerator(name="sacpSequenceGenerator", sequenceName="SACP_SEQ") public class Sacp { private Integer id; @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="sacpSequenceGenerator") public Integer getId() { return this.id; } // other setter's a...

How to make a sequence diagram for this?

A group diary and time management system is intended to support the timetabling of meetings and appointments across a group of coworkers. When an appointment is to be made that involves a number of people, the system finds a common slot in each of their diaries and arranges the appointment for that time. If no common slots are available,...

R: 0-1 sequence without spaces?

Spaces are redundant when reporting a binary sequence. This code x <- '1 0 0 0 0 0 1 1 0 1 0 1 1 0 ' y<-gsub(' +', '', x) does the job so I can copy and paste from R. How do I do the same for 0-1 sequences (and other one-digit data) in others formats, e.g., x <- c(1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0) or toString(x) or whate...

Is it possible to match with decomposed sequences in F#?

I seem to remember an older version of F# allowing structural decomposition when matching sequences just like lists. Is there a way to use the list syntax while keeping the sequence lazy? I'm hoping to avoid a lot of calls to Seq.head and Seq.skip 1. I'm hoping for something like: let decomposable (xs:seq<'a>) = match xs with |...

Sequential Guid Generator C#

Is there any way to get the functionality of the Sql Server 2005+ Sequential Guid generator without inserting records to read it back on round trip or invoking a native win dll call? I saw someone answer with a way of using rpcrt4.dll but I'm not sure if that would be able to work from my hosted environment for production. Edit: Working...

Hexadecimal sequence in Oracle

Hi all, I would like to generate 16 char length hex decimal value as sequence. My database is Oracle and would like to know is it possible to do so? I checked the SEQUENCE in Oracle but I think its only for numericals. Any idea would be great help. Thanks in advance, Abdel Olakara ...

Need very simple 'sequence' for GetNextOrderNumber for SQL Server

I'm trying to make an even simpler function than the one described here to get the next value of an order number for a shopping cart. I don't care if there are gaps Only completed orders get an ID (i.e. I'm deliberately not using IDENTITY) Obviously there must not be duplicates I don't care about performance and locking. If we have so ...

CouchDB View, Map, Index, and Sequence

I think read somewhere that when a View is requested the "map" is only run across documents that have been added since the last time it was requested? How is this determined? I thought I saw something about a sequence number. Is this something that you can get to? Its not part of the UUID trailing on the _rev field is it? Any way to for...

Add single element to a sequence for an expression

Hi there. Imagine you would want to select all elements of one sequence all, except elements contained in sequence exceptions and single element otherException. Is there some better way to do this than? I'd like to avoid creating new array, but I couldn't find a method on the sequence that concats it with a single element. all.Except(e...

Stagger jQuery Animations

I want to animate a series of items in jquery 1.3, with each next item beginning halfway through the first animation. In otherwords, I want a half-queue effect. I attempted to use the below code, but it is not working. Does anyone have any ideas? $("h3").click(function(){ $(".projectItem").each(function (i) { if (i > 0...

Postgresql - Using subqueries with alter sequence expressions

My question is kind of simple. Is it possible to use subqueries within alter expressions in PostgreSQL? I want to alter a sequence value based on a primary key column value. I tried using the following expression, but it wouldn't execute. alter sequence public.sequenceX restart with (select max(table_id)+1 from table) Thanks in ...

jQuery Image Fade Sequence?

Hey, I have a question regarding jQuery and image fading. I have a bunch of images and I would like to fade each one sequentially to full opacity when you load the page. My html code is below: <div class='mod'> <img src='image-src' alt='' /> <div class='mod-text'> <h2>Title</h2> <p>Caption</p></div> </div> <div class='mod'...

Find sequences of digits in long integers efficiently

Is it possible to find a defined sequence in an integer without converting it to a string? That is, is it possible to do some form of pattern matching directly on integers. I have not thought of one but I keeping thinking there should be a mathematical way of doing this. That's not to say it is more efficient. (edit) I actually what num...

Trouble with Berkeley DB JE Base API Secondary Databases and Sequences

I have a class Document which consists of Id (int) and Url (String). I would like to have a primary index on Id and secondary index on Url. I would also like to have a sequence for Id auto-incrementation. So I create a SecondaryDatabase and then I create a Sequence. During initialisation of the Sequence I get an exception: Exception in ...

oracle date sequence?

Hi I have an oracle db and I need a table containing all the dates spanning 2 years; for example from 01/01/2011 to 01/01/2013. First I thought of a sequence but apparently the only supported type is number, so now I am looking for an efficient way to do this cheers hoax ...

Sequences not affected by transactions?

I have a table create table testtable( testtable_rid serial not null, data integer not null, constraint pk_testtable primary key(testtable_rid) ); So lets say I do this code about 20 times: begin; insert into testtable (data) values (0); rollback; and then I do begin; insert into testtable (data) values (0); commit; And f...

JavaScript event sequence

Some events in JavaScript fire before others. For example, with an input element, the keydown and keypress events fire first. Then, if the return value from those was not false, the input.value is updated. Then, the keyup event fires. Is there a web site where I can find a comprehensive list of all events and the order in which they are...

Mathematical technique to check intersection

Imagine there is a very very large room in the shape of a hollow cube. There are magic balls hanging in the air at fixed discrete positions of the room. No magic ball has another one exactly above it. If we take an imaginary horizontal plane of infinite area and pass through the cube, how can we be sure that the plane doesn't cut through...