Tom Avni

1

votes
2

answer
224

views

Replace all attributes in Visual Studio

I have many cs files, with the next annotation: [Js(Md.pr, imo = false, tr='csc')] where the tr value is changed between each cs file. I want to delete all these annotation automaticlly. So I try to use 'replace all' in Visual studion, when I choose regular expressions function. So I wrote: find wh...
Tom Avni
2

votes
2

answer
2.1k

views

Java/ Efficient way to find all permutation of lists [duplicate]

This question already has an answer here: Cartesian product of arbitrary sets in Java 9 answers Generating all possible permutations of a list recursively 4 answers I have a list of lists in JAVA: {{1,2},{3,4,5},{6,7,8}} I try to find all permutations of this list. Meaning, In the result I would g...
Tom Avni
2

votes
4

answer
79

views

Remove duplicate in a list which contains arrays

I have a list in Java, and I want to remove from it all duplicates. In addition, the array [1,2] is the same as array [2,1]. I want to use Set, but as I understand it, if I declare 2 arrays: int[] array1 = {1, 2} and int[] array2 = {1,2}, Java considers them as 2 different arrays. In addition, It do...
Tom Avni
1

votes
4

answer
3.1k

views

Java/ Sort array which contain points

I have array with points: Point[] p = new Point[] I want to sort it by x, and then by y. Meaning, If I have Point A = (1, 2) Point B = (2, 1) Point C = (1, 3) Point D = (2, 2) After sorting, I will get: [(1,2), (1,3), (2,1), (2,2)] I try to use Arrays.sort(), but point isn't comparable. There is an...
Tom Avni