Saturday, January 27, 2018

Harry Potter and the Methods of Rationality

I've finally finished reading the book Harry Potter and the Methods of Rationality (HPMOR).
What can I say: it is amazing book. One of the best I've ever read.
10/10 Excellent work. I will definitely recommend it to everyone.

I wish the author to live long, and prosper - EXPECTO PATRONUM! :)

Thursday, January 25, 2018

Contribute to CPython

Today I tried to contribute to CPython. My pull request was small and changes minor, I found a mistake in HAMT algorithm description in the comments.

After sending my pull request and my username was checked by the bot "the-knights-who-say-ni", and the bot said the next message with "CLA not signed" badge.


I was really surprised. Despite this my fix was accepted and merged.
But here are the steps needed in order to sign the CLA (from https://devguide.python.org/pullrequest/#licensing):
  1. If you don’t have an account on bugs.python.org (aka b.p.o), please register to create one.
  2. Make sure your GitHub username is listed in the “Your Details” section at b.p.o.
  3. Fill out and sign the PSF contributor form. The “bugs.python.org username” requested by the form is the “Login name” field under “Your Details”.
After at least one US business day "Contributor Form Received Yes on " and "Is Committer <...>" status will appear in your profile details on b.p.o site.

Since this time your pull requests on github will be with "CLA signed" badge.
It is also required to provide a link like "https://bugs.python.org/issue" to the issue in PR description and specify a bpo- in PR title.

Sunday, December 17, 2017

Hex Calendar

Some time ago, I've written a simple tool to generate calendar image for a year. But the calendar in not usual format, but in hex format, i.e. with days, month and year in hexadecimal format.

Repository with sources in Python is available on github: https://github.com/delimitry/hex_calendar

Here is the result image of hex calendar for 2018 year (0x7e2 in hex) with SPbPython logo:


Wednesday, November 1, 2017

SchoolCTF 2017


SchoolCTF game will be held on November 5, 2017. Don't forget to register for this event. Despite the name of this CTF, not only student teams can participate. The rating is counted separately for school and non-school teams.
The complexity of the tasks is targeted at beginners. Therefore, if your team wants to practice, but does not have much experience – welcome.

Tuesday, July 11, 2017

PEP20 - The Zen of Python decorators

Idea:
The Zen of Python principles as Python decorators:
@beautiful_is_better_than_ugly
@explicit_is_better_than_implicit
@simple_is_better_than_complex
@complex_is_better_than_complicated
@flat_is_better_than_nested
@sparse_is_better_than_dense
@readability_counts
@special_cases_arent_special_enough_to_break_the_rules
@although_practicality_beats_purity
@errors_should_never_pass_silently
@unless_explicitly_silenced
@in_the_face_of_ambiguity_refuse_the_temptation_to_guess
@there_should_be_one_and_preferably_only_one_obvious_way_to_do_it
@although_that_way_may_not_be_obvious_at_first_unless_youre_dutch
@now_is_better_than_never
@although_never_is_often_better_than_right_now
@if_the_implementation_is_hard_to_explain_its_a_bad_idea
@if_the_implementation_is_easy_to_explain_it_may_be_a_good_idea
@namespaces_are_one_honking_great_idea_lets_do_more_of_those
def func():
    """Idiomatic function"""
Each decorator could act as code analyser.

Friday, June 2, 2017

Stalactite vs Stalagmite

My visual mnemonics for stalactite and stalagmite. Maybe this can help someone to remember:

Thursday, May 25, 2017

SNMP walk in pure Python

Some time ago I've added one more protocol to my github repo. This time SNMP.
I created tool similar to snmpwalk in pure Python. The most difficult part was to implement an ASN.1 parser. Current version supports only SNMP versions 1 and 2.
https://github.com/delimitry/networks/blob/master/networks/snmp.py