7,331 questions
1
vote
1
answer
111
views
How to append all content between valid numbers
I am newer at coding and can't wrap my mind around what I'm doing wrong. This function takes in text from pdf's and starts collecting text only after a certain "search phrase" is found. Then ...
2
votes
1
answer
116
views
How to disable sequence
I need to disable a sequence on a table, insert some values and re-enable.
I'm searching for the Postgres equivalent of
set identity_insert dbo.myTable ON/OFF
as I can do it in SQL Server.
I have a ...
1
vote
1
answer
71
views
How to make SEQ display a colored metric badge (highlight) for elapsed time in log messages?
I’m using SEQ for structured logging in my .NET application (Serilog).
I want SEQ to display a colored badge (highlight) with the elapsed time (in ms) on the right side of the log message, just like ...
0
votes
0
answers
127
views
SCCM Task Sequence - Powershell (Application Uninstall)
i have created a Task sequence to uninstall a Application via Powershell. i am not able to Find where the issue is. when i Deploy it in Test Device Collection. in Software Center Status shows ...
1
vote
0
answers
38
views
Transforming a reactive API into a lazy sequence in Kotlin
Consider I have a reactive, push-style API such as Files.walkFileTree() from NIO.2. Now, I want to transform this API to produce a lazy sequence of items (Sequence<T>) instead.
This is fully ...
1
vote
1
answer
104
views
Error when running NEXTVAL on sequence inside stored procedure
I have a snowflake procedure in which I would like to capture the next value from a sequence and do something with it. Here is a simplified example of such a sequence and proc:
use schema TEST_DB....
1
vote
4
answers
86
views
How can I find the only matching element in a Seq[A] as an Option[A], throwing an exception if there is more than one matching element?
In some test code, I have a Seq[A] that I'm filtering down to items matching a given property. There should be at most one such element in the sequence. If it has more, it means I set up something ...
1
vote
2
answers
86
views
Check if a sequential value in a range
I am stuck in a unique situation. I have a range:
ABCD0001 to ZZZZ9999
The above range can hold any combination of numbers in between. The individual values reset at Z (next becomes A) or 9 (next ...
1
vote
2
answers
63
views
How to define an infinite recursive object which is defined through discriminated union?
Suppose I define this variant type
type Sequence =
| Seq of type-1 * Sequence
And let's suppose in Repl I want to some how encode the sequence using this, then how can I do it? For ...
1
vote
1
answer
107
views
Does SERIAL8 (BIGSERIAL) in Greenplum cause performance issues with parallel inserts?
I am using Greenplum Database (GPDB) for OLAP workloads, and I have several tables where the primary key is defined as SERIAL8. Since SERIAL8 automatically creates a unique SEQUENCE for each table, I ...
0
votes
1
answer
53
views
Generation of particular combinations
In Mathematica I implemented this simple code:
n = 8;
a0 = Range[0, n - 1];
a1 = Subsets[a0, {2}];
a2 = Subsets[a1, {2}];
a3 = Select[a2, Length[Union[Flatten[#]]] == 4 &];
a4 = Subsets[a3, {n/4}];...
1
vote
3
answers
147
views
Oracle Sequence Gaps: Are Skipped Values Ever Reused
I use an Oracle sequence of the form:
CREATE SEQUENCE MY_SEQUENCE INCREMENT BY 1 START WITH 1000000000 MAXVALUE 9999999999 MINVALUE 1000000001
NOCYCLE CACHE 20 NOORDER;
This sequence is used in an ...
2
votes
3
answers
79
views
What are some possible solutions to identify the next non-existing value?
I'm currently working on a scenario where I need to find the next available ID within a list of unique IDs that contain both letters and numbers.
While I have a working solution, I'm interested in ...
1
vote
1
answer
49
views
Google sheets year range sequence formula
I am in need of a formula for google sheets which can list out a range of years vertically based on the data in a specific cell. If the input is not a range then the output should just be the single ...
1
vote
1
answer
263
views
How to reset a Postgres IDENTITY column to its original first value
First, I'm aware of this answer and it does not do what I want
I need to reset IDENTITY so that next insert generates a 1, but it inserts a 2 instead:
create table test(
id BIGINT NOT NULL GENERATED ...
0
votes
1
answer
88
views
C++23 ranges::elements_of from combination of multiple ranges::iota_view?
How to generate a sequence of numbers from a combination of multiple ranges?
generator<const size_t &> GenerateSequence(size_t start1, size_t end1, size_t start2, size_t end2)
{
co_yield ...
0
votes
0
answers
63
views
Sequence relations with multisets
I am trying to verify the following lemma in dafny:
ghost predicate noD(s: seq<nat>)
{
forall i :: 0<=i <|s| ==> !(exists j :: 0<=j< |s| && i!=j && s[i]==s[j])
...
-4
votes
1
answer
75
views
Making a List with Arithmetic Progression [duplicate]
[Doing an assignment where I have to have to run the formula a(n) = 2*n - 5 (n>=1)] 100 times and have those in a list so that I can grab terms and compare and bunch of other stuff. This is what my ...
0
votes
0
answers
26
views
Approximate cycle detection in a sequence of tuples
I have a cyclic 1-D sequence of tuples of numeric values, and I'm trying to figure out the best way to find the length of the cycle. This is complicated by 2 factors:
The sequence of values in one ...
0
votes
1
answer
104
views
SQL query to audit employee claim based on specific sequence of rows defined by criteria
I need to create an exception/audit report for our accounting section.
The business case is an employee is deployed to remote location and can claim lodging cost if they are away from their family. If ...
0
votes
1
answer
133
views
Create a stored procedure that uses a sequence
I am attempting to create a stored procedure that inserts a new record into a table but the procedure to create the stored procedure yields an error.
Here are the steps to demonstrate the problem:
...
1
vote
2
answers
120
views
Generate a regular numeric sequence by increments of 3 BUT considering gaps in the input
Say I have a sequence like myseq below. It is a DNA sequence, so each group of 3 letters make for one letter (aminoacid) in the accompanying myaa sequence. It has a length of 13aa.
I want to create a ...
1
vote
1
answer
79
views
Does the construction of the dataframe change the values of the list? [duplicate]
If I write this:
f <- function(lambda, a_0, n) {
a <- numeric(n)
a[1] <- a_0
for (i in 2:n) {
a[i] <- lambda * a[i-1] * (1 - a[i-1])
}
return(a)
}
f(4, 0.75, 100)
then a ...
1
vote
3
answers
102
views
Highlight specific x-axis elements in ggplot2 by drawing a circle around them
I have a sequence myseq associated to some data that I want to plot. Besides, I have another sequence checkseq that I want to compare myseq to.
The objective is to make a plot like the one below (with ...
-1
votes
1
answer
93
views
How to sort array of tuples alphabetically only based on the first item of the tuple in nim?
if i have a sequence
let my_seq = @[("a", "hello"), ("c", "world"), ("b", "to")]
how can i sort this so that it returns:
let my_seq = @[(&...