sequence

Event Tracking

I want to understand event cycles. I have a form with a grid and textboxes. It has a grid, bound to DataTable, and textboxes bound to same table too. I'm trying to debug something and need to know how to identify ALL events fired in the form to see what may solve an issue for me. Anyhow, unless I explicitly subclass every class on my...

Looking for an algorithm to spit out a sequence of numbers in a (pseudo) random order

Suppose I have a sequence of numbers: {n, n+1, n+2, ... n + m} Without storing the numbers ahead of time I want to create a function f(), which given the sequence {1,2,3,...m} will spit out the original set in a random (or at least pseudo random) order. For example assume my sequence is {10, 11, 12, 13, 14, 15, 16, 17} f(1) could ...

Why does the empty string not match as Seq.empty?

During some experimentation around question Pattern matching a String as Seq[Char], I ran across another weird matching phenomenon. Consider the following code that treats a string as a sequence of characters: def %%&#(input: String) : String = { val uha : Seq[Char] = input uha match { case Seq() => "Empty" case...

Sequenced video playback (cutlists) in Java.. can it be done?

If I have a bunch of video files, all in precisely the same format, shape, whatever, then can I play them back seamlessly without jumps or gaps? The effect from the end user's point of view would be as though they are watching one video. I understand that this is possible in DirectX, but I'd rather use Java if possible. ...

Windows/C# system-level sequential number generator?

Is there a managed system-level sequential number generator? DateTime.Now.Ticks won't do because the operations I'm doing sometimes occur more than once per tick. Requirement Clarifications: Process agnostic - there's really only one process that would be accessing this. Performance is critical! This is used for logging impressions ...

How to create an Oracle sequence starting with max value from a table?

Trying to create a sequence in Oracle that starts with the max value from a specific table. Why does this not work? CREATE SEQUENCE transaction_sequence MINVALUE 0 START WITH (SELECT MAX(trans_seq_no) FROM TRANSACTION_LOG) INCREMENT BY 1 CACHE 20; ...

Increment a sequence twice in DB2

I need to get the next value of a sequence twice in DB2 (version 9.1). Rather than executing the following twice: SELECT nextval FOR schema.sequence AS id FROM dual I would like to do something like: SELECT nextval FOR schema.sequence AS id1, nextval FOR schema.sequence AS id2 FROM dual Except the above only increments it o...

Checking sequence with SQL query.

I have a table orders that keeps all order from all our stores. I wrote a query to check the sequence orders for each store. It looks like that. select WebStoreID, min(webordernumber), max(webordernumber), count(webordernumber) from orders where ordertype = 'WEB' group by WebStoreID I can check it all orders are present with this qu...

HiLo or identity?

Just wanted to get some opinions on primary keys - would it be better to use identity/sequence numbers or use a HiLo strategy (query for the high value and increment the low value on the app itself)? ...

Oracle: sequence MySequence.currval is not yet defined in this session

The title kind of says it all. What does this mean, and how can I get around it? SELECT MySequence.CURRVAL FROM DUAL; Result: ORA-08002: sequence MySequence.CURRVAL is not yet defined in this session ...

The shortest Binary sequence to cover Dec numbers 0-99

Consider the set of strings S that contains the binary representation of the numbers 0 to 99. What is the shortest string T such that every element of S is a substring of T? ...

Extract single element from list in F#

I want to extract a single item from a sequence in F#, or give an error if there is none or more than one. What is the best way to do this? I currently have let element = data |> (Seq.filter (function | RawXml.Property (x) -> false | _ -> true)) |> List.of_seq |> (function head :: [] -> head | head...

Sequence comparison in java.

I'm looking for a standard algorithm/code (Java) which compares two integer lists (old and new) and gives a third result list which provides actions to convert the 'old' list into the 'new' list. For example: old-> 1, 2, 3, 4 new-> 9, 2, 3, 6, 4 so the result should be something like: 1-, 9+, 2, 3, 4-, 6+, 4+ Here, the suffix: ...

Replace a number in Netbeans editor with incrementing number

Hello to all I have some code in Netbeans 6.1 editor that looks like this fooString(8) fooString(8) fooString(8) fooString(8) foostring2(8) foostring3(8) foostring4(8) foostring5(8) foostring6(8) foostring7(8) foostring7(9) foostring7(10) foostring7(11) foostring7(12) and i want to convert it to fooString(1...

Continuous sequences in SQL

Having a table with the following fields: Order,Group,Sequence it is required that all orders in a given group form a continuous sequence. For example: 1,2,3,4 or 4,5,6,7. How can I check using a single SQL query what orders do not comply with this rule? Thank you. Example data: Order Group Sequence 1 1 3 2 1 4 3 1 5 4 1 6 ...

How do you create an auto-incrementing revision number unique to a key in PGSQL?

Assuming I have the following tables. PARENT: PARENT_ID serial, DESCRIPTION character varying(50) CHILD: PARENT_ID integer, CHILD_ID integer, DESCRIPTION character varying(50) What I would like to see is each row in CHILD having a CHILD_ID that starts at 1 and increments by 1, unique per PARENT_ID. It would be similar to a revision n...

Problem in displaying sequence of DICOM images using QT

Hello, i'm working in Linux [GCC Compiler] , i'm using Eclipse with CDT + QT to compile I need to display sequence of DICOM images using QT window and OpenGL functions pls let me know which is the function to display sequence of images i'm using 3 functions 1) initiallizeGL() to initallize OpenGL functions. 2) resizeGL() instead of g...

How can you make a sequence of optional items which must be in order in an XML schema?

What I want to do is create a sequence element in an XML schema such that the contents must be in order, but may not all be present. For example, the schema would be something like this: <xs:element name="rods" maxOccurs="1" minOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="green" type="xs:positiveInteger" /> <xs:...

MYSQL - generating subset sequence in a table

Hi, I have the following table Id Value 1 3 1 12 1 67 2 7 2 99 5 30 5 33 5 4 5 87 5 12 5 1 I'd like to update it to have this table. Id UniqueIdBySubSet Value 1 1 3 1 2 12 1 3 67 2 1 7 2 ...

sequence ID for handling reliability

I'm trying to figure out a simple way to handle reliability for UDP messages. I figured I would just send each one with a sequencing ID and by comparing the ID to the one previously received, a loss can be detected. I would normally just use integers however the idea that it would just keep incrementing indefinitely did not sit right wit...