I hereby claim:
- I am fikander on github.
- I am fikander (https://keybase.io/fikander) on keybase.
- I have a public key ASA6LWitkNHk3ihjJdTROmoYtIpFJfg2XrfAv_mu1jVu1wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
class ObjectDict(dict): | |
"""Allows access to dict elements via dot notation | |
>>> o = ObjectDict.as_object(dict(a=1, b=2)) | |
>>> o.a | |
1 | |
>>> o.b | |
2 | |
>>> o.b = 4 | |
>>> o.b |
# MIT License | |
# | |
# Copyright (c) 2017 Tomasz Kustrzynski | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
#!/bin/bash | |
set -o errexit | |
echo "Removing exited docker containers..." | |
docker ps -a -f status=exited -q | xargs -r docker rm -v | |
echo "Removing dangling images..." | |
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi |
#!/usr/bin/python | |
# https://www.hackerrank.com/challenges/bfsshortreach | |
import unittest | |
from collections import defaultdict, deque | |
def bfs_find_paths(graph, start, path=[]): | |
queue = deque([(start, [start])]) | |
visited = set() |
R, C, N = [int(i) for i in input().split()] | |
board = list() | |
for i in range(R): | |
board.append([0 if x == '.' else 1 for x in list(input())]) | |
def print_board(board): | |
for row in board: | |
r = '' | |
for v in row: |
import sys | |
from optparse import OptionParser | |
def split_file(file, prefix, max_size, buffer=1024): | |
""" | |
file: the input file | |
prefix: prefix of the output files that will be created | |
max_size: maximum size of each created file in bytes | |
buffer: buffer size in bytes |