Posts by g-otn • 429 points
18 posts
-
0
votes1
answer75
viewsQ: Expected operando in for loop shell script
I am creating a function in shell script that says if the number is prime or not, but I am getting a syntax error in for loop that the function has and I could not find how to fix. # ... 9 ehPrimo()…
-
2
votes1
answer80
viewsA: How to fix this code in Java?
The error is mathematical. a + b / 2 is dividing b by 2 and only then adding a. Simply add parentheses to the sum a + b: public static double average(int a, int b) { return (a + b) / 2; }…
-
0
votes1
answer199
viewsA: JAVA - Split and Arrays
To declare attributes as arrays use these instructions: char[] tipo; String[] cor; int[] x; int[] y; And when you know the size of them (assuming num), initialize them: public void inserirPeças()…
-
2
votes3
answers337
viewsA: error calling a method passing a class as parameter c#
The error is because you function IncluirUsuario(Usuario usuario) requires a parameter. This parameter must be an object of the type Usuario, that is, you will have to instantiate this class Usuario…
-
4
votes3
answers52
viewsA: Does code always return the last character?
.length, when used in a string (in this case, 'mozzilad'), returns the number of characters of this string. 'mozzilad' has 8 characters, carrying browserType.length - 1 is equal to 8 - 1 = 7. By…
javascriptanswered g-otn 429 -
2
votes2
answers231
viewsA: Stop Preload only when the page loads full
Try one of these methods: Using jQuery .hide() $(window).on('load',function(){ $('.preload-content').hide(); }) source Altering the style.display of the element window.onload = function() {…
javascriptanswered g-otn 429 -
0
votes2
answers1338
viewsA: How to generate sequential ID?
To every user you create, you’re saying that the id of it one is 1. That’s because the command int id = 1 is within the class User, and the method gerarid(), which is also within the class, will…
-
2
votes2
answers300
viewsA: How to create an array through another?
This error is due to the attempt to access the first element (Index 0) of arr2, whereas arr2 has no element (length 0) because you declared her with int[] arr2= {}, without any element between the…
-
0
votes2
answers96
viewsA: Merge Sorted Java
Add this constructor with these two additional parameters, fila1 and fila2, row 1 will be the row that will have its first value (from dado) at the beginning of dado of the queue being instantiated:…
-
0
votes1
answer53
views -
0
votes1
answer241
viewsA: Help with Struct and File Manipulation (C)
At the time of writing in the file, the fwrite(&ctt, sizeof(CONTATO),1, resposta) is passing through all vector positions, including those that have not been filled. These strange symbols are…
-
1
votes1
answer39
viewsA: Bad operand : does not accept accounts or comparisons!
You are trying to carry out divisions and use the relational operator <= between a boolean (true or false) and a number in the variables quilo and aux. Replace the type of boolean for int, float…
-
1
votes1
answer262
viewsA: Variable in a url by powershell
Concatene the string and variable by placing it inside the quotes and wrapped by a $( ): Invoke-WebRequest -uri "http://meusite/blebleble=$($id)" I found this information in this other reply.…
-
0
votes2
answers2088
viewsA: Group repeated records into an array in javascript
This algorithm is not the best in performance issues, but brings the expected result. For repeated states not to be added separately, it is checked if there is no state with the same name, if any,…
-
2
votes1
answer79
viewsA: What is the difference between Property in css, background-origin and background-clip?
Compare these examples: background-origin and background clip Note that the background-origin defines the position of the image, and the background-clip how far she can if extend. The…
-
0
votes1
answer4776
viewsA: Discord.js sending user-programmed private messages with a scroll
From what I understand, you want to rescue all users from a specific server job instead of releasing multiple client.users.get().send() for each user. You can recover these users using…
-
1
votes2
answers988
viewsA: How to center an image in the header?
This CSS centers the image horizontally, within the header#cabecalho: header#cabecalho img#logo { position: absolute; left: 0; right: 0; margin: auto; } You can put the image at the top by adding…
-
3
votes1
answer581
viewsA: How to show only 1 image with Javascript
You can hide the banners and show them only when the random image is loaded by adding the event onload in the image tag. var imagens = new Array('') imagens[0] = '<img ...…