Posts by renatomt • 194 points
16 posts
-
1
votes2
answers63
views -
1
votes2
answers144
viewsA: How to check if at least one checkbox is enabled
There are some ways to do that. In the code below I put a class check in all checkboxes to make it easier to pick up all the elements with javascript, it tests one by one to see if it is tight and…
-
3
votes2
answers155
viewsA: Remove 1 day from a specific date
Depending on which server you are using has a function to add/subtract dates. MYSQL DATE_ADD("2017-06-15", INTERVAL -1 DAY) SQL Server DATEADD (day, -1, "2017-06-15") Postgresql DATE '2017-06-15' -…
-
0
votes1
answer32
views -
1
votes1
answer102
viewsA: Python. I cannot return an if statement within a function
By your code only the first 4 lines of the function are doing something. The command Return exits the function and the first if is speaking exits the function with the equal value if x is equal to…
-
0
votes2
answers80
viewsA: Open a page before loading the header
I couldn’t do it for PHP. But an alternative would be to use Javascript both to open the pop-up and to redirect: <?php echo "<script…
-
0
votes2
answers237
viewsA: Access Javascript properties: point notation or square brackets?
It is always difficult to prove a negative (in which case there is no other benefit to using a notation or other). From what you quoted it seems to be all the differences between the two notations.…
-
0
votes1
answer30
viewsA: How to do checkbox count marked when clicking on Submit?
To check how many checkboxes have been marked on the page you can use the following javascript function: var array_checked = document.querySelectorAll('input[type="checkbox"]:checked') var…
-
0
votes1
answer1397
viewsA: Typeerror: '<' not supported between instances of 'float' and 'str'
This error means that one of the variables you are passing to calculate the median is as text (even if you can calculate the mean, probably the result is not what you would expect). With…
-
0
votes3
answers75
viewsA: Add Character at the end of the line
There seems to be no error in your logic, but the fact that it is returning false always in if means that the variable lastchar is not a semicolon as you expected. Very likely this is happening…
-
-1
votes2
answers37
viewsA: Balance calculation (Credit - Debit) resulting in Nan
There are two errors in your code. First in function sumBalance you’re subtracting sumCredit and sumDebit when you would have to subtract the variables you passed to function credit and debit.…
-
0
votes1
answer58
viewsA: Working with two different Datasets - Filter the data
You can use the pandas isin method to filter the data that is in a column using a series or array (documentation here). For example, to get all the games on the dataframe loc_results appearing in…
-
2
votes1
answer41
viewsA: Problems with NA in R
You are confusing the code to loop with a counter and an array loop. When you do the for i in v, each time the loop rotates it rotates it puts the value of the next value of v in i. The correct form…
-
1
votes1
answer313
viewsA: Two Buttons type Submit in the same form
There are some different ways to solve your problem: Using HTML5 The formaction attribute does exactly what you want, it replaced the standard form action for the button. <input type="submit"…
-
2
votes1
answer31
viewsA: Iterating over list with B Soup
The problem is that when you append a dictionary you are creating a pointer, not a reference (one can see the answer at that link to understand the difference between pointer and reference). When…
-
0
votes1
answer381
viewsA: How to convert Object to number in pandas?
What the error is telling you is that Python tried to convert the string "54.00" to int, and failed, even the two houses after the point being zero. You can convert the value column using…