jq is useful to slice, filter, map and transform structured json data.
brew install jq
| $ curl --help | |
| Usage: curl [options...] <url> | |
| --abstract-unix-socket <path> Connect via abstract Unix domain socket | |
| --alt-svc <file name> Enable alt-svc with this cache file | |
| --anyauth Pick any authentication method | |
| -a, --append Append to target file when uploading | |
| --basic Use HTTP Basic Authentication | |
| --cacert <file> CA certificate to verify peer against | |
| --capath <dir> CA directory to verify peer against | |
| -E, --cert <certificate[:password]> Client certificate file and password |
| class Teacher(Job): | |
| def __init__(self, person_name, school): | |
| super().__init__(person_name) | |
| self.school = school | |
| def task(self): | |
| print("working") | |
| teacher = Teacher2("xiaoxu", "TU delft") | |
| print(teacher.school) |
| class Job: | |
| def __init__(self, person_name): | |
| self.name = person_name | |
| def task(self): | |
| print("working") | |
| class Teacher(Job): | |
| def task(self): | |
| print("teach students") |
| class Job: | |
| def __init__(self, person_name): | |
| self.name = person_name | |
| def task(self): | |
| print("working") | |
| class Teacher(Job): | |
| def task(self): | |
| print("teach students") |
| from confluent_kafka import Producer | |
| from python_kafka import Timer | |
| producer = Producer({'bootstrap.servers': 'localhost:9092'}) | |
| msg = ('kafkatest' * 20).encode()[:100] | |
| size = 1000000 | |
| def delivery_report(err, decoded_message, original_message): | |
| if err is not None: | |
| print(err) |
| from confluent_kafka import Consumer, TopicPartition | |
| size = 1000000 | |
| consumer = Consumer( | |
| { | |
| 'bootstrap.servers': 'localhost:9092', | |
| 'group.id': 'mygroup', | |
| 'auto.offset.reset': 'earliest', | |
| } | |
| ) |
| class Kid(Dad, Mum): | |
| def __init__(self): | |
| Mum.__init__(self) | |
| kid = Kid() | |
| print(kid.eye_color) | |
| # brown |
| class Dad: | |
| def __init__(self): | |
| self.eye_color = "blue" | |
| self.hair_color = "black" | |
| self.city = "Amsterdam" | |
| def swim(self): | |
| print("I can swim") | |
| class Mum: |