$ openssl s_client -connect <host:port> -debug -state -cert <path_to_your_cert.pem> -key <path_to_your_key.pem> -CAfile <path_to_your_CA_cert.pem>
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
| /* | |
| #1 always write datetime values into the database as UTC!!! | |
| -- Reread that last statement | |
| Vertica will store all datetime values as UTC values | |
| */ | |
| -- I highly recommend storing an Integer column of the Day Date | |
| select TO_CHAR(<% DATA_END_TIME %>::DATE - INTEGER '1', 'YYYYMMDD')::INTEGER AS date_id | |
| SELECT CLOCK_TIMESTAMP() "Current Time"; -- return current time | |
| SELECT NOW(); -- time since last session connection (or commit;) which may be an older time than now |
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
| print(Kid.__mro__) | |
| # (<class '__main__.Kid'>, <class '__main__.Dad'>, <class '__main__.Mum'>, <class 'object'>) | |
| kid = Kid() | |
| print(kid.eye_color) | |
| # blue | |
| print(kid.city) | |
| # Amsterdam | |
| kid.swim() | |
| # I can swim | |
| kid.dance() |
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
| 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: |
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
| class Kid(Dad, Mum): | |
| def __init__(self): | |
| Mum.__init__(self) | |
| kid = Kid() | |
| print(kid.eye_color) | |
| # brown |
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 confluent_kafka import Consumer, TopicPartition | |
| size = 1000000 | |
| consumer = Consumer( | |
| { | |
| 'bootstrap.servers': 'localhost:9092', | |
| 'group.id': 'mygroup', | |
| 'auto.offset.reset': 'earliest', | |
| } | |
| ) |
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 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) |
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
| 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") |
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
| 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") |
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
| 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) |
OlderNewer