Skip to content

Multiple assignment at once in java

In python you can do this: Is there an equivalent in java? Answer tl;dr: No, there isn’t such a thing in Java. You can assign initial values to variables like this: But if your want (1, 2, 3) to be the result of a method call, this is not possible in Java. Java does not allow returning multiple values. …

Filtering using predicates

I have used predicates before to filter collections as follows: For the above I used Java 8 and the latest Guava library. However I’m working on an assignment where I am restricted to Java 6 and version 13.0.1 of Guava with zero chance of getting them to update their maven repo. I am struggling to get a…

Regular Expression in burp

I’m using a forward proxy called Burp and would like to see only results from google in my site scope. What will be the regex for if i want to see *.google.* in my result So sample output can be and so on Answer This should work for you: Will match anything before and after .google.

Find closest factor to a number, of a number

I am trying to automate the finding of the closest factor of a number to another number; Example: Closest factor of 700 to 30 is 28 (30 does not go into 700, but 28 does). An obvious solution is just to get all the factors of 700 and do a simple distance calculation to find the nearest factor to 30,

Fetching Oracle DB LONG type through jdbc works very slow

This happens only when the statement return LONG column. Even if i don’t do anything with it such like rs.getString, just execute. sql1: That was: 7593 ms sql2: That was: 530 ms As you can see it’s not about volume of data. When i use OracleConnection:OracleStatement:OracleCachedResultSet result i…