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 functools import reduce | |
| string = '456995111617' | |
| odds = string[1::2] | |
| evens = string[0::2] | |
| sum_from_odds = reduce(lambda a,b: int(a)+int(b),odds) * 3 | |
| sum_from_evens = reduce(lambda a,b: int(a)+int(b),evens) | |
| value_to_minus = str(sum_from_odds + sum_from_evens)[-1] |
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
| ```bash | |
| docker run -d --user "$(id -u):$(id -g)" -v /etc/passwd:/etc/passwd:ro -v $(pwd)/data:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:10.10 | |
| ``` | |
| ```bash | |
| psql -h localhost -p 5432 -U postgres -W -d postgres | |
| ``` |
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
| // using reflection class | |
| Class outputClass = output_row.getClass(); | |
| Class inputClass = input_row.getClass(); | |
| Field[] targets = outputClass.getFields(); | |
| // loop output_row fields | |
| for(Field target: targets){ | |
| // Debug: display Type | |
| // System.out.println(field.getType().getTypeName()); |