Most voted "set" questions
24 questions
Sort by count of
-
14
votes2
answers3795
views -
9
votes2
answers1683
viewsConvert a collection from Set to List type
I have a class that has an attribute of the type of Set, because I want repeated values to be ignored, however I need to return this in the form of a List to fill in a ListView, so what is the best…
-
8
votes2
answers10963
viewsWhat is the difference between SET and ENUM in Mysql?
What are the differences between SET and ENUM in Mysql? And in what situations both are best applied?
-
8
votes2
answers1283
viewsHow to access the elements of a set (set)?
I’m studying about ensembles (set) in Python because I’m going to use it in an algorithm to find paths in a graph, it’s for a college discipline that I’m having. I created two set examples using two…
-
6
votes3
answers1337
viewsIn what order is a Set stored? Random?
When I store something inside a Set, the order in which it stores is random? And how could I order a set Set?
-
6
votes1
answer107
viewsHow does the use of "Set" to remove repeated values from an array in Javascript work?
Is it known almost general which, in Javascript, can be used this trick with Set and Operator spread for remove values duplicates of an array: const arr = [1, 1, 1, 2, 2, 3]; const deduped = [...new…
-
5
votes3
answers108
viewsIs there any way in pure C to implement set?
I’m doing a job for college and I need to check word for word from a "dictionary" on file txt and compare these words to the words of an array that has been provided. To make my life easier (because…
-
5
votes1
answer111
viewsSet does not remove duplicate objects
I have an array of objects and always to remove duplicate objects use the new Set(array), but this time did not work as expected. In the following example, it is easier to understand. I’m passing my…
-
4
votes1
answer896
viewsType set in Python is ordered?
When creating a variable like this: a = {1,2,5,1,3} It ends up returning a variable of type set. However, in the Python documentation, it is said that it is impossible to create a set without the…
-
4
votes2
answers76
viewsFind() function of the set library does not return whether or not it found
I’m writing a little program for a college exercise and I’m having second thoughts about find(). I must enter two integer numbers, check if the first number exists within the set previously defined.…
-
3
votes1
answer589
viewsSet values of an array recursively
Assuming I have the following array array( 'chave1' => 'valor1', 'chave2' => array( 'chave3' => 'valor2', 'chave4' => array( 'chave5' => 'valor3' ) )) And in this array I need to set…
-
3
votes1
answer1815
viewsDifferences between list, tuple and set
I know that in Python there are three structures that apparently resemble each other, but that in the background there are differences. They are: list, tuple and set. List a = [1, 2, 3, 4] Tuple a =…
-
1
votes2
answers498
viewsEloquent Laravel - Column user_id
Hi, I’m learning Portable and I didn’t find this on any forums. I have some tables that have a foreign key called 'user_id', but when I save an object in the bank I always have to fill this column.…
-
1
votes1
answer92
viewsHow to create a condition "if all the elements of a list then inside a set list" (Python)?
I’m trying to say, "If all elements of a list are in a list of sets". a= [0,1,2,3,4] b=[ 3,4,5,6,7] c=[0,1,8,9,10] d=[0,1] e= set(a).intersection(b) f = set(a).intersection(c) g = [e,f] print (g) if…
-
1
votes1
answer75
viewsHow to obtain items that multiple lists have in common
How to do for when there is no common item, launch warnings? List 1, 2 and 3 have different index numbers. def compabilitySorter (lista1, lista2, lista3): listCompatible=[lista1, lista2, lista3]…
-
1
votes1
answer220
viewsAdd tuple in Python set
I am creating a graph with the following rules: The graph is a dictionary. The vertices are the keys of this dictionary and the values are the edges. Since I can have more than one edge for a…
-
0
votes2
answers795
viewsPHP Cookie is not set on remote server
I implemented a cookie that works on the local server but doesn’t work on the remote server, I don’t understand why. Thanks for any help. I have the following code: <?php if…
-
0
votes1
answer390
viewsProblem with Getters and Setters of an Array
I’m having trouble accessing arrays in a Singleton class Class Info public class Info { private static Info cinfo; private String[] first_name; private String[] last_name; private String[] nickname;…
-
0
votes1
answer230
viewsDifference between tuple and set
I’m working with python and I was wondering what would be the difference between a set(set()) and a tuple(tuple()). I know that both are delimited with '()'. But I tried to assign a set attribute to…
-
0
votes0
answers34
viewsUsing the Update command but does not update the column in the table
I used the following command : update cliente set telefone = '969843225' where nome = 'João da silva'; Afterward: select * from cliente; Did not update the record. Image of the records:…
-
0
votes1
answer148
viewsHow to suppress Oracle input window without using set define off
I need to insert an image in oracle using php, but after I convert it to insert into the database, it gets some characters & in the middle of the string, this character in Oracle triggers an…
-
0
votes1
answer161
views -
0
votes1
answer55
viewsWhat is the coplexity of my solution?
I have the following computer problem: Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M). More formally check if there…
-
0
votes0
answers9
viewsHow to sum an equation with index (i-1) in Gams?
Hi, guys! I’m writing a program (Linear Programming Mixed Integer) that contains equations like the following: r2a(s,d,theta).. limitesuperior(s,d-1)*y4(s,d,theta) =l= sum(f,x1(f,s,d,theta));…