Posts by Juliano Alves • 2,110 points
45 posts
-
0
votes1
answer116
viewsA: How do I line up at the bottom corner of the screen in the flutter?
Basically, you need to expand the size of the area that your Row occupy and align its contents. Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ... ] ) ) Expanded…
-
3
votes1
answer194
viewsA: Function that returns another function by returning itself
You missed a detail yes. When you call the function a it is necessary to pass a parameter, which does not happen here: a(a); // o a de dentro não recebe o parâmetro So when a executes return b(); -…
javascriptanswered Juliano Alves 2,110 -
0
votes1
answer28
viewsA: Check codes that are not in the database with a query
If the list is fixed, you can do this with unions: select * from ( select 1 item union select 2 union select 3 union select 4 ) where item not in (select cod from tabela1) But if as the list…
-
0
votes1
answer84
viewsA: Ruby on Rails Routes
Your problem is in the VerificacaosController. The url maquinas/:maquinas_id/verificacaos is processed by the action index, to which all is returning: # GET /verificacaos def index @verificacaos =…
-
2
votes2
answers704
viewsA: Problems with the result of a sum between double-type numbers
For mathematical calculations always use Bigdecimal. Bigdecimal is a class that works with arbitrary precision floating point numbers, which choose how much precision you want to use. But there’s an…
-
2
votes1
answer118
viewsA: Servlet is responding but ajax does not reflect the answer
It seems the problem is a typo, in its code is written succes: succes: function(data){ but it should be Success (ss): success: function(data){ Remember to check out these details in the…
-
1
votes2
answers878
viewsA: Subtract shellscript input argument value
You only need one $ in the subtraction expression (and remove spaces): #!/bin/bash for i in $(seq 1 $(($1 - 1))); do if [ $(($i % 2)) -eq 0 ] then echo "$i" fi done Extracting a variable becomes…
-
13
votes3
answers1700
viewsA: Embedded (Embedded) or external (traditional) application server?
The "traditional" deployment and operations model used to handle java applications is strictly linked to application servers. The way of administering Application Servers has hardly changed over the…
-
0
votes1
answer97
viewsA: Passing Parameters between a jsp and two servlts?
You don’t need two Servlets, your problem is easier to solve than this: Send the values of your form to Servlet Create the respective object in Servlet, persist it, make the magic happen Put your…
java-eeanswered Juliano Alves 2,110 -
1
votes1
answer165
viewsA: Filter passes before login Servlet
From your description, I’m assuming you have a Servlet to validate whether the user/password is valid, and a filter that only checks whether the user is logged in or not. This separation is correct,…
-
1
votes1
answer371
viewsA: Instantiate an object from a Spring-managed class
You need to somehow access the ApplicationContext of Spring. As you said that this class is not managed by the same, I believe you will have to instantiate it: ApplicationContext context = new…
springanswered Juliano Alves 2,110 -
0
votes1
answer149
viewsA: How can I test an Exception in my code with unittest?
You must use Testcase.assertRaises: import unittest class SeusTestes(unittest.TestCase): def testa_excecao(self): self.assertRaises(SuaException, objeto.suaFuncao) if __name__ == '__main__':…
-
6
votes2
answers164
viewsA: Types of C#Methods calls
Imagine we have a method that returns a String: public string StringMarota() I can call this method and play the result in a variable: var marota = StringMarota(); Every string has the method…
-
3
votes1
answer160
viewsA: Using Callable in java runs code sequentially
In fact, it makes perfect sense: List< IResult > result = future.get( ); // wait for a processor to complete You’re calling get in each Future, which is bloating, thus making a sequential…
-
1
votes2
answers284
viewsA: Screen to configure Mysql connection
You can leave all your configuration in a file application.properties, commonly placed in your Resources folder (thinking of the Maven project structure) and read its settings. This even allows you…
-
27
votes4
answers8680
viewsA: What are the differences between HTTP 2 and HTTP 1.1?
Automatic compression At HTTP 1.1 we enable GZIP to compress the information we send in our responses. A good practice that needs to be explicitly enabled. In HTTP 2 GZIP is standard and required.…
httpanswered Juliano Alves 2,110 -
0
votes1
answer208
viewsA: How to print the Browser or OS name on a JSP - Java Web
Take a look at user-agent-utils, with this lib you can easily extract the information you need, for example: String userAgentStr = request.getHeader("User-Agent"); UserAgent userAgent =…
-
3
votes1
answer233
viewsA: Passing multiple parameters as an Array
Use the method toArray(T[] arr): ArrayList<String> listaCampos = new ArrayList<>(Arrays.asList("nome", "dataNascimento", "sexo", "rg", "cpf")); enviarCampos("CADASTRAR",…
-
5
votes2
answers350
viewsA: Solve a bug in the middle of a sprint?
The size of the damage that the bug cause determines the urgency. Suppose it is an application that is running and being used by users and that this bug, somehow prevents users from being able to…
scrumanswered Juliano Alves 2,110 -
1
votes2
answers297
viewsA: How to get checkbox and option value with jquery
Even with the doubt I raised, I think I can propose a solution. Instead of accumulating the result, you can get a list of everything you want and then transform the results as you see fit. In the…
-
0
votes2
answers155
viewsA: Storing data in a Rails array
A more elegant solution. Case modelo is a simple value (string, int): @lista = Item.where(codigo: params[:codigo]).pluck(:modelo) If you are an association: @lista = Item.where(codigo:…
-
0
votes1
answer2773
viewsA: Unable to build Entity manager Factory errors Help aq please
Apparently, the cause of your problem is that the password for the root user is incorrect: Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "root" You…
-
1
votes1
answer30
viewsA: Search using between no postrgres
You are converting the values to an integer so that postgres is ignoring the separator. Change the function TO_NUMBER for: TO_NUMBER(caracteristica_lista.carlis_nome, '9.99999999') And you must get…
postgresqlanswered Juliano Alves 2,110 -
7
votes1
answer6067
viewsA: Javascript - Filter object array
the only problem is that the function you use has to return the value. Change your code to: var filtrado = array.filter(function(obj) { return obj.marcar == 1; }); That will work.…
javascriptanswered Juliano Alves 2,110 -
1
votes2
answers375
viewsA: Debug javascript object Chrome
Are you sure breakpoint is correctly placed in your code? If you use a console.log in that spot he’ll write straight? If everything is ok, try instead of using the manual breakpoint of Chrome to put…
-
3
votes1
answer588
viewsA: Differences between Criteria and HQL
With rare exceptions, everything you do with one can also do with the other. I think the difference lies in how each one works. Some interesting details to take into consideration at the time of…
-
6
votes2
answers528
viewsA: What is the difference between new Function and Eval?
They don’t do the same thing: eval() evaluates a string as a Javascript expression within the current scope and can access local variables. new Function parses the code for a function object, which…
-
7
votes3
answers5917
viewsA: Check whether the values of an array are all the same or all different
I have filtered the array by removing duplicates. If only one element is left, they are all the same. If the array size is the same, they are all different. function todosIguaisOuDiferentes(array) {…
-
2
votes1
answer517
viewsA: How to print a JSON array?
I will suggest a different solution without using loops. First Filtre by what you are looking for with the method filter: listaFiltrada = listaNomeProjeto.filter(function(e) { return e.nomeProjeto…
-
2
votes1
answer52
viewsA: Why is there such a "(jQuery)" at the end of Function?
When you write (function() { ... })() you are making the code within the literal function (literal Function), so that the whole object is actually a function. Then you are calling the function, with…
jqueryanswered Juliano Alves 2,110 -
2
votes2
answers190
viewsA: Rails Console does not load the methods and classes of my application, why?
person is a variable that does not exist. You have to call the class method: person = Person.first That’ll get you the first Person from your database.…
-
1
votes2
answers359
viewsA: How to use @Delete annotation in Vraptor + AJAX?
The problem is you’re trying to make a POST to a resource that only accepts DELETE, The solution is easy, you just need to correctly indicate which html method you want to use in the request:…
-
4
votes2
answers4895
viewsA: Pass parameters to the Controller via @Html.Action
The parameter name in the View and Controller should be the same, so you are only receiving null. Just change your View to @Html.Action("ExibirCliente", "Cliente", new {idcidade = Model.ID}) since…
-
5
votes1
answer525
viewsA: I can’t update a Ruby project on Heroku with Git
The first error indicates that your project is outdated from what is in Heroku. You have two options. The first is: git pull --rebase heroku master And in this case you resolve the rebase to align…
-
1
votes2
answers1351
viewsA: Pass parameter via jquery with href
This is because you are taking the value of a through the id, and all its as has the same id (which is bad, id must be unique). You’re adding the event to the element itself, so you can refer to…
jqueryanswered Juliano Alves 2,110 -
20
votes3
answers5311
viewsA: When to use var in C#?
I believe that this is much more a matter of legality than anything else. When I read about this I found discussions on the topic, and the recommendations will depend on what the person thinks of…
-
5
votes1
answer707
viewsA: Pass values from a JSON to html via Jquery
I believe that by "without touching the html" you mean putting the content on the page via javascript, right? // transforme a lista no que você precisa (lista de li): var listaDeLi =…
-
1
votes1
answer340
viewsA: Problem with @Autowire Spring + Hibernate and Junit
Spring doesn’t have to instantiate or inject something into its Daogeneric class because it’s abstract. Its options are: To make his Daogenerico stop being abstract and father of Daousuario, to…
-
1
votes1
answer136
viewsA: Ajax callback using Spring MVC does not work
It seems that it is a typo, is written sucess with only one c, when the right is Success. Remember to check these details on documentation.…
-
2
votes2
answers241
viewsA: Active Record Rails 4
In Rails 4, different from 3, when calling the method all Active Record does not return a Array, but an object child of ActiveRecord::Relation. Once the darlings return this Relation, now we can…
-
1
votes1
answer710
viewsA: Doubt with Spring dependency injection (injected object returning null)
The problem is exactly what you put in the comment, you are using a wrong approach: Dependency injection: This concept is not being employed. You should not instantiate in your class the objects it…
-
4
votes3
answers1517
viewsA: How to use Skip and Take with Pagedlist Helper
There are no Take and Skip equivalents in query syntax, but you can use the methods by merging, as follows: var grupos= (from s in db.grupos select s).Skip(10).Take(20);…
-
1
votes3
answers403
viewsA: Agile development and documentation update
The easiest (and cheapest) way would be to make the changes in the classes (software in operation first) and then reverse engineer it to generate class diagrams and the like. There are several tools…
-
2
votes1
answer481
viewsA: Changing the status of a checkbox component in the database using AJAX
To make the change in the bank, you need to have an action that does this. Let’s consider that there are 2 actions, a ativarDestino and the desativarDestino. When the checkbox is selected we will…
-
2
votes1
answer1013
viewsA: I cannot generate the table by Hibernate
The Geratable class is using a Configuration which she herself creates, when she should use the object created in HibernateUtil. Better than exposing this object, you can create a method for…