Skip to content

Instantly share code, notes, and snippets.

@agoldis
Created March 29, 2018 06:31
Show Gist options
  • Select an option

  • Save agoldis/f1510bb8aee10b3b38ff61e1347f9f2a to your computer and use it in GitHub Desktop.

Select an option

Save agoldis/f1510bb8aee10b3b38ff61e1347f9f2a to your computer and use it in GitHub Desktop.
Comments frustrated - naive example
List<ResultType> resultsList = new ArrayList<>();
final Double TWO = new Double(2);
final Double LIMIT = new Double(10);
for(ItemType item: itemsList) {
if(Math.pow(item.x, TWO) + Math.pow(item.y, TWO) < Math.pow(LIMIT, TWO)) {
resultsList.add(item.toResultType());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment