Posts by Gustavo Piucco • 347 points
9 posts
-
5
votes1
answer129
viewsQ: Different regex strategies to get the same result
I have the following input: Detalhamento de Serviços nº: 999-99999-9999 I need to get the number in a group, for that I would use: Detalhamento de Serviços nº: (\d+-\d+-\d+) However I can’t trust…
-
5
votes2
answers133
viewsQ: How to filter a Hashmap by returning another Hashmap using Java 8 lambda?
The following code traverses a Set and filters only the objects that the isActive() is true. public Set<InvoiceLineDocument> getActiveLines() { Set<InvoiceLineDocument> activeLines = new…
-
3
votes1
answer156
viewsQ: map.foreach Unexpected Return value
I have the following map: private static Map<ParseCreator, Parseable> map = new HashMap<>(); I walk this map as follows: for (Map.Entry<ParseCreator, Parseable> entry :…
-
2
votes1
answer193
viewsQ: Instantiate a Map object only when necessary based on a regex
I have a Factory what instance the PARSER responsible for extracting information from a particular invoice format. To determine the invoice format I use regex. I loop every regex added to Map and…
-
2
votes3
answers253
viewsQ: Refactor code using Factory Pattern without using the if-elseif condition
I got the following Factory. In it I urge a class responsible for parsing the file in question. For this parser to be instantiated, it is first verified in the conditions whether that parser is…
-
3
votes2
answers648
viewsQ: Ignore scoring in a sequence of numbers using Regex with Java
I have the following input: Fatura Cliente: 1.7852964.34 CPF/CNPJ: 09022317000222 I need to take only the "Customer Invoice" numbers, ignoring scores, returning only 1785296434, for this I am using…
-
2
votes1
answer147
viewsQ: Where to store binary files in Junit Unit tests with Maven?
I have the following directory structure for the Unit tests Resource folder: src/test/resources/*.files So that I can read binary files (like a PDF for example) to complete a Unit test, I am…
-
0
votes1
answer148
viewsQ: Force container > Row > col to be non-reresponsivel in Bootstrap
I have the following family Tree: https://codepen.io/chuongdang/pen/lcnsC It is possible to realize that the responsiveness of a framily Tree does not exist. To have a good visibility of this Tree,…
-
1
votes1
answer693
viewsQ: Receive a parameter through a friendly URL on a Wordpress page
I have a Wordpress page called Recordings which is accessed through http://localhost/Recordings and I need to pass an ID parameter at the end of the URL that can be used later to create dynamic…