Posts by CSAnimor • 731 points
21 posts
-
0
votes1
answer50
viewsQ: Make modal box without HTML
Good afternoon, I have this code that generates me a Modal Box, however it is not working: jQuery(function() { var modalHtml = '<div id="open-modal" class="modal-window">' + ' <div>' + '…
-
1
votes1
answer176
viewsQ: How to hide a table line div
Good afternoon, I have a table where I show several values, but I have lines where sometimes I have no number and shows N.A. What I want is to delete a row from the table (div id="ApagarNA") if all…
-
4
votes1
answer250
viewsQ: Add 1 minute to the hour
I have a problem solving an exercise. It may be easy but I’m not finding the right solution. I have the following class Time public final class Time { private final int hours; private final int…
-
0
votes0
answers76
viewsQ: Implement interface with linked lists
Good evening, everyone, I could use a hand here. I’m starting to learn the implementation of linked lists in java, but I can’t understand or find a solution to this. I have this interface: public…
-
2
votes2
answers197
viewsQ: Java polymorphism
In the context of inheritance, when B is sub-class of A, an instance of B can be used anywhere where an A is valid. This is the characteristic of polymorphism. However I have a question. I know it’s…
-
0
votes1
answer77
viewsQ: Doubt about java.util.Date
Can anyone explain to me what this will return: java.util.Date date = new java.util.Date(); java.util.Date date1 = date; java.util.Date date2 = (java.util.Date(date.clone()));…
-
5
votes2
answers380
viewsQ: Algorithmic complexity of map
Could you tell me the algorithmic complexity of this code, in particular, what the complexity of the function map numero = map(lambda x: x[0], lista) map(lambda x: (numero.count(x)),…
-
0
votes2
answers121
viewsQ: Turn cycle into higher order function
Good afternoon, I have this function containing a cycle: def ciclo(x,y): lista = [] for i in x: if i[0]==y: lista.append(i[3]) return sorted(lista) And I wanted to turn it into a line of code, using…
-
1
votes2
answers281
viewsQ: Count occurrences in tuples
I have a problem that is simple but I’m not getting the solution. I have a list of tuples, for example: lista = [('x',2,3),('y',4,5),('x',6,7),('z',8,9)] What I want is for him to tell me how many…
-
2
votes1
answer702
viewsQ: How to separate each sequence of equal numbers from a string?
How do I split a number string? For example '233' to obtain ['2','33']. Given values may vary, for example '44446' and give ['4444','6'] or '2345' and give ['2','3','4','5']. That is, give split…
-
4
votes3
answers23189
viewsQ: Recursive and iterative function that calculates the factorial from 1 to n
Good people, wanted help with an exercise: It asks to create a function that calculates the factorial of the numbers from 1 to n. I already have the recursive part, but I don’t know how to make it…
-
1
votes1
answer335
viewsQ: Extend the list to another list
Well I have two lists, list1 and Lista2: lista1 = [['carlos','10','cenouras','carro','agora'],['duarte','34','couves','bus','agora']] lista2 = [['11:30', '12:00'],['13:00', '13:30']] What I want is…
-
4
votes1
answer683
viewsQ: Sort lists with two sort criteria
If I have a list of lists like this: lista = [['ana','1'], ['joao', '3'], ['rita','2'], ['alice','2']] I first want to sort the list according to the numbers, to look like this: lista =…
python-2.7asked CSAnimor 731 -
1
votes2
answers792
viewsQ: Sort list of lists
I have the following list of lists: lista = [['a', '1'], ['c', '3'], ['b', '2']] And I want to sort this list according to the numbers, which means I want it to stay that way: listaOrdenada =…
python-2.7asked CSAnimor 731 -
7
votes1
answer23359
viewsQ: Validate email in Javascript
Good afternoon, I have a question in an exercise that I have to solve and I wanted to ask you to help me: As I do a function in Javascript that takes as argument a string and checks if an email is…
javascriptasked CSAnimor 731 -
8
votes1
answer787
viewsQ: Check if list is equal
I have the following list: x = [([1,2], [1, 2]), ([1,2], [4, 5])] And I wanted to check if the first list of each Tuple is always the same. Note: the list x contains tuples with lists. These tuples…
-
5
votes3
answers4053
viewsQ: How to add list values in tuples?
I have for example a list with tuples, and inside these tuples I have 2 lists, where only the second list of each tuple varies: x= [(y, [1, 2]), (y, [3,4]), (y, [5, 6])] How do I add the first…
-
0
votes1
answer3199
viewsQ: Install Spyder in python
How do I install Spyder in python 2.7 ? i already have Pip installed in python scripts and easy_install.. with the help of a friend but I don’t know how to install Spyder
python-2.7asked CSAnimor 731 -
8
votes4
answers5471
viewsQ: Count occurrences in a list according to prefixes
Let’s say I have a list ['rato', 'roeu', 'rolha', 'rainha', 'rei', 'russia'] and another list with prefixes ['ro', 'ra', 'r'] how do I count how many times each prefix is within the first list?…
-
0
votes3
answers913
viewsQ: Multiple of 10 closest to a sum
def multiplo(x): somamulti= somaImpares(x) + somaPares(x) if somamulti/10==0: return somamulti/10 else: return In this function I did what happens is the following: the somamulti sum 2 values, in…
-
4
votes1
answer1843
viewsQ: How to add string numbers
Well I have a string like a=("1234") and I wanted to separate these numbers in order to add them, like this: 1+2+3+4 How can I do that? I appreciate any help :)
python-2.7asked CSAnimor 731