All Questions

3
answers

How to create a DateTime object that represents the last day of a given month?

In an object of type DateTime , how do I get a new object object DateTime that represents the last day of the month of the first object? var data = new Date(2017, 3, 1); // 01/03/2017 var dataUltimoDia = ??? // 31/03/2017     
asked on 09.12.2015 / 16:54
4
answers

What does the "do" function do in JavaScript?

I searched a lot and could not find the functionality of do in JavaScript. Example: function b(a, b) { do a = a[b]; while (a && 1 !== a.nodeType); return a }     
asked on 07.07.2017 / 15:42
3
answers

Principle open / closed - how to understand this?

In object orientation there is SOLID, and one of the principles is the open / closed principle that I have learned as follows: "software components must be open for extension and closed for modification", where components include classes, methods...
asked on 13.05.2014 / 13:24
3
answers

In Python, what are the consequences of using 'is' instead of '=='

The two forms below return True , but what are the consequences of this in a more complex code? >>> a = '2' >>> a is '2' >>> True >>> a == '2' >>> True     
asked on 24.10.2014 / 23:44
4
answers

Is there a ternary operation in Python?

I often see several programming languages where a ternary operation is almost always identical. (x % 2 == 0) ? "par" : "impar" However, when I tried to do this in Python, it gave me an error: (x % 2 == 0) ? "par" : "impar" ^...
asked on 26.10.2016 / 18:35
3
answers

What is the difference between braces "{}" and brackets "[]"?

The JSON file format uses two types of symbols to organize the data in its structure, they are: Brackets: [ ] Keys: { } In them you can enter values of several types, see this example example: { "Nome": "Ana", "E...
asked on 28.12.2016 / 15:30
4
answers

How to select a text snippet in a String?

I'm creating a text file and using some delimiters ( <# and #> ) I need to select what's inside the <# texto.delimitado #> delimiter. Using the split() JavaScript function. What would be the best regular...
asked on 30.12.2013 / 04:43
2
answers

Enter key do not give submit

How to make the enter key not give submit on a form? Example: in an input pressing enter nothing happens. Today, if you press enter , the browser gives submit , and you clicked the submit button.     
asked on 14.12.2015 / 20:24
3
answers

In PHP the correct is else if or elseif?

In PHP, is correct else if or elseif ? What's the difference between them? The language allows you to write everything together and separate, and apparently the results are identical     
asked on 10.04.2015 / 20:50
3
answers

Floats module in PHP returns integers?

How do I get the rest of the division (modulo % operation) to decimal places when I use a divisor or float dividend? Example: echo 5 % 3; // imprime 2 como é esperado echo 5.6 % 3; // imprime 2 quando deveria imprimir 2.6  ...
asked on 20.12.2013 / 13:20