Ignorance is a Socially Transmitted Disease.

Latest stories

Python: Enforce Type Hints

To enforce Type Hints, copy the enforce_type function and import typing. Decorate your function with @enforce_type. The enforce_type function will raise a TypeError when it detects mismatched types or return the original function when matching types have been passed to the decorated function. It requires decorated functions to include type hints. import typing def enforce_type(func): def...

Python: Comprehensions

Comprehensions build data structures with one or more iterator. This approach reduces syntax and increase efficiency when building lists, dictionaries, or sets from conditional and loop statements. Comprehension Examples # Construct a list with a list comprehension import string alphabet = string.ascii_lowercase alphabet_list = [letter for letter in alphabet] print(alphabet_list) # Construct...

Python: Lists

Python lists are data structures containing a group of elements within a single variable. Elements are access by offset (position), slice (offset range), or iteration. The first element is positioned at “index 0”. You can loop through a list with a “for” and “in” construct. You can also check for an element by value with an “if” and “in”...

Advantages

A tactical advantage uses one’s strength. A strategic advantage leverages another’s weakness.

Stop Renting

Manufacturers value supply chain; so too should tech. If it’s not your advantage, it’s likely a disadvantage. Own your stack.

Pricing

Solutions are not about profits, but about problems. The problem — not the solution — dictates the price.

Dependency Inversion w/Mongo Engine + Flask

Page defines our object’s attributes. This allows us to create an object instance with the following attributes: author, content, title, and meta_attributes. /app/domain/page/page_model.py from cms.services.schema.page_schema import PageSchema class Page(PageSchema): """ Page class """ def __init__(self, author, content, title, meta_attributes, *args, **values): """ Instantiate page object...