Skip to content

Instantly share code, notes, and snippets.

@corani
Created March 30, 2011 05:42
Show Gist options
  • Save corani/893921 to your computer and use it in GitHub Desktop.
Save corani/893921 to your computer and use it in GitHub Desktop.
Filter
List<Integer> result = new ArrayList<Integer>();
for (Integer value : items) {
if (value % 2 == 0) {
result.add(value);
}
}
result = filter(lambda x: x % 2 == 0, items)
SELECT value FROM items WHERE value % 2 = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment