Skip to content

Instantly share code, notes, and snippets.

# https://stackoverflow.com/q/62478289/1933185
ini_list = [('G 05', 'Over-Speed', '1.63'), ('Load 23A_UF', 'Over-Voltage', '11.37'), ('Load 21A_UF', '11.38'), ('Load 08A_UF', '11.38'), ('Load 07A_UF', '11.38'), ('Load 12A_UF', '11.38'), ('Load 24A_UF', '11.38'), ('Load 15A_UF', '11.38'), ('Load 16A_UF', '11.38'), ('Load 04A_UF', '11.38'), ('Load 03A_UF', '11.38'), ('Load 18A_UF', '11.38'), ('Load 25A_UF', '11.38'), ('Load 27A_UF', '11.39'), ('Load 26A_UF', '11.39'), ('G 05', 'Over-Speed', '1.63'), ('G 05', 'Over-Voltage', '1.63'), ('NSG_2', 'OverVoltage', '2.72'), ('G 01', 'Out of Step', '2.72')]
reasons = {'sum_of_reasons': 0}
for item in ini_list:
reason = lambda x: 'No Reason Given' if len(x) == 2 else x[1]
add_fault(reason(item), reasons)
{print('%s: %s this is %.2f' % (k, reasons[k], reasons[k]/reasons['sum_of_reasons'])) for k in reasons}
def add_fault(fault, reasons):
@jerik
jerik / mac-php-composer-setup.md
Created April 26, 2017 20:16 — forked from tomysmile/mac-php-composer-setup.md
Setup PHP Composer using Brew
@jerik
jerik / 0_reuse_code.js
Created February 11, 2016 14:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jerik
jerik / Get-started-with-kibana4.md
Last active February 24, 2016 19:57
Get started with kibana4

Get started with kibana4

Short tutorial how to get started with kibana on OSX for rookies (like me at this topic)

Install (on *nix flavours)

  • elasitcsearch
  • kibana4

Fireup

on the shell start bin/elasticsearch and bin/kibana