Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/bin/bash | |
# This script will make a best-effort attempt at showing modifications | |
# to package-provided config files on a Debian system. | |
# | |
# It's subject to some pretty significant limitations: most notably, | |
# there's no way to identify all such config files. We approximate the | |
# answer by looking first at dpkg-managed conffiles, and then hoping | |
# that most of the time, if maintainer scripts are managing files | |
# themselves, they're using ucf. So, DO NOT TRUST THIS SCRIPT to find |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/bin/sh | |
WEBDIR=yourwebdir | |
WORKSPACE=your/workspace | |
TEX_FILE_NAME=your_file | |
echo | |
echo "**** Pulling changes into Live [Hub's post-update hook]" | |
echo |
#!/usr/bin/env python | |
# An example of decoding/encoding datetime values in JSON data in Python. | |
# Code adapted from: http://broadcast.oreilly.com/2009/05/pymotw-json.html | |
# Copyright (c) 2023, Abhinav Upadhyay | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: |
/* | |
* I add this to html files generated with pandoc. | |
*/ | |
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} |
/opt/flexlm
At this point you should have something similar to following directory structure:
/opt/flexlm/
└── VENDOR
import math | |
import pandas as pd | |
def read_csv_in_chunks(path, n_lines, **read_params): | |
if 'chunksize' not in read_params or read_params['chunksize'] < 1: | |
read_params['chunksize'] = 80000 | |
chunks = [0] * math.ceil(n_lines / read_params['chunksize']) | |
for i, chunk in enumerate(pd.read_csv(path, **read_params)): | |
percent = min(((i + 1) * read_params['chunksize'] / n_lines) * 100, 100.0) | |
print("#" * int(percent), f"{percent:.2f}%", end='\r', flush=True) |