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 python | |
from PIL import Image, ImageFont, ImageDraw | |
def code39(filepath=".", text="", size=200, orientation="horizontal", printText=False, sizeFactor=8): | |
code_dict = {"0":"111221211","1":"211211112","2":"112211112","3":"212211111","4":"111221112","5":"211221111","6":"112221111","7":"111211212","8":"211211211","9":"112211211","A":"211112112","B":"112112112","C":"212112111","D":"111122112","E":"211122111","F":"112122111","G":"111112212","H":"211112211","I":"112112211","J":"111122211","K":"211111122","L":"112111122","M":"212111121","N":"111121122","O":"211121121","P":"112121121","Q":"111111222","R":"211111221","S":"112111221","T":"111121221","U":"221111112","V":"122111112","W":"222111111","X":"121121112","Y":"221121111","Z":"122121111","-":"121111212",".":"221111211"," ":"122111211","$":"121212111","/":"121211121","+":"121112121","%":"111212121","*":"121121211"} | |
upper_text = text.upper() | |
code_string = ''.join([code_dict[c] + "1" for c in upper_text]) | |
code_string = "1211212111" + code_stri |
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 python | |
from __future__ import print_function, division | |
import sys | |
import math | |
def main(argv): | |
if len(argv) < 3: | |
print("Usage: split_csv.py filename N") | |
print("filename: File to be split") |
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
#ifndef UUID_H | |
#define UUID_H | |
#include <string> | |
#include <cstdlib> | |
//*Adapted from https://gist.github.com/ne-sachirou/882192 | |
//*std::rand() can be replaced with other algorithms as Xorshift for better perfomance | |
//*Random seed must be initialized by user |