Install
Pylint
from Install. If you have anaconda already installed usepip install -U pylint
to update thePylint
so thatpyreverse
is added to the scripts folder.You need to install Graphviz as the pyreverse generates the UML diagrams in dot format and needs the dot.exe provided by Graphviz. Once Graphviz is installed make sure the bin folder is added to the
PATH
variable so that pyreverse can find it at run time. "the command pyreverse generates the diagrams in all formats that graphviz/dot knows." (ReferenceNow add the path of python modules for which you want to generate the documentation to PYTHONPATH.
Use pyreverse -S <modulename> to generate dot files in the current folder
Usage:
This file contains 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
# Copyright (c) 2018 Bao Nguyen <[email protected]> | |
# | |
# 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: | |
# | |
# The above copyright notice and this permission notice shall be included in all |
This file contains 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
CREATE FUNCTION levenshtein(s1 varchar, s2 varchar) RETURNS integer IMMUTABLE AS $$ | |
import numpy as np | |
# https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Python | |
def levenshtein(source, target): | |
source = source or "" | |
target = target or "" | |
if len(source) < len(target): | |
return levenshtein(target, source) |
This Gist contains a NiFi flow template that utilizes NiFi backpressure mechanizm to distribute load among multiple consumers.
This pattern is useful to consume large data from AWS, downloading large files from S3 for instance.
The key point is configure GetSQS
processor Batch Size
to 1
.
It defaults to 10, so you may not be able to see expected distribution with small number of messages.
Set Back Pressure Object Threshold
to 1
at the success relationship from GetSQS
, so that only one flow file can be processed at a time.
This file contains 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
#! /usr/bin/env python3 | |
"""Fixing bluetooth stereo headphone/headset problem in debian distros. | |
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197 | |
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone. | |
This will be only fixes the bluez5 problem mentioned above . | |
Licence: Freeware |
This file contains 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
FFmpeg has been removed from Ubuntu 14.04 and was replaced by Libav. This decision has been reversed so that FFmpeg is available now in Ubuntu 15.04 again, but there is still no official package for 14.04. In this tutorial, I will show you how to install FFmpeg from mc3man ppa. Add the mc3man ppa: | |
sudo add-apt-repository ppa:mc3man/trusty-media | |
And confirm the following message by pressing <enter>: | |
Also note that with apt-get a sudo apt-get dist-upgrade is needed for initial setup & with some package upgrades | |
More info: https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media | |
Press [ENTER] to continue or ctrl-c to cancel adding it | |
Update the package list. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import io | |
import sys | |
class IteratorFile(io.TextIOBase): | |
""" given an iterator which yields strings, | |
return a file like object for reading those strings """ | |
def __init__(self, it): | |
self._it = it | |
self._f = io.StringIO() |
This file contains 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
import time | |
import boto3 | |
import botocore | |
def main(): | |
db_identifier = 'yourDBID' | |
rds = boto3.client('rds') | |
try: |
NewerOlder