All Questions

3
answers

How to sort by Like relevancy?

I am doing an autocomplete that makes a request to a url, which in turn queries the database. This query is done with LIKE . I use %$termo% to be able to query, however I would like to sort the result according to the relevance o...
asked on 17.05.2017 / 16:17
2
answers

How to check an attribute of type object in Javascript?

I get the following object: obj = { fernando: { nome: 'Fernando', idade: 21 }, tiago: { nome: 'tiago', idade: NaN }, total: 2 } As you can see, I get an object where each attribute can be...
asked on 21.12.2016 / 19:36
2
answers

What does a class diagram contain?

The title is a stupid question, because the name of the diagram already responds. But yesterday this question came to my head when a professor of Analysis and Software Projects asked the whole class the class diagram of what would be our project...
asked on 20.10.2016 / 14:27
1
answer

Whenever I'm scanning a string in C I should use "strlen ()", right?

It is common to see in C executions that people need to parse and / or manipulate the contents of a string , so we need to be sure that it will not exceed its limit. It is very common to make a for ranging from 0 to strlen() - 1 ,...
asked on 24.11.2016 / 12:53
3
answers

Is it better to have an exception type for each case or a more general exception?

A project from my college was asked to create a class called RepositorioException which is a subclass of Exception to be used for handling exceptions in repository classes, which are: RepositorioMotorista , RepositorioViag...
asked on 09.11.2016 / 20:58
2
answers

Sql Server 2014 Null Value

I am a beginner in Sql server, I am doubtful about the following code: declare @var nvarchar(50) = null declare @bool bit if (@var = null) set @bool = 1 else set @bool = 0 print @bool The variable @bool returns as 0...
asked on 23.09.2016 / 23:06
3
answers

How to change the text of a link after it has been clicked?

How do I get the text of a link where to be written "show more" change to "show less" and vice versa when clicked? >     
asked on 28.12.2016 / 17:39
2
answers

What is salt when it comes to password encryption?

Searching for encryption, in some cases, salt is used, as some people probably know. In English translation I know it's salt, but within the scope of software development I did not quite understand. What is salt when it comes to password...
asked on 18.02.2017 / 14:20
2
answers

Josephus problem (recursive)

This is the recursively rendered resolution of the Josephus problem , where n is equal to the number of people in the circle, and k is the step number to be given to the next person. #include <iostream> using namespace st...
asked on 19.03.2015 / 16:52
3
answers

How to add more products?

I'm creating a personal "sales" system for my father's company. I just have a problem. I can only sell one product at a time, I'm new to PHP so its not much to do. I want to make a "cart" and can add 2 or more products. I tried the following:...
asked on 26.03.2017 / 22:21