All Questions

3
answers

Global variables recursion

I am learning recursion and I have doubts about using global variables, particularly I think a clumsy gambiarra , maybe you could be wrong. I made a code to add positive numbers and I used a variable called sum. I wonder if there are any other...
asked on 29.01.2017 / 21:41
3
answers

Invert string in C

I'm trying to invert a string into C but the function is cleaning it: for(i = 0; i < (int)(size/2); i++) { tmp = buffer[i]; //armazena o character inicial buffer[i] = buffer[size - i]; //Troca o character da ponta oposta buffer[s...
asked on 01.07.2016 / 20:27
2
answers

The operator! = is undefined for the argument type (s)

I am trying to create a method to save users in the database by doing the following check if the id of the last user is different from null it changes if it does not register. Code public void salvar(Usuario usuario){...
asked on 28.03.2016 / 20:48
3
answers

How do I get a String size correctly using UTF8?

I'm doing some tests and I realized that the string has special characters and counts more than one in substr . Example: $string = "PAÇOCA"; echo strlen($string); echo substr($string, 0, 3); I should print: PAÇ but only p...
asked on 08.07.2016 / 20:03
2
answers

What is it and what is the function. (dot) in OOP?

A long time ago a teacher defined and explained the function of . in POO (Java Classroom). In time I forgot, but I found it quite interesting, we often think it's just a "dot", but it's not quite like that. So the question:...
asked on 24.02.2016 / 13:36
3
answers

How to make links with preventDefault in angular?

I'm using a function called with ng-click , through a link (Anchor). However, because of the hash # , the page is "jumping" every time I click that link. My code is this: <a ng-click="openImageModal(request)" href="#">...
asked on 27.07.2016 / 17:07
2
answers

Functions with number of arguments "dynamic"

I want to construct a function that can have the number of variable parameters, such as the c function, and how to access their addresses, for example: c(a = 1, b = 2, d = 9) #acessar a, b e d Is it related to ... ? What do the...
asked on 23.06.2016 / 19:01
2
answers

Save multiple instances of a class to a List in Java

I'm having a college assignment that I need to create multiple instances of a Pessoa object and save those instances to a listing to show the user when needed (this will work as a database). As we have not seen database I still can not insert t...
asked on 18.04.2016 / 03:59
4
answers

Error when executing hibernate

After catching a little, I'm walking with my project. When I run the project, I get the following error: mai 16, 2016 6:41:22 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation INFO: HHH000204: Processing PersistenceUni...
asked on 17.05.2016 / 02:44
5
answers

How to run an event once?

How do I get an event fired one time? <div> <span class="oi"> OI </span> </div> $('.oi').mouseenter(function(){ alert('OLÁ'); }); This is just a simple example.     
asked on 01.03.2016 / 18:00