Posts by Israel Merljak • 943 points
56 posts
-
0
votes1
answer28
viewsA: Questions in relationships Ibernate
In this case you have no escape from having the table Itemvenda as an entity in your project, precisely because of its structure. If it were only a simple table of relation between Product and Sale…
hibernateanswered Israel Merljak 943 -
-1
votes2
answers74
viewsA: icheck plugin does not disable all checkbox
Hello, I did it in two ways, with pure javascript (always good to know) and with jQuery. PS: I updated the example to demonstrate how it would be done with the icheck. PS2: the icheck did not render…
jqueryanswered Israel Merljak 943 -
0
votes1
answer49
viewsA: Paging and Research - Springdata with Sqlserver2008
I found a solution to the problem (I don’t know if it’s the best, but it’s working). Thinking about the issue of the page, I saw that if I had a way to ignore the page when there was a query by some…
-
0
votes1
answer49
viewsQ: Paging and Research - Springdata with Sqlserver2008
Hello, I have a problem in my application and I wanted to see if anyone here can assist me. I’m developing a system with Springboot (Springdata, etc. ) on top of a base Sqlserver2008. Due to force…
-
0
votes1
answer49
viewsA: Handles error within if Javascript
Friend, personally I would separate the inputs so you have more control in the validation, and avoid as much as possible the use of the function eval. Here’s a short example of how you could do it…
javascriptanswered Israel Merljak 943 -
2
votes2
answers51
viewsQ: jQuery "contains word" selector does not work as expected
I’m trying to use the "contains word selector" from jQuery to hide/show some elements dynamically on my page, however the selector is not working as expected. I am using the version 3.1.1 jQuery.…
jqueryasked Israel Merljak 943 -
5
votes2
answers804
viewsA: Insert Option with Java
Follow an example friend.. After you select an option, the options are created dynamically. With each radio change options change, reflecting only the desired values for that selection. function…
-
1
votes0
answers119
viewsQ: Customize gauge with C3.js
Hello, I am developing some dashboards with the c3js library and the need arose to create a "gauge" chart with pointer and color areas according to the value. From what I’ve researched, there’s no…
highchartsasked Israel Merljak 943 -
-1
votes2
answers1083
viewsA: How is the logic to print the numbers in ascending order in C
To order the array you can use the qsort() more or less in the exemplified way. To change the order, desc or asc just change the order of the a - b for b - a int compareInt(const void *a, const void…
-
1
votes2
answers75
viewsA: I cannot use Pseudo-classes in css
Welcome to the Stackoverflow! I used exactly the same css that you made available and is working normally. The only difference is a ; that was missing on the line 7 in color: #315e8a body {…
-
2
votes3
answers134
viewsA: Explanation of name in php
Friend, it’s just the opposite. The variable name $nomeis totally free, you can name her as you want ex. $banana, however it is good practice to name variables in order to make clear their content.…
-
0
votes1
answer261
viewsA: java.lang.Nullpointerexception error
When you try to create the Connection is returning null in case of error and simply ignoring the Exception. That way, when you run, the code "seems" to work, but it is falling into the exception and…
-
2
votes3
answers1210
viewsA: Select to bring the amount of certain records in related tables
Friend, as you are probably using the JSON data type due to the contents of the CONTRIBUTORS column in the CONTROLS table. You can do it this way.. (Note that I have not tested this select, but this…
-
1
votes3
answers1316
viewsA: Return of PHP Query in Ajax
Friend, you can send the parameter (id) directly by ajax script. using "date". $.ajax({ url: "listaGabaritosSelecionados.php", method: "POST", data: { id : seuIdAqui }, //{[nome_do_parametro_post]:…
-
4
votes3
answers337
viewsA: How to find the occurrence of equal integer values in a vector?
One more alternative to solve this problem. A little simpler than the solution presented by @Severmateus. import java.util.*; class Main { public static void main(String[] args) {…
javaanswered Israel Merljak 943 -
1
votes2
answers136
viewsA: How to update a field in Ionic automatically?
var geolocationInterval; ionViewDidLoad() { geolocationInterval = setInterval(() => this.local(), 5000); } ionViewWillLeave() { …
ionicanswered Israel Merljak 943 -
2
votes1
answer374
viewsA: Rename all files from the directory where you have "u0026" to "and"
in python can be? import os [os.rename(f, f.replace('u0026', 'e')) for f in os.listdir('.') if not f.startswith('.')] This script will replace the string 'u0026' with 'and' in all files in the…
-
1
votes2
answers559
viewsA: Grouping an array’s value in PHP
First Option It was not very clear what you want, and the transformation of the original data into your "filtered" array did not seem to me exactly what you want by your description. I believe the…
-
1
votes2
answers83
viewsA: Regex - Expression for catching limited fields
If you want to always pick up after the word 'bits', you can use this simple expression: (bits[^\n]*) It captures everything after (and including) the word 'bits' until it finds a line break. See…
regexanswered Israel Merljak 943 -
1
votes3
answers318
viewsA: Pick site name by link
You can use php’s native function parse_url to retrieve information from a URL. That way: $listalinks = "http://site1.com/embed1/CODIGO http://site2.com/embed2/CODIGO http://site3.com/embed3/CODIGO…
-
3
votes2
answers54
viewsA: Change array structure in php
Although Woton’s response was already satisfactory to you, I took the trouble to do something a little more 'automated' I would say. Since you commented on the possibility of not knowing the size of…
phpanswered Israel Merljak 943 -
0
votes2
answers5608
viewsA: Count how many times each character appears in a string (no function use)
Here is an example of how to count occurrences of the same character present in a string in C. (This example does not consider 'A' and 'a' chars equal'). #include "stdio.h" #include "stdlib.h" int…
-
1
votes1
answer70
viewsA: Create array and count values
I am not going to paste all the JSON.. pq would get a little exaggerated, and the same is already found in the question.. Here is an example of code that separates the elements by 'source' and…
-
0
votes1
answer188
viewsA: How to iterate PHP array received as JSON?
first. The format of the data you put into question is not a Array, and yes a Objeto. An array JSON possesses [] delimiting its content. An object has {}. I don’t know the structure of objeto json…
-
1
votes1
answer36
viewsA: How to do a git push to bitbucket programmatically using BASH on Ubuntu16.04?
I think it goes something like this. https://$USR_BITBUCKET:[email protected]/$USR_BITBUCKET/$VHOST.git git push -u origin master
-
0
votes1
answer345
viewsA: Position plots and values
Are you using the Chart js. right? So. You can use the function update() in the Chart to update. All you need to do is change the value of the dataset (or add a new value..) and call the method…
-
0
votes1
answer748
viewsA: Efficient method for comparing lists
Not intended to be the most performative solution to your case. But if you don’t want to compare the same items (1 : 1) or their inverses (1 : 0 and 0 : 1) you could simply change your internal loop…
-
0
votes2
answers197
viewsA: Read a portion of the file contents
To solve this problem you can use regular expressions. As you apparently already own the id that you want to read and it is quite obvious the pattern that follows this text file (if all the content…
phpanswered Israel Merljak 943 -
1
votes2
answers41
viewsA: How do I display a new INPUT as per the user’s previous response?
You can use javascript for this.. Here’s an example. var form = document.querySelector("#myForm"); form.addEventListener('change', function(ev) { let changedElement = ev.target;…
-
0
votes1
answer41
viewsA: Increase transfer speed by pressing mouse (hold)?
take a look at this example, maybe it will enlighten you on how you can make this functionality. const TICK = 300; // milliseconds var initialSpeed = 1; var maxSpeed = 100; var initialStorage = 200;…
javascriptanswered Israel Merljak 943 -
0
votes1
answer746
viewsA: Solving Precedent at the Angle
Friend, what happens is that a Promise executes in a way asynchronous, that is, when you print the console.log on the next line outside the then() the value has not yet been recovered from Storage.…
-
0
votes1
answer294
viewsA: How to use SQL instead of JPQL?
How you wanted to see a possible implementation of this same filter not using the CriteriaAPI, follows a version (untested..) with the JPQL. I have added only those parts of the code that have been…
-
1
votes2
answers609
viewsA: Change bgcolor according to class
Maybe you can do it this way, instead of checking the active class in the element, you can take directly by the slide event which element is active, and by setting a data-attribute in the html vc…
-
1
votes2
answers1244
viewsA: How to fire a JS function inside a PHP IF?
I would say.. don’t do that. But anyway. <?php if(foo): ?> <script> bar() </script> <?php endif; ?> <script> function bar() { /*do something...*/ }…
-
1
votes2
answers1064
viewsA: Sum of number in typescript is resulting in Nan
With the code you passed, you can’t be sure if the return of the method getCredit() is actually a number in all cases. However, it follows an example of a code functionally equal to your. Note that,…
-
0
votes3
answers219
viewsA: Duplicate jquery code without refreshing and deleting text in form inputs
When you need to create dynamic components on the page, whenever possible try using the DOM API for this. Avoid simply concatenating an "HTML" string into the innerHTML of the element. Take a look…
-
0
votes2
answers362
viewsA: POO JAVA - Doubt Exercise
You are already creating the class parameters in the first lines, inside the constructor, reference them using the identifier this. Since you are learning OO, try to keep things separate. Each class…
-
0
votes0
answers213
viewsQ: Primefaces p:selectBooleanButton ignoring Converter
I’m trying to get a p:selectBooleanButton is used to select the status of a registration form. The value of the attribute in the template is a Enum with two values that can be translated as True or…
-
0
votes1
answer86
viewsA: Loop inside the PHP Table
Hello... I have no way to check if it was right... I did my best. I know it’s quite easy to get lost when you’re working on a file like this, with PHP and HTML mixed in.. Here’s what I did.. please…
phpanswered Israel Merljak 943 -
0
votes2
answers138
viewsA: Are variables declared within blocks or subprograms dynamically allocated?
That is correct, Alocação Dinâmica in the context cited by the author refers to the fact that a variable existing in a block of code, is a function, for, while, if, etc. It exists only within that…
-
0
votes4
answers146
viewsA: Change button link according to an option
There is a solution, I used the value of select to store the link, but you can use other strategies, map a value and identify the link etc.. var select = document.querySelector('#linkOpt') var link…
-
1
votes1
answer39
viewsA: Jquery Object groups with same id
I don’t understand why you want to simply filter objects by question in different arrays. maybe it’s more useful to map to another structure? Here’s an example that maps to a json: { [nro_pergunta]…
jqueryanswered Israel Merljak 943 -
1
votes1
answer247
viewsA: How to change the colors of a Jquery implementation?
I think that would be this.. use the container (div#accordion) to facilitate the selection of the elements you want to style. PS: I think it would be simpler if you used css to style the elements.…
cssanswered Israel Merljak 943 -
1
votes1
answer706
viewsA: Add color to mine when scrolling the page and remove when you reach the top
Here it is.. quick fix (probably can be improved), but it already serves for you to see how it could do.. I changed the code to use Jquery, maybe it’s clearer how you can use it. 'use strict'; var…
-
0
votes2
answers1203
viewsA: Regex to make full-name first letter uppercase, whether or not with a special character
A little Overkill.. but solves the problem. let regex = /^\D/g; let nomes = [ "maria do carmo", "nome com çedilha", "nome com &special", "marilia mendonça" ]; nomes .map(nome => { // Essa…
-
1
votes2
answers204
viewsA: Check negative balance
Very simple using javascript only... Take all elements with class . balance, check if you have any negative, if you have 0. else it is 1. PS: Remember to avoid duplicating ids on the page, id should…
-
1
votes1
answer303
viewsA: Simply chained list - Method problem
Dude, I don’t program in C++ .. However, this is a fairly common problem. So I made a quick solution here in Javascript so you can take a look at the logic. It is not complete (nor perfect), however…
-
1
votes2
answers91
viewsA: Create associative array with other PHP arrays to use as JSON return
I believe that the statements of these arrays are wrong.. so I will consider that the correct one would be this way: $S1 = [[0,100], [1,200], [2,700]]; $S2 = [[0,700], [1,300], [2,400]]; $Label =…
-
2
votes3
answers3370
viewsA: How to convert Date to whole in Java?
Maybe what you want is not to turn the whole date, but to take its value in milliseconds? If that’s the case, you can do it this way. //Cria nova data Date d = new Date(); //Printa o valor da data…
-
3
votes3
answers1180
viewsA: Transfer the value of a variable to Ctrl+C
I found in this reply How do I copy to the Clipboard in Javascript? a script that should work PS: I know you’re using angular, but nothing prevents you from using normal JS n is even? See if it…