All Questions

2
answers

Best Practices for URI in RESTful APIs

I am doubtful about the URIs of some api resources that I am developing. I have the projects and activities resources with respect to 1-N , ie a project has multiple activities and an activity belongs to a project. What is the right way...
asked on 21.10.2016 / 13:28
1
answer

How does a form's data capture work?

I have this code to get data from a form: @WebServlet(name = "computador", urlPatterns = {"/computador"}) public class computador extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse re...
asked on 08.02.2016 / 17:45
2
answers

Performance difference between several conditions in an IF or multiple IF's separately?

During a change in a source code, I came across the following situation, developed by another developer: if ( booleano1 || booleano2 || booleano3 ) { if( booleano1 ) { //faz algo } if( booleano2 ) { //faz a...
asked on 03.12.2015 / 12:54
1
answer

Is there an associative array type data structure in Java?

Well, I'm trying to name an Array of Strings in Java, but I wanted it to be, for example: String[] symbols; And that could be stated like this: symbols["name"] = "Tiago"; I know that Array does not exist like this, but in some other wa...
asked on 13.01.2015 / 22:10
2
answers

Use Command Line with C #

In my work I use the Command Line, and wanted to improve the work in my company. To do this, I thought about creating a C # program for people who do not know how to work with the command line. I thought of putting a button to open a CNF fi...
asked on 17.04.2015 / 17:52
1
answer

How to perform automatic pull with Git?

Imagine that I have an environment for testing a web application, where there is a cloned GitHub repository that goes right inside the server, and any modification in it already results in a real-time modification when the user accesses the same...
asked on 21.12.2014 / 17:50
1
answer

PSR-4 in an MVC project or not?

I have two codes, the first one uses spl_autoload_register and the other does not, however the second one loads "automatically the class" as well. With spl_autoload_register Uses namespaces to split MVC You can create multiple le...
asked on 10.08.2015 / 22:18
3
answers

Which application layer is geared towards processing of broader and more complex business rules?

I have been reading some questions and answers about the MVC standard and I have seen that it is correct to treat business rules in the Controller layer, for example: Verify that a record already exists in the database before persisting i...
asked on 08.10.2014 / 01:41
1
answer

How to handle duplicate key error?

How do I handle duplicate key errors? I need to display message to user that "Item is already registered" Something like this: try{ //tenta inserir no Banco de Dados context.Produto.Add(_produto); context.SaveChanges(); }catch(exceç...
asked on 02.10.2015 / 01:26
2
answers

How to detect USB connection via application?

Is it possible for me to detect a USB connection in my Android application and how do I do this? I have a sync menu that is performed via USB and FTP, however I want to leave the USB option accessible only when the device is connected to the...
asked on 29.12.2014 / 15:11