FAQ Database Discussion Community


Keep sequence created from BIGSERIAL when deleting table

postgresql,sequence,auto-increment,postgresql-9.2
I have a postgres table creating with the following SQL: CREATE TABLE mytable ( mytable_id BIGSERIAL NOT NULL, mytable_char VARCHAR(8) NOT NULL ) This creates the table as well as an implicit mytable_mytable_id_seq sequence. Now, after creating 1.000.000 records, I want to split this table into partitioned tables (using inheritance)....

R add columns indicating start and end for a sequence within columns

r,sequence
I have data as below. names=c(rep("a",4),rep("b",5),rep("c",2)) time=c(1,2,3,4,1,2,3,4,5,1,2) dd=data.frame(names,time) dd <- group_by(dd, names) dd <- mutate(dd, seq=seq_along(names)) extr <- summarise(dd, minw=min(time), maxw=max(time)) > dd Source: local data frame [11 x 3] Groups: names names time seq 1 a 1 1 2 a 2 2 3 a 3 3 4 a 4...

Edit Sequence values using sql developer interface

sql,oracle,oracle11g,sequence,oracle-sqldeveloper
I try to change the value of LAST_NUMBER in a sequence in sql developer v4 using the graphical interface only. When I click the edit icon next to the value I am unable to change the field. What I see is following: My question is: is there a way to...

Keypress event sequence on IE

javascript,events,sequence,keypress,explorer
I just noticed that the sequence of the keypress event is not executed the same way on Firefox and IE: on Firefox, if you keypress on a focused input, the character is written in the box, then the function attached to the event is fired. On IE it is the...

How should I generate the n-th digit of this sequence in logarithmic time complexity?

c,algorithm,sequence
I have the following problem: The point (a) was easy, here is my solution: #include <stdio.h> #include <string.h> #define MAX_DIGITS 1000000 char conjugateDigit(char digit) { if(digit == '1') return '2'; else return '1'; } void conjugateChunk(char* chunk, char* result, int size) { int i = 0; for(; i < size;...

Convert INSERT sequence into UPDATE sequence

sql,pdo,syntax,insert,sequence
i have a SQL INSERT sequence in PDO like: INSERT INTO property (id,name,addres...) VALUES (:id,:name,:address...) And i want to do a UPDATE sequence, with the same fields. The problem is that i have 150 fields and about 3 or 4 different sequences, so if i make the update syntax manually...

arithmetic sequence: use apply or map instead of for loop

javascript,sequence,apply
I have a for loop like so: var myary = []; for(i=0; i<3; i++){ myary[i] = i; } //yields [0, 1, 2] I'd like to accomplish the same with myary.apply() or a functional equivalent, but I am not familiar with generating arithmetic sequences via functional methods in JavaScript. Is this...

Having an error of setting array element with a sequence in a two dimensional vector

python,matrix,vector,sequence
I want to calculate a two dimensional vector with two for loops, each calculating some parameters. My inputs are: Temp= array([ 25., 30., 50., 25., 25., 25.]) Ir= array([ 1000., 500., 1000., 100., 200., 1000.]) In the first loop, I calculate the some vectors and in the inner loop, I...

F(n) = F(n-1) - F(n-2)

math,sequence,discrete-mathematics,cyclic
I came across this sequence in a programming contest F(n)= F(n-1)-F(n-2); Given F0 and F1 find nth term (http://codeforces.com/contest/450/problem/B) (the contest is over) Now the solution of this problem is like this The sequence take value f0, f1, f1-f0, -f0, -f1, f0 - f1 then again f0 and the whole...

I can't figure out this sequence - 11110000111000110010

python,algorithm,math,sequence,discrete-mathematics
NOTE: This is for a homework assignment, but the portion I have a question on is ok to ask help for. I have to script out a sequence 11110000111000110010 (i am using python) without using switches or if statements and only a maximum of 5 for and whiles. I already...

SQL - Need to populate sequences for records

sql,oracle,sequence,records
I have the below table (PART_MAP). PART | OFFER | --------+------------ part1 | offer01 | part1 | offer02 | part1 | offer03 | part1 | offer04 | part1 | offer05 | part2 | offer06 | part2 | offer07 | part2 | offer08 | part2 | offer09 | part2 | offer10...

Bug in my code: identifying sequence within another sequence

python,sequence,biopython
My current code: import re from Bio.Seq import Seq def check_promoter(binding_element,promoter_seq): promoter_seq = str(promoter_seq) residues = list() for i in range(0,len(promoter_seq)): if binding_element[0] == promoter_seq[i]: ind = promoter_seq[i] for j in range(0,len(binding_element)): if binding_element[0+j] == promoter_seq[i+j-len(binding_element)]: residues.append(i+j-len(binding_element)) return residues ESR1_promoter = Seq('''aagtcaggctgagagaatctcagaaggttgtggaagggtctatctacttt\...

python postgresql insert error while adding SEQUENCE for auto increment

python,postgresql,insert,syntax-error,sequence
Below is mainly everything that is dependent authorname="samuel" bugid=1222 filename="mila.txt" conn = None; cursor = None; conn = pg8000.connect(database="postgres", user="postgres", password="root", host="localhost") cursor = conn.cursor() def createTables(): cursor.execute("CREATE SEQUENCE FILE_id_seq") cursor.execute("CREATE TABLE FileTable(ID INT UNIQUE NOT NULL DEFAULT NEXTVAL('FILE_id_seq'), filename varchar(250) NOT null UNIQUE )") cursor.execute("CREATE SEQUENCE Author_id_seq") conn.commit() return...

How to go about a d-smooth sequence algorithm

algorithm,sorting,sequence,seq
I'm really struggling to design an algorithm to find d, which is the lowest value that can be added or subtracted (at most) to make a given sequence strictly increasing. For example.. say seq[] = [2,4,8,3,1,12] given that sequence, the algorithm should return "5" as d because you can add...

finding the lowest collatz sequence that gives more that 65 primes

python,sequence,primes,collatz,memorization
I have a task where I need to find the lowest Collatz sequence that contains more than 65 prime numbers in Python. For example, the Collatz sequence for 19 is: 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2,...

How to create a String and Integer sequence in Ruby?

ruby,string,integer,sequence
Aim The aim is to create a String and Integer sequence in Ruby, i.e., hello0, hello1, hello2. hello represents a String and the numbers: 1,2 and 3 are the integers. Attempt seq=(0..3).to_a returns 0, 1, 2, 3 Question How to create a String and Integer sequence in Ruby?...

Sequence vectorized

matlab,sequence,vectorization
How is it possible to create in a vectorized way, in Matlab, a sequence if I've the 2 vectors of startings and ending of the subsequences ? Example Input: A=[12 20 34] B=[18 25 37] I want to get C=[12 13 14 15 16 17 18 20 21 22 23...

Liquibase not dropping sequences on Postgres

postgresql,maven,sequence,liquibase
i'm driving crazy already as liquibase (on postgres) is not dropping sequences when running a liquibase:dropAll through the maven plugin. These sequences are created by liquibase itself through different changelogs. I've found that there was the same issue once for Derby but that is resolved already. Is anyone aware of...

Cocos2d-x. How to add action on the sprite after the previous one was finished

action,cocos2d-x,sequence
I add action on the sprite. auto moveBy = MoveBy::create(2, Vec2(moveX, moveY)); _Spr1->runAction(moveBy); I want to add another action on touch, but I want that the second one started after the first one is finished. And if I tap two times before first action stops, I want to create sequence...

XQuery - Doing math on elements within a sequence and aggregating results

function,operators,xquery,sequence,aggregation
I'm trying to execute a XQuery sum function in a multiplication of two XML elements, but it has been difficult to avoid the iteration in a sequence of elements. For example, consider this case: sample data: <Orders> <Order> <OrderKey>1</OrderKey> <LineItem> <LineNumber>1</LineNumber> <Quantity>41</Quantity> <ExtendedPrice>70848.0000</ExtendedPrice> <Discount>0.0913</Discount> <Tax>0.0663</Tax> <ReturnFlag>A</ReturnFlag>...

Returning True if a sequence appears in a list

list,python-3.x,boolean,sequence
I need to write a function that takes a list of ints nums and returns True if the sequence 1, 2, 3, .. appears in the list somewhere. My approach: def list123(nums): num = "" for i in nums: num += i if "1,2,3" in num: return True else: return...

How to create a sequence on selected values in MySQL?

mysql,sequence,case-statement,nextval
I'm trying to create a query which will select a team from a declared variable and then make the remaining teams "anonymous" by giving them generic brands and sequential IDs. For example, if my dataset has 3 different team names (ABC, DEF, and GHI), but I would only like the...

Longest Snake Sequence in an Array

python,arrays,sequence
Question : A set of numbers separated by space is passed as input. The program must print the largest snake sequence present in the numbers. A snake sequence is made up of adjacent numbers such that for each number, the number on the right or left is +1 or -1...

Time Series in R - reshape?

r,sequence
I'm trying to analyse an exported .ics file from outlook. The structure of the file is given in the following minimal example dataset d1 <- structure(list(start = structure(1:3, .Label = c("01.01.2014 09:00", "01.01.2014 18:00", "02.01.2014 08:00"), class = "factor"), end = structure(1:3, .Label = c("01.01.2014 17:00", "01.01.2014 19:00", "02.01.2014 11:00"),...

Custom List data structure implementing SequenceType with using of GeneratorOf struct

swift,generator,sequence
My attempts to understand Generators and Sequences lead me to an idea of implementing my own list data structure and implement protocols to use forIn loop. My code: class GSList<T> : SequenceType { var Next : GSList<T>? var Value : T init(_ value: T, next : GSList<T>?) { self.Value =...

Formula Sequence

c++,sequence,formula
I need help finding the formula of the sequence for the next problem. What I think and have for now is Sn=n(10^n-1)/9 but it just works in some cases... Here is the description of the problem: Description Sn is based upon the sequence positive integers numbers. The value n can...

Insert unique values after addition of a column in a table

sql,oracle,oracle11g,sql-update,sequence
We have a table with two columns and have added another column recently (named sequence_no) , Is there a way to insert unique values like , 1,2,3 for every row in the table ? eg table name : test desc test name varchar2 value varchar2 --> n_seq_no number select *...

Python: Check whether list is sequential or not

python,list,hex,iteration,sequence
Want a function / statement, to check whether all the values of mylist are sequential or not, which is hexadecimal list. For example: def checkmylist(mylist): #code returns True or False mylist1 = ['03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c','0d', '0e', '0f'] mylist2 = ['03', '05', '06', '07',...

R: Select multiple values from vector of sequences

r,vector,sequence,indices
In R I'm trying to figure out how to select multiple values from a predefined vector of sequences (e.g. indices = c(1:3, 4:6, 10:12, ...)). In other words, if I want a new vector with the 3rd, 5th, and 7th entries in "indices", what syntax should I use to get...

How do I break the string in output into 2 parts in this assembly code

assembly,output,sequence
So I want to break the break "The nth term in Fibonacci Series is " string into two: "The " and "th term in Fibonacci Series is ", print the first string, then print the value of n (say using WriteInt), then print the second string. But I can't seem...

How to use Oracle sequence with Hibernate + Spring

spring,oracle,hibernate,sequence
Inside my entity class package com.entity; // Generated May 23, 2015 10:43:49 PM by Hibernate Tools 4.3.1 import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * EmpTest generated by hbm2java */ @Entity...

Extracting the longest sequence from the tab delim file

r,sequence,fasta,longest-substring
I have tab delim file file which contains which contains the following information >fasta >ss_23_122_0_1 MJSDHWTEZTZEWUIASUDUAISDUASADIASDIAUSIDAUSIDCASDAS >ss_23_167_0_1 WEIURIOWERWKLEJDSAJFASDGASZDTTQZWTEZQWTEZUQWEZQWTEZQTWEZTQW >ss_23_167_0_1 MAASDASDWEPWERIWERIWER >ss_23_167_0_1 QWEKCKLSDOIEOWIOWEUWWEUWEZURZEWURZUWEUZUQZUWZUE >ss_45_201_0_1 HZTMKSKDIUWZUWEZTZWERWUEOIRUOEROOWEWERSDFSDFRRRETERTER >ss_45_201_0_1 ZTTRASOIIDIFOSDIOFISDOFSDFQAWTZETQWE >ss_89_10_0_2...

How can I use Matlab's filter command to plot impulse response of system?

matlab,plot,filter,sequence
I am trying to make a plot the impulse response of both an IIR and FIR system by using Matlab's filter command and no other pre-existing Matlab functions. The filter must be able to handle a sample input such as plot([1 2 2], [0 1 .8]). The problem looks like...

How do inits and tails work in Data.Sequence?

haskell,data-structures,sequence
Louis Wasserman wrote the current implementations of inits and tails in Data.Sequence. He indicates that they are very efficient, and indeed just looking at the code I can see that whatever they are doing, they are doing it in the clean, top-down sort of fashion that tends to lead to...

Counting up “broadly”: Not 0,1,2,..,9,10,11,..,99 but 00, 01, 10, 11, 02, 12, 20, 21, 22, 03, .., 99

math,count,language-agnostic,numbers,sequence
When a counter is made up from a fixed number of digits (2 in the title), standard counting-up works by incrementing from the least to the most significant digit and upon overflow reset it. I want to count differently: A 4 digit number in base-10 would be counted up in...

Space leak with recursive list zipWith

haskell,memory-leaks,sequence,fibonacci,space-leak
My space leak happens in one of my personal project. But I don't want someone to solve it in my project. I want to understand it. I reproduced my space leak by making up this algorithm: u is a sequence defined by: u(0) = 1 u(1) = 2 u(2) =...

How invert this formula with % operator

c#,sequence,formula
I have a semaphore variable with 5 states. I can increase the state using this cicle X = (X + 1) % 5 For X = {0, 1, 2, 3, 4} generate {1, 2, 3, 4, 0}. But if I try go in the other direction decreasing the state, doesn't...

How to change list sequence field register in prestashop 1.6?

sequence,prestashop
i want to change list sequence of field register in prestashop 1.6 like country - state - city, i have tried edit in themes - default-bootsrap - address but cannot work

Swift. GeneratorOf generate function doesn't return proper generator

ios,swift,generator,sequence
I use playground to play a little with sequences and generators. So I created function that returns GeneratorOf struct that suppose to implement GeneratorType and SequenceType. I expect that generate will give me new full generator that I can traverse through again. But it didn't for my countDownGen2. I suppose...

R: How to generate a squence which fills up a column of a data frame

arrays,r,data.frame,sequence
So lets say i have a data frame (Address) like this: Street HouseNumber A Fakestreet1 10 bla Fakestreet2 20 bla Fakestreet3 30 bla Fakestreet4 40 bla and I want to add a new column lets call it ID which simply makes something like Address$ID <- 1:4 but without having to...

When is a MIDINoteMessage played in a MusicTrack? iOS

ios,sequence,midi,audiotoolbox,coremidi
I'm creating a MusicTrack of MIDI Notes that are successfully played using MusicPlayerStart(sequencePlayer) But I would like to know when are they played, so I can update the UI for each MIDI Note played. // Creating MIDI Track MusicTrack track; UInt32 trackIndex = 0; musicTrackAtIndex(trackIndex, &track); //Adding Tempo addTempoEvent(0.0, 120);...

Use sequence number with insert select

oracle,sequence
I'm trying to execute the following statement: INSERT INTO mySchema.ODI_PRICELIST_THREAD_TABLE ( src_table, thread_id, creation_date ) SELECT DISTINCT source_table AS src_table, num_thread_seq.nextval AS THREAD_ID, create_date AS CREATION_DATE FROM mySchema.nb_pricelist_ctrl I need the THREAD_ID field to be a number from 1 to X where X is defined in runtime therefore I've used...

Why are takeR, dropR and splitAtR missing from Data.Sequence?

haskell,containers,sequence
Data.Sequence has takeWhileR and dropWhileR for efficient deconstruction of Seqs from the right. However, takeR, dropR and splitAtR are conspicuously absent. take and drop are implemented in terms of splitAt. So, do finger trees not admit an efficient splitAtR or was this functionality not included for some other reason? (Separate...

why does this node.js code not execute in series?

node.js,sequence
I'm a total node noob and barely know what I'm doing. I'm trying to execute a series of functions in sequence, one after the other, using the futures library. My code: var futures = require('futures'); var sequence = futures.sequence(); sequence .then(function() { console.log("one"); }) .then(function() { console.log("two"); }) .then(function() {...

Longest sequence of words with no repeating letters

algorithm,sorting,sequence
I have a list of words. I need to choose the longest sequence of them with no repeating letters. For example, my words are: ab cd cxyz The longest sequence is (6 letters): ab-cxyz The order is not imoratant. I am looking for an efficient way of choosing such a...

Replace sequence in list with a value in Python

python,list,python-3.x,replace,sequence
I want to replace example two specific one-after-one going elements in a list with another element (elements). For example - replace ["+", "="] with ["+="]: Input: [3, "blah", "+", "foo", "=", "+", "="] Output: [3, "blah", "+", "foo", "=", "+="] ...

Make animation with several div's in a loop

javascript,jquery,animation,sequence
I have a working animation jquery script here: jsfiddle var speed = 1500; var margin = 50; var start = 200; var next = 1400; setTimeout(function() { $("#foo").show().animate({ // marginLeft: startPoint, marginLeft: margin // endPoint }, speed); },start + next * 0); setTimeout(function() { $("#bar").show().animate({ // marginLeft: startPoint, marginLeft: margin...

Error related to setting an array element with a sequence

python,loops,sequence
I am a beginner with Python and I will be thankful if someone helps me with the following error: ValueError: setting an array element with a sequence. I want the program takes the related values from the array Ir at each step and runs it in the loop. I mean...

ordering non-decreasing functions then adding them in R

r,function,order,sequence,rstudio
Need help with basic R function: Firstly order non-decreasing sequence from 4 different sequences and then order those 4 sequences into one. Im totally green in programing so please make it the simplest way possible. Edit1: puting some input data as required A={3,2,1,2} B={6,7,5,8} C={12,11,9,10} D={65,43,76,13} I would like it...

sequence of numbers using recursion

recursion,sequence
I want to compute sequence of numbers like this: n*(n-1)+n*(n-1)*(n-2)+n*(n-1)*(n-2)*(n-3)+n*(n-1)*(n-2)*(n-3)*(n-4)+...+n(n-1)...(n-n) For example n=5 and sum equals 320. I have a function, which compute one element: int fac(int n, int s) { if (n > s) return n*fac(n - 1, s); return 1; } ...

How does one retrieve the count of a type conforming to SequenceType?

swift,count,sequence
Let's say I have this code: postfix func ++ <S: SequenceType>(inout sequence: S) { //do stuff } How could I figure out how many elements there are in sequence? The obvious version I'd go for is pretty inefficient: var count = 0 for element in sequence { ++count } There...

execute immediate alter sequence not working

oracle,plsql,sequence,execute-immediate
I'm stuck on this pretty simple script. It isn't working like I expect it to. declare st VARCHAR(1024); begin for x in (SELECT sequence_name FROM USER_SEQUENCES) loop st := 'ALTER SEQUENCE ' || x.sequence_name || ' INCREMENT BY 1000'; execute immediate st; st := 'select ' || x.sequence_name || '.nextval...

Python: Check whether the list is in sequential or not | End of the list is defined

python,list,hex,sequence,enumerate
My function is something like this, thanks to this answer, which is to check whether all the values of mylist are sequential or not, which is hexadecimal list. For example: mylist1 = ['03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c','0d', '0e', '0f'] mylist2 = ['03', '05', '06', '07',...

Laravel Schema for PostgreSQL Sequence

postgresql,laravel,schema,sequence
These are my requirements: I have a table(upload_training_files) The fields are id, organisation_id(foreign), year_id(foreign), created_by, created_at, updated_by, updated_at, file_path. The organisation_id field refers to id field of organisations. It should be auto_incremented and also should identify with a sequence table(upload_training_file_organisation_id_fk_seq). I have failed to do this in Laravel after repeated...

Add increasing number to filename, how not to loop?

php,numbers,sequence
I'm trying to modify a script that generates random numbers to filenames and instead have a pretty increasing counter of +1 each new file The original function is very simple it looks like this: $name .= generateRandomString(5); What I've came up with my mediocre skills is: $name .= $count =...

Scala - finding first position in which two Seq differ

scala,diff,sequence,seq
Scala comes with the nice corresponds method: val a = scala.io.Source.fromFile("fileA").getLines().toSeq() val b = scala.io.Source.fromFile("fileB").getLines().toSeq() val areEqual = a.corresponds(b){_.equals(_)} if(areEqual) ... And I quite like the brevity of that. Is there a similar method already defined that will also report to me the first position in which the two sequences...

Get position of item in rdf type sequence with sparql

sequence,rdf,sparql
i have a sequence encoded like this in rdf: _:blanknode <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq>. _:blanknode <http://www.w3.org/1999/02/22-rdf-syntax-ns#_0> uri:a. _:blanknode <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> uri:b. _:blanknode <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> uri:c. now i want to have the position of a given uri within this list. is there something like: SELECT ?position WHERE { _:blanknode...

Oracle sequences of characters?

oracle,sequence
In Oracle, we can create sequences of integers : CREATE SEQUENCE IDPassenger MINVALUE 1 START WITH 1 INCREMENT BY 1 CACHE 15 / Is it possible to do sequences of characters ? If yes, how ?...

How to map an xml sequence of mixed elements to a go struct?

xml,go,sequence,choice
'm trying to load an XML file that contains an unbounded sequence of mixed elements (a choice in a sequence in the XSD) The file looks like that : <RootNode> <ElementB>...</ElementB> <ElementA>...</ElementA> <ElementA>...</ElementA> <ElementC>...</ElementC> <ElementB>...</ElementB> <ElementA>...</ElementA> <ElementB>...</ElementB> </RootNode> I use xml.Unmarshal to initialize and fill these structs : type RootNode...

Alpha-numeric sequence in SQL Server

sql-server,sequence,alphanumeric
I need to generate a 3 character alphanumeric sequence, in SQL Server 2008, as follows: 001, 002, ..., 999, A01, A02, ..., A99, B01, B02, ..., Z99 The next item in the sequence will get generated from a stored procedure and stored in a NCHAR(3) table column....

Get the kth permutation of 1 to n

algorithm,sequence,permutation
I checked from website, this is called unimodal permutation, which defines as a sequence that has only one local maximum. For example n = 5: 12345 12354 12453 12543 13452 13542 14532 15432 23451 23541 24531 25431 34521 35421 45321 54321 Is there an algorithm to get the kth unimodal...

Creating an indicator for strings of numbers, ignoring a particular one in python pandas

python,list,pandas,sequence
I have no idea how to title this question, edits welcome. I have a pandas series of numbers (could be made into a list, the type isn't important really). The numbers go from 1 to 13. For example: 13,13,1,1,1,1,13,2,1,1 I want to find strings of the same numbers but NOT...

Oracle sequence created twice. ORA-00955: name is already used by an existing object

java,oracle,jdbc,sequence,drop-table
EDIT After your advices, the code and the errors. I got an error "ORA-00955: name is already used by an existing object" now. The sequences creation create this error each time a DataStoreManager constructor is called. Here is the code now : public class DataStoreManager { private Connection connection; private...

How to find largest sequence of a given number in excel?

excel,sequence
I have a column of zeros and ones 1 0 0 0 1 1 I want to find out the largest sequence of zeros I have in my column AND how many times it appears. ...

Can I intercept the F# sequence generator?

f#,sequence
trying to work around a problem in outside library - is there a way to try-catch the generator itself item by item (probably not, but just to be sure...)? let myTest() = let mySeq = seq { for i in -3 .. 3 -> 1 / i } // how...

sequence in DB2 generates duplicate values

db2,sequence
My application uses DB2 data base. I had created a sequence for my table to generate the primary key,it was working fine uptill today, but now it seems to be generating existing values and I am getting DuplicateKeyException while inserting values. After a bit of googling I found that we...

Ensure Start-Process starts and finishes in order

powershell,sequence,start-process
PowerShell script has the following Start-Process "D:\Script\EMAIL_Snapshot_Done.bat" $date, $scr_comp Start-Process "D:\Script\BATCH_gup.bat" How to ensure that first Start-Process starts and finishes BEFORE second Start-Process begins?...

Randomly iterate through sequence of integers, 1 to n [duplicate]

random,integer,sequence
This question already has an answer here: Generating non-repeating random numbers in Python 17 answers I have a range of integers I want to iterate through. You can assume the sequence begins with 1 and ends with n, where n > 1. However, I do not want to iterate...

Reset Oracle Sequence to have MIN VALUE = 1 and STARTING number from 1

oracle,sequence,reset
I have a problem resetting Oracle Sequence to have MIN VALUE = 1 and starting next number used is 1. I have followed through the answer of this question: How do I reset a sequence in Oracle? create or replace procedure reset_seq( p_seq_name in varchar2 ) is l_val number; begin...

Sequence.NEXTVAL in Oracle 12c with rs.getInt() or getLong() fails - so what datatype it returns?

java,oracle,jdbc,prepared-statement,sequence
I am fetching next value of sequence with the ps = connection.prepareStatement("select seq.nextval from dual"); But neither getLong() nor getInt() works. So how to correctly get the value from the ResultSet then? full code: public static long seqGetNextValue(String sequence) { Connection connection = Util.getConnection(); PreparedStatement ps = null; ResultSet rs...

how to count sequential column and each one is counted before rows in sql

sql,sql-server,count,numbers,sequence
I am using MSSQL for my application and I need to count sequential number status predecessor line. Table is like this, +------+------+ |Number|Status| | 1| N| | 2| G| | 3| G| | 4| N| | 5| N| | 6| G| | 7| G| | 8| N| +------+------+ I suppose...

Why is GenerationType.AUTO not using a serial on PostgreSQL?

java,postgresql,jpa,eclipselink,sequence
I have an application using JPA (with eclipselink). The application was developed with a Derby database in the background. The tables were generated by JPA itself. This is a simple example of one of the entities: public class MyEntity implements Serializable { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; @Column(nullable=false) private String...

F# Create a sequence of a certain type

f#,sequence
I am writing some unit tests at the moment and need to replicate a sequence. The sequence is of type (string * string * string). I have tried to recreate this sequence by let aSequence = seq<aType>{ ("ABC","DEF","GHI"); ("JHL","MNO","PQR") } What am I doing wrong?...

Iteration vs Recursion: Calculate point position in sequence for known iteration

javascript,math,recursion,iteration,sequence
I have a recursive function that takes a point {x,y} and calculates the next point in the sequence, recursively. It looks a little like this: var DECAY = 0.75; var LENGTH = 150; var ANGLE = 0.52; getNextPoint(0, 0, ANGLE, LENGTH); function getNextPoint (x, y, a, l) { l *=...

Microsoft Release Management : option to switch deployment order in a tag does not exist?

parallel-processing,tags,sequence,ms-release-management
On this page it's described that "Now you can use tags with the servers in your Azure or on-premises (standard) environments. ...With tags you can also switch the deployment order from parallel to sequence." See this picture: However in our version from MRM (ReleaseManagementConsole.exe ; 12.0.31101.0 ; Nov 1 2014)...

R directed network from sequence

r,networking,graph,sequence
(using: R 3.1.0) Hi - I feel like this should be simpler than I'm finding it. I have a set of sequences and I'd like to visualise them as a directed network. A pure graph probably isn't right because each sequence can have multiple instances of nodes and the repetition...