sequence

Determining an Arbitrary Range of Digits in a Target Base from a Sequence and Source Base

If I have a function f that computes element m of a sequence of digits in base b, is it in general possible to write a function g that computes element n of the corresponding sequence in base c ? As a contrived example, say f produces binary and g produces hexadecimal: f(m) 1, 0, 1, 0, 1, 0, 1, 0, ... g(n) A, A, ... Now say f is i...

CORBA sequences: can I define sequences of objects w/ methods?

Hello, I have an interface with a method that should return a list of items, and each item should have certain methods associated with it. For example, I want to define a method listAllItems() that returns a bunch of "item" objects which have methods attached to them (so I can have the client process pick one of the items and say itemo...

Hibernate/Oracle seqhilo generator

Hi, I'm trying to configure a seqhilo generator for a Hibernate application on Oracle. <id name="idTest" type="int"> <column name="ID_TEST" precision="6" scale="0" /> <generator class="seqhilo"> <param name="sequence">S_TEST</param> <param name="max_lo">1000</param> </generator> </id> I created...

Hibernate, mapping of foreign keys that have been generated by a sequence in the parent table

I have a 1:n relation in the database and java objects that represent the relation with hibernate. The primary key of the parent table is generated with a database sequence, the child object uses the primary key of the parent object as foreign key. I create a new parent object including a set of new child objects. Then I try to persist ...

How do I generate this specific sequence of numbers?

Apparently there is no predefined list available in .net. I'd like to use a number of standard colors, e.g. something like red, green, blue, yellow, ... i.e. the typical colors consisting of 00 and FF components, followed by those with additional 7F components, ... Is there a way to retrieve these "standard" colors or do I have to writ...

Finding a Value within a Range in a List of Tuple Values in Python

I'm trying to get the Body Mass Index (BMI) classification for a BMI value that falls within a standard BMI range - for instance, if someone's BMI were 26.2, they'd be in the "Overweight" range. I made a list of tuples of the values (see below), although of course I'm open to any other data structure. This would be easy to do with SQL's...

MySQL UPDATE values with sequence 1,2,3, ...

Hello, I have table with position atribute 'posit' with unknown values (in my example '0') and I want to UPDATE it to 1,2,3, ... BEFORE: _______________ | title | posit | |---------------| | test | 0 | |-------|-------| | test | 0 | |-------|-------| | test | 0 | |-------|-------| | test | 0 | '---------------' ...

Detecting rare incidents from multivariate time series intervals

Given a time series of sensor state intervals, how do I implement a classifier which learns from supervised training data to detect an incident based on a sequence of state intervals? To simplify the problem, sensor states are reduced to either true or false. Update: I've found this paper (PDF) on Mining Sequences of Temporal Intervals ...

Adobe Flash Player - video for playing a given .jpeg image sequence ??

Is there any possible way to play a .jpeg sequence using .flv player on-the-fly ? I mean, by not needing to convert the entire sequence into one single .flv ? Since I´m not familiar with flash neither action script, I was surfing the web in hope to find any templete or tips about similar things to that but I couldn´t... I will be very ...

Observable from Sequence in F#

Is there a way to creating an observable from a sequence in F#? The required behaviour is that an observer subscribing to the resulting observable receives all the values of the sequence one at a time. Edit: The question can be framed as: Is there an equivalent to Rx.Observable.FromArray([1,2,3]) as shown here in F#? Edit 2: Thanks ev...

On performance of Clojure's `first` function.

I saw the following example in Rich's video on sequences http://blip.tv/file/734409 about 33-36 minutes into it: (first "abcd") => \a Now, he say that this expands to (sort of): (first "abcd") => (first (seq "abcd")) => (first '(\a \b \c \d)) So, it looks like an O(N) operation because the full copy of the string is being made. Fir...

How to distinguish between a sequence and a mapping

I would like to perform an operation on an argument based on the fact that it might be a map-like object or a sequence-like object. I understand that no strategy is going to be 100% reliable for type-like checking, but I'm looking for a robust solution. Based on this answer, I know how to determine whether something is a sequence and I ...

PHP sequential numbering

Someone gave me a -1. Not displaying my source code anymore, this has been resolved. ...

Generating a random sequence with no repeats

Hi, I read a couple of posts here about generating random sequence without repeats (for example http://stackoverflow.com/questions/693880/create-random-number-sequence-with-no-repeats) and decided to implement it for my own need Actually it was an algorithm applying some non-destructive (reversible) operations with the bits of the cur...

How to create an algorithm type?

Say I have two sequences of numbers, A and B. How can I create an object to describe the relationship between the two sequences? For example: A: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9... B: 0, 2, 4, 6, 8, 10, 12, 14, 16, 18... B = 2A The relationship, f() is how we get from A to B. But given two arbitrary sequences, how can I construct...

Finding the longest down sequence in a Java array

Given this array int [] myArray = {5,-11,2,3,14,5,-14,2}; I must be able to return 3 because the longest down sequence is 14,5,-14. What's the fastest way to do this? PS: Down sequence is a series of non-increasing numbers. ...

What kind of algorithm is better for unordered sequence matching problem?

If I have two sequences (for example, string) // 01234567890123456789012 a = "AAACDDFFFEE1122VV1VAADD" // 0123456789012345678901 b = "DDFFAA11221DHHVV1VAAFE" I want to know the best substring matching (unordered) from b to a, for instance: optimal (6 matched parts, 19 characters of a matched) b a DDFF -> DDFF (4...

Manual inserts on a postgres table with a primary key sequence

Hi guys! I'm converting a MySQL table to PostgreSQL for the first time in my life and running into the traditional newbie problem of having no auto_increment. Now I've found out that the postgres solution is to use a sequence and then request the nextval() of this sequence as the default value every time you insert. I've also read that...

SQL(plus) performance with sequence

Hi All, I have to generate some million update from some table, to update themselves. I had just recently learned about parallel(tablename,threads) which really improved the performance in PLSQL developer when I had run something like this: select /* + parallel(table1,100) parallel(table2,100) */ 'update table1 set id = 1 where ...

String/Sequence Patterm Mining ! not matching !

Hi , it's a week i'm trying to find an answer for my question , i would appreciate if anyone can help . I've got a list of strings(originally list of sequences which can be viewed as list of strings) and i'd like to find a pattern (which is a string itself) withtin strings of this list , is there any java library which can i use or is t...