All Questions

1
answer

Detect collision between corners of objects

I'm writing a game based on the breakout , but I can not think of a way to detect the collision between the corner of the ball area and the paddle, to be able to reverse the horizontal direction of the ball. In my class Ball , I have a...
asked on 09.05.2017 / 01:29
2
answers

What is the impact of changing the keypress event so that it interacts a 'level up' than the key would do natively?

A simple example, no code needed: If I press CTRL + F , the browser automatically opens a search bar on the page. I made that by pressing CTRL + F it would point to an input inside the system. I want to put several other co...
asked on 27.09.2017 / 17:16
2
answers

Is there a way to do a foreach with two variables at the same time?

I tried to separate by comma, but it did not work: foreach($dados as $d, $telefones as $t){} I know there are other ways to make this foreach work, but I wanted to get this curious. Is it possible to use two variables in a foreach...
asked on 19.01.2016 / 13:03
1
answer

Creating many static classes does it impact system performance?

I've been creating many static classes to make code easier and cleaner, such as a Google Translate API call. public static class GoogleTranslate { public static string Translate(string word){ //código de chamada } } Doing so...
asked on 17.04.2018 / 15:14
2
answers

How can I query for the heaviest queries in SQL Server?

In the SQL Server database, how do you know which queries have consumed most of the database resources at runtime?     
asked on 12.12.2013 / 17:31
2
answers

What is dynamic programming?

What is dynamic programming?    Dynamic programming NOT is dynamic typing What are its features? What are its advantages and disadvantages?
asked on 09.12.2015 / 14:26
3
answers

JSON string conversion for Java object

I'm trying to convert a JSON string to a Java object used by Gson. This is the json I get from webservice: {"concurso": { "numero":1499, "data_sorteio":"01\/06\/2013", "dezenas":[8,22,26,33,37,54] } } Here...
asked on 17.02.2014 / 01:05
5
answers

How to get the current date and time without using the computer clock?

I'm having trouble with date , it takes my computer clock time and I wanted it to really get the right time. The result of the following code is that date will fetch from your host server. date_default_timezone_set('America/Sao...
asked on 13.03.2014 / 20:28
2
answers

How to create an immutable object in JavaScript?

I know that it is possible to "freeze" an object in JavaScript using the Object.freeze method: var x = { foo:"bar", complexo:[1,2,3] }; Object.freeze(x); x.foo = "baz"; // Não tem efeito console.log(x.foo); // bar However, the comple...
asked on 18.02.2014 / 02:09
1
answer

How does the HTML5 template element work?

Recently I've seen some news about a new HTML element called <template> specified by W3C and has already been implemented in most modern browsers. Apparently it allows you to create custom tags, much like in XML: <minha-tag&...
asked on 18.06.2014 / 04:35