All Questions

3
answers

With the 9th digit on the phones, how can I solve the problem of displaying phones that have 8 digits?

This was a question that came up with the ninth digit news on the phones here in Brazil. I have in the system a list of phones that are saved together with the DDD. How can I make an 8-digit phone (and with the DDD) be filled with 9? Ex...
asked on 15.10.2015 / 15:13
3
answers

How to add +1 in a countable variable with each click?

Each time I click a button, I want to add +1 to a variable. For example: I have a count variable getting a value of 5, when I click a button I want the value 5 to change to 6 and so on, displaying in alert() . Is it possible?...
asked on 19.02.2014 / 23:09
3
answers

Star vote with input radio, javascript / css

I am creating a registration form, in it I will insert a voting system, I wanted to do that when clicking on some star, the previous ones will change color as well. (Here is the code I created) <div class="vote"> <label> <in...
asked on 22.06.2015 / 17:41
5
answers

indexOf does not find element in an array

The indexOf() is returning -1 even though I have this element, I'm doing this: pessoas = []; pessoas.push({"nome": "Pedro"}) pessoas.push({"nome": "João"}) pessoas.push({"nome": "Maria"}) pessoas.push({"nome": "José"}) console.log(pess...
asked on 30.10.2018 / 20:11
9
answers

Best practice for if

Which of the two code options performs better? I'm going to display a very simple example, there's usually more code inside if . A) string mensagem = "OI"; if(exibirAdeus) mensagem = "Adeus"; B) string mensagem = ""; if(exi...
asked on 03.02.2014 / 12:16
5
answers

Sum of hours greater than 24h

I have a variable with the value '18: 00 ', which corresponds to a duration received through two-time calculations. $tempo = '18:00'; // queria somar 8:00 Answer: $temposomado = '2:00'; Desired value: $temposomado = '26:00' How ca...
asked on 20.04.2018 / 18:35
3
answers

Why JavaScript objects are not always JSON?

This for example: { "nome": "Meu nome", "sobrenome": "Meu sobrenome" } Can it be considered an Object and also a Json? If not, why not? What will differentiate one from the other is when instantiating?     
asked on 11.07.2018 / 12:45
4
answers

Installable PHP application architecture [closed]

I'm trying to improve my PHP applications. In this goal I would like to create an installer for a web application, a website for example. I already know linux packages like rpm and deb, that's not what I'm talking about, because some servers...
asked on 24.12.2013 / 17:40
2
answers

Can a subclass have two superclasses?

Suppose I have a Pessoa superclass and another Funcionário , with its given attributes and methods. Can my Professor class be a "daughter" of Pessoa and Funcionário , since it fits both? If yes how is it possible? With...
asked on 27.02.2018 / 13:37
3
answers

What is the difference between files encoded with BOM and without BOM? [duplicate]

In a long time I faced problems with formatting files between ISO , UTF-8 , ANSII and others, search for ways to solve these problems, I found several different ways, both using tools, and using programming languages, but one thing I never...
asked on 21.05.2014 / 16:06