Posts by fsi • 505 points
11 posts
-
1
votes2
answers920
viewsA: How to find an element within an object array by Id?
Use the grep: var array1 = [1,2,3] var array2 = [ {id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6} ]; var diferenca = [] jQuery.grep(array2, function(item) { if (jQuery.inArray(item.id, array1)…
-
2
votes2
answers4339
viewsA: Difference between start date and end date with Moment js
There is the function diff of Moment. var antes = moment("2017-11-01T13:13:59.015Z"); var depois= moment("2017-11-01T14:22:23.466Z'); var horas = depois.diff(antes, 'hours'); var minutos =…
-
1
votes2
answers4133
viewsA: Angular 4 - Calling Component function through service
You can communicate via Subject, in the concept of sending and receiving messages. For example, your service will exist two functions, one that receives and one that sends. @Injectable() export…
-
1
votes2
answers678
viewsA: Convert String to Array - Java/Groovy
If your variable is a string and that is an array: def arrayString = '''[["4","SCAB171301BF5","Vazio","Lexmark International","50F0Z00",null,null,"2017-10-27 08:54:56",false,"ROMUALDO SANTOS"]]'''…
-
13
votes0
answers16554
viewsQ: Format value in cash while typing with pure javascript
There are several questions in the OS about coin formatting, but most of them do not format while a number is typed correctly. How can I format the numbers while typing, passing in these cases…
javascriptasked fsi 505 -
2
votes1
answer141
viewsQ: Spring instantiating object with @Value
In my application.properties has the algumaCoisa=joao, and when I spin the java -jar nomedo.jar, it comes null, someone can explain to me why this happens and how I arrange? @Component class…
-
1
votes2
answers131
viewsA: How to load multiple records into a Combo?
You can try something like this $('#selectID').bind('scroll', function(){ if($(this).scrollTop() + $(this).innerHeight()>=$(this)[0].scrollHeight){ // sua chamada ajax. e dando sucesso, voce…
-
3
votes2
answers1379
viewsA: Mark/deselect all dynamically created checkboxes
Use the on click and prop instead of attr $(document).on( "click",'input[type=checkbox][name=selectAll]', function() { var isChecked = $(this).is(':checked');…
-
2
votes3
answers7458
viewsA: Frameworks for Java reporting
Birt plugin for eclipse http://eclipse.org/birt/ It is almost the same as the Japser Report, much more intuitive because it is WYSIWYG, also drag'n'drop.…
-
3
votes1
answer596
viewsQ: Decompose huge number in javascript
Continuing with this question The problem is with quantity of numbers existing in my variable, IE, I am not able to catch the values above 1073741824 and wanted to get to the 562949953421312…
javascriptasked fsi 505 -
8
votes3
answers3787
viewsQ: How to decompose a number into powers of 2
I’m using javascript for my logic: I have a sequence of numbers: 1, 2, 4, 8, 16, 32 and so on. Given a number, which needs to be the sum of numbers in the sequence, for example: 44 (of which the…
javascriptasked fsi 505