Categories
Mastering Development

How to pass a mix of multiple Arrays and individual arg to another function and return them (GAS/JS)?

I have a main function which do bunch of operations and the output is pushed into arrays along with other multiple values declared in individual variables. Then I need to pass them to another sub function for other bunch of operations then return the updated arrays. I realized that it will not work if I […]

Categories
Mastering Development

How to sort a list of tuples with by the second column of a nested list?

I have the following list of tuples in which each tuple consists of a list followed by two strings. I wish to sort the list of tuples based on the second column of the nested list within the tuple. example array: array = [([45, 56, ‘-‘], ‘CGUCAUAAAGUA’, ‘MKYC’), ([24, 38, ‘-‘], ‘GUAAGGUUUGCCGUA’, ‘MPFGM’), ([6, 26, […]

Categories
Development

Non blocking fifo causes errors in application by blockign the open command

My code is shown below, This is a header file shared by 2 different applications in C++, one is a server, the otehr is a client, the server runs in the background The problem is, when the server is running by itself it does not hang up, but when the client is running it receives […]

Categories
Development

How to convert list of lists into groups in Python?

I am trying to solve an exercise which i have a list of list like this: outerlist = [[344,0,”str1″],[233,0,”str2″],[213,0,”str3″],[344,2,”str4″], [213,1,”str5″],[344,3,”str6″],[344,1,”str7″],[213,2,”str8″]] second elements in inner lists are always increase consecutively. And want an output like this: Group 1 213 0 str3 213 1 str5 213 2 str8 Group 2 233 0 str2 Group 3 344 0 […]

Categories
Development

i don’t know it is dynamic programming

i am beginner who learning algorithm in korea college. it is assignment that solving the problem by using dynamic programming without recursive programming, using only python. the problem is whether the result is printed out ‘a’ by some operation or not when you input 5 alphabet of string that composed only ‘a’,’b’,’c’ I made it, […]

Categories
Development

Use a function’s unnamed parameters … in a glue::glue call

I want a function to glue two character variables together even when the name of one (or many) are not know until the function is called. f <- function(t, str1, …) { t %>% mutate(name = glue::glue(“{str1} {…}”)) } s <- tidyr::tribble( ~str1, ~str2, “first”, “second” ) s s %>% f(str1, str2) The answer I […]

Categories
Development

Replicating Excel function in VBA

I have an excel function as follows- IF(B3=””,””,IF(AND(G3=”NA”,F3=”Qualified”),”New to Qualified”, IF(AND(G3=”NA”,F3<>”Qualified”),CONCATENATE(“New to Qualified and “,F3), IF(AND(G3<>”NA”,F3=”Qualified”),IF(H3<>G3,”TCV Change”,”Same”), IF(AND(G3<>”NA”,F3<>”Qualified”),IF(H3=”NA”,”TCV Change”,IF(H3<>G3,CONCATENATE(“TCV Change and “,F3),F3))))))) I am trying to replicate the same in VBA as- Sub CC() Dim str1 As String Dim str2 As String str1 = “New to Qualified and” & Range(“F3:F100”) str2 = “TCV Change and” […]

Categories
Development

How to remove an object from Arraylist by using contains

I have added some objects to list. I want to remove an object if it satisfies some condition. E.g: In my list i have object as follow [test/te,str1,str2] Scenario: No i want to remove object which contains “test” List<Object> Extraprimitivesintarget = new ArrayList<Object>(); if(ens2.size()!=0) { HashSet s1=null; HashSet s2=null; for (Entry<String, JsonElement> en1 : ens1) […]