text:
# REPLACE_ME_WITH_PROJECT_TITLE
REPLACE_ME_WITH_DESCRIPTION_OF_THE_PROJECT

## Features
- REMOVE_THE_SAMPLES_BELOW_AND_PUT_YOUR_FEATURES;
- Support Standard Markdown / CommonMark and GFM(GitHub Flavored Markdown);
- Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
- Markdown Extras : Support ToC (Table of Contents), Emoji, Task lists, @Links...;
- Compatible with all major browsers (IE8+), compatible Zepto.js and iPad;
- Support identification, interpretation, fliter of the HTML tags;
- Support TeX (LaTeX expressions, Based on KaTeX), Flowchart and Sequence Diagram of Markdown extended syntax;
- Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins;

## Links

[REMOVE_THE_SAMPLES_BELOW_AND_PUT_YOUR_LINKS](http://github/lib)

[Library1](http://github/lib1)

[Library2](http://github/lib2)

## Screenshot(s)

Image:

![](https://pandao.github.io/editor.md/examples/images/4.jpg)

> Picture of following your heart.

## Credits Behind This Project

[REMOVE_THE_SAMPLES_BELOW_AND_PUT_YOUR_NAMES](http://facebook.com/name)

[NAME_SURNAME1](http://facebook.com/name1)

[NAME_SURNAME2](http://facebook.com/name2)


text:
---
layout: post
title: Program Profiling Using Systemtap
---

SystemTap (stap) is both scripting language and tool for profiling program on Linux kernel-based operation system. The most important feature is its ability to probe user-land function, different from tools like [strace](http://linux.die.net/man/1/strace) and [perf](http://en.wikipedia.org/wiki/Perf_%28Linux%29) which can only or partly support user-land probing. You can find what it can do in the latest Linux performance tools graph:

![linux_observability_tools](http://www.brendangregg.com/Perf/linux_observability_tools.png)

Stap supports c++ and c. For java, it may support it  from RHEL7 according to [this](http://developerblog.redhat.com/2014/01/10/probing-java-w-systemtap/). The key is the systemtap-runtime-java package, which I don’t see it in RHEL6 repo.(Yeah, I use RHEL6.)

##Install Guide

* Make sure utrace is enabled in your OS. By default, RHEL should has this option open. But it’s better to double check.
   ```
   grep CONFIG_UTRACE /boot/config-`uname -r`
   ```
* Install required kernel package, including kernel-debuginfo, kernel-debuginfo-common, kernel-devel (**Optional if you only use user-land probe**)

* Install debug info for program ls, which we will use as a test.
`` debuginfo-install `rpm -qf /bin/ls` ``
* Test whether the installation works and user-land probe is enabled. If succeed, it should print out a line "hello world!"
{% highlight bash %}
sudo stap -e 'probe process("ls").function("main") { printf("hello world!\n"); }' -c ls
{% endhighlight %}

##Usage Guide

You don’t need to learn stap language very well to use it. There are many good resources on Github. I mainly use scripts from [agentzh](https://github.com/agentzh), who is pretty active on performance tuning using stap. Blow are his two repositories I use:

###[nginx-systemtap-toolkit](https://github.com/openresty/nginx-systemtap-toolkit)

Although this repo is mainly for nginx performance tuning, there are also many for general purpose usage. Here I use the [sample-bt](https://github.com/openresty/nginx-systemtap-toolkit/blob/master/sample-bt) and [sample-bt-off-cpu](https://github.com/openresty/nginx-systemtap-toolkit/blob/master/sample-bt-off-cpu) to generate the [FlameGraph](http://www.brendangregg.com/flamegraphs.html).

* **On-CPU Flame Graph**

sample-bt could be used to generate in-CPU graph. This graph shows how your program consume CPU cycles from the perspective of functions. Follow the instruction [here](https://github.com/openresty/nginx-systemtap-toolkit#sample-bt).

For example, below graph is got from profiling redis server. From the graph, you can clearly see what redis is doing and which funciton consume the most cpu cycles. Some of the functions may not be optimizable, but most of the time you are able to find the bottomneck or some program fault. Click that function, you can follow the stacktrace further.

{% highlight bash %}
# example used to show systemtap use case
# All the use cases use the same program and running paramaters.

# redis-server opens in localhost
# redis-benchmark runs like:
./redis-benchmark -r 10000000 -n 2000000 -t get -P 16 -q

# For more details about redis-benchmark commands please refer to http://redis.io/topics/benchmarks.
{% endhighlight %}

**ATTENTION**: For C++ program, we need to unmangle the .bt file. Please run `cat [bt file] | c++filt -n > [output bt file]`

![redis-on-cpu-get](/images/redis-on-cpu-get.svg)
[Download the svg file and open it in your browser to see the interactive graph](https://github.com/qqibrow/qqibrow.github.io/blob/master/images/redis-on-cpu-get.svg)

* **Off-CPU Flame Graph**

sample-bt-off-cpu could be used to generate off-CPU graph, which shows all the blocking(or latency) come from. Then running process is exactly the same with sample-bt.

The Off-CPU flame graph is a pretty good startpoint for latency analysis. Personally I have a user case here. After a newest feature been pushed to production, we notice the latency went pretty high. Then we got the off-cpu flame graph of the app and find out one specific funtion consumed most of the time. Following that, we found out there is some wrong with our cache layer once under high traffic and finally fixed that. The off-cpu flame graph really helps us quickly target the root casue and also give us a clear picture whether the application is doing the right thing.

Here is a flame graph of redis
![redis-on-cpu-get](/images/redis-on-cpu-get.svg)
[Download the svg file and open it in your browser to see the interactive graph](https://github.com/qqibrow/qqibrow.github.io/blob/master/images/redis-on-cpu-get.svg)

FlameGraph is pretty powerful in performance tuning, since it could give you a overview of the program without any domain-specific knowledge. Need to mention that FlameGraph is independent of stap, you can definitely use other tools to generate flameGraph. Please check following links.

1. [Nodejs in Flames](http://techblog.netflix.com/2014/11/nodejs-in-flames.html)
2. [Java Flame Graphs](http://www.brendangregg.com/blog/2014-06-12/java-flame-graphs.html)

###[stapxx](https://github.com/openresty/stapxx)

stapxx is a macro language built on top of stap, which provide more functionalities and easier to use. For more detail, please review the main page. Here I mainly use the func-latency-distr script. The usage is very clear here.https://github.com/openresty/stapxx#func-latency-distr

For example, below is a comparison I did using func-latency-distr.sxx to show how big the cross-colo latency is:

{% highlight bash %}
# the latency of lookupKeyRead function in redis codebase.
sudo ./func-latency-distr.sxx -x 10995 --arg func='@pfunc(lookupKeyRead)'

Start tracing 10995 (/home/lniu/redis-2.8.13/src/redis-server)
Hit Ctrl-C to end.
^CDistribution of lookupKeyRead latencies (in nanoseconds) for 1859762 samples
max/avg/min: 248455/6884/5955
 value |-------------------------------------------------- count
  1024 |                                                         0
  2048 |                                                         0
  4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  1764146
  8192 |@@                                                   80367
 16384 |                                                     14996
 32768 |                                                       228
 65536 |                                                        22
131072 |                                                         3
262144 |                                                         0
524288 |                                                         0

{% endhighlight %}

Please leave a message if you have any questions. I am glad to help :)

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: HTML

gha_license_id: MIT

license_type: permissive


text:
# δια-φέρω

<!-- Status: S2=NeedsFinalCheck -->
<!-- Lexica used for edits: BDAG  -->

## Word data

* Strongs: G13080

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html);

* Instances in NT: 13

* All Scriptures cited: Yes

## Etymology:

* LXX/Hebrew glosses:

in LXX for [שְׁנָא](//en-uhl/H8133) ([Da 7](Dan 7) only); [I Ki 17:39](1Sa 17:39), [Es 3:13](Ezr 3:13), al. ;

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses

### Sense  1.0:

#### Definition:

to carry something through somewhere;

#### Glosses:

carry;

#### Explanation:

pass. to be carried, i.e., spread;

#### Citations:

to carry about, spread abroad: pass., [Ac 13:49](Act 13:49),  [27:27](Act 27:27).
to carry through: seq. [διά](), [Mk 11:16](Mrk 11:16);

### Sense  2.0:

#### Definition:

to differ, be different from;

#### Glosses:

to differ;

#### Explanation:

#### Citations:

to differ: [τὰ διαφέροντα](), [Ro 2:18](Rom 2:18), [Phl 1:10](Php 1:10) (R, mg., but v. infr.); [I Co 15:41](1Co 15:41);
impers., [διαφέρει](), it makes a difference, [Ga 2:6](Gal 2:6); [Ga 4:1](Gal 4:1);

### Sense  3.0:

#### Definition:

to differ in positive value, to excel;

#### Glosses:

to excel, be superior, be worth more than;

#### Explanation:

#### Citations:

to excel: c. gen. [Mt 6:26](Mat 6:26) [10:31](Mat 10:31) [12:12](Mat 12:12), [Lk 12:7](Luk 12:7), [24](Luk 12:24),    [[[Phl](Php 1:10) 1:10](Php 1:10)](Php 1:10) (R, txt.; for discussion and reff. v. ICC on Ro, Phl, ll. c.).†

repository: mandolyte/uw-obsidian

branch_name: refs/heads/main

repo_name: mandolyte/uw-obsidian


text:
---
layout: post
title: Types of AI
---

So, I have been trying to think about what we (AI/ML researchers) are aiming for, and I had some trouble coming up with clear answers. So …

Define AI.

# Types
* Human-like
* Scientist-like (they aren’t really humans)
* Machine-like
* ???

Distributed consciousness? Goal driven? Attention/priorities?

## Human-like AI

Popular ideas - Her, Ex Machina, …
Models of the brain - Blue brain projects …

Conscious, emotions,

## Scientist-like

Seeks to find an accurate model of the world.

Versions
* passively observes the world and forms a model. It’s goal is to make accurate predictions.
* actively queries the world and designs experiments to increase its ability to make accurate predictions. Queries and experimental designs could be filtered through humans. (this sounds kind of similar to what we do now? supervised learning the queries, which already exist are filtered through humans…)

## Already?

Thermostat? Self-driving cars …

# Goals?

* Truth
	* Accurate models/predictions
	*
* Compression
* Make people happy (… lame)

Related to problem types?
> Machine Learning has four common classes of applications: classification, predicting next value, anomaly detection, and discovering structure. [](https://iwringer.wordpress.com/2015/11/17/anomaly-detection-concepts-and-techniques/)


text:
# Scroll Figma
Firefox extension that fixes this issue:
https://spectrum.chat/figma/feature-requests/zooming-speed-with-ctrl-mouse-scroll-on-firefox-differs-from-googles-chrome~250fac37-73e9-4319-b38a-297bf4db5843

It makes scroll in linux faster for figma.com site.

Extension link: https://addons.mozilla.org/ru/firefox/addon/scroll-figma/


text:
# deep-book-nim
[Nim Arraymancer](https://github.com/mratsim/Arraymancer) version of the code for the [Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com/) free book

I made it in hope that it will be much faster than MXNet/Clojure implemntation


text:
# Password Locker #

## Author ##
Benson Njoroge Mwaniki
## Description ##
This is a python application to showcase the level of python understanding. This application allows users to create and even generate passwords. The main purpose behind the creation of the app is to help the user save his or her password in it since one might have different accounts, with this app it is easier to manage them.

## preview of the app

<img src="scsh.png" width=60%>

## Installation / Setup instruction

The application requires the following installations to operate
* python3.6
* pyperclip
*pip
### Cloning
Open Terminal {Ctrl+Alt+T}

git clone https://github.com/bensammwaniki/password-locker

cd Password-Locker

code .

## Running the Application

To run the application, open the cloned file in terminal and run the following commands:

  $ ./user_interface.py

## Technology used

* python 3.8

## Known bugs
some problems with data saving

## Contact Information
for any conserns you might have email<EMAIL_ADDRESS>
## Licence
MIT License

Copyright (c) 2021 By Bensam Mwaniki

repository: bensammwaniki/password-locker

repo_name: bensammwaniki/password-locker


text:
# @geoffcox/svelte-splitter

A resizable splitter for Svelte that leverages CSS display:grid

[Live Demo](https://geoffcox.github.io/demos/svelte-splitter)

## Features
- Vertical (left|right) and Horizontal (top/bottom) splitting
- Provides slots for panes and splitter
- Set initial split size
- Minimum pane sizes
- Sizes can be any CSS unit (e.g. px, %, fr, em, pt, cm, mm)
- Reset to initial split with double-click
- Resize with keyboard arrow keys
- Nested splits with correct resizing
- Customize the DefaultSplitter size & colors, or render your own splitter.

## Technology
- Built with Svelte and Typescript
- Package has no dependencies
- CSS grid combined with a simple percentage split system provides accurate and responsive resizing.

# Installation

```
npm install --save @geoffcox/svelte-splitter
```
# Usage

To create vertical or horizontal splits you only need the `Split` component.

## Vertical Split
The default creates a left(50%) | right(50%) split, no minimum pane sizes, and renders the default splitter.

```svelte
<Split>
  <div slot="primary">This is the left pane.</div>
  <div slot="secondary">This is the right pane.<div>
</Split>
```

## Horizontal Split
Add the `horizontal` attribute to split top/bottom.

```svelte
<Split horizontal>
  <div slot="primary">This is the top pane.</div>
  <div slot="secondary">This is the bottom pane.<div>
</Split>
```

## Set the initial split size
Add the `initialPrimarySize` property to control where the initial split occurs.

```svelte
<Split initialPrimarySize='30%'>
  <div slot="primary">Primary pane</div>
  <div slot="secondary">Secondary pane<div>
</Split>
```

To support double-clicking to reset back to the initial size, add the `resetOnDoubleClick` property.

```svelte
<Split initialPrimarySize='30%' resetOnDoubleClick>
  <div slot="primary">Primary pane</div>
  <div slot="secondary">Secondary pane<div>
</Split>
```

## Nest Splits
Just nest Split componets to create whatever layout you like.
Here is an example of a common layout for a main, detail, and output view.

```svelte
<Split initialPrimarySize='30%'>
  <div slot="primary">This is the left pane.</div>
  <svelte:fragment slot="secondary">
    <Split horizontal initialPrimarySize='60%'>
      <div slot="primary">This is the right-top pane.</div>
      <div slot="secondary">This is the right-bottom pane.</div>
    </Split>
  </svelte:fragment>
</Split>
```
## Constrain minimum pane sizes
Prevent either pane from becoming too small using the `minPrimarySize` and `minSecondarySize` properties.

```svelte
<Split minPrimarySize='250px' minSecondarySize='15%'>
  <div slot="primary">This pane won't get smaller than 250 pixels.</div>
  <div slot="secondary">This pane won't get any smaller than 15% of the overall size of the split control./<div>
</Split>
```

## Customize the splitter size
Set the size of the default splitter's hit area with the `splitterSize` property.
The hit area is where the user can click to start dragging the splitter.

```svelte
<Split splitterSize='10px'>
  <div slot="primary">Primary pane</div>
  <div slot="secondary">Secondary pane<div>
</Split>
```
## Customize the splitter colors
Change the colors of the default splitter by adding the `DefaultSplitter` to the splitter slot.
Pass color properties to the default splitter.

```svelte
<Split defaultSplitterColors={colors}>
  <div slot="primary">Primary pane</div>
  <svelte:fragment slot="splitter">
    <DefaultSplitter color="red" hoverColor="#00FF00" dragColor="blue">
  </svelte:fragment>
  <div slot="secondary">Secondary pane<div>
</Split>
```
## Custom render the splitter
Substitute a custom splitter by replacing the default splitter.

```svelte
<Split defaultSplitterColors={colors}>
  <div slot="primary">Primary pane</div>
  <svelte:fragment slot="splitter">
    <MyAwesomeSplitter />
  </svelte:fragment>
  <div slot="secondary">Secondary pane<div>
</Split>
```

When building a customer splitter, leverage the context information from the parent `Split` component.

```ts
let splitterContext = getContext<SplitterContextStore>(splitterContextKey);

$: dragging = $splitterContext.dragging;
$: horizontal = $splitterContext.horizontal;
};
```

## Events
Subscribe to the changed event to get updates.

```ts
const onChanged = (event) => {
    const {details: {percent, primarySize, splitterSize, secondarySize, dragging}} = event;
    console.log(`percent: ${percent}`);
    console.log(`primarySize: ${primarySize}`);
    console.log(`splitterSize: ${splitterSize}`);
    console.log(`secondarySize: ${secondarySize}`);
    console.log(`dragging: ${dragging}`);
};
```ts

```svelte
<Split on:changed={onChanged}>
    ...
</Split>
```
## Imperative Methods
Get or set the percentage by calling `getPercent` and `setPercent` on the `Split` handle.

```ts
let splitControl;

const flipSplitPercent = () => {
    const percent = splitControl.getPercent();
    splitControl.setPercent(100 - percent);
}
```

```svelte
<Split
      bind:this={splitControl}>
    ...
</Split>
```

# Known limitations

- No typescript definitions for Split or DefaultSplitter

# Change History

## 1.0.0 - First project publication
- Based on the 2.1.0 version of @geoffcox/react-splitter
- Updated to idomatic Svelte

## 1.0.1 - Updated live demo link


text:
---
title: Opt-in tax credits give boon to midstate private schools.
date: '2011-08-07T14:40:32.000+00:00'
categories:
  - Enterprise
  - Print
  - The Telegraph
excerpt: 'Donna DrummondΓÇÖs family members pay part of their state income taxes to an unusual place: her 6-year-old daughterΓÇÖs private K-12 school.'
---

Originally appeared Aug. 7, 2010

Donna Drummond’s family members pay part of their state income taxes to an unusual place: her 6-year-old daughter’s private K-12 school.

Drummond’s daughter Laney is attending The Westfield School in Perry this fall using scholarship money from an opt-in taxpayer-funded scholarship program.

At least 254 other midstate students like Laney are receiving a free or reduced price private school education this fall, adding up to about $750,000 in scholarships in Middle Georgia alone, according to information from Georgia GOAL, the scholarship organization administering most of the money.

As part of a law passed by Gov. Sonny Perdue in 2008 and just now gaining popularity, taxpayers can redirect state income taxes to one of 29 independent scholarship organizations approved by the Georgia Department of Education.

A couple can redirect up to $2,500 in state income tax payments annually to their chosen scholarship organization, and an individual can redirect up to $1,000.

After redirecting the money to one of the scholarship organizations, individuals don’t choose which students receive scholarships — that’s up to the scholarship organizations — but they can choose what private school they want their money to be donated to.

Under the law, up to $50 million in income tax payments can be redirected toward private-school scholarships statewide each year.

...

Boon to midstate private schools

The scholarships — which are available only to students transferring from a public school or entering kindergarten — have allowed private schools in the area to recruit new students and keep enrollments steady despite the slack economy.

Most Middle Georgia private schools are participating this fall in Georgia GOAL, the largest of the approved scholarship organizations. Mount de Sales Academy, in Macon, participates in a different approved scholarship organization, GRACE Scholars, which is specifically designed for Catholic schools.

The GOAL and GRACE programs, which both administer need-based scholarships, have helped midstate private schools enroll new low-income students whose parents wouldn’t normally be able to afford a private education.

Officials at First Presbyterian Day School, Stratford Academy, Tattnall Square Academy, Mount de Sales Academy and The Westfield School said they have all either met or exceeded predicted enrollment figures and expect stable operating budgets this fall.

At Stratford, Headmaster Bob Veto said he’s expecting about 940 students roaming the halls when classes begin Aug. 17. That’s up significantly from the 914 students enrolled last year.

“There’s no question this increase in enrollment is directly tied to the GOAL scholarship, which has allowed a lot of new families to send their kids here,” Veto said.

Veto said the GOAL program has boosted Stratford’s financial aid budget by more than $100,000 this year. The growth in enrollment has allowed Stratford to add new computer labs and four new employees this fall.

At First Presbyterian Day School, Headmaster Gregg Thompson told a similar story. Thompson said he’s expecting 971 students this fall, which is up from last year because of the more than $100,000 extra the school has on hand to dole out GOAL scholarships.

“I think people like the idea of being able to direct the way their taxes are spent, and I know we’ve gotten a lot of people directing it toward us,” Thompson said. “We’re not making cuts at FPD like you’re seeing at some of the public schools.”

...

Statewide effects

Lisa Kelly, president of the GOAL scholarship program, said the organization is planning to administer a total of $6.5 million in need-based aid to about 1,700 students statewide this fall.

Directing money toward GOAL or any of the other approved scholarship organizations is considered a tax credit, not a tax write-off, which means that 100 percent of the money donated is slashed from the individual’s state income taxes, Kelly said.

Kelly said families seeking to receive scholarships from the GOAL program must demonstrate financial need based on roughly the same criteria that’s necessary to receive free or reduced lunches at public schools.

But GOAL is just one of the many approved scholarship organizations, and there’s nothing in the law mandating that household income be a consideration of other organizations.

“At GOAL, we have very clear guidelines and income requirements for all students who we give scholarships to, and we’re aiming to be transparent, but there’s nothing requiring us do that. I’m concerned that some of the other scholarship organizations could possibly take advantage of this law and give tax-funded scholarships to kids who don’t need it as badly as others,” Kelly said.

Kelly said she thinks the law needs to be strengthened to allow for more oversight and to require scholarship organizations to be more transparent.

Jennifer Hackemeyer, chief counsel with the Georgia Department of Education, said the Department of Education only has the power either to approve or reject scholarship organizations based upon whether they meet the tax-exempt qualifications.

“The way the law is written, there’s very little oversight on our part. The (scholarship organizations) basically just have to show us that they’re registered. If someone has a concern that the law isn’t strong enough, they should take that up with the legislators,” Hackemeyer said.

Hackemeyer said there’s not really a good way of telling how much total scholarship money has been given out statewide — or what qualifications the scholarship organizations use — since they all operate autonomously of each other.

But for Drummond, a single Fort Valley mother, the important part is that her daughter has been given an opportunity previously out of reach.

“This has been such a huge, huge blessing. I never thought I’d get to send my daughter to a Christian school where she’d also be stimulated intellectually, and I couldn’t have done it without this money.”

--

To contact writer Carl V. Lewis, call 744-4347.

extension: markdown


text:
# Uredo hypericorum var. hypericorum DC., 1807 VARIETY

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mém. Agric. Soc. Agric. Dép. Seine 10: 235 (1807)

#### Original name
Uredo hypericorum var. hypericorum DC., 1807

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Melampsoraceae/Melampsora/Melampsora hypericorum/ Syn. Uredo hypericorum hypericorum/README.md

repo_name: mdoering/backbone


text:
# [customer-manager](https://akshit13.github.io/customer-manager/)

Customer manager app built on the [Aurelia JS](http://aurelia.io/) framework that implements the [localStorage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to store customers.


text:
---
layout: post
title: 'First post'
date: 2020-03-20
categories: ds eda
---

# EDA<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section1/eda11.htm)</sup> is the approach for data analysis that employs a variety of techniques to
- maximize insight into a data set
- uncover underlying structure
- extract important variables
- detect outliers and anomalies
- test underlying assumptions
- develop parsimonious models
- determine optimal factor settings

# Today
EDA with a team was full of struggles but rewarding. It was hard to get the ball rolling without a question to focus on. However once we had a direction to play with the data, we're able to start answering questions and think about questions of our own.

I did couple time series analyses, bar charts, and scatter plots. To show trends, frequency counts, and correlations respectively.

I need to better understand why I am exploring because my time series analyses, in my opinion, did not generate tremendous values. Though the bar chart and the scatter plots were interesting in showing relationships between categories and quantitative variables.

# First consider a question,
then think about EDA
- What features to work with?
- What features brought interest?
- What were the features' types?
- How much of the data was missing, how was it handled?
- What were feature's relationships to each other and to the target?

repository: hininefox/blog

repo_name: hininefox/blog


text:
# Addressing catastrophic forgetting for medical domain expansion

## About

This is the code repository for our paper "Addressing catastrophic forgetting for medical domain expansion", available on preprint here: https://arxiv.org/abs/2103.13511

## Installation

1. Install Docker from Docker's website here: https://www.docker.com/get-started. Follow instructions on that link to get Docker set up properly on your workstation.

2. Install the Docker Engine Utility for NVIDIA GPUs, AKA nvidia-docker. You can find installation instructions at their Github page, here: https://github.com/NVIDIA/nvidia-docker

3. Pull docker container using this command: docker pull projectmonai/monai:latest

4. Install the packages in requirements.txt

## Code

**train_model.py**: Train a base model on the original domain

**train_model_ft_bn.py**: Fine-tune batch normalization layers only on a second domain

**train_model_ft_bn_freeze.py**: Fine-tune batch normalization layers only on a second domain while freezing batch normalization statistics from the original domain

**train_model_ft.py**: Fine-tune all layers on a second domain

**train_model_ft_freeze.py**: Fine-tune all layers on a second domain while freezing batch normalization statistics from the original domain

**fim.py**: Calculate the fisher matrix from the original domain

**train_model_ft_bn_ewc.py**: Fine-tune batch normalization layers only with use of Elastic Weight Consolidation on a second domain

**train_model_ft_bn_freeze_ewc.py**: Fine-tune batch normalization layers with use of Elastic Weight Consolidation only on a second domain while freezing batch normalization statistics from the original domain

**train_model_ft_ewc.py**: Fine-tune all layers with use of Elastic Weight Consolidation on a second domain

**train_model_ft_freeze_ewc.py**: Fine-tune all layers with use of Elastic Weight Consolidation on a second domain while freezing batch normalization statistics from the original domain

**run_inference.py**: run model inference

## Contact

This code is under active development, and you may run into errors or want additional features. Send any questions or requests for methods to<EMAIL_ADDRESS>You can also submit a Github issue if you run into a bug.

## Acknowledgements

Code for fisher matrix calculation adapted from https://github.com/tudor-berariu/fisher-information-matrix/blob/master/fim.py

repository: QTIM-Lab/MedicalDomainExpansion

repo_name: QTIM-Lab/MedicalDomainExpansion


text:
# 🖤💛 mongoose-lazy-migration [![Build Status](https://travis-ci.org/baethon/mongoose-lazy-migration.svg?branch=master)](https://travis-ci.org/baethon/mongoose-lazy-migration)

Migrates on-fly fetched Mongoose documents.

## Installation

```
npm i @baethon/mongoose-lazy-migration
```

## Usage

Define model schema:

```js
const mongoose = require('mongoose')
const { Schema } = mongoose

const userSchema = new Schema({
    fullname: String
})
```

Wrap it with `withMigrations()` helper:

```js
const { withMigrations, migration: m } = require('@baethon/mongoose-lazy-migration')

const migrations = [
    m(1, (user) => ({
        fullname: `${user.firstname} ${user.lastname}`
    }))
]

const User = mongoose.model('User', withMigrations(userSchema, migrations))
```

Use `User` model as always.

## Under the hood

### Migrations

The `migrations` array contains list of objects that contain:

- schema version number

- migration callback that is applied to the document

`m()` is a convenience wrapper.

Schema versioning is not opinionated (it can be consecutive numbers, or date of writing), however, it's required to use an integer value.

Migration callback should be a pure function. Due to the structure of Mongoose hooks, the migration callback **has to be synchronous**.

### Schema

The `withMigrations()` function appends `schemaVersion` property to the model. It defines the _latest_ schema version used at the time of saving. The _latest_ version is taken from the last element of the `migrations` array.

By default `schemaVersion` is indexed. This, can be disabled by setting the `index: false` option.

```js
const User = mongoose.model('User', withMigrations(userSchema, migrations, { index: false }))
```

### Runtime

Whenever a document is fetched the library will compare its `schemaVersion` with the _latest_ schema version.

On mismatch it will apply the migration callbacks in following way:

- when `schemaVersion === NULL`:

  - apply all of the migration callbacks

- otherwise:

  - determine the index of the `schemaVersion` in the `migrations` array

  - apply following migration callbacks

- update the `schemaVersion` property

The document **is not saved** after the migration.

## Testing

The package provides both unit tests and integration tests. The test suite requires access to MongoDB instance (see `ava.config.js`).

You can use `docker-compose` to setup local instance:

```
docker-compose up -d
```

To run the tests use:

```
yarn test
```

repository: baethon/mongoose-lazy-migration

gha_language: JavaScript

repo_name: baethon/mongoose-lazy-migration


text:
## Rolling Update Deployment Strategy

![Rolling update](../images/rollingUpdate.png)

A slow rollout or zero downtime rollout. The RollingUpdate strategy is the generally preferable strategy for any user-facing service. You start replacing existing pods until you have no pods to replace.

Main advantages of this approach are:
* Rollout can be paused and resumed
* Rollbacks are straight forward
* Rollouts are slow and controlled

Main disadvantages are:
* Rollouts are slower
* No control over traffic
* Problematic if older and newer version of apps cannot function together

Anatomy: A rolling update uses readiness probes to check for the availability of new pods probe before it starts scaling down the old ones. If there is a problem, the rolling update or deployment can be aborted without bringing the whole cluster down. In this sense, it is a controlled way to release new features.

repository: Rippyblogger/kube-deployment-strategies

repo_name: Rippyblogger/kube-deployment-strategies


text:
# Study Sheet on ELM

### Web Development
- Front End
  - Run by a browser
  - Scripting is done in **JavaScript**, and MarkUp in **HTML** and **CSS**
- Back End
  - Run by a server
  - Scripting is done in **PHP**, **Python**, etc., and Databases are in **SQL**, **MongoDB**, etc.
- ELM in Web Dev
  - Compiles to JavaScript, HTML and CSS, meaning it provides a unifed language
     - Complies to HTML by executing: `elm-make Main.elm --output Main.hmtl`
  - Built to resemble Haskell, be simple, and have great performance

### Basics
- Modules
  - To define a program in Elm, you define a module
      ```elm
          module ModName exposing (..)
       ```
       or
       ```elm
          module ModName exposing (function)
       ```
   - Modules can also be imported in a similar manner
      ```elm
         import ModName as MN
      ```
      - It is best practice to use the `as` keyword because of Elm's absence of **type classes**

- Differences between Elm and Haskell
  - No type classes
  - No `where` clause, only `let-in`
  - `data` becomes `type`
  - `type` becomes `type alias`
  - No guards or pattern matching, other than **case statements**

## The Elm Architecture
- Messages
  - These define things that happen in the application that the components respond to
  - Defined as:
    ```elm
       type Msg = Something
                | SomethingElse
                | MaybeAnotherThing
    ```

- Init
  - Initialized the program
  - Provides information describing the initial state of the program
  - Defined as:
    ```elm
       init : Model
       init = ...
    ```
- Model
  - Definition of a data type that represents the state of the program
  - Defined as:
    ```elm
       type alias Model =
    ```
- View
  - Takes the **Model** and generates HTML
  - Defined as:
    ```elm
       view : Model -> Html Msg
       view model = ...
    ```
- Update
  - A function that takes the **Module** and generates a new, updated Model
  - Defined as:
    ```elm
       update : Msg -> Model -> Model
       update msg model = ...
    ```
- Subscriptions
  - These allow the program to listen for **external output** such as Keyboard and Mouse events
  - Defined as:
    ```elm
       subscriptions : Model -> Sub Msg
       subscriptions model = ...
    ```
  - Subscriptions can be **batched**, or combined
    - This means that they can listen for multiple events in one subscription
    - Ex.
      ```elm
         subscriptions model = Sub.batch
             [ Mouse.clicks MouseMsg
             , Keyboard.downs KeyMsg ]
      ```
- Commands
   - These are used to execute things that involve **side effects**
   - Ex. Random Number Generation, HTTP requests, saving to local storage

- Main
  - There are many types of programs, for instance:
    ```elm
       main : Program Never Model Msg
       main = Html.beginnerProgram
              { model = init
              , view = view
              , update = update }
    ```
  - Other definitions add more functionality:
    ```elm
       main : Program Never Model Msg
       main = Html.program
              { init = init
              , view = view
              , update = update
              , subscriptions = subscriptions }
    ```
## Elm HTML
- Elm and HTML are very similar
```elm
   div [] [
           h1 [style [("color", "blue")] ] [ text "Hello World" ]
          ]
```
versus
```html
   <div>
     <h1 style="color:blue;">Hello World</h1>
   <div>
```
- Elm HTML Tags
  - `div` is just a generic container
  - `p` groups text into a paragraph
  - `pre` groups text and leaves it formatted as is
  - `b` is for bold, `sub` for subscript, `sup` for superscript
  - `br` for a line break
  - `ol` for an ordered list, `ul` for an unordered list and `li` for an enumerated list
  - `img` for embedding an image, and `a` for creating a hyperlink
    - Ex.
      ```elm
         main = div [] [
                         h1 [] [text "Drunk Rick"]
                       , img [src "www.somelink.com/drunkrick"] []
                       ]
      ```
  - **CSS** can also be used in Elm
    - Ex.
      ```elm
         myStyle = [ ("backgroundColor", "red"), ("height", "90px") ]
      ```
- Elm Buttons
  - Buttons should include an event from `Html.Event`
  - They are defined like this:
    ```elm
       main = div [] [ button [onClick Msg] [text "Label"] ]
    ```

## SVG Graphics
- Record Types
  - This is a unique structure to Elm
  - Ex.
    ```elm
       type alias Pos = { x : Int, y : Int }
       pos = { x = 5, y = 3 }
    ```
- SVG Graphics
  - This library contains a large variety of shapes, as well as other functionalities
  - Can be used like so:
    ```elm
       view model = svg [ width "600", height "400" ]
                        [ circle [cx "300", cy "300", r "20", fill "blue" ] [] ]
    ```
Created by Jessica de Leeuw

path: /Study Sheets/Elm.md


text:
rx-player
=========

Latest release: v1.0.0

The rx-player is a Javascript library implementic a generic streaming video player using HTML5 Media Source and Encrypted Media extensions. It is entirely written in reactive-programming with ECMAScript 6.

It comes with a support for DASH and SmoothStreaming transports.

## API

[Read the detailed API](//github.com/canalplus/rx-player/blob/master/API.md).

## Why a new player ? Why Rx ?

Building a streaming video player in javascript is a complex task due to the numerous interactions with the outside world it has to deal with. Whether they come from the user seeking at a particular moment of its movie, changing the current channel or the network congestion. The video player being the centerpiece of our applications, it needs to adapt very quickly to any of these inputs and stay resilient to various errors.

Many current video player implementations rely on classical object-oriented hierarchy and imperative event callbacks with shared mutable objects to manage all these asynchronous tasks and states. We found this approach to be the wrong abstraction to handle the complexity of a video player.

Rx on the contrary provides gracious interfaces and operators to compose asynchronous tasks together by representating changing states as observable stream of values. It also comes with a **cancelation** contract so that every asynchronous side-effect can be properly disposed when discarded by the system (this is still [a controversial issue in the JS community](https://github.com/whatwg/fetch/issues/27)).

This allowed us to implement some nice features quite easily. For instance, because in the rx-player all asynchronous tasks are encapsulated in observable data-structures, we were able to add a transparent [retry system](https://github.com/canalplus/canal-js-utils/blob/master/rx-ext.js#L73-L100) with a simple observable operator to declaratively handle any failure and replay the whole process.

Another example is the way we abstracted our transport layer into an observable pipeline, allowing us to support different type of streaming systems with its own asynchronous specifities. And because Rx is message-driven, this encapsulation allows us isolate the transport I/O into a WebWorker without any effort, or add an offline support for any pipeline implementation.

### Architecture

TODO

## Demo

The demo is a small application written in [React](https://github.com/facebook/react) demonstrating a simple usage of the player.

To launch the demo yourself, run `make demo` and start a local webserver from the root directory of the repository. For instance:

```sh
python -m SimpleHTTPServer 8080 # open http://localhost:8080/demo
```

## Installation

The fastest way to use our player is to add this repository as a dependency of
your `package.json` dependency field:

```
npm install --save https://github.com/canalplus/rx-player/
```

You can then either use directly the `dist/rx-player.js` file:

```html
<script src="node_modules/rx-player/dist/rx-player.js"></script>
```

Or with tools like [Browserify](http://browserify.org/) or
[Webpack](http://webpack.github.io/) you can import the player as a CommonJS
or AMD dependency.

## Dependencies

- [RxJS](https://github.com/Reactive-Extensions/RxJS)
- [canal-js-utils](https://github.com/canalplus/canal-js-utils)
- [es6-promise](https://github.com/jakearchibald/es6-promise)

For the demo only:

- Font Awesome by Dave Gandy - http://fontawesome.io

## Build

A build is directly included at `dist/rx-player.js` directory if you don't
want to build it yourself.

To bundle the application yourself, we use `make`. The important task to know:

```sh
make clean
# build dist/rx-player.js
make build
# build dist/rx-player.min.js
make min
# build and watch file change for rebuild
make dev
# lint the code with jshint
make lint
```

## Target support

Here are the supported platform that we plan to target with this player.

|          |    IE     |  Firefox  |   Chrome  |  Safari   |
|----------|-----------|-----------|-----------|-----------|
| Windows  |   >= 11   |  Nightly  |   >= 30   |           |
| OX X     |           |  Nightly  |   >= 30   |   >= 8    |
| Linux    |           |  Nightly  |   >= 37   |           |
| iOS      |           |           |           |           |
| Android  |           |           |   >= 30   |           |

- Internet Explorer 11 only on Windows >= 8.
- To test on Firefox, use Firefox Nightly and add in about-config:
     media.mediasource.enabled        true
     media.mediasource.ignore_codecs  true
- Android version >= 4.2

A good way to know if the browser should be supported by our player is to go
on the page https://www.youtube.com/html5 and check support for MSE & H.264.

## Launch tests

Tests are only usable from the browser for now due to dependencies on DOM
elements. We plan to add support for `node` only tests asap.

```sh
# starts a local webserver, open http://localhost:9999/webpack-dev-server/test
make test
```

repository: Developpeur/rx-player

repo_name: Developpeur/rx-player


text:
# Examples

## basic

In this example, tokio is chosen as the runtime.
The system contains four components:

- A [Tide](https://github.com/http-rs/tide) server component
- A [Gotham Server](https://gotham.rs/) component
- DB pool
- A simple tide controller

[mockall](https://github.com/asomers/mockall) is used to demonstrate how to unit test a single component, see `foo_controller.rs`.

### To Run

Start a testing DB container: `docker run -it --rm -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:10-alpinee`

Run example: `cargo run -p examples --example basic`

You'll see:

```
System starting up...
Starting DB connection...
Starting TideServer...
Starting Gotham Server...
System started.
```

And then press Ctrl-C, you will see:

```
^CSystem shutting down...
Shutting Gotham server...
Gotham server gracefully shutted down...
Shutting down TideServer...
TideServer gracefully shutted down...
Shutting down DB connections...
System shutted down.
```

gha_language: Rust


text:
# Game of Life
[![Build Status](https://travis-ci.org/JoshTumath/bbcgradscheme-gameoflife.svg?branch=master)](https://travis-ci.org/JoshTumath/bbcgradscheme-gameoflife)

This is an implementation of
[Conway's Game of Life](https://en.wikipedia.org/wiki/Conway's_Game_of_Life) in
Java. This was created in preparation for an Assessment Centre at the BBC.

In this particular implementation, no assumption about the size of the grid is
made, so both positive and negative coordinates are permitted for the cells of
the grid. Additionally, I assumed that it was only intended for me to create
tests for the game, and there was no need for me to create a view of the grid
either in a CLI or GUI.

To run tests for the Game of Life, use the following command:

```
ant test
```

repository: JoshTumath/bbcgradscheme-gameoflife

repo_name: JoshTumath/bbcgradscheme-gameoflife


text:
+++
date = "2016-08-15T16:11:58+05:30"
title = "Thread and fork safety"
[menu.main]
  weight = 14
  parent="mongocxx3"
+++

TLDR: **Always give each thread its own `mongocxx::client`**.

In general each `mongocxx::client` object AND all of its child objects,
including `mongocxx::client_session`, `mongocxx::database`, `mongocxx::collection`,
and `mongocxx::cursor`, **should be used by a single thread at a time**. This
is true even for clients acquired from a `mongocxx::pool`.

Even if you create multiple child objects from a single `client`, and
synchronize them individually, that is unsafe as they will concurrently
modify internal structures of the `client`. The same is true if you copy a
child object.

## Never do this

```c++
mongocxx::instance instance{};
mongocxx::uri uri{};
mongocxx::client c{uri};
auto db1 = c["db1"];
auto db2 = c["db2"];
std::mutex db1_mtx{};
std::mutex db2_mtx{};

auto threadfunc = [](mongocxx::database& db, std::mutex& mtx) {
  mtx.lock();
  db["col"].insert_one({});
  mtx.unlock();
};

// BAD! These two databases are individually synchronized, but they are derived from the same
// client, so they can only be accessed by one thread at a time
std::thread t1([&]() { threadfunc(db1, db1_mtx); threadfunc(db2, db2_mtx); });
std::thread t2([&]() { threadfunc(db2, db2_mtx); threadfunc(db1, db1_mtx); });

t1.join();
t2.join();
```

In the above example, even though the two databases are individually
synchronized, they are derived from the same client. There is shared state
inside the library that is now being modified without synchronization. The
same problem occurs if `db2` is a copy of `db1`.

## A better version

```c++
mongocxx::instance instance{};
mongocxx::uri uri{};
mongocxx::client c1{uri};
mongocxx::client c2{uri};
std::mutex c1_mtx{};
std::mutex c2_mtx{};

auto threadfunc = [](std::string dbname, mongocxx::client& client, std::mutex& mtx) {
  mtx.lock();
  client[dbname]["col"].insert_one({});
  mtx.unlock();
};

// These two clients are individually synchronized, so it is safe to share them between
// threads.
std::thread t1([&]() { threadfunc("db1", c1, c1_mtx); threadfunc("db2", c2, c2_mtx); });
std::thread t2([&]() { threadfunc("db2", c2, c2_mtx); threadfunc("db1", c1, c1_mtx); });

t1.join();
t2.join();
```

## The best version

```c++
mongocxx::instance instance{};
mongocxx::pool pool{mongocxx::uri{}};

auto threadfunc = [](mongocxx::client& client, std::string dbname) {
  auto col = client[dbname]["col"].insert_one({});
};

// Great! Using the pool allows the clients to be synchronized while sharing only one
// background monitoring thread.
std::thread t1 ([&]() {
  auto c = pool.acquire();
  threadfunc(*c, "db1");
  threadfunc(*c, "db2");
});

std::thread t2 ([&]() {
  auto c = pool.acquire();
  threadfunc(*c, "db2");
  threadfunc(*c, "db1");
});

t1.join();
t2.join();
```

In most programs, clients will be long lived - so it is less of a hassle (and
more performant) to make one per-thread. Obviously in this contrived example,
there's quite a bit of overhead because we're doing so little work with each
client - but in a real program this is the best solution.

## Fork safety

Neither a `mongocxx::client` or a `mongocxx::pool` can be safely copied
when forking. Because of this, any client or pool must be created *after*
forking, not before.

repository: mongodb/mongo-cxx-driver

repo_name: mongodb/mongo-cxx-driver


text:
---
title: "glide.i18n.single_currency"
description: "Property"
---

Description: Use a single currency model. Display all currencies in the same currency code, regardless of a user's locale, country, or language code

Value: `false`

repository: ASHISH-SERVICENOW/sn

repo_name: ASHISH-SERVICENOW/sn


text:
---
layout: post
title: From Imaging Biomarkers to Computational Medicine
date: 2018-10-10
comments: true
tags: imaging biomarkers, machine learning, computational medicine, MMIV
---

Talk at the Faculty Lunch, Department of Biomedicine, University of Bergen.
See the presentation [PPTX](https://drive.google.com/file/d/1dN33zC8E6aFWpngA9JCaWdkT__KU2ZDY/view?usp=sharing)
![Faculty_lunch_20181010_imaging_biomarkers](http://arvidl.github.io/images/2018-10-10-faculty-lunch-imaging-biomarkers.png "Faculty Lunch 2018-10-10 - From Imaging Biomarkers to Computational Medicine")

“When you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it,
when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind: it may be the beginning of knowledge,
but you have scarcely, in your thoughts, advanced to the stage of science, whatever the matter may be.” - Lord Kelvin, 1883


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Summary
- [0.0.2 (unreleased)](#002---unreleased)
- [0.0.1](#001---2019-03-25)

## [0.0.2] - (unreleased)
### Removed
- `src/scripts/pages/NotFound.tsx`.

## [0.0.1] - 2019-03-25
- Initial commit.

repository: ttous/basic-front-app

repo_name: ttous/basic-front-app


text:
Looking at the events on the pods you see "permission denied" errors related to terminating the docker containers.

Fix:

The following commands seem to unblock the current pods and allow you to delete pods in the future.
```
sudo systemctl disable apparmor.service --now
sudo service apparmor teardown
sudo systemctl restart apparmor
```

repository: accanto-systems/lm-allinone

repo_name: accanto-systems/lm-allinone


text:
# bash-menu

Introduction
Philosophy / Workflow
Getting the source
Optional installation locations
Help in bash-menu
Using bash-menu
Sub-commands
Editing
Using the _title_ command
Scripting
Examples

## Introduction
**dynamide** [bash-menu](http://dynamide.org/bash-menu) is a menu system for bash which keeps lists of
- directories you wish to navigate to
- command lines you wish to execute
- spaces, which group directories and commands by project

Here's a screenshot showing launching the directory menu, then switching to the command menu:

You use the menu to select from these lists.  Selecting a directory from a menu changes to that directory.  Selecting a command from a command menu executes that command.  You can use the menu or the command line to add to, remove from, and edit these lists.

A fancy bash-prompt is also provided, which gives you options to display on one line the title, user, host, pwd, and git-status.  See [Using the *title* command](#using-the-title-command).

After you install **bash-menu** and log in, you'll have a custom prompt, and some new commands:
-   **d**        directory changer
-   **da**       add a directory to the list
-   **m**        menu of executable command-lines
-   **ma**        add a command to the list
-   **catall**   cat all text files in current directory with a colored line between each.
-   **title**    set the title, user, or hostname in a multi-line, colored PS1 bash prompt.

## Philosophy / Workflow

#### Why do you want a bash menu?
- You are a whiz at `history`, tab-completion, expansion, reverse-search... but you still have to ask: what am I doing here, how did I get here, and what do I do next?
- you work on several projects, and having them all together in one history list doesn't help
- you work in multiple terminals simultaneously, and synchronizing the histories doesn't help
- you prefer command-line tools for their configurable options, but so many options to remember!
- you hate typing long paths or aliasing everything
- you run multiple, complicated command lines repeatedly, but they aren't quite ready for putting into scripts yet.

#### Prototyping Workflow

**Scenario 1**
Execute command-by-command at the command-line, until you get one that does just what you want it to do.
Add that last command by executing `ma` which grabs the last item from your history and adds it to the command menu.

**Scenario 2**
You have completed a prototyping session locally, and would like to write a script to capture all the steps you did.
  To use your history, you need to know which directory you were in.  If you `cd` or `pushd` incrementally, your history is not much help here.  If you use **bash-menu** to store the path and the command together, you have a re-useable item that is quicker to create than a script, but more reliable than using `history`.

```
cd ~/bin
dir
cd tomcat7.dm
dir
cd conf
vi server.xml
cd ..
bin/startup.sh
ma -cd
```

Now when you type `m` you'll see something like this item at the bottom of your command menu:

    7: cd /Users/laramie/bin/tomcat7.dm ; bin/startup.sh

How did that work?  Well, the `ma` command has a built-in option `-cd` to add the `cd ...;` for you.  It automatically uses the last item on your history if you specify nothing. It is effectively doing this (which you can also type in if you want):

```
ma cd `pwd` \; !!
```

Now, any time you want to start tomcat, just do

```
m 7
```

#### Polyglot Workflow

Set up each project with scripts and buildfiles in the appropriate directories.  Mark these scripts and directories using **bash-menu** in one *space*, using menu separators to group commands by area.  The menus serve to remind you where the key build directories are, and the commands you'll need once you are there.

#### Contractor Workflow

You work on multiple projects, and have many command-lines, scripts, directories, and builds to remember.  Store each project under a `space`, and switch between spaces using **bash-menu**. the command `d s` brings up the space menu from the command-line, and from a **bash-menu** directory or command menu prompt, you can just type `s`.  When you change spaces, your directory list and your command menu change.  When you are in another terminal or another project, just navigate to the space you want.

## Getting the source

On [GitHub](https://github.com/dynamide/bash-menu), mash on the "Download ZIP" button, and extract to `~/.bash-menu`, or use wget or curl:

     cd ~
     curl -o master.zip  https://codeload.github.com/dynamide/bash-menu/zip/master
     unzip master.zip
     mv bash-menu-master/ ~/.bash-menu/

Or, checkout **bash-menu** from GitHub:

     cd ~
     git clone https://github.com/dynamide/bash-menu.git .bash-menu

or

     cd ~
     git clone git@github.com:dynamide/bash-menu.git .bash-menu

Then pull in the **bash-menu** from your bash profile, by sourcing in the bash menu, e.g.

| _~/.bash_profile_  |
| :------------- |
| source ~/.bash-menu/.bash_profile |

You can source with  `.` or `source`.

All of the shell aliases created by bash-menu are defined in `~/.bash-menu/aliases` (or `$DYNAMIDE_MENU/aliases`).  Please review these aliases before launching.

The next time you log in, you'll have a custom prompt, and some new commands. Try the main command `d` for example.

Here is a sample bash prompt on two lines with current working directory, and git status:

## Optional Installation Locations

By default, the above check-out will leave you with a new, hidden directory in your home directory, that is,
```
~/.bash-menu
```

or something like `/home/laramie/.bash-menu/`.  **bash-menu** knows about this because it sets DYNAMIDE_MENU in `~/.bash-menu/.bash_profile`.

| _~/.bash-menu/.bash_profile_  |
| :------------- |
| DYNAMIDE_MENU=~/.bash-menu |
| ... |

If you checked out to some directory other than `~/.bash-menu`, for example `~/.my-menu/` then you need to do two things to connect **bash-menu** to your shell.

1) Edit this file, on the line where it sets DYNAMIDE_MENU (by default it is `DYNAMIDE_MENU=~/.bash-menu`), so that **bash-menu** will know where its home directory is.

| _~/.my-menu/.bash_profile_  |
| :------------- |
| DYNAMIDE_MENU=~/.my-menu |
| ... |

2) Then, in your ~/.bash_profile source in the **bash-menu** control file we just edited:

| _~/.bash_profile_  |
| :------------- |
| source ~/.my-menu/.bash_profile |

## Help in bash-menu
To see help, run with `-h` or `h` which will dump out usage.

`d -h`

To see help on options:

`d h options`

To see all the options and their alternate spellings, see:

`d h aliases`

To see the current configuration, see:

`d h info`

## Using bash-menu

To get started, just type `d` at your new prompt.  From there you can choose a listed item by typing it's number.

Here is the dynamide **bash-menu** being used to change to directory 6 on the menu:

Note that it shows you the directory you chose, "/Users/vcrocla/src/dynamide/build/resource_root", and then a quick "ls" of that directory, then it changes to that directory.  You can tell because the fancy bash prompt has changed and now shows the current working directory as /Users/vcrocla/src/dynamide/build/resource_root, and the git status in that directory is (master) which means we are on git branch "master" with no pending pulls or pushes.

## Sub-commands

From menus such as the directory menu, you can type another menu option.  You can type `?` to see the mini-help of sub-commands at this menu.

You can choose options on the command line, and skip the menus.  You can also choose some options after you have launched **bash-menu** and are sitting in a menu, where you are prompted for a choice.  If you type a number from the list of choices, you will get that choice.  But there are also sub-commands at these menus.  These mirror options available on the command line.  So you could, for example, launch right into your command menu like this:

`d -m`

Or, you could launch the directory menu, then change to the command menu with this sequence:

`d` `Enter` `m` `Enter`

that is, typing `d` at your bash prompt, then the `Enter` key (or `Return` key) then typing `m` at the **choose dir>** prompt, then `Enter` again.

Here is an actual example:

The sub-commands take an option form: `-h`, a single-letter form: `h`, and a word form:  `help`.

Here are all the sub-command options and their equivalents (-c and -s are completely equivalent):

| option  | cmd | cmd | context |
| ------------- | ------------- | ------------- | ------------- |
| -a  | a | add |directory, command|
| -c  | c | connect |directory, command|
| -d  | d | list  |command, space|
| -e  | e  | edit |*|
| -h  | h | help |*|
| -i  | i | info |*|
| -l  | l | list |command, space |
| -m  | m | menu |directory, space|
| -s  | s | space |directory, command|
| -x  | x | delete |directory, command|
| -o  | o | options |help|
| -a  | a | aliases |help|
| -i  | i | info |help|

The _option_ form or the _cmd_ form may be used on the command line, or as sub-commands.

Help takes subcommands `options`, `aliases`, and `info`, or their alternate names listed above.  For example:

```
d h info
```

The `edit` sub-command is context-sensitive, and will launch your EDITOR or VISUAL editor to let you edit the correct menu.

On the command line, using these options could look like these examples below.

This works with the alias `ma` like so:

    ma -cd
    ma -cd bin/make

NOTE: *There is no alias for -cd, so you can* **NOT** *do this without the hyphen on -cd:* ~~d -ma cd /bin/mycommand~~.
In other words:

LEGAL----> `d -ma -cd /bin/mycommand`

ILLEGAL--> `d -ma cd /bin/mycommand`

## Using the *title* command

**bash-menu** comes with a custom PS1 bash prompt.  This prompt can show you:
- title
- user
- host
- pwd
- git-status

To see all the options, type

`title -h`

Here is a sample of what setting various options does to your prompt:

In these examples, my user name is "vcrocla", my host is "SFCAML-G2XFD56", which I override with the fake hostname "myhost".

The title (appears at left of the first line) is any placeholder that reminds you of what this shell was for.  If you use -w, or -window, the title is also sent to the shell window's title bar.

My directory "~/src/tagonomy" is a git repository, and its git status in that directory is (master) which means we are on git branch "master" with no pending pulls or pushes.  My directory "~/src/dynamide" is also a git repository, and also is on branch "master".

You'll also see the numbers of commits ahead/behind if you are not up-to-date. (Thanks to the authors who wrote `git-branch-status`, listed in our NOTICE file.)

Here is what it looks like when you are ahead:

If you type `git status` you'll see why:

Here is what it looks like when you are ahead and behind:

If you type `git status`  (I have it aliased to `st`) you'll see why:

To customize your prompt, call `title` in your ~/.bash_profile *after* you source in ~/.bash-menu/.bash_profile:

| _~/.bash_profile_  |
| :------------- |
| source ~/.bash-menu/.bash_profile |
| source ~/.laramie/.bash_profile |

| _~/.laramie/.bash_profile_  |
| :------------- |
| DYNAMIDE_SPACES_LIST=~/.laramie/spaces.laramie.list |
| title -user -nohost -title Lappy -window |

## Editing

You can edit your menus in two ways:
- 1. using the command-line args or sub-commands in menus, and
- 2. using your console editor such as `vi` or `emacs`.

For case (2), **bash-menu** will launch your EDITOR or VISUAL editor on the appropriate file.  Just edit, then save normally.  Files contain non-blank lines or separators.

| _Sub-commands:_  |Editing Action|
| :------------- | :------------- |
|d x       | launches the delete menu for directory lists|
|d x 3     | deletes directory list item 3|
|d mx      | launches the delete menu for commands|
|d mx 3    | deletes command menu item 3|
|d m x     | launches the delete menu for commands, using submenu|
|d ma      | add to the command menu, using command-line|
|d m a     | add to the command menu, using submenu|
|d e       | launch EDITOR for directory lists|
|d m e     | launch EDITOR for the command menu|
|d s       | launch the space chooser|
|d s e     | launch the space editor|

### Separators

Separators are three hyphens alone on one line, like this:
```
/some/directory/on/dirlist
---
/bin/probe
---
/other/dirs
/other/dirs/bin
```
Separators display in your menus as blank lines.  So the above menu renders as:

You can also put line-separating labels in, which will be displayed in your menu in highlight color, minus the leading `---`.  You can use more `-` characters on that line, or any other printable character.  Here I'm using `=` characters to help visually break up the menu.
```
/some/directory/on/dirlist
---=== Area 51 ===
/bin/probe
---=== Area 52 ===
/other/dirs
/other/dirs/bin
```

##Scripting

In case you want to use **bash-menu** in a script itself, you'll want to use the quiet option: `-q` which suppresses all but the most essential output.  The opposite is `-v` which gives debugging info.

To keep things simple, you may wish to avoid aliases in your scripts and use the full names of things, e.g. instead of calling `d`, call `bash-menu-d` which is the name of the main bash function that `d` is aliased to.

Remember that all `d` and `m` commands are relative to the current *space*, so you should change to your space first, or set it using DYNAMIDE_SPACES_LIST. You can programmatically set your space, e.g. by calling `d s 0` to select space `0` or `d s 1` to select space `1`.  (NOTE: $DYNAMIDE_MENU/space.index is written out for you.  However, you can overwrite it with the zero-based index of the space you want to use in DYNAMIDE_SPACES_LIST.  Usually, `d s 0` is the preferred way.)

After you call to set the space, e.g. `d s 0`, the following values are exported to your shell:
```
DYNAMIDE_DIRLIST_LIST
DYNAMIDE_MENU_LIST
DYNAMIDE_MENU_SPACE_INDEX
```

Here is how to set the env var to point to a specific space list, e.g.
`DYNAMIDE_SPACES_LIST=~/.laramie/spaces.laramie.list`

Here is how to programmatically get the menu line for an item in a file:

```
line=`bash-menu-getFromList $DYNAMIDE_SPACES_LIST $DYNAMIDE_MENU_SPACE_INDEX`
```

will output:
```
[1]: /Users/vcrocla/.laramie/spaces/pearson
```

Here is how to programmatically get the bare menu line for an item in a file without the index being displayed:

```
line=`bash-menu-getFromList $DYNAMIDE_SPACES_LIST $DYNAMIDE_MENU_SPACE_INDEX bare`
```

This technique can be used to read a line from any of the files: directories.list, menu.list, spaces.list, by passing the list name, and the zero-based index of non-separator lines.  (Blank lines are not allowed in the list files.)  For example, get the 3rd item (index 2) from your directory list:

```
line=`bash-menu-getFromList $DYNAMIDE_DIRLIST_LIST 2 bare`
```

For example, get the 4th item (index 3) from your menu list:

```
line=`bash-menu-getFromList $DYNAMIDE_MENU_LIST 3 bare`
```

##Examples

###Show your directory menu

    d

###Show your command menu

    m

###put shell history item 467 (expanded) into your menu

    d -ma !467

###put a command into your menu using the alias `ma` (installed in ~/.bash-menu/aliases)

    ma find . -iname '*my-file.*'

###chose menu item 2 and execute it

    d -m 2

###chose menu item 2 and execute it

    m 2
###put a separator into your menu using the special string ---

    ma ---

###put a separating label into your menu using the special string ---

    ma ---Build RestReplay

Everything after the `---` is treated as the label.  Note that you don't need quotes around "Build RestReplay" because the ma command just grabs everything: `---Build RestReplay` is put into your menu on a line by itself.

  *Use separating labels help to organize and document groups in one list.  Consider using the space feature, with the `d s` command, for working on other servers, or organizing by projects.*

###Add ~/zanzibar (expanded) to your directory list

    d -a ~/zanzibar

###Add ~/zanzibar (NOT expanded) to your directory list

    d -a '~/zanzibar'

###Add $JAVA_HOME (NOT expanded) to your directory list

    d -a '$JAVA_HOME'

###Add $JAVA_HOME (expanded) to your directory list

    d -a $JAVA_HOME

###Choose directory 2 from your directory list

    d 2

###Add . (expanded using \`pwd\`) to your directory list

    d -a .

###Add `foo` in current directory (expanded using `pwd`/foo) to your directory list

    d -a foo

###Add /var/log (full path, unexpanded) to your directory list

    d -a /var/log

###Add a frequently used Maven (mvn) command to the menu and use the menu to run it.

The command is `mvn -DskipTests -o install`  and we are adding the whole thing using the `ma` command.

`mvn` is a popular build tool.  You can see where it begins to run with the line "[INFO] Scanning for projects...

###Re-run that command without looking at the menu, now that you know the number

*You could also run the command in your shell, then use the `ma` command to capture the command to your command list in your current space.  The ma command will take a command-line as its arguments.    Note that you need to read the output of the ma command to see the index of the new command, in this case, the number `4`.*

```
mvn -DskipTests -o install
ma
m 4
```

repository: MichealBenzel/bash-menu

repo_name: MichealBenzel/bash-menu


text:
# The Kubernetes package manager

## Learning goal

- Try the Helm cli to spin up a chart

## Introduction

[Enter Helm](https://github.com/helm/helm) - the
answer to how to package multi-container
applications, and how to easily install packages
on Kubernetes.

Helm helps you to:

- Achieve a simple (one command) and repeatable
  deployment
- Manage application dependency, using specific
  versions of other application and services
- Manage multiple deployment configurations: test,
  staging, production and others
- Execute post/pre deployment jobs during
  application deployment
- Update/rollback and test application deployments

## Using Helm charts

Helm uses a packaging format called charts. A
Chart is a collection of files that describe k8s
resources.

Charts can be simple, describing something like a
standalone web server but they can also be more
complex, for example, a chart that represents a
full web application stack included web servers,
databases, proxies, etc.

Instead of installing k8s resources manually via
kubectl, we can use Helm to install pre-defined
Charts faster, with less chance of typos or other
operator errors.

When you install Helm, it does not have a
connection to any default repositories. This is
because Helm wants to decouple the application to
the repository in use.

One of the largest Chart Repositories is the
[BitNami Chart Repository](https://charts.bitnami.com),
which we will be using in these exercises.

Helm chart repositories are very dynamic due to
updates and new additions. To keep Helm's local
list updated with all these changes, we need to
occasionally run the
[repository update](https://helm.sh/docs/helm/helm_repo_update/)
command.

## Exercise

### Overview

- Add a chart repository to your Helm cli
- Install Nginx chart
- Access the Nginx load balanced service
- Look at the status of the deployment with
  `helm ls`
- Clean up the chart deployment

### Step by step

<details>
      <summary>More details</summary>

**Add a chart repository to your Helm cli**

To install the Bitnami Helm Repo and update Helm's
local list of Charts, run:

- `helm repo add bitnami https://charts.bitnami.com/bitnami`
- `helm repo update`

**Install Nginx Chart**

We use the Nginx chart because it is fast and easy to install, and allows us to access the Nginx webserver from our browser to verify that it was deployed.

- `helm install my-release bitnami/nginx`

This command creates a release called `my-release`
with the bitnami/nginx chart.

The command will output information about your
newly deployed mysql setup similar to this:

```
NAME: my-release
LAST DEPLOYED: Tue Apr 20 12:46:10 2021
NAMESPACE: user1
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **

NGINX can be accessed through the following DNS name from within your cluster:

    my-release-nginx.user1.svc.cluster.local (port 80)

To access NGINX from outside the cluster, follow the steps below:

1. Get the NGINX URL by running these commands:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace user1 -w my-release-nginx'

    export SERVICE_PORT=$(kubectl get --namespace user1 -o jsonpath="{.spec.ports[0].port}" services my-release-nginx)
    export SERVICE_IP=$(kubectl get svc --namespace user1 my-release-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
    echo "http://${SERVICE_IP}:${SERVICE_PORT}"
```

**Access the Nginx load balanced service**

Get the external IP and port with the following
three commands.
> :bulb: You must change `user1` in the below commands to your namespace.
> You can find your namespace with the command `kubectl config view | grep namespace`.

- `export SERVICE_PORT=$(kubectl get --namespace user1 -o jsonpath="{.spec.ports[0].port}" services my-release-nginx)`
- `export SERVICE_IP=$(kubectl get svc --namespace user1 my-release-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}')`
- `echo "http://${SERVICE_IP}:${SERVICE_PORT}"`
- Navigate your browser to the url printed out by
  the last command

**Look at the status of the deployment with `helm`
and `kubectl`**

Running `helm ls` will show all current
deployments.

- Run `helm ls` and observe that you have a
  release named `my-release`
- Run `kubectl get pods,deployments,svc` and look
  at a few of the kubernetes objects the release
  created.

> :bulb: As said before Helm deals with the
> concept of
> [charts](https://github.com/kubernetes/charts)
> for its deployment logic. bitnami/nginx was a
> chart,
> [found here](https://github.com/bitnami/charts/tree/master/bitnami/nginx)
> that describes how helm should deploy it. It
> interpolates values into the deployment, which
> for nginx looks
> [like this](https://github.com/bitnami/charts/blob/master/bitnami/nginx/templates/deployment.yaml).
> The charts describe which values can be given
> for overwriting default behavior, and there is
> an active community around it.

**Clean up the chart deployment**

To remove the `my-release` release run:

- `helm uninstall my-release`

</details>


text:
---
layout: post
title: Ambari MPack
date: 2018-08-22 16:29 +0800
---

## 参考
> * [https://cwiki.apache.org/confluence/display/AMBARI/Overview](https://cwiki.apache.org/confluence/display/AMBARI/Overview)
> * [https://community.hortonworks.com/content/supportkb/178553/more-than-one-mpack-installed-for-the-same-service.html](https://community.hortonworks.com/content/supportkb/178553/more-than-one-mpack-installed-for-the-same-service.html)
> * [https://www.ibm.com/developerworks/cn/opensource/os-cn-bigdata-ambari2/](https://www.ibm.com/developerworks/cn/opensource/os-cn-bigdata-ambari2/)


text:
## v0.1.0
- Added `hide` option to hide specific UI elements.
- Removed `hide_icon`, use new `hide` option (**Breaking change**)
- Fixed issue causing errors if all available history entries had the exact same state
- Updated dependencies

## v0.0.9
- Added `decimals` option to display specified amount of decimals for the current state #18
- Fixed issue where `line_value_above` and `line_value_below` would not work when set to `0` #13

## v0.0.8
- Major rework of the graph calculation, now taking moving average and timestamps into account
- Added bundle version
- Added `detail` option, to specify the detail level of the graph
- Added `labels` option to display min/max labels
- Removed `accuracy` option in favor for `detail`
- Changed the reported size of the card

## v0.0.7
- Improved responsive design
- Fixed overflow issue when stacking several cards in horizontal-stack #11
- Fixed default font-size when not specified in config

## v0.0.6
- Improved handling of unknown/unavailable history entries #8
- Fixed issue where `<path>` error would appear in some scenarios
- Refactored code responsible for building the line graph #9

## v0.0.5
- Added `hide_icon` option #5
- Fixed issue where unknown/unavailable history would make the graph not render #6
- Fixed issue where graph line would rendering outside svg boundary and get clipped
- Made graph line ends rounded
- Adjusted line Y-scale
- Updated to lit-element 0.6.2

## v0.0.4
- Added options to have the line change color if the state is above/below specified values
- Fixed graph when setting accuracy option to a higher value than the available data points in history

## v0.0.3
- Added option `font_size` to modify the font size scale of the state #4
- Fixed `<path> attribute d: Expected number` errors.
- Decreased the default font size slightly #4
- Changed default graph height from 150 to 100;
- Improved compatibility with other custom cards like vertical-card-stack #3

## v0.0.2
- Added option to set hours to show

## v0.0.1
- Initial release

repository: derstrassi/hass-config

repo_name: derstrassi/hass-config


text:
Checks Commands
===============

Get latest docs via: `./sens8 -check-commands`

### `deployment_status`

**Resources**: deployment

Checks deployment pod levels via status obj given by Kubernetes. Provides full deployment status object in result output
Example: `deployment_status -w 0.8 -c 0.6`

```
  -c, --crit value                      Percent of healthy pods to alert critical at (default 0.8)
  -m, --min-configured-replicas value   Alert if a deployment gets configured with a replica count below X. Often users 'suspend' a service by setting 'replicas: 0'. Intended as a simple safeguard
  -w, --warn value                      Percent of healthy pods to warn at (default 0.9)

```

### `hs_healthcheck`

**Resources**: pod, service

Make an http request to the pod or service and check the status returned in the following format: https://hootsuite.github.io/health-checks-api/#status-aggregate-get.
Example: `hs_healthcheck url=http://:::POD_IP::::8080/status/dependencies`

```
  -u, --url string   url to query. :::POD_IP::: gets replace with the pod's IP. :::HOST_IP::: gets replaced with the pod's host ip. :::CUSTER_IP::: gets replaced by the service's ip

```


text:
# Proposing and submitting a new operator or function to ONNX

Operators are the basic building blocks that define ONNX model. With a rich set of operators, ONNX can describe most DNN and ML models from various frameworks. Functions allow for composing complex operators from more primitive operators. The ONNX specification includes a core set of operators that enable many models. It is a non-goal to add all possible operators, however more operators are added as needed to cover evolving needs.

In this document, we describe the process of accepting a new proposed operator and how to properly submit a new operator as part of ONNX standard. The goal is to improve on what we currently have based on our experience, learning and feedbacks we gathered from the community.

## 4 steps to add an operator
1. Decide what to propose
2. Submit PR for new operator/function
3. Review of PR by Operators SIG
4. Merging of PR and inclusion in next ONNX release

## Step 1: Proposing a new operator/function
In order to propose a new operator/function, the following is needed:
1. If the operator can be composed by other ONNX operators, then it should be a function and not an operator (we have a function in ONNX : MeanVarianceNormalization).
2. If the operators can be split to new primitives, propose those primitives instead and make the operator a function.
3. Based on a model. This will help us understand the usage and that it solves an actual problem. For the case of the model being private or IP and can't be shared, the operator doesn't belong to the standard and should be implemented as custom OP.
4. The operator needs to be implemented by at-least one (well-known) framework. This help us to understand the actual behavior of the operator and its usage.
5. Operator signature and behavior:
    1. If the operator is available in numpy, prefer numpy semantics.
    2. If the operator is available in more than one frameworks, make sure that your design is general and cover those frameworks.
6. Prefer attributes over inputs.

## Step 2: Submit PR
Once the criteria of proposing new operator/function has been satisfied, you will need to submit a PR for the new operator/function. Here the expectation of what the PR should include. The reviewer is expected to verify the completeness of the PR before signoff.
1. Description:
    1. Write a detailed description about the operator, and its expected behavior. Pretty much, the description should be clear enough to avoid confusion between implementors.
    2. Add an example in the description to illustrate the usage.
    3. Add reference to the source of the operator in the corresponding framework in the description (if possible).
    4. Write the mathematic formula or a pseudocode in the description. The core algorithm needs to be very clear.
2. Write a reference implementation in Python, this reference implementation should cover all the expected behavior of the operator. Only in extremely rare case, we will waive this requirement.
3. Operator version: check out our
[versioning doc](https://github.com/fdwr/onnx/blob/master/docs/Versioning.md#operator-versioning)
4. Write unit test, that cover main usage and corner cases.
    1. The testing examples will be extracted to the doc.
    2. We also generate binary data for it.
    3. Example: https://github.com/onnx/onnx/blob/master/onnx/backend/test/case/node/abs.py
5. Update the documentation and generate the test data.
    1. Running [the script](https://github.com/onnx/onnx/blob/master/tools/update_doc.sh)
to update the doc and generate the test data.
6. Shape Inference function
    1. Please provide a shape inference function in cases where it is meaningful and applicable.
    2. In cases where shape inference is not possible, it must have logic to perform
rank inference at the very least (adding right amount of dimensions to the output shape)
    3. Shape inference functions must be accompanied by unit tests (https://github.com/onnx/onnx/blob/master/onnx/test/shape_inference_test.py).
    4. You can refer to the shape inference function for the `TopK` operator while implementing your own function (https://github.com/onnx/onnx/blob/master/onnx/defs/math/defs.cc#L943)

### Example to Follow
[PR 1959](https://github.com/onnx/onnx/pull/1959) is a good example to follow.

## Step 3: PR Review by Operators SIG
The [Operators SIG](https://github.com/onnx/sigs/tree/master/operators) is responsible for the operators/functions in the ONNX specification. The SIG regularly meets and reviews PRs.

### Sign-off
At least two sign-off from the Operators SIG [contributors](https://github.com/onnx/onnx/tree/master/community#community-roles).

## Step 4: ONNX release
Once the PR is reviewed and signed off by the Operators SIG, it will be merged. Your new operator/function will be part of the master branch and available to anyone building from source. These are not official releases. ONNX periodically releases official new versions that are a snapshot of the master branch. Your new operator/function will be part of that release.

repository: EricKani/onnx

repo_name: EricKani/onnx


text:
# Cluster Network Addons Operator

This operator can be used to deploy additional networking components on top of
Kubernetes cluster.

# Configuration

Configuration of desired network addons is done using `NetworkAddonsConfig` object:

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  multus: {}
  multusDynamicNetworks: {}
  linuxBridge: {}
  kubeMacPool: {}
  ovs: {}
  macvtap: {}
  kubeSecondaryDNS: {}
  imagePullPolicy: Always
```

## Multus

The operator allows administrator to deploy multi-network
[Multus plugin](https://github.com/intel/multus-cni). It is done using `multus`
attribute.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  multus: {}
```

Additionally, container image used to deliver this plugin can be set using
`MULTUS_IMAGE` environment variable in operator deployment manifest.

## Multus Dynamic Networks Controller

[This controller](https://github.com/k8snetworkplumbingwg/multus-dynamic-networks-controller)
allows hot-plug and hot-unplug of additional Pod intefaces. It is done using
`multusDynamicNetworks` attribute.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  multus: {}
  multusDynamicNetworks: {}
```

Additionally, container image used to deliver this plugin can be set using
`MULTUS_DYNAMIC_NETWORKS_CONTROLLER_IMAGE` environment variable in operator
deployment manifest.

## Linux Bridge

The operator allows administrator to deploy [Linux Bridge CNI plugin](https://github.com/containernetworking/plugins/tree/master/plugins/main/bridge)
simply by adding `linuxBridge` attribute to `NetworkAddonsConfig`.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  linuxBridge: {}
```

Additionally, container image used to deliver this plugin can be set using
`LINUX_BRIDGE_IMAGE` environment variable in operator deployment manifest.

The bridge marker image used to deliver a bridge marker detecting the availability
of linux bridges on nodes can be set using the `LINUX_BRIDGE_MARKER_IMAGE` environment
variable in operator deployment manifest.

### Configure bridge on node

Following snippets can be used to configure linux bridge on your node.

```shell
# create the bridge using NetworkManager
nmcli con add type bridge ifname br10

# allow traffic to go through the bridge between pods
iptables -I FORWARD 1 -i br10 -j ACCEPT
```

## Kubemacpool
The operator allows administrator to deploy the [Kubemacpool](https://github.com/K8sNetworkPlumbingWG/kubemacpool).
This project allow to allocate mac addresses from a pool to secondary interfaces using
[Network Plumbing Working Group de-facto standard](https://github.com/K8sNetworkPlumbingWG/multi-net-spec).

**Note:** Administrator can specify a requested range, if the range is not
requested a random range will be provided. This random range spans from
`02:XX:XX:00:00:00` to `02:XX:XX:FF:FF:FF`, where `02` makes the address local
unicast and `XX:XX` is a random prefix.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  kubeMacPool:
   rangeStart: "02:00:00:00:00:00"
   rangeEnd: "FD:FF:FF:FF:FF:FF"
```

## Open vSwitch

The operator allows administrator to deploy [OVS CNI plugin](https://github.com/kubevirt/ovs-cni/)
simply by adding `ovs` attribute to `NetworkAddonsConfig`. Please note that
in order to use this plugin, openvswitch have to be up and running at nodes.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  ovs: {}
```

## NMState

**Note:** The cluster-network-addons-operator is no longer installing
kubernetes-nmstate, refer to its own operator [release notes](https://github.com/nmstate/kubernetes-nmstate/releases) to install it.

## Macvtap

**Note:** This feature is **experimental**. Macvtap-cni is unstable and its API
may change.

The operator allows the administrator to deploy the
[macvtap CNI plugin](https://github.com/kubevirt/macvtap-cni/), simply by
adding `macvtap` attribute to `NetworkAddonsConfig`.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  macvtap: {}
```

Macvtap-cni must be explicitly configured by the administrator, indicating the
interfaces on top of which logical networks can be created.

A simple example on how to do so, the user must deploy a `ConfigMap`, such as in [this example](https://github.com/kubevirt/macvtap-cni/blob/main/examples/macvtap-deviceplugin-config-explicit.yaml).

Currently, this configuration is not dynamic.

## KubeSecondaryDNS

[This controller](https://github.com/kubevirt/kubesecondarydns)
allows to support FQDN for VMI's secondary networks.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  kubeSecondaryDNS:
    DOMAIN: ""
    NAME_SERVER_IP: ""
```

Additionally, container image used to deliver this plugin can be set using
`KUBE_SECONDARY_DNS_IMAGE` environment variable in operator
deployment manifest.

## Image Pull Policy

Administrator can specify [image pull policy](https://kubernetes.io/docs/concepts/containers/images/)
for deployed components. Default is `IfNotPresent`.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  imagePullPolicy: Always
```

## Self Signed Certificates Configuration

Administrator can specify [webhook self signed certificates configuration](https://pkg.go.dev/github.com/qinqon/kube-admission-webhook@v0.13.0/pkg/certificate?tab=doc#Options)
for deployed components. Default is `caRotateInterval: 168h`, `caOverlapInterval: 24h`, `certRotateInterval: 24h`, `certOverlapInterval: 8h`

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  selfSignConfiguration:
    caRotateInterval: 168h
    caOverlapInterval: 24h
    certRotateInterval: 24h
    certOverlapInterval: 8h
```
The selfSignConfiguration parameters has to be all or none set, setting some of
them fails at validation. They have to conform to golang time.Duration
string format. Additionally the following checks are done at validation:
- caRotateInterval >= caOverlapInterval && caRotateInterval >= certRotateInterval && certRotateInterval >= certOverlapInterval

This parameters are consumed by Kubemacpool component.

## Placement Configuration

CNAO deploys two component categories: infra and workload. Workload components manage node configuration
and need to be scheduled on the nodes where actual user workload is scheduled.
Infra components provide cluster-wide service and do not need to be running on the same nodes as user workload.

Administrator can specify placement preferences for deployed infra and workload components
by defining [affinity, nodeSelector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)
and [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/).

By default, infra components are scheduled on control-plane nodes and workload components are scheduled on all nodes.
To adjust this behaviour, provide custom `placementConfiguration` to the `NetworkAddonsConfig`.

In the following example, `nodeAffinity` is used to schedule infra components to control-plane nodes and `nodeSelector`
to schedule workloads on worker nodes.
Note that worker nodes need to be labeled with `node-role.kubernetes.io/worker` label.

```yaml
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  name: cluster
spec:
  placementConfiguration:
    infra:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/control-plane
                operator: Exists
    workloads:
      nodeSelector:
        node-role.kubernetes.io/worker: ""
```

# Deployment

First install the operator itself:

```shell
kubectl apply -f https://github.com/kubevirt/cluster-network-addons-operator/releases/download/v0.89.0/namespace.yaml
kubectl apply -f https://github.com/kubevirt/cluster-network-addons-operator/releases/download/v0.89.0/network-addons-config.crd.yaml
kubectl apply -f https://github.com/kubevirt/cluster-network-addons-operator/releases/download/v0.89.0/operator.yaml
```

Then you need to create a configuration for the operator [example
CR](manifests/cluster-network-addons/0.4.0/network-addons-config-example.cr.yaml):

```shell
kubectl apply -f https://github.com/kubevirt/cluster-network-addons-operator/releases/download/v0.89.0/network-addons-config-example.cr.yaml
```

Finally you can wait for the operator to finish deployment:

```shell
kubectl wait networkaddonsconfig cluster --for condition=Available
```

In case something failed, you can find the error in the NetworkAddonsConfig Status field:

```shell
kubectl get networkaddonsconfig cluster -o yaml
```
You can follow the deployment state through events produced in the default namespace:

```shell
kubectl get events
```
Events will be produced whenever the deployment is applied, configured or failed. The expected events are:

|Event type   | Reason                                                            |
|-------------|-------------------------------------------------------------------|
|Progressing  | When operator had started deploying the components                |
|Failed       | When one or more components failed to deploy                      |
|Available    | When all components finished to deploy                            |
|Modified     | When the configuration was modified or applied for the first time |

For more information about the configuration format check [configuring section](#configuration).

# Upgrades

Starting with version `0.65.0`, this operator supports upgrades to any newer
version. If you wish to upgrade, remove old operator (`operator.yaml`) and
install new, operands will remain available during the operator's downtime.

# Development

Make sure you have either Docker >= 17.05 / podman >= 3.1 installed.

```shell
# run code validation and unit tests
make check

# perform auto-formatting on the source code (if not done by your IDE)
make fmt

# generate source code for API
make gen-k8s

# build images (uses multi-stage builds and therefore requires Docker >= 17.05 / podman >= 3.1)
make docker-build

# or build only a specific image
make docker-build-operator
make docker-build-registry

# bring up a local cluster with Kubernetes
make cluster-up

# bridge up a local cluster with kubernetes 1.25
export KUBEVIRT_PROVIDER=k8s-1.25
make cluster-up

# build images and push them to the local cluster
make cluster-operator-push

# install operator on the local cluster
make cluster-operator-install

# run workflow e2e tests on the cluster, requires cluster with installed operator,
# workflow covers deployment of operands
make test/e2e/workflow

# run lifecycle e2e tests on the cluster, requires cluster without operator installed,
# lifecycle covers deployment of operator itself and its upgrades
make test/e2e/lifecycle

# access kubernetes API on the cluster
./cluster/kubectl.sh get nodes

# ssh into the cluster's node
./cluster/cli.sh ssh node01

# clean up all resources created by the operator from the cluster
make cluster-clean

# delete the cluster
make cluster-down
```

For developing at an external cluster:

```bash
export KUBEVIRT_PROVIDER=external

export KUBECONFIG=[path to external's cluster kubeconfig]

# This is the registry used to push and pull the dev image
# it has to be accessible by the external cluster
export DEV_IMAGE_REGISTRY=quay.io/$USER

# Then is possible to follow normal dev flow

make cluster-operator-push
make cluster-operator-install
make test/e2e/workflow
make test/e2e/lifecycle
```

# Releasing

1. Checkout a public branch
2. Call `make prepare-patch|minor|major` and prepare release notes
3. Open a new PR
4. Once the PR is merged, create a new release in GitHub and attach new manifests

gha_language: Go


text:
# teslacam
Tesla Camera

This is a very simple python 3 script to help me consolidate my Tesla's raw camera data into nicely formatted videos.  It tries to maintain the same resolution as the original with the same video quality by default.

This also makes use of nvidia video card GPUs to accelerate encoding.

Installation:

Download FFMpeg here:
https://ffmpeg.org/download.html

Run:
```
python -m pip install teslacam
```
Command line usage
```
python -m teslacam --help
```
```
usage: teslacam [-h] [--codec {hevc_nvenc,libx265}] [--preset PRESET] [--reduce REDUCE] [--layout {pyramid,tall_diamond,short_diamond,cross}] [--keep_temp_folder KEEP_TEMP_FOLDER] [--log_level {debug,info,warning,error,critical,none}]
                ffprobe_file_path ffmpeg_file_path input_folder_path output_folder_path

positional arguments:
  ffprobe_file_path     Path to the ffprobe binary
  ffmpeg_file_path      Path to the ffmpeg binary
  input_folder_path     Path to the video folder containing timestamped folders
  output_folder_path    Path to the output folder containing both merged files and the temporary work folder

optional arguments:
  -h, --help            show this help message and exit
  --codec {hevc_nvenc,libx265}
                        Codec to use for encoding (default: hevc_nvenc)
  --preset PRESET       Codec's preset to use for encoding. See ffmpeg -h long for each codec's available presets (default: slow)
  --reduce REDUCE       Percent to reduce video to (default: 100)
  --layout {pyramid,tall_diamond,short_diamond,cross}
                        Camera layout (default: pyramid)
  --keep_temp_folder KEEP_TEMP_FOLDER
                        Keep temporary working folder after extraction (default: False)
  --log_level {debug,info,warning,error,critical,none}
                        Display log messages that matches or exceeds the severity of the specified level. Use "none" to disable messages (default: info)
```
API Usage
```
import teslacam
from teslacam import *

def main():
  print(f"Available layouts: {', '.join(teslacam.constants.LAYOUT.keys())}")
  print(f'Available codecs: {teslacam.constants.CODEC_OPTIONS.items()}')
  extract_videos(
    FFMpegPaths(
      r'some_ffmpeg_path\ffprobe.exe', # path to ffprobe
      r'some_ffmpeg_path\ffmpeg.exe'   # path to ffmpeg
    ),
    LayoutOptions(
      'hevc_nvenc', # Codec name
      'fast',       # Codec preset
      'pyramid',    # Layout name
      DONT_REDUCE   # Percentage value from 1-100 (or DONT_REDUCE constant)
    ),
    BaseFolderPaths(
      r'g:\TeslaCam\SentryClips',   # Path to your USB stick
      r'c:\users\user\videos\tesla' # Destination path
    ),
    True  # Keep temporary working folder
  )

if __name__ == '__main__':
  main()
```

repository: SillyGoat/teslacam

repo_name: SillyGoat/teslacam


text:
# VABS

This package contains the code which is associated with the following paper:

Pei Xiang, Jiangluqi Song, Hanlin Qin, Wei Tan, Huan Li and Huixin Zhou. "Visual Attention and Background Subtraction with Adaptive Weight for Hyperspectral Anomaly Detection",
IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 14, pp. 2270-2283, 2021, DOI: 10.1109/JSTARS.2021.3052968.

Edited by Pei Xiang, Dec. 27, 2020.

This code is only used for research purposes.

Please refer to the above publication if you use this code.

The demo file is Demo.m

repository: pei-xiang/VABS

repo_name: pei-xiang/VABS