Skip to content

Tag: java

Algorithm to get the submultiples of each number in a range

I have this exercise in mind, I keep trying to solve it in Java but I’m not able to create a correct algorithm to get the submultiples of each number in a range, the start and the end of the range is user defined. Besides, the number 1 doesn’t count as a submultiple. For example, in a range betwee…

Java Regex to match Chinese and/or ordinary numbers

Actually the regex I have matches anything but the Chinese but it matches the numbers too, which I don’t want. As you can see in the regex demo here, the number 45 is matched but I need it to be excluded too. https://regex101.com/r/XNtD12/1 Current regex is: (?!p{IsHan}n)[^p{IsHan}n?。,?!]+ Desired outpu…

Batch update returned unexpected row count from update JAVA

When i try to add user throws next exception: This is my entity: } This is my service: Mapper for reg user: I found some strange things like: when i dont set field ROLE in mapper i dont recive this excep; i create my DB with dates, and when i have it’s with nanos in db, i dont recive exception,