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
| data = [...] | |
| # without lambda | |
| def square_plus_one(x): | |
| return x * x + 1 | |
| map(square_plus_one, data) | |
| # with lambda |
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> numbers = Arrays.asList(1, 2, 3, 4, 5); | |
| List<Integer> squares = numbers.stream() | |
| .map(n -> n * n) | |
| .collect(Collectors.toList()); | |
| ... |
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<int> numbers = new List<int>() { 1,2,3,4,5 }; | |
| List<int> squares = numbers | |
| .Select(x => x * x) | |
| .ToList(); | |
| ... | |
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
| var numbers = [1,2,3,4,5] | |
| var squares = numbers.map(function (x) { | |
| return x * x; | |
| }); | |
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
| from apispec import APISpec | |
| from apispec.ext.flask import FlaskPlugin | |
| from apispec.ext.marshmallow import MarshmallowPlugin | |
| from flask import jsonify | |
| import marshmallow | |
| spec = APISpec( | |
| title='ttang me', | |
| version='1.0.0', | |
| openapi_version='2.0', |
OlderNewer