All Questions

3
answers

How to write multiple rows in Python?

How can I write a string with multiple lines in Python? As I come from PHP, I usually do this: $string = " uma linha outra linha2 " Or: $string = <<<EOT uma linha outra linha EOT; When I try to do this in Python, it...
asked on 13.08.2015 / 14:47
3
answers

Set constant in Python

How can I declare a Python constant in the same way I do in C with #Define PI 3.1415 or in java public final double PI = 3.1415     
asked on 05.04.2017 / 21:35
3
answers

Convert date of type 2016-10-04 15:51:16 to, 04-10-2016 15:51:16 in SQL or PHP how to do?

I am doing a job to show the date and time of the insertion in the script in the database, I have to show the date in dd-mm-yyyy format and then the time, how can I do this by the SELECT of the script or by the PHP? If so, how can someone help m...
asked on 10.10.2016 / 16:58
7
answers

How to check if there are numbers inside an input with JavaScript?

Form validation with JavaScript is routine in web development, but it always causes a headache! My situation is this: I can not allow numbers to enter a field of type 'name', but how can I do this?     
asked on 13.03.2014 / 12:42
3
answers

Why is it necessary to create a function to execute certain methods?

.onclick = function() {myFunction()}; Why does not the example below work? .onclick = myFunction() It runs without me clicking! <script> document.getElementById("demo").onclick = function() {myFunction()}; function myFunction() {...
asked on 13.11.2017 / 15:58
4
answers

Count occurrences in a list according to prefixes

Let's imagine that 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?     
asked on 07.04.2015 / 23:10
4
answers

How not to lose the "this" of the current object

I've already done a similar question , however this time I have a somewhat more complex problem: / p> ObjectTest1 = (function(){ var init = function(){ this.callback = null; } init.prototype = { setCallback :...
asked on 05.09.2016 / 21:11
3
answers

Use of using versus full name

I've been following many open source projects and noticed that there is a fairly large switch between using using ( Imports in VB.NET) and using direct reference to namespace . Example: void Main() { System.Int32 i...
asked on 17.07.2015 / 19:04
5
answers

The rest of the code inside the Try runs after encountering Exception?

The rest of the code within a try is executed after finding a exception or skips directly to the code within catch(Exception e) try{ x = 10; //alguns erro de try catch x = 20; } catch (Exception e) { x++; Message...
asked on 17.10.2016 / 13:00
3
answers

Picking up part of the phone

At registration, the user registers his phone and this field is masked (99) 99999-9999 and this is saved in the BD. if I want to use only the DDD of this, and the numbers separated, how should I proceed? in case I wanted DDD 99 Number 999999999....
asked on 03.11.2016 / 03:19