Using sequences in dynamic SQL
By : Brett Davis
Date : March 29 2020, 07:55 AM
I wish did fix the issue. A sequence is spectacularly the wrong tool for this job. Not only are you executing unnecessary DDL, but sequences aren't transactionsafe or guaranteed gapless. (They also all share a namespace, so your procedures are likely to have to wait for each other in annoying ways). Don't use a sequence. It's about as good for the job as a rubber chicken is as a hammer. code :
EXECUTE format('
INSERT INTO row (trans_id, row_in_trans)
SELECT
p_trans_id,
row_number() OVER (ORDER BY p_trans_id)
FROM sales
WHERE trans_id = p_trans_id AND %s', p_where_clause);

Dynamic Programming  With 3 sequences.and finding the maximized value
By : Shalord Tito Okello
Date : March 29 2020, 07:55 AM
I hope this helps you . You solution doesn't sound at all like dynamic programming. The problem basically asks to find a maximum sum longest common subsequence, where the common subsequence is between A and B and the sum is from P. code :
backtrack(LCS, A, B, i, j):
if i == 0 or j == 0
return ""
if A[i] == B[j]:
return backtrack(LCS, A, B, i1, j1) + A[i]
else if LCS[i1, j] > LCS[i, j1]:
return backtrack(LCS, A, B, i1, j)
return backtrack(LCS, A, B, i, j1)
backtrack(LCS, A, B, i, j, s=0):
if i == 0 or j == 0
return s
if A[i] == B[j]:
return backtrack(LCS, A, B, i1, j1, s + P[i])
else if LCS[i1, j] > LCS[i, j1]:
return backtrack(LCS, A, B, i1, j, s)
else if LCS[i1, j] < LCS[i, j1]:
return backtrack(LCS, A, B, i, j1, s)
else:
return max(backtrack(LCS, A, B, i1, j, s),
backtrack(LCS, A, B, i, j1, s))

Replace dynamic sequences in text string using a vector in R
By : Shahid Ahmad
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , You can do this with gsub. The regex says to look for a combination of letters followed by ".i _ " then the same combination followed by ".c", and replace the whole thing with the same combination followed by ".c". code :
ts < gsub("([AZaz]+)\\.i\\s_\\s\\1\\.c","\\1\\.c",text.seq)
ts
[1] "An.i _ Bo.i _ An.c _ Cx.i _ Cx.c" "An.i _ Bo.i _ Dz.c" "Cx.c _ Cx.i _ An.c"

Counting valid sequences with dynamic programming
By : user3223767
Date : March 29 2020, 07:55 AM
help you fix your problem For a moment let's just not care about the array. Let's implement this recursively. Let dp(i, j, k) be the number of sequences with length i, last element j, and k consecutive occurrences of j at the end of the array. The question now becomes how do we write the solution of dp(i, j, k) recursively. code :
def dp(i, j, k):
# this is the base case, the number of sequences of length 1
# one if k is valid, otherwise zero
if i == 1: return int(k == 1)
if k > 1:
# get all the valid sequences [0...i1] and add j to them
return dp(i  1, j, k  1)
if k == 1:
# get all valid sequences that don't end with j
res = 0
for last in range(len(A)):
if last == j: continue
for n_consec in range(1, A[last] + 1):
res += dp(i  1, last, n_consec)
return res

Concern with the use of dynamic sequences in ESB 4.5.0
By : L LL
Date : March 29 2020, 07:55 AM
this one helps. You can enable statistics for dynamic endpoints and dynamic sequences by this way: 1. Go to the registry resource, eg: /_system/config/Hello 2. Content > Edit as text 3. Add statistics="enable" to address element Then if you have used that endpoint, statistics will be fired to BAM and you can see those if the Mediation statistics toolbox is installed.

