Created
March 30, 2011 05:42
-
-
Save corani/893921 to your computer and use it in GitHub Desktop.
Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<Integer> result = new ArrayList<Integer>(); | |
| for (Integer value : items) { | |
| if (value % 2 == 0) { | |
| result.add(value); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| result = filter(lambda x: x % 2 == 0, items) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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