All Questions

5
answers

Property readonly .NET

I received this question in a test and could not answer: "How can I declare a readonly property in .NET / C #?"     
asked on 31.01.2014 / 15:36
3
answers

How to optimize the sum of the elements of an array

I need to get the value of the sum of the items of a array in JavaScript. The amount of these items can easily reach 2,000 items. Items are of type int , no testing required. ar = [1,3,5,...,2000]; I already have a array...
asked on 27.10.2016 / 18:07
3
answers

Is it correct to write CSS with Javascript?

I see a focus on javascript frameworks, to write css directly in javascript, example ... new Vue({ el : "#style", data : { ctn : { display: "flex", alignItems: "center", justifyContent: "center", flex...
asked on 26.10.2017 / 20:18
5
answers

How to detect the page encoding with PHP?

I wanted to create a function that would save the data in the database always in the correct encoding (my bank is UTF-8) according to the detected encoding . Is there any native PHP function to do this? Is there any other way?     
asked on 19.12.2013 / 12:57
3
answers

How to remove a "listener" that I added via addEventListener?

I usually use the addEventListener function to "listen" to some events, such as click , Websocket connection, and the like. For example: var ws = new WebSocket('ws://echo.websocket.org/'); ws.addEventListener('open', function...
asked on 28.09.2017 / 21:38
2
answers

setTimeout attached to an onload does not work

I have a page in PHP that confirms or does not send the user's email through the contact page. I want it after 10 seconds (long enough for the confirmation prompt to be read), window.location is the homepage of the site. I'm trying this w...
asked on 05.02.2014 / 13:56
3
answers

"== true" is it useful for anything? Is it better "!" Or "== false"?

Is == true useful for scans, or is it completely useless? It is best to use ! or == false . Example: if (pessoa.estaMorta() == false) .... if (!pessoa.estaMorta()) .... if (pessoa.estaViva() == true) .... if (pessoa....
asked on 15.07.2018 / 16:37
3
answers

How to decompose a number in powers of 2

I'm using javascript for my logic: I have a sequence of numbers: 1, 2, 4, 8, 16, 32 and so on. Given a number, which must be the sum of sequence numbers, for example: 44 (of which the value is the sum of 4 + 8 + 32). How do I know that the nu...
asked on 11.07.2014 / 18:54
2
answers

How to use database in CakePHP without complying with the naming conventions?

CakePHP has conventions for naming tables, classes, etc., such as having the username and password columns for tables that hold users. In my current situation, I have tables that do not meet these standards. How could I continue to us...
asked on 13.01.2014 / 15:17
4
answers

What is the most complete linux for programmers? [closed]

I studied hobby programming about 4 years ago, I started with php , c # , I learned a little bit of everything, but Now I'm thinking of going deeper. I have always used Windows which I have always really enjoyed, but I feel that Linux can offe...
asked on 09.03.2014 / 23:48