Posts by Renato Dinhani • 1,747 points
50 posts
-
4
votes1
answer79
viewsA: How do I get a value from a cell in R?
Use the argument drop = TRUE. The code should look like this: umParticipante[5, 1, drop = TRUE] Explanation: When you pass the argument drop = TRUE, R turns the result into a vector and will stay…
-
2
votes2
answers780
viewsA: Start with an already selected <f:selectItem
In your Java code you probably have something like this: public class SelectManyView{ private List<String> selectedOptions; public List<String> getSelectedOptions() { return…
-
2
votes1
answer2431
viewsA: Select with Laravel/Eloquent
You need to put the column NM_MATRICULA_ALU in your bank consultation because it is not being returned. Change the first line of SQL to this: SELECT alunos.ST_ALUNO_ALU, alunos.ID_ALUNO_ALU,…
-
0
votes2
answers55
viewsA: Is it possible to intercept calls to class functions?
In PHP there is the method __call() which is called when the method does not exist in the class. Suddenly you can do something like this: public function __call($metodo, $parametros){ if($metodo ==…
phpanswered Renato Dinhani 1,747 -
5
votes1
answer183
viewsA: Roles and Roles Api
In Brazil there is a Brazilian Classification of Occupations. You can download the CSV files with the data to import into your application in the link:…
apianswered Renato Dinhani 1,747 -
1
votes1
answer66
viewsA: Parameter is not coming as null
You are not passing null in the method addInfoMessage. You are passing an array of size 1 where the first object is null. Do so if you want to pass null: addMessage(FacesMessage.SEVERITY_INFO,…
-
1
votes1
answer112
viewsA: Bundler Error::Gemrequireerror
A Gem uglifier is a wrapper for Javascript code. In order to run it, you need to have Nodejs (or another Javascript execution environment) also installed on the machine.
ruby-on-railsanswered Renato Dinhani 1,747 -
2
votes1
answer180
viewsA: How to choose which field to serialize - Jackson
You have two alternatives: 1 - You create classes to represent the information that must be serialized for each case and populate these classes according to need. 2 - You can create a custom…
-
1
votes2
answers1141
viewsA: Postgresql - Query data from a range and bring a boundary of lines but spaced
You can use Window Functions to take for example a line every 100 lines or you can use some kind of aggregation in the bank, such as transforming the TIMESTAMP at a date and group the values per day…
-
1
votes1
answer169
viewsA: Internationalization with Enums Labels
Do so inside the getLabel FacesContext context = FacesContext.getCurrentInstance(); FacesContext.getCurrentInstance().getApplication().evaluateExpressionGet(context, label, String.class); This code…
-
0
votes2
answers344
viewsA: Httppost action returning null values
The problem with your code is that you send the SOLICITANTE to the view, but does not submit it back. My suggestion is to create a field IdSolicitante in class Solic and render this in a field like…
-
0
votes3
answers1759
viewsA: Create post on a wordpress and bring in other wordpress automatically
You can edit the file wp-config.php in the two Wordpress installations so that they point to the same database. That way, everything created through one will automatically appear in the other.…
-
5
votes1
answer335
viewsA: It makes a difference to use LONGTEXT instead of VARCHAR(255)
Yes, it makes a difference. These two types of data are stored in different ways in the database and have different functions. For example, you can index a column of the type VARCHAR, but cannot…
-
3
votes3
answers673
viewsA: Functions with Textbox and Buttons type parameters
The problem is that you are trying to define the property on an object of the type object, and not TextBox. You have to do the cast for the type you want, for example: ((TextBox)x).Visible = true;…
c#answered Renato Dinhani 1,747 -
4
votes3
answers3594
viewsA: What is the difference between display:inline-block and float:left
inline-block is the junction of behaviors inline (ex.: occupy only the space of the content, not break line) and block (eg: configurable dimensions) in a single HTML element float causes the element…
-
0
votes3
answers61
viewsA: BD Results Count for pagination
You can use SELECT count(*) FROM cl to know how many rows/records this table has.
-
5
votes1
answer1356
viewsA: Access html objects in code in Asp.net c#
To access an HTML object through the C#code, you must add the attributes id and runat="server" in the HTML element you want to access. Once this is done, the HTML element is available to be accessed…
-
2
votes1
answer265
viewsA: Bootstrap 3: Collapse on Hover and fixed on click
You can use the following code so that when you click, in addition to you set the class to leave it open, you remove the event from Hover. $('.menu-header').click(function () {…
-
1
votes1
answer231
viewsA: How to make the header color of Panelgrid Dynamic in Primefaces?
Natively Primefaces doesn’t have a property that allows you to change the header style, but Windows can create its own CSS by customizing the class ui-widget-panelheader, for she is responsible for…
primefacesanswered Renato Dinhani 1,747 -
1
votes2
answers300
viewsA: Return N elements from a list in jQuery
You can use multiple separator selectors with comma and use the nth-child to pick up a specific element. In the case of your example, it would look like this: // no nth-child, indices começam no um,…
-
1
votes1
answer71
viewsA: Edit registered containing image
What I usually do in this case is a separate Ajax request the moment he clicks to remove the image. Another alternative is as soon as he clicks to remove the image, Voce just deletes it from the…
asp.net-mvc-5answered Renato Dinhani 1,747 -
0
votes1
answer69
viewsA: How to get value from an action property?
In ASP.NET MVC Voce you can use the object ViewBag to transfer properties between controller and views. In the controller, it stays that way: ViewBag.Exemplo = "meu valor"; You can access this value…
asp.net-mvcanswered Renato Dinhani 1,747 -
2
votes2
answers847
viewsA: Changing index.jsp dynamically without reloading the page
You can use Javascript to change the iframe address without having to reload the entire page: document.getElementById("id-do-iframe").src = "/nova-pagina.jsp?parametro=1";…
-
1
votes1
answer901
viewsA: Setting controller paths in Codeigniter directories
Try to do it this way, using the (.*) as a capture group, getting the whole URL: $route['admin/(.*)'] = "admin/$1"; $route['(.*)'] = "site/$1";
-
3
votes1
answer566
viewsA: Get values through get method parameters
In his method CadastrarEndereco you can declare the parameter codigoCliente as follows and use it. public ActionResult CadastrarEndereco(int codigoCliente){ // codigoCliente preenchido aqui dentro }…
-
1
votes2
answers1433
viewsA: Automatization of the execution of a file . exe
You can use the Quartz library Enterprise Scheduler . NET to perform scheduled tasks in an application, either at a preset time or from time to time. Quartz.NET is a full-featured, open source job…
c#answered Renato Dinhani 1,747 -
2
votes3
answers598
viewsA: Check if there was POST with Javascript
If you are using jQuery to make Ajax calls to the server, Voce can use the events ajaxStart and ajaxComplete to execute its logic whenever an Ajax request is started or completed. Example:…
-
3
votes3
answers1429
viewsA: Generate sequential number within one month
A possible solution for your problem would be to create a sequence in the database and reset it with a database check at the beginning of each month. That way your code would look like this:…
phpanswered Renato Dinhani 1,747 -
3
votes3
answers3993
viewsA: Variable $_POST has size limit?
Yes, the $_POST has a maximum limit defined by the setting post_max_size PHP, but this value is usually sufficient for textual information. It would be interesting to check if Voce has no attributes…
phpanswered Renato Dinhani 1,747 -
1
votes1
answer1051
viewsA: Target Unreachable, Identifier resolved to null
This mistake happens because the meuManagedBean simply doesn’t exist in this case. Perhaps some annotation was missing in the class to indicate that this class must be a manageable bean or simply…
-
2
votes1
answer635
viewsA: How to insert timestamp value into a Mysql table?
You can select a column that contains a timestamp in Mysql as a date in that format by doing the following query: SELECT FROM_UNIXTIME(coluna_timestamp, '%d/%m/%Y') FROM minha_tabela;…
-
1
votes1
answer701
viewsA: How to pass data between pages?
Try to change your commandButton for that reason: <p:commandButton value="Chutar" ajax="true" oncomplete="window.open('pag2.xhtml');"> <f:setPropertyActionListener target="#{Chute.chutar}"…
-
2
votes1
answer182
viewsA: Leave the selected image with opacity higher than the others in a gallery
You can create a class for the image gallery and leave by default all images with an opacity of not selected. When the user selects an image, you add a CSS class that indicates that the image is…
cssanswered Renato Dinhani 1,747 -
5
votes1
answer60
viewsA: How does the inverse function work in jQuery?
Try to use the method toggleClass. Using it, if the class is present, it removes, and if not present, it adds. $(".formsEditProdutos").toggleClass("esconde");…
jqueryanswered Renato Dinhani 1,747 -
4
votes2
answers2325
viewsA: Control Serial Port using Web Application
I’ve had to do this kind of work in several applications. The solutions found were to use Java Applets or install a small service on the client machine that opens a port and responds to HTTP…
phpanswered Renato Dinhani 1,747 -
1
votes1
answer259
viewsA: Repeat div with foreach?
If you are using Razor to generate your views, you can place the creation of the Divs inside the foreach. @forach(var usuario in ViewBag.usuarios){ <div> @usuario.nome - @usuario.email…
-
1
votes3
answers3470
viewsA: GROUP BY last entry
In Mysql you just need to sort your SELECT from the latest to the oldest and apply GROUP BY. It will return the first line for each grouping. SELECT id, protocolo, status, alteracao, datahora FROM…
-
3
votes2
answers14517
viewsA: Get file name in input file
You can get the selected file name by obtaining the field value. In this specific case, using the following code: var nomeDoArquivo = $("#curriculoForm").val(); // obtem o nome…
-
1
votes1
answer321
viewsA: Inserting Textview in Relativelayout
You can replace the RelativeLayout for LinearLayout and use the attribute android:orientation="vertical". This will cause when Voce adds the fields dynamically, one is below the other instead of…
androidanswered Renato Dinhani 1,747 -
1
votes1
answer219
viewsA: Oracle 12C + Java + Xmltype
Instead of using the method getStringVal to obtain XML content, you can use the method that getInputStream that returns a InputStream for you to read the XML byte to byte of the database. Make sure…
-
5
votes3
answers5650
viewsA: Regular expression to pick up the value after the comma
Use the following regular expression that will work: (?<=,)([0-9]+) This regular expression uses lookbehind that nothing else is to find the values of the defined group ([0-9]+) if before he…
regexanswered Renato Dinhani 1,747 -
4
votes2
answers1311
viewsQ: How to get position of a sub-list within another list?
I have a list of bytes and I need to check if it contains a sub-list of bytes in a specific order. How can I do this check by getting the position of the sub-list in a simple way, using the…
-
7
votes3
answers9362
viewsQ: How to get the value without a mask from a Maskedtextbox?
I’m wearing a MaskedTextBox for formatting documents. It is working perfectly, but how do I get the value typed in the field without the mask being present?
-
4
votes1
answer171
viewsQ: Should Android support libraries be compiled together in APK?
I’m developing an application for Android, and it uses two libraries that Google provides. To appcompat-v7 is used to have action bar on devices with version 2.3 or less, as this has only been added…
-
1
votes3
answers364
viewsQ: How to get the class name where a bean will be injected?
I am configuring two Beans in the file beans.xml to inject Loggers into my classes. <bean id="loggerFactory" class="company.LoggerFactory" /> <bean id="logger"…
-
2
votes1
answer527
viewsQ: Configure the Jackson library for dynamic attributes
I am using the Jackson library to transform the following JSON into a Java object.…
-
1
votes1
answer1114
viewsA: How not to serialize some attributes in Restful calls with Jersey and Jackson
To ignore an attribute in serialization, I used Annotation org.codehaus.jackson.annotate.JsonIgnore of the Jackson library itself. It should be placed in the attribute to be ignored as the following…
-
2
votes1
answer1114
viewsQ: How not to serialize some attributes in Restful calls with Jersey and Jackson
I’m using the Jersey library in conjunction with the Jackson library to use REST-like web services. In calls, I usually use the following code that transforms a particular entity into a JSON to be…
-
15
votes4
answers3728
viewsQ: Java client library for REST web services
I am in a project in which it is necessary to access a web service REST and I would like to know which is the most used Java library to access this type of resource in an easy way. I know it is even…
-
14
votes1
answer1567
viewsQ: Use the same entity in Hibernate to write to two tables
I am using Hibernate to make the persistence in the database, and in a given case, for each update that a certain entity Consultor has, it must update in the main table called TB_Consultorand insert…