A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: Update packages list | |
apt: update_cache=yes | |
when: ansible_os_family == 'Debian' | |
- name: List packages to upgrade (1/2) |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
def human_log(res): | |
if isinstance(res, dict): | |
for field in FIELDS: | |
if field in res.keys(): | |
encoded_field = res[field].encode('utf-8') | |
print '\n{0}:\n{1}'.format(field, encoded_field) |
c3.large c4.large c4 / c3
===========================================================================================
Dhrystone 2 using register variables 34752053.9 lps 43996767.0 lps 1.2660
Double-Precision Whetstone 4459.8 MWIPS 8113.5 MWIPS 1.8193
Execl Throughput 4110.8 lps 7697.1 lps 1.8724
git ls-tree -r --name-only HEAD | while read filename; do | |
echo "$(git log -1 --format="%ad" --date=iso -- $filename) $filename" | |
done | sort |
This works in a python 3.6 environment with bokeh and flask installed. To use this you need the following directory structure:
app/
- templates/
- hello.html
- bokeh-slider.py
- hello.py
After that you need to open two terminals at app/, in the first one you need to run the bokeh server with the command:
infix operator ➡️: AdditionPrecedence | |
enum 🖇<🤖>: Collection, CustomStringConvertible { | |
indirect case 📎(🤖, 🖇) | |
case 🚫 | |
func makeIterator() -> AnyIterator<🤖> { | |
var 📌 = self | |
return AnyIterator { |
#!/usr/bin/env python3 | |
""" | |
We want to buy magnetic letters to teach French at home during the COVID-19 crisis. | |
I was wondering what is the optimal bag of letters to be able to *write* French words. | |
This script implements two ways of estimating this, *optimal bag of letters*: | |
- Per word max occurrence of each letters (ensure the bare minimum to write any single word of the dictionary [1]) | |
- Statistical occurrence of letters (biased as words frequency is strongly dependent of the context [2]) |
This will allow you to test a specific frequency that you hear when you do your resonance testing in Klipper and potentially track down where extra peaks are coming from. If something is rattling at a specific frequency, you can specify that frequency and feel around the printer until you track it down.
Code was adopted by zifnab from somewhere in Klipper.
You have to have [resonance_holder]
in your printer.cfg.
The command is HOLD_RESONANCE AXIS=<axis> FREQ=int SECONDS=<seconds>
""" | |
Convert SARIF to Generic SonarQube issues import format. | |
Links: | |
* https://community.sonarsource.com/t/import-sarif-results-as-security-hotspots/83223 | |
* docs.sonarqube.org/9.8/analyzing-source-code/importing-external-issues/generic-issue-import-format | |
* https://gist.github.com/davidfischer-ch/cdfede27ac053a8332b2127becc07608 | |
Author: David Fischer <[email protected]> |