Posts by Gabriel Gonçalves • 1,632 points
64 posts
-
1
votes1
answer77
viewsQ: How do I "share" a request between threads?
I have a "problem" in the system I’m working on, it’s a Java api. Not long ago, they started deploying filters from the request parameters. For every request, it has a preHandle that filters this…
-
0
votes1
answer156
viewsA: How to manipulate several banks with Hibernate?
An alternative found, to be able to use two databases, is to create two configuration files of the hibernate and handle according to use: Hibernate-Event.cfg.xml <?xml version="1.0"…
-
3
votes1
answer156
viewsQ: How to manipulate several banks with Hibernate?
I am testing the functioning of Hibernate and I came across a question. I have the following configuration: Hibernate.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE…
-
2
votes2
answers5626
viewsA: Trigger event when user starts typing in search field
You can do it in two ways. The first is to use the event onkeyup in one tag and the other is to use the function keyup() jquery. JS function busca(){ alert("Funcionou"); } <input type="text"…
-
1
votes2
answers61
viewsA: Remove a class from a tag with more than one class
There are basically two "mistakes" in your code. The removeclass() is written in small, it should be that way removeClass(). The slidedown() is also in tiny, it must be that way slideDown().…
-
1
votes1
answer42
viewsA: How to use text Popover without using Href
By the looks of it, you are using Bootstrap, are going to give a solution in Bootstrap. In it, there is the component Popover, that you can read your definition better here. Below is a code of how…
-
1
votes1
answer63
viewsA: How to play letter by letter of a sentence in an array?
To do this, simply take control of the rows of your matrix and insert each character into the matrix separately. You must assign each sentence character in a matrix position. In this example, the…
-
5
votes3
answers535
viewsA: CSS Change Time with Javascript
Assuming you have the style class ready for the desktop-card, just add the properties transition in that class and when to change the style in JS it will receive the transition according to what you…
-
-2
votes3
answers54
viewsA: Website with centralized content but out of conjunction with the background
There man, an example of use, leaving the <div> "disconnected" from the content and allowing it to move, with no concern for what is on the side, for example: #menu-vertical{ position: fixed;…
-
0
votes2
answers3450
viewsQ: Difference between Requestmapping and Postmapping
I was taking a look at the requisitions from Spring Boot and I saw that you can make a requisition POST, in two ways: //primeira forma @RequestMapping(value = "/dev", method = RequestMethod.POST)…
-
1
votes2
answers1604
viewsA: Redirect to html with Spring Boot
I managed to solve it that way: Creating a Requestmapping in the Controller @RequestMapping("/") public ModelAndView index(){ return new ModelAndView("index"); } Unlike yours, it returns one…
-
0
votes2
answers697
viewsA: How to put ALT in a Background-Image? How to make a Background-Image more accessible and semantic?
ALT with background-image As cited, the property ALT, has benefits, for SEO, semantics and accessibility, being an element used in the marking itself. When using CSS, there is no way to add the…
-
1
votes0
answers105
viewsQ: Reposition gotoxy(x, y) with C
I’m using the gotoxy function, so I can write in a certain coordinate: #include <stdio.h> #include <windows.h> void gotoxy(int x, int y){…
casked Gabriel Gonçalves 1,632 -
3
votes1
answer1484
viewsA: Size of the Javascript Image
Here is an example using appendChild(), that is nothing more than to create a "son" for a "father", where each element <img> is a son and the main div the father: for(y = 0; y < 10; y++){…
-
0
votes2
answers76
viewsA: Using the contents of an input field in a JS function
In this example basically, the date is taken from input, is transformed into an Object of the type Date and is formatted taking day, month and year separately, after which concatenates with the…
javascriptanswered Gabriel Gonçalves 1,632 -
0
votes2
answers112
viewsA: want to read more than 1 file . txt in C
In this example, there is a function that creates in the project folder, files according to the amount passed, following the pattern of arquivo-00, arquivo-01 and so on. For each file created, a…
-
7
votes1
answer261
viewsA: What should the server return in an OPTIONS request?
OPTIONS The Method OPTIONS is a method HTTP, which is used to find out which request options are allowed for certain server resources, so this request is made before the others, to find out which…
-
5
votes5
answers869
viewsA: Fill <text> inputs after check <checkbox> and clear when unchecking
An example based on ID. By clicking on checkbox, it performs a function that checks whether the checkbox, true case, inserts "Anonymous" in input, false case, inserts empty: function…
-
2
votes2
answers1418
viewsA: How to move html input
If you want to centralize everything, you can use the display: flex, together with its alignment properties, in a <div> for the form, with this you can centralize the information, without…
-
1
votes2
answers2460
viewsA: Export. xlsx with Java
To create an Excel spreadsheet in the format .xlsx, it is necessary to use with import of Apache POI-XSSF/SXSSF. the HSSF only works with spreadsheets .xls. You can convert the code already made to…
-
1
votes1
answer4636
viewsA: Hide something HTML (Text, Images)
Here is a very simple solution, it is not something extraordinary. Basically, it uses the selector target that will apply a style when clicking on the element, applying the visibility: visible in…
htmlanswered Gabriel Gonçalves 1,632 -
2
votes1
answer1207
viewsQ: How to concatenate variable names in Java
I’m having a question. I’m wanting to generate a total of variables, from a for, to not have to write all of them, but I’m not able to concatenate the names of variables. I’m trying this way:…
-
0
votes2
answers2460
viewsQ: Export. xlsx with Java
I am trying to export a spreadsheet with Java, specifically a file .xlsx, but I’m not getting it. I’m doing it this way and it’s working, but it only works by putting the extension .xls:…
-
2
votes2
answers933
viewsA: I wanted to show an Alert after a form has been sent, PHP, JAVASCRIPT, HTML, AJAX
If it returns 1, it is because it is entered in the if of the archive PHP, what you can do is put a "technical adaptation" on that own if, where the echo will show a alert of JS, if an error occurs,…
-
7
votes1
answer5022
viewsA: Mysql command alter table, difference from "Modify" and "change"?
Reset Clauses These 2 modifiers can be used in MySQL, they allow you to change names and column definitions that have already been created, avoiding having to delete and create again. Although they…
-
1
votes2
answers288
viewsA: How to overwrite an image without Absolute? HTML+CSS
Here follows an example, using background-size: cover, it resets the size to be supported inside the container you want, in this whole case <section>, even if you have to stretch the image or…
-
0
votes2
answers47
viewsA: Check if a radio has been checked
You can do this with a simple check on JS. If all the checked were false, it displays the alert message and does not let the form complete the submission. In case one of radios are selected, it does…
-
2
votes1
answer81
viewsA: Search with group by
Basically, it was not working because it is not possible to join an aggregate column (in the box at the maximum date) with data not grouped. First, let’s call the main table of T. Then from the…
-
2
votes1
answer39
viewsA: How to fix this error of HTML+CSS Sub-Menus?
Another option is to use visibility: visible and visibility: hidden, she along with the opacity, will hide the submenu and leave it with the transition: * { margin: 0; padding: 0; } .menu { height:…
-
5
votes2
answers270
viewsA: Language C - Structure jumps directly to ELSE ignoring IF parameters
You have to revise a little the concepts in C, there are some "mistakes" in your code, as: The variables p and c are declared as int, but in the code are used to keep a word. When you use int, you…
-
1
votes3
answers121
viewsA: MAX() returning multiple lines
When you use group by, it makes the grouping in each value of the column you specific, ie group equal values, see in this example. When you use the max(), it returns the highest value field of the…
-
2
votes1
answer381
viewsA: Horizontally center the html css page logo
I suggest giving a read in that guide of Flex Container, where you will have several examples of centralization. Below is the code, I used the justify-content: center and the align-items: center to…
-
0
votes2
answers59
viewsA: Top calculation on scss
For you to use Calc(), you should always know the size of the things you insert, not only put height inside calc(), that it will not return the value for the calculation. He must also be with…
-
1
votes2
answers103
viewsA: Unexpected result
The x and the y was declared at the beginning as int and then you did the reading with scanf ("%f", &y), using the %f, which is for float. Or you change to float the x and y, or exchange the %f…
-
6
votes1
answer3203
viewsA: How to put an Icone/Lookup Button inside an input with Bootstrap?
This would be an option, but you will have to do in "Save" the style, so that the search icon is in the color of the <input>: <link…
-
0
votes2
answers56
viewsA: Problems with Bootstrap grid
You can do this by changing the height and the width from image to 100%, then it will track the size of the div in which it is inserted, see how it works in Codepen. Only that way, if it’s a small…
-
1
votes1
answer83
viewsQ: Comparison going wrong
I saw an example of comparison and I was in doubt of the reason for the operation. In the comparison below, he removes the text and <button> and compares in if for verification, whether it is…
-
6
votes3
answers738
viewsA: What is the $() [dollar sign followed by parentheses] for in BASH?
Command Substitution $() The $() has a function very similar to crase used in shell: (``). The $(), called Command Substitution allows a command to be executed and has an output, i.e., it is…
bashanswered Gabriel Gonçalves 1,632 -
2
votes1
answer155
viewsA: How to use a svg (or div) to click and select the corresponding checkbox
There is a "half way" to do, I will use some concepts that @hugocsl used. Each <div> will have to have his id and onclick to call the function, which will be sending a parameter, which is the…
-
0
votes1
answer286
viewsA: How do I make messages in Javascript etc, when logging in a warning appears?
This is very relative, there are several ways to do this, it depends on what you are using, if there is a database with the login and password of users or if you want to use only JS, jQuery to do…
-
0
votes2
answers110
viewsA: Create navbar with centralized search field
You can use the following code to center, but there must be another element at the end to have the alignment of the 3: display: flex justify-content: space-between Operating code:…
-
0
votes2
answers1035
viewsA: Check for JSON value with PHP
Here is the code working, it takes the cc of the JSON and then compares it to the value of the variable. To get from an external file, it is necessary to use file_get_contents() to get the JSON…
phpanswered Gabriel Gonçalves 1,632 -
1
votes1
answer374
viewsA: Effect on input type="date"
You can determine that when it is invalid, it assigns a transparent color to dd/mm/aaaa and when it is selected, assigns a black color to the dd/mm/aaaa:…
-
1
votes2
answers325
viewsA: Picking up content within a tag
To get the name at the beginning, you just take the value, so the function init() is started and tag <p>: var nomevideo = $("#playlist .active").text(); $("#nome").text(nomevideo); Note: it…
javascriptanswered Gabriel Gonçalves 1,632 -
3
votes2
answers151
viewsA: Doubt about shell script
You have to read how the comparison works in Shell, it does not only accept to put the direct command in the comparison. What you should do is store the value in a variable and then compare that…
-
1
votes2
answers45
viewsA: Failure to trigger an event
Your code is full of variable name "wrong", you have to standardize the variable name so it doesn’t happen. Any of the mistakes: Count variable, which was defined at the beginning as…
-
1
votes1
answer59
viewsA: Javascript clock increment for game
The problem is the attribution you are doing. No this.min =+ 1 you are assigning the positive value of 1, so it always results in 1. The sign of =+ is used to assign the anointing + of one value in…
-
1
votes1
answer199
viewsA: Value rounding up php does not work
First you should do the calculation and then round off the value: <?php $valor = 1863; $porcent = 20 / 100; $resultado = $porcent * $valor; ?> <span style="width:40px"…
phpanswered Gabriel Gonçalves 1,632 -
1
votes2
answers66
viewsA: href with single click until page Reload
What you can do to block is catch the amount of click, if equal to 1, locks the element with preventDefault(), as you can see in the example below, it enters the first link "#" and then when I…
-
0
votes2
answers744
viewsA: Take the value of a field
I don’t know what your code is html, but you can use the getElementById, which takes a particular Id of choice or querySelector, that will catch the selector: function MyFunction(){ //Pegar pelo Id…