All Questions

5
answers

Mask for CPF and CNPJ in the same field

Hello, I looked for this doubt in the questions, but I could not find it. Well, I would like to make a field have the masks of cpf and cnpj depending on the amount of characters typed. This is not quite true, because with several tests I did her...
asked on 27.10.2015 / 19:40
2
answers

Differences between localStorage Vs sessionStorage?

What are the differences, pros and cons between localStorage and sessionStorage ?     
asked on 06.06.2014 / 02:22
5
answers

How do anonymous functions work?

I know they are functions that do not have the specified name, but what is the purpose? Is recursion possible with anonymous functions? Ex: Fibonacci sequence. (function(x, y) { alert(x + y); })(5, 5); // Função para somar duas v...
asked on 20.03.2014 / 16:23
4
answers

Regular expression to validate a field that accepts CPF or CNPJ

I have <input> in the form that should accept CPF or CNPJ . In the back-end in PHP the value to save either in the " cpf " field or in the " cnpj " field of a table in the database. I'm using AngularJS and I need a regular...
asked on 30.03.2014 / 06:56
3
answers

What are lexical scope and dynamic scope and what are their main differences?

What are lexical scope and dynamic scope and what are their main differences?     
asked on 15.04.2014 / 18:21
4
answers

Type of the CPF or CNPJ field in the VARCHAR or INT database?

What type of CPF or CNPJ field in database VARCHAR or INT ? I've seen some posts suggesting to use INT to optimize performance in JOIN and filters. If you have 0 on the left, you can only complete it according...
asked on 22.01.2015 / 14:51
5
answers

What is the advantage of using recursive functions?

Recently I discovered the famous (or not so famous) Recursive Functions and I found the concept very interesting. But during my reading I had some doubts about the use of such. 1st What is the advantage of using Recursive Function ? For I...
asked on 11.01.2016 / 04:10
4
answers

What is the problem of gluttonous philosophers?

When it comes to competing programming, they always cite 3 classic problems / competition models: Producers and Consumers Readers and writers gluttonous philosophers (or philosopher's supper) I searched here on the site but at no ti...
asked on 16.03.2018 / 05:02
1
answer

Programming oriented towards interface and not for implementation, why?

What are the main reasons (in practice) that lead developers to apply the practice of developing interface-oriented rather than implementation?     
asked on 11.09.2015 / 21:03
3
answers

What is the difference between $ (this) and $ this and this?

I've always used $(this) regardless of the situation and always worked. Rarely have I had to use one of the others and in those times I did for someone's guidance and not for knowing exactly what I had to do. So what's the difference...
asked on 22.10.2014 / 17:57