title | customTheme | highlightTheme | transition | transitionSpeed | center | slideNumber | navigationMode | controls | width | height | defaultTiming |
---|---|---|---|---|---|---|---|---|---|---|---|
AdvancedProgramming: JSON |
leagueFabio |
monokai |
slide |
fast |
true |
true |
linear |
false |
1920 |
1080 |
52 |
- Write a JSON successor that is better than anything
--
Write a JSON successor that is better than anything
--
- We want to train programming{.fragment}
- We want a realistic but feasible problem to practice on{.fragment}
- We want a common problem{.fragment}
- We want to compare notes{.fragment}
--
This course requires active contribution both in the workshop parts and on homework (~1 day per week). If you sign up for this course please make sure that you can commit to that as other participants will depend on it.
Create a more space efficient JSON
- The API should allow basic usage examples e.g. like these{.fragment}
- The output of the serialization should be shorter (or at least not longer) than the JSON output{.fragment}
--
import json
person_dict = {'name': 'Bob', 'age': 12, 'children': None }
person_json = json.dumps(person_dict)
# Output: {"name": "Bob", "age": 12, "children": null}
print(person_json)
--
import our_better_json
person_dict = {'name': 'Bob', 'age': 12, 'children': None }
person_json = our_better_json.dumps(person_dict)
# Output: S4nameS3BobS3ageI12S8childrenN
print(person_json)
--
- Supported types:
- Dict
- Array
- String
- Number (Int and float)
- Bool
- None
- Round trip works:{.fragment}
- String -> Python object -> String{.fragment}
- Python object -> String -> Python Object{.fragment}
--
- Ratio Size: JSON string vs Our protocol{.fragment}
- Runtime speed:{.fragment}
- JSON Serialization{.fragment}
- JSON Deserialization{.fragment}
- Python JSON Documentatin
- Existing Formats:
--
Get some data to test with:
- NLohmann JSON Testdata
- JSONPlaceholder
- Awsome Datasets Has some stale links
Start With (till next session/ 2 Weeks):
- Tests{.fragments}
- Benchmarks{.fragments}
- Sketch out Serialization{.fragments}
- (as far as it will go){.fragments}
--
check in
- Answer questions
- Remove Blockers
- (Align on API)
--
In two Sessions (3rd April - 6 Weeks)
- The full thing
--
"Post Mortem"/Lessons Learned
We will then swap projects, and do some refactorings on each others code
--
More lessons Learned